Ticket #10860: Decomp (CD) - Script 13, castOpenScript changeState.txt

File Decomp (CD) - Script 13, castOpenScript changeState.txt, 2.5 KB (added by Vhati, 5 years ago)
Line 
1CD edition, script 13 - castOpenScript::changeState()
2
3
4(method (changeState param1)
5 (switch (= state param1)
6 (0
7 (= local3 (IntArray with: 0 0 0 1 0 0 2 3))
8 (= local4 (IntArray with: 2 3 6 7))
9 (= local5 (IntArray with: 2 3 0 3 0 1 2 3))
10 (g1_Glory handsOff:)
11 (g0_hero setHeading: (GetAngle (g0_hero x?) (- (g0_hero y?) (/ (g0_hero scaleY?) 3)) g441_myX g442_myY) self)
12 )
13 (1
14 (= local1 (go_hero loop?))
15 (if (and (> (go_hero view?) 17) (< (go_hero view?) 21))
16 # hero's holding the staff.
17 (= local2 (go_hero cel?))
18 (g0_hero
19 view: 19
20 loop: (local3 at: local1)
21 setCel: 0
22 setCycle: End self
23 )
24 else
25 (g0_hero
26 view: 14
27 loop: (local5 at: local1)
28 setCel: 0
29 setCycle End self
30 )
31 )
32 )
33 (2
34 (openEffect
35 view: 21
36 x: g441_myX
37 y: g442_myY
38 setLoop: 0
39 setCel: 0
40 signal: $6001
41 setScaler: g0_hero
42 cycleSpeed: 0
43 setPri: 180
44 init:
45 setCycle: Fwd
46 )
47 (if register
48 (if (register onMe: g441_myX g442_myY)
49 (= local0 register)
50 )
51 (= register 0)
52 )
53 (if (not (and (> (go_hero view?) 17) (< (go_hero view?) 21)))
54 # hero's NOT holding the staff.
55 (g0_hero setCycle: Beg)
56
57 # Unlike castTriggerScript, there's self arg to cue.
58 )
59 (soundFX number: 934 play:)
60
61 # Use seconds to cue, with or without the staff.
62 (= seconds 3)
63 )
64 (3
65 (openEffect dispose:)
66 (= cycles 2)
67 )
68 (4
69 (if (and (> (go_hero view?) 17) (< (go_hero view?) 21))
70 # hero's holding the staff.
71 (g0_hero
72 view: 20
73 loop: (local4 at: (g0_hero loop?))
74 cel: (if (< (g0_hero loop?) 6) 4 else 5)
75 )
76 else
77 (g0_hero normalize:)
78 )
79
80 (cond
81 (
82 (not
83 (proc64999_5 global11
84 250 260 270 340 440 500 510 593 641 643
85 660 610 662 670 600 661 662 780 460 470
86 790 620 621 622 623 624 625 626 627 629
87 630 631 632 640 642 644 633 634 645 663
88 680 300
89 )
90 )
91 # "You can't open that."
92 (g91_gloryMessager say: 0 0 1 0 self 13)
93 )
94 (local0
95 (local0 doVerb: -80) # 0xb0
96 # There's no cue here. doVerb() is expected to replace the room script.
97 (local3 dispose:)
98 (local4 dispose:)
99 (local5 dispose:)
100 )
101 (else
102 # "You can't open that."
103 (g91_gloryMessager say: 0 0 1 0 self 13)
104 )
105 )
106 )
107 (5
108 (local3 dispose:)
109 (local4 dispose:)
110 (local5 dispose:)
111 (g1_Glory handsOn:)
112 (self dispose:)
113 )
114 )
115)