/* Generic Recoil Machine // // This machine is run on the target, but called from the attacker. // The attacker needs to call the following actions before setting it's target to run this machine: // action SetTargetToSlave() // action SetNumPassedParamTarget(1) ; sets up the parameters required by this machine // action SetPassedParamTargetKnockDir(0) ; 1 = fwd, 2 = left, 3 = back, 4 = right // action SetTargetFSM(fsm::"Recoil") */ machine Recoil { state RecoilStart { action SetAutoMovementBlend(true) transition GetPassedParam(0) <= 2 { ;// recoil left action PlayAnim("rcl", "lt", false) ;//action PlayAnim("idle", "recl_lp", false) goto RecoilLoop } transition { ;// recoil right action PlayAnim("rcl", "lt", false) ;//action PlayAnim("idle", "recl_lp", false) goto RecoilLoop } } state RecoilLoop { transition IsAnimStatePlaying("rcl", false) == false ;//transition IsAnimPlaying("idle", "recl_lp", false) == false { goto RecoilEndStart } } ;//------------------------ Exit States Begin ---------------------- exitstart state RecoilEndStart { transition IsAnimPlaying("idle", "recl_lp", false) { goto RecoilEndWait } transition { goto RecoilEnd } } state RecoilEndWait { transition IsAnimPlaying("idle", "recl_lp", false) == false { goto RecoilEnd } } exitend state RecoilEnd { action DeleteAllCommands() } }