From: otta8634 Date: Sat, 15 Feb 2025 09:52:51 +0000 (+0800) Subject: Merge branch 'master' into TimePath/guide X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=77d559f8f07daabe0f7bc06ea5167904ac44c2dd;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into TimePath/guide --- 77d559f8f07daabe0f7bc06ea5167904ac44c2dd diff --cc qcsrc/common/mutators/mutator/nades/nade/ammo.qh index 62b83aef68,beca99bf68..f0fa72e407 --- a/qcsrc/common/mutators/mutator/nades/nade/ammo.qh +++ b/qcsrc/common/mutators/mutator/nades/nade/ammo.qh @@@ -21,14 -21,6 +21,16 @@@ CLASS(AmmoNade, Nade ATTRIB(AmmoNade, m_color, vector, '0.66 0.33 0'); ATTRIB(AmmoNade, m_name, string, _("Ammo grenade")); ATTRIB(AmmoNade, m_icon, string, "nade_ammo"); +#ifdef MENUQC + METHOD(AmmoNade, describe, string(AmmoNade this)) + { + TC(AmmoNade, this); + return sprintf(_("The %s 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"), + COLORED_NAME(this)); + } +#endif + ATTRIB(AmmoNade, netname, string, "ammo"); + ATTRIB(AmmoNade, impulse, int, 10); ENDCLASS(AmmoNade) diff --cc qcsrc/common/mutators/mutator/nades/nade/darkness.qh index df37118ae1,efccc06a25..a3fa5876ee --- a/qcsrc/common/mutators/mutator/nades/nade/darkness.qh +++ b/qcsrc/common/mutators/mutator/nades/nade/darkness.qh @@@ -18,12 -18,6 +18,14 @@@ CLASS(DarknessNade, Nade ATTRIB(DarknessNade, m_color, vector, '0.23 0 0.23'); ATTRIB(DarknessNade, m_name, string, _("Darkness grenade")); ATTRIB(DarknessNade, m_icon, string, "nade_darkness"); +#ifdef MENUQC + METHOD(DarknessNade, describe, string(DarknessNade this)) + { + TC(DarknessNade, this); + return sprintf(_("The %s detonates after a short delay, creating a dark field which temporarily blinds enemies who enter it"), + COLORED_NAME(this)); + } +#endif + ATTRIB(DarknessNade, netname, string, "darkness"); + ATTRIB(DarknessNade, impulse, int, 11); ENDCLASS(DarknessNade) diff --cc qcsrc/common/mutators/mutator/nades/nade/entrap.qh index cedea9c135,4a260813c6..dc509cabea --- a/qcsrc/common/mutators/mutator/nades/nade/entrap.qh +++ b/qcsrc/common/mutators/mutator/nades/nade/entrap.qh @@@ -21,13 -21,6 +21,15 @@@ CLASS(EntrapNade, Nade ATTRIB(EntrapNade, m_color, vector, '0.15 0.85 0'); ATTRIB(EntrapNade, m_name, string, _("Entrap grenade")); ATTRIB(EntrapNade, m_icon, string, "nade_entrap"); +#ifdef MENUQC + METHOD(EntrapNade, describe, string(EntrapNade this)) + { + TC(EntrapNade, this); + return sprintf(_("The %s 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"), + COLORED_NAME(this)); + } +#endif + ATTRIB(EntrapNade, netname, string, "entrap"); + ATTRIB(EntrapNade, impulse, int, 8); ENDCLASS(EntrapNade) diff --cc qcsrc/common/mutators/mutator/nades/nade/heal.qh index e1d60a2db4,01386aedd2..a64a4722dc --- a/qcsrc/common/mutators/mutator/nades/nade/heal.qh +++ b/qcsrc/common/mutators/mutator/nades/nade/heal.qh @@@ -19,13 -19,6 +19,15 @@@ CLASS(HealNade, Nade ATTRIB(HealNade, m_color, vector, '1 0 0'); ATTRIB(HealNade, m_name, string, _("Heal grenade")); ATTRIB(HealNade, m_icon, string, "nade_heal"); +#ifdef MENUQC + METHOD(HealNade, describe, string(HealNade this)) + { + TC(HealNade, this); + return sprintf(_("The %s 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"), + COLORED_NAME(this)); + } +#endif + ATTRIB(HealNade, netname, string, "heal"); + ATTRIB(HealNade, impulse, int, 6); ENDCLASS(HealNade) diff --cc qcsrc/common/mutators/mutator/nades/nade/ice.qh index 8e710205e2,ed64a8303e..8fbced0627 --- a/qcsrc/common/mutators/mutator/nades/nade/ice.qh +++ b/qcsrc/common/mutators/mutator/nades/nade/ice.qh @@@ -19,13 -19,6 +19,15 @@@ CLASS(IceNade, Nade ATTRIB(IceNade, m_color, vector, '0 0.5 2'); ATTRIB(IceNade, m_name, string, _("Ice grenade")); ATTRIB(IceNade, m_icon, string, "nade_ice"); +#ifdef MENUQC + METHOD(IceNade, describe, string(IceNade this)) + { + TC(IceNade, this); + return sprintf(_("The %s 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"), + COLORED_NAME(this)); + } +#endif + ATTRIB(IceNade, netname, string, "ice"); + ATTRIB(IceNade, impulse, int, 3); ENDCLASS(IceNade) diff --cc qcsrc/common/mutators/mutator/nades/nade/monster.qh index 8c6a9613ff,50d3e8c69f..cf3978b226 --- a/qcsrc/common/mutators/mutator/nades/nade/monster.qh +++ b/qcsrc/common/mutators/mutator/nades/nade/monster.qh @@@ -18,12 -18,6 +18,14 @@@ CLASS(MonsterNade, Nade ATTRIB(MonsterNade, m_color, vector, '0.25 0.75 0'); ATTRIB(MonsterNade, m_name, string, _("Monster grenade")); ATTRIB(MonsterNade, m_icon, string, "nade_monster"); +#ifdef MENUQC + METHOD(MonsterNade, describe, string(MonsterNade this)) + { + TC(MonsterNade, this); + return sprintf(_("The %s explodes after a short delay, spawning one of four monster types"), + COLORED_NAME(this)); + } +#endif + ATTRIB(MonsterNade, netname, string, "pokenade"); // TODO: "monster"? nade needs renaming! + ATTRIB(MonsterNade, impulse, int, 7); ENDCLASS(MonsterNade) diff --cc qcsrc/common/mutators/mutator/nades/nade/napalm.qh index 47c57d20b4,e8ee871e44..873bae13ea --- a/qcsrc/common/mutators/mutator/nades/nade/napalm.qh +++ b/qcsrc/common/mutators/mutator/nades/nade/napalm.qh @@@ -30,13 -30,6 +30,15 @@@ CLASS(NapalmNade, Nade ATTRIB(NapalmNade, m_color, vector, '2 0.5 0'); ATTRIB(NapalmNade, m_name, string, _("Napalm grenade")); ATTRIB(NapalmNade, m_icon, string, "nade_napalm"); +#ifdef MENUQC + METHOD(NapalmNade, describe, string(NapalmNade this)) + { + TC(NapalmNade, this); + return sprintf(_("The %s 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"), + COLORED_NAME(this)); + } +#endif + ATTRIB(NapalmNade, netname, string, "napalm"); + ATTRIB(NapalmNade, impulse, int, 2); ENDCLASS(NapalmNade) diff --cc qcsrc/common/mutators/mutator/nades/nade/normal.qh index 2136824f23,76c19eb770..bc129ef8c0 --- a/qcsrc/common/mutators/mutator/nades/nade/normal.qh +++ b/qcsrc/common/mutators/mutator/nades/nade/normal.qh @@@ -10,13 -10,6 +10,15 @@@ CLASS(NormalNade, Nade ATTRIB(NormalNade, m_color, vector, '1 1 1'); ATTRIB(NormalNade, m_name, string, _("Grenade")); ATTRIB(NormalNade, m_icon, string, "nade_normal"); +#ifdef MENUQC + METHOD(NormalNade, describe, string(NormalNade this)) + { + TC(NormalNade, this); + return sprintf(_("The (normal) %s explodes after a short delay, dealing damage to nearby players\n\n" + "Make sure you remember to throw it with ^3drop weapon^7, or else it will blow up in your hands!"), + COLORED_NAME(this)); + } +#endif + ATTRIB(NormalNade, impulse, int, 1); + ATTRIB(NormalNade, netname, string, "normal"); ENDCLASS(NormalNade) diff --cc qcsrc/common/mutators/mutator/nades/nade/spawn.qh index 66a2166bde,5d9f09c5fb..d71b1db9f7 --- a/qcsrc/common/mutators/mutator/nades/nade/spawn.qh +++ b/qcsrc/common/mutators/mutator/nades/nade/spawn.qh @@@ -16,13 -16,6 +16,15 @@@ CLASS(SpawnNade, Nade ATTRIB(SpawnNade, m_color, vector, '1 0.9 0'); ATTRIB(SpawnNade, m_name, string, _("Spawn grenade")); ATTRIB(SpawnNade, m_icon, string, "nade_spawn"); +#ifdef MENUQC + METHOD(SpawnNade, describe, string(SpawnNade this)) + { + TC(SpawnNade, this); + return sprintf(_("The %s 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"), + COLORED_NAME(this)); + } +#endif + ATTRIB(SpawnNade, netname, string, "spawn"); + ATTRIB(SpawnNade, impulse, int, 5); ENDCLASS(SpawnNade) diff --cc qcsrc/common/mutators/mutator/nades/nade/translocate.qh index 1c6710fe94,0c01e73747..5da2ba1bbf --- a/qcsrc/common/mutators/mutator/nades/nade/translocate.qh +++ b/qcsrc/common/mutators/mutator/nades/nade/translocate.qh @@@ -16,12 -16,6 +16,14 @@@ CLASS(TranslocateNade, Nade ATTRIB(TranslocateNade, m_color, vector, '1 0 1'); ATTRIB(TranslocateNade, m_name, string, _("Translocate grenade")); ATTRIB(TranslocateNade, m_icon, string, "nade_translocate"); +#ifdef MENUQC + METHOD(TranslocateNade, describe, string(TranslocateNade this)) + { + TC(TranslocateNade, this); + return sprintf(_("The %s detonates after a short delay, teleporting you to where it detonated"), + COLORED_NAME(this)); + } +#endif + ATTRIB(TranslocateNade, netname, string, "translocate"); + ATTRIB(TranslocateNade, impulse, int, 4); ENDCLASS(TranslocateNade) diff --cc qcsrc/common/mutators/mutator/nades/nade/veil.qh index 87c92aa592,95312a4747..cf459bf0c1 --- a/qcsrc/common/mutators/mutator/nades/nade/veil.qh +++ b/qcsrc/common/mutators/mutator/nades/nade/veil.qh @@@ -22,13 -22,6 +22,15 @@@ CLASS(VeilNade, Nade ATTRIB(VeilNade, m_name, string, _("Veil grenade")); ATTRIB(VeilNade, m_icon, string, "nade_veil"); ATTRIB(VeilNade, m_alpha, float, 0.45); +#ifdef MENUQC + METHOD(VeilNade, describe, string(VeilNade this)) + { + TC(VeilNade, this); + return sprintf(_("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"), + COLORED_NAME(this)); + } +#endif + ATTRIB(VeilNade, netname, string, "veil"); + ATTRIB(VeilNade, impulse, int, 9); ENDCLASS(VeilNade) diff --cc qcsrc/common/mutators/mutator/nades/nades.qh index 33081556de,84e5a352a5..ad27f8b0cf --- a/qcsrc/common/mutators/mutator/nades/nades.qh +++ b/qcsrc/common/mutators/mutator/nades/nades.qh @@@ -14,24 -14,16 +14,26 @@@ CLASS(Nade, Object ATTRIB(Nade, m_name, string, _("Grenade")); ATTRIB(Nade, m_icon, string, "nade_normal"); ATTRIB(Nade, m_alpha, float, 1); + ATTRIB(Nade, netname, string, "random"); + ATTRIB(Nade, impulse, int, 0); // legacy number for selection, do not add to new nade types ATTRIBARRAY(Nade, m_projectile, int, 2); ATTRIBARRAY(Nade, m_trail, entity, 2); - METHOD(Nade, display, void(entity this, void(string name, string icon) returns)) { - returns(this.m_name, sprintf("/gfx/hud/%s/%s", cvar_string("hud_skin"), this.m_icon)); + METHOD(Nade, display, void(Nade this, void(string name, string icon) returns)) { + TC(Nade, this); + returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("hud_skin"), this.m_icon) : string_null); } +#ifdef MENUQC + METHOD(Nade, describe, string(Nade this)) { + TC(Nade, this); + return SUPER(Nade).describe(this); + } +#endif ENDCLASS(Nade) -REGISTER_NADE(Null, NEW(Nade)); +CLASS(NullNade, Nade) + ATTRIB(NullNade, m_hidden, bool, true); +ENDCLASS(NullNade) +REGISTER(Nades, NADE_TYPE, Null, m_id, NEW(NullNade)); REGISTRY_DEFINE_GET(Nades, NADE_TYPE_Null) // use slots 70-100 @@@ -62,16 -54,6 +64,16 @@@ Nade Nade_FromProjectile(int proj .float orb_radius; #ifdef GAMEQC - REPLICATE_INIT(int, cvar_cl_nade_type); + REPLICATE_INIT(string, cvar_cl_nade_type); REPLICATE_INIT(string, cvar_cl_pokenade_type); #endif + +#ifdef MENUQC +#include + +CLASS(MutatorNades, Mutator) + ATTRIB(MutatorNades, message, string, _("Nades")); +ENDCLASS(MutatorNades) + +REGISTER_MUTATOR(nades, true, MutatorNades); +#endif diff --cc qcsrc/common/mutators/mutator/new_toys/new_toys.qc index f00a42bfaa,0000000000..97b094895b mode 100644,000000..100644 --- a/qcsrc/common/mutators/mutator/new_toys/new_toys.qc +++ b/qcsrc/common/mutators/mutator/new_toys/new_toys.qc @@@ -1,38 -1,0 +1,37 @@@ +#include "new_toys.qh" + +#include + +// TODO: unhardcode this +bool nt_IsNewToy(int w) +{ + switch(w) + { + case WEP_SEEKER.m_id: + case WEP_MINE_LAYER.m_id: + case WEP_HLAC.m_id: + case WEP_RIFLE.m_id: - case WEP_SHOCKWAVE.m_id: + case WEP_ARC.m_id: + return true; + default: + return false; + } +} + +#ifdef MENUQC +#include "../instagib/instagib.qh" +#include "../overkill/overkill.qh" + +METHOD(MutatorNewToys, describe, string(MutatorNewToys this)) +{ + TC(MutatorNewToys, this); + string s = sprintf(_("The %s mutator, enabled by default, allows the spawning of new gimmicky weapons, sometimes replacing a core weapon\n\n" + "Since these weapons can't spawn in %s and %s, the %s mutator can't be enabled concurrently\n\n" + "The current %s weapons are:"), // do it like this so that the string doesn't need to change when the list is updated + COLORED_NAME(this), COLORED_NAME(MUTATOR_mutator_instagib), COLORED_NAME(MUTATOR_ok), COLORED_NAME(this), COLORED_NAME(this)); + FOREACH(Weapons, nt_IsNewToy(it.m_id), { + s = strcat(s, "\n ", COLORED_NAME(it)); + }); + return s; +} +#endif