diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-06-08 19:54:40 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-06-08 19:54:40 -0300 |
| commit | eaa3536c027a4f7c1b879b78ab0ecdefcdb4833d (patch) | |
| tree | 03f851e558656f8fc36fdb982c28fbc09cef8dac /src/crcombat.cc | |
| parent | ab9f606371a1df23e9cacbffa0811db7a9e50100 (diff) | |
| download | game-eaa3536c027a4f7c1b879b78ab0ecdefcdb4833d.tar.gz game-eaa3536c027a4f7c1b879b78ab0ecdefcdb4833d.zip | |
impl `TCreature::Move` which was absolute hell + some tidying up
Diffstat (limited to 'src/crcombat.cc')
| -rw-r--r-- | src/crcombat.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/crcombat.cc b/src/crcombat.cc index dd732e3..25fff0e 100644 --- a/src/crcombat.cc +++ b/src/crcombat.cc @@ -48,10 +48,10 @@ void TCombat::GetWeapon(void){ return; } - // TODO(fusion): We're iterating over left and right hand slots. Make - // it clearer perhaps. - for(int Hand = 5; Hand <= 6; Hand += 1){ - Object Obj = GetBodyObject(Master->ID, Hand); + for(int Position = INVENTORY_HAND_FIRST; + Position <= INVENTORY_HAND_LAST; + Position += 1){ + Object Obj = GetBodyObject(Master->ID, Position); if(Obj == NONE){ continue; } @@ -111,7 +111,7 @@ void TCombat::GetAmmo(void){ } // TODO(fusion): Check if `Master` is NULL? - Object Ammo = GetBodyObject(this->Master->ID, 10); + Object Ammo = GetBodyObject(this->Master->ID, INVENTORY_AMMO); this->Ammo = NONE; if(Ammo != NONE){ ObjectType AmmoType = Ammo.getObjectType(); @@ -283,10 +283,11 @@ int TCombat::GetDefendDamage(void){ } int TCombat::GetArmorStrength(void){ - // TODO(fusion): We're iterating over inventory slots. Make it clearer? int Armor = 0; TCreature *Master = this->Master; - for(int Position = 1; Position <= 10; Position += 1){ + for(int Position = INVENTORY_FIRST; + Position <= INVENTORY_LAST; + Position += 1){ Object Obj = GetBodyObject(Master->ID, Position); if(Obj.exists()){ ObjectType ObjType = Obj.getObjectType(); |
