diff --git a/osx/boe.combat.cpp b/osx/boe.combat.cpp index 20ed2556..a52ba90c 100644 --- a/osx/boe.combat.cpp +++ b/osx/boe.combat.cpp @@ -2335,7 +2335,7 @@ void monster_attack_pc(short who_att,short target) attacker->m_type,sound_type) && (store_hp - univ.party[target].cur_health > 0)) { damaged_message(store_hp - univ.party[target].cur_health, - (i > 0) ? attacker->a23_type : attacker->a1_type); + attacker->a[i].type); if (univ.party[target].status[10] > 0) { add_string_to_buf(" Shares damage! "); @@ -2507,7 +2507,7 @@ void monster_attack_monster(short who_att,short attackee) dam_type += DAMAGE_MARKED; if (damage_monst(attackee,7,r2,0,dam_type,sound_type) == true) { damaged_message(store_hp - target->health, - (i > 0) ? attacker->a23_type : attacker->a1_type); + attacker->a[i].type); if ((attacker->poison > 0) && (i == 0)) { poison_monst(target,attacker->poison); @@ -4795,7 +4795,7 @@ void add_new_action(short pc_num) short get_monst_sound(cCreature *attacker,short which_att) { short type,strength; - type = (which_att == 0) ? attacker->a1_type : attacker->a23_type; + type = attacker->a[which_att].type; strength = attacker->a[which_att]; switch (type) { diff --git a/osx/boe.monster.cpp b/osx/boe.monster.cpp index 238a39d8..37e1976c 100644 --- a/osx/boe.monster.cpp +++ b/osx/boe.monster.cpp @@ -230,8 +230,7 @@ void set_up_monst(short mode,m_num_t m_num) for (which = 0; which < univ.town->max_monst(); which++) if (univ.town.monst[which].active == 0) { - univ.town.monst[which].number = m_num; - univ.town.monst[which] = cCreature(); + univ.town.monst[which] = cCreature(m_num); univ.town.monst[which].active = 2; univ.town.monst[which].summoned = 0; univ.town.monst[which].attitude = mode + 1; diff --git a/osx/classes/monster.cpp b/osx/classes/monster.cpp index c01e8cdc..b1508b66 100644 --- a/osx/classes/monster.cpp +++ b/osx/classes/monster.cpp @@ -17,7 +17,6 @@ cMonster& cMonster::operator = (legacy::monster_record_type& old){ int i; - m_num = old.m_num; level = old.level; //m_name = old.m_name; health = old.health; @@ -28,8 +27,8 @@ cMonster& cMonster::operator = (legacy::monster_record_type& old){ skill = old.skill; for(i = 0; i < 3; i++) a[i] = old.a[i]; // TODO: These two bits of data belong in a[] - a1_type = old.a1_type; - a23_type = old.a23_type; + a[0].type = old.a1_type; + a[1].type = a[2].type = old.a23_type; m_type = (eMonsterType) old.m_type; speed = old.speed; ap = old.ap; @@ -78,6 +77,10 @@ cCreature::cCreature(){ target = 6; } +cCreature::cCreature(int num) : cCreature() { + number = num; +} + cCreature& cCreature::operator = (legacy::creature_start_type old){ number = old.number; start_attitude = old.start_attitude; diff --git a/osx/classes/monster.h b/osx/classes/monster.h index 0a4240a6..b14393bf 100644 --- a/osx/classes/monster.h +++ b/osx/classes/monster.h @@ -103,7 +103,6 @@ public: unsigned char extra1, extra2; operator std::string(); }; - m_num_t m_num; // TODO: This probably shouldn't be necessary. Consider why it is, and determine if it can be removed unsigned char level; std::string m_name; short health; // TODO: Move health, mp and max_mp to cCreature @@ -113,7 +112,6 @@ public: unsigned char armor; unsigned char skill; cAttack a[3]; - unsigned char a1_type,a23_type; // TODO: Delete in favour of type field of cAttack eMonsterType m_type; unsigned char speed; unsigned char ap; // TODO: Move ap to cCreature @@ -172,6 +170,7 @@ public: location targ_loc; cCreature(); + cCreature(int num); cCreature& operator = (legacy::creature_data_type old); cCreature& operator = (legacy::creature_start_type old);