From efad33bddf8b97cb41318d1ec17840ab5bc5a372 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Fri, 16 Jan 2015 03:23:16 -0500 Subject: [PATCH] Fix avatar spell doing nothing when cast outside of combat mode --- src/boe.combat.cpp | 10 ++-------- src/boe.party.cpp | 11 +++++++++++ src/classes/pc.cpp | 11 +++++++++++ src/classes/pc.h | 1 + 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/boe.combat.cpp b/src/boe.combat.cpp index 019e990f..4569829a 100644 --- a/src/boe.combat.cpp +++ b/src/boe.combat.cpp @@ -4556,14 +4556,8 @@ void combat_immed_priest_cast(short current_pc, eSpell spell_num, bool freebie) add_string_to_buf(" " + univ.party[current_pc].name + " is an avatar!"); heal_pc(current_pc,200); cure_pc(current_pc,8); - univ.party[current_pc].status[eStatus::BLESS_CURSE] = 8; - univ.party[current_pc].status[eStatus::HASTE_SLOW] = 8; - univ.party[current_pc].status[eStatus::INVULNERABLE] = 3; - univ.party[current_pc].status[eStatus::MAGIC_RESISTANCE] = 8; - univ.party[current_pc].status[eStatus::WEBS] = 0; - univ.party[current_pc].status[eStatus::DISEASE] = 0; - univ.party[current_pc].status[eStatus::DUMB] = 0; - univ.party[current_pc].status[eStatus::MARTYRS_SHIELD] = 8; + // TODO: Move the heal/cure over to this function as well + univ.party[current_pc].avatar(); break; case eSpell::CURSE_ALL: case eSpell::CHARM_MASS: case eSpell::PESTILENCE: diff --git a/src/boe.party.cpp b/src/boe.party.cpp index 83eda536..d25e6cfe 100644 --- a/src/boe.party.cpp +++ b/src/boe.party.cpp @@ -1451,6 +1451,17 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) { } } break; + + case eSpell::AVATAR: + heal_pc(pc_num,200); + cure_pc(pc_num,8); + // TODO: Move the heal/cure over to this function as well + univ.party[pc_num].avatar(); + break; + + default: + add_string_to_buf(" Error: Spell not implemented for town.", 4); + break; } } diff --git a/src/classes/pc.cpp b/src/classes/pc.cpp index 4cd9ae7d..f649d1a2 100644 --- a/src/classes/pc.cpp +++ b/src/classes/pc.cpp @@ -97,6 +97,17 @@ void cPlayer::apply_status(eStatus which, int how_much) { status[which] = max(status[which],0); } +void cPlayer::avatar() { + status[eStatus::BLESS_CURSE] = 8; + status[eStatus::HASTE_SLOW] = 8; + status[eStatus::INVULNERABLE] = 3; + status[eStatus::MAGIC_RESISTANCE] = 8; + status[eStatus::WEBS] = 0; + status[eStatus::DISEASE] = 0; + status[eStatus::DUMB] = 0; + status[eStatus::MARTYRS_SHIELD] = 8; +} + void cPlayer::finish_create() { // Start items switch(race) { diff --git a/src/classes/pc.h b/src/classes/pc.h index f92c7f07..0f1f4017 100644 --- a/src/classes/pc.h +++ b/src/classes/pc.h @@ -50,6 +50,7 @@ public: void finish_create(); void apply_status(eStatus which, int how_much); + void avatar(); void append(legacy::pc_record_type old); cPlayer();