Show right values for Weapons
This commit is contained in:
@@ -95,7 +95,7 @@ func mapAttributes(char *models.Char) AttributeValues {
|
||||
func mapDerivedValues(char *models.Char) DerivedValueSet {
|
||||
// Get attributes for bonus calculations
|
||||
attrs := mapAttributes(char)
|
||||
|
||||
|
||||
return DerivedValueSet{
|
||||
LPMax: char.Lp.Max,
|
||||
LPAktuell: char.Lp.Value,
|
||||
@@ -151,7 +151,7 @@ func mapWeapons(char *models.Char) []WeaponViewModel {
|
||||
if equippedWeapon, exists := equippedWeapons[weaponSkill.Name]; exists {
|
||||
// EW = skill + character attack bonus + weapon attack bonus
|
||||
vm.Value += angriffsBonus + equippedWeapon.Anb
|
||||
|
||||
|
||||
// TODO: Calculate damage including weapon and character bonuses
|
||||
// TODO: Add range information for ranged weapons
|
||||
} else {
|
||||
|
||||
@@ -45,8 +45,8 @@ func TestMapWeapons_WithEWCalculation(t *testing.T) {
|
||||
Name: "Langschwert",
|
||||
},
|
||||
},
|
||||
Anb: 2, // Attack bonus of weapon
|
||||
Schb: 1, // Damage bonus of weapon
|
||||
Anb: 2, // Attack bonus of weapon
|
||||
Schb: 1, // Damage bonus of weapon
|
||||
},
|
||||
{
|
||||
BamortCharTrait: models.BamortCharTrait{
|
||||
@@ -82,7 +82,7 @@ func TestMapWeapons_WithEWCalculation(t *testing.T) {
|
||||
if sword.Name != "Langschwert" {
|
||||
t.Errorf("Expected weapon name 'Langschwert', got '%s'", sword.Name)
|
||||
}
|
||||
|
||||
|
||||
// EW should be: skill(12) + char_attack_bonus + weapon_bonus(2)
|
||||
// Character attack bonus is derived from St/Gw, typically calculated in DerivedValues
|
||||
// For now, we expect at least: 12 + 2 = 14 (we'll enhance with char bonus later)
|
||||
@@ -95,7 +95,7 @@ func TestMapWeapons_WithEWCalculation(t *testing.T) {
|
||||
if bow.Name != "Bogen" {
|
||||
t.Errorf("Expected weapon name 'Bogen', got '%s'", bow.Name)
|
||||
}
|
||||
|
||||
|
||||
if bow.Value < 10 {
|
||||
t.Errorf("Expected bow EW >= 10 (skill 10 + no weapon bonus), got %d", bow.Value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user