X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fvehicles%2Fbumblebee.qc;h=4330966dc7894f2b959b4c51ceedaa302e56e4f4;hp=0f984129fe589e406439e67aa846ccd36df14318;hb=1078d034778d90585a975782feffba609144a577;hpb=dbcdd58814a7281aef637c8c07a02242331c4c86 diff --git a/qcsrc/server/vehicles/bumblebee.qc b/qcsrc/server/vehicles/bumblebee.qc index 0f984129fe..4330966dc7 100644 --- a/qcsrc/server/vehicles/bumblebee.qc +++ b/qcsrc/server/vehicles/bumblebee.qc @@ -86,7 +86,7 @@ void bumb_fire_cannon(entity _gun, string _tagname, entity _owner) vehicles_projectile("bigplasma_muzzleflash", "weapons/flacexp3.wav", v, normalize(v_forward + randomvec() * autocvar_g_vehicle_bumblebee_cannon_spread) * autocvar_g_vehicle_bumblebee_cannon_speed, autocvar_g_vehicle_bumblebee_cannon_damage, autocvar_g_vehicle_bumblebee_cannon_radius, autocvar_g_vehicle_bumblebee_cannon_force, 0, - DEATH_BUMB_GUN, PROJECTILE_BUMBLE_GUN, 0, TRUE, TRUE, _owner); + DEATH_VH_BUMB_GUN, PROJECTILE_BUMBLE_GUN, 0, TRUE, TRUE, _owner); } float bumb_gunner_frame() @@ -214,9 +214,7 @@ float bumb_gunner_frame() void bumb_gunner_exit(float _exitflag) { - - - if(clienttype(self) == CLIENTTYPE_REAL) + if(IS_REAL_CLIENT(self)) { msg_entity = self; WriteByte(MSG_ONE, SVC_SETVIEWPORT); @@ -236,18 +234,17 @@ void bumb_gunner_exit(float _exitflag) self.movetype = MOVETYPE_WALK; self.effects &~= EF_NODRAW; self.alpha = 1; - self.PlayerPhysplug = SUB_Null; + self.PlayerPhysplug = func_null; self.view_ofs = PL_VIEW_OFS; self.event_damage = PlayerDamage; self.hud = HUD_NORMAL; self.switchweapon = self.vehicle.switchweapon; - if(self.flagcarried) - { - self.flagcarried.scale = 0.6; - setattachment(self.flagcarried, self, ""); - setorigin(self.flagcarried, FLAG_CARRY_POS); - } + vh_player = self; + vh_vehicle = self.vehicle; + MUTATOR_CALLHOOK(VehicleExit); + self = vh_player; + self.vehicle = vh_vehicle; self.vehicle.vehicle_hudmodel.viewmodelforclient = self.vehicle; @@ -308,7 +305,7 @@ float bumb_gunner_enter() other.solid = SOLID_NOT; other.movetype = MOVETYPE_NOCLIP; other.alpha = -1; - other.event_damage = SUB_Null; + other.event_damage = func_null; other.view_ofs = '0 0 0'; other.hud = _gun.hud; other.PlayerPhysplug = _gun.PlayerPhysplug; @@ -331,24 +328,18 @@ float bumb_gunner_enter() CSQCVehicleSetup(other, other.hud); - if(other.flagcarried) - { - if(!autocvar_g_vehicles_allow_flagcarry) - DropFlag(other.flagcarried, world, world); - else - { - other.flagcarried.scale = 1; - setattachment(other.flagcarried, self, ""); - setorigin(other.flagcarried, '0 0 1' * self.maxs_z); - } - } + vh_player = other; + vh_vehicle = _gun; + MUTATOR_CALLHOOK(VehicleEnter); + other = vh_player; + _gun = vh_vehicle; return TRUE; } float vehicles_valid_pilot() { - if(other.classname != "player") + if not(IS_PLAYER(other)) return FALSE; if(other.deadflag != DEAD_NO) @@ -357,7 +348,7 @@ float vehicles_valid_pilot() if(other.vehicle != world) return FALSE; - if(clienttype(other) != CLIENTTYPE_REAL) + if not(IS_REAL_CLIENT(other)) if(!autocvar_g_vehicles_allow_bots) return FALSE; @@ -568,7 +559,7 @@ float bumb_pilot_frame() if(autocvar_g_vehicle_bumblebee_healgun_hps) trace_ent.vehicle_health = min(trace_ent.vehicle_health + autocvar_g_vehicle_bumblebee_healgun_hps * frametime, trace_ent.tur_health); } - else if(trace_ent.flags & FL_CLIENT) + else if(IS_CLIENT(trace_ent)) { if(trace_ent.health <= autocvar_g_vehicle_bumblebee_healgun_hmax && autocvar_g_vehicle_bumblebee_healgun_hps) trace_ent.health = min(trace_ent.health + autocvar_g_vehicle_bumblebee_healgun_hps * frametime, autocvar_g_vehicle_bumblebee_healgun_hmax); @@ -694,43 +685,14 @@ void bumb_exit(float eject) spot = vehicles_findgoodexit(spot); + // Hide beam + if(self.gun3.enemy || !wasfreed(self.gun3.enemy)) { + self.gun3.enemy.effects |= EF_NODRAW; + } self.owner.velocity = 0.75 * self.vehicle.velocity + normalize(spot - self.vehicle.origin) * 200; self.owner.velocity_z += 10; setorigin(self.owner, spot); - - /*if(eject) - { - spot = self.origin + v_forward * 100 + '0 0 64'; - spot = vehicles_findgoodexit(spot); - //setorigin(self.owner , spot); - self.owner.velocity = (v_up + v_forward * 0.25) * 250; - self.owner.oldvelocity = self.owner.velocity; - } - else - { - if(vlen(self.velocity) > autocvar_g_vehicle_bumblebee_speed_forward * 0.5) - { - if(vlen(self.velocity) > autocvar_sv_maxairspeed) - self.owner.velocity = normalize(self.velocity) * autocvar_sv_maxairspeed; - else - self.owner.velocity = self.velocity + v_forward * 100; - - self.owner.velocity_z += 200; - spot = self.origin + v_forward * 128 + '0 0 32'; - spot = vehicles_findgoodexit(spot); - } - else - { - self.owner.velocity = self.velocity * 0.5; - self.owner.velocity_z += 10; - spot = self.origin - v_forward * 300 + '0 0 32'; - spot = vehicles_findgoodexit(spot); - } - self.owner.oldvelocity = self.owner.velocity; - //setorigin(self.owner , spot); - } - */ antilag_clear(self.owner); self.owner = world; @@ -742,7 +704,7 @@ void bumb_blowup() autocvar_g_vehicle_bumblebee_blowup_edgedamage, autocvar_g_vehicle_bumblebee_blowup_radius, self, autocvar_g_vehicle_bumblebee_blowup_forceintensity, - DEATH_WAKIBLOWUP, world); + DEATH_VH_BUMB_DEATH, world); sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM); pointparticles(particleeffectnum("explosion_large"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1); @@ -801,7 +763,7 @@ void bumb_die() if(random() > 0.5) _body.touch = bumb_blowup; else - _body.touch = SUB_Null; + _body.touch = func_null; _body.think = bumb_diethink; _body.nextthink = time; @@ -812,7 +774,7 @@ void bumb_die() pointparticles(particleeffectnum("explosion_medium"), findbetterlocation(self.origin, 16), '0 0 0', 1); self.health = 0; - self.event_damage = SUB_Null; + self.event_damage = func_null; self.solid = SOLID_CORPSE; self.takedamage = DAMAGE_NO; self.deadflag = DEAD_DYING; @@ -821,7 +783,7 @@ void bumb_die() self.colormod = '0 0 0'; self.avelocity = '0 0 0'; self.velocity = '0 0 0'; - self.touch = SUB_Null; + self.touch = func_null; self.nextthink = 0; setorigin(self, self.pos1);