newmine.owner = this.owner;
newmine.realowner = this.realowner;
- setsize(newmine, '-4 -4 -4', '4 4 4');
setorigin(newmine, this.origin);
setmodel(newmine, MDL_MINELAYER_MINE);
+ setsize(newmine, '-4 -4 -4', '4 4 4');
newmine.angles = vectoangles(-trace_plane_normal); // face against the surface
- newmine.mine_orientation = -trace_plane_normal;
+ newmine.movedir = -trace_plane_normal;
newmine.takedamage = this.takedamage;
newmine.damageforcescale = this.damageforcescale;
this.takedamage = DAMAGE_NO;
if(this.move_movetype == MOVETYPE_NONE || this.move_movetype == MOVETYPE_FOLLOW)
- this.velocity = this.mine_orientation; // particle fx and decals need .velocity
+ this.velocity = this.movedir; // .velocity must be != '0 0 0' for particle fx and decal to work
RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, remote_damage), WEP_CVAR(minelayer, remote_edgedamage), WEP_CVAR(minelayer, remote_radius),
NULL, NULL, WEP_CVAR(minelayer, remote_force), this.projectiledeathtype | HITTYPE_BOUNCE, this.weaponentity_fld, NULL);
void W_MineLayer_ProximityExplode(entity this)
{
- // make sure no friend is in the mine's radius. If there is any, explosion is delayed until he's at a safe distance
+ // make sure no friend is in the mine's radius. If there is any, explosion is delayed until they're at a safe distance
if(WEP_CVAR(minelayer, protection) && this.mine_explodeanyway == 0)
{
entity head;
this.mine_explodeanyway = 1; // make the mine super aggressive -- Samual: Rather, make it not care if a team mate is near.
}
- // a player's mines shall explode if he disconnects or dies
+ // a player's mines shall explode if they disconnect or die
// TODO: Do this on team change too -- Samual: But isn't a player killed when they switch teams?
if(!IS_PLAYER(this.realowner) || IS_DEAD(this.realowner) || STAT(FROZEN, this.realowner))
{
head = findradius(this.origin, WEP_CVAR(minelayer, proximityradius));
while(head)
{
- if(IS_PLAYER(head) && !IS_DEAD(head) && !STAT(FROZEN, head))
+ if(IS_PLAYER(head) && !IS_DEAD(head) && !STAT(FROZEN, head) && !IS_INDEPENDENT_PLAYER(head))
if(head != this.realowner && DIFF_TEAM(head, this.realowner)) // don't trigger for team mates
if(!this.mine_time)
{
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), thiswep.m_id);
- W_MuzzleFlash(actor, weaponentity, EFFECT_ROCKET_MUZZLEFLASH, MDL_MINELAYER_MUZZLEFLASH, w_shotorg, w_shotdir);
+ W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
entity mine = WarpZone_RefSys_SpawnSameRefSys(actor);
mine.weaponentity_fld = 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) = bot_aim(actor, weaponentity, WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), false, false);
if(skill >= 2) // skill 0 and 1 bots won't detonate mines!
{
// decide whether to detonate mines
float desirabledamage;
desirabledamage = enemydamage;
- if(time > STAT(INVINCIBLE_FINISHED, actor) && time > actor.spawnshieldtime)
+ if(StatusEffects_active(STATUSEFFECT_Shield, actor) && !StatusEffects_active(STATUSEFFECT_SpawnShield, actor))
desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
if(teamplay && actor.team)
desirabledamage = desirabledamage - teamdamage;