X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fvehicles%2Fvehicle%2Fspiderbot.qc;h=323b025e0ebb5769d434004073a1fb04598176c5;hp=57486a2f38bf22987abcdb403db3a68086c51214;hb=791f300d2660d6b75a51c6e7f302d6fa6b64861a;hpb=b945d959784e5b249c66aea4f3326d8ae048f1cd diff --git a/qcsrc/common/vehicles/vehicle/spiderbot.qc b/qcsrc/common/vehicles/vehicle/spiderbot.qc index 57486a2f3..323b025e0 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot.qc @@ -63,7 +63,7 @@ bool spiderbot_frame(entity this, float dt) .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 @@ -264,7 +264,7 @@ bool spiderbot_frame(entity this, float dt) .entity weaponentity = weaponentities[0]; // TODO: unhardcode fireBullet(this, weaponentity, v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_solidpenetration, - autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, 0); + autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, EFFECT_BULLET); sound (gun, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM); //trailparticles(this, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos); @@ -294,7 +294,7 @@ bool spiderbot_frame(entity this, float dt) 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; @@ -309,7 +309,7 @@ bool spiderbot_frame(entity this, float dt) 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); @@ -449,7 +449,7 @@ void spiderbot_blowup(entity this) 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); @@ -464,37 +464,37 @@ bool spiderbot_impulse(entity this, int _imp) 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; @@ -521,10 +521,10 @@ METHOD(Spiderbot, vr_impact, void(Spiderbot thisveh, entity instance)) } 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) @@ -540,7 +540,7 @@ METHOD(Spiderbot, vr_think, void(Spiderbot thisveh, entity instance)) } 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); @@ -582,7 +582,7 @@ METHOD(Spiderbot, vr_spawn, void(Spiderbot thisveh, entity instance)) 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; @@ -599,9 +599,9 @@ METHOD(Spiderbot, vr_setup, void(Spiderbot thisveh, entity instance)) 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 }