X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Foverkill%2Fokshotgun.qc;h=cd1d618a8c9816adf00e3eda54096c96f285880b;hb=8b5de5f74e75c5736e50e7802fdc90eb9941007f;hp=2f1651776fdab25a67b98a42b0f9e386b44805ea;hpb=1d96f1ba683493a34bd036c1890bb93383793457;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 2f1651776..cd1d618a8 100644 --- a/qcsrc/common/mutators/mutator/overkill/okshotgun.qc +++ b/qcsrc/common/mutators/mutator/overkill/okshotgun.qc @@ -5,11 +5,11 @@ METHOD(OverkillShotgun, wr_aim, void(entity thiswep, entity actor, .entity weapo { if (vdist(actor.origin - actor.enemy.origin, >, WEP_CVAR_PRI(okshotgun, bot_range))) { - PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, 1000000, 0, 0.001, false); + PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, 1000000, 0, 0.001, false, false); } else { - PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, 1000000, 0, 0.001, false); + PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, 1000000, 0, 0.001, false, false); } } @@ -19,19 +19,17 @@ 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); - BLASTER_SECONDARY_ATTACK(okshotgun, actor, weaponentity); + makevectors(actor.v_angle); + W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY); 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, autocvar_g_weaponratefactor, true); } )); animdecide_setaction(actor, ANIMACTION_SHOOT, true); @@ -45,7 +43,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; } @@ -55,7 +53,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; } @@ -65,14 +64,15 @@ METHOD(OverkillShotgun, wr_think, void(entity thiswep, entity actor, .entity wea { return; } - BLASTER_SECONDARY_ATTACK(okshotgun, actor, weaponentity); + makevectors(actor.v_angle); + W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY); 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; }