# Expected to be imported by "anim/_spider.fus" # Expected vars: # NS (str), e.g. "spider_" state "swim_spit": rgraph: $PREFIX NS "swim_spit" hitbox: collmap("stand") unsafe if() then: goto: "swim" state "swim_jump": # NOTE: the only goto: "swim_jump" is in "start_jump", which checks # whether we're in water, and does goto: "jump" or goto: "swim_jump" # accordingly. # Therefore, if we're in "swim_jump", then we can safely assume we're in # water without checking. rgraph: $PREFIX NS "swim_jump" hitbox: collmap("stand") unsafe if: any: key: isdown f key: isdown u key: isdown d any: all: expr: myvar("is_stickyspider") coll: all yes ;; + ;; ;; ( ) + all: not: expr: myvar("is_stickyspider") coll: all yes ;; + ;; / ;; ( ) + then: move: 1 0 rot: 1 goto delay: "step" if: any: key: isdown f key: isdown u key: isdown d coll: any yes ;; + ;; / ;; ( ) coll: all no ;; *\*/* ;; - + - ;; \* ;; . ;; ;; ( ) then: move: 2 1 rot: 1 goto immediate: "start_jump" if: any: key: isdown f key: isdown u key: isdown d coll: any yes ;; \ ;; + ;; ;; ( ) coll: all no ;; ;; /* ;; ( )- + - ;; */*\* then: move: 0 0 rot: -1 goto immediate: "start_jump" if: any: key: isdown f key: isdown u key: isdown d coll: all no ;; \*/* ;; + - ;; /*\* ;; ( ) then: move: 1 0 goto immediate: "start_jump" if() then: goto immediate: "swim" state "swim": rgraph: $PREFIX NS "swim" hitbox: collmap("stand") unsafe if: key: wentdown y then: call: "swim_spit" if: any: key: isdown f key: isdown u key: isdown d any: all: expr: myvar("is_stickyspider") coll: all yes ;; + ;; ;; ( ) + all: not: expr: myvar("is_stickyspider") coll: all yes ;; + ;; / ;; ( ) + then: move: 1 0 rot: 1 goto delay: "step" if: any: key: isdown f key: isdown u key: isdown d any: key: isdown u coll: any yes ;; + ;; / ;; ( ) coll: all no ;; *\*/* ;; - + - ;; \* ;; . ;; ;; ( ) then: move: 2 1 rot: 1 goto immediate: "start_jump" if: any: key: isdown f key: isdown u key: isdown d any: key: isdown d coll: any yes ;; \ ;; + ;; ;; ( ) coll: all no ;; ;; /* ;; ( )- + - ;; */*\* then: move: 0 0 rot: -1 goto immediate: "start_jump" if: any: key: isdown f key: isdown u key: isdown d coll: all no ;; \*/* ;; + - ;; /*\* ;; ( ) then: move: 1 0 goto immediate: "start_jump" if: key: isdown b then: move: 1 0 turn delay: 2 if: any: all: expr: myvar("is_stickyspider") coll: all yes ;; (+) + all: not: expr: myvar("is_stickyspider") coll: all yes ;; (+)- + then: goto: "stand" delay: 2