script renamings
[dd2d.git] / data / scripts / monster / robot.dacs
blob61b23d1589edc857bb728421c8179ecc69296c4f
1 module monsterRobot is "monster" "Robot";
3 import actor;
4 import monsterai;
7 // setup actor animations
8 public void initializeAnim () {
9   // sleep
10   animClearFrames("monster", "Robot", "sleep");
11   // left
12   animAddFrame("monster", "Robot", "sleep", ACTOR_DIR_LEFT, "monsters/robot/graphics/shared/roboa2a1_mirrored.vga");
13   // right
14   animAddFrame("monster", "Robot", "sleep", ACTOR_DIR_RIGHT, "monsters/robot/graphics/shared/roboa2a1.vga");
15   // go
16   animClearFrames("monster", "Robot", "go");
17   // left
18   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/shared/robod2d1_mirrored.vga");
19   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/shared/robod2d1_mirrored.vga");
20   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/roboe2e1_mirrored.vga");
21   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/roboe2e1_mirrored.vga");
22   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/robof2f1_mirrored.vga");
23   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/robof2f1_mirrored.vga");
24   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/robog2g1_mirrored.vga");
25   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/robog2g1_mirrored.vga");
26   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/roboh2h1_mirrored.vga");
27   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/roboh2h1_mirrored.vga");
28   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/roboi2i1_mirrored.vga");
29   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/roboi2i1_mirrored.vga");
30   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/roboj2j1_mirrored.vga");
31   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/roboj2j1_mirrored.vga");
32   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/robok2k1_mirrored.vga");
33   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/robok2k1_mirrored.vga");
34   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/robol2l1_mirrored.vga");
35   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/robol2l1_mirrored.vga");
36   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/shared/roboa2a1_mirrored.vga");
37   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/shared/roboa2a1_mirrored.vga");
38   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/robob2b1_mirrored.vga");
39   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/robob2b1_mirrored.vga");
40   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/roboc2c1_mirrored.vga");
41   animAddFrame("monster", "Robot", "go", ACTOR_DIR_LEFT, "monsters/robot/graphics/go/roboc2c1_mirrored.vga");
42   // right
43   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/shared/robod2d1.vga");
44   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/shared/robod2d1.vga");
45   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/roboe2e1.vga");
46   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/roboe2e1.vga");
47   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/robof2f1.vga");
48   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/robof2f1.vga");
49   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/robog2g1.vga");
50   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/robog2g1.vga");
51   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/roboh2h1.vga");
52   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/roboh2h1.vga");
53   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/roboi2i1.vga");
54   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/roboi2i1.vga");
55   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/roboj2j1.vga");
56   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/roboj2j1.vga");
57   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/robok2k1.vga");
58   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/robok2k1.vga");
59   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/robol2l1.vga");
60   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/robol2l1.vga");
61   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/shared/roboa2a1.vga");
62   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/shared/roboa2a1.vga");
63   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/robob2b1.vga");
64   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/robob2b1.vga");
65   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/roboc2c1.vga");
66   animAddFrame("monster", "Robot", "go", ACTOR_DIR_RIGHT, "monsters/robot/graphics/go/roboc2c1.vga");
67   // pain
68   animClearFrames("monster", "Robot", "pain");
69   // left
70   animAddFrame("monster", "Robot", "pain", ACTOR_DIR_LEFT, "monsters/robot/graphics/shared/robod2d1_mirrored.vga");
71   // right
72   animAddFrame("monster", "Robot", "pain", ACTOR_DIR_RIGHT, "monsters/robot/graphics/shared/robod2d1.vga");
73   // wait
74   animClearFrames("monster", "Robot", "wait");
75   // left
76   animAddFrame("monster", "Robot", "wait", ACTOR_DIR_LEFT, "monsters/robot/graphics/shared/robod2d1_mirrored.vga");
77   // right
78   animAddFrame("monster", "Robot", "wait", ACTOR_DIR_RIGHT, "monsters/robot/graphics/shared/robod2d1.vga");
79   // attack
80   animClearFrames("monster", "Robot", "attack");
81   // left
82   animAddFrame("monster", "Robot", "attack", ACTOR_DIR_LEFT, "monsters/robot/graphics/attack/roboo2o1_mirrored.vga");
83   animAddFrame("monster", "Robot", "attack", ACTOR_DIR_LEFT, "monsters/robot/graphics/attack/roboo2o1_mirrored.vga");
84   animAddFrame("monster", "Robot", "attack", ACTOR_DIR_LEFT, "monsters/robot/graphics/attack/robop2p1_mirrored.vga");
85   animAddFrame("monster", "Robot", "attack", ACTOR_DIR_LEFT, "monsters/robot/graphics/attack/robop2p1_mirrored.vga");
86   animAddFrame("monster", "Robot", "attack", ACTOR_DIR_LEFT, "monsters/robot/graphics/attack/roboq2q1_mirrored.vga");
87   animAddFrame("monster", "Robot", "attack", ACTOR_DIR_LEFT, "monsters/robot/graphics/attack/roboq2q1_mirrored.vga");
88   // right
89   animAddFrame("monster", "Robot", "attack", ACTOR_DIR_RIGHT, "monsters/robot/graphics/attack/roboo2o1.vga");
90   animAddFrame("monster", "Robot", "attack", ACTOR_DIR_RIGHT, "monsters/robot/graphics/attack/roboo2o1.vga");
91   animAddFrame("monster", "Robot", "attack", ACTOR_DIR_RIGHT, "monsters/robot/graphics/attack/robop2p1.vga");
92   animAddFrame("monster", "Robot", "attack", ACTOR_DIR_RIGHT, "monsters/robot/graphics/attack/robop2p1.vga");
93   animAddFrame("monster", "Robot", "attack", ACTOR_DIR_RIGHT, "monsters/robot/graphics/attack/roboq2q1.vga");
94   animAddFrame("monster", "Robot", "attack", ACTOR_DIR_RIGHT, "monsters/robot/graphics/attack/roboq2q1.vga");
95   // die
96   animClearFrames("monster", "Robot", "die");
97   // left
98   animAddFrame("monster", "Robot", "die", ACTOR_DIR_LEFT, "monsters/robot/graphics/shared/robod2d1_mirrored.vga");
99   // right
100   animAddFrame("monster", "Robot", "die", ACTOR_DIR_RIGHT, "monsters/robot/graphics/shared/robod2d1.vga");
101   // slop
102   animClearFrames("monster", "Robot", "slop");
103   // left
104   // right
105   // dead
106   animClearFrames("monster", "Robot", "dead");
107   // left
108   animAddFrame("monster", "Robot", "dead", ACTOR_DIR_LEFT, "monsters/robot/graphics/shared/robod2d1_mirrored.vga");
109   // right
110   animAddFrame("monster", "Robot", "dead", ACTOR_DIR_RIGHT, "monsters/robot/graphics/shared/robod2d1.vga");
111   // mess
112   animClearFrames("monster", "Robot", "mess");
113   // left
114   // right
118 // change actor animation
119 public void setAnim (Actor me, string state) {
120   me.animidx = 0;
121   switch (state) {
122     case "sleep": me.animname = "sleep"; me.animstr = "A"; break;
123     case "go": me.animname = "go"; me.animstr = "DDEEFFGGHHIIJJKKLLAABBCC"; break;
124     case "pain": me.animname = "pain"; me.animstr = "D"; break;
125     case "wait": me.animname = "wait"; me.animstr = "D"; break;
126     case "attack": me.animname = "attack"; me.animstr = "OOPPQQ"; break;
127     case "die": me.animname = "die"; me.animstr = "D"; break;
128     case "slop": me.animname = "slop"; me.animstr = ""; break;
129     case "dead": me.animname = "dead"; me.animstr = "D"; break;
130     case "mess": me.animname = "mess"; me.animstr = ""; break;
131     case "run": me.animname = "go"; me.animstr = "DDEEFFGGHHIIJJKKLLAABBCC"; break;
132     case "climb": me.animname = "go"; me.animstr = "DDEEFFGGHHIIJJKKLLAABBCC"; break;
133     case "runout": me.animname = "go"; me.animstr = "DDEEFFGGHHIIJJKKLLAABBCC"; break;
134     case "shoot": me.animname = "attack"; me.animstr = "OOPPQQ"; break;
135     case "revive": me.animname = "revive"; me.animstr = "D"; break;
136     default: me.animname = "sleep"; me.animstr = "A"; break;
137   }
138   me.actorSetAnimation(state);
142 // setup actor properties
143 public void initialize (Actor me) {
144   // `classname` and `classtype` will be set by the engine
145   //me.classname = "Robot";
146   //me.classtype = "monster";
147   me.radius = 17;
148   me.height = 38;
149   me.hitpoints = me.life = 20;
150   me.painin = 40;
151   me.xvel = 3;
152   me.yvel = 6;
153   me.slophit = 0;
154   me.painout = 20;
155   me.angertime = 90;
156   me.setAnim("sleep");
160 // thinker
161 public void think (Actor me) {
162   monsterThink(me);