X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Fcrylink.qc;h=6a69a7c570936f87b24e92f5666fceeb11275c74;hb=33885ba02998d463c0c4f7e5ea26a7489980cc35;hp=db14a603068f47d3b9c267cad6369b2573359dd7;hpb=d4831635f720b2ee2a210c544cd7709d32cc6b92;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index db14a6030..6a69a7c57 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -307,7 +307,7 @@ void W_Crylink_Attack(Weapon thiswep, entity actor, .entity weaponentity) up = v_up; shots = WEP_CVAR_PRI(crylink, shots); - Send_Effect(EFFECT_CRYLINK_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, shots); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); proj = prevproj = firstproj = NULL; for(counter = 0; counter < shots; ++counter) { @@ -357,7 +357,7 @@ void W_Crylink_Attack(Weapon thiswep, entity actor, .entity weaponentity) s.y = v_forward.x; s.z = v_forward.y; } - s = s * WEP_CVAR_PRI(crylink, spread) * g_weaponspreadfactor; + s = s * WEP_CVAR_PRI(crylink, spread) * autocvar_g_weaponspreadfactor; W_SetupProjVelocity_Explicit(proj, w_shotdir + right * s.y + up * s.z, v_up, WEP_CVAR_PRI(crylink, speed), 0, 0, 0, false); settouch(proj, W_Crylink_Touch); @@ -391,7 +391,7 @@ void W_Crylink_Attack(Weapon thiswep, entity actor, .entity weaponentity) MUTATOR_CALLHOOK(EditProjectile, actor, proj); } - if(WEP_CVAR_PRI(crylink, joinspread) != 0) + if(WEP_CVAR_PRI(crylink, joinspread) != 0 && WEP_CVAR_PRI(crylink, shots) > 1) { actor.(weaponentity).crylink_lastgroup = proj; W_Crylink_CheckLinks(proj); @@ -420,7 +420,7 @@ void W_Crylink_Attack2(Weapon thiswep, entity actor, .entity weaponentity) up = v_up; shots = WEP_CVAR_SEC(crylink, shots); - Send_Effect(EFFECT_CRYLINK_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, shots); + W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir); proj = prevproj = firstproj = NULL; for(counter = 0; counter < shots; ++counter) { @@ -471,12 +471,12 @@ void W_Crylink_Attack2(Weapon thiswep, entity actor, .entity weaponentity) s.y = v_forward.x; s.z = v_forward.y; } - s = s * WEP_CVAR_SEC(crylink, spread) * g_weaponspreadfactor; + s = s * WEP_CVAR_SEC(crylink, spread) * autocvar_g_weaponspreadfactor; s = w_shotdir + right * s.y + up * s.z; } else { - s = (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * WEP_CVAR_SEC(crylink, spread) * g_weaponspreadfactor); + s = (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * WEP_CVAR_SEC(crylink, spread) * autocvar_g_weaponspreadfactor); } W_SetupProjVelocity_Explicit(proj, s, v_up, WEP_CVAR_SEC(crylink, speed), 0, 0, 0, false); @@ -505,13 +505,13 @@ void W_Crylink_Attack2(Weapon thiswep, entity actor, .entity weaponentity) proj.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, proj); IL_PUSH(g_bot_dodge, proj); - proj.missile_flags = MIF_SPLASH; + proj.missile_flags = MIF_SPLASH; CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true); MUTATOR_CALLHOOK(EditProjectile, actor, proj); } - if(WEP_CVAR_SEC(crylink, joinspread) != 0) + if(WEP_CVAR_SEC(crylink, joinspread) != 0 && WEP_CVAR_SEC(crylink, shots) > 1) { actor.(weaponentity).crylink_lastgroup = proj; W_Crylink_CheckLinks(proj); @@ -522,9 +522,9 @@ void W_Crylink_Attack2(Weapon thiswep, entity actor, .entity weaponentity) METHOD(Crylink, wr_aim, void(entity thiswep, entity actor, .entity weaponentity)) { if(random() < 0.10) - PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR_PRI(crylink, speed), 0, WEP_CVAR_PRI(crylink, middle_lifetime), false); + PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR_PRI(crylink, speed), 0, WEP_CVAR_PRI(crylink, middle_lifetime), false, true); else - PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), false); + PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), false, true); } METHOD(Crylink, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) { @@ -532,7 +532,7 @@ METHOD(Crylink, wr_think, void(entity thiswep, entity actor, .entity weaponentit thiswep.wr_reload(thiswep, actor, weaponentity); } - if(fire & 1) + else if(fire & 1) { if(actor.(weaponentity).crylink_waitrelease != 1) if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(crylink, refire))) @@ -542,7 +542,7 @@ METHOD(Crylink, wr_think, void(entity thiswep, entity actor, .entity weaponentit } } - if((fire & 2) && autocvar_g_balance_crylink_secondary) + else if((fire & 2) && autocvar_g_balance_crylink_secondary) { if(actor.(weaponentity).crylink_waitrelease != 2) if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(crylink, refire))) @@ -574,7 +574,7 @@ METHOD(Crylink, wr_think, void(entity thiswep, entity actor, .entity weaponentit } actor.(weaponentity).crylink_waitrelease = 0; if(!thiswep.wr_checkammo1(thiswep, actor, weaponentity) && !thiswep.wr_checkammo2(thiswep, actor, weaponentity)) - if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO)) + if(!(actor.items & IT_UNLIMITED_AMMO)) { // ran out of ammo! actor.cnt = thiswep.m_id; @@ -619,8 +619,7 @@ METHOD(Crylink, wr_killmessage, Notification(entity thiswep)) #ifdef CSQC METHOD(Crylink, wr_impacteffect, void(entity thiswep, entity actor)) { - vector org2; - org2 = w_org + w_backoff * 2; + vector org2 = w_org + w_backoff * 2; if(w_deathtype & HITTYPE_SECONDARY) { pointparticles(EFFECT_CRYLINK_IMPACT2, org2, '0 0 0', 1);