# Expected vars: # ANIM_NS (str), e.g. "roller_", "" # RGRAPH_NS (str), e.g. "rollerspider_", "" # Optional vars: # # STICKY_GRAB: you can "catch" an otherwise uncatchable vertex # as you rotate past it # # + - + + - + # / / => \ \ # (+)- + + + + - + # # FLIPPY_GRAB: you can roll onto your "side" # (and grabbing with your side has a separate anim) # # + - + # \ \ # (+)- + # # GOTO_GRABBED: when you grab something, you stay grabbed until # letting go of "f" # # SPIDER: we are a rollerspider # #$SET_BOOL FLIPPY_GRAB #$SET_BOOL STICKY_GRAB $SET_BOOL STICKY_GRAB $SET_BOOL FLIPPY_GRAB #$SET_BOOL STICKY_GRAB #$SET_BOOL GOTO_GRABBED # TODO: when GOTO_GRABBED is active, when you do the STICKY_GRAB "side grab", # you should stay grabbed until you let go of "f" #$SET_BOOL STICKY_GRAB #$SET_BOOL GOTO_GRABBED #$SET_BOOL FLIPPY_GRAB $IF SPIDER: $SET_BOOL NOGRAB collmsgs: "touch" state $PREFIX ANIM_NS "stand": rgraph: $PREFIX RGRAPH_NS "roller" hitbox: ;; . ;; * ;; (.) . on "spit": goto: $PREFIX ANIM_NS "turn" ################################################ # rollerspider turning back into spider $IF SPIDER: if: key: not isdown x coll: all yes ;; (+)- + then: goto: "crawl" if: key: not isdown x coll: all yes ;; + ;; / ;; (+) . then: goto: "crawl" rot: -2 turn ################################################ # Grabbing $IF !NOGRAB: # Grabbing a vertex if: key: wasdown u coll: any yes ;; . + ;; ;; ( ) . coll: all no ;; . ;; \* ;; ( ) . $IF WATER_ROLLER: coll: water all no ;; . ;; \* ;; ( ) . then: move: 2 1 rot: 3 $IF GOTO_GRABBED: goto: $PREFIX ANIM_NS "grabbed" $IF !GOTO_GRABBED: goto: $PREFIX ANIM_NS "grab" delay: 1 $IF !NOGRAB: # Attempting to grab, but no vertex (so we just stick out our pseudopod) if: key: wasdown u coll: all no ;; . ;; \* ;; ( ) . $IF WATER_ROLLER: coll: water all no ;; . ;; \* ;; ( ) . then: goto: $PREFIX ANIM_NS "grab" delay: 1 ################################################ # Rolling forward if: # Roll forward (not holding d) key: not isdown d key: not isdown b key: wasdown f any: coll: any yes ;; ( ) + $IF WATER_ROLLER: coll: water any yes ;; ( ) . ;; * then: move: 1 0 rot: 2 delay: 1 if: # Spin around forward (possibly holding d) key: not isdown b key: wasdown f all: coll: all no ;; ( )- . ;; * $IF WATER_ROLLER: coll: water all no ;; ( )- . ;; * then: rot: -1 delay: 1 if: # Roll forward (possibly holding d) key: not isdown b key: wasdown f any: coll: any yes ;; ( ) + $IF WATER_ROLLER: coll: water any yes ;; ( ) . ;; * then: move: 1 0 rot: 2 delay: 1 ################################################ # Turning around if: # Turn around key: not isdown f key: wasdown b then: turn rot: 2 delay: 1 state $PREFIX ANIM_NS "turn": # When bumped, turn around if: then: confused: toggle goto: $PREFIX ANIM_NS "stand" state $PREFIX ANIM_NS "grab": # Rolling around with your pseudopod stuck out rgraph: $PREFIX RGRAPH_NS "roller_grab" hitbox: ;; . . ;; *\* ;; (.) . if: key: not isdown u then: goto: $PREFIX ANIM_NS "stand" delay: 1 $IF FLIPPY_GRAB: if: key: wasdown f key: not isdown b any: coll: any yes ;; ( ) + $IF WATER_ROLLER: coll: water any yes ;; ( ) . ;; * then: move: 1 0 rot: 1 goto: $PREFIX ANIM_NS "grab_flipped" delay: 1 $IF STICKY_GRAB: if: key: wasdown f key: not isdown b coll: any yes ;; ( ) . + coll: all no ;; *\*/* ;; ( ) . . $IF WATER_ROLLER: coll: water all no ;; * * * ;; ( ) . . then: move: 2 0 rot: 2 $IF GOTO_GRABBED: goto: $PREFIX ANIM_NS "grabbed" delay: 1 $IF FLIPPY_GRAB: if: key: wasdown f key: not isdown b any: coll: any yes ;; . ;; ;; ( ) . . ;; ;; + . $IF WATER_ROLLER: coll: water any yes ;; . ;; ;; ( ) . . ;; * ;; . . coll: all no ;; . ;; /* ;; ( )- + - . ;; */*\* ;; . . $IF WATER_ROLLER: coll: water all no ;; . ;; /* ;; ( )- + - . ;; */*\* ;; . . then: move: 0 -1 goto: $PREFIX ANIM_NS "grab_flipped" delay: 1 if: key: wasdown f key: not isdown b any: coll: any yes ;; . ;; ;; ( ) . . ;; ;; . + $IF WATER_ROLLER: coll: water any yes ;; . ;; ;; ( ) . . ;; ;; . . ;; * coll: all no ;; . ;; /* ;; ( )- + - . ;; */*\* ;; . . $IF WATER_ROLLER: coll: water all no ;; . ;; /* ;; ( )- + - . ;; */*\* ;; . . then: move: 1 -1 rot: 2 $IF GOTO_GRABBED: goto: $PREFIX ANIM_NS "grabbed" delay: 1 if: key: wasdown f key: not isdown b coll: all no ;; /* ;; ( )- + - ;; */*\* $IF WATER_ROLLER: coll: water all no ;; /* ;; ( )- + - ;; */*\* then: rot: -1 delay: 1 $IF GRAB_WHEN_TURNING: if: key: wasdown b key: not isdown f coll: any yes ;; . + ;; ;; ( ) . coll: all no ;; . ;; \* ;; ( ) . $IF WATER_ROLLER: coll: water all no ;; . ;; \* ;; ( ) . then: move: 2 1 rot: 3 turn rot: 2 $IF GOTO_GRABBED: goto: $PREFIX ANIM_NS "grabbed" delay: 1 if: key: wasdown b key: not isdown f then: turn rot: 2 delay: 1 state $PREFIX ANIM_NS "grab_flipped": rgraph: $PREFIX RGRAPH_NS "roller_grab_flipped" hitbox: ;; . . ;; */* ;; (.) . if: key: not isdown u key: wasdown f then: goto: $PREFIX ANIM_NS "stand" delay: 1 if: key: not isdown u key: wasdown b then: goto: $PREFIX ANIM_NS "stand" turn rot: 1 delay: 1 if: key: wasdown d key: wasdown f key: not isdown b coll: all no ;; ( )- ;; * $IF WATER_ROLLER: coll: water all no ;; ( )- ;; * then: rot: -1 delay: 1 if: key: wasdown f key: not isdown b any: coll: any yes ;; ( ) + $IF WATER_ROLLER: coll: water any yes ;; ( ) . ;; * then: move: 1 0 rot: 2 goto: $PREFIX ANIM_NS "grab" delay: 1 if: key: wasdown f key: not isdown b coll: all no ;; ( )- ;; * $IF WATER_ROLLER: coll: water all no ;; ( )- ;; * then: rot: -1 delay: 1 if: key: wasdown b key: not isdown f then: turn rot: 1 delay: 1 state $PREFIX ANIM_NS "grabbed": rgraph: $PREFIX RGRAPH_NS "roller_grab" hitbox: ;; . . ;; *\* ;; (.) . if: key: not isdown u then: goto: $PREFIX ANIM_NS "stand" delay: 1