RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, damage), WEP_CVAR(minelayer, edgedamage), WEP_CVAR(minelayer, radius), NULL, NULL, WEP_CVAR(minelayer, force), this.projectiledeathtype, this.weaponentity_fld, directhitentity);
.entity weaponentity = this.weaponentity_fld;
RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, damage), WEP_CVAR(minelayer, edgedamage), WEP_CVAR(minelayer, radius), NULL, NULL, WEP_CVAR(minelayer, force), this.projectiledeathtype, this.weaponentity_fld, directhitentity);
.entity weaponentity = this.weaponentity_fld;
- Weapon w = WEP_MINE_LAYER;
- if(!w.wr_checkammo1(w, own, weaponentity))
+ if(!thiswep.wr_checkammo1(thiswep, own, weaponentity))
- own.cnt = WEP_MINE_LAYER.m_id;
- int slot = weaponslot(weaponentity);
- ATTACK_FINISHED(own, slot) = time;
+ own.cnt = thiswep.m_id;
+ ATTACK_FINISHED(own, weaponentity) = time;
NULL, NULL, WEP_CVAR(minelayer, remote_force), this.projectiledeathtype | HITTYPE_BOUNCE, this.weaponentity_fld, NULL);
.entity weaponentity = this.weaponentity_fld;
NULL, NULL, WEP_CVAR(minelayer, remote_force), this.projectiledeathtype | HITTYPE_BOUNCE, this.weaponentity_fld, NULL);
.entity weaponentity = this.weaponentity_fld;
- Weapon w = WEP_MINE_LAYER;
- if(!w.wr_checkammo1(w, own, weaponentity))
+ if(!thiswep.wr_checkammo1(thiswep, own, weaponentity))
- own.cnt = WEP_MINE_LAYER.m_id;
- int slot = weaponslot(weaponentity);
- ATTACK_FINISHED(own, slot) = time;
+ own.cnt = thiswep.m_id;
+ ATTACK_FINISHED(own, weaponentity) = time;
if(this.move_movetype == MOVETYPE_NONE || this.move_movetype == MOVETYPE_FOLLOW)
return; // we're already a stuck mine, why do we get called? TODO does this even happen?
if(this.move_movetype == MOVETYPE_NONE || this.move_movetype == MOVETYPE_FOLLOW)
return; // we're already a stuck mine, why do we get called? TODO does this even happen?
- if(WarpZone_Projectile_Touch(this, toucher))
- {
- if(wasfreed(this))
- {
- .entity weaponentity = this.weaponentity_fld;
- this.realowner.(weaponentity).minelayer_mines -= 1;
- }
- return;
- }
+ PROJECTILE_TOUCH(this, toucher);
// scan how many mines we placed, and return if we reached our limit
if(WEP_CVAR(minelayer, limit))
{
// scan how many mines we placed, and return if we reached our limit
if(WEP_CVAR(minelayer, limit))
{
- if(actor.(weaponentity).minelayer_mines >= WEP_CVAR(minelayer, limit))
+ int minecount = W_MineLayer_Count(actor, weaponentity);
+ if(minecount >= WEP_CVAR(minelayer, limit))
{
// the refire delay keeps this message from being spammed
Send_Notification(NOTIF_ONE, actor, MSG_MULTI, WEAPON_MINELAYER_LIMIT, WEP_CVAR(minelayer, limit));
{
// the refire delay keeps this message from being spammed
Send_Notification(NOTIF_ONE, actor, MSG_MULTI, WEAPON_MINELAYER_LIMIT, WEP_CVAR(minelayer, limit));
W_DecreaseAmmo(thiswep, actor, WEP_CVAR(minelayer, ammo), weaponentity);
W_DecreaseAmmo(thiswep, actor, WEP_CVAR(minelayer, ammo), weaponentity);
- W_SetupShot_ProjectileSize(actor, weaponentity, '-4 -4 -4', '4 4 4', false, 5, SND_MINE_FIRE, CH_WEAPON_A, WEP_CVAR(minelayer, damage), WEP_MINE_LAYER.m_id);
+ W_SetupShot_ProjectileSize(actor, weaponentity, '-4 -4 -4', '4 4 4', false, 5, SND_MINE_FIRE, CH_WEAPON_A, WEP_CVAR(minelayer, damage), thiswep.m_id);
Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
mine = WarpZone_RefSys_SpawnSameRefSys(actor);
Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
mine = WarpZone_RefSys_SpawnSameRefSys(actor);
set_movetype(mine, MOVETYPE_TOSS);
PROJECTILE_MAKETRIGGER(mine);
set_movetype(mine, MOVETYPE_TOSS);
PROJECTILE_MAKETRIGGER(mine);
mine.weaponentity_fld = weaponentity;
setsize(mine, '-4 -4 -4', '4 4 4'); // give it some size so it can be shot
mine.weaponentity_fld = weaponentity;
setsize(mine, '-4 -4 -4', '4 4 4'); // give it some size so it can be shot
METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
{
// aim and decide to fire if appropriate
METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
{
// aim and decide to fire if appropriate
- if(actor.(weaponentity).minelayer_mines >= WEP_CVAR(minelayer, limit))
+ int minecount = W_MineLayer_Count(actor, weaponentity);
+ if(minecount >= WEP_CVAR(minelayer, limit))
PHYS_INPUT_BUTTON_ATCK(actor) = false;
else
PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), false);
PHYS_INPUT_BUTTON_ATCK(actor) = false;
else
PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), false);
}
METHOD(MineLayer, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
}
METHOD(MineLayer, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
if(autocvar_g_balance_minelayer_reload_ammo && actor.(weaponentity).clip_load < WEP_CVAR(minelayer, ammo)) // forced reload
{
// not if we're holding the minelayer without enough ammo, but can detonate existing mines
if(autocvar_g_balance_minelayer_reload_ammo && actor.(weaponentity).clip_load < WEP_CVAR(minelayer, ammo)) // forced reload
{
// not if we're holding the minelayer without enough ammo, but can detonate existing mines
}
METHOD(MineLayer, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
{
}
METHOD(MineLayer, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
{