5 if (other.solid == SOLID_BSP)
6 if (vlen(self.velocity) >= 50)
7 if (time >= self.attack_finished_single)
12 f = floor(random() * 3) + 1;
14 s = strcat("weapons/casings", ftos(f), ".wav");
15 else if(self.state == 2)
16 s = strcat("weapons/steel", ftos(f), ".wav");
18 s = strcat("weapons/brass", ftos(f), ".wav");
19 sound (self, CHAN_PROJECTILE, s, VOL_BASE, ATTN_NORM);
21 self.attack_finished_single = time + 0.2;
22 //self.touch = SUB_Null; // one tink is enough
23 //self.dest = self.origin - self.groundentity.origin;
29 self.nextthink = time + 0.1;
30 if (self.flags & FL_ONGROUND)
32 // just keep the yaw angle
35 self.flags = self.flags - FL_ONGROUND;
36 self.nextthink = time + 0.5;
38 p = pointcontents(self.origin);
39 if (p == CONTENT_SOLID || p == CONTENT_LAVA || p == CONTENT_SKY)
46 self.nextthink = time;
47 self.alpha = self.alpha - frametime;
48 if (self.alpha < 0.0625)
53 // knock loose the casing when disturbed
54 void casingknockedloosefunc()
56 self.movetype = MOVETYPE_BOUNCE;
57 self.flags = self.flags - (self.flags & FL_ONGROUND);
58 self.avelocity = randomvec() * 300;
59 self.nextthink = time + 0.1;
60 self.touch = casingtouch;
63 void SpawnCasing(vector org, vector vel, float randomvel, vector ang, vector avel, float randomavel, float casingtype)
66 if (cvar("temp1") & 2048)
74 e.movetype = MOVETYPE_BOUNCE;
75 e.solid = SOLID_TRIGGER;
76 e.velocity = vel + randomvec() * randomvel;
78 e.avelocity = avel + randomvec() * randomavel;
80 e.think = casingthink;
81 e.touch = casingtouch;
82 //e.knockedloosefunc = casingknockedloosefunc;
83 e.effects = EF_LOWPRECISION;
87 setmodel (e, "models/casing_shell.mdl"); // precision set above
89 // bias to make these be considered more important than other things
90 e.createdtime = time + 1;
92 else if (casingtype == 2)
94 // FIXME: this is not used and not precached, uncomment if you need it
95 //setmodel (e, "models/casing_steel.mdl"); // precision set above
100 setmodel (e, "models/casing_bronze.mdl"); // precision set above
105 setsize (e, '0 0 -1', '0 0 -1');