fixes in items and monsters scripts
[dd2d.git] / data / scripts / actor / sergeant.dacs
blob46787fb0d4add3583c89a956cedfdd0da390299d
1 module actorSergeant is "monster" "Sergeant";
3 import actor;
4 import monsterai;
7 // setup actor animations
8 public void initializeAnim () {
9   // sleep
10   animClearFrames("monster", "Sergeant", "sleep");
11   // left
12   animAddFrame("monster", "Sergeant", "sleep", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/shared/sposa1a2.vga");
13   animAddFrame("monster", "Sergeant", "sleep", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/shared/sposa1a2.vga");
14   animAddFrame("monster", "Sergeant", "sleep", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/shared/sposa1a2.vga");
15   animAddFrame("monster", "Sergeant", "sleep", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/shared/sposb1b2.vga");
16   animAddFrame("monster", "Sergeant", "sleep", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/shared/sposb1b2.vga");
17   animAddFrame("monster", "Sergeant", "sleep", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/shared/sposb1b2.vga");
18   // right
19   animAddFrame("monster", "Sergeant", "sleep", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/shared/sposa1a2_mirrored.vga");
20   animAddFrame("monster", "Sergeant", "sleep", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/shared/sposa1a2_mirrored.vga");
21   animAddFrame("monster", "Sergeant", "sleep", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/shared/sposa1a2_mirrored.vga");
22   animAddFrame("monster", "Sergeant", "sleep", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/shared/sposb1b2_mirrored.vga");
23   animAddFrame("monster", "Sergeant", "sleep", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/shared/sposb1b2_mirrored.vga");
24   animAddFrame("monster", "Sergeant", "sleep", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/shared/sposb1b2_mirrored.vga");
25   // go
26   animClearFrames("monster", "Sergeant", "go");
27   // left
28   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/shared/sposa1a2.vga");
29   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/shared/sposa1a2.vga");
30   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/shared/sposb1b2.vga");
31   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/shared/sposb1b2.vga");
32   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/go/sposd1d2.vga");
33   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/go/sposd1d2.vga");
34   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/shared/sposa1a2.vga");
35   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/shared/sposa1a2.vga");
36   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/go/sposc1c2.vga");
37   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/go/sposc1c2.vga");
38   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/go/sposd1d2.vga");
39   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/go/sposd1d2.vga");
40   // right
41   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/shared/sposa1a2_mirrored.vga");
42   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/shared/sposa1a2_mirrored.vga");
43   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/shared/sposb1b2_mirrored.vga");
44   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/shared/sposb1b2_mirrored.vga");
45   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/go/sposd1d2_mirrored.vga");
46   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/go/sposd1d2_mirrored.vga");
47   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/shared/sposa1a2_mirrored.vga");
48   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/shared/sposa1a2_mirrored.vga");
49   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/go/sposc1c2_mirrored.vga");
50   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/go/sposc1c2_mirrored.vga");
51   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/go/sposd1d2_mirrored.vga");
52   animAddFrame("monster", "Sergeant", "go", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/go/sposd1d2_mirrored.vga");
53   // pain
54   animClearFrames("monster", "Sergeant", "pain");
55   // left
56   animAddFrame("monster", "Sergeant", "pain", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/pain/sposg1g2.vga");
57   // right
58   animAddFrame("monster", "Sergeant", "pain", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/pain/sposg1g2_mirrored.vga");
59   // wait
60   animClearFrames("monster", "Sergeant", "wait");
61   // left
62   animAddFrame("monster", "Sergeant", "wait", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/shared/sposa1a2.vga");
63   // right
64   animAddFrame("monster", "Sergeant", "wait", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/shared/sposa1a2_mirrored.vga");
65   // attack
66   animClearFrames("monster", "Sergeant", "attack");
67   // left
68   animAddFrame("monster", "Sergeant", "attack", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/attack/spose1e2.vga");
69   animAddFrame("monster", "Sergeant", "attack", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/attack/spose1e2.vga");
70   animAddFrame("monster", "Sergeant", "attack", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/attack/spose1e2.vga");
71   animAddFrame("monster", "Sergeant", "attack", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/attack/spose1e2.vga");
72   animAddFrame("monster", "Sergeant", "attack", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/attack/spose1e2.vga");
73   animAddFrame("monster", "Sergeant", "attack", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/attack/sposf1f2.vga");
74   // right
75   animAddFrame("monster", "Sergeant", "attack", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/attack/spose1e2_mirrored.vga");
76   animAddFrame("monster", "Sergeant", "attack", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/attack/spose1e2_mirrored.vga");
77   animAddFrame("monster", "Sergeant", "attack", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/attack/spose1e2_mirrored.vga");
78   animAddFrame("monster", "Sergeant", "attack", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/attack/spose1e2_mirrored.vga");
79   animAddFrame("monster", "Sergeant", "attack", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/attack/spose1e2_mirrored.vga");
80   animAddFrame("monster", "Sergeant", "attack", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/attack/sposf1f2_mirrored.vga");
81   // die
82   animClearFrames("monster", "Sergeant", "die");
83   // left
84   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/die/sposh0.vga");
85   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/die/sposh0.vga");
86   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/die/sposh0.vga");
87   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/die/sposi0.vga");
88   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/die/sposi0.vga");
89   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/die/sposi0.vga");
90   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/die/sposj0.vga");
91   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/die/sposj0.vga");
92   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/die/sposj0.vga");
93   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/die/sposk0.vga");
94   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/die/sposk0.vga");
95   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/die/sposk0.vga");
96   // right
97   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/die/sposh0.vga");
98   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/die/sposh0.vga");
99   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/die/sposh0.vga");
100   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/die/sposi0.vga");
101   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/die/sposi0.vga");
102   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/die/sposi0.vga");
103   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/die/sposj0.vga");
104   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/die/sposj0.vga");
105   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/die/sposj0.vga");
106   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/die/sposk0.vga");
107   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/die/sposk0.vga");
108   animAddFrame("monster", "Sergeant", "die", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/die/sposk0.vga");
109   // slop
110   animClearFrames("monster", "Sergeant", "slop");
111   // left
112   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposm0.vga");
113   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposm0.vga");
114   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposm0.vga");
115   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposn0.vga");
116   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposn0.vga");
117   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposn0.vga");
118   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposo0.vga");
119   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposo0.vga");
120   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposo0.vga");
121   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposp0.vga");
122   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposp0.vga");
123   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposp0.vga");
124   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposr0.vga");
125   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposr0.vga");
126   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposr0.vga");
127   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposs0.vga");
128   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposs0.vga");
129   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/sposs0.vga");
130   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/spost0.vga");
131   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/spost0.vga");
132   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/slop/spost0.vga");
133   // right
134   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposm0.vga");
135   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposm0.vga");
136   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposm0.vga");
137   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposn0.vga");
138   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposn0.vga");
139   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposn0.vga");
140   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposo0.vga");
141   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposo0.vga");
142   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposo0.vga");
143   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposp0.vga");
144   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposp0.vga");
145   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposp0.vga");
146   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposr0.vga");
147   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposr0.vga");
148   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposr0.vga");
149   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposs0.vga");
150   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposs0.vga");
151   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/sposs0.vga");
152   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/spost0.vga");
153   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/spost0.vga");
154   animAddFrame("monster", "Sergeant", "slop", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/slop/spost0.vga");
155   // dead
156   animClearFrames("monster", "Sergeant", "dead");
157   // left
158   animAddFrame("monster", "Sergeant", "dead", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/dead/sposl0.vga");
159   // right
160   animAddFrame("monster", "Sergeant", "dead", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/dead/sposl0.vga");
161   // mess
162   animClearFrames("monster", "Sergeant", "mess");
163   // left
164   animAddFrame("monster", "Sergeant", "mess", ACTOR_DIR_LEFT, "monsters/sergeant/graphics/mess/sposu0.vga");
165   // right
166   animAddFrame("monster", "Sergeant", "mess", ACTOR_DIR_RIGHT, "monsters/sergeant/graphics/mess/sposu0.vga");
170 // change actor animation
171 public void setAnim (Actor me, string state) {
172   me.animidx = 0;
173   switch (state) {
174     case "sleep": me.animname = "sleep"; me.animstr = "AAABBB"; break;
175     case "go": me.animname = "go"; me.animstr = "AABBDDAACCDD"; break;
176     case "pain": me.animname = "pain"; me.animstr = "G"; break;
177     case "wait": me.animname = "wait"; me.animstr = "A"; break;
178     case "attack": me.animname = "attack"; me.animstr = "EEEEEF"; break;
179     case "die": me.animname = "die"; me.animstr = "HHHIIIJJJKKK"; break;
180     case "slop": me.animname = "slop"; me.animstr = "MMMNNNOOOPPPRRRSSSTTT"; break;
181     case "dead": me.animname = "dead"; me.animstr = "L"; break;
182     case "mess": me.animname = "mess"; me.animstr = "U"; break;
183     case "run": me.animname = "go"; me.animstr = "AABBDDAACCDD"; break;
184     case "climb": me.animname = "go"; me.animstr = "AABBDDAACCDD"; break;
185     case "runout": me.animname = "go"; me.animstr = "AABBDDAACCDD"; break;
186     case "shoot": me.animname = "attack"; me.animstr = "EEEEEF"; break;
187     case "revive": me.animname = "revive"; me.animstr = "KKKJJJIIIHHH"; break;
188     default: me.animname = "sleep"; me.animstr = "AAABBB"; break;
189   }
190   me.actorSetAnimation(state);
194 // setup actor properties
195 public void initialize (Actor me) {
196   // `classname` and `classtype` will be set by the engine
197   //me.classname = "Sergeant";
198   //me.classtype = "monster";
199   me.radius = 10;
200   me.height = 28;
201   me.hitpoints = me.life = 20;
202   me.painin = 10;
203   me.xvel = 3;
204   me.yvel = 10;
205   me.slophit = 30;
206   me.painout = 0;
207   me.angertime = 90;
208   me.setAnim("sleep");
212 // thinker
213 public void think (Actor me) {
214   monsterThink(me);