X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fvehicles%2Fvehicle.qh;h=723a98518ae651857a4409afc1d4cce3c300c8ec;hp=b085a248bdfd690e253f6f600488ddb78d7a6eb9;hb=692cb758fe8f25fa078bfd5885333ee031885600;hpb=eaf335444015f42b9bd29135ec3ad0cb23c2ea63 diff --git a/qcsrc/common/vehicles/vehicle.qh b/qcsrc/common/vehicles/vehicle.qh index b085a248b..723a98518 100644 --- a/qcsrc/common/vehicles/vehicle.qh +++ b/qcsrc/common/vehicles/vehicle.qh @@ -1,10 +1,78 @@ #ifndef VEHICLE_H #define VEHICLE_H -int v_null(int) { return 0; } - CLASS(Vehicle, Object) ATTRIB(Vehicle, vehicleid, int, 0) + /** hud icon */ + ATTRIB(Vehicle, m_icon, string, string_null) + /** short name */ + ATTRIB(Vehicle, netname, string, "") + /** human readable name */ + ATTRIB(Vehicle, vehicle_name, string, "Vehicle") + /** full name of model */ + ATTRIB(Vehicle, model, string, "") + /** currently a copy of the model */ + ATTRIB(Vehicle, mdl, string, "") + /** full name of tur_head model */ + ATTRIB(Vehicle, head_model, string, "") + /** cockpit model */ + ATTRIB(Vehicle, hud_model, string, "") + /** tur_head model tag */ + ATTRIB(Vehicle, tag_head, string, string_null) + /** hud model tag */ + ATTRIB(Vehicle, tag_hud, string, string_null) + /** cockpit model tag */ + ATTRIB(Vehicle, tag_view, string, string_null) + /** player physics mod */ + ATTRIB(Vehicle, PlayerPhysplug, int(), func_null) + /** */ + ATTRIB(Vehicle, spawnflags, int, 0) + /** vehicle hitbox size */ + ATTRIB(Vehicle, mins, vector, '-0 -0 -0') + /** vehicle hitbox size */ + ATTRIB(Vehicle, maxs, vector, '0 0 0') + /** vehicle 3rd person view offset */ + ATTRIB(Vehicle, view_ofs, vector, '0 0 0') + /** vehicle 3rd person view distance */ + ATTRIB(Vehicle, height, float, 0) + + /** (BOTH) setup vehicle data */ + METHOD(Vehicle, vr_setup, void(Vehicle this, entity instance)) { } + /** (SERVER) logic to run every frame */ + METHOD(Vehicle, vr_think, void(Vehicle this, entity instance)) { } + /** (SERVER) called when vehicle dies */ + METHOD(Vehicle, vr_death, void(Vehicle this, entity instance)) { } + /** (BOTH) precaches models/sounds used by this vehicle */ + 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 the vehicle re-spawns */ + METHOD(Vehicle, vr_spawn, void(Vehicle this, entity instance)) { } + /** (SERVER) called when a vehicle hits something */ + METHOD(Vehicle, vr_impact, void(Vehicle this, entity instance)) { } + /** (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)) { } 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 + +// fields: +.entity tur_head; + #endif