/* Generic Carnivore Stress Behaviour // */ machine CarnStress { state StressInit { action SetRageIcon(true) action SetRampageTime(600.0, true) action LockMachine(true) transition { goto StressSleep } } ;//----------------------------------------------------------------- state StressSleep { action StopAllRandomAnimations() action SetStandStill() action StopLook() action SetRandomTimerBetween(1, 3.0, 4.0) action SetRandomTimerBetween(3, 5.0, 10.0) transition { goto StressSleepInit } } state StressSleepInit { transition IsNextDrive("Sedated") { action SetRampageTime(0.0, false) goto StressExit } transition IsTimerUp(1) { ;//action SetRampageTime(0.0, false) ;//action InitStressHealthDecr(0.5) action SetAutoMovementBlend(false) action PlayAnim("fall", "st", false) ;//action SetRandomTimerBetween(1, 580.0, 600.0) action SetRandomTimerBetween(2, 3.0, 3.0) goto FallLoopWait } } state FallLoopWait { transition IsAnimPlaying("fall", "st") == false { goto SleepWait } transition IsTimerUp(2) { goto SleepWait } } state SleepWait { action UpdateRampageHealth(true) transition IsNextDrive("Dead") { direct goto SleepDead } transition IsNextDrive("Sedated") { action SetRampageTime(0.0, false) goto StressExit } ;//transition IsTimerUp(1) transition GetRampageTime() <= 0.0 { action StopAnimState("fall") goto SleepEnd } transition IsTimerUp(3) { action PlayDistressedSound(); action SetRandomTimerBetween(3, 20.0, 35.0) goto SleepWait } } state SleepDead { transition IsAnimPlaying("fall", "brth_lp", false) { action SetAutoLinkAnimOff("fall", "brth_lp", true) action StopAnimState("fall") action SetLockLastPose("fall", "brth_lp", true) action LockDeadPose() goto StressExitEnd } transition IsAnimPlaying("fall", "st", false) { action SetAutoLinkAnimOff("fall", "st", true) action StopAnimState("fall") action SetLockLastPose("fall", "st", true) action LockDeadPose() goto StressExitEnd } transition IsAnimPlaying("fall", "lp", false) { action SetAutoLinkAnimOff("fall", "lp", true) action StopAnimState("fall") action SetLockLastPose("fall", "lp", true) action LockDeadPose() goto StressExitEnd } transition { ;// hmmmm... action StopAnimState("fall") goto SleepEnd } } state SleepEnd { transition IsAnimStatePlaying("fall", false) == false { action SetAutoMovementBlend(true) action LockMachine(false) action SetRampageTime(0.0, false) goto StressExit } } ;//----------------------------------------------------------------- exitstart state StressExit { action StopAnimState("drink") action StopAnimState("fall") transition { goto StressEndWait } } state StressEndWait { transition IsAnimStatePlaying("drink", true) == true { goto StressEndWait } transition IsAnimStatePlaying("fall", false) == false { action SetRandomTimerBetween(1, 20.0, 30.0) goto StressEndIdleWait } } state StressEndIdleWait { transition IsIdleLocked() == false { action StopLook() action SetAutoMovementBlend(true) goto StressExitEnd } transition IsTimerUp(1) { action StopLook() action SetAutoMovementBlend(true) goto StressExitEnd } } exitend state StressExitEnd { action SetRageIcon(false) action LockMachine(false) } }