.entity weaponentity = weaponentities[slot];
this.(weaponentity).m_switchweapon = WEP_Null;
}
- this.vehicle_weapon2mode = vehic.vehicle_weapon2mode;
+ STAT(VEHICLESTAT_W2MODE, this) = STAT(VEHICLESTAT_W2MODE, vehic);
#if 1 // 0 to enable per-gun impact aux crosshairs
vehicles_regen(vehic, vehic.dmg_time, vehicle_shield, autocvar_g_vehicle_spiderbot_shield, autocvar_g_vehicle_spiderbot_shield_regen_pause, autocvar_g_vehicle_spiderbot_shield_regen, dt, true);
if(vehic.vehicle_flags & VHF_HEALTHREGEN)
- vehicles_regen(vehic, vehic.dmg_time, vehicle_health, autocvar_g_vehicle_spiderbot_health, autocvar_g_vehicle_spiderbot_health_regen_pause, autocvar_g_vehicle_spiderbot_health_regen, dt, false);
+ vehicles_regen_resource(vehic, vehic.dmg_time, vehicle_health, autocvar_g_vehicle_spiderbot_health, autocvar_g_vehicle_spiderbot_health_regen_pause, autocvar_g_vehicle_spiderbot_health_regen, dt, false, RESOURCE_HEALTH);
PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = false;
//this.vehicle_ammo2 = vehic.tur_head.frame;
this.oldorigin = this.origin; // negate fall damage
this.velocity = vehic.velocity;
- VEHICLE_UPDATE_PLAYER(this, vehic, health, spiderbot);
+ VEHICLE_UPDATE_PLAYER_RESOURCE(this, vehic, health, spiderbot, RESOURCE_HEALTH);
if(vehic.vehicle_flags & VHF_HASSHIELD)
VEHICLE_UPDATE_PLAYER(this, vehic, shield, spiderbot);
SUB_SetFade(g1, time, min(this.respawntime, 10));
SUB_SetFade(g2, time, min(this.respawntime, 10));
- RadiusDamage (this, this.enemy, 250, 15, 250, NULL, NULL, 250, DEATH_VH_SPID_DEATH.m_id, NULL);
+ RadiusDamage (this, this.enemy, 250, 15, 250, NULL, NULL, 250, DEATH_VH_SPID_DEATH.m_id, DMG_NOWEP, NULL);
this.alpha = this.tur_head.alpha = this.gun1.alpha = this.gun2.alpha = -1;
set_movetype(this, MOVETYPE_NONE);
switch(_imp)
{
case IMP_weapon_group_1.impulse:
- this.vehicle.vehicle_weapon2mode = SBRM_VOLLY;
+ STAT(VEHICLESTAT_W2MODE, this.vehicle) = SBRM_VOLLY;
CSQCVehicleSetup(this, 0);
return true;
case IMP_weapon_group_2.impulse:
- this.vehicle.vehicle_weapon2mode = SBRM_GUIDE;
+ STAT(VEHICLESTAT_W2MODE, this.vehicle) = SBRM_GUIDE;
CSQCVehicleSetup(this, 0);
return true;
case IMP_weapon_group_3.impulse:
- this.vehicle.vehicle_weapon2mode = SBRM_ARTILLERY;
+ STAT(VEHICLESTAT_W2MODE, this.vehicle) = SBRM_ARTILLERY;
CSQCVehicleSetup(this, 0);
return true;
case IMP_weapon_next_byid.impulse:
case IMP_weapon_next_bypriority.impulse:
case IMP_weapon_next_bygroup.impulse:
- this.vehicle.vehicle_weapon2mode += 1;
- if(this.vehicle.vehicle_weapon2mode > SBRM_LAST)
- this.vehicle.vehicle_weapon2mode = SBRM_FIRST;
+ STAT(VEHICLESTAT_W2MODE, this.vehicle) += 1;
+ if(STAT(VEHICLESTAT_W2MODE, this.vehicle) > SBRM_LAST)
+ STAT(VEHICLESTAT_W2MODE, this.vehicle) = SBRM_FIRST;
- //centerprint(this, strcat("Rocket mode is ", ftos(this.vehicle.vehicle_weapon2mode)));
+ //centerprint(this, strcat("Rocket mode is ", ftos(STAT(VEHICLESTAT_W2MODE, this.vehicle))));
CSQCVehicleSetup(this, 0);
return true;
case IMP_weapon_last.impulse:
case IMP_weapon_prev_byid.impulse:
case IMP_weapon_prev_bypriority.impulse:
case IMP_weapon_prev_bygroup.impulse:
- this.vehicle.vehicle_weapon2mode -= 1;
- if(this.vehicle.vehicle_weapon2mode < SBRM_FIRST)
- this.vehicle.vehicle_weapon2mode = SBRM_LAST;
+ STAT(VEHICLESTAT_W2MODE, this.vehicle) -= 1;
+ if(STAT(VEHICLESTAT_W2MODE, this.vehicle) < SBRM_FIRST)
+ STAT(VEHICLESTAT_W2MODE, this.vehicle) = SBRM_LAST;
- //centerprint(this, strcat("Rocket mode is ", ftos(this.vehicle.vehicle_weapon2mode)));
+ //centerprint(this, strcat("Rocket mode is ", ftos(STAT(VEHICLESTAT_W2MODE, this.vehicle))));
CSQCVehicleSetup(this, 0);
return true;
}
METHOD(Spiderbot, vr_enter, void(Spiderbot thisveh, entity instance))
{
- instance.vehicle_weapon2mode = SBRM_GUIDE;
+ STAT(VEHICLESTAT_W2MODE, instance) = SBRM_GUIDE;
set_movetype(instance, MOVETYPE_WALK);
CSQCVehicleSetup(instance.owner, 0);
- instance.owner.vehicle_health = (instance.vehicle_health / autocvar_g_vehicle_spiderbot_health) * 100;
+ instance.owner.vehicle_health = (GetResourceAmount(instance, RESOURCE_HEALTH) / autocvar_g_vehicle_spiderbot_health) * 100;
instance.owner.vehicle_shield = (instance.vehicle_shield / autocvar_g_vehicle_spiderbot_shield) * 100;
if(instance.owner.flagcarried)
}
METHOD(Spiderbot, vr_death, void(Spiderbot thisveh, entity instance))
{
- instance.health = 0;
+ SetResourceAmountExplicit(instance, RESOURCE_HEALTH, 0);
instance.event_damage = func_null;
instance.takedamage = DAMAGE_NO;
settouch(instance, func_null);
setorigin(instance, instance.pos1 + '0 0 128');
instance.angles = instance.pos2;
instance.damageforcescale = 0.03;
- instance.vehicle_health = autocvar_g_vehicle_spiderbot_health;
+ SetResourceAmountExplicit(instance, RESOURCE_HEALTH, autocvar_g_vehicle_spiderbot_health);
instance.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
instance.PlayerPhysplug = spiderbot_frame;
instance.vehicle_flags |= VHF_HEALTHREGEN;
instance.respawntime = autocvar_g_vehicle_spiderbot_respawntime;
- instance.vehicle_health = autocvar_g_vehicle_spiderbot_health;
+ SetResourceAmountExplicit(instance, RESOURCE_HEALTH, autocvar_g_vehicle_spiderbot_health);
instance.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
- instance.max_health = instance.vehicle_health;
+ instance.max_health = GetResourceAmount(instance, RESOURCE_HEALTH);
instance.pushable = true; // spiderbot can use jumppads
}