diff --git a/src/boe.combat.cpp b/src/boe.combat.cpp index cd57f442..6a74a18f 100644 --- a/src/boe.combat.cpp +++ b/src/boe.combat.cpp @@ -592,7 +592,7 @@ void pc_attack(short who_att,short target) { move_to_zero(univ.party[who_att].status[eStatus::POISONED_WEAPON]); take_ap(4); - if((univ.town.monst[target].status[eStatus::MARTYRS_SHIELD] > 0 || univ.town.monst[target].spec_skill == 22) + if((univ.town.monst[target].status[eStatus::MARTYRS_SHIELD] > 0 || univ.town.monst[target].spec_skill == MONSTER_PERMANENT_MARTYRS_SHIELD) && (store_hp - univ.town.monst[target].health > 0)) { add_string_to_buf(" Shares damage! "); damage_pc(who_att, store_hp - univ.town.monst[target].health, eDamageType::MAGIC,eRace::UNKNOWN,0); @@ -642,7 +642,7 @@ void pc_attack_weapon(short who_att,short target,short hit_adj,short dam_adj,cIt r1 = get_ran(1,1,100); if((univ.party[who_att].level >= which_m->level - 1) && univ.party[who_att].skills[eSkill::ASSASSINATION] >= which_m->level / 2 - && (which_m->spec_skill != 12)) // Can't assassinate splitters + && (which_m->spec_skill != MONSTER_SPLITS)) // Can't assassinate splitters if(r1 < hit_chance[max(univ.party[who_att].skills[eSkill::ASSASSINATION] - which_m->level,0)]) { add_string_to_buf(" You assassinate."); spec_dam += r2; @@ -1990,7 +1990,7 @@ void do_monster_turn() { // flee if((univ.town.monst[i].target != 6) && (((cur_monst->morale <= 0) - && cur_monst->spec_skill != 13 && cur_monst->m_type != eRace::UNDEAD) + && cur_monst->spec_skill != MONSTER_MINDLESS && cur_monst->m_type != eRace::UNDEAD) || (current_monst_tactic == 1))) { if(cur_monst->morale < 0) cur_monst->morale++; @@ -2052,8 +2052,10 @@ void do_monster_turn() { && (get_ran(1,1,8) < abil_odds[cur_monst->spec_skill]) && !acted_yet) { // Don't fire when adjacent, unless non-gaze magical attack if((!monst_adjacent(targ_space,i) || - ((cur_monst->spec_skill > 7) && (cur_monst->spec_skill != 20) - && (cur_monst->spec_skill != 33))) + ((cur_monst->spec_skill > 7) && (cur_monst->spec_skill != MONSTER_GOOD_ARCHER) + && (cur_monst->spec_skill != MONSTER_ACID_SPIT))) + // TODO: ^ What about shooting spines? That's non-magical too, isn't it? + // TODO: ^ What about gaze attacks? Aren't they supposed to be excluded too? // missile range && (dist(cur_monst->cur_loc,targ_space) <= abil_range[cur_monst->spec_skill])) { print_monst_name(cur_monst->number); @@ -2061,10 +2063,13 @@ void do_monster_turn() { cur_monst->spec_skill,cur_monst->cur_loc,target); // Vapors don't count as action - if((cur_monst->spec_skill == 11) || (cur_monst->spec_skill == 7) || - (cur_monst->spec_skill == 20)) + // TODO: Except that this code makes them consume 3 ap. + // TODO: This is an odd choice of skills to consume 2 ap. + // Shouldn't it be something more like "all archery skills" or "all thrown missile skills"? + // (Cross-reference with PC action point consumption in similar situations.) + if(cur_monst->spec_skill == MONSTER_THROWS_RAZORDISKS || cur_monst->spec_skill == MONSTER_GOOD_ARCHER) take_m_ap(2,cur_monst); - else if(cur_monst->spec_skill == 10) + else if(cur_monst->spec_skill == MONSTER_HEAT_RAY) take_m_ap(1,cur_monst); else take_m_ap(3,cur_monst); had_monst = true; @@ -2158,40 +2163,42 @@ void do_monster_turn() { // Place fields for monsters that create them. Only done when monst sees foe if((target != 6) && (can_see_light(cur_monst->cur_loc,targ_space,sight_obscurity) < 5)) { //// - if((cur_monst->radiate_1 == 1) && (get_ran(1,1,100) < cur_monst->radiate_2)) + if((cur_monst->radiate_1 == MONSTER_RADIATE_FIRE_FIELDS) && (get_ran(1,1,100) < cur_monst->radiate_2)) place_spell_pattern(square,cur_monst->cur_loc,WALL_FIRE,7); - if((cur_monst->radiate_1 == 2) && (get_ran(1,1,100) < cur_monst->radiate_2)) + if((cur_monst->radiate_1 == MONSTER_RADIATE_ICE_FIELDS) && (get_ran(1,1,100) < cur_monst->radiate_2)) place_spell_pattern(square,cur_monst->cur_loc,WALL_ICE,7); - if((cur_monst->radiate_1 == 3) && (get_ran(1,1,100) < cur_monst->radiate_2)) + if((cur_monst->radiate_1 == MONSTER_RADIATE_SHOCK_FIELDS) && (get_ran(1,1,100) < cur_monst->radiate_2)) place_spell_pattern(square,cur_monst->cur_loc,WALL_FORCE,7); - if((cur_monst->radiate_1 == 4) && (get_ran(1,1,100) < cur_monst->radiate_2)) + if((cur_monst->radiate_1 == MONSTER_RADIATE_ANTIMAGIC_FIELDS) && (get_ran(1,1,100) < cur_monst->radiate_2)) place_spell_pattern(square,cur_monst->cur_loc,FIELD_ANTIMAGIC,7); - if((cur_monst->radiate_1 == 5) && (get_ran(1,1,100) < cur_monst->radiate_2)) + if((cur_monst->radiate_1 == MONSTER_RADIATE_SLEEP_FIELDS) && (get_ran(1,1,100) < cur_monst->radiate_2)) place_spell_pattern(square,cur_monst->cur_loc,CLOUD_SLEEP,7); - if((cur_monst->radiate_1 == 6) && (get_ran(1,1,100) < cur_monst->radiate_2)) + if((cur_monst->radiate_1 == MONSTER_RADIATE_STINKING_CLOUDS) && (get_ran(1,1,100) < cur_monst->radiate_2)) place_spell_pattern(square,cur_monst->cur_loc,CLOUD_STINK,7); - if((cur_monst->radiate_1 == 10) && (get_ran(1,1,100) < 5)){ + if((cur_monst->radiate_1 == MONSTER_RADIATE_BLADE_FIELDS) && (get_ran(1,1,100) < cur_monst->radiate_2)) + place_spell_pattern(square,cur_monst->cur_loc,WALL_BLADES,7); + if((cur_monst->radiate_1 == MONSTER_SUMMON_5_PERCENT) && (get_ran(1,1,100) < 5)){ if(summon_monster(cur_monst->radiate_2, cur_monst->cur_loc,130,cur_monst->attitude)) { monst_spell_note(cur_monst->number,33); play_sound(61); } } - if((cur_monst->radiate_1 == 11) && (get_ran(1,1,100) < 20)){ + if((cur_monst->radiate_1 == MONSTER_SUMMON_20_PERCENT) && (get_ran(1,1,100) < 20)){ if(summon_monster(cur_monst->radiate_2, cur_monst->cur_loc,130,cur_monst->attitude)) { monst_spell_note(cur_monst->number,33); play_sound(61); } } - if((cur_monst->radiate_1 == 12) && (get_ran(1,1,100) < 50)){ + if((cur_monst->radiate_1 == MONSTER_SUMMON_50_PERCENT) && (get_ran(1,1,100) < 50)){ if(summon_monster(cur_monst->radiate_2, cur_monst->cur_loc,130,cur_monst->attitude)) { monst_spell_note(cur_monst->number,33); play_sound(61); } } - if((cur_monst->radiate_1 == 14) && !special_called && party_can_see_monst(i)) { + if((cur_monst->radiate_1 == MONSTER_SPECIAL_ACTION) && !special_called && party_can_see_monst(i)) { short s1, s2, s3; special_called = true; take_m_ap(1,cur_monst); @@ -2310,7 +2317,7 @@ void monster_attack_pc(short who_att,short target) { // Draw attacker frames if((is_combat()) && ((center_on_monst) || !monsters_going)) { - if(attacker->spec_skill != 11) + if(attacker->spec_skill != MONSTER_INVISIBLE) frame_space(attacker->cur_loc,0,attacker->x_width,attacker->y_width); frame_space(univ.party[target].combat_pos,1,1,1); } @@ -2380,7 +2387,7 @@ void monster_attack_pc(short who_att,short target) { } // Gremlin - if((attacker->spec_skill == 21) && (get_ran(1,0,2) < 2)) { + if((attacker->spec_skill == MONSTER_STEALS_FOOD) && (get_ran(1,0,2) < 2)) { add_string_to_buf(" Steals food! "); print_buf(); play_sound(26); @@ -2389,7 +2396,7 @@ void monster_attack_pc(short who_att,short target) { } // Disease - if(((attacker->spec_skill == 25)) + if(((attacker->spec_skill == MONSTER_DISEASE_TOUCH)) && (get_ran(1,0,2) < 2)) { add_string_to_buf(" Causes disease! "); print_buf(); @@ -2397,67 +2404,68 @@ void monster_attack_pc(short who_att,short target) { } // Petrification touch - if(attacker->spec_skill == 30) { + if(attacker->spec_skill == MONSTER_PETRIFICATION_TOUCH) { add_string_to_buf(" Petrifying touch!"); print_buf(); petrify_pc(target,attacker->level / 4); } // Undead xp drain - if(((attacker->spec_skill == 16) || (attacker->spec_skill == 17)) + if(((attacker->spec_skill == MONSTER_XP_DRAINING_TOUCH) || (attacker->spec_skill == MONSTER_ICY_AND_DRAINING_TOUCH)) && (pc_has_abil_equip(target,eItemAbil::LIFE_SAVING) == 24)) { - // Note: spec_skill 17 (Icy+Draining Touch) also enters another if block further down. + // Note: Icy+Draining Touch also enters another if block further down. add_string_to_buf(" Drains life! "); drain_pc(target,(attacker->level * 3) / 2); put_pc_screen(); } // Undead slow - if((attacker->spec_skill == 18) && (get_ran(1,0,8) < 6) && (pc_has_abil_equip(target,eItemAbil::LIFE_SAVING) == 24)) { + // TODO: Why does life-saving protect from this? + if((attacker->spec_skill == MONSTER_SLOWING_TOUCH) && (get_ran(1,0,8) < 6) && (pc_has_abil_equip(target,eItemAbil::LIFE_SAVING) == 24)) { add_string_to_buf(" Stuns! "); slow_pc(target,2); put_pc_screen(); } // Dumbfound target - if(attacker->spec_skill == 24) { + if(attacker->spec_skill == MONSTER_DUMBFOUNDING_TOUCH) { add_string_to_buf(" Dumbfounds! "); dumbfound_pc(target,2); put_pc_screen(); } // Web target - if(attacker->spec_skill == 27) { + if(attacker->spec_skill == MONSTER_WEB_TOUCH) { add_string_to_buf(" Webs! "); web_pc(target,5); put_pc_screen(); } // Sleep target - if(attacker->spec_skill == 28) { + if(attacker->spec_skill == MONSTER_SLEEP_TOUCH) { add_string_to_buf(" Sleeps! "); sleep_pc(target,6,eStatus::ASLEEP,-15); put_pc_screen(); } // Paralyze target - if(attacker->spec_skill == 29) { + if(attacker->spec_skill == MONSTER_PARALYSIS_TOUCH) { add_string_to_buf(" Paralysis touch! "); sleep_pc(target,500,eStatus::PARALYZED,-5); put_pc_screen(); } // Acid touch - if(attacker->spec_skill == 31) { + if(attacker->spec_skill == MONSTER_ACID_TOUCH) { add_string_to_buf(" Acid touch! "); acid_pc(target,(attacker->level > 20) ? 4 : 2); } // Freezing touch - if(((attacker->spec_skill == 15) || (attacker->spec_skill == 17)) + if(((attacker->spec_skill == MONSTER_ICY_TOUCH) || (attacker->spec_skill == MONSTER_ICY_AND_DRAINING_TOUCH)) && (get_ran(1,0,8) < 6) && (pc_has_abil_equip(target,eItemAbil::LIFE_SAVING) == 24)) { add_string_to_buf(" Freezing touch!"); r1 = get_ran(3,1,10); damage_pc(target,r1,eDamageType::COLD,eRace::UNKNOWN,0); } // Killing touch - if(attacker->spec_skill == 35) { + if(attacker->spec_skill == MONSTER_DEATH_TOUCH) { add_string_to_buf(" Killing touch!"); r1 = get_ran(20,1,10); damage_pc(target,r1,eDamageType::UNBLOCKABLE,eRace::UNKNOWN,0); @@ -2493,7 +2501,7 @@ void monster_attack_monster(short who_att,short attackee) { // Draw attacker frames if((is_combat()) && (center_on_monst || !monsters_going)) { - if(attacker->spec_skill != 11) + if(attacker->spec_skill != MONSTER_INVISIBLE) frame_space(attacker->cur_loc,0,attacker->x_width,attacker->y_width); frame_space(target->cur_loc,1,1,1); } @@ -2543,52 +2551,53 @@ void monster_attack_monster(short who_att,short attackee) { } // Undead slow - if((attacker->spec_skill == 18) && (get_ran(1,0,8) < 6)) { + // TODO: This should not be associated with undead, should it? + if((attacker->spec_skill == MONSTER_SLOWING_TOUCH) && (get_ran(1,0,8) < 6)) { add_string_to_buf(" Stuns! "); slow_monst(target,2); } // Web target - if(attacker->spec_skill == 27) { + if(attacker->spec_skill == MONSTER_WEB_TOUCH) { add_string_to_buf(" Webs! "); web_monst(target,4); } // Sleep target - if(attacker->spec_skill == 28) { + if(attacker->spec_skill == MONSTER_SLEEP_TOUCH) { add_string_to_buf(" Sleeps! "); charm_monst(target,-15,eStatus::ASLEEP,6); } // Dumbfound target - if(attacker->spec_skill == 24) { + if(attacker->spec_skill == MONSTER_DUMBFOUNDING_TOUCH) { add_string_to_buf(" Dumbfounds! "); dumbfound_monst(target,2); } // Disease target - if(((attacker->spec_skill == 25)) + if(((attacker->spec_skill == MONSTER_DISEASE_TOUCH)) && (get_ran(1,0,2) < 2)) { add_string_to_buf(" Causes disease! "); print_buf(); disease_monst(target,6); } // Paralyze target - if(attacker->spec_skill == 29) { + if(attacker->spec_skill == MONSTER_PARALYSIS_TOUCH) { add_string_to_buf(" Paralysis touch! "); charm_monst(target,-5,eStatus::PARALYZED,500); } // Petrify target - if(attacker->spec_skill == 30) { + if(attacker->spec_skill == MONSTER_PETRIFICATION_TOUCH) { add_string_to_buf(" Petrification touch! "); petrify_monst(target, attacker->level / 4); } // Acid touch - if(attacker->spec_skill == 31) { + if(attacker->spec_skill == MONSTER_ACID_TOUCH) { add_string_to_buf(" Acid touch! "); acid_monst(target,3); } // Freezing touch - if(((attacker->spec_skill == 15) || (attacker->spec_skill == 17)) + if(((attacker->spec_skill == MONSTER_ICY_TOUCH) || (attacker->spec_skill == MONSTER_ICY_AND_DRAINING_TOUCH)) && (get_ran(1,0,8) < 6)) { add_string_to_buf(" Freezing touch!"); r1 = get_ran(3,1,10); @@ -2596,7 +2605,7 @@ void monster_attack_monster(short who_att,short attackee) { } // Death touch - if((attacker->spec_skill == 35) + if((attacker->spec_skill == MONSTER_DEATH_TOUCH) && (get_ran(1,0,8) < 6)) { add_string_to_buf(" Killing touch!"); r1 = get_ran(20,1,10); @@ -2650,13 +2659,13 @@ void monst_fire_missile(short m_num,short bless,short level,location source,shor } draw_terrain(2); - if(level == 32) { // sleep cloud + if(level == MONSTER_BREATHES_SLEEP_CLOUDS) { ASB("Creature breathes."); run_a_missile(source,targ_space,0,0,44, 0,0,100); place_spell_pattern(radius2,targ_space,CLOUD_SLEEP,7); } - else if(level == 14) { // vapors + else if(level == MONSTER_BREATHES_STINKING_CLOUDS) { //play_sound(44); if(target < 100) { // on PC std::string create_line = " Breathes on " + univ.party[target].name + '.'; @@ -2669,7 +2678,7 @@ void monst_fire_missile(short m_num,short bless,short level,location source,shor 0,0,100); scloud_space(targ_space.x,targ_space.y); } - else if(level == 19) { // webs + else if(level == MONSTER_SHOOTS_WEB) { //play_sound(14); if(target < 100) { // on PC std::string create_line = " Throws web at " + univ.party[target].name + '.'; @@ -2682,7 +2691,7 @@ void monst_fire_missile(short m_num,short bless,short level,location source,shor 0,0,100); web_space(targ_space.x,targ_space.y); } - else if(level == 23) { // paral + else if(level == MONSTER_PARALYSIS_RAY) { // TODO: This sound doesn't seem right? play_sound(51); if(target < 100) { // on PC @@ -2698,7 +2707,7 @@ void monst_fire_missile(short m_num,short bless,short level,location source,shor // 0,0,100); //web_space(targ_space.x,targ_space.y); } - else if(level == 8) { // petrify + else if(level == MONSTER_PETRIFICATION_RAY) { //play_sound(43); run_a_missile(source,targ_space,14,0,43,0,0,100); if(target < 100) { // on PC @@ -2712,7 +2721,7 @@ void monst_fire_missile(short m_num,short bless,short level,location source,shor petrify_monst(m_target, m_target->level / 4); } } - else if(level == 9) { /// Drain sp + else if(level == MONSTER_SP_DRAIN_RAY) { if(target < 100) { // pc // modify target is target has no sp if(univ.party[target].cur_sp < 4) { @@ -2740,7 +2749,7 @@ void monst_fire_missile(short m_num,short bless,short level,location source,shor else m_target->skill = 1; } } - else if(level == 10) { // heat ray + else if(level == MONSTER_HEAT_RAY) { run_a_missile(source,targ_space,13,0,51, 0,0,100); r1 = get_ran(7,1,6); @@ -2758,7 +2767,7 @@ void monst_fire_missile(short m_num,short bless,short level,location source,shor end_missile_anim(); handle_marked_damage(); } - else if(level == 33) { // acid spit + else if(level == MONSTER_ACID_SPIT) { run_a_missile(source,targ_space,0,1,64, 0,0,100); //play_sound(64); @@ -2775,19 +2784,19 @@ void monst_fire_missile(short m_num,short bless,short level,location source,shor else if(target < 100) { // missile on PC std::string create_line; switch(level) { - case 1: case 2: case 20: + case MONSTER_THROWS_DARTS: case MONSTER_SHOOTS_ARROWS: case MONSTER_GOOD_ARCHER: run_a_missile(source,targ_space,3,1,12,0,0,100); create_line = " Shoots at " + univ.party[target].name + '.'; break; - case 3: + case MONSTER_THROWS_SPEARS: run_a_missile(source,targ_space,5,1,14,0,0,100); create_line = " Throws spear at " + univ.party[target].name + '.'; break; - case 7: + case MONSTER_THROWS_RAZORDISKS: run_a_missile(source,targ_space,7,1,14,0,0,100); create_line = " Throws razordisk at " + univ.party[target].name + '.'; break; - case 34: + case MONSTER_SHOOTS_SPINES: run_a_missile(source,targ_space,5,1,14,0,0,100); create_line = " Fires spines at " + univ.party[target].name + '.'; break; @@ -2830,19 +2839,19 @@ void monst_fire_missile(short m_num,short bless,short level,location source,shor } else { // missile on monst switch(level) { - case 1: case 2: case 20: + case MONSTER_THROWS_DARTS: case MONSTER_SHOOTS_ARROWS: case MONSTER_GOOD_ARCHER: run_a_missile(source,targ_space,3,1,12,0,0,100); monst_spell_note(m_target->number,12); break; - case 3: + case MONSTER_THROWS_SPEARS: run_a_missile(source,targ_space,5,1,14,0,0,100); monst_spell_note(m_target->number,13); break; - case 7: + case MONST_THROWS_RAZORDISKS: run_a_missile(source,targ_space,7,1,14,0,0,100); monst_spell_note(m_target->number,15); break; - case 34: + case MONSTER_SHOOTS_SPINES: run_a_missile(source,targ_space,5,1,14,0,0,100); monst_spell_note(m_target->number,32); break; @@ -3876,32 +3885,40 @@ static void place_spell_pattern(effect_pat_type pat,location center,unsigned sho break; case WALL_FORCE: r1 = get_ran(3,1,6); + if(which_m->radiate_1 == MONSTER_RADIATE_SHOCK_FIELDS) + break; damage_monst(k, who_hit, r1,0, eDamageType::MAGIC,0); break; case WALL_FIRE: r1 = get_ran(2,1,6); which_m = &univ.town.monst[k]; - if(which_m->spec_skill == 22) + if(which_m->radiate_1 == MONSTER_RADIATE_FIRE_FIELDS) break; damage_monst(k, who_hit, r1,0, eDamageType::FIRE,0); break; case CLOUD_STINK: which_m = &univ.town.monst[k]; + if(which_m->radiate_1 == MONSTER_RADIATE_STINKING_CLOUDS) + break; curse_monst(which_m,get_ran(1,1,2)); break; case WALL_ICE: which_m = &univ.town.monst[k]; r1 = get_ran(3,1,6); - if(which_m->spec_skill == 23) + if(which_m->radiate_1 == MONSTER_RADIATE_ICE_FIELDS) break; damage_monst(k, who_hit, r1,0, eDamageType::COLD,0); break; case WALL_BLADES: r1 = get_ran(6,1,8); + if(which_m->radiate_1 == MONSTER_RADIATE_BLADE_FIELDS) + break; damage_monst(k, who_hit, r1,0, eDamageType::WEAPON,0); break; case CLOUD_SLEEP: which_m = &univ.town.monst[k]; + if(which_m->radiate_1 == MONSTER_RADIATE_SLEEP_FIELDS) + break; charm_monst(which_m,0,eStatus::ASLEEP,3); break; case OBJECT_BLOCK: diff --git a/src/boe.graphutil.cpp b/src/boe.graphutil.cpp index a267f154..a271e78b 100644 --- a/src/boe.graphutil.cpp +++ b/src/boe.graphutil.cpp @@ -190,7 +190,7 @@ void draw_monsters() { } if(is_town() || is_combat()) { for(i = 0; i < univ.town->max_monst(); i++) - if((univ.town.monst[i].active != 0) && (univ.town.monst[i].spec_skill != 11)) + if(univ.town.monst[i].active != 0 && univ.town.monst[i].spec_skill != MONSTER_INVISIBLE) if(point_onscreen(center,univ.town.monst[i].cur_loc) && party_can_see_monst(i)) { check_if_monst_seen(univ.town.monst[i].number, univ.town.monst[i].cur_loc); where_draw.x = univ.town.monst[i].cur_loc.x - center.x + 4; diff --git a/src/boe.items.cpp b/src/boe.items.cpp index 0dc324c3..047dc5ca 100644 --- a/src/boe.items.cpp +++ b/src/boe.items.cpp @@ -833,7 +833,7 @@ void set_town_attitude(short lo,short hi,short att) { univ.town.monst[i].mobility = 1; // If a "guard", give a power boost - if(univ.scenario.scen_monsters[num].spec_skill == 37) { + if(univ.scenario.scen_monsters[num].spec_skill == MONSTER_GUARD) { univ.town.monst[i].active = 2; univ.town.monst[i].health *= 3; univ.town.monst[i].status[eStatus::HASTE_SLOW] = 8; diff --git a/src/boe.monster.cpp b/src/boe.monster.cpp index b886e495..e554fe6b 100644 --- a/src/boe.monster.cpp +++ b/src/boe.monster.cpp @@ -224,7 +224,7 @@ void do_monsters() { l1 = univ.town.monst[i].cur_loc; l2 = (univ.town.monst[i].target <= 6) ? univ.town.p_loc : univ.town.monst[target - 100].cur_loc; - if((univ.town.monst[i].morale < 0) && (univ.town.monst[i].spec_skill != 13) + if(univ.town.monst[i].morale < 0 && univ.town.monst[i].spec_skill != MONSTER_MINDLESS && univ.town.monst[i].m_type != eRace::UNDEAD) { acted_yet = flee_party(i,l1,l2); if(get_ran(1,0,10) < 6) @@ -283,38 +283,44 @@ bool monst_hate_spot(short which_m,location *good_loc) { bool hate_spot = false; // Hate barriers if(univ.town.is_fire_barr(loc.x,loc.y) || univ.town.is_force_barr(loc.x,loc.y)) hate_spot = true; - // Hate regular fields - else if(univ.town.is_quickfire(loc.x,loc.y) || univ.town.is_blade_wall(loc.x,loc.y)) hate_spot = true; + // Hate quickfire + else if(univ.town.is_quickfire(loc.x,loc.y)) hate_spot = true; + // Hate blade wall? + else if(univ.town.is_blade_wall(loc.x,loc.y)) { + hate_spot = true; + if(univ.town.monst[which_m].radiate_1 == MONSTER_RADIATE_BLADE_FIELDS) hate_spot = false; + else if(univ.town.monst[which_m].spec_skill == MONSTER_INVULNERABILITY) hate_spot = false; + } // Hate ice wall? else if(univ.town.is_ice_wall(loc.x,loc.y)) { hate_spot = true; - if(univ.town.monst[which_m].radiate_1 == 2) hate_spot = false; + if(univ.town.monst[which_m].radiate_1 == MONSTER_RADIATE_ICE_FIELDS) hate_spot = false; else if(univ.town.monst[which_m].cold_res == RESIST_ALL) hate_spot = false; } // Hate fire wall? else if(univ.town.is_fire_wall(loc.x,loc.y)) { hate_spot = true; - if(univ.town.monst[which_m].radiate_1 == 1) hate_spot = false; + if(univ.town.monst[which_m].radiate_1 == MONSTER_RADIATE_FIRE_FIELDS) hate_spot = false; else if(univ.town.monst[which_m].fire_res == RESIST_ALL) hate_spot = false; } // Note: Monsters used to enter shock walls even if they were merely resistant to magic // Hate shock wall? else if(univ.town.is_force_wall(loc.x,loc.y)) { hate_spot = true; - if(univ.town.monst[which_m].radiate_1 == 3) hate_spot = false; + if(univ.town.monst[which_m].radiate_1 == MONSTER_RADIATE_SHOCK_FIELDS) hate_spot = false; else if(univ.town.monst[which_m].magic_res == RESIST_ALL) hate_spot = false; } // Hate stink cloud? else if(univ.town.is_scloud(loc.x,loc.y)) { hate_spot = true; - if(univ.town.monst[which_m].radiate_1 == 6) hate_spot = false; + if(univ.town.monst[which_m].radiate_1 == MONSTER_RADIATE_STINKING_CLOUDS) hate_spot = false; else if(univ.town.monst[which_m].magic_res == RESIST_ALL) hate_spot = false; else if(univ.town.monst[which_m].magic_res == RESIST_HALF) hate_spot = false; } // Hate sleep cloud? else if(univ.town.is_sleep_cloud(loc.x,loc.y)) { hate_spot = true; - if(univ.town.monst[which_m].radiate_1 == 5) hate_spot = false; + if(univ.town.monst[which_m].radiate_1 == MONSTER_RADIATE_SLEEP_FIELDS) hate_spot = false; else if(univ.town.monst[which_m].magic_res == RESIST_ALL) hate_spot = false; else if(univ.town.monst[which_m].magic_res == RESIST_HALF) hate_spot = false; } @@ -821,27 +827,31 @@ void monst_inflict_fields(short which_monst) { } if(univ.town.is_blade_wall(where_check.x,where_check.y)) { r1 = get_ran(6,1,8); - damage_monst(which_monst,7,r1,0,eDamageType::WEAPON,0); + if(univ.town.monst[which_monst].radiate_1 != MONSTER_RADIATE_BLADE_FIELDS) + damage_monst(which_monst,7,r1,0,eDamageType::WEAPON,0); break; } if(univ.town.is_force_wall(where_check.x,where_check.y)) { r1 = get_ran(3,1,6); - damage_monst(which_monst,7,r1,0,eDamageType::MAGIC,0); + if(univ.town.monst[which_monst].radiate_1 != MONSTER_RADIATE_SHOCK_FIELDS) + damage_monst(which_monst,7,r1,0,eDamageType::MAGIC,0); break; } if(univ.town.is_sleep_cloud(where_check.x,where_check.y)) { - charm_monst(which_m,0,eStatus::ASLEEP,3); + if(univ.town.monst[which_monst].radiate_1 != MONSTER_RADIATE_SLEEP_FIELDS) + charm_monst(which_m,0,eStatus::ASLEEP,3); break; } if(univ.town.is_ice_wall(where_check.x,where_check.y)) { r1 = get_ran(3,1,6); - if(univ.town.monst[which_monst].spec_skill != 23) + if(univ.town.monst[which_monst].radiate_1 != MONSTER_RADIATE_ICE_FIELDS) damage_monst(which_monst,7,r1,0,eDamageType::COLD,0); break; } if(univ.town.is_scloud(where_check.x,where_check.y)) { r1 = get_ran(1,2,3); - curse_monst(which_m,r1); + if(univ.town.monst[which_monst].radiate_1 != MONSTER_RADIATE_STINKING_CLOUDS) + curse_monst(which_m,r1); break; } if(univ.town.is_web(where_check.x,where_check.y) && which_m->m_type != eRace::BUG) { @@ -853,7 +863,7 @@ void monst_inflict_fields(short which_monst) { } if(univ.town.is_fire_wall(where_check.x,where_check.y)) { r1 = get_ran(2,1,6); - if(univ.town.monst[which_monst].spec_skill != 22) + if(univ.town.monst[which_monst].radiate_1 != MONSTER_RADIATE_FIRE_FIELDS) damage_monst(which_monst,7,r1,0,eDamageType::FIRE,0); break; } @@ -916,7 +926,7 @@ bool monst_check_special_terrain(location where_check,short mode,short which_mon // nasty barriers if((which_m->mu > 0) || (which_m->cl > 0)) mage = true; - if(which_m->spec_skill == 13) + if(which_m->spec_skill == MONSTER_MINDLESS) guts = 20; else guts = get_ran(1,1,(which_m->level / 2)); guts += which_m->health / 20; @@ -927,25 +937,25 @@ bool monst_check_special_terrain(location where_check,short mode,short which_mon if((univ.town.is_antimagic(where_check.x,where_check.y)) && (mage)) return false; - if((univ.town.is_fire_wall(where_check.x,where_check.y)) && (which_m->spec_skill != 22)) { + if(univ.town.is_fire_wall(where_check.x,where_check.y) && which_m->radiate_1 != MONSTER_RADIATE_FIRE_FIELDS) { if(guts < 3) return false; } - if(univ.town.is_force_wall(where_check.x,where_check.y)) { + if(univ.town.is_force_wall(where_check.x,where_check.y) && which_m->radiate_1 != MONSTER_RADIATE_SHOCK_FIELDS) { if(guts < 4) return false; } - if((univ.town.is_ice_wall(where_check.x,where_check.y)) && (which_m->spec_skill != 23)) { + if(univ.town.is_ice_wall(where_check.x,where_check.y) && which_m->radiate_1 != MONSTER_RADIATE_ICE_FIELDS) { if(guts < 5) return false; } - if(univ.town.is_sleep_cloud(where_check.x,where_check.y)) { + if(univ.town.is_sleep_cloud(where_check.x,where_check.y) && which_m->radiate_1 != MONSTER_RADIATE_SLEEP_FIELDS) { if(guts < 8) return false; } - if(univ.town.is_blade_wall(where_check.x,where_check.y)) { + if(univ.town.is_blade_wall(where_check.x,where_check.y) && which_m->radiate_1 != MONSTER_RADIATE_BLADE_FIELDS) { if(guts < 8) return false; } if(univ.town.is_quickfire(where_check.x,where_check.y)) { if(guts < 8) return false; } - if(univ.town.is_scloud(where_check.x,where_check.y)) { + if(univ.town.is_scloud(where_check.x,where_check.y) && which_m->radiate_1 != MONSTER_RADIATE_STINKING_CLOUDS) { if(guts < 4) return false; } if(univ.town.is_web(where_check.x,where_check.y) && which_m->m_type != eRace::BUG) { @@ -1083,7 +1093,7 @@ void forced_place_monster(m_num_t which,location where) { } void magic_adjust(cCreature *which_m,short *how_much) { - if(which_m->spec_skill == 26) { + if(which_m->spec_skill == MONSTER_ABSORB_SPELLS) { *how_much = 0; if(32767 - which_m->health > 3) which_m->health = 32767; @@ -1213,7 +1223,7 @@ void charm_monst(cCreature *which_m,short penalty,eStatus which_status,short amo r1 -= 25; if(which_status == eStatus::PARALYZED) r1 -= 15; - if((which_status == eStatus::ASLEEP) && (which_m->spec_skill == 32)) + if(which_status == eStatus::ASLEEP && which_m->spec_skill == MONSTER_BREATHES_SLEEP_CLOUDS) return; if(r1 > charm_odds[which_m->level / 2]) { @@ -1250,7 +1260,7 @@ void record_monst(cCreature *which_m) { ASB("Capture Soul: Monster is too big."); } // TODO: Are these two sounds right? - else if((r1 > charm_odds[which_m->level / 2]) || (which_m->spec_skill == 12) + else if(r1 > charm_odds[which_m->level / 2] || which_m->spec_skill == MONSTER_SPLITS || which_m->m_type == eRace::IMPORTANT) { monst_spell_note(which_m->number,10); play_sound(68); diff --git a/src/boe.specials.cpp b/src/boe.specials.cpp index a2a0c582..6bca031f 100644 --- a/src/boe.specials.cpp +++ b/src/boe.specials.cpp @@ -1463,7 +1463,7 @@ bool damage_monst(short which_m, short who_hit, short how_much, short how_much_s // Absorb damage? if((dam_type == eDamageType::FIRE || dam_type == eDamageType::MAGIC || dam_type == eDamageType::COLD) - && (victim->spec_skill == 26)) { + && victim->spec_skill == MONSTER_ABSORB_SPELLS) { if(32767 - victim->health > how_much) victim->health = 32767; else victim->health += how_much; @@ -1478,7 +1478,7 @@ bool damage_monst(short which_m, short who_hit, short how_much, short how_much_s how_much /= 2; // Invulnerable? - if(victim->spec_skill == 36) + if(victim->spec_skill == MONSTER_INVULNERABILITY) how_much = how_much / 10; @@ -1523,7 +1523,7 @@ bool damage_monst(short which_m, short who_hit, short how_much, short how_much_s victim->health = -1; // splitting monsters - if((victim->spec_skill == 12) && (victim->health > 0)){ + if(victim->spec_skill == MONSTER_SPLITS && victim->health > 0){ where_put = find_clear_spot(victim->cur_loc,1); if(where_put.x > 0) if((which_spot = place_monster(victim->number,where_put)) < 90) { @@ -1636,7 +1636,7 @@ void kill_monst(cCreature *which_m,short who_killed,eMainStatus type) { if(which_m->special_on_kill >= 0) run_special(eSpecCtx::KILL_MONST,2,which_m->special_on_kill,which_m->cur_loc,&s1,&s2,&s3); - if(which_m->radiate_1 == 15) + if(which_m->radiate_1 == MONSTER_DEATH_TRIGGERS) run_special(eSpecCtx::KILL_MONST,0,which_m->radiate_2,which_m->cur_loc,&s1,&s2,&s3); if((!in_scen_debug) && ((which_m->summoned >= 100) || (which_m->summoned == 0))) { // no xp for party-summoned monsters diff --git a/src/boe.town.cpp b/src/boe.town.cpp index 5d10ae4a..f3475a48 100644 --- a/src/boe.town.cpp +++ b/src/boe.town.cpp @@ -361,7 +361,7 @@ void start_town_mode(short which_town, short entry_dir) { // Flush excess doomguards and viscous goos for(i = 0; i < univ.town->max_monst(); i++) - if((univ.town.monst[i].spec_skill == 12) && + if((univ.town.monst[i].spec_skill == MONSTER_SPLITS) && (univ.town.monst[i].number != univ.town->creatures(i).number)) univ.town.monst[i].active = 0; diff --git a/src/classes/creatlist.cpp b/src/classes/creatlist.cpp index d36a14c5..9dc55135 100644 --- a/src/classes/creatlist.cpp +++ b/src/classes/creatlist.cpp @@ -39,7 +39,7 @@ void cPopulation::assign(size_t n, const cCreature& other, const cMonster& base, static_cast(dudes[n]) = base; // Now set up extra stuff dudes[n].active = 1; // TODO: Is this right? - if(dudes[n].spec_skill == 11) dudes[n].picture_num = 0; + if(dudes[n].spec_skill == MONSTER_INVISIBLE) dudes[n].picture_num = 0; dudes[n].m_health /= easy ? 2 : 1; dudes[n].m_health *= difficulty_adjust; dudes[n].health = dudes[n].m_health; diff --git a/src/classes/monster.h b/src/classes/monster.h index 65bd1aae..aab157cd 100644 --- a/src/classes/monster.h +++ b/src/classes/monster.h @@ -88,11 +88,13 @@ class cUniverse; #define MONSTER_RADIATE_ANTIMAGIC_FIELDS 4 #define MONSTER_RADIATE_SLEEP_FIELDS 5 #define MONSTER_RADIATE_STINKING_CLOUDS 6 -//as said 7,8 and 9 are unused -#define MONSTER_SUMMON1 10 //5 percent chance -#define MONSTER_SUMMON2 11 //20 percent chance -#define MONSTER_SUMMON3 12 //50 percent chance -//as said 13 and 14 are unused +#define MONSTER_RADIATE_BLADE_FIELDS 7 + +#define MONSTER_SUMMON_5_PERCENT 10 //5 percent chance +#define MONSTER_SUMMON_20_PERCENT 11 //20 percent chance +#define MONSTER_SUMMON_50_PERCENT 12 //50 percent chance + +#define MONSTER_SPECIAL_ACTION 14 #define MONSTER_DEATH_TRIGGERS 15 //death triggers global special // Directions!