Improved killmove switching in effect scripts

This commit is contained in:
Eddoursul 2024-01-18 01:21:07 +01:00
parent 59698590b4
commit 7a86fcfb42
18 changed files with 56 additions and 41 deletions

BIN
scripts/_00E_KillMove.pex Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,35 @@
Scriptname _00E_KillMove Hidden
int Function Off() Global
GlobalVariable KillMove = Game.GetForm(0x100F19) as GlobalVariable
int iPrevValue = KillMove.GetValue() as int
KillMove.SetValue(0 as float)
Utility.SetINIBool("bVATSDisable:VATS", true)
return iPrevValue
EndFunction
int Function On() Global
GlobalVariable KillMove = Game.GetForm(0x100F19) as GlobalVariable
int iPrevValue = KillMove.GetValue() as int
KillMove.SetValue(1 as float)
Utility.SetINIBool("bVATSDisable:VATS", false)
return iPrevValue
EndFunction
int function SetValue(bool bValue) Global
if bValue
return On()
else
return Off()
endif
endfunction

View File

@ -8,12 +8,11 @@ Import _00E_TalentLibrary
Event onEffectStart(Actor akTarget, Actor akCaster)
if ((akTarget.GetLevel() - (PlayerLevel.GetValueInt())) > 4) || (akTarget.HasKeyword(MagicNoFreeze)) ; Debug only!
_00E_A1_ArcticWind_sEnemyTooPowerful.Show()
Else
akTarget.AddSpell(_00E_A1_ArcticWindFrozenAb)
KillMove.SetValueInt(0)
akTarget.AddSpell(_00E_A1_ArcticWindFrozenAb)
iKillMove = _00E_KillMove.Off()
EndIf
EndEvent
@ -21,9 +20,7 @@ EndEvent
Event OnEffectFinish(Actor akTarget, Actor akCaster)
akTarget.RemoveSpell(_00E_A1_ArcticWindFrozenAb)
If Utility.GetINIBool("bVATSDisable:VATS") == 0
KillMove.SetValueInt(1)
EndIf
_00E_KillMove.SetValue(iKillMove)
EndEvent
@ -32,6 +29,8 @@ EndEvent
; PROPERTIES
;=====================================================================================
int iKillMove
Actor Property PlayerREF Auto
Spell Property _00E_A1_ArcticWindFrozenAb Auto
@ -43,4 +42,3 @@ GlobalVariable Property KillMove Auto
Keyword Property MagicNoFreeze Auto
GlobalVariable Property PlayerLevel Auto

View File

@ -21,8 +21,7 @@ Event OnEffectStart(Actor akTarget, Actor akCaster)
fDurationFailsave = _00E_A2_EyeOfTheStormSP.GetNthEffectDuration(iDurationIndex)
iSound = MAGShoutSlowTimeActive02LP.Play(PlayerREF)
PlayerREF.PlaceAtMe(_00E_A2_EyeOfTheStormFailsaveExp, 1)
iKillMoveConfig = KillMove.GetValueInt()
KillMove.SetValueInt(0)
iKillMoveConfig = _00E_KillMove.Off()
akCaster.AddSpell(_00E_A2_EyeOfTheStormAb, False)
RegisterForSingleUpdate(fDurationFailsave)
@ -41,7 +40,7 @@ Event OnEffectFinish(Actor akTarget, Actor akCaster)
if (PlayerREF.HasSpell(_00E_A2_EyeOfTheStormAb))
Sound.StopInstance(iSound)
KillMove.SetValueInt(iKillMoveConfig)
_00E_KillMove.SetValue(iKillMoveConfig)
akCaster.RemoveSpell(_00E_A2_EyeOfTheStormAb)
endif

View File

@ -8,7 +8,7 @@ Import _00E_TalentLibrary
Event OnEffectStart(Actor Target, Actor Caster)
KillMove.SetValueInt(0)
iKillMove = _00E_KillMove.Off()
AudioCategoryPausedDuringMenu.Mute()
_00E_A2_EyeOfTheStormIMOD.Apply()
@ -17,9 +17,7 @@ EndEvent
Event OnEffectFinish(Actor akTarget, Actor akCaster)
If Utility.GetINIBool("bVATSDisable:VATS") == 0
KillMove.SetValueInt(1)
EndIf
_00E_KillMove.SetValue(iKillMove)
_00E_A2_EyeOfTheStormIMOD.Remove()
AudioCategoryPausedDuringMenu.UnMute()
@ -30,6 +28,8 @@ EndEvent
; PROPERTIES
;=====================================================================================
int iKillMove
ImagespaceModifier Property _00E_A2_EyeOfTheStormIMOD Auto
Actor Property PlayerREF Auto

View File

@ -17,7 +17,7 @@ EndEvent
Event OnEffectStart(Actor akTarget, Actor akCaster)
KillMove.SetValue(0)
iKillMove = _00E_KillMove.Off()
MAGPowerRacialHitskinM.Play(PlayerREF)
AudioCategorySFXDeath.Mute()
PlayerREF.GetActorBase().SetEssential(True)
@ -29,14 +29,10 @@ Event OnEffectFinish(Actor akTarget, Actor akCaster)
AudioCategorySFXDeath.UnMute()
PlayerREF.GetActorBase().SetEssential(False)
UnregisterForUpdate()
_00E_KillMove.SetValue(iKillMove)
EndEvent
Event OnUpdate()
EndEvent
;=====================================================================================
; FUNCTIONS
@ -100,6 +96,7 @@ EndFunction
; PROPERTIES
;=====================================================================================
int iKillMove
float iTriggerHealthPercentage
Explosion Property _00E_A2_WellOfLifeExplosionVisual Auto

View File

@ -2,20 +2,18 @@ Scriptname _00E_DisableKillMovesSC extends ObjectReference
Event OnTriggerEnter(ObjectReference akActionRef)
if akActionRef == Game.GetPlayer()
KillMove.SetValueInt(0)
if akActionRef == Game.GetForm(0x14)
iKillMove = _00E_KillMove.Off()
EndIf
EndEvent
Event OnTriggerLeave(ObjectReference akActionRef)
if akActionRef == Game.GetPlayer()
If Utility.GetINIBool("bVATSDisable:VATS") == 0
KillMove.SetValueInt(1)
EndIf
if akActionRef == Game.GetForm(0x14)
_00E_KillMove.SetValue(iKillMove)
EndIf
EndEvent
GlobalVariable Property KillMove Auto
int iKillMove

View File

@ -1,4 +1,4 @@
Scriptname _00E_EPHandler
Scriptname _00E_EPHandler Hidden
Function GiveEP(int ToGive) Global

View File

@ -449,18 +449,6 @@ Function DijaamAttackPlayer()
EndFunction
Function ToggleKillmoves()
if KillMove.GetValue() == 1
bKillMovesDeactivated = true
KillMove.SetValue(0)
ElseIf KillMove.GetValue() == 0 && bKillMovesDeactivated == true
bKillMovesDeactivated = false
KillMove.SetValue(1)
EndIf
EndFunction
Function DijaamLeave()
FadeToBlackIMOD.Apply()

View File

@ -23,7 +23,7 @@ EndFunction
;BEGIN FRAGMENT Fragment_7
Function Fragment_7()
;BEGIN CODE
NQ_G_07.ToggleKillmoves()
; 2.1: toggling killmove removed
;END CODE
EndFunction
;END FRAGMENT