Created
March 5, 2018 05:06
-
-
Save JPLeBreton/ce9a6ecaedef55e2b78adbe8b11e7213 to your computer and use it in GitHub Desktop.
Fishing Rod (multi-phase fire state weapon)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MFFishingRod : Weapon | |
{ | |
States | |
{ | |
Spawn: | |
SAWG C -1; | |
Stop; | |
Ready: | |
SAWG C 1 A_WeaponReady; | |
Loop; | |
Select: | |
SAWG C 1 A_Raise; | |
Loop; | |
Deselect: | |
SAWG C 1 A_Lower; | |
Loop; | |
Fire: | |
SAWG B 1 A_JumpIf(invoker.ShouldCast(), "LineCast"); | |
Goto Ready; | |
LineCast: | |
SAWG AB 5 A_Log("LineCast"); | |
Loop; | |
} | |
bool ShouldCast() | |
{ | |
// TODO: WTF? none of these statements return true | |
if ( InStateSequence(CurState, ResolveState("Fire")) ) | |
Console.Printf("Fire"); | |
if ( InStateSequence(CurState, ResolveState("Ready")) ) | |
Console.Printf("Ready"); | |
if ( InStateSequence(CurState, ResolveState("LineCast")) ) | |
Console.Printf("LineCast"); | |
if ( InStateSequence(CurState, ResolveState("Reeling")) ) | |
Console.Printf("Reeling"); | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment