1 void() rlauncher_ready_01;
2 void() rlauncher_fire1_01;
3 void() rlauncher_deselect_01;
4 void() rlauncher_select_01;
6 float() rlauncher_check =
8 if (self.ammo_rockets >= 3)
13 void(float req) w_rlauncher =
17 else if (req == WR_FIRE1)
18 weapon_prepareattack(rlauncher_check, rlauncher_check, rlauncher_fire1_01, cvar("g_balance_rocketlauncher_refire"));
19 else if (req == WR_RAISE)
20 rlauncher_select_01();
21 else if (req == WR_UPDATECOUNTS)
22 self.currentammo = self.ammo_rockets;
23 else if (req == WR_DROP)
24 rlauncher_deselect_01();
25 else if (req == WR_SETUP)
26 weapon_setup(WEP_ROCKET_LAUNCHER, "w_rl.zym", IT_ROCKETS);
27 else if (req == WR_CHECKAMMO)
28 weapon_hasammo = rlauncher_check();
32 void W_Rocket_Explode (void)
35 org2 = findbetterlocation (self.origin);
37 effect (org2, "models/sprites/rocketexplosion.spr32", 0, 26, 30);
38 sound (self, CHAN_BODY, "weapons/rocket_impact.wav", 1, ATTN_NORM);
40 self.event_damage = SUB_Null;
41 RadiusDamage (self, self.owner, cvar("g_balance_rocketlauncher_damage"), cvar("g_balance_rocketlauncher_edgedamage"), cvar("g_balance_rocketlauncher_radius"), world, cvar("g_balance_rocketlauncher_force"), IT_ROCKET_LAUNCHER);
46 void W_Rocket_Think (void)
48 self.nextthink = time;
54 if (self.owner.weapon == WEP_ROCKET_LAUNCHER)
55 if (self.owner.button3)
59 void W_Rocket_Touch (void)
61 if (pointcontents (self.origin) == CONTENT_SKY)
70 void W_Rocket_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
72 self.health = self.health - damage;
77 void W_Rocket_Attack (void)
82 sound (self, CHAN_WEAPON, "weapons/rocket_fire.wav", 1, ATTN_NORM);
83 if (cvar("g_rocketarena") == 0)
84 self.ammo_rockets = self.ammo_rockets - 3;
85 self.punchangle_x = -4;
86 org = self.origin + self.view_ofs + v_forward * 15 + v_right * 3 + v_up * -11;
91 missile.classname = "missile";
93 missile.takedamage = DAMAGE_YES;
94 missile.damageforcescale = 4;
96 missile.event_damage = W_Rocket_Damage;
98 missile.movetype = MOVETYPE_FLY;
99 missile.solid = SOLID_BBOX;
100 setmodel (missile, "models/rocket.md3");
101 setsize (missile, '0 0 0', '0 0 0');
103 setorigin (missile, org);
104 missile.velocity = v_forward * cvar("g_balance_rocketlauncher_speed");
105 missile.angles = vectoangles (missile.velocity);
107 missile.touch = W_Rocket_Touch;
108 missile.think = W_Rocket_Think;
109 missile.nextthink = time;
110 missile.cnt = time + 9;
111 sound (missile, CHAN_BODY, "weapons/rocket_fly.wav", 0.4, ATTN_NORM);
114 setorigin (flash, org);
115 setmodel (flash, "models/flash.md3");
116 flash.velocity = v_forward * 20;
117 flash.angles = vectoangles (flash.velocity);
118 SUB_SetFade (flash, time, 0.4);
119 flash.effects = flash.effects | EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
124 void() rlauncher_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, rlauncher_ready_01); self.weaponentity.state = WS_READY;};
125 void() rlauncher_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');};
126 void() rlauncher_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);};
127 void() rlauncher_fire1_01 =
129 weapon_doattack(rlauncher_check, rlauncher_check, W_Rocket_Attack);
130 weapon_thinkf(WFRAME_FIRE1, 0.3, rlauncher_ready_01);