// Secondary uses it's own refire timer if refire_type is 1.
actor.jump_interval = time + WEP_CVAR_SEC(okhmg, refire) * W_WeaponRateFactor(actor);
makevectors(actor.v_angle);
- W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+ W_Blaster_Attack(actor, thiswep, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
if ((actor.(weaponentity).wframe == WFRAME_IDLE) ||
(actor.(weaponentity).wframe == WFRAME_FIRE2))
{
return;
}
makevectors(actor.v_angle);
- W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+ W_Blaster_Attack(actor, thiswep, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(okhmg, animtime), w_ready);
}
}
// Secondary uses it's own refire timer if refire_type is 1.
actor.jump_interval = time + WEP_CVAR_SEC(okmachinegun, refire) * W_WeaponRateFactor(actor);
makevectors(actor.v_angle);
- W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+ W_Blaster_Attack(actor, thiswep, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
if ((actor.(weaponentity).wframe == WFRAME_IDLE) ||
(actor.(weaponentity).wframe == WFRAME_FIRE2))
{
return;
}
makevectors(actor.v_angle);
- W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+ W_Blaster_Attack(actor, thiswep, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(okmachinegun, animtime), w_ready);
}
}
// Secondary uses it's own refire timer if refire_type is 1.
actor.jump_interval = time + WEP_CVAR_SEC(oknex, refire) * W_WeaponRateFactor(actor);
makevectors(actor.v_angle);
- W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+ W_Blaster_Attack(actor, thiswep, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
if ((actor.(weaponentity).wframe == WFRAME_IDLE) ||
(actor.(weaponentity).wframe == WFRAME_FIRE2))
{
return;
}
makevectors(actor.v_angle);
- W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+ W_Blaster_Attack(actor, thiswep, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(oknex, animtime), w_ready);
return;
}
// Secondary uses it's own refire timer if refire_type is 1.
actor.jump_interval = time + WEP_CVAR_SEC(okrpc, refire) * W_WeaponRateFactor(actor);
makevectors(actor.v_angle);
- W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+ W_Blaster_Attack(actor, thiswep, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
if ((actor.(weaponentity).wframe == WFRAME_IDLE) ||
(actor.(weaponentity).wframe == WFRAME_FIRE2))
{
return;
}
makevectors(actor.v_angle);
- W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+ W_Blaster_Attack(actor, thiswep, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(okrpc, animtime), w_ready);
}
}
// Secondary uses it's own refire timer if refire_type is 1.
actor.jump_interval = time + WEP_CVAR_SEC(okshotgun, refire) * W_WeaponRateFactor(actor);
makevectors(actor.v_angle);
- W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+ W_Blaster_Attack(actor, thiswep, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
if ((actor.(weaponentity).wframe == WFRAME_IDLE) ||
(actor.(weaponentity).wframe == WFRAME_FIRE2))
{
return;
}
makevectors(actor.v_angle);
- W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+ W_Blaster_Attack(actor, thiswep, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(okshotgun, animtime), w_ready);
}
}
#define WepSet_FromWeapon(it) ((it).m_wepset)
WepSet _WepSet_FromWeapon(int i);
+.entity real_weapon;
+
#define DEFAULT_FILENAME "weapons_dump.cfg"
// NOTE: dumpeffectinfo, dumpnotifs, dumpturrets and dumpweapons use similar code
GENERIC_COMMAND(dumpweapons, "Dump all turrets into " DEFAULT_FILENAME, false) // WEAPONTODO: make this work with other progs than just server
#define WEP_CVAR_SEC(wepname, name) WEP_CVAR(wepname, secondary_##name)
#define WEP_CVAR_BOTH(wepname, isprimary, name) ((isprimary) ? WEP_CVAR_PRI(wepname, name) : WEP_CVAR_SEC(wepname, name))
+#define WEP_CVAR_E(wep, name) (wep.wepvar_##name)
+#define WEP_CVAR_PRI_E(wep, name) WEP_CVAR_E(wep, primary_##name)
+#define WEP_CVAR_SEC_E(wep, name) WEP_CVAR_E(wep, secondary_##name)
+#define WEP_CVAR_BOTH_E(wep, isprimary, name) ((isprimary) ? WEP_CVAR_PRI_E(wep, name) : WEP_CVAR_SEC_E(wep, name))
+
const int WEP_FIRST = 1;
#define WEP_LAST (REGISTRY_COUNT(Weapons) - 1)
WepSet WEPSET_ALL;
(this.origin + (this.mins + this.maxs) * 0.5),
this.velocity,
this.realowner,
- WEP_CVAR_BOTH(blaster, isprimary, damage),
- WEP_CVAR_BOTH(blaster, isprimary, edgedamage),
- WEP_CVAR_BOTH(blaster, isprimary, radius),
+ WEP_CVAR_BOTH_E(this.real_weapon, isprimary, damage),
+ WEP_CVAR_BOTH_E(this.real_weapon, isprimary, edgedamage),
+ WEP_CVAR_BOTH_E(this.real_weapon, isprimary, radius),
NULL,
NULL,
false,
- WEP_CVAR_BOTH(blaster, isprimary, force),
- WEP_CVAR_BOTH(blaster, isprimary, force_zscale),
+ WEP_CVAR_BOTH_E(this.real_weapon, isprimary, force),
+ WEP_CVAR_BOTH_E(this.real_weapon, isprimary, force_zscale),
this.projectiledeathtype,
this.weaponentity_fld,
toucher
void W_Blaster_Attack(
entity actor,
+ entity real_wpn,
.entity weaponentity,
float atk_deathtype)
{
W_MuzzleFlash(WEP_BLASTER, actor, weaponentity, w_shotorg, w_shotdir);
entity missile = new(blasterbolt);
+ missile.real_weapon = real_wpn;
missile.owner = missile.realowner = actor;
missile.bot_dodge = true;
missile.bot_dodgerating = atk_damage;
{
if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(blaster, refire)))
{
- W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id);
+ W_Blaster_Attack(actor, thiswep, weaponentity, WEP_BLASTER.m_id);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(blaster, animtime), w_ready);
}
}
{
if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(blaster, refire)))
{
- W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+ W_Blaster_Attack(actor, thiswep, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(blaster, animtime), w_ready);
}
actor.jump_interval = time + WEP_CVAR_SEC(blaster, refire) * W_WeaponRateFactor(actor);
.entity weaponentity = weaponentities[1];
makevectors(actor.v_angle);
- W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+ W_Blaster_Attack(actor, this, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
}
#endif
W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(vaporizer, ammo), weaponentity);
makevectors(actor.v_angle);
- W_Blaster_Attack(actor, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
+ W_Blaster_Attack(actor, thiswep, weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY);
// now do normal refire
weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(vaporizer, animtime), w_ready);