SKSE-free pipe smoking
This commit is contained in:
parent
91ca470ecf
commit
5ffd5d7e97
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
Scriptname HealthBarManager Hidden
|
||||
|
||||
function Show(Actor akActor) global
|
||||
if akActor
|
||||
if akActor && SKSE.GetVersion()
|
||||
int handle = ModEvent.Create("Enderal_ShowActorHealth")
|
||||
if handle
|
||||
ModEvent.PushForm(handle, akActor)
|
||||
@ -11,7 +11,7 @@ function Show(Actor akActor) global
|
||||
endfunction
|
||||
|
||||
function Hide(Actor akActor) global
|
||||
if akActor
|
||||
if akActor && SKSE.GetVersion()
|
||||
int handle = ModEvent.Create("Enderal_HideActorHealth")
|
||||
if handle
|
||||
ModEvent.PushForm(handle, akActor)
|
||||
|
@ -2,21 +2,31 @@ Scriptname _00E_CameraControl Hidden
|
||||
|
||||
Function LockVanityCamera() Global
|
||||
|
||||
Actor PlayerREF = Game.GetForm(0x14) as Actor
|
||||
float fMinDist = 150.0
|
||||
|
||||
if SKSE.GetVersion()
|
||||
float fCameraMaxDistance = Utility.GetIniFloat("fVanityModeMaxDist:Camera")
|
||||
(Game.GetForm(0x14) as Actor).SetActorValue("Variable08", fCameraMaxDistance)
|
||||
Utility.SetINIFloat("fVanityModeMaxDist:Camera", Utility.GetIniFloat("fVanityModeMinDist:Camera"))
|
||||
PlayerREF.SetActorValue("Variable08", fCameraMaxDistance)
|
||||
fMinDist = Utility.GetIniFloat("fVanityModeMinDist:Camera")
|
||||
else
|
||||
PlayerREF.SetActorValue("Variable08", 600.0)
|
||||
endif
|
||||
|
||||
Utility.SetINIFloat("fVanityModeMaxDist:Camera", fMinDist)
|
||||
|
||||
EndFunction
|
||||
|
||||
Function UnlockVanityCamera() Global
|
||||
|
||||
float fCameraMaxDistance = (Game.GetForm(0x14) as Actor).GetActorValue("Variable08")
|
||||
Actor PlayerREF = Game.GetForm(0x14) as Actor
|
||||
float fCameraMaxDistance = PlayerREF.GetActorValue("Variable08")
|
||||
|
||||
if fCameraMaxDistance <= 0
|
||||
fCameraMaxDistance = 600
|
||||
fCameraMaxDistance = 600.0
|
||||
endif
|
||||
|
||||
Utility.SetINIFloat("fVanityModeMaxDist:Camera", fCameraMaxDistance)
|
||||
(Game.GetForm(0x14) as Actor).SetActorValue("Variable08", 0)
|
||||
PlayerREF.SetActorValue("Variable08", 0)
|
||||
|
||||
EndFunction
|
||||
|
@ -190,8 +190,10 @@ State RealPlayer
|
||||
; Level up
|
||||
If iLevelUpsNeeded > 0
|
||||
; Level up if not in combat, not in dialogue, activate controls enabled (not in a scene?) and, obviously, not dead
|
||||
While !IsInCombat() && (SKSE.GetVersion() == 0 || UI.IsMenuOpen("Dialogue Menu") == False) && Game.IsActivateControlsEnabled() && !Player.IsDead() && (isdead == False) && (iLevelUpsNeeded > 0)
|
||||
While !IsInCombat() && Game.IsActivateControlsEnabled() && !Player.IsDead() && (isdead == False) && (iLevelUpsNeeded > 0)
|
||||
if SKSE.GetVersion() == 0 || UI.IsMenuOpen("Dialogue Menu") == False
|
||||
levelUp()
|
||||
endif
|
||||
EndWhile
|
||||
EndIf
|
||||
|
||||
|
@ -23,6 +23,7 @@ Sound Property _00E_FS_DecreaseArcaneFeverM Auto
|
||||
Message Property _00E_AlchAmbrosia_sArcaneFeverDecreased Auto
|
||||
|
||||
Actor Property PlayerRef Auto
|
||||
bool bSKSE = true
|
||||
|
||||
|
||||
;=====================================================================================
|
||||
@ -76,6 +77,11 @@ State Smoking
|
||||
|
||||
Event OnUpdate()
|
||||
_UpdateSmoking()
|
||||
|
||||
if ! bSKSE
|
||||
Utility.Wait(2.5)
|
||||
StopSmoking()
|
||||
endif
|
||||
EndEvent
|
||||
|
||||
EndState
|
||||
@ -100,7 +106,7 @@ Int Property SMOKING_STAGE_SMOKING = 3 AutoReadOnly
|
||||
|
||||
Float Property SMOKING_ARCANE_FEVER_REDUCE = 1.0 AutoReadOnly
|
||||
|
||||
Int StoredCameraState = -1
|
||||
bool bFirstPerson = true
|
||||
Armor StoredEquippedShield
|
||||
Armor StoredEquippedHelmet
|
||||
Form[] EquippedTorches
|
||||
@ -121,12 +127,14 @@ Function StartSmoking()
|
||||
EndFunction
|
||||
|
||||
Function _TryStartSmoking()
|
||||
bSKSE = (SKSE.GetVersion() > 0)
|
||||
|
||||
If TheriantrophistControlQuest.IsTransformed()
|
||||
_00E_PeaceweedSmoking_CantSmokeInWolfForm.Show()
|
||||
Return
|
||||
EndIf
|
||||
|
||||
If (_00E_Meditate_Allowed.GetValueInt() == 0) || (PlayerRef.GetWorldSpace() == MQ07aDreamRealm) || PlayerRef.IsOnMount() || PlayerRef.IsSwimming() || (PlayerRef.GetSitState() != 0) || PlayerRef.IsInCombat() || PlayerREF.IsInLocation(_00E_ClassMenuLocation)
|
||||
If (_00E_Meditate_Allowed.GetValueInt() == 0) || (PlayerRef.GetWorldSpace() == MQ07aDreamRealm) || PlayerRef.IsOnMount() || (bSKSE && PlayerRef.IsSwimming()) || (PlayerRef.GetSitState() != 0) || PlayerRef.IsInCombat() || PlayerREF.IsInLocation(_00E_ClassMenuLocation)
|
||||
_00E_PeaceweedSmoking_CantSmokeNow.Show()
|
||||
Return
|
||||
EndIf
|
||||
@ -149,12 +157,9 @@ Function _TryStartSmoking()
|
||||
Game.SetInChargen(true, true, false) ; Forbid saving the game while smoking
|
||||
Game.DisablePlayerControls(abMovement=true, abFighting=true, abCamSwitch=true, abLooking=false, abSneaking=true, abMenu=true, abActivate = true, abJournalTabs=true)
|
||||
|
||||
StoredCameraState = Game.GetCameraState()
|
||||
bFirstPerson = PlayerREF.GetAnimationVariableBool("IsFirstPerson")
|
||||
Game.ForceThirdPerson()
|
||||
|
||||
RefreshCancelKeys()
|
||||
RegisterCancelKeys()
|
||||
|
||||
EquippedTorches = New Form[2]
|
||||
Bool bTorchesUnequipping = _00E_TorchControl.UnequipTorches(EquippedTorches)
|
||||
|
||||
@ -179,7 +184,7 @@ Function _TryStartSmoking()
|
||||
SmokingStage = SMOKING_STAGE_WARMUP
|
||||
|
||||
; Unequip armor in the HEAD slot. Will work for most closed-face helmets, I hope.
|
||||
StoredEquippedHelmet = PlayerRef.GetWornForm(0x00000001) as Armor
|
||||
StoredEquippedHelmet = PlayerRef.GetEquippedArmorInSlot(30) as Armor
|
||||
If StoredEquippedHelmet
|
||||
PlayerREF.UnequipItem(StoredEquippedHelmet, False, True)
|
||||
EndIf
|
||||
@ -191,9 +196,13 @@ Function _TryStartSmoking()
|
||||
EndIf
|
||||
|
||||
Debug.SendAnimationEvent(PlayerRef, "IdleSitCrossLeggedEnter")
|
||||
|
||||
Utility.Wait(1.1)
|
||||
_AdjustCameraPositionToSitting()
|
||||
|
||||
if bSKSE
|
||||
RefreshCancelKeys()
|
||||
RegisterCancelKeys()
|
||||
|
||||
If (bQuitTutorialShown == False) && (_00E_DisableOtherTutorials.GetValueInt() == 0)
|
||||
bQuitTutorialShown = True
|
||||
Message.ResetHelpMessage("Empty")
|
||||
@ -206,9 +215,12 @@ Function _TryStartSmoking()
|
||||
_00E_PeaceweedSmoking_ExitTutorial.ShowAsHelpMessage("Empty", 7, 30, 1)
|
||||
EndIf
|
||||
EndIf
|
||||
RegisterForSingleUpdate(2.9)
|
||||
else
|
||||
RegisterForSingleUpdate(5.0)
|
||||
endif
|
||||
|
||||
Utility.Wait(0.4)
|
||||
RegisterForSingleUpdate(2.5)
|
||||
Debug.SendAnimationEvent(PlayerRef, "pipesmokingcrossleggedstartblaze")
|
||||
Debug.SendAnimationEvent(PlayerRef, "pipesmokingcrossleggedblazed")
|
||||
EndFunction
|
||||
@ -249,6 +261,7 @@ Function ApplySmokingSideEffects(Ingredient peaceweedIngredient, Float fReduceFe
|
||||
EndIf
|
||||
|
||||
; Teach ambrosia effect
|
||||
if bSKSE
|
||||
Int Index = peaceweedIngredient.getNumEffects()
|
||||
While Index > 0
|
||||
Index -= 1
|
||||
@ -257,6 +270,9 @@ Function ApplySmokingSideEffects(Ingredient peaceweedIngredient, Float fReduceFe
|
||||
Index = 0 ; Break
|
||||
EndIf
|
||||
EndWhile
|
||||
else
|
||||
peaceweedIngredient.LearnEffect(1)
|
||||
endif
|
||||
EndFunction
|
||||
|
||||
Function StopSmoking()
|
||||
@ -296,10 +312,9 @@ Function StopSmoking()
|
||||
|
||||
_00E_TorchControl.ReequipTorches(EquippedTorches)
|
||||
|
||||
If StoredCameraState == 0
|
||||
If bFirstPerson
|
||||
Game.ForceFirstPerson()
|
||||
EndIf
|
||||
StoredCameraState = -1
|
||||
|
||||
_00E_Meditate_Allowed.SetValueInt(1)
|
||||
EndIf
|
||||
@ -337,14 +352,21 @@ Float fStoredOverShoulderPosZ
|
||||
Function _SetCameraPosition(Float x, Float z)
|
||||
Utility.SetINIFloat("fOverShoulderPosX:Camera", x)
|
||||
Utility.SetINIFloat("fOverShoulderPosZ:Camera", z)
|
||||
if bSKSE
|
||||
Game.UpdateThirdPerson()
|
||||
endif
|
||||
EndFunction
|
||||
|
||||
Function _AdjustCameraPositionToSitting()
|
||||
If bStoredCameraPositions == False
|
||||
bStoredCameraPositions = True
|
||||
if bSKSE
|
||||
fStoredOverShoulderPosX = Utility.GetINIFloat("fOverShoulderPosX:Camera")
|
||||
fStoredOverShoulderPosZ = Utility.GetINIFloat("fOverShoulderPosZ:Camera")
|
||||
else
|
||||
fStoredOverShoulderPosX = 30.0
|
||||
fStoredOverShoulderPosZ = -10.0
|
||||
endif
|
||||
_00E_CameraControl.LockVanityCamera()
|
||||
EndIf
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user