From: otta8634 Date: Thu, 19 Dec 2024 08:45:08 +0000 (+0800) Subject: Add buffs, powerups, and items to the guide X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8ce8d39e836502d480bb62bdbf1dd558962b61cc;p=xonotic%2Fxonotic-data.pk3dir.git Add buffs, powerups, and items to the guide Descriptions of buffs/powerups were somewhat based on https://gitlab.com/xonotic/xonotic/-/wikis/Buffs and https://gitlab.com/xonotic/xonotic/-/wikis/Powerups. --- diff --git a/qcsrc/common/items/item.qh b/qcsrc/common/items/item.qh index 1b29d71bd..b67c52371 100644 --- a/qcsrc/common/items/item.qh +++ b/qcsrc/common/items/item.qh @@ -132,6 +132,11 @@ CLASS(GameItem, Object) ATTRIB(GameItem, m_glow, bool, false); ATTRIB(GameItem, m_respawnsound, Sound, SND_ITEMRESPAWN); #endif + METHOD(GameItem, describe, string(GameItem this)) + { + TC(GameItem, this); + return SUPER(Object).describe(this); + } METHOD(GameItem, display, void(GameItem this, void(string name, string icon) returns)) { TC(GameItem, this); diff --git a/qcsrc/common/items/item/ammo.qh b/qcsrc/common/items/item/ammo.qh index c9688a282..5b2b8fdf4 100644 --- a/qcsrc/common/items/item/ammo.qh +++ b/qcsrc/common/items/item/ammo.qh @@ -23,6 +23,11 @@ CLASS(Ammo, Pickup) ATTRIB(Ammo, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_ammo)); ATTRIB(Ammo, m_pickupanyway, float(), GET(g_pickup_ammo_anyway)); #endif + METHOD(Ammo, describe, string(Ammo this)) + { + TC(Ammo, this); + return SUPER(Pickup).describe(this); + } ENDCLASS(Ammo) @@ -44,6 +49,11 @@ void ammo_shells_init(Pickup this, entity item) #endif CLASS(Shells, Ammo) + METHOD(Shells, describe, string(Shells this)) + { + TC(Shells, this); + return _("The Shells ammo type is used by the Shotgun and Overkill Shotgun"); + } ENDCLASS(Shells) REGISTER_ITEM(Shells, Shells) { @@ -80,6 +90,11 @@ void ammo_bullets_init(Pickup this, entity item) #endif CLASS(Bullets, Ammo) + METHOD(Bullets, describe, string(Bullets this)) + { + TC(Bullets, this); + return _("The Bullets ammo type is used by the MachineGun, Rifle, Overkill MachineGun, and Overkill Heavy Machine Gun"); + } ENDCLASS(Bullets) REGISTER_ITEM(Bullets, Bullets) { @@ -114,7 +129,16 @@ void ammo_rockets_init(Pickup this, entity item) SetResourceExplicit(item, RES_ROCKETS, g_pickup_rockets); } #endif -REGISTER_ITEM(Rockets, Ammo) { + +CLASS(Rockets, Ammo) + METHOD(Rockets, describe, string(Rockets this)) + { + TC(Rockets, this); + return _("The Rockets ammo type is used by the Devastator, Mortar, Mine Layer, Hagar, T.A.G. Seeker, and Overkill Rocket Propelled Chainsaw"); + } +ENDCLASS(Rockets) + +REGISTER_ITEM(Rockets, Rockets) { this.m_canonical_spawnfunc = "item_rockets"; #ifdef GAMEQC this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; @@ -146,7 +170,16 @@ void ammo_cells_init(Pickup this, entity item) SetResourceExplicit(item, RES_CELLS, g_pickup_cells); } #endif -REGISTER_ITEM(Cells, Ammo) { + +CLASS(Cells, Ammo) + METHOD(Cells, describe, string(Cells this)) + { + TC(Cells, this); + return _("The Cells ammo type is used by the Vortex, Crylink, Electro, Heavy Laser Assault Cannon, Arc, and Vaporizer"); + } +ENDCLASS(Cells) + +REGISTER_ITEM(Cells, Cells) { this.m_canonical_spawnfunc = "item_cells"; #ifdef GAMEQC this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; diff --git a/qcsrc/common/items/item/armor.qh b/qcsrc/common/items/item/armor.qh index b8c3b408f..c45079f10 100644 --- a/qcsrc/common/items/item/armor.qh +++ b/qcsrc/common/items/item/armor.qh @@ -12,6 +12,7 @@ ENDCLASS(Armor) #include #endif +// small armor #ifdef GAMEQC MODEL(ArmorSmall_ITEM, Item_Model("item_armor_small.md3")); SOUND(ArmorSmall, Item_Sound("armor1")); @@ -29,7 +30,16 @@ void item_armorsmall_init(Pickup this, entity item) } #endif -REGISTER_ITEM(ArmorSmall, Armor) { +CLASS(ArmorSmall, Armor) + METHOD(ArmorSmall, describe, string(ArmorSmall this)) + { + TC(ArmorSmall, this); + return _("The Small armor provides you a small amount of armor when picked up, " + "protecting you from damage by absorbing incoming hits until it is depleted"); + } +ENDCLASS(ArmorSmall) + +REGISTER_ITEM(ArmorSmall, ArmorSmall) { this.m_canonical_spawnfunc = "item_armor_small"; #ifdef GAMEQC this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; @@ -56,6 +66,7 @@ REGISTER_ITEM(ArmorSmall, Armor) { SPAWNFUNC_ITEM(item_armor_small, ITEM_ArmorSmall) +// medium armor #ifdef GAMEQC MODEL(ArmorMedium_ITEM, Item_Model("item_armor_medium.md3")); SOUND(ArmorMedium, Item_Sound("armor10")); @@ -73,7 +84,16 @@ void item_armormedium_init(Pickup this, entity item) } #endif -REGISTER_ITEM(ArmorMedium, Armor) { +CLASS(ArmorMedium, Armor) + METHOD(ArmorMedium, describe, string(ArmorMedium this)) + { + TC(ArmorMedium, this); + return _("The Medium armor provides you a medium amount of armor when picked up, " + "protecting you from damage by absorbing incoming hits until it is depleted"); + } +ENDCLASS(ArmorMedium) + +REGISTER_ITEM(ArmorMedium, ArmorMedium) { this.m_canonical_spawnfunc = "item_armor_medium"; #ifdef GAMEQC this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; @@ -100,6 +120,7 @@ REGISTER_ITEM(ArmorMedium, Armor) { SPAWNFUNC_ITEM(item_armor_medium, ITEM_ArmorMedium) +// big armor #ifdef GAMEQC MODEL(ArmorBig_ITEM, Item_Model("item_armor_big.md3")); SOUND(ArmorBig, Item_Sound("armor17_5")); @@ -117,7 +138,16 @@ void item_armorbig_init(Pickup this, entity item) } #endif -REGISTER_ITEM(ArmorBig, Armor) { +CLASS(ArmorBig, Armor) + METHOD(ArmorBig, describe, string(ArmorBig this)) + { + TC(ArmorBig, this); + return _("The Big armor provides you a large amount of armor when picked up, " + "protecting you from damage by absorbing incoming hits until it is depleted"); + } +ENDCLASS(ArmorBig) + +REGISTER_ITEM(ArmorBig, ArmorBig) { this.m_canonical_spawnfunc = "item_armor_big"; #ifdef GAMEQC this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; @@ -144,6 +174,7 @@ REGISTER_ITEM(ArmorBig, Armor) { SPAWNFUNC_ITEM(item_armor_big, ITEM_ArmorBig) +// mega armor #ifdef GAMEQC MODEL(ArmorMega_ITEM, Item_Model("item_armor_large.md3")); SOUND(ArmorMega, Item_Sound("armor25")); @@ -161,7 +192,17 @@ void item_armormega_init(Pickup this, entity item) } #endif -REGISTER_ITEM(ArmorMega, Armor) { +CLASS(ArmorMega, Armor) + METHOD(ArmorMega, describe, string(ArmorMega this)) + { + TC(ArmorMega, this); + return _("The Mega armor provides you a huge amount of armor when picked up, " + "protecting you from damage by absorbing incoming hits until it is depleted\n\n" + "It tends to be one of the most highly contested items on a map, particularly in game modes like Duel"); + } +ENDCLASS(ArmorMega) + +REGISTER_ITEM(ArmorMega, ArmorMega) { this.m_canonical_spawnfunc = "item_armor_mega"; #ifdef GAMEQC this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; diff --git a/qcsrc/common/items/item/health.qh b/qcsrc/common/items/item/health.qh index a028f28c3..5a85beb97 100644 --- a/qcsrc/common/items/item/health.qh +++ b/qcsrc/common/items/item/health.qh @@ -12,6 +12,7 @@ ENDCLASS(Health) #include #endif +// small health #ifdef GAMEQC MODEL(HealthSmall_ITEM, Item_Model("g_h1.md3")); SOUND(HealthSmall, Item_Sound("minihealth")); @@ -29,7 +30,16 @@ void item_healthsmall_init(Pickup this, entity item) } #endif -REGISTER_ITEM(HealthSmall, Health) { +CLASS(HealthSmall, Health) + METHOD(HealthSmall, describe, string(HealthSmall this)) + { + TC(HealthSmall, this); + return _("The Small health restores a small amount of health when picked up, " + "helping you recover from damage taken during combat"); + } +ENDCLASS(HealthSmall) + +REGISTER_ITEM(HealthSmall, HealthSmall) { this.m_canonical_spawnfunc = "item_health_small"; #ifdef GAMEQC this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; @@ -51,12 +61,12 @@ REGISTER_ITEM(HealthSmall, Health) { this.m_respawntimejitter = GET(g_pickup_respawntimejitter_health_small); this.m_pickupanyway = GET(g_pickup_healthsmall_anyway); this.m_iteminit = item_healthsmall_init; - #endif } SPAWNFUNC_ITEM(item_health_small, ITEM_HealthSmall) +// medium health #ifdef GAMEQC MODEL(HealthMedium_ITEM, Item_Model("g_h25.md3")); SOUND(HealthMedium, Item_Sound("mediumhealth")); @@ -74,7 +84,16 @@ void item_healthmedium_init(Pickup this, entity item) } #endif -REGISTER_ITEM(HealthMedium, Health) { +CLASS(HealthMedium, Health) + METHOD(HealthMedium, describe, string(HealthMedium this)) + { + TC(HealthMedium, this); + return _("The Medium health restores a medium amount of health when picked up, " + "helping you recover from damage taken during combat"); + } +ENDCLASS(HealthMedium) + +REGISTER_ITEM(HealthMedium, HealthMedium) { this.m_canonical_spawnfunc = "item_health_medium"; #ifdef GAMEQC this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; @@ -101,6 +120,7 @@ REGISTER_ITEM(HealthMedium, Health) { SPAWNFUNC_ITEM(item_health_medium, ITEM_HealthMedium) +// big health #ifdef GAMEQC MODEL(HealthBig_ITEM, Item_Model("g_h50.md3")); SOUND(HealthBig, Item_Sound("mediumhealth")); @@ -118,7 +138,16 @@ void item_healthbig_init(Pickup this, entity item) } #endif -REGISTER_ITEM(HealthBig, Health) { +CLASS(HealthBig, Health) + METHOD(HealthBig, describe, string(HealthBig this)) + { + TC(HealthBig, this); + return _("The Big health restores a large amount of health when picked up, " + "helping you recover from damage taken during combat"); + } +ENDCLASS(HealthBig) + +REGISTER_ITEM(HealthBig, HealthBig) { this.m_canonical_spawnfunc = "item_health_big"; #ifdef GAMEQC this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; @@ -162,7 +191,17 @@ void item_healthmega_init(Pickup this, entity item) } #endif -REGISTER_ITEM(HealthMega, Health) { +CLASS(HealthMega, Health) + METHOD(HealthMega, describe, string(HealthMega this)) + { + TC(HealthMega, this); + return _("The Mega health restores a huge amount of health when picked up, " + "helping you recover from damage taken during combat\n\n" + "It tends to be one of the most highly contested items on a map, particularly in game modes like Duel"); + } +ENDCLASS(HealthMega) + +REGISTER_ITEM(HealthMega, HealthMega) { this.m_canonical_spawnfunc = "item_health_mega"; #ifdef GAMEQC this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; diff --git a/qcsrc/common/items/item/jetpack.qh b/qcsrc/common/items/item/jetpack.qh index ca52f5466..1f6ad365b 100644 --- a/qcsrc/common/items/item/jetpack.qh +++ b/qcsrc/common/items/item/jetpack.qh @@ -11,6 +11,7 @@ .int m_itemid; #endif +// jetpack powerup #ifdef GAMEQC MODEL(Jetpack_ITEM, Item_Model("g_jetpack.md3")); #endif @@ -29,6 +30,13 @@ void powerup_jetpack_init(Pickup def, entity item) #endif CLASS(Jetpack, Powerup) + METHOD(Jetpack, describe, string(Jetpack this)) + { + TC(Jetpack, this); + return _("The Jetpack allows you to fly around the map for a short period, " + "providing increased mobility, maneuverability, and the ability to reach higher ground\n\n" + "It consumes Fuel ammo while operating, so make sure you don't run out when you're high up!"); + } ENDCLASS(Jetpack) REGISTER_ITEM(Jetpack, Jetpack) { @@ -53,10 +61,19 @@ REGISTER_ITEM(Jetpack, Jetpack) { SPAWNFUNC_ITEM(item_jetpack, ITEM_Jetpack) +// fuel ammo #ifdef GAMEQC MODEL(JetpackFuel_ITEM, Item_Model("g_fuel.md3")); #endif +CLASS(JetpackFuel, Ammo) + METHOD(JetpackFuel, describe, string(JetpackFuel this)) + { + TC(JetpackFuel, this); + return _("The Fuel ammo type is used by the Jetpack"); + } +ENDCLASS(JetpackFuel) + #ifdef SVQC PROPERTY(int, g_pickup_fuel); void ammo_fuel_init(Pickup this, entity item) @@ -65,7 +82,7 @@ void ammo_fuel_init(Pickup this, entity item) SetResourceExplicit(item, RES_FUEL, g_pickup_fuel); } #endif -REGISTER_ITEM(JetpackFuel, Ammo) { +REGISTER_ITEM(JetpackFuel, JetpackFuel) { this.m_canonical_spawnfunc = "item_fuel"; #ifdef GAMEQC this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; @@ -83,6 +100,7 @@ REGISTER_ITEM(JetpackFuel, Ammo) { SPAWNFUNC_ITEM(item_fuel, ITEM_JetpackFuel) +// fuel regenerator powerup #ifdef GAMEQC MODEL(JetpackRegen_ITEM, Item_Model("g_fuelregen.md3")); #endif @@ -97,6 +115,13 @@ void powerup_fuelregen_init(Pickup def, entity item) #endif CLASS(JetpackRegen, Powerup) + METHOD(JetpackRegen, describe, string(JetpackRegen this)) + { + TC(JetpackRegen, this); + return _("The Fuel Regenerator powerup regenerates Fuel needed for the Jetpack until the powerup expires, " + "so you can continue flying around for longer" + "Since it is a powerup, it will drop if you die while holding it"); + } ENDCLASS(JetpackRegen) REGISTER_ITEM(JetpackRegen, JetpackRegen) { diff --git a/qcsrc/common/mutators/mutator/buffs/all.inc b/qcsrc/common/mutators/mutator/buffs/all.inc index a5127a153..7ec8cfc22 100644 --- a/qcsrc/common/mutators/mutator/buffs/all.inc +++ b/qcsrc/common/mutators/mutator/buffs/all.inc @@ -21,8 +21,13 @@ CLASS(AmmoBuff, Buff) ATTRIB(AmmoBuff, m_icon, string, "buff_ammo"); ATTRIB(AmmoBuff, m_skin, int, 3); ATTRIB(AmmoBuff, m_color, vector, '0.76 1 0.1'); + METHOD(AmmoBuff, describe, string(AmmoBuff this)) + { + TC(AmmoBuff, this); + return _("The Ammo Buff gives you infinite ammo until the buff expires, so you don't need to worry about running out of ammo"); + } ENDCLASS(AmmoBuff) -REGISTER_BUFF(AMMO, NEW(AmmoBuff)); +REGISTER_BUFF(AMMO, AmmoBuff); BUFF_SPAWNFUNCS(ammo, BUFF_AMMO) BUFF_SPAWNFUNC_Q3COMPAT(item_ammoregen, BUFF_AMMO) @@ -32,8 +37,13 @@ CLASS(ResistanceBuff, Buff) ATTRIB(ResistanceBuff, m_icon, string, "buff_resistance"); ATTRIB(ResistanceBuff, m_skin, int, 0); ATTRIB(ResistanceBuff, m_color, vector, '0.36 1 0.07'); + METHOD(ResistanceBuff, describe, string(ResistanceBuff this)) + { + TC(ResistanceBuff, this); + return _("The Resistance Buff greatly reduces your damage taken while the buff is active"); + } ENDCLASS(ResistanceBuff) -REGISTER_BUFF(RESISTANCE, NEW(ResistanceBuff)); +REGISTER_BUFF(RESISTANCE, ResistanceBuff); BUFF_SPAWNFUNCS(resistance, BUFF_RESISTANCE) BUFF_SPAWNFUNC_Q3COMPAT(item_guard, BUFF_RESISTANCE) @@ -43,8 +53,14 @@ CLASS(MedicBuff, Buff) ATTRIB(MedicBuff, m_icon, string, "buff_medic"); ATTRIB(MedicBuff, m_skin, int, 1); ATTRIB(MedicBuff, m_color, vector, '1 0.12 0'); + METHOD(MedicBuff, describe, string(MedicBuff this)) + { + TC(MedicBuff, this); + return _("The Medic Buff increases health regeneration speed, increases the maximum health you can have before health starts to rot, and reduces health rot speed until the buff expires\n\n" + "It also gives you a chance to survive a fatal hit, with a small amount of health left over"); + } ENDCLASS(MedicBuff) -REGISTER_BUFF(MEDIC, NEW(MedicBuff)); +REGISTER_BUFF(MEDIC, MedicBuff); BUFF_SPAWNFUNCS(medic, BUFF_MEDIC) BUFF_SPAWNFUNC_Q3COMPAT(item_regen, BUFF_MEDIC) BUFF_SPAWNFUNC_Q3COMPAT(item_revival, BUFF_MEDIC) @@ -55,8 +71,14 @@ CLASS(BashBuff, Buff) ATTRIB(BashBuff, m_icon, string, "buff_bash"); ATTRIB(BashBuff, m_skin, int, 5); ATTRIB(BashBuff, m_color, vector, '1 0.39 0'); + METHOD(BashBuff, describe, string(BashBuff this)) + { + TC(BashBuff, this); + return _("The Bash Buff increases knockback force you deal, and makes you immune to knockback while the buff is active\n\n" + "It also slightly increases knockback you deal to yourself"); + } ENDCLASS(BashBuff) -REGISTER_BUFF(BASH, NEW(BashBuff)); +REGISTER_BUFF(BASH, BashBuff); BUFF_SPAWNFUNCS(bash, BUFF_BASH) BUFF_SPAWNFUNC_Q3COMPAT(item_scout, BUFF_BASH) @@ -66,8 +88,13 @@ CLASS(VampireBuff, Buff) ATTRIB(VampireBuff, m_icon, string, "buff_vampire"); ATTRIB(VampireBuff, m_skin, int, 2); ATTRIB(VampireBuff, m_color, vector, '1 0 0.24'); + METHOD(VampireBuff, describe, string(VampireBuff this)) + { + TC(VampireBuff, this); + return _("The Vampire Buff converts some of the damage you deal to enemies and monsters into health for yourself, until the buff expires"); + } ENDCLASS(VampireBuff) -REGISTER_BUFF(VAMPIRE, NEW(VampireBuff)); +REGISTER_BUFF(VAMPIRE, VampireBuff); BUFF_SPAWNFUNCS(vampire, BUFF_VAMPIRE) BUFF_SPAWNFUNC_Q3COMPAT(holdable_invulnerability, BUFF_VAMPIRE) @@ -77,8 +104,14 @@ CLASS(DisabilityBuff, Buff) ATTRIB(DisabilityBuff, m_icon, string, "buff_disability"); ATTRIB(DisabilityBuff, m_skin, int, 7); ATTRIB(DisabilityBuff, m_color, vector, '0.94 0.3 1'); + METHOD(DisabilityBuff, describe, string(DisabilityBuff this)) + { + TC(DisabilityBuff, this); + return _("The Disability Buff causes your enemies and monsters to slow down for a few seconds when you attack them, while the buff is active\n\n" + "This is particularly useful against speedy players, especially in Capture The Flag"); + } ENDCLASS(DisabilityBuff) -REGISTER_BUFF(DISABILITY, NEW(DisabilityBuff)); +REGISTER_BUFF(DISABILITY, DisabilityBuff); BUFF_SPAWNFUNCS(disability, BUFF_DISABILITY) CLASS(VengeanceBuff, Buff) @@ -87,8 +120,13 @@ CLASS(VengeanceBuff, Buff) ATTRIB(VengeanceBuff, m_icon, string, "buff_vengeance"); ATTRIB(VengeanceBuff, m_skin, int, 15); ATTRIB(VengeanceBuff, m_color, vector, '1 0.23 0.61'); + METHOD(VengeanceBuff, describe, string(VengeanceBuff this)) + { + TC(VengeanceBuff, this); + return _("The Vengeance Buff reciprocates a portion of the damage enemies deal to you onto them, until the buff expires"); + } ENDCLASS(VengeanceBuff) -REGISTER_BUFF(VENGEANCE, NEW(VengeanceBuff)); +REGISTER_BUFF(VENGEANCE, VengeanceBuff); BUFF_SPAWNFUNCS(vengeance, BUFF_VENGEANCE) BUFF_SPAWNFUNC_Q3COMPAT(holdable_kamikaze, BUFF_VENGEANCE) @@ -98,8 +136,13 @@ CLASS(JumpBuff, Buff) ATTRIB(JumpBuff, m_icon, string, "buff_jump"); ATTRIB(JumpBuff, m_skin, int, 10); ATTRIB(JumpBuff, m_color, vector, '0.24 0.78 1'); + METHOD(JumpBuff, describe, string(JumpBuff this)) + { + TC(JumpBuff, this); + return _("The Jump Buff greatly increases your jump height, while the buff is active"); + } ENDCLASS(JumpBuff) -REGISTER_BUFF(JUMP, NEW(JumpBuff)); +REGISTER_BUFF(JUMP, JumpBuff); BUFF_SPAWNFUNCS(jump, BUFF_JUMP) BUFF_SPAWNFUNC_Q3COMPAT(item_jumper, BUFF_JUMP) @@ -109,8 +152,13 @@ CLASS(InfernoBuff, Buff) ATTRIB(InfernoBuff, m_icon, string, "buff_inferno"); ATTRIB(InfernoBuff, m_skin, int, 16); ATTRIB(InfernoBuff, m_color, vector, '1 0.62 0'); + METHOD(InfernoBuff, describe, string(InfernoBuff this)) + { + TC(InfernoBuff, this); + return _("The Inferno Buff sets any enemies or monsters you attack alight, dealing burn damage to them for several seconds until the buff expires"); + } ENDCLASS(InfernoBuff) -REGISTER_BUFF(INFERNO, NEW(InfernoBuff)); +REGISTER_BUFF(INFERNO, InfernoBuff); BUFF_SPAWNFUNCS(inferno, BUFF_INFERNO) BUFF_SPAWNFUNC_Q3COMPAT(item_doubler, BUFF_INFERNO) @@ -120,8 +168,14 @@ CLASS(SwapperBuff, Buff) ATTRIB(SwapperBuff, m_icon, string, "buff_swapper"); ATTRIB(SwapperBuff, m_skin, int, 17); ATTRIB(SwapperBuff, m_color, vector, '0.63 0.36 1'); + METHOD(SwapperBuff, describe, string(SwapperBuff this)) + { + TC(SwapperBuff, this); + return _("The Swapper Buff allows you to press the \"dropweapon\" bind to switch places with a nearby enemy once\n\n" + "A common usage of this Buff is to jump over the map's void, then swap with an enemy, to cause them to fall into the void"); + } ENDCLASS(SwapperBuff) -REGISTER_BUFF(SWAPPER, NEW(SwapperBuff)); +REGISTER_BUFF(SWAPPER, SwapperBuff); BUFF_SPAWNFUNCS(swapper, BUFF_SWAPPER) BUFF_SPAWNFUNC_Q3COMPAT(holdable_teleporter, BUFF_SWAPPER) @@ -131,8 +185,13 @@ CLASS(MagnetBuff, Buff) ATTRIB(MagnetBuff, m_icon, string, "buff_magnet"); ATTRIB(MagnetBuff, m_skin, int, 18); ATTRIB(MagnetBuff, m_color, vector, '1 0.95 0.18'); + METHOD(MagnetBuff, describe, string(MagnetBuff this)) + { + TC(MagnetBuff, this); + return _("The Magnet Buff greatly increases your item pickup range, collecting nearby items for you while the buff is active"); + } ENDCLASS(MagnetBuff) -REGISTER_BUFF(MAGNET, NEW(MagnetBuff)); +REGISTER_BUFF(MAGNET, MagnetBuff); BUFF_SPAWNFUNCS(magnet, BUFF_MAGNET) CLASS(LuckBuff, Buff) @@ -141,8 +200,13 @@ CLASS(LuckBuff, Buff) ATTRIB(LuckBuff, m_icon, string, "buff_luck"); ATTRIB(LuckBuff, m_skin, int, 19); ATTRIB(LuckBuff, m_color, vector, '1 0.23 0.44'); + METHOD(LuckBuff, describe, string(LuckBuff this)) + { + TC(LuckBuff, this); + return _("While you have the Luck Buff, each attack has a chance of being a critical hit with greatly increased damage"); + } ENDCLASS(LuckBuff) -REGISTER_BUFF(LUCK, NEW(LuckBuff)); +REGISTER_BUFF(LUCK, LuckBuff); BUFF_SPAWNFUNCS(luck, BUFF_LUCK) CLASS(FlightBuff, Buff) @@ -151,7 +215,12 @@ CLASS(FlightBuff, Buff) ATTRIB(FlightBuff, m_icon, string, "buff_flight"); ATTRIB(FlightBuff, m_skin, int, 11); ATTRIB(FlightBuff, m_color, vector, '0.23 0.44 1'); + METHOD(FlightBuff, describe, string(FlightBuff this)) + { + TC(FlightBuff, this); + return _("While you have the Flight Buff, you can crouch while midair to switch your gravity, allowing flight"); + } ENDCLASS(FlightBuff) -REGISTER_BUFF(FLIGHT, NEW(FlightBuff)); +REGISTER_BUFF(FLIGHT, FlightBuff); BUFF_SPAWNFUNCS(flight, BUFF_FLIGHT) BUFF_SPAWNFUNC_Q3COMPAT(item_flight, BUFF_FLIGHT) diff --git a/qcsrc/common/mutators/mutator/buffs/buffs.qh b/qcsrc/common/mutators/mutator/buffs/buffs.qh index a14ad6bb8..ca58b15d4 100644 --- a/qcsrc/common/mutators/mutator/buffs/buffs.qh +++ b/qcsrc/common/mutators/mutator/buffs/buffs.qh @@ -8,8 +8,7 @@ #include #endif -#define REGISTER_BUFF(id, inst) \ - REGISTER(StatusEffect, BUFF_##id, m_id, inst) +#define REGISTER_BUFF(id, class) REGISTER(StatusEffect, BUFF_##id, m_id, NEW(class)) #include CLASS(Buff, StatusEffects) @@ -28,8 +27,14 @@ CLASS(Buff, StatusEffects) } #ifdef SVQC METHOD(Buff, m_time, float(Buff this)) - { return cvar(strcat("g_buffs_", this.netname, "_time")); } + { + return cvar(strcat("g_buffs_", this.netname, "_time")); + } #endif + METHOD(Buff, describe, string(Buff this)) { + TC(Buff, this); + return SUPER(Object).describe(this); + } ENDCLASS(Buff) STATIC_INIT(REGISTER_BUFFS) { diff --git a/qcsrc/common/mutators/mutator/instagib/items.qh b/qcsrc/common/mutators/mutator/instagib/items.qh index 9be156bb3..1ac8d1b30 100644 --- a/qcsrc/common/mutators/mutator/instagib/items.qh +++ b/qcsrc/common/mutators/mutator/instagib/items.qh @@ -22,7 +22,16 @@ void ammo_vaporizercells_init(Pickup this, entity item) SetResourceExplicit(item, RES_CELLS, autocvar_g_instagib_ammo_drop); } #endif -REGISTER_ITEM(VaporizerCells, Ammo) { + +CLASS(VaporizerCells, Ammo) + METHOD(VaporizerCells, describe, string(VaporizerCells this)) + { + TC(VaporizerCells, this); + return _("The Vaporizer ammo is sometimes present on maps when InstaGib is enabled, providing ammo for the Vaporizer"); + } +ENDCLASS(VaporizerCells) + +REGISTER_ITEM(VaporizerCells, VaporizerCells) { this.m_canonical_spawnfunc = "item_vaporizer_cells"; #ifdef GAMEQC this.spawnflags = ITEM_FLAG_MUTATORBLOCKED; @@ -49,7 +58,16 @@ MODEL(ExtraLife_ITEM, Item_Model("g_h100.md3")); SOUND(ExtraLife, Item_Sound("megahealth")); #endif -REGISTER_ITEM(ExtraLife, Powerup) { +CLASS(ExtraLife, Powerup) + METHOD(ExtraLife, describe, string(ExtraLife this)) + { + TC(ExtraLife, this); + return _("The Extra Life powerup acts as armor in InstaGib. " + "If a player is shot while having one or more Extra Lives, they will survive the shot but suffer strong knockback"); + } +ENDCLASS(ExtraLife) + +REGISTER_ITEM(ExtraLife, ExtraLife) { this.m_canonical_spawnfunc = "item_extralife"; #ifdef GAMEQC this.m_model = MDL_ExtraLife_ITEM; diff --git a/qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh b/qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh index 690abb5ca..dabf7f48c 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh @@ -58,5 +58,12 @@ CLASS(Invisibility, Powerups) ATTRIB(Invisibility, m_name, string, _("Invisibility")); ATTRIB(Invisibility, m_color, vector, '0.5 0.5 1'); ATTRIB(Invisibility, m_icon, string, "buff_invisible"); + METHOD(Invisibility, describe, string(Invisibility this)) + { + TC(Invisibility, this); + return _("The Invisibility powerup increases your translucency while the powerup is active, making it more difficult for enemies to see you. " + "This powerup is often present in InstaGib\n\n" + "Since it is a powerup, it will drop if you die while holding it"); + } ENDCLASS(Invisibility) REGISTER_STATUSEFFECT(Invisibility, NEW(Invisibility)); diff --git a/qcsrc/common/mutators/mutator/powerups/powerup/shield.qh b/qcsrc/common/mutators/mutator/powerups/powerup/shield.qh index de2f5dc29..4e184eb1e 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerup/shield.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerup/shield.qh @@ -55,5 +55,12 @@ CLASS(Shield, Powerups) ATTRIB(Shield, netname, string, "invincible"); // NOTE: referring to as invincible so that it matches the powerup item ATTRIB(Shield, m_name, string, _("Shield")); ATTRIB(Shield, m_icon, string, "shield"); + METHOD(Shield, describe, string(Shield this)) + { + TC(Shield, this); + return _("The Shield powerup greatly decreases the damage you take until the powerup expires, having a compounding effect with armor. " + "It also makes you more resistant to knockback\n\n" + "Since it is a powerup, it will drop if you die while holding it"); + } ENDCLASS(Shield) REGISTER_STATUSEFFECT(Shield, NEW(Shield)); diff --git a/qcsrc/common/mutators/mutator/powerups/powerup/speed.qh b/qcsrc/common/mutators/mutator/powerups/powerup/speed.qh index 38010e480..633c7b1bf 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerup/speed.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerup/speed.qh @@ -59,5 +59,12 @@ CLASS(Speed, Powerups) ATTRIB(Speed, m_name, string, _("Speed")); ATTRIB(Speed, m_color, vector, '0.1 1 0.84'); ATTRIB(Speed, m_icon, string, "buff_speed"); + METHOD(Speed, describe, string(Speed this)) + { + TC(Speed, this); + return _("The Speed powerup increases your movement speed, attack speed, and health regeneration speed while the powerup is active. " + "However, it also makes you a bit more vulnerable to incoming attacks\n\n" + "Since it is a powerup, it will drop if you die while holding it"); + } ENDCLASS(Speed) REGISTER_STATUSEFFECT(Speed, NEW(Speed)); diff --git a/qcsrc/common/mutators/mutator/powerups/powerup/strength.qh b/qcsrc/common/mutators/mutator/powerups/powerup/strength.qh index 79ef229f1..a3af05f5e 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerup/strength.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerup/strength.qh @@ -56,5 +56,13 @@ CLASS(Strength, Powerups) ATTRIB(Strength, netname, string, "strength"); ATTRIB(Strength, m_name, string, _("Strength")); ATTRIB(Strength, m_icon, string, "strength"); + METHOD(Strength, describe, string(Strength this)) + { + TC(Strength, this); + return _("The Strength powerup greatly increases the damage you deal, until the powerup expires. " + "It also increases the knockback that your attacks deal\n\n" + "The damage and knockback you deal to yourself also increases but by a smaller amount\n\n" + "Since it is a powerup, it will drop if you die while holding it"); + } ENDCLASS(Strength) REGISTER_STATUSEFFECT(Strength, NEW(Strength)); diff --git a/qcsrc/common/mutators/mutator/powerups/powerups.qh b/qcsrc/common/mutators/mutator/powerups/powerups.qh index ecd754672..745842fcc 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerups.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerups.qh @@ -16,4 +16,9 @@ CLASS(Powerups, StatusEffects) #ifdef GAMEQC ATTRIB(Powerups, m_sound_rm, Sound, SND_POWEROFF); #endif + METHOD(Powerups, describe, string(Powerups this)) + { + TC(Powerups, this); + return SUPER(Object).describe(this); + } ENDCLASS(Powerups)