Fix avatar spell doing nothing when cast outside of combat mode

This commit is contained in:
2015-01-16 03:23:16 -05:00
parent 31b63b1ab7
commit efad33bddf
4 changed files with 25 additions and 8 deletions

View File

@@ -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:

View File

@@ -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;
}
}

View File

@@ -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) {

View File

@@ -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();