Skip to content

Commit

Permalink
partly reverted old 3f9adcb: don't mix disruption and concentration
Browse files Browse the repository at this point in the history
once we're in that branch, we already know the checks failed, so
don't give them another chance with a different calculation
  • Loading branch information
lynxlynxlynx committed May 8, 2014
1 parent ef47a1e commit 0a8af6c
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions gemrb/core/GameScript/GSUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2575,31 +2575,13 @@ inline static bool InterruptSpellcasting(Scriptable* Sender) {

// ouch, we got hit
if (Sender->InterruptCasting) {
int roll = 0;

// iwd2 does an extra concentration check first:
// d20 + Concentration Skill Level + Constitution bonus (+4 Combat casting feat) >= 15 + spell level
if (core->HasFeature(GF_3ED_RULES)) {
roll = core->Roll(1, 20, 0); // TODO: check if the original does a lucky roll
roll += caster->GetStat(IE_CONCENTRATION);
roll += caster->GetAbilityBonus(IE_CON);
if (caster->HasFeat(FEAT_COMBAT_CASTING)) {
roll += 4;
}
Spell* spl = gamedata->GetSpell(Sender->SpellResRef, true);
if (!spl) return false;
roll -= spl->SpellLevel;
gamedata->FreeSpell(spl, Sender->SpellResRef, false);
}
if (roll < 15) {
if (caster->InParty) {
displaymsg->DisplayConstantString(STR_SPELLDISRUPT, DMC_WHITE, Sender);
} else {
displaymsg->DisplayConstantStringName(STR_SPELL_FAILED, DMC_WHITE, Sender);
}
DisplayStringCore(Sender, VB_SPELL_DISRUPTED, DS_CONSOLE|DS_CONST );
return true;
if (caster->InParty) {
displaymsg->DisplayConstantString(STR_SPELLDISRUPT, DMC_WHITE, Sender);
} else {
displaymsg->DisplayConstantStringName(STR_SPELL_FAILED, DMC_WHITE, Sender);
}
DisplayStringCore(Sender, VB_SPELL_DISRUPTED, DS_CONSOLE|DS_CONST );
return true;
}

// abort casting on invisible or dead targets
Expand Down

0 comments on commit 0a8af6c

Please sign in to comment.