X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fvehicles%2Fvehicle.qh;h=1578e0a7d549832e8aa33f548dabd213c49b50d9;hb=a8e9c14803c6ee158f8183701f8e9c8601da9983;hp=723a98518ae651857a4409afc1d4cce3c300c8ec;hpb=724a41faf2cbfd86d41f3ab59ff8326a831a8326;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/vehicles/vehicle.qh b/qcsrc/common/vehicles/vehicle.qh index 723a98518..1578e0a7d 100644 --- a/qcsrc/common/vehicles/vehicle.qh +++ b/qcsrc/common/vehicles/vehicle.qh @@ -1,5 +1,4 @@ -#ifndef VEHICLE_H -#define VEHICLE_H +#pragma once CLASS(Vehicle, Object) ATTRIB(Vehicle, vehicleid, int, 0) @@ -24,7 +23,7 @@ CLASS(Vehicle, Object) /** cockpit model tag */ ATTRIB(Vehicle, tag_view, string, string_null) /** player physics mod */ - ATTRIB(Vehicle, PlayerPhysplug, int(), func_null) + ATTRIB(Vehicle, PlayerPhysplug, bool(entity,float), func_null) /** */ ATTRIB(Vehicle, spawnflags, int, 0) /** vehicle hitbox size */ @@ -46,6 +45,8 @@ CLASS(Vehicle, Object) METHOD(Vehicle, vr_precache, void(Vehicle this)) { } /** (SERVER) called when a player enters this vehicle */ METHOD(Vehicle, vr_enter, void(Vehicle this, entity instance)) { } + /** (SERVER) called when a player enters this vehicle while occupied */ + METHOD(Vehicle, vr_gunner_enter, void(Vehicle this, entity instance, entity actor)) { } /** (SERVER) called when the vehicle re-spawns */ METHOD(Vehicle, vr_spawn, void(Vehicle this, entity instance)) { } /** (SERVER) called when a vehicle hits something */ @@ -53,26 +54,24 @@ CLASS(Vehicle, Object) /** (CLIENT) logic to run every frame */ METHOD(Vehicle, vr_hud, void(Vehicle this)) { } /** (CLIENT) logic to run every frame */ - METHOD(Vehicle, vr_crosshair, void(Vehicle this)) { } + METHOD(Vehicle, vr_crosshair, void(Vehicle thisveh, entity player)) { } ENDCLASS(Vehicle) // vehicle spawn flags (need them here for common registrations) -const int VHF_ISVEHICLE = 2; /// Indicates vehicle -const int VHF_HASSHIELD = 4; /// Vehicle has shileding -const int VHF_SHIELDREGEN = 8; /// Vehicles shield regenerates -const int VHF_HEALTHREGEN = 16; /// Vehicles health regenerates -const int VHF_ENERGYREGEN = 32; /// Vehicles energy regenerates -const int VHF_DEATHEJECT = 64; /// Vehicle ejects pilot upon fatal damage -const int VHF_MOVE_GROUND = 128; /// Vehicle moves on gound -const int VHF_MOVE_HOVER = 256; /// Vehicle hover close to gound -const int VHF_MOVE_FLY = 512; /// Vehicle is airborn -const int VHF_DMGSHAKE = 1024; /// Add random velocity each frame if health < 50% -const int VHF_DMGROLL = 2048; /// Add random angles each frame if health < 50% -const int VHF_DMGHEADROLL = 4096; /// Add random head angles each frame if health < 50% -const int VHF_MULTISLOT = 8192; /// Vehicle has multiple player slots -const int VHF_PLAYERSLOT = 16384; /// This ent is a player slot on a multi-person vehicle +const int VHF_ISVEHICLE = BIT(1); /// Indicates vehicle +const int VHF_HASSHIELD = BIT(2); /// Vehicle has shileding +const int VHF_SHIELDREGEN = BIT(3); /// Vehicles shield regenerates +const int VHF_HEALTHREGEN = BIT(4); /// Vehicles health regenerates +const int VHF_ENERGYREGEN = BIT(5); /// Vehicles energy regenerates +const int VHF_DEATHEJECT = BIT(6); /// Vehicle ejects pilot upon fatal damage +const int VHF_MOVE_GROUND = BIT(7); /// Vehicle moves on gound +const int VHF_MOVE_HOVER = BIT(8); /// Vehicle hover close to gound +const int VHF_MOVE_FLY = BIT(9); /// Vehicle is airborn +const int VHF_DMGSHAKE = BIT(10); /// Add random velocity each frame if health < 50% +const int VHF_DMGROLL = BIT(11); /// Add random angles each frame if health < 50% +const int VHF_DMGHEADROLL = BIT(12); /// Add random head angles each frame if health < 50% +const int VHF_MULTISLOT = BIT(13); /// Vehicle has multiple player slots +const int VHF_PLAYERSLOT = BIT(14); /// This ent is a player slot on a multi-person vehicle // fields: .entity tur_head; - -#endif