diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index a5529255..dfba7c01 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -2695,7 +2695,7 @@ void start_new_game(bool force) { party_in_memory = true; // use user's easy mode and less wandering mode univ.party.easy_mode=get_bool_pref("EasyMode", false); - univ.party.less_wm=get_bool_pref("lesswm", false); + univ.party.less_wm=get_bool_pref("LessWanderingMonsters", false); if(force) return; fs::path file = nav_put_party(); if(!file.empty()) save_party(file, univ); diff --git a/src/game/boe.combat.cpp b/src/game/boe.combat.cpp index 55ce1c70..3d969935 100644 --- a/src/game/boe.combat.cpp +++ b/src/game/boe.combat.cpp @@ -249,6 +249,18 @@ effect_pat_type field[8] = { bool center_on_monst; +std::set spell_missile_map = +{ + // magic spell + eSpell::DUMBFOUND, eSpell::FEAR, + eSpell::FLAME, eSpell::GOO, + eSpell::ICE_BOLT, eSpell::KILL, eSpell::POISON, + eSpell::POISON_MINOR, eSpell::SCARE, eSpell::SCRY_MONSTER, + eSpell::SLOW, eSpell::SPARK, eSpell::WRACK, + // priest spell + eSpell::CHARM_FOE, eSpell::CURSE, eSpell::DISPEL_UNDEAD, eSpell::HOLY_SCOURGE, + eSpell::STUMBLE, eSpell::TURN_UNDEAD, eSpell::WOUND, +}; void start_outdoor_combat(cOutdoors::cCreature encounter,location where,short num_walls) { short how_many,num_tries = 0; @@ -544,8 +556,8 @@ void pc_attack(short who_att,iLiving* target) { // TODO: These don't stack? if(cInvenSlot skill_item = attacker.has_abil_equip(eItemAbil::SKILL)) { - hit_adj += 5 * (skill_item->abil_data[0] / 2 + 1); - dam_adj += skill_item->abil_data[0] / 2; + hit_adj += 5 * (short(skill_item->abil_data[0]) / 2 + 1); + dam_adj += short(skill_item->abil_data[0]) / 2; } if(cInvenSlot skill_item = attacker.has_abil_equip(eItemAbil::GIANT_STRENGTH)) { dam_adj += skill_item->abil_data[0]; @@ -1028,21 +1040,7 @@ void do_combat_cast(location target) { iLiving* victim; cPlayer& caster = univ.current_pc(); bool allow_obstructed = false, allow_antimagic = false; - static std::set const oneHitSpell = - { - // dispell barrier - eSpell::DISPEL_BARRIER, - // magic spell - eSpell::DUMBFOUND, eSpell::FEAR, - eSpell::FLAME, eSpell::GOO, - eSpell::ICE_BOLT, eSpell::KILL, eSpell::POISON, - eSpell::POISON_MINOR, eSpell::SCARE, eSpell::SCRY_MONSTER, - eSpell::SLOW, eSpell::SPARK, eSpell::WRACK, - // priest spell - eSpell::CHARM_FOE, eSpell::CURSE, eSpell::DISPEL_UNDEAD, eSpell::HOLY_SCOURGE, - eSpell::STUMBLE, eSpell::TURN_UNDEAD, eSpell::WOUND, - }; - if(oneHitSpell.find(spell_being_cast)!=oneHitSpell.end() || (spell_being_cast == eSpell::NONE && spec_target_options % 10 == 1)) + if(spell_being_cast==eSpell::DISPEL_BARRIER || spell_missile_map.count(spell_being_cast)!=0 || (spell_being_cast == eSpell::NONE && spec_target_options % 10 == 1)) allow_obstructed = true; if(spell_being_cast == eSpell::NONE && spec_target_options / 10 == 2) allow_antimagic = false; // checkme: make no sense, allow_antimagic is always false @@ -4067,8 +4065,8 @@ short count_levels(location where,short radius) { for(short i = 0; i < univ.town.monst.size(); i++) if(monst_near(i,where,radius,0)) { if(!univ.town.monst[i].is_friendly()) - store = store - univ.town.monst[i].level; - else store = store + univ.town.monst[i].level; + store = store - int(univ.town.monst[i].level); + else store = store + int(univ.town.monst[i].level); } if(is_combat()) { for(short i = 0; i < 6; i++) diff --git a/src/game/boe.fileio.cpp b/src/game/boe.fileio.cpp index f67c0029..497a3012 100644 --- a/src/game/boe.fileio.cpp +++ b/src/game/boe.fileio.cpp @@ -59,7 +59,7 @@ void finish_load_party(){ // use user's easy mode and less wandering mode univ.party.easy_mode=get_bool_pref("EasyMode", false); - univ.party.less_wm=get_bool_pref("lesswm", false); + univ.party.less_wm=get_bool_pref("LessWanderingMonsters", false); // now if not in scen, this is it. if(!in_scen) { diff --git a/src/game/boe.party.cpp b/src/game/boe.party.cpp index 830da4c6..c549e55a 100644 --- a/src/game/boe.party.cpp +++ b/src/game/boe.party.cpp @@ -5,6 +5,7 @@ #include #include +#include #include "universe.hpp" @@ -1349,14 +1350,15 @@ void cast_town_spell(location where) { } // TODO: Currently, the node is called before any spell-specific behaviour (eg missiles) occurs. +extern std::set spell_missile_map; bool cast_spell_on_space(location where, eSpell spell) { short s1 = 0; for(auto const &spec_loc : univ.town->special_locs) { if(where != spec_loc) continue; bool need_redraw = false; - // TODO: Is there a way to skip this condition without breaking compatibility? - if(univ.town->get_special(spec_loc.spec).type == eSpecType::IF_CONTEXT) + eSpecType specType=univ.town->get_special(spec_loc.spec).type; + if (specType==eSpecType::IF_CONTEXT && (!univ.scenario.is_legacy || spell_missile_map.count(spell)==0)) run_special(eSpecCtx::TARGET, eSpecCtxType::TOWN, spec_loc.spec, where, &s1, nullptr, &need_redraw); if(need_redraw) redraw_terrain(); return !s1;