X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fw_porto.qc;h=8083a79685d3a17e862514d73491f418888d4b51;hb=a348133f389bded7a6a09d114ef2e764690c68ac;hp=55bbc51f8c4bc44624187cabe4fcdba3ddc74cce;hpb=715202f719f244160bfc0b004013fa6e1bcc5668;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/w_porto.qc b/qcsrc/server/w_porto.qc index 55bbc51f8..8083a7968 100644 --- a/qcsrc/server/w_porto.qc +++ b/qcsrc/server/w_porto.qc @@ -1,6 +1,7 @@ #ifdef REGISTER_WEAPON REGISTER_WEAPON(PORTO, w_porto, 0, 0, WEP_TYPE_OTHER, 0, "porto" , "porto", "Port-O-Launch"); #else +#ifdef SVQC .entity porto_current; .vector porto_v_angle; // holds "held" view angles .float porto_v_angle_held; @@ -159,7 +160,7 @@ void W_Porto_Attack (void) if not(self.items & IT_UNLIMITED_SUPERWEAPONS) self.weapons = self.weapons - (self.weapons & WEPBIT_PORTO); - W_SetupShot (self, FALSE, 4, "porto/fire.wav", 0); + W_SetupShot (self, FALSE, 4, "porto/fire.wav", CHAN_WEAPON, 0); // always shoot from the eye w_shotdir = v_forward; w_shotorg = self.origin + self.view_ofs + ((w_shotorg - self.origin - self.view_ofs) * v_forward) * v_forward; @@ -179,13 +180,13 @@ void W_Porto_Attack (void) setorigin(gren, w_shotorg); setsize(gren, '0 0 0', '0 0 0'); - gren.nextthink = time + cvar("g_balance_porto_primary_lifetime"); + gren.nextthink = time + autocvar_g_balance_porto_primary_lifetime; gren.think = W_Porto_Think; gren.touch = W_Porto_Touch; if(self.items & IT_STRENGTH) - W_SetupProjectileVelocity(gren, cvar("g_balance_porto_primary_speed") * cvar("g_balance_powerup_strength_force"), 0); + W_SetupProjectileVelocity(gren, autocvar_g_balance_porto_primary_speed * autocvar_g_balance_powerup_strength_force, 0); else - W_SetupProjectileVelocity(gren, cvar("g_balance_porto_primary_speed"), 0); + W_SetupProjectileVelocity(gren, autocvar_g_balance_porto_primary_speed, 0); gren.angles = vectoangles (gren.velocity); gren.flags = FL_PROJECTILE; @@ -199,6 +200,8 @@ void W_Porto_Attack (void) gren.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP; CSQCProjectile(gren, TRUE, PROJECTILE_PORTO_RED, TRUE); + + other = gren; MUTATOR_CALLHOOK(EditProjectile); } void spawnfunc_weapon_porto (void) @@ -216,7 +219,7 @@ float w_porto(float req) { self.BUTTON_ATCK = FALSE; self.BUTTON_ATCK2 = FALSE; - if(bot_aim(cvar("g_balance_porto_primary_speed"), 0, cvar("g_balance_grenadelauncher_primary_lifetime"), FALSE)) + if(bot_aim(autocvar_g_balance_porto_primary_speed, 0, autocvar_g_balance_grenadelauncher_primary_lifetime, FALSE)) self.BUTTON_ATCK = TRUE; } else if (req == WR_THINK) @@ -247,10 +250,10 @@ float w_porto(float req) if (self.BUTTON_ATCK) if (!self.porto_current) if (!self.porto_forbidden) - if (weapon_prepareattack(0, cvar("g_balance_porto_primary_refire"))) + if (weapon_prepareattack(0, autocvar_g_balance_porto_primary_refire)) { W_Porto_Attack(); - weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_porto_primary_animtime"), w_ready); + weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_porto_primary_animtime, w_ready); } } else if (req == WR_PRECACHE) @@ -268,10 +271,6 @@ float w_porto(float req) } else if (req == WR_SETUP) weapon_setup(WEP_PORTO); - else if (req == WR_SUICIDEMESSAGE) - w_deathtypestring = "did the impossible"; - else if (req == WR_KILLMESSAGE) - w_deathtypestring = "felt # doing the impossible to him"; else if (req == WR_RESETPLAYER) { self.porto_current = world; @@ -279,3 +278,22 @@ float w_porto(float req) return TRUE; }; #endif +#ifdef CSQC +float w_porto(float req) +{ + if(req == WR_IMPACTEFFECT) + { + print("Since when does Porto send DamageInfo?\n"); + } + else if(req == WR_PRECACHE) + { + // nothing to do + } + else if (req == WR_SUICIDEMESSAGE) + w_deathtypestring = "%s did the impossible"; + else if (req == WR_KILLMESSAGE) + w_deathtypestring = "%s felt %s doing the impossible to him"; + return TRUE; +} +#endif +#endif