X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fw_electro.qc;h=6634d3ae107a76546cb977a509a24531c92af94b;hb=9d9cf783d3ac428fbbe95553c8f5c7e113d888bb;hp=ad1fbf0fddcf2a02eb261cd7ec830b4f466c0662;hpb=b2dc1d0a1c73a6eeb47df5092be173db37da1f7d;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/w_electro.qc b/qcsrc/server/w_electro.qc index ad1fbf0fd..6634d3ae1 100644 --- a/qcsrc/server/w_electro.qc +++ b/qcsrc/server/w_electro.qc @@ -1,5 +1,15 @@ #ifdef REGISTER_WEAPON -REGISTER_WEAPON(ELECTRO, w_electro, IT_CELLS, 5, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "electro", "electro", _("Electro")); +REGISTER_WEAPON( +/* WEP_##id */ ELECTRO, +/* function */ w_electro, +/* ammotype */ IT_CELLS, +/* impulse */ 5, +/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH, +/* rating */ BOT_PICKUP_RATING_MID, +/* model */ "electro", +/* shortname */ "electro", +/* fullname */ _("Electro") +); #else #ifdef SVQC .float electro_count; @@ -29,22 +39,22 @@ void W_Plasma_TriggerCombo(vector org, float rad, entity own) void W_Plasma_Explode (void) { if(other.takedamage == DAMAGE_AIM) - if(other.classname == "player") + if(IS_PLAYER(other)) if(IsDifferentTeam(self.realowner, other)) if(other.deadflag == DEAD_NO) if(IsFlying(other)) - AnnounceTo(self.realowner, "electrobitch"); + Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH); self.event_damage = func_null; self.takedamage = DAMAGE_NO; if (self.movetype == MOVETYPE_BOUNCE) { - RadiusDamage (self, self.realowner, autocvar_g_balance_electro_secondary_damage, autocvar_g_balance_electro_secondary_edgedamage, autocvar_g_balance_electro_secondary_radius, world, autocvar_g_balance_electro_secondary_force, self.projectiledeathtype, other); + RadiusDamage (self, self.realowner, autocvar_g_balance_electro_secondary_damage, autocvar_g_balance_electro_secondary_edgedamage, autocvar_g_balance_electro_secondary_radius, world, world, autocvar_g_balance_electro_secondary_force, self.projectiledeathtype, other); } else { W_Plasma_TriggerCombo(self.origin, autocvar_g_balance_electro_primary_comboradius, self.realowner); - RadiusDamage (self, self.realowner, autocvar_g_balance_electro_primary_damage, autocvar_g_balance_electro_primary_edgedamage, autocvar_g_balance_electro_primary_radius, world, autocvar_g_balance_electro_primary_force, self.projectiledeathtype, other); + RadiusDamage (self, self.realowner, autocvar_g_balance_electro_primary_damage, autocvar_g_balance_electro_primary_edgedamage, autocvar_g_balance_electro_primary_radius, world, world, autocvar_g_balance_electro_primary_force, self.projectiledeathtype, other); } remove (self); @@ -55,7 +65,8 @@ void W_Plasma_Explode_Combo (void) W_Plasma_TriggerCombo(self.origin, autocvar_g_balance_electro_combo_comboradius, self.realowner); self.event_damage = func_null; - RadiusDamage (self, self.realowner, autocvar_g_balance_electro_combo_damage, autocvar_g_balance_electro_combo_edgedamage, autocvar_g_balance_electro_combo_radius, world, autocvar_g_balance_electro_combo_force, WEP_ELECTRO | HITTYPE_BOUNCE, world); // use THIS type for a combo because primary can't bounce + RadiusDamage (self, self.realowner, autocvar_g_balance_electro_combo_damage, autocvar_g_balance_electro_combo_edgedamage, autocvar_g_balance_electro_combo_radius, world, world, autocvar_g_balance_electro_combo_force, WEP_ELECTRO | HITTYPE_BOUNCE, world); // use THIS type for a combo because primary can't bounce + remove (self); } @@ -437,13 +448,8 @@ float w_electro(float req) { if(autocvar_g_balance_electro_lightning) if(self.BUTTON_ATCK_prev) - { - // prolong the animtime while the gun is being fired - if(self.animstate_startframe == self.anim_shoot_x && self.animstate_numframes == self.anim_shoot_y) - weapon_thinkf(WFRAME_DONTCHANGE, autocvar_g_balance_electro_primary_animtime, w_ready); - else - weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_electro_primary_animtime, w_ready); - } + weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_electro_primary_animtime, w_ready); + if (weapon_prepareattack(0, (autocvar_g_balance_electro_lightning ? 0 : autocvar_g_balance_electro_primary_refire))) { if(autocvar_g_balance_electro_lightning) @@ -548,6 +554,27 @@ float w_electro(float req) { W_Reload(min(autocvar_g_balance_electro_primary_ammo, autocvar_g_balance_electro_secondary_ammo), autocvar_g_balance_electro_reload_ammo, autocvar_g_balance_electro_reload_time, "weapons/reload.wav"); } + else if (req == WR_SUICIDEMESSAGE) + { + if(w_deathtype & HITTYPE_SECONDARY) + return WEAPON_ELECTRO_SUICIDE_ORBS; + else + return WEAPON_ELECTRO_SUICIDE_BOLT; + } + else if (req == WR_KILLMESSAGE) + { + if(w_deathtype & HITTYPE_SECONDARY) + { + return WEAPON_ELECTRO_MURDER_ORBS; + } + else + { + if(w_deathtype & HITTYPE_BOUNCE) + return WEAPON_ELECTRO_MURDER_COMBO; + else + return WEAPON_ELECTRO_MURDER_BOLT; + } + } return TRUE; } #endif @@ -586,32 +613,6 @@ float w_electro(float req) precache_sound("weapons/electro_impact.wav"); precache_sound("weapons/electro_impact_combo.wav"); } - else if (req == WR_SUICIDEMESSAGE) - { - if(w_deathtype & HITTYPE_SECONDARY) - w_deathtypestring = _("%s could not remember where they put their electro plasma"); - else - w_deathtypestring = _("%s played with electro plasma"); - } - else if (req == WR_KILLMESSAGE) - { - if(w_deathtype & HITTYPE_SECONDARY) - { - if(w_deathtype & HITTYPE_SPLASH) // unchecked: BOUNCE - w_deathtypestring = _("%s just noticed %s's electro plasma"); - else // unchecked: BOUNCE - w_deathtypestring = _("%s got in touch with %s's electro plasma"); - } - else - { - if(w_deathtype & HITTYPE_BOUNCE) // combo - w_deathtypestring = _("%s felt the electrifying air of %s's electro combo"); - else if(w_deathtype & HITTYPE_SPLASH) - w_deathtypestring = _("%s got too close to %s's blue electro bolt"); - else - w_deathtypestring = _("%s was blasted by %s's blue electro bolt"); - } - } return TRUE; } #endif