X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Fitem%2Farmor.qh;h=7f37c75aec002465260b1852810253e05c6a4b11;hp=a0e4ab27713a1406e0424fa91c9f6cd782ea8e97;hb=9e113dae328809b5e7432f434649a35ebb185a52;hpb=7d33231d5c7493336efdece905890ec41793448b diff --git a/qcsrc/common/items/item/armor.qh b/qcsrc/common/items/item/armor.qh index a0e4ab277..7f37c75ae 100644 --- a/qcsrc/common/items/item/armor.qh +++ b/qcsrc/common/items/item/armor.qh @@ -18,50 +18,103 @@ ENDCLASS(Armor) MODEL(ArmorSmall_ITEM, Item_Model("item_armor_small.md3")); SOUND(ArmorSmall, Item_Sound("armor1")); #endif +#ifdef SVQC +PROPERTY(float, g_pickup_armorsmall_anyway); +PROPERTY(int, g_pickup_armorsmall); +PROPERTY(int, g_pickup_armorsmall_max); +void item_armorsmall_init(entity item) +{ + if(!item.max_armorvalue) + item.max_armorvalue = g_pickup_armorsmall_max; + if(!item.armorvalue) + item.armorvalue = g_pickup_armorsmall; +} +#endif REGISTER_ITEM(ArmorSmall, Armor) { + this.m_canonical_spawnfunc = "item_armor_small"; #ifdef GAMEQC + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_OVERKILL; this.m_model = MDL_ArmorSmall_ITEM; this.m_sound = SND_ArmorSmall; #endif + this.netname = "armor_small"; this.m_name = "5 Armor"; this.m_icon = "armor"; #ifdef SVQC this.m_itemid = IT_ARMOR_SHARD; this.m_respawntime = GET(g_pickup_respawntime_short); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_short); + this.m_pickupanyway = GET(g_pickup_armorsmall_anyway); + this.m_iteminit = item_armorsmall_init; #endif } +SPAWNFUNC_ITEM(item_armor_small, ITEM_ArmorSmall) + #ifdef GAMEQC MODEL(ArmorMedium_ITEM, Item_Model("item_armor_medium.md3")); SOUND(ArmorMedium, Item_Sound("armor10")); #endif +#ifdef SVQC +PROPERTY(float, g_pickup_armormedium_anyway); +PROPERTY(int, g_pickup_armormedium); +PROPERTY(int, g_pickup_armormedium_max); +void item_armormedium_init(entity item) +{ + if(!item.max_armorvalue) + item.max_armorvalue = g_pickup_armormedium_max; + if(!item.armorvalue) + item.armorvalue = g_pickup_armormedium; +} +#endif REGISTER_ITEM(ArmorMedium, Armor) { + this.m_canonical_spawnfunc = "item_armor_medium"; #ifdef GAMEQC + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_OVERKILL; this.m_model = MDL_ArmorMedium_ITEM; this.m_sound = SND_ArmorMedium; #endif + this.netname = "armor_medium"; this.m_name = "25 Armor"; this.m_icon = "armor"; #ifdef SVQC this.m_itemid = IT_ARMOR; this.m_respawntime = GET(g_pickup_respawntime_medium); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_medium); + this.m_pickupanyway = GET(g_pickup_armormedium_anyway); + this.m_iteminit = item_armormedium_init; #endif } +SPAWNFUNC_ITEM(item_armor_medium, ITEM_ArmorMedium) + #ifdef GAMEQC MODEL(ArmorBig_ITEM, Item_Model("item_armor_big.md3")); SOUND(ArmorBig, Item_Sound("armor17_5")); #endif +#ifdef SVQC +PROPERTY(float, g_pickup_armorbig_anyway); +PROPERTY(int, g_pickup_armorbig); +PROPERTY(int, g_pickup_armorbig_max); +void item_armorbig_init(entity item) +{ + if(!item.max_armorvalue) + item.max_armorvalue = g_pickup_armorbig_max; + if(!item.armorvalue) + item.armorvalue = g_pickup_armorbig; +} +#endif REGISTER_ITEM(ArmorBig, Armor) { + this.m_canonical_spawnfunc = "item_armor_big"; #ifdef GAMEQC + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_OVERKILL; this.m_model = MDL_ArmorBig_ITEM; this.m_sound = SND_ArmorBig; #endif + this.netname = "armor_big"; this.m_name = "50 Armor"; this.m_icon = "armor"; this.m_color = '0 1 0'; @@ -70,19 +123,38 @@ REGISTER_ITEM(ArmorBig, Armor) { this.m_itemid = IT_ARMOR; this.m_respawntime = GET(g_pickup_respawntime_long); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_long); + this.m_pickupanyway = GET(g_pickup_armorbig_anyway); + this.m_iteminit = item_armorbig_init; #endif } +SPAWNFUNC_ITEM(item_armor_big, ITEM_ArmorBig) + #ifdef GAMEQC MODEL(ArmorMega_ITEM, Item_Model("item_armor_large.md3")); SOUND(ArmorMega, Item_Sound("armor25")); #endif +#ifdef SVQC +PROPERTY(float, g_pickup_armormega_anyway); +PROPERTY(int, g_pickup_armormega); +PROPERTY(int, g_pickup_armormega_max); +void item_armormega_init(entity item) +{ + if(!item.max_armorvalue) + item.max_armorvalue = g_pickup_armormega_max; + if(!item.armorvalue) + item.armorvalue = g_pickup_armormega; +} +#endif REGISTER_ITEM(ArmorMega, Armor) { + this.m_canonical_spawnfunc = "item_armor_mega"; #ifdef GAMEQC + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_OVERKILL; this.m_model = MDL_ArmorMega_ITEM; this.m_sound = SND_ArmorMega; #endif + this.netname = "armor_mega"; this.m_name = "100 Armor"; this.m_icon = "item_large_armor"; this.m_color = '0 1 0'; @@ -93,5 +165,9 @@ REGISTER_ITEM(ArmorMega, Armor) { this.m_itemid = IT_ARMOR; this.m_respawntime = GET(g_pickup_respawntime_long); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_long); + this.m_pickupanyway = GET(g_pickup_armormega_anyway); + this.m_iteminit = item_armormega_init; #endif } + +SPAWNFUNC_ITEM(item_armor_mega, ITEM_ArmorMega)