From 7e6ad934199bacd9705cb9c5b84558e4083ea82f Mon Sep 17 00:00:00 2001 From: otta8634 Date: Thu, 19 Dec 2024 15:30:56 +0800 Subject: [PATCH] Add grenades to the guide Descriptions were somewhat based on https://gitlab.com/xonotic/xonotic/-/wikis/Nades and the g_nades_* cvar descriptions. --- qcsrc/common/mutators/mutator/nades/nades.inc | 110 ++++++++++++++++-- qcsrc/common/mutators/mutator/nades/nades.qh | 6 +- 2 files changed, 103 insertions(+), 13 deletions(-) diff --git a/qcsrc/common/mutators/mutator/nades/nades.inc b/qcsrc/common/mutators/mutator/nades/nades.inc index b1d1d7c1e..e2564fc52 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.inc +++ b/qcsrc/common/mutators/mutator/nades/nades.inc @@ -5,7 +5,15 @@ MACRO_END #endif -REGISTER_NADE(NORMAL) { +CLASS(NormalNade, Nade) + METHOD(NormalNade, describe, string(NormalNade this)) + { + TC(NormalNade, this); + return _("The (normal) Grenade explodes after a short delay, dealing damage to nearby players\n\n" + "Make sure you remember to throw it, or else it will blow up in your hands!"); + } +ENDCLASS(NormalNade) +REGISTER_NADE(NORMAL, NormalNade) { this.m_color = '1 1 1'; #ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE, EFFECT_Null); @@ -13,7 +21,15 @@ REGISTER_NADE(NORMAL) { #endif } -REGISTER_NADE(NAPALM) { +CLASS(NapalmNade, Nade) + METHOD(NapalmNade, describe, string(NapalmNade this)) + { + TC(NapalmNade, this); + return _("The Napalm grenade explodes after a short delay, spreading fiery napalm globs around in the fountain. " + "The napalm fire balls burn for a while, and damage players who get too close"); + } +ENDCLASS(NapalmNade) +REGISTER_NADE(NAPALM, NapalmNade) { this.m_color = '2 0.5 0'; this.m_name = _("Napalm grenade"); this.m_icon = "nade_napalm"; @@ -23,7 +39,15 @@ REGISTER_NADE(NAPALM) { #endif } -REGISTER_NADE(ICE) { +CLASS(IceNade, Nade) + METHOD(IceNade, describe, string(IceNade this)) + { + TC(IceNade, this); + return _("The Ice grenade detonates after a short delay, freezing any enemies who walk within the explosion radius for a few seconds after the explosion. " + "While frozen, enemies are progressively dealt damage"); + } +ENDCLASS(IceNade) +REGISTER_NADE(ICE, IceNade) { this.m_color = '0 0.5 2'; this.m_name = _("Ice grenade"); this.m_icon = "nade_ice"; @@ -33,7 +57,14 @@ REGISTER_NADE(ICE) { #endif } -REGISTER_NADE(TRANSLOCATE) { +CLASS(TranslocateNade, Nade) + METHOD(TranslocateNade, describe, string(TranslocateNade this)) + { + TC(TranslocateNade, this); + return _("The Translocate grenade detonates after a short delay, teleporting you to where it detonated"); + } +ENDCLASS(TranslocateNade) +REGISTER_NADE(TRANSLOCATE, TranslocateNade) { this.m_color = '1 0 1'; this.m_name = _("Translocate grenade"); this.m_icon = "nade_translocate"; @@ -43,7 +74,15 @@ REGISTER_NADE(TRANSLOCATE) { #endif } -REGISTER_NADE(SPAWN) { +CLASS(SpawnNade, Nade) + METHOD(SpawnNade, describe, string(SpawnNade this)) + { + TC(SpawnNade, this); + return _("The Spawn grenade detonates after a short delay, temporarily setting your spawn point to where it detonated. " + "It is useful for cases where you want to go back to some point on the map after you die"); + } +ENDCLASS(SpawnNade) +REGISTER_NADE(SPAWN, SpawnNade) { this.m_color = '1 0.9 0'; this.m_name = _("Spawn grenade"); this.m_icon = "nade_spawn"; @@ -53,7 +92,15 @@ REGISTER_NADE(SPAWN) { #endif } -REGISTER_NADE(HEAL) { +CLASS(HealNade, Nade) + METHOD(HealNade, describe, string(HealNade this)) + { + TC(HealNade, this); + return _("The Heal grenade detonates after a short delay, temporarily creating a healing orb around the point where it detonated for several seconds. " + "If your team members enter the orb they will recover health, and if enemies enter the sphere they will be harmed"); + } +ENDCLASS(HealNade) +REGISTER_NADE(HEAL, HealNade) { this.m_color = '1 0 0'; this.m_name = _("Heal grenade"); this.m_icon = "nade_heal"; @@ -63,7 +110,14 @@ REGISTER_NADE(HEAL) { #endif } -REGISTER_NADE(MONSTER) { +CLASS(MonsterNade, Nade) + METHOD(MonsterNade, describe, string(MonsterNade this)) + { + TC(MonsterNade, this); + return _("The Monster grenade explodes after a short delay, spawning one of four monster types"); + } +ENDCLASS(MonsterNade) +REGISTER_NADE(MONSTER, MonsterNade) { this.m_color = '0.25 0.75 0'; this.m_name = _("Monster grenade"); this.m_icon = "nade_monster"; @@ -73,7 +127,15 @@ REGISTER_NADE(MONSTER) { #endif } -REGISTER_NADE(ENTRAP) { +CLASS(EntrapNade, Nade) + METHOD(EntrapNade, describe, string(EntrapNade this)) + { + TC(EntrapNade, this); + return _("The Entrap grenade detonates after a short delay, temporarily creating an orb around the point where it detonated for several seconds. " + "Players and projectiles that enter the sphere will be slowed down, including yourself"); + } +ENDCLASS(EntrapNade) +REGISTER_NADE(ENTRAP, EntrapNade) { this.m_color = '0.15 0.85 0'; this.m_name = _("Entrap grenade"); this.m_icon = "nade_entrap"; @@ -83,7 +145,15 @@ REGISTER_NADE(ENTRAP) { #endif } -REGISTER_NADE(VEIL) { +CLASS(VeilNade, Nade) + METHOD(VeilNade, describe, string(VeilNade this)) + { + TC(VeilNade, this); + return _("The Veil grenade detonates after a short delay, temporarily creating an orb around the point where it detonated for several seconds. " + "Players inside the orb will be invisible to those outside it"); + } +ENDCLASS(VeilNade) +REGISTER_NADE(VEIL, VeilNade) { this.m_color = '0.65 0.85 0.65'; this.m_name = _("Veil grenade"); this.m_icon = "nade_veil"; @@ -94,7 +164,16 @@ REGISTER_NADE(VEIL) { #endif } -REGISTER_NADE(AMMO) { +CLASS(AmmoNade, Nade) + METHOD(AmmoNade, describe, string(AmmoNade this)) + { + TC(AmmoNade, this); + return _("The Ammo grenade detonates after a short delay, temporarily creating an orb around the point where it detonated for several seconds. " + "If your team members enter the orb they will recover ammo, and if enemies enter the sphere they will lose ammo\n\n" + "This does not impact weapon magazines, so it won't reload your weapons for you"); + } +ENDCLASS(AmmoNade) +REGISTER_NADE(AMMO, AmmoNade) { this.m_color = '0.66 0.33 0'; this.m_name = _("Ammo grenade"); this.m_icon = "nade_ammo"; @@ -104,7 +183,14 @@ REGISTER_NADE(AMMO) { #endif } -REGISTER_NADE(DARKNESS) { +CLASS(DarknessNade, Nade) + METHOD(DarknessNade, describe, string(DarknessNade this)) + { + TC(DarknessNade, this); + return _("The Darkness grenade detonates after a short delay, creating a dark field which temporarily blinds enemies who enter it"); + } +ENDCLASS(DarknessNade) +REGISTER_NADE(DARKNESS, DarknessNade) { this.m_color = '0.23 0 0.23'; this.m_name = _("Darkness grenade"); this.m_icon = "nade_darkness"; @@ -112,4 +198,4 @@ REGISTER_NADE(DARKNESS) { NADE_PROJECTILE(0, PROJECTILE_NADE_DARKNESS, EFFECT_NADE_TRAIL_PURPLE); NADE_PROJECTILE(1, PROJECTILE_NADE_DARKNESS_BURN, EFFECT_NADE_TRAIL_BURN_PURPLE); #endif -} \ No newline at end of file +} diff --git a/qcsrc/common/mutators/mutator/nades/nades.qh b/qcsrc/common/mutators/mutator/nades/nades.qh index 73d780490..c511b9159 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qh +++ b/qcsrc/common/mutators/mutator/nades/nades.qh @@ -115,7 +115,7 @@ REGISTRY(Nades, BITS(4)) REGISTER_REGISTRY(Nades) REGISTRY_CHECK(Nades) -#define REGISTER_NADE(id) REGISTER(Nades, NADE_TYPE, id, m_id, NEW(Nade)) +#define REGISTER_NADE(id, class) REGISTER(Nades, NADE_TYPE, id, m_id, NEW(class)) CLASS(Nade, Object) ATTRIB(Nade, m_id, int, 0); @@ -128,6 +128,10 @@ CLASS(Nade, Object) METHOD(Nade, display, void(entity this, void(string name, string icon) returns)) { returns(this.m_name, sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon)); } + METHOD(Nade, describe, string(Nade this)) { + TC(Nade, this); + return SUPER(Object).describe(this); + } ENDCLASS(Nade) CLASS(NullNade, Nade) -- 2.39.2