Entropic Blood: selection of a victim happens by pressing "Activate" instead of just pointing

This commit is contained in:
Eddoursul 2024-07-31 15:15:17 +02:00
parent fb076c753c
commit 54aa09c3c2
6 changed files with 135 additions and 132 deletions

Binary file not shown.

View File

@ -10,7 +10,21 @@ Import Utility
Auto State Marking
Event OnCrosshairRefChange(ObjectReference ref)
Event OnControlUp(string control, float HoldTime)
Actor rTarget = Game.GetCurrentCrosshairRef() as Actor
if ! rTarget || rTarget == Game.GetForm(0x14)
return
endif
If _00E_A2_EldritchBloodGlobal.GetValueInt() == 1
EldritchBloodEffectScript.SelectEnemy(rTarget)
EndIf
EndEvent
Event OnCrosshairRefChange(ObjectReference ref)
if lastTarget != None
lastTarget.blockActivation(false)
@ -21,17 +35,9 @@ Event OnCrosshairRefChange(ObjectReference ref)
ref.blockActivation(true)
endif
If _00E_A2_EldritchBloodGlobal.GetValueInt() == 1
If ref as Actor && ref != Game.GetForm(0x14)
EldritchBloodEffectScript.SelectEnemy(ref as Actor)
EndIf
Else
UnregisterForCrosshairRef()
EndIf
EndEvent
EndEvent
Event OnAnimationEvent(ObjectReference akSource, string asEventName)
Event OnAnimationEvent(ObjectReference akSource, string asEventName)
if(akSource == akSelfRef && asEventName == "weaponSwing")
if iAttackCounter == 0
@ -44,23 +50,19 @@ Event OnAnimationEvent(ObjectReference akSource, string asEventName)
EndIf
EndIf
EndEvent
EndEvent
Event OnObjectEquipped(Form equippedObject, ObjectReference reference)
Event OnObjectEquipped(Form equippedObject, ObjectReference reference)
Shout equippedShout = equippedObject as Shout
if(!equippedShout)
if ! equippedObject as Shout
; Debug.Notification(sMarkingModeInterrupted)
_00E_MarkingTalents_sMarkingModeInterrupted.Show()
EldritchBloodEffectScript.abort()
EndIf
EndEvent
EndEvent
Event OnSpellCast(Form akSpell)
Shout equippedShout = akSpell as Shout
Event OnSpellCast(Form akSpell)
if akSpell != _00E_A2_EldritchBloodSP
; Debug.Notification(sMarkingModeInterrupted)
@ -68,15 +70,15 @@ Event OnSpellCast(Form akSpell)
EldritchBloodEffectScript.abort()
EndIf
EndEvent
EndEvent
Event OnPlayerBowShot(Weapon akWeapon, Ammo akAmmo, float afPower, bool abSunGazing)
Event OnPlayerBowShot(Weapon akWeapon, Ammo akAmmo, float afPower, bool abSunGazing)
; Debug.Notification(sMarkingModeInterrupted)
_00E_MarkingTalents_sMarkingModeInterrupted.Show()
EldritchBloodEffectScript.abort()
EndEvent
EndEvent
EndState
@ -93,21 +95,28 @@ Function EnterMarkingMode(Float iReach, _00E_A2_EldritchBloodPlayerSC _00E_A2_El
SetINIFloat("fActivatePickLength:Interface", iReach)
EldritchBloodEffectScript = _00E_A2_EldritchBloodMEScript
RegisterForCrosshairRef()
RegisterForControl("Activate")
EndFunction
Function ExitMarkingMode()
iAttackCounter = 0
UnregisterForAllControls()
UnregisterForCrosshairRef()
UnregisterForAnimationEvent(akSelfRef, "weaponSwing")
; Restore activation reach
if fActivatePickLengthBefore <= 0
fActivatePickLengthBefore = 150.0
endif
SetINIFloat("fActivatePickLength:Interface", fActivatePickLengthBefore)
if lastTarget != None
lastTarget.blockActivation(false)
EndIf
lastTarget = None
iAttackCounter = 0
UnregisterForAnimationEvent(akSelfRef, "weaponSwing")
UnregisterForCrosshairRef()
SetINIFloat("fActivatePickLength:Interface", 150)
EndFunction
;=====================================================================================

View File

@ -51,7 +51,7 @@ EndFunction
State MarkTargets
Event OnBeginState()
Event OnBeginState()
If _00E_SelectionTutorialShown.GetValueInt() == 0 && _00E_DisableSkillTutorials.GetValueInt() == 0
_00E_Tutorial_SelectionMode.Show()
@ -79,13 +79,13 @@ Event OnBeginState()
Wait(0.5)
_00E_A2_EldritchBloodSelectionHoldIMOD.ApplyCrossFade(1.5)
EndEvent
EndEvent
EndState
State AddEffect
Event OnBeginState()
Event OnBeginState()
A2_EldritchBlood_Victim.GetActorReference().RemoveSpell(_00E_A2_EldritchBloodAbMarkedVictimSP)
@ -123,7 +123,7 @@ Event OnBeginState()
_00E_A2_EldritchBloodGlobal.SetValueInt(0)
Sound.StopInstance(MarkingLP)
EndEvent
EndEvent
EndState
@ -267,12 +267,6 @@ Function UnmarkEnemy(Actor iVictim)
_00E_A2_GhostwalkDeselectM.Play(PlayerREF)
MarkingRuneREF.Delete()
MarkingRuneREF = None
; Unmark attack target too
if A2_EldritchBlood_VictimTarget.GetActorReference()
UnmarkEnemy(A2_EldritchBlood_VictimTarget.GetActorReference())
endif
Elseif iVictim.HasSpell(_00E_A2_EldritchBloodAbMarkedVictimTargetSP)
A2_EldritchBlood_VictimRune.Clear()
A2_EldritchBlood_VictimTarget.Clear()

Binary file not shown.