From: Laszlo T. <ave...@us...> - 2011-09-03 11:13:31
|
gemrb: Infinity Engine emulator The branch master has been updated via 81cd022b8ddd67073ac148d8d31689001cfabd46 (commit) Summary of changes: gemrb/GUIScripts/bg1/GUICommonWindows.py | 3 +- gemrb/GUIScripts/bg2/GUICommonWindows.py | 3 +- gemrb/GUIScripts/iwd/GUICommonWindows.py | 3 +- gemrb/GUIScripts/iwd2/GUICommonWindows.py | 44 ++++++++++++++++++++-------- 4 files changed, 37 insertions(+), 16 deletions(-) from a7761c38bdfc6bfb5d256d7bd07796fc4347f414 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=81cd022b8ddd67073ac148d8d31689001cfabd46 commit 81cd022b8ddd67073ac148d8d31689001cfabd46 Author: Avenger <ave...@so...> Date: Sat Sep 3 13:10:37 2011 +0200 don't cast self affecting spell when setting up quickspell slots (fixes 3385895) diff --git a/gemrb/GUIScripts/bg1/GUICommonWindows.py b/gemrb/GUIScripts/bg1/GUICommonWindows.py index c4f5dbe..fec6d66 100644 --- a/gemrb/GUIScripts/bg1/GUICommonWindows.py +++ b/gemrb/GUIScripts/bg1/GUICommonWindows.py @@ -552,7 +552,8 @@ def SpellPressed (): #if spell has no target, return #otherwise continue with casting Target = GemRB.SetupQuickSpell (pc, slot, Spell, Type, 1) - if Target == 5: + #sabotage the immediate casting of self targeting spells + if Target == 5 or Target == 7: Type = -1 GemRB.GameControlSetTargetMode (TARGET_MODE_NONE) diff --git a/gemrb/GUIScripts/bg2/GUICommonWindows.py b/gemrb/GUIScripts/bg2/GUICommonWindows.py index 0f769b7..316d6f0 100644 --- a/gemrb/GUIScripts/bg2/GUICommonWindows.py +++ b/gemrb/GUIScripts/bg2/GUICommonWindows.py @@ -624,7 +624,8 @@ def SpellPressed (): #if spell has no target, return #otherwise continue with casting Target = GemRB.SetupQuickSpell (pc, slot, Spell, Type, 1) - if Target == 5: + #sabotage the immediate casting of self targeting spells + if Target == 5 or Target == 7: Type = -1 GemRB.GameControlSetTargetMode (TARGET_MODE_NONE) diff --git a/gemrb/GUIScripts/iwd/GUICommonWindows.py b/gemrb/GUIScripts/iwd/GUICommonWindows.py index cd66c14..a35a8c8 100644 --- a/gemrb/GUIScripts/iwd/GUICommonWindows.py +++ b/gemrb/GUIScripts/iwd/GUICommonWindows.py @@ -547,7 +547,8 @@ def SpellPressed (): #if spell has no target, return #otherwise continue with casting Target = GemRB.SetupQuickSpell (pc, slot, Spell, Type, 1) - if Target == 5: + #sabotage the immediate casting of self targeting spells + if Target == 5 or Target == 7: Type = -1 GemRB.GameControlSetTargetMode (TARGET_MODE_NONE) diff --git a/gemrb/GUIScripts/iwd2/GUICommonWindows.py b/gemrb/GUIScripts/iwd2/GUICommonWindows.py index 529a442..09ff386 100644 --- a/gemrb/GUIScripts/iwd2/GUICommonWindows.py +++ b/gemrb/GUIScripts/iwd2/GUICommonWindows.py @@ -118,20 +118,20 @@ def SetupMenuWindowControls (Window, Gears, ReturnToGame): return def AIPress (): - """Toggles the party AI.""" + """Toggles the party AI.""" - Button = PortraitWindow.GetControl (6) - AI = GemRB.GetMessageWindowSize () & GS_PARTYAI + Button = PortraitWindow.GetControl (6) + AI = GemRB.GetMessageWindowSize () & GS_PARTYAI - if AI: - GemRB.GameSetScreenFlags (GS_PARTYAI, OP_NAND) - Button.SetTooltip (15918) - GemRB.SetVar ("AI", 0) - else: - GemRB.GameSetScreenFlags (GS_PARTYAI, OP_OR) - Button.SetTooltip (15917) - GemRB.SetVar ("AI", GS_PARTYAI) - return + if AI: + GemRB.GameSetScreenFlags (GS_PARTYAI, OP_NAND) + Button.SetTooltip (15918) + GemRB.SetVar ("AI", 0) + else: + GemRB.GameSetScreenFlags (GS_PARTYAI, OP_OR) + Button.SetTooltip (15917) + GemRB.SetVar ("AI", GS_PARTYAI) + return def EmptyControls (): global PortraitWindow @@ -395,8 +395,26 @@ def SpellPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_CAST) Spell = GemRB.GetVar ("Spell") Type = GemRB.GetVar ("Type") + slot = GemRB.GetVar ("QSpell") + if slot>=0: + #setup quickspell slot + #if spell has no target, return + #otherwise continue with casting + Target = GemRB.SetupQuickSpell (pc, slot, Spell, Type, 1) + # sabotage the immediate casting of self targeting spells + if Target == 5 or Target == 7: + Type = -1 + GemRB.GameControlSetTargetMode (TARGET_MODE_NONE) + + if Type==-1: + GemRB.SetVar ("ActionLevel", 0) + GemRB.SetVar("Type", 0) GemRB.SpellCast (pc, Type, Spell, 1) - GemRB.SetVar ("ActionLevel", 0) + if GemRB.GetVar ("Type")!=-1: + GemRB.SetVar ("ActionLevel", 0) + #init spell list + GemRB.SpellCast (pc, -1, 0, 1) + GemRB.SetVar ("TopIndex", 0) UpdateActionsWindow () return ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |