From 032c27655276455fa1b0bea91bade7dfad310d55 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Mon, 12 Jan 2015 23:18:21 -0500 Subject: [PATCH] Handle more status effects for weapon abilities --- src/boe.combat.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++++- src/boe.monster.cpp | 7 +++++-- src/boe.text.cpp | 4 ++++ 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/src/boe.combat.cpp b/src/boe.combat.cpp index 4da95fef8..9b5a1e134 100644 --- a/src/boe.combat.cpp +++ b/src/boe.combat.cpp @@ -672,7 +672,14 @@ void pc_attack_weapon(short who_att,short target,short hit_adj,short dam_adj,cIt } if((weap.ability == eItemAbil::STATUS_WEAPON) && (get_ran(1,0,1) == 1)) { switch(eStatus(weap.abil_data[1])) { - // TODO: Handle other status types + // TODO: It should be possible to make monsters support magic resistance and invulnerability, at least. + // Maybe also poisoned weapon and invisibility. + case eStatus::MAIN: // Not a valid status + case eStatus::INVISIBLE: // Not supported by monsters + case eStatus::MAGIC_RESISTANCE: // Not supported by monsters + case eStatus::INVULNERABLE: // Not supported by monsters + case eStatus::POISONED_WEAPON: // Not supported by monsters + break; case eStatus::POISON: add_string_to_buf(" Blade drips venom."); poison_monst(which_m,weap.abil_data[0] / 2); @@ -681,6 +688,48 @@ void pc_attack_weapon(short who_att,short target,short hit_adj,short dam_adj,cIt add_string_to_buf(" Blade drips acid."); acid_monst(which_m,weap.abil_data[0] / 2); break; + case eStatus::BLESS_CURSE: + add_string_to_buf(" Blade leaks a dark aura."); + curse_monst(which_m, weap.abil_data[0] / 2); + break; + case eStatus::HASTE_SLOW: + add_string_to_buf(" Blade leaks a smoky aura."); + slow_monst(which_m, weap.abil_data[0] / 2); + break; + case eStatus::WEBS: + add_string_to_buf(" Blade drips goo."); + web_monst(which_m, weap.abil_data[0] / 2); + break; + case eStatus::DISEASE: + add_string_to_buf(" Blade drips bile."); + disease_monst(which_m, weap.abil_data[0] / 2); + break; + case eStatus::DUMB: + add_string_to_buf(" Blade leaks a misty aura."); + dumbfound_monst(which_m, weap.abil_data[0] / 2); + break; + case eStatus::ASLEEP: + add_string_to_buf(" Blade emits coruscating lights."); + charm_monst(which_m, 20 + r2 + spec_dam, eStatus::ASLEEP, weap.abil_data[0] / 2); + break; + case eStatus::PARALYZED: + add_string_to_buf(" Blade emits a purple flash."); + charm_monst(which_m, 20 + r2 + spec_dam, eStatus::PARALYZED, weap.abil_data[0] / 2); + break; + case eStatus::CHARM: + add_string_to_buf(" Blade leaks a bright aura."); + // Higher penalty means more likely to resist. + charm_monst(which_m, 20 + r2 + spec_dam - weap.abil_data[0] / 2, eStatus::CHARM, 0); + break; + case eStatus::FORCECAGE: + add_string_to_buf(" Blade emits a green flash."); + charm_monst(which_m, r2 + spec_dam - weap.abil_data[0] / 2, eStatus::FORCECAGE, 0); + break; + case eStatus::MARTYRS_SHIELD: + add_string_to_buf(" Blade leaks an odd-coloured aura."); + which_m->status[eStatus::MARTYRS_SHIELD] -= weap.abil_data[0] / 2; + // TODO: Maybe clip it to 0? + break; } } if((weap.ability == eItemAbil::SOULSUCKER) && (get_ran(1,0,1) == 1)) { diff --git a/src/boe.monster.cpp b/src/boe.monster.cpp index ebc66ed93..23bf94754 100644 --- a/src/boe.monster.cpp +++ b/src/boe.monster.cpp @@ -1167,8 +1167,11 @@ void charm_monst(cCreature *which_m,short penalty,eStatus which_status,short amo if(which_status == eStatus::CHARM) { which_m->attitude = 2; monst_spell_note(which_m->number,23); - } - else { + } else if(which_status == eStatus::FORCECAGE) { + which_m->status[eStatus::FORCECAGE] = 8; + univ.town.set_force_cage(which_m->cur_loc.x, which_m->cur_loc.y, true); + monst_spell_note(which_m->number,52); + } else { which_m->status[which_status] = amount; if(which_status == eStatus::ASLEEP && (amount >= 0)) monst_spell_note(which_m->number,28); diff --git a/src/boe.text.cpp b/src/boe.text.cpp index 83cbded41..c5b108c73 100644 --- a/src/boe.text.cpp +++ b/src/boe.text.cpp @@ -1114,6 +1114,10 @@ void monst_spell_note(m_num_t number,short which_mess) { break; case 51: msg = " " + msg + " is obliterated!"; + break; + case 52: + msg = " " + msg + " is trapped!"; + break; } if(which_mess > 0)