X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Foverkill%2Fokshotgun.qc;h=da4c4749d04763e4fab32d8624e00ab11e1430d3;hb=b137896768ee22017cd43bf7614b8c01f99acd9c;hp=3a7143f780863711f4bb077df0d2b36ce741d1b0;hpb=723fe3aa08556fdde679753c0afde734853f34e5;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 3a7143f78..da4c4749d 100644 --- a/qcsrc/common/mutators/mutator/overkill/okshotgun.qc +++ b/qcsrc/common/mutators/mutator/overkill/okshotgun.qc @@ -19,37 +19,16 @@ 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); - Weapon oldwep = actor.(weaponentity).m_weapon; // we can't avoid this hack - actor.(weaponentity).m_weapon = WEP_BLASTER; - 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) - ); - actor.(weaponentity).m_weapon = oldwep; + BLASTER_SECONDARY_ATTACK(okshotgun, actor, weaponentity); if ((actor.(weaponentity).wframe == WFRAME_IDLE) || (actor.(weaponentity).wframe == WFRAME_FIRE2)) { // Set secondary fire animation. - vector a = '0 0 0'; actor.(weaponentity).wframe = WFRAME_FIRE2; - a = actor.(weaponentity).anim_fire2; - a.z *= g_weaponratefactor; FOREACH_CLIENT(true, LAMBDA( if (it == actor || (IS_SPEC(it) && it.enemy == actor)) { - wframe_send(it, actor.(weaponentity), a, true); + wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, g_weaponratefactor, true); } )); animdecide_setaction(actor, ANIMACTION_SHOOT, true); @@ -63,7 +42,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; } @@ -73,7 +52,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; } @@ -83,32 +63,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); - Weapon oldwep = actor.(weaponentity).m_weapon; // we can't avoid this hack - actor.(weaponentity).m_weapon = WEP_BLASTER; - 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) - ); - actor.(weaponentity).m_weapon = oldwep; + 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; } @@ -130,10 +92,7 @@ METHOD(OverkillShotgun, wr_suicidemessage, Notification(entity thiswep)) METHOD(OverkillShotgun, wr_killmessage, Notification(entity thiswep)) { - if(w_deathtype & HITTYPE_SECONDARY) - return WEAPON_BLASTER_MURDER; - else - return WEAPON_SHOTGUN_MURDER; + return WEAPON_OVERKILL_SHOTGUN_MURDER; } #endif