Cleaned up TrapExplosiveGas

This commit is contained in:
Eddoursul 2024-01-19 04:25:20 +01:00
parent 8c999a6fd6
commit 2db96586c2
2 changed files with 3 additions and 19 deletions

Binary file not shown.

View File

@ -1,7 +1,4 @@
scriptName TrapExplosiveGas extends objectReference scriptName TrapExplosiveGas extends objectReference
;
;
;==================================================
formlist property flExplodesGasTrapOnHit auto formlist property flExplodesGasTrapOnHit auto
{projectiles that will set this off when they hit} {projectiles that will set this off when they hit}
@ -18,7 +15,6 @@ formlist property flExplodesGasTrapEquippedSpell auto
formlist property trapGasWeapon auto formlist property trapGasWeapon auto
{weapons that will set this off on hit, specifically explosions} {weapons that will set this off on hit, specifically explosions}
bool actorHasWeaponsDrawn = TRUE ;remove this later
bool property checkActorEquippedItems = TRUE auto bool property checkActorEquippedItems = TRUE auto
{Whether or not to check items the player is carrying {Whether or not to check items the player is carrying
default = True on explosive gas default = True on explosive gas
@ -32,11 +28,10 @@ keyword property flameKeyword Auto
keyword property lightningKeyword auto keyword property lightningKeyword auto
bool property lightningIgnites = TRUE Auto bool property lightningIgnites = TRUE Auto
{if this is true lightning should ignite this trap {if this is true lightning should ignite this trap
default == false} default == true}
light property Torch01 auto light property Torch01 auto
projectile property storedProjectile auto hidden projectile property storedProjectile auto hidden
objectReference property storedObjRef auto hidden
MagicEffect property storedEffect1 auto hidden MagicEffect property storedEffect1 auto hidden
MagicEffect property storedEffect2 auto hidden MagicEffect property storedEffect2 auto hidden
MagicEffect property storedEffect3 auto hidden MagicEffect property storedEffect3 auto hidden
@ -48,17 +43,13 @@ auto state waiting
event onHit(objectReference akAggressor, form akWeapon, projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) event onHit(objectReference akAggressor, form akWeapon, projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
if !akProjectile || akProjectile != storedProjectile if !akProjectile || akProjectile != storedProjectile
storedProjectile = akProjectile storedProjectile = akProjectile
; debug.Trace(self + " is testing " + akProjectile + " due to onHit, akWeapon = " + akWeapon)
;USKP 1.3.2 added NONE checks due to numerous Papyrus errors. ;USKP 1.3.2 added NONE checks due to numerous Papyrus errors.
If( (trapGasWeapon != NONE && trapGasWeapon.hasForm(akWeapon)) || akweapon == torch01 ) If( (trapGasWeapon != NONE && trapGasWeapon.hasForm(akWeapon)) || akweapon == torch01 )
; debug.Trace(self + " is exploding due to " + akWeapon + " being in formlist " + TrapGasWeapon)
GasExplode(akAggressor) GasExplode(akAggressor)
ElseIf( flExplodesGasTrapOnHit != NONE && flExplodesGasTrapOnHit.hasForm(akProjectile) ) ElseIf( flExplodesGasTrapOnHit != NONE && flExplodesGasTrapOnHit.hasForm(akProjectile) )
; debug.Trace(self + " is exploding due to " + akProjectile)
GasExplode(akAggressor) GasExplode(akAggressor)
ElseIf akWeapon.HasKeyword(flameKeyword) || ( lightningIgnites && akWeapon.HasKeyword(lightningKeyword) ) ElseIf akWeapon.HasKeyword(flameKeyword) || ( lightningIgnites && akWeapon.HasKeyword(lightningKeyword) )
; debug.Trace(self + " is exploding due to " + akWeapon + " - hasKeyword")
GasExplode(akAggressor) GasExplode(akAggressor)
endif endif
endif endif
@ -81,15 +72,11 @@ auto state waiting
storedEffect4 = akEffect storedEffect4 = akEffect
storedEffectIncrement = 1 storedEffectIncrement = 1
endif endif
; debug.Trace(self + " is testing " + akEffect + " due to onMagicEffectApply")
if flExplodesGasTrapOnMagicEffectApply.hasForm(akEffect as form) if flExplodesGasTrapOnMagicEffectApply.hasForm(akEffect as form)
; debug.Trace(self + " is exploding due to " + akEffect)
GasExplode(akCaster) GasExplode(akCaster)
elseif akEffect.hasKeyword(flameKeyword) elseif akEffect.hasKeyword(flameKeyword)
; debug.Trace(self + " is exploding due to " + akEffect)
GasExplode(akCaster) GasExplode(akCaster)
elseif lightningIgnites && akEffect.hasKeyword(lightningKeyword) elseif lightningIgnites && akEffect.hasKeyword(lightningKeyword)
; debug.Trace(self + " is exploding due to " + akEffect)
GasExplode(akCaster) GasExplode(akCaster)
endif endif
endif endif
@ -128,10 +115,7 @@ auto state waiting
EndState EndState
function GasExplode(objectReference causeActor) function GasExplode(objectReference causeActor)
;if (causeActor as actor) self.setActorCause(causeActor as actor)
self.setActorCause(causeActor as actor)
;endif
; debug.Trace(self + " has exploded")
self.damageObject(5) self.damageObject(5)
endFunction endFunction
@ -161,5 +145,5 @@ event onReset()
endEvent endEvent
event OnDestructionStageChanged(int aiOldStage, int aiCurrentStage) event OnDestructionStageChanged(int aiOldStage, int aiCurrentStage)
; debug.Trace(self + " has received destruction event #" + aiCurrentStage) ;
endEvent endEvent