koi moved to separate module
[dd2d.git] / data / scripts / monsterai.dacs
blob0343544a856ffa399f86c27fccf8572fb816ef1a
1 module monsterai;
3 import actor;
4 import moveapi;
7 field(Actor) int lightCooldown;
10 public void monsterThink (Actor me) {
11   Z_simpleGravity(me);
12   if (!me) return; // it can die/fallout
13   // debug ;-)
14   if (--me.lightCooldown <= 0) {
15     me.lightCooldown = 0;
16     me.attachedLightRGBX(200, 0, 0, 0);
17   }
18   rewindTouchList();
19   for (Actor other = getNextTouchListItem; other; other = getNextTouchListItem) {
20     me.attLightXOfs = 0;
21     me.attLightYOfs = -6;
22     me.attachedLightRGBX(200, 0, 0, 48);
23     me.lightCooldown = 10;
24     if (!other.isPlayer) {
25       other.attLightXOfs = 0;
26       other.attLightYOfs = -12;
27       other.attachedLightRGBX(200, 100, 0, 32);
28       other.lightCooldown = 10;
29     }
30   }