commit 0d112e604721f336868587731726480eeccf5253
parent d851cc2af176949c4fd2b30c906587735433860c
Author: anon <anon@example.com>
Date: Thu, 22 Oct 2026 12:14:04 +0000
Apply equipped armor to normal combat damage
Diffstat:
8 files changed, 314 insertions(+), 33 deletions(-)
diff --git a/TODO.md b/TODO.md
@@ -53,9 +53,9 @@ recorded in [inventory behavior](docs/inventory.md).
skill cannot equip it, while a qualifying character can.
- [x] Equip one armor piece. Check: the correct native slot and appearance
update, and its armor stats appear and disappear with equip/unequip.
-- [ ] Apply one equipment stat bonus. Check: a known bonus affects derived stats
+- [x] Apply one equipment stat bonus. Check: a known bonus affects derived stats
exactly once and unequipping restores the baseline.
-- [ ] Combine two equipment bonuses to the same stat. Check: removing either
+- [x] Combine two equipment bonuses to the same stat. Check: removing either
item leaves precisely the other item's contribution.
- [ ] Equip one implant. Check: its slot, treatment/ability requirements and
bonuses work independently of armor and weapon slots.
@@ -66,9 +66,9 @@ recorded in [inventory behavior](docs/inventory.md).
- [ ] Apply overequipping rules to one weapon. Check: dropping below a verified
requirement threshold changes effectiveness at the correct boundary.
-The supported Metaplast pieces, native appearance and AC modifier checks are
-recorded in [armor](docs/armor.md). Server-side damage reduction and broader
-derived-stat bonuses remain separate milestones.
+The supported Metaplast pieces, native appearance, combined AC bonuses and
+server-side damage checks are recorded in [armor](docs/armor.md). These stat
+bonus milestones use AC; broader skill and resource modifiers remain future work.
## Combat calculations
@@ -76,9 +76,9 @@ derived-stat bonuses remain separate milestones.
native outcomes; a miss does not reduce health.
- [ ] Resolve a critical hit. Check: a known weapon and controlled roll produce
the expected critical damage and client feedback.
-- [ ] Apply armor to one damage type. Check: known armor/damage inputs produce
+- [x] Apply armor to one damage type. Check: known armor/damage inputs produce
sourced results, including the minimum-damage boundary.
-- [ ] Select armor by damage type. Check: changing only the attack's damage type
+- [x] Select armor by damage type. Check: changing only the attack's damage type
selects the corresponding protection rather than a universal armor value.
- [ ] Scale one weapon's damage with attack rating. Check: fixed stats and rolls
match documented expected amounts at representative boundaries.
diff --git a/docs/armor.md b/docs/armor.md
@@ -1,6 +1,6 @@
# Metaplast armor in 14.9.1
-The first supported armor pieces are exact QL 1 catalog records. Their native
+The supported armor pieces are exact catalog endpoints. Their native
identity type is 51022. Acquisition remains fixture-controlled, like the first
weapon and corpse items.
@@ -8,11 +8,13 @@ weapon and corpse items.
| --- | --- | --- | --- |
| Worn Metaplast Body Armor | 85686 | 21, chest | `server/gamedata/items/items_005.yaml` |
| Worn Metaplast Armor Boots | 85638 | 30, feet | `server/gamedata/items/items_004.yaml` |
+| High-Quality Metaplast Body Armor, QL 200 | 85685 | 21, chest | `server/gamedata/items/items_005.yaml` |
-Both Wear actions require Strength 16 and Agility 17 strictly greater than 7.
-Both have EquipDelay 211 equal to 10 centiseconds, processed on the existing
-250 ms equipment tick. Their default armor positions are 5 and 14, within the
-armor range starting at 16. The native inventory remains 48..77; armor slots
+The QL 1 Wear actions require Strength 16 and Agility 17 strictly greater than
+7. The QL 200 chest requires Strength greater than 460 and Agility greater
+than 510. All three have EquipDelay 211 equal to 10 centiseconds, processed on
+the existing 250 ms equipment tick. Their default armor positions are 5 and 14,
+within the armor range starting at 16. The native inventory remains 48..77; armor slots
are not shifted by the ordinary-inventory conversion.
The chest's OnWear section (type 2, subtype 14) adds 5 to AC stats 90..93 and
@@ -23,7 +25,7 @@ one tick, interval zero, target 2 and no effect requirements.
The native labels map these totals as follows:
-| Protection | Stat | Chest | Boots | Both |
+| Protection | Stat | QL 1 chest | Boots | Both |
| --- | --- | --- | --- | --- |
| Projectile | 90 | 5 | 1 | 6 |
| Melee | 91 | 5 | 1 | 6 |
@@ -34,6 +36,41 @@ The native labels map these totals as follows:
| Disease | 96 | 1 | 1 | 2 |
| Fire | 97 | 1 | 1 | 2 |
+The QL 200 chest contributes 1000 Projectile, 875 Melee, 1000 Energy,
+750 Chemical and 150 each Radiation, Cold, Disease and Fire AC. Its texture
+is the same 8736/1 pair. Intermediate qualities are not supported.
+
+## Authoritative armor reduction
+
+The server sums the supported equipped items' unconditional OnWear Modify
+effects for the attack's AC stat. This derives the value from current owned
+slots rather than incrementally maintaining another modifier balance. Removing
+either piece leaves the other's contribution; reconnecting cannot apply it twice.
+
+Normal hits now use the weapon's DamageType 436 to select that protection.
+The native selection accepts stats 90..97 and NanoAC 168, with invalid values
+falling back to ProjectileAC; see [client stat findings](combat-client-stats.md).
+The supported pieces have no NanoAC bonus.
+
+The [September 2001 Vampi weapon guide](https://martin.brenner.de/ao/vampiguide/weapeval.html)
+describes damage reduction of AC/10, bounded by the weapon's adjusted minimum.
+The [July 2002 player experiments](https://forums-archive.anarchy-online.com/printthread.php?page=1&pp=20&t=36008)
+corroborate the ratio and minimum floor. These are period observations rather
+than a recovered server implementation. The current normal-hit calculation is:
+
+```text
+raw = uniform_integer(weapon_minimum, weapon_maximum)
+damage = raw - min(raw - weapon_minimum, floor(selected_AC / 10))
+```
+
+Truncating AC/10 before subtraction is provisional: the sources do not settle
+integer ordering for fractional reductions. For example, raw 200 with 1000 AC
+becomes 100, while a QL 1 Leet Bite roll of 4..8 against 875 Melee AC becomes
+4. Tests also record the provisional fractional case, 200 against 875 becoming
+113. Attack-rating scaling, damage additions, hit/critical rolls, NPC armor,
+absorbs, reflects and shields remain separate work. Fists still use the QL 1
+3..5 endpoints; supported weapons retain their catalog endpoints.
+
## Native move and effect messages
Native left-click pickup/place sends ContainerAddItem `0x47537a24` from
@@ -106,9 +143,10 @@ requirements, failed saves, full bags, two-piece removal, native payloads and
restart initialization. Existing weapon and inventory bounds regressions also
cover the extended equipment handler.
-These messages establish equipped ownership, native appearance and native AC
-modifiers. Authoritative damage reduction by AC remains a separate combat
-milestone; the current damage calculation still does not consult armor.
+`server/armor_damage_test.go` checks controlled damage rolls for all eight
+protections, NanoAC and invalid-type fallback, the minimum floor, combined
+bonuses after removal/restart, QL 200 requirements and matching native damage
+packets/HP for two observers.
The two-client Chromium WASM run is retained in `local/armor-smoke/` with
`verification.json`, per-step screenshots/state and packet logs. Native pickup
@@ -123,5 +161,23 @@ The only console failures were 16 expected socket connection refusals during
the intentional restart. Both browser contexts and the test server closed in
the driver's `finally` block.
+The damage comparison is retained separately in `local/armor-damage-smoke/`.
+Its `verification.json` and `tmp_verify.py` check temporary raw-roll tracing,
+ownership, combined AC and persisted inventory; screenshots establish native
+UI and combat feedback. The fixture uses the actual level-1 Leet profile and
+raises the owner's abilities and Body Development to equip the QL 200 chest
+and survive repeated encounters. Fixture-only cancellation and HP restoration
+separate the two fights; equipment and Q combat use native controls.
+
+With chest and boots, five Leet bites with raw values including 4, 7 and 8 all
+dealt 4 damage. With both removed, six bites retained their raw 4..8 values.
+Owner and observer combat logs showed those results. Removing the chest left
+1 AC from the boots; removing both restored zero. Re-equipping and restarting
+restored the same four owned items and 1001 Projectile, 876 Melee and 151
+Radiation AC, also shown in the native Protection window. Both clients restored
+appearance with no page errors or adapter failures. There were 16 expected
+socket refusals during restart. Both browser contexts and the fixture server
+were closed before the regression builds.
+
The full `go test ./server/...` suite passes. Focused race checks for armor,
-equipment, inventory and reclaim also pass.
+combat, equipment, inventory and reclaim also pass.
diff --git a/docs/combat-client-reconstruction.md b/docs/combat-client-reconstruction.md
@@ -79,8 +79,9 @@ unknowns for each area:
| Player max/current health and nano | Native formula, breed/title resources, browser 37/37 | Derived from editable abilities and base Body Development/Nano Pool; Soldier profession |
| Martial Arts selecting fist QL | Period observation; exact native selector not found | Fixed QL 1, not a recovered MA-to-QL selection rule |
| NPC health, damage and weapons | Level-1 Leet weapon data verified; binding and actor stats provisional | Exact-level Leet profile with replicated bite weapon; other NPCs retain prototype values |
-| QL 1 Metaplast chest armor and boots | Shipped wear effects and native packets, owner/observer WASM checks | Persistent equip/unequip, appearance and native AC modifiers; [armor notes](armor.md) |
-| Armor damage reduction, evade/critical rolls and damage modifiers | Client data/handlers do not alone establish authoritative calculation | Not implemented |
+| Metaplast chest armor (QL 1/200) and boots (QL 1) | Shipped wear effects and native packets, owner/observer WASM checks | Persistent equip/unequip, appearance and AC modifiers; [armor notes](armor.md) |
+| Armor damage reduction and damage-type selection | Period AC/10 observations and shipped damage types | Normal hits respect the weapon minimum; fractional integer ordering is provisional; [armor notes](armor.md) |
+| Evade/critical rolls and damage modifiers | Client data/handlers do not alone establish authoritative calculation | Not implemented |
| Range and physical extents | Native formula recovered; instance extent construction needs full reconciliation | Four-meter center-distance approximation |
| Line of sight | Client checks cannot establish original server validation | Not implemented on the server |
| Dual wield, ammunition/reload, specials and nanos | Scheduling, core effect streams and skill-lock contract recovered; full effect semantics remain partial | Not implemented |
diff --git a/docs/combat-rules.md b/docs/combat-rules.md
@@ -37,14 +37,17 @@ and native owner/observer replication are described in
[inventory and equipment](inventory.md). Combat swapping is not implemented.
The server still selects QL 1 regardless of MA skill and omits hit/critical
-rolls and armor. Level-1 Leets use an explicit catalog-weapon profile;
-other NPCs retain 100 health, 5 damage and 1s/1s timing. Profile settings
+rolls. Supported Metaplast armor now reduces normal hits using the weapon's
+damage type and minimum floor; [armor notes](armor.md) distinguish sourced
+rules from provisional integer ordering. Level-1 Leets use an explicit
+catalog-weapon profile; other NPCs retain 100 health, 5 damage and 1s/1s timing. Profile settings
and their verified/provisional status are recorded in [NPC balance](combat-npc-balance.md).
The uniform normal-damage roll is a reconstruction choice; the item establishes
the endpoints, not the historical server's random distribution. The four-meter
range approximates physical extents, and there is no server line-of-sight
-test. Other equipment, nanos, specials, aggression/taunt AI, reclaim, XP and
-player resurrection are not implemented. Fixed corpse loot and the provisional
+test. Other equipment, nanos, specials, aggression/taunt AI and XP awards
+are not implemented. Player resurrection and private reclaim have separate
+documented lifecycle implementations. Fixed corpse loot and the provisional
level-1 Leet [respawn lifecycle](npc-respawn.md) are supported. Reload revival
is a local test convenience.
These limitations prevent a claim of canonical combat balance.
@@ -189,7 +192,7 @@ seconds per 600, with separate one-second floors. An earlier reply gives
conflicting recharge advice; the shipped implementation above resolves it.
Do not label fixed NPC damage, NPC health, always-hit attacks, arbitrary
-critical rolls, missing armor/reflect behavior, resurrection on reload, or
+critical rolls, missing absorb/reflect behavior, resurrection on reload, or
respawn on server restart as canonical. NPC combat profiles, exact hit/crit
rolls, line of sight, player death/reclaim and progression need separate
evidence and implementation.
diff --git a/server/armor_damage_test.go b/server/armor_damage_test.go
@@ -0,0 +1,182 @@
+package main
+
+import (
+ "ao/server/gamedata"
+ "bytes"
+ "encoding/binary"
+ "reflect"
+ "slices"
+ "testing"
+)
+
+func newArmorDamageWorld(t *testing.T) (*server, *combatTestConn) {
+ t.Helper()
+ world, conn := newArmorWorld(t)
+ player := world.characters[1]
+ player.stats.Strength, player.stats.Agility = 461, 511
+ if err := world.saveUser_locked(player); err != nil {
+ t.Fatal(err)
+ }
+ if granted, err := world.grantItem_locked(player, 85685); err != nil || !granted {
+ t.Fatalf("grant QL 200 chest: %v %v", granted, err)
+ }
+ world.handleInventory(world.clients[1], inventoryMovePacket(1, 67, 21)[20:])
+ world.advanceEquipment(world.clients[1].equipment.readyAt)
+ return world, conn
+}
+
+func TestArmorDamageUsesTheAttacksProtectionType(t *testing.T) {
+ for _, attack := range []struct {
+ name string
+ kind uint32
+ damage uint32
+ }{
+ {"projectile", 90, 100}, {"melee", 91, 113}, {"energy", 92, 100},
+ {"chemical", 93, 125}, {"radiation", 94, 185}, {"cold", 95, 185},
+ {"disease", 96, 185}, {"fire", 97, 185}, {"nano", 168, 200}, {"invalid", 0, 100},
+ } {
+ t.Run(attack.name, func(t *testing.T) {
+ world, _ := newArmorDamageWorld(t)
+ original := gamedata.ItemTemplates[120911]
+ weapon := *original
+ weapon.Stats = slices.Clone(original.Stats)
+ for index, stat := range weapon.Stats {
+ if stat[0] == 436 {
+ weapon.Stats[index][1] = attack.kind
+ }
+ }
+ gamedata.ItemTemplates[120911] = &weapon
+ t.Cleanup(func() { gamedata.ItemTemplates[120911] = original })
+ npc := world.characters[1000000]
+ npc.combatProfile = &gamedata.NPCCombatProfile{Weapon: 120911}
+
+ damage := npc.normalDamage(world.characters[1], func(limit uint32) uint32 {
+ if limit != 352 {
+ t.Fatalf("unexpected QL 400 Leet Bite roll bound: %d", limit)
+ }
+ return 145
+ })
+
+ if damage != attack.damage {
+ t.Fatalf("damage type %d: got %d want %d", attack.kind, damage, attack.damage)
+ }
+ })
+ }
+}
+
+func TestArmorDamageCannotCrossWeaponMinimum(t *testing.T) {
+ world, _ := newArmorDamageWorld(t)
+ npc := world.characters[1000000]
+ npc.combatProfile = &gamedata.NPCCombatProfile{Weapon: 120910}
+ var hits []uint32
+
+ for _, roll := range []uint32{0, 1, 2, 3, 4} {
+ hits = append(hits, npc.normalDamage(world.characters[1], func(limit uint32) uint32 {
+ if limit != 5 {
+ t.Fatalf("unexpected QL 1 Leet Bite roll bound: %d", limit)
+ }
+ return roll
+ }))
+ }
+
+ if !reflect.DeepEqual(hits, []uint32{4, 4, 4, 4, 4}) {
+ t.Fatalf("AC reduced weapon minimum: %v", hits)
+ }
+}
+
+func TestArmorDamageBonusesFollowOwnershipAcrossRemovalAndRestart(t *testing.T) {
+ for _, scenario := range []struct {
+ name string
+ slot uint32
+ armor [3]uint32
+ }{
+ {"remove chest", 21, [3]uint32{1, 1, 1}},
+ {"remove boots", 30, [3]uint32{1000, 875, 150}},
+ } {
+ t.Run(scenario.name, func(t *testing.T) {
+ world, _ := newArmorDamageWorld(t)
+ player := world.characters[1]
+ world.handleInventory(world.clients[1], inventoryMovePacket(1, 66, 30)[20:])
+ world.advanceEquipment(world.clients[1].equipment.readyAt)
+ before := [3]uint32{player.armorClass(90), player.armorClass(91), player.armorClass(94)}
+
+ world.handleInventory(world.clients[1], itemMovePacket(1, scenario.slot, 111)[20:])
+ world.advanceEquipment(world.clients[1].equipment.readyAt)
+ world.handleInventory(world.clients[1], itemMovePacket(1, scenario.slot, 111)[20:])
+ restarted := newTestInventoryServer(t).characters[1]
+ after := [3]uint32{restarted.armorClass(90), restarted.armorClass(91), restarted.armorClass(94)}
+
+ if before != [3]uint32{1001, 876, 151} || after != scenario.armor || len(restarted.inventory.Items) != 4 {
+ t.Fatalf("armor contributions were duplicated or lost: before%v after%v items%+v", before, after, restarted.inventory.Items)
+ }
+
+ // Removing the remaining piece restores the unarmored baseline.
+ remaining := uint32(30)
+ if scenario.slot == 30 {
+ remaining = 21
+ }
+ world.handleInventory(world.clients[1], itemMovePacket(1, remaining, 111)[20:])
+ world.advanceEquipment(world.clients[1].equipment.readyAt)
+ if player.armorClass(90) != 0 || player.armorClass(91) != 0 || player.armorClass(94) != 0 {
+ t.Fatalf("unequipping retained armor bonuses: %+v", player.inventory)
+ }
+ })
+ }
+}
+
+func TestArmorDamageNativeCombatMatchesBothObservers(t *testing.T) {
+ world, owner := newArmorDamageWorld(t)
+ player, npc := world.characters[1], world.characters[1000000]
+ player.health = 37
+ npc.combatProfile = &gamedata.NPCCombatProfile{Weapon: 120910}
+ observer := &combatTestConn{}
+ world.characters[2] = &character{id: 2, playfield: 950, health: 100}
+ world.clients[2] = &worldClient{id: 2, conn: observer, target: true, ready: true, npcs: map[uint32]bool{1000000: true}}
+ owner.packets = nil
+
+ world.handleCombat(world.clients[1], attackPacket(1, npc.id)[20:])
+ world.advanceCombat(player.nextAttack)
+ world.advanceCombat(npc.nextAttack)
+ world.advanceCombat(npc.nextAttack)
+ var hits []uint32
+ for index, packet := range owner.packets {
+ if len(observer.packets) <= index || !bytes.Equal(packet[16:], observer.packets[index][16:]) {
+ t.Fatal("observers disagree on armored combat")
+ }
+ if binary.BigEndian.Uint32(packet[16:20]) == 0x46002f16 && binary.BigEndian.Uint32(packet[24:28]) == npc.id {
+ hits = append(hits, binary.BigEndian.Uint32(packet[29:33]))
+ }
+ }
+
+ if !reflect.DeepEqual(hits, []uint32{4, 4}) || player.health != 29 || len(owner.packets) != len(observer.packets) {
+ t.Fatalf("native armored hits or authoritative HP: hits%v HP%d", hits, player.health)
+ }
+}
+
+func TestArmorDamageHighQualityChestRequirements(t *testing.T) {
+ for _, scenario := range []struct {
+ name string
+ strength, agility uint16
+ slot uint32
+ }{
+ {"strength below", 460, 511, 67}, {"agility below", 461, 510, 67}, {"both qualify", 461, 511, 21},
+ } {
+ t.Run(scenario.name, func(t *testing.T) {
+ world, _ := newArmorWorld(t)
+ player := world.characters[1]
+ player.stats.Strength, player.stats.Agility = scenario.strength, scenario.agility
+ if granted, err := world.grantItem_locked(player, 85685); err != nil || !granted {
+ t.Fatalf("grant: %v %v", granted, err)
+ }
+
+ world.handleInventory(world.clients[1], inventoryMovePacket(1, 67, 21)[20:])
+ if world.clients[1].equipment != nil {
+ world.advanceEquipment(world.clients[1].equipment.readyAt)
+ }
+
+ if player.inventory.Items[3].Slot != scenario.slot {
+ t.Fatalf("QL 200 chest ignored exact requirements: %+v", player.inventory.Items[3])
+ }
+ })
+ }
+}
diff --git a/server/armor_test.go b/server/armor_test.go
@@ -181,6 +181,7 @@ func TestArmorCatalogProtectionAndTexture(t *testing.T) {
texture int32
category int32
}{
+ {85685, [8]int32{1000, 875, 1000, 750, 150, 150, 150, 150}, 8736, 1},
{85686, [8]int32{5, 5, 5, 5, 1, 1, 1, 1}, 8736, 1},
{85638, [8]int32{1, 1, 1, 1, 1, 1, 1, 1}, 9424, 2},
} {
diff --git a/server/combat.go b/server/combat.go
@@ -133,6 +133,25 @@ func (character *character) maximumNano() uint32 {
return stats[0] + uint32(character.level)*stats[1] + nanoPool*stats[2]
}
+func (attacker *character) normalDamage(target *character, roll func(uint32) uint32) uint32 {
+ // Exact catalog endpoints; attack-rating scaling remains a separate rule.
+ minimum, maximum, damageType := uint32(3), uint32(5), uint32(91)
+ if weapon := attacker.meleeWeapon(); weapon != nil {
+ minimum, maximum, damageType = itemStat(weapon, 286), itemStat(weapon, 285), itemStat(weapon, 436)
+ // kkr.dll FUN_100ab7b0 accepts the eight ACs and NanoAC, else ProjectileAC.
+ if (damageType < 90 || damageType > 97) && damageType != 168 {
+ damageType = 90
+ }
+ } else if attacker.npc {
+ minimum, maximum = 5, 5
+ }
+
+ // Period AC rule: reduce the rolled hit without crossing the weapon minimum.
+ // Truncating AC/10 before subtraction is provisional integer ordering.
+ damage := minimum + roll(maximum-minimum+1)
+ return damage - min(damage-minimum, target.armorClass(damageType)/10)
+}
+
func (server *server) combatInRange_locked(attacker, target *character, now time.Time) bool {
first, second := attacker.position, target.position
if !attacker.npc {
@@ -223,15 +242,7 @@ func (server *server) advanceCombat(now time.Time) {
continue
}
- // Shipped QL 1 fists have 3..5 base damage; NPC profiles remain local.
- damage := rand.Uint32N(3) + 3
- if weapon := attacker.meleeWeapon(); weapon != nil {
- minimum, maximum := itemStat(weapon, 286), itemStat(weapon, 285)
- damage = minimum + rand.Uint32N(maximum-minimum+1)
- } else if attacker.npc {
- damage = 5
- }
- damage = min(damage, target.health)
+ damage := min(attacker.normalDamage(target, rand.Uint32N), target.health)
if damage == target.health && !target.npc {
if err := server.collectReclaim_locked(target, now); err != nil {
log.Printf("Reclaim: %v", err)
diff --git a/server/equipment.go b/server/equipment.go
@@ -24,6 +24,9 @@ func (item ownedItem) equipmentSlot() uint32 {
if item.isKineticAxe() {
return 6
}
+ if item.Type == 51022 && item.Template == 85685 && item.Quality == 200 {
+ return 21
+ }
if item.Type == 51022 && item.Quality == 1 {
switch item.Template {
case 85686:
@@ -39,10 +42,34 @@ func (character *character) canEquip(item ownedItem) bool {
if item.isKineticAxe() {
return character.canWieldKineticAxe()
}
+ if item.Template == 85685 {
+ return character.baseStats().Strength > 460 && character.baseStats().Agility > 510
+ }
// Both QL 1 Metaplast pieces require Strength and Agility greater than 7.
return character.baseStats().Strength > 7 && character.baseStats().Agility > 7
}
+func (character *character) armorClass(stat uint32) uint32 {
+ // Supported Metaplast pieces have unconditional positive OnWear AC modifiers.
+ var armor uint32
+ for _, item := range character.inventory.Items {
+ if item.Slot != 21 && item.Slot != 30 {
+ continue
+ }
+ for _, section := range gamedata.ItemTemplates[item.Template].Sections {
+ if section.Type != 2 || section.Subtype != 14 {
+ continue
+ }
+ for _, function := range *section.Functions {
+ if function.ID == 53045 && uint32(*function.Arguments[0].Integer) == stat {
+ armor += uint32(*function.Arguments[1].Integer)
+ }
+ }
+ }
+ }
+ return armor
+}
+
func (character *character) meleeWeapon() *gamedata.Item {
if character.npc && character.combatProfile != nil {
return gamedata.ItemTemplates[character.combatProfile.Weapon]