Added Spells:CharmDisablesSpecialAbilities

This commit is contained in:
Xackery Xtal
2019-01-21 20:29:12 -08:00
parent 7857bc45fb
commit 44f85f140c
3 changed files with 7 additions and 0 deletions
+5
View File
@@ -208,6 +208,7 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
default_accuracy_rating = npc_type_data->accuracy_rating;
default_avoidance_rating = npc_type_data->avoidance_rating;
default_atk = npc_type_data->ATK;
strn0cpy(default_special_abilities, npc_type_data->special_abilities, 512);
// used for when getting charmed, if 0, doesn't swap
charm_ac = npc_type_data->charm_ac;
@@ -2840,6 +2841,8 @@ void NPC::ModifyStatsOnCharm(bool bRemoved)
base_damage = round((default_max_dmg - default_min_dmg) / 1.9);
min_damage = default_min_dmg - round(base_damage / 10.0);
}
if (RuleB(Spells, CharmDisablesSpecialAbilities))
ProcessSpecialAbilities(default_special_abilities);
} else {
if (charm_ac)
AC = charm_ac;
@@ -2855,6 +2858,8 @@ void NPC::ModifyStatsOnCharm(bool bRemoved)
base_damage = round((charm_max_dmg - charm_min_dmg) / 1.9);
min_damage = charm_min_dmg - round(base_damage / 10.0);
}
if (RuleB(Spells, CharmDisablesSpecialAbilities))
ClearSpecialAbilities();
}
// the rest of the stats aren't cached, so lets just do these two instead of full CalcBonuses()
SetAttackTimer();
+1
View File
@@ -538,6 +538,7 @@ protected:
int default_accuracy_rating;
int default_avoidance_rating;
int default_atk;
char default_special_abilities[512];
// when charmed, switch to these
int charm_ac;