1
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

129 lines
4.1 KiB

ScriptName _00E_Theriantrophist_AttributeStorage Extends Quest
;-- Variables ---------------------------------------
Float damageResist
Float healthMod
Float humanDamageResist
Float humanSpeedMult
Float speedMult
Float staminaMod
Float unarmedDamage
;-- Properties --------------------------------------
Actor Property PlayerREF Auto
Weapon Property _00E_Theriantrophist_Claws Auto
Spell Property _00E_Theriantrophist_DisplayArmorSpell Auto
Spell Property _00E_Theriantrophist_DisplayDamageSpell Auto
Spell Property _00E_Theriantrophist_DisplayHealthSpell Auto
Spell Property _00E_Theriantrophist_DisplaySpeedMultSpell Auto
Spell Property _00E_Theriantrophist_DisplayStaminaSpell Auto
MiscObject Property _00E_UpdateInventoryItem Auto
;-- Functions ---------------------------------------
; Skipped compiler generated GetState
; Skipped compiler generated GotoState
Function clearManagedAttributes()
unarmedDamage = PlayerREF.getAV("unarmedDamage")
humanDamageResist = PlayerREF.getAV("damageResist")
humanSpeedMult = PlayerREF.getAV("speedMult")
damageResist = humanDamageResist
speedMult = humanSpeedMult
healthMod = 0 as Float
staminaMod = 0 as Float
EndFunction
Function UpdateDisplaySpell(Spell displaySpell, Float value)
If PlayerREF.hasSpell(displaySpell as Form)
PlayerREF.removeSpell(displaySpell)
displaySpell.setNthEffectMagnitude(0, value)
PlayerREF.addSpell(displaySpell, False)
EndIf
EndFunction
Function ModWolfHealth(Float mod)
healthMod += mod
PlayerREF.modAv("health", mod)
Self.UpdateDisplaySpell(_00E_Theriantrophist_DisplayHealthSpell, healthMod)
EndFunction
Function ModWolfStamina(Float mod)
staminaMod += mod
PlayerREF.modAv("stamina", mod)
Self.UpdateDisplaySpell(_00E_Theriantrophist_DisplayStaminaSpell, staminaMod)
EndFunction
Function ForceWolfUnarmedDmg(Float value)
unarmedDamage = value
_00E_Theriantrophist_Claws.setBaseDamage(unarmedDamage as Int)
Self.UpdateDisplaySpell(_00E_Theriantrophist_DisplayDamageSpell, unarmedDamage)
EndFunction
Function ModWolfUnarmedDmg(Float mod)
Self.ForceWolfUnarmedDmg(unarmedDamage + mod)
EndFunction
Function ForceWolfDamageResist(Float value)
damageResist = value
PlayerREF.forceAV("damageResist", damageResist)
Self.UpdateDisplaySpell(_00E_Theriantrophist_DisplayArmorSpell, damageResist)
EndFunction
Function ModWolfDamageResist(Float mod)
Self.ForceWolfDamageResist(damageResist + mod)
EndFunction
Function ForceWolfSpeedMult(Float value)
speedMult = value
PlayerREF.forceAV("speedMult", speedMult)
Self.updateSpeedMult()
Self.UpdateDisplaySpell(_00E_Theriantrophist_DisplaySpeedMultSpell, speedMult - 100 as Float)
EndFunction
Function ModWolfSpeedMult(Float mod)
Self.ForceWolfSpeedMult(speedMult + mod)
EndFunction
Function RestoreHumanAv()
PlayerREF.modAv("health", -healthMod)
PlayerREF.modAv("stamina", -staminaMod)
Self.ForceWolfDamageResist(humanDamageResist)
Self.ForceWolfSpeedMult(humanSpeedMult)
Self.updateSpeedMult()
EndFunction
Function ModWolfAV(String attribute, Float mod)
If attribute == "health"
Self.ModWolfHealth(mod)
ElseIf attribute == "stamina"
Self.ModWolfStamina(mod)
ElseIf attribute == "unarmedDamage"
Self.ModWolfUnarmedDmg(mod)
ElseIf attribute == "damageResist"
Self.ModWolfDamageResist(mod)
ElseIf attribute == "speedMult"
Self.ModWolfSpeedMult(mod)
Else
Debug.MessageBox("Try to mod unknown attribute in _00E_Theriantrophist_AttributeStorage: " + attribute + "; Please create a bugticket")
EndIf
EndFunction
Function updateSpeedMult()
PlayerREF.additem(_00E_UpdateInventoryItem as Form, 1, True)
PlayerREF.removeItem(_00E_UpdateInventoryItem as Form, 1, True, None)
EndFunction
Function renewNotPersistentStats()
Self.ForceWolfDamageResist(damageResist)
Self.ForceWolfUnarmedDmg(unarmedDamage)
Self.ForceWolfSpeedMult(speedMult)
Self.UpdateDisplaySpell(_00E_Theriantrophist_DisplayHealthSpell, healthMod)
Self.UpdateDisplaySpell(_00E_Theriantrophist_DisplayStaminaSpell, staminaMod)
EndFunction
Function updateAfterRaceSwitch()
Self.ForceWolfDamageResist(damageResist)
Self.ForceWolfSpeedMult(speedMult)
EndFunction