1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
|
main()
{
gasfx1 = loadfx ("explosions/aerial_explosion");
gasfx2 = loadfx ("fire/gas_pump_fire");
gastrigs = getentarray("firetrig","targetname");
for(i=0;i<gastrigs.size;i++)
{
gastrigs[i] thread dogasow(gasfx1,gasfx2);
}
}
dogasow(gasfx1,gasfx2)
{
targetdamage=1000;
totaldamage=0;
gasowShattered=false;
gasowBroken=false;
self enablegrenadetouchdamage();
NormalState = getent(self.target,"targetname");
ShatteredState = getent(NormalState.target,"targetname");ShatteredState hide();
BrokenState = getent(shatteredState.target,"targetname");BrokenState hide();
while(!gasowbroken)
{
self waittill ("damage", amount,attacker, direction_vec, point, type);
totaldamage+=amount;
if(totaldamage>targetdamage || getdamagetype(type)=="explosion")
{
gasowBroken=true;
}
if(!gasowShattered)
{
ShatteredState show();
NormalState delete();
gasowShattered=true;
}
}
BrokenState show();
self playsound ("explo_metal_rand");
BrokenState playloopsound ("fire_metal_large");
PlayFX(gasfx1, BrokenState.origin);
PlayFX(gasfx2, BrokenState.origin);
ShatteredState delete();
self delete();
}
getDamageType(type)
{
if(!isdefined(type)){return "unknown";}
type = tolower(type);
switch(type)
{
case "mod_explosion":
case "mod_crush":
case "explosion":
return "explosion";
default:
return "other";
}
}
|