collmsgs: "solid" vars: # This tells spit that we "accept" mini_eyes # (i.e. if spit which collides with us is carrying a mini_eye, # it should transfer it to us by calling our accept_carryable proc) "accept_carryable": "mini_eye" # If set to T, we open even if a spider isn't nearby "auto_open": F # The collmsg (or stateset filename) of bodies we will look at "key_anim": "touch" # Vars for temporarily storing the results of "coll: bodies ..." nosave "coll_looking": F nosave "coll_looking_l": F nosave "coll_looking_d": F proc "accept_carryable": # me: an eye # you: spit which is carrying a mini_eye if: exists myvar("accepted_mini_eye_key") then: set mapvar(myvar("accepted_mini_eye_key")): T collmap "hitbox": ;; . . ;; *\*/* ;; . -(+)- . ;; */*\* ;; . . collmap "opening": ;; + - + - + - + - + - + ;; /*\*/*\*/*\*/*\*/*\*/*\ ;; + - + - + - + - + - + - + ;; /*\*/*\*/*\*/*\*/*\*/*\*/*\ ;; + - + - + - + - + - + - + - + ;; /*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\ ;; + - + - + - + - + - + - + - + - + ;; /*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\ ;; + - + - + - + - + - + - + - + - + - + ;; /*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\ ;; + - + - + - + - + -(+)- + - + - + - + - + ;; \*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/ ;; + - + - + - + - + - + - + - + - + - + ;; \*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/ ;; + - + - + - + - + - + - + - + - + ;; \*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/ ;; + - + - + - + - + - + - + - + ;; \*/*\*/*\*/*\*/*\*/*\*/*\*/ ;; + - + - + - + - + - + - + ;; \*/*\*/*\*/*\*/*\*/*\*/ ;; + - + - + - + - + - + collmap "looking": ;; + - + ;; /*\*/*\ ;; + - + - + ;; /*\*/*\*/*\ ;; + - + - + - + ;; /*\*/*\*/*\*/*\ ;; + - + - + - + - + ;; /*\*/*\*/*\*/*\*/*\ ;; + -(+)- + - + - + - + ;; \*/*\*/*\*/*\*/*\*/ ;; + - + - + - + - + collmap "looking_l": collmap("looking") ^ 2 collmap "looking_d": collmap("looking") ^ -2 state "closed": rgraph: "eye_closed" hitbox: collmap("hitbox") if: any: not: exists myvar("key") expr: mapvar(myvar("key")) any: not: exists myvar("antikey") not: expr: mapvar(myvar("antikey")) any: expr: myvar("auto_open") coll: bodies(myvar("key_anim")) any yes collmap("opening") then: goto delay: "opening" state "opening": rgraph: "eye_opening" hitbox: collmap("hitbox") if() then: if: exists myvar("opened_key") then: inc mapvar(myvar("opened_key")) goto: "open" state "open": rgraph: "eye_open" hitbox: collmap("hitbox") if: any: all: exists myvar("key") not: expr: mapvar(myvar("key")) all: exists myvar("antikey") expr: mapvar(myvar("antikey")) not: any: expr: myvar("auto_open") coll: bodies(myvar("key_anim")) any yes collmap("opening") then: goto delay: "closing" if() then: set myvar("coll_looking"): F set myvar("coll_looking_l"): F set myvar("coll_looking_d"): F if: coll: bodies(myvar("key_anim")) any yes collmap("looking") then: set myvar("coll_looking"): T if: coll: bodies(myvar("key_anim")) any yes collmap("looking_l") then: set myvar("coll_looking_l"): T if: coll: bodies(myvar("key_anim")) any yes collmap("looking_d") then: set myvar("coll_looking_d"): T continue if: expr: myvar("coll_looking") not: expr: myvar("coll_looking_l") not: expr: myvar("coll_looking_d") then: goto delay: "looking" if: not: expr: myvar("coll_looking") expr: myvar("coll_looking_l") not: expr: myvar("coll_looking_d") then: goto delay: "looking_l" if: not: expr: myvar("coll_looking") not: expr: myvar("coll_looking_l") expr: myvar("coll_looking_d") then: goto delay: "looking_d" state "closing": rgraph: "eye_closing" hitbox: collmap("hitbox") if() then: if: exists myvar("opened_key") then: dec mapvar(myvar("opened_key")) goto: "closed" # "anim/_eye_looking.fus": # Provides states looking, unlooking, look (with suffix indicated # by LOOK_SUFFIX) $SET_STR LOOK_SUFFIX "" import "anim/_eye_looking.fus" $SET_STR LOOK_SUFFIX "_l" import "anim/_eye_looking.fus" $SET_STR LOOK_SUFFIX "_d" import "anim/_eye_looking.fus"