From 700a347ad38976ede608ff9fe42175eb5b37c8e4 Mon Sep 17 00:00:00 2001 From: otta8634 Date: Thu, 19 Dec 2024 22:14:11 +0800 Subject: [PATCH] Add vehicles to the guide Descriptions were mostly entirely copied from https://gitlab.com/xonotic/xonotic/-/wikis/Vehicles. --- qcsrc/common/vehicles/vehicle.qh | 4 ++++ qcsrc/common/vehicles/vehicle/bumblebee.qh | 8 ++++++++ qcsrc/common/vehicles/vehicle/racer.qh | 6 ++++++ qcsrc/common/vehicles/vehicle/raptor.qh | 8 ++++++++ qcsrc/common/vehicles/vehicle/spiderbot.qh | 9 +++++++++ 5 files changed, 35 insertions(+) diff --git a/qcsrc/common/vehicles/vehicle.qh b/qcsrc/common/vehicles/vehicle.qh index 51c849dcf..031dd02a9 100644 --- a/qcsrc/common/vehicles/vehicle.qh +++ b/qcsrc/common/vehicles/vehicle.qh @@ -35,6 +35,10 @@ CLASS(Vehicle, Object) /** vehicle 3rd person view distance */ ATTRIB(Vehicle, height, float, 0); + METHOD(Vehicle, describe, string(Vehicle this)) { + TC(Vehicle, this); + return SUPER(Object).describe(this); + } METHOD(Vehicle, display, void(entity this, void(string name, string icon) returns)) { returns(this.vehicle_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null); } diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qh b/qcsrc/common/vehicles/vehicle/bumblebee.qh index d71dcd6c3..80f675665 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qh +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qh @@ -20,6 +20,14 @@ CLASS(Bumblebee, Vehicle) /* netname */ ATTRIB(Bumblebee, netname, string, "bumblebee"); /* fullname */ ATTRIB(Bumblebee, vehicle_name, string, _("Bumblebee")); /* icon */ ATTRIB(Bumblebee, m_icon, string, "vehicle_bumble"); +METHOD(Bumblebee, describe, string(Bumblebee this)) { + TC(Bumblebee, this); + return _("The Bumblebee vehicle seats up to three passengers, who are given different roles based on the order they enter\n\n" + "The first player to enter will be the pilot, flying the vehicle up into the skies. " + "The first player can also shoot a green healing wave to heal other teammates on the ground\n\n" + "The second player to enter is the right gunner and the third player to enter is the left gunner\n\n" + "When the pilot exits the vehicle, the players switch roles by moving up in position"); +} ENDCLASS(Bumblebee) REGISTER_VEHICLE(BUMBLEBEE, NEW(Bumblebee)); diff --git a/qcsrc/common/vehicles/vehicle/racer.qh b/qcsrc/common/vehicles/vehicle/racer.qh index e87d1714b..95cd2cd67 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qh +++ b/qcsrc/common/vehicles/vehicle/racer.qh @@ -20,5 +20,11 @@ CLASS(Racer, Vehicle) /* netname */ ATTRIB(Racer, netname, string, "racer"); /* fullname */ ATTRIB(Racer, vehicle_name, string, _("Racer")); /* icon */ ATTRIB(Racer, m_icon, string, "vehicle_racer"); +METHOD(Racer, describe, string(Racer this)) { + TC(Racer, this); + return _("The Racer vehicle looks like a jet, but does not fly uwpards very well. It seats only one passenger, who becomes the pilot\n\n" + "It can be accelerated by pressing the \"+jump\" bind, which consumes power from the same source as the primary weapon\n\n" + "The Racer's primary weapon is a laser and the secondary weapon is energy balls that explode on impact"); +} ENDCLASS(Racer) REGISTER_VEHICLE(RACER, NEW(Racer)); diff --git a/qcsrc/common/vehicles/vehicle/raptor.qh b/qcsrc/common/vehicles/vehicle/raptor.qh index 2532a9cbe..425f2ee9f 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qh +++ b/qcsrc/common/vehicles/vehicle/raptor.qh @@ -20,6 +20,14 @@ CLASS(Raptor, Vehicle) /* netname */ ATTRIB(Raptor, netname, string, "raptor"); /* fullname */ ATTRIB(Raptor, vehicle_name, string, _("Raptor")); /* icon */ ATTRIB(Raptor, m_icon, string, "vehicle_raptor"); +METHOD(Raptor, describe, string(Raptor this)) { + TC(Raptor, this); + return _("The Raptor vehicle is a flying vehicle that takes only one pilot, who can also opearate two weapons\n\n" + "The two weapons have different reticles for them similar to the Spiderbot. " + "The primary weapon is laser-based, and is shot toward the white reticle. " + "The secondary weapon drops bombs to the ground, aiming towards the green reticle. " + "The white reticle always points at the head of the vehicle, while the green reticle's location is determined by the momentum of the vehicle"); +} ENDCLASS(Raptor) REGISTER_VEHICLE(RAPTOR, NEW(Raptor)); diff --git a/qcsrc/common/vehicles/vehicle/spiderbot.qh b/qcsrc/common/vehicles/vehicle/spiderbot.qh index 8301cd607..4306e093b 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot.qh +++ b/qcsrc/common/vehicles/vehicle/spiderbot.qh @@ -20,6 +20,15 @@ CLASS(Spiderbot, Vehicle) /* netname */ ATTRIB(Spiderbot, netname, string, "spiderbot"); /* fullname */ ATTRIB(Spiderbot, vehicle_name, string, _("Spiderbot")); /* icon */ ATTRIB(Spiderbot, m_icon, string, "vehicle_spider"); +METHOD(Spiderbot, describe, string(Spiderbot this)) { + TC(Spiderbot, this); + return _("The Spiderbot vehicle walks and jumps around, and takes only one rider\n\n" + "It can jump from very high altitudes while protecting the rider\n\n" + "It has two weapons the rider can control, which have different reticles for them similar to the Raptor. " + "The primary weapon is a machine gun, and is shot toward the green reticle. " + "The secondary weapon shoots rockets towards the white reticle. " + "The white reticle points to the front of the vehicle, while the green reticle also points to the front, with a bit of delay when the Spiderbot rotates"); +} ENDCLASS(Spiderbot) REGISTER_VEHICLE(SPIDERBOT, NEW(Spiderbot)); -- 2.39.2