From: Samual Lenks Date: Tue, 11 Jun 2013 03:03:28 +0000 (-0400) Subject: Switch the code ENTIRELY to use "Arc" instead of "Lightning" for the name X-Git-Tag: xonotic-v0.8.0~152^2~393 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=06c03fc0bb1a9bd5c0e8ab90b3b5359d4028b583;p=xonotic%2Fxonotic-data.pk3dir.git Switch the code ENTIRELY to use "Arc" instead of "Lightning" for the name --- diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index c1ad208d3..cf6536901 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -876,7 +876,7 @@ void CSQC_Ent_Update(float bIsNewEntity) case ENT_CLIENT_TRIGGER_MUSIC: Ent_ReadTriggerMusic(); break; case ENT_CLIENT_HOOK: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_HOOK); break; case ENT_CLIENT_ELECTRO_BEAM: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_ELECTRO_BEAM); break; - case ENT_CLIENT_LIGHTNING_BEAM: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_LIGHTNING_BEAM); break; + case ENT_CLIENT_ARC_BEAM: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_ARC_BEAM); break; case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break; case ENT_CLIENT_AUXILIARYXHAIR: Net_AuXair2(bIsNewEntity); break; case ENT_CLIENT_TURRET: ent_turret(); break; @@ -1016,10 +1016,10 @@ void Ent_Init() electro_shotorigin[1] = decompressShotOrigin(ReadInt24_t()); electro_shotorigin[2] = decompressShotOrigin(ReadInt24_t()); electro_shotorigin[3] = decompressShotOrigin(ReadInt24_t()); - lightning_shotorigin[0] = decompressShotOrigin(ReadInt24_t()); - lightning_shotorigin[1] = decompressShotOrigin(ReadInt24_t()); - lightning_shotorigin[2] = decompressShotOrigin(ReadInt24_t()); - lightning_shotorigin[3] = decompressShotOrigin(ReadInt24_t()); + arc_shotorigin[0] = decompressShotOrigin(ReadInt24_t()); + arc_shotorigin[1] = decompressShotOrigin(ReadInt24_t()); + arc_shotorigin[2] = decompressShotOrigin(ReadInt24_t()); + arc_shotorigin[3] = decompressShotOrigin(ReadInt24_t()); if(forcefog) strunzone(forcefog); @@ -1285,8 +1285,8 @@ float CSQC_Parse_TempEntity() Net_TeamNagger(); bHandled = true; break; - case TE_CSQC_LIGHTNINGARC: - Net_ReadLightningarc(); + case TE_CSQC_ARC: + Net_ReadArc(); bHandled = true; break; case TE_CSQC_PINGPLREPORT: diff --git a/qcsrc/client/effects.qc b/qcsrc/client/effects.qc index 8c237aade..c35a3a94a 100644 --- a/qcsrc/client/effects.qc +++ b/qcsrc/client/effects.qc @@ -95,3 +95,4 @@ void Net_ReadLightningarc() } } +void Net_ReadArc() { Net_ReadLightningarc(); } diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index 75a15834d..662de9fc7 100644 --- a/qcsrc/client/hook.qc +++ b/qcsrc/client/hook.qc @@ -78,7 +78,7 @@ void Draw_GrapplingHook() case ENT_CLIENT_ELECTRO_BEAM: vs = electro_shotorigin[s]; break; - case ENT_CLIENT_LIGHTNING_BEAM: + case ENT_CLIENT_ARC_BEAM: vs = lightning_shotorigin[s]; break; } @@ -93,7 +93,7 @@ void Draw_GrapplingHook() b = self.origin; break; case ENT_CLIENT_ELECTRO_BEAM: - case ENT_CLIENT_LIGHTNING_BEAM: + case ENT_CLIENT_ARC_BEAM: if(self.HookRange) b = view_origin + view_forward * self.HookRange; else @@ -114,7 +114,7 @@ void Draw_GrapplingHook() b = self.origin; break; case ENT_CLIENT_ELECTRO_BEAM: - case ENT_CLIENT_LIGHTNING_BEAM: + case ENT_CLIENT_ARC_BEAM: a = self.origin; b = self.velocity; break; @@ -161,7 +161,7 @@ void Draw_GrapplingHook() tex = "particles/lgbeam"; rgb = '1 1 1'; break; - case ENT_CLIENT_LIGHTNING_BEAM: // todo + case ENT_CLIENT_ARC_BEAM: // todo intensity = bound(0.2, 1 + Noise_Pink(self, frametime) * 1 + Noise_Burst(self, frametime, 0.03) * 0.3, 2); offset = Noise_Brown(self, frametime) * 10; tex = "particles/lgbeam"; @@ -194,7 +194,7 @@ void Draw_GrapplingHook() } break; case ENT_CLIENT_ELECTRO_BEAM: - case ENT_CLIENT_LIGHTNING_BEAM: + case ENT_CLIENT_ARC_BEAM: setorigin(self, a); // beam origin! break; } @@ -207,7 +207,7 @@ void Draw_GrapplingHook() case ENT_CLIENT_ELECTRO_BEAM: pointparticles(particleeffectnum("electro_lightning"), trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect break; - case ENT_CLIENT_LIGHTNING_BEAM: + case ENT_CLIENT_ARC_BEAM: pointparticles(particleeffectnum("electro_lightning"), trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect break; } @@ -240,7 +240,7 @@ void Ent_ReadHook(float bIsNew, float type) self.HookRange = 0; break; case ENT_CLIENT_ELECTRO_BEAM: - case ENT_CLIENT_LIGHTNING_BEAM: + case ENT_CLIENT_ARC_BEAM: self.HookRange = ReadCoord(); break; } @@ -277,7 +277,7 @@ void Ent_ReadHook(float bIsNew, float type) case ENT_CLIENT_ELECTRO_BEAM: sound (self, CH_SHOTS_SINGLE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTN_NORM); break; - case ENT_CLIENT_LIGHTNING_BEAM: + case ENT_CLIENT_ARC_BEAM: sound (self, CH_SHOTS_SINGLE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTN_NORM); break; } diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 3a410b793..0fc1a98be 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -32,7 +32,7 @@ const float TE_CSQC_PICTURE = 100; const float TE_CSQC_RACE = 101; const float TE_CSQC_ZCURVEPARTICLES = 102; const float TE_CSQC_NEXGUNBEAMPARTICLE = 103; -const float TE_CSQC_LIGHTNINGARC = 104; +const float TE_CSQC_ARC = 104; const float TE_CSQC_TEAMNAGGER = 105; const float TE_CSQC_PINGPLREPORT = 106; const float TE_CSQC_TARGET_MUSIC = 107; @@ -88,7 +88,7 @@ const float ENT_CLIENT_WARPZONE_CAMERA = 25; const float ENT_CLIENT_TRIGGER_MUSIC = 26; const float ENT_CLIENT_HOOK = 27; const float ENT_CLIENT_ELECTRO_BEAM = 28; -const float ENT_CLIENT_LIGHTNING_BEAM = 29; +const float ENT_CLIENT_ARC_BEAM = 29; const float ENT_CLIENT_ACCURACY = 30; const float ENT_CLIENT_SHOWNAMES = 31; const float ENT_CLIENT_WARPZONE_TELEPORTED = 32; diff --git a/qcsrc/common/weapons/w_arc.qc b/qcsrc/common/weapons/w_arc.qc index a272616e2..0f5cc152c 100644 --- a/qcsrc/common/weapons/w_arc.qc +++ b/qcsrc/common/weapons/w_arc.qc @@ -1,12 +1,12 @@ #ifdef REGISTER_WEAPON REGISTER_WEAPON( -/* WEP_##id */ LIGHTNING, -/* function */ w_lightning, +/* WEP_##id */ ARC, +/* function */ w_arc, /* ammotype */ IT_CELLS, /* impulse */ 5, /* flags */ WEP_FLAG_NORMAL, /* rating */ BOT_PICKUP_RATING_HIGH, -/* model */ "lightning", +/* model */ "arc", /* shortname */ "arc", /* fullname */ _("Arc") ); @@ -24,24 +24,23 @@ REGISTER_WEAPON( WEP_ADD_PROP(weapon, switchdelay_raise, switchdelay_raise) \ WEP_ADD_PROP(weapon, switchdelay_drop, switchdelay_drop) -#ifdef SVQC -ARC_SETTINGS(arc) -void LightningInit(); -vector lightning_shotorigin[4]; +#ifndef MENUQC +vector arc_shotorigin[4]; #endif -#else #ifdef SVQC - -// Declarations ========================= +ARC_SETTINGS(arc) +void ArcInit(); .vector hook_start, hook_end; // used for beam -.entity lightning_beam; // used for beam +.entity arc_beam; // used for beam .float BUTTON_ATCK_prev; // for better animation control .float lg_fire_prev; // for better animation control +#endif +#else +#ifdef SVQC -// Lightning functions ========================= -float W_Lightning_Beam_Send(entity to, float sf) +float W_Arc_Beam_Send(entity to, float sf) { - WriteByte(MSG_ENTITY, ENT_CLIENT_LIGHTNING_BEAM); + WriteByte(MSG_ENTITY, ENT_CLIENT_ARC_BEAM); sf = sf & 0x7F; if(sound_allowed(MSG_BROADCAST, self.owner)) sf |= 0x80; @@ -66,18 +65,18 @@ float W_Lightning_Beam_Send(entity to, float sf) return TRUE; } -void W_Lightning_Beam_Think() +void W_Arc_Beam_Think() { self.owner.lg_fire_prev = time; - if (self != self.owner.lightning_beam) + if (self != self.owner.arc_beam) { remove(self); return; } if (self.owner.weaponentity.state != WS_INUSE || (self.owner.ammo_cells <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK || self.owner.freezetag_frozen) { - if(self == self.owner.lightning_beam) - self.owner.lightning_beam = world; + if(self == self.owner.arc_beam) + self.owner.arc_beam = world; remove(self); return; } @@ -109,8 +108,8 @@ void W_Lightning_Beam_Think() f = ExponentialFalloff(WEP_CVAR_PRI(arc, falloff_mindist), WEP_CVAR_PRI(arc, falloff_maxdist), WEP_CVAR_PRI(arc, falloff_halflifedist), vlen(WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos) - w_shotorg)); if(accuracy_isgooddamage(self.owner, trace_ent)) - accuracy_add(self.owner, WEP_LIGHTNING, 0, WEP_CVAR_PRI(arc, damage) * dt * f); - Damage (trace_ent, self.owner, self.owner, WEP_CVAR_PRI(arc, damage) * dt * f, WEP_LIGHTNING, trace_endpos, force * dt); + accuracy_add(self.owner, WEP_ARC, 0, WEP_CVAR_PRI(arc, damage) * dt * f); + Damage (trace_ent, self.owner, self.owner, WEP_CVAR_PRI(arc, damage) * dt * f, WEP_ARC, trace_endpos, force * dt); } // draw effect @@ -127,7 +126,7 @@ void W_Lightning_Beam_Think() } // Attack functions ========================= -void W_Lightning_Attack1 (void) +void W_Arc_Attack1 (void) { // only play fire sound if 0.5 sec has passed since player let go the fire button if(time - self.lg_fire_prev > 0.5) @@ -135,16 +134,16 @@ void W_Lightning_Attack1 (void) entity beam, oldself; - self.lightning_beam = beam = spawn(); - beam.classname = "W_Lightning_Beam"; + self.arc_beam = beam = spawn(); + beam.classname = "W_Arc_Beam"; beam.solid = SOLID_NOT; - beam.think = W_Lightning_Beam_Think; + beam.think = W_Arc_Beam_Think; beam.owner = self; beam.movetype = MOVETYPE_NONE; beam.shot_spread = 1; beam.bot_dodge = TRUE; beam.bot_dodgerating = WEP_CVAR_PRI(arc, damage); - Net_LinkEntity(beam, FALSE, 0, W_Lightning_Beam_Send); + Net_LinkEntity(beam, FALSE, 0, W_Arc_Beam_Send); oldself = self; self = beam; @@ -152,7 +151,7 @@ void W_Lightning_Attack1 (void) self = oldself; } -float w_lightning(float req) +float w_arc(float req) { if (req == WR_AIM) { @@ -166,8 +165,8 @@ float w_lightning(float req) { float shoot; - if(autocvar_g_balance_lightning_primary_speed) - shoot = bot_aim(autocvar_g_balance_lightning_primary_speed, 0, autocvar_g_balance_lightning_primary_lifetime, FALSE); + if(autocvar_g_balance_arc_primary_speed) + shoot = bot_aim(autocvar_g_balance_arc_primary_speed, 0, autocvar_g_balance_arc_primary_lifetime, FALSE); else shoot = bot_aim(1000000, 0, 0.001, FALSE); @@ -179,7 +178,7 @@ float w_lightning(float req) } else // todo { - //if(bot_aim(autocvar_g_balance_lightning_secondary_speed, autocvar_g_balance_grenadelauncher_secondary_speed_up, autocvar_g_balance_lightning_secondary_lifetime, TRUE)) + //if(bot_aim(autocvar_g_balance_arc_secondary_speed, autocvar_g_balance_grenadelauncher_secondary_speed_up, autocvar_g_balance_arc_secondary_lifetime, TRUE)) //{ // self.BUTTON_ATCK2 = TRUE; // if(random() < 0.03) self.bot_aim_whichfiretype = 0; @@ -193,14 +192,14 @@ float w_lightning(float req) { if(self.BUTTON_ATCK_prev) // TODO: Find another way to implement this! /*if(self.animstate_startframe == self.anim_shoot_x && self.animstate_numframes == self.anim_shoot_y) - weapon_thinkf(WFRAME_DONTCHANGE, autocvar_g_balance_lightning_primary_animtime, w_ready); + weapon_thinkf(WFRAME_DONTCHANGE, autocvar_g_balance_arc_primary_animtime, w_ready); else*/ weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(arc, animtime), w_ready); if (weapon_prepareattack(0, 0)) { - if ((!self.lightning_beam) || wasfreed(self.lightning_beam)) - W_Lightning_Attack1(); + if ((!self.arc_beam) || wasfreed(self.arc_beam)) + W_Arc_Attack1(); if(!self.BUTTON_ATCK_prev) { @@ -220,28 +219,28 @@ float w_lightning(float req) } //if (self.BUTTON_ATCK2) - //if (weapon_prepareattack(1, autocvar_g_balance_lightning_secondary_refire)) + //if (weapon_prepareattack(1, autocvar_g_balance_arc_secondary_refire)) //{ - // W_Lightning_Attack2(); - // self.lightning_count = autocvar_g_balance_lightning_secondary_count; - // weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_lightning_secondary_animtime, w_lightning_checkattack); - // self.lightning_secondarytime = time + autocvar_g_balance_lightning_secondary_refire2 * W_WeaponRateFactor(); + // W_Arc_Attack2(); + // self.arc_count = autocvar_g_balance_arc_secondary_count; + // weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_arc_secondary_animtime, w_arc_checkattack); + // self.arc_secondarytime = time + autocvar_g_balance_arc_secondary_refire2 * W_WeaponRateFactor(); //} } else if (req == WR_PRECACHE) { - precache_model ("models/weapons/g_lightning.md3"); - precache_model ("models/weapons/v_lightning.md3"); - precache_model ("models/weapons/h_lightning.iqm"); - //precache_sound ("weapons/lightning_bounce.wav"); - precache_sound ("weapons/lightning_fire.wav"); - precache_sound ("weapons/lightning_fire2.wav"); - precache_sound ("weapons/lightning_impact.wav"); - //precache_sound ("weapons/lightning_impact_combo.wav"); - //precache_sound ("weapons/W_Lightning_Beam_fire.wav"); + precache_model ("models/weapons/g_arc.md3"); + precache_model ("models/weapons/v_arc.md3"); + precache_model ("models/weapons/h_arc.iqm"); + //precache_sound ("weapons/arc_bounce.wav"); + precache_sound ("weapons/arc_fire.wav"); + precache_sound ("weapons/arc_fire2.wav"); + precache_sound ("weapons/arc_impact.wav"); + //precache_sound ("weapons/arc_impact_combo.wav"); + //precache_sound ("weapons/W_Arc_Beam_fire.wav"); } else if (req == WR_SETUP) - weapon_setup(WEP_LIGHTNING); + weapon_setup(WEP_ARC); else if (req == WR_CHECKAMMO1) { return !WEP_CVAR_PRI(arc, ammo) || (self.ammo_cells > 0); @@ -264,33 +263,33 @@ float w_lightning(float req) } else if (req == WR_RESETPLAYER) { - //self.lightning_secondarytime = time; + //self.arc_secondarytime = time; } return TRUE; }; -void LightningInit() +void ArcInit() { - weapon_action(WEP_LIGHTNING, WR_PRECACHE); - lightning_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LIGHTNING), FALSE, FALSE, 1); - lightning_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LIGHTNING), FALSE, FALSE, 2); - lightning_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LIGHTNING), FALSE, FALSE, 3); - lightning_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_LIGHTNING), FALSE, FALSE, 4); + weapon_action(WEP_ARC, WR_PRECACHE); + arc_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), FALSE, FALSE, 1); + arc_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), FALSE, FALSE, 2); + arc_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), FALSE, FALSE, 3); + arc_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), FALSE, FALSE, 4); #define WEP_ADD_CVAR(weapon,mode,name) /*nothing*/ - #define WEP_ADD_PROP(weapon,prop,name) get_weaponinfo(WEP_LIGHTNING).##prop = autocvar_g_balance_##weapon##_##name; + #define WEP_ADD_PROP(weapon,prop,name) get_weaponinfo(WEP_ARC).##prop = autocvar_g_balance_##weapon##_##name; ARC_SETTINGS(arc) #undef WEP_ADD_CVAR #undef WEP_ADD_PROP } -void spawnfunc_weapon_lightning (void) // should this really be here? +void spawnfunc_weapon_arc (void) // should this really be here? { - weapon_defaultspawnfunc(WEP_LIGHTNING); + weapon_defaultspawnfunc(WEP_ARC); } #endif #ifdef CSQC -float w_lightning(float req) +float w_arc(float req) { if(req == WR_IMPACTEFFECT) { @@ -299,21 +298,21 @@ float w_lightning(float req) if(w_deathtype & HITTYPE_SECONDARY) { - pointparticles(particleeffectnum("lightning_ballexplode"), org2, '0 0 0', 1); + pointparticles(particleeffectnum("arc_ballexplode"), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, "weapons/lightning_impact.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, "weapons/arc_impact.wav", VOL_BASE, ATTN_NORM); } else { - pointparticles(particleeffectnum("lightning_impact"), org2, '0 0 0', 1); + pointparticles(particleeffectnum("arc_impact"), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, "weapons/lightning_impact.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, "weapons/arc_impact.wav", VOL_BASE, ATTN_NORM); } } else if(req == WR_PRECACHE) { - precache_sound("weapons/lightning_impact.wav"); - precache_sound("weapons/lightning_impact_combo.wav"); + precache_sound("weapons/arc_impact.wav"); + precache_sound("weapons/arc_impact_combo.wav"); } return TRUE; } diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index dd7a4d37e..fb9524c4c 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -620,10 +620,10 @@ float ClientInit_SendEntity(entity to, float sf) WriteInt24_t(MSG_ENTITY, compressShotOrigin(electro_shotorigin[1])); WriteInt24_t(MSG_ENTITY, compressShotOrigin(electro_shotorigin[2])); WriteInt24_t(MSG_ENTITY, compressShotOrigin(electro_shotorigin[3])); - WriteInt24_t(MSG_ENTITY, compressShotOrigin(lightning_shotorigin[0])); - WriteInt24_t(MSG_ENTITY, compressShotOrigin(lightning_shotorigin[1])); - WriteInt24_t(MSG_ENTITY, compressShotOrigin(lightning_shotorigin[2])); - WriteInt24_t(MSG_ENTITY, compressShotOrigin(lightning_shotorigin[3])); + WriteInt24_t(MSG_ENTITY, compressShotOrigin(arc_shotorigin[0])); + WriteInt24_t(MSG_ENTITY, compressShotOrigin(arc_shotorigin[1])); + WriteInt24_t(MSG_ENTITY, compressShotOrigin(arc_shotorigin[2])); + WriteInt24_t(MSG_ENTITY, compressShotOrigin(arc_shotorigin[3])); if(sv_foginterval && world.fog != "") WriteString(MSG_ENTITY, world.fog); diff --git a/qcsrc/server/csqceffects.qc b/qcsrc/server/csqceffects.qc index 4b626546d..ea13aedd5 100644 --- a/qcsrc/server/csqceffects.qc +++ b/qcsrc/server/csqceffects.qc @@ -1,7 +1,7 @@ void te_csqc_lightningarc(vector from,vector to) { WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte(MSG_BROADCAST, TE_CSQC_LIGHTNINGARC); + WriteByte(MSG_BROADCAST, TE_CSQC_ARC); WriteCoord(MSG_BROADCAST, from_x); WriteCoord(MSG_BROADCAST, from_y); diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index ffc8cdb8b..796d68799 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -654,7 +654,7 @@ void spawnfunc_worldspawn (void) InitGameplayMode(); readlevelcvars(); GrappleHookInit(); - LightningInit(); + ArcInit(); ElectroInit(); player_count = 0;