;============================================================= ; Script Name: ABH_JohnnyEncounterScript.psc ; Quest: A Bad Hand (Fallout: Cascadia) ; Manages a critical encounter between the player and Johnny Bradshaw, ; including skill check branches, branching quest stages, and conditional world state logic. ;============================================================= ScriptName ABH_JohnnyEncounterScript extends ObjectReference ;======= PROPERTIES ======= Quest Property ABH_Quest Auto Actor Property JohnnyBradshaw Auto Faction Property HeartsFaction Auto Faction Property OrcasFaction Auto ObjectReference Property JohnnyCorpseMarker Auto ObjectReference Property JohnnyFakeCorpse Auto GlobalVariable Property PlayerReputation_Hearts Auto GlobalVariable Property PlayerReputation_Orcas Auto Message Property PerceptionOptionMessage Auto Message Property IntimidateOptionMessage Auto Message Property BluffOptionMessage Auto Sound Property GunshotFX Auto ;======= STATES ======= Bool Property HasFakeKilledJohnny = False Auto Bool Property HasRevealedOrcasPlan = False Auto ;======= MAIN TRIGGER ======= Event OnActivate(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() ; Present dialogue options based on player skills If Game.GetPlayer().GetAV("Perception") >= 8 PerceptionOptionMessage.Show() HandlePerceptionBranch() ElseIf Game.GetPlayer().GetAV("Intimidation") >= 60 IntimidateOptionMessage.Show() HandleIntimidationBranch() Else BluffOptionMessage.Show() HandleBluffBranch() EndIf EndIf EndEvent ;======= BRANCH: PERCEPTION ======= Function HandlePerceptionBranch() Debug.Trace("[ABH] Player used Perception to uncover Johnny's allegiance.") ABH_Quest.SetObjectiveCompleted(10) ABH_Quest.SetStage(20) ; Unlocked Hearts-aligned path PlayerReputation_Hearts.Mod(5) EndFunction ;======= BRANCH: INTIMIDATION ======= Function HandleIntimidationBranch() Debug.Trace("[ABH] Player used Intimidation to force Johnny's cooperation.") ABH_Quest.SetObjectiveCompleted(10) ABH_Quest.SetStage(30) ; Player coerces Johnny into working for them JohnnyBradshaw.EvaluatePackage() PlayerReputation_Orcas.Mod(-3) EndFunction ;======= BRANCH: BLUFF ======= Function HandleBluffBranch() Debug.Trace("[ABH] Player failed to pass any check, proceeds with default lie.") ABH_Quest.SetObjectiveCompleted(10) ABH_Quest.SetStage(40) ; Trigger confrontation later JohnnyBradshaw.StartCombat(Game.GetPlayer()) PlayerReputation_Hearts.Mod(-2) EndFunction ;======= FAKE KILL EVENT ======= Function TriggerFakeDeath() If HasFakeKilledJohnny Return EndIf Debug.Trace("[ABH] Triggering fake death sequence for Johnny.") JohnnyBradshaw.Disable() GunshotFX.Play(Game.GetPlayer()) Utility.Wait(1.0) JohnnyFakeCorpse.MoveTo(JohnnyCorpseMarker) JohnnyFakeCorpse.Enable() ABH_Quest.SetStage(50) HasFakeKilledJohnny = True EndFunction ;======= REVEALING ORCAS PLAN ======= Function RevealOrcasPlanToHearts() If HasRevealedOrcasPlan Return EndIf Debug.Trace("[ABH] Player revealed Orcas plot to Hearts.") ABH_Quest.SetStage(60) PlayerReputation_Hearts.Mod(10) HasRevealedOrcasPlan = True EndFunction ;======= RESET STATE (FOR TESTING) ======= Function ResetEncounterState() HasFakeKilledJohnny = False HasRevealedOrcasPlan = False JohnnyBradshaw.Enable() JohnnyFakeCorpse.Disable() ABH_Quest.SetStage(10) EndFunction