X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Foverkill%2Fokshotgun.qc;h=784d1c37b770f47a4110b76cc03e990dacee4063;hb=25f7a4a5f137ffb344c47107636fcfc7cdfa2045;hp=a0c80f25ec7457787b926a700a79af76ce9d6f09;hpb=83093a5626b3ec25a2dc4f87b24eda2a95a8335f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mutators/mutator/overkill/okshotgun.qc b/qcsrc/common/mutators/mutator/overkill/okshotgun.qc index a0c80f25e..784d1c37b 100644 --- a/qcsrc/common/mutators/mutator/overkill/okshotgun.qc +++ b/qcsrc/common/mutators/mutator/overkill/okshotgun.qc @@ -19,22 +19,7 @@ METHOD(OverkillShotgun, wr_think, void(entity thiswep, entity actor, .entity wea { // Secondary uses it's own refire timer if refire_type is 1. actor.jump_interval = time + WEP_CVAR_SEC(okshotgun, refire) * W_WeaponRateFactor(actor); - // Ugly hack to reuse the fire mode of the blaster. - makevectors(actor.v_angle); - W_Blaster_Attack( - actor, - weaponentity, - WEP_BLASTER.m_id | HITTYPE_SECONDARY, - WEP_CVAR_SEC(okshotgun, shotangle), - WEP_CVAR_SEC(okshotgun, damage), - WEP_CVAR_SEC(okshotgun, edgedamage), - WEP_CVAR_SEC(okshotgun, radius), - WEP_CVAR_SEC(okshotgun, force), - WEP_CVAR_SEC(okshotgun, speed), - WEP_CVAR_SEC(okshotgun, spread), - WEP_CVAR_SEC(okshotgun, delay), - WEP_CVAR_SEC(okshotgun, lifetime) - ); + BLASTER_SECONDARY_ATTACK(okshotgun, actor, weaponentity); if ((actor.(weaponentity).wframe == WFRAME_IDLE) || (actor.(weaponentity).wframe == WFRAME_FIRE2)) { @@ -60,7 +45,7 @@ METHOD(OverkillShotgun, wr_think, void(entity thiswep, entity actor, .entity wea } if (fire & 1) // Primary attack { - if (!weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(okshotgun, animtime))) + if (!weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(okshotgun, refire))) { return; } @@ -70,7 +55,8 @@ METHOD(OverkillShotgun, wr_think, void(entity thiswep, entity actor, .entity wea WEP_CVAR_PRI(okshotgun, bullets), WEP_CVAR_PRI(okshotgun, spread), WEP_CVAR_PRI(okshotgun, solidpenetration), - WEP_CVAR_PRI(okshotgun, force)); + WEP_CVAR_PRI(okshotgun, force), + EFFECT_RIFLE_WEAK); weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(okshotgun, animtime), w_ready); return; } @@ -80,29 +66,14 @@ METHOD(OverkillShotgun, wr_think, void(entity thiswep, entity actor, .entity wea { return; } - // Ugly hack to reuse the fire mode of the blaster. - makevectors(actor.v_angle); - W_Blaster_Attack( - actor, - weaponentity, - WEP_BLASTER.m_id | HITTYPE_SECONDARY, - WEP_CVAR_SEC(okshotgun, shotangle), - WEP_CVAR_SEC(okshotgun, damage), - WEP_CVAR_SEC(okshotgun, edgedamage), - WEP_CVAR_SEC(okshotgun, radius), - WEP_CVAR_SEC(okshotgun, force), - WEP_CVAR_SEC(okshotgun, speed), - WEP_CVAR_SEC(okshotgun, spread), - WEP_CVAR_SEC(okshotgun, delay), - WEP_CVAR_SEC(okshotgun, lifetime) - ); + BLASTER_SECONDARY_ATTACK(okshotgun, actor, weaponentity); weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(okshotgun, animtime), w_ready); } } METHOD(OverkillShotgun, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity)) { - float ammo_amount = GetResourceAmount(actor, thiswep.ammo_type) >= WEP_CVAR_PRI(okshotgun, ammo); + float ammo_amount = GetResource(actor, thiswep.ammo_type) >= WEP_CVAR_PRI(okshotgun, ammo); ammo_amount += actor.(weaponentity).(weapon_load[WEP_OVERKILL_SHOTGUN.m_id]) >= WEP_CVAR_PRI(okshotgun, ammo); return ammo_amount; }