1 void() rlauncher_ready_01;
2 void() rlauncher_fire1_01;
3 void() rlauncher_fire2_01;
4 void() rlauncher_fire3_01;
5 void() rlauncher_deselect_01;
6 void() rlauncher_select_01;
7 void() W_Rocket_Attack2;
9 float() rlauncher_check =
11 if (self.ammo_rockets > 0)
16 void(float req) w_rlauncher =
20 else if (req == WR_FIRE1)
21 weapon_prepareattack(rlauncher_check, rlauncher_check, rlauncher_fire1_01, 1.5);
22 else if (req == WR_FIRE2)
24 if (time < self.attack_finished)
27 else if (req == WR_FIRE3)
28 weapon_prepareattack(rlauncher_check, rlauncher_check, rlauncher_fire3_01, 1.5);
29 else if (req == WR_RAISE)
30 rlauncher_select_01();
31 else if (req == WR_UPDATECOUNTS)
32 self.currentammo = self.ammo_rockets;
33 else if (req == WR_DROP)
34 rlauncher_deselect_01();
35 else if (req == WR_SETUP)
36 weapon_setup(WEP_ROCKET_LAUNCHER, "w_rl.zym", IT_ROCKETS);
37 else if (req == WR_CHECKAMMO)
38 weapon_hasammo = rlauncher_check();
42 void W_Rocket_Explode (entity ignore)
44 ImpactEffect (self, IT_ROCKET_LAUNCHER);
46 self.event_damage = SUB_Null;
47 RadiusDamage (self, self.owner, 130, 50, 170, ignore, 600, IT_ROCKET_LAUNCHER);
52 void W_Rocket_Think (void)
54 W_Rocket_Explode (world);
57 void W_Rocket_Touch (void)
59 if (other == self.owner)
61 else if (pointcontents (self.origin) == CONTENT_SKY)
67 W_Rocket_Explode (world);
70 void W_Rocket_Damage (vector hitloc, float damage, entity inflictor, entity attacker, float deathtype)
72 self.health = self.health - damage;
74 W_Rocket_Explode(world);
77 void W_Rocket_Attack (void)
81 makevectors (self.v_angle);
82 sound (self, CHAN_WEAPON, "weapons/rocket_fire.wav", 1, ATTN_NORM);
86 missile.classname = "missile";
88 missile.takedamage = DAMAGE_YES;
89 missile.damageforcescale = 4;
91 missile.event_damage = W_Rocket_Damage;
93 missile.movetype = MOVETYPE_FLY;
94 missile.solid = SOLID_BBOX;
95 setmodel (missile, "models/rocketmissile.mdl");
96 setsize (missile, '0 0 0', '0 0 0');
98 org = self.origin + self.view_ofs + v_forward * 20 + v_right * 4 + v_up * -15;
100 setorigin (missile, org);
101 missile.velocity = v_forward * 850;
102 missile.angles = vectoangles (missile.velocity);
104 missile.touch = W_Rocket_Touch ;
105 missile.think = W_Rocket_Think;
106 missile.nextthink = time + 9;
108 self.attack_finished = time + 1.5;
110 if (!(game & GAME_ROCKET_ARENA))
111 self.ammo_rockets = self.ammo_rockets - 1;
114 void W_Rocket_Attack2 (void)
117 proj = findradius (self.origin, 50000);
120 if (proj.classname == "missile" && proj.owner == self)
122 proj.nextthink = time;
127 self.attack_finished = time + 0.1;
131 void W_Rocket_Attack3 (void)
138 void() rlauncher_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, rlauncher_ready_01); self.weaponentity.state = WS_READY;};
139 void() rlauncher_select_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
140 void() rlauncher_deselect_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
141 void() rlauncher_fire1_01 =
143 weapon_doattack(rlauncher_check, rlauncher_check, W_Rocket_Attack);
144 weapon_thinkf(WFRAME_FIRE1, 0.3, rlauncher_ready_01);
146 void() rlauncher_fire2_01 =
148 weapon_doattack(rlauncher_check, rlauncher_check, W_Rocket_Attack2);
149 weapon_thinkf(WFRAME_FIRE2, 0.3, rlauncher_ready_01);
151 void() rlauncher_fire3_01 =
153 weapon_doattack(rlauncher_check, rlauncher_check, W_Rocket_Attack3);
154 weapon_thinkf(WFRAME_FIRE2, 0.3, rlauncher_ready_01);