Skip to content

Commit

Permalink
found out the difference between spell disruption checks and concentr…
Browse files Browse the repository at this point in the history
…ation

renamed the disruption function and fixed the comments accordingly
fixing concentration remains a TODO
  • Loading branch information
lynxlynxlynx committed May 8, 2014
1 parent 6c1967b commit 3b5706b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions gemrb/core/Scriptable/Actor.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3739,13 +3739,16 @@ void Actor::GetHit(int damage, int spellLevel)
Effect *fx = EffectQueue::CreateEffect(fx_cure_sleep_ref, 0, 0, FX_DURATION_INSTANT_PERMANENT); Effect *fx = EffectQueue::CreateEffect(fx_cure_sleep_ref, 0, 0, FX_DURATION_INSTANT_PERMANENT);
fxqueue.AddEffect(fx); fxqueue.AddEffect(fx);
} }
if (CheckCastingInterrupt(damage, spellLevel)) { if (CheckSpellDisruption(damage, spellLevel)) {
InterruptCasting = true; InterruptCasting = true;
} }
} }


// TODO: check that this isn't the same thing we have in GSUtils (that one is missing a debug string in the original) // this has no effect in adnd
bool Actor::CheckCastingInterrupt(int damage, int spellLevel) // iwd2 however has two mechanisms: spell disruption and concentration checks:
// - disruption is checked when a caster is damaged while casting
// - concentration is checked when casting is taking place <= 5' from an enemy
bool Actor::CheckSpellDisruption(int damage, int spellLevel)
{ {
if (!third) { if (!third) {
return true; return true;
Expand Down
4 changes: 2 additions & 2 deletions gemrb/core/Scriptable/Actor.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -549,8 +549,8 @@ class GEM_EXPORT Actor : public Movable {
void DialogInterrupt(); void DialogInterrupt();
/* called when actor was hit */ /* called when actor was hit */
void GetHit(int damage=0, int spellLevel=0); void GetHit(int damage=0, int spellLevel=0);
/* checks whether concentration cancels damage taken disrupting casting */ /* checks whether taking damage should disrupt spellcasting */
bool CheckCastingInterrupt(int damage, int spellLevel); bool CheckSpellDisruption(int damage, int spellLevel);
/* called when actor starts to cast a spell*/ /* called when actor starts to cast a spell*/
bool HandleCastingStance(const ieResRef SpellResRef, bool deplete, bool instant); bool HandleCastingStance(const ieResRef SpellResRef, bool deplete, bool instant);
/* check if the actor should be just knocked out by a lethal hit */ /* check if the actor should be just knocked out by a lethal hit */
Expand Down

0 comments on commit 3b5706b

Please sign in to comment.