]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mutators/mutator/instagib/items.qh
Added ITEM_FLAG_OVERKILL.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / instagib / items.qh
1 #pragma once
2
3 #include <common/items/_mod.qh>
4 #include <common/items/item/ammo.qh>
5 #include <common/items/item/powerup.qh>
6
7 float instagib_respawntime_ammo = 45;
8 float instagib_respawntimejitter_ammo = 0;
9 GETTER(float, instagib_respawntime_ammo)
10 GETTER(float, instagib_respawntimejitter_ammo)
11
12 #ifdef GAMEQC
13 MODEL(VaporizerCells_ITEM, Item_Model("a_cells.md3"));
14 SOUND(VaporizerCells, Item_Sound("itempickup"));
15 #endif
16
17 #ifdef SVQC
18 int autocvar_g_instagib_ammo_drop;
19 void ammo_vaporizercells_init(entity item)
20 {
21     if(!item.ammo_cells)
22         item.ammo_cells = autocvar_g_instagib_ammo_drop;
23 }
24 #endif
25 REGISTER_ITEM(VaporizerCells, Ammo) {
26     this.m_canonical_spawnfunc = "item_vaporizer_cells";
27 #ifdef GAMEQC
28     this.spawnflags = ITEM_FLAG_INSTAGIB | ITEM_FLAG_MUTATORBLOCKED;
29     this.m_model                =   MDL_VaporizerCells_ITEM;
30     this.m_sound                =   SND_VaporizerCells;
31 #endif
32     this.netname                =   "vaporizer_cells";
33     this.m_name                 =   "Vaporizer Ammo";
34     this.m_icon                 =   "ammo_supercells";
35 #ifdef SVQC
36     this.m_botvalue             =   2000;
37     this.m_itemid               =   IT_CELLS;
38     this.m_respawntime          =   GET(instagib_respawntime_ammo);
39     this.m_respawntimejitter    =   GET(instagib_respawntimejitter_ammo);
40     this.m_iteminit             =   ammo_vaporizercells_init;
41 #endif
42 }
43
44 SPAWNFUNC_ITEM(item_vaporizer_cells, ITEM_VaporizerCells)
45 SPAWNFUNC_ITEM(item_minst_cells, ITEM_VaporizerCells)
46
47 #ifdef GAMEQC
48 MODEL(ExtraLife_ITEM, Item_Model("g_h100.md3"));
49 SOUND(ExtraLife, Item_Sound("megahealth"));
50 #endif
51
52 REGISTER_ITEM(ExtraLife, Powerup) {
53     this.m_canonical_spawnfunc = "item_extralife";
54 #ifdef GAMEQC
55         this.spawnflags = ITEM_FLAG_INSTAGIB;
56     this.m_model                =   MDL_ExtraLife_ITEM;
57     this.m_sound                =   SND_ExtraLife;
58 #endif
59     this.netname                =   "extralife";
60     this.m_name                 =   "Extra life";
61     this.m_icon                 =   "item_mega_health";
62     this.m_color                =   '1 0 0';
63     this.m_waypoint             =   _("Extra life");
64     this.m_waypointblink        =   2;
65     this.m_itemid               =   IT_NAILS;
66 }
67
68 SPAWNFUNC_ITEM(item_extralife, ITEM_ExtraLife)
69
70 #ifdef GAMEQC
71 MODEL(Invisibility_ITEM, Item_Model("g_strength.md3"));
72 SOUND(Invisibility, Item_Sound("powerup"));
73 #endif
74
75 #ifdef SVQC
76 /// \brief Initializes the invisibility powerup.
77 /// \param[in,out] item Item to initialize.
78 /// \return No return.
79 void powerup_invisibility_init(entity item);
80 #endif
81
82 REGISTER_ITEM(Invisibility, Powerup) {
83     this.m_canonical_spawnfunc = "item_invisibility";
84 #ifdef GAMEQC
85         this.spawnflags = ITEM_FLAG_INSTAGIB;
86     this.m_model            =   MDL_Invisibility_ITEM;
87     this.m_sound            =   SND_Invisibility;
88     this.m_glow             =   true;
89     this.m_respawnsound     =   SND_STRENGTH_RESPAWN;
90 #endif
91     this.netname            =   "invisibility";
92     this.m_name             =   "Invisibility";
93     this.m_icon             =   "strength";
94     this.m_color            =   '0 0 1';
95     this.m_waypoint         =   _("Invisibility");
96     this.m_waypointblink    =   2;
97     this.m_itemid           =   IT_STRENGTH;
98 #ifdef SVQC
99     this.m_iteminit         =   powerup_invisibility_init;
100 #endif
101 }
102
103 SPAWNFUNC_ITEM(item_invisibility, ITEM_Invisibility)
104
105 #ifdef GAMEQC
106 MODEL(Speed_ITEM, Item_Model("g_invincible.md3"));
107 SOUND(Speed, Item_Sound("powerup_shield"));
108 #endif
109
110 #ifdef SVQC
111 /// \brief Initializes the speed powerup.
112 /// \param[in,out] item Item to initialize.
113 /// \return No return.
114 void powerup_speed_init(entity item);
115 #endif
116
117 REGISTER_ITEM(Speed, Powerup) {
118     this.m_canonical_spawnfunc = "item_speed";
119 #ifdef GAMEQC
120         this.spawnflags = ITEM_FLAG_INSTAGIB;
121     this.m_model            =   MDL_Speed_ITEM;
122     this.m_sound            =   SND_Speed;
123     this.m_glow             =   true;
124     this.m_respawnsound     =   SND_SHIELD_RESPAWN;
125 #endif
126     this.netname            =   "speed";
127     this.m_name             =   "Speed";
128     this.m_icon             =   "shield";
129     this.m_color            =   '1 0 1';
130     this.m_waypoint         =   _("Speed");
131     this.m_waypointblink    =   2;
132     this.m_itemid           =   IT_INVINCIBLE;
133 #ifdef SVQC
134     this.m_iteminit         =   powerup_speed_init;
135 #endif
136 }
137
138 SPAWNFUNC_ITEM(item_speed, ITEM_Speed)