#pragma once
#include "all.qh"
-#include "item/pickup.qh"
CLASS(Inventory, Object)
/** Stores counts of items, the id being the index */
if (!(minorBits & BIT(j))) { \
continue; \
} \
- const GameItem it = Items_from(Inventory_groups_minor * maj + j); \
+ const entity it = Items_from(Inventory_groups_minor * maj + j); \
WriteByte(MSG_ENTITY, data.inv_items[it.m_id]); \
} \
} \
#pragma once
-#include <common/t_items.qh>
#ifdef GAMEQC
+#include <common/models/all.qh>
#include <common/sounds/all.qh>
#include <common/sounds/all.inc>
+#include <common/stats.qh>
#endif
const int IT_UNLIMITED_WEAPON_AMMO = BIT(0); // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
#include <common/t_items.qh>
#endif
+.int ammo_none;
+.int ammo_shells;
+.int ammo_nails;
+.int ammo_rockets;
+.int ammo_cells;
+#ifdef SVQC
+.int ammo_plasma = _STAT(PLASMA);
+.int ammo_fuel = _STAT(FUEL);
+#else
+.int ammo_plasma;
+.int ammo_fuel;
+#endif
+
#ifdef SVQC
PROPERTY(float, g_pickup_ammo_anyway);
#endif
#include "pickup.qh"
+#include <common/items/inventory.qh>
#ifdef SVQC
bool ITEM_HANDLE(Pickup, entity this, entity item, entity player) {
return this.giveTo(this, item, player);
}
+
+METHOD(Pickup, giveTo, bool(Pickup this, entity item, entity player))
+{
+ TC(Pickup, this);
+ bool b = Item_GiveTo(item, player);
+ if (b) {
+ LOG_DEBUGF("entity %i picked up %s", player, this.m_name);
+ player.inventory.inv_items[this.m_id]++;
+ Inventory_update(player);
+ }
+ return b;
+}
+
#endif
PROPERTY(float, g_pickup_respawntimejitter_powerup)
#endif
-#include <common/items/inventory.qh>
#include <common/items/item.qh>
-#include <common/t_items.qh>
-
-#ifdef GAMEQC
-#include <common/models/all.qh>
-#include <common/sounds/all.qh>
-#include <common/sounds/all.inc>
-#endif
CLASS(Pickup, GameItem)
#ifdef GAMEQC
ATTRIB(Pickup, m_pickupanyway, float());
ATTRIB(Pickup, m_iteminit, void(entity item));
float Item_GiveTo(entity item, entity player);
- METHOD(Pickup, giveTo, bool(Pickup this, entity item, entity player))
- {
- TC(Pickup, this);
- bool b = Item_GiveTo(item, player);
- if (b) {
- LOG_DEBUGF("entity %i picked up %s", player, this.m_name);
- player.inventory.inv_items[this.m_id]++;
- Inventory_update(player);
- }
- return b;
- }
+ METHOD(Pickup, giveTo, bool(Pickup this, entity item, entity player));
bool ITEM_HANDLE(Pickup, Pickup this, entity item, entity player);
#endif
ENDCLASS(Pickup)
#pragma once
+#include <common/weapons/all.qh>
+
CLASS(HeavyMachineGun, Weapon)
/* spawnfunc */ ATTRIB(HeavyMachineGun, m_canonical_spawnfunc, string, "weapon_hmg");
/* ammotype */ ATTRIB(HeavyMachineGun, ammo_type, int, RESOURCE_BULLETS);
#pragma once
+#include <common/weapons/all.qh>
+
CLASS(RocketPropelledChainsaw, Weapon)
/* spawnfunc */ ATTRIB(RocketPropelledChainsaw, m_canonical_spawnfunc, string, "weapon_rpc");
/* ammotype */ ATTRIB(RocketPropelledChainsaw, ammo_type, int, RESOURCE_ROCKETS);
.Weapon ok_lastwep[MAX_WEAPONSLOTS];
-void ok_Initialize();
-
REGISTER_MUTATOR(ok, expr_evaluate(autocvar_g_overkill) && !cvar("g_instagib") && !g_nexball && cvar_string("g_mod_balance") == "Overkill")
{
MUTATOR_ONADD
{
- ok_Initialize();
+ precache_all_playermodels("models/ok_player/*.dpm");
+
+ WEP_RPC.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+ WEP_HMG.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+
+ WEP_SHOTGUN.mdl = "ok_shotgun";
+ WEP_MACHINEGUN.mdl = "ok_mg";
+ WEP_VORTEX.mdl = "ok_sniper";
}
MUTATOR_ONREMOVE
M_ARGV(0, string) = "Overkill";
return true;
}
-
-void ok_Initialize()
-{
- precache_all_playermodels("models/ok_player/*.dpm");
-
- WEP_RPC.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
- WEP_HMG.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
-
- WEP_SHOTGUN.mdl = "ok_shotgun";
- WEP_MACHINEGUN.mdl = "ok_mg";
- WEP_VORTEX.mdl = "ok_sniper";
-}
#ifdef SVQC
#include "physics/movetypes/movetypes.qh"
+float warmup_limit;
#endif
REGISTER_STAT(MOVEVARS_AIRACCEL_QW_STRETCHFACTOR, float)
#pragma once
-#ifdef SVQC
-#include <server/defs.qh>
-#endif
-
const int AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel
// item networking
/** idle frame */
const int WS_READY = 4;
-#ifdef SVQC
-.int ammo_shells;
-.int ammo_nails;
-.int ammo_rockets;
-.int ammo_cells;
-.int ammo_plasma = _STAT(PLASMA);
-.int ammo_fuel = _STAT(FUEL);
-.int ammo_none;
-#else
-.int ammo_shells;
-.int ammo_nails;
-.int ammo_rockets;
-.int ammo_cells;
-.int ammo_plasma;
-.int ammo_fuel;
-.int ammo_none;
-#endif
-
/** fields which are explicitly/manually set are marked with "M", fields set automatically are marked with "A" */
CLASS(Weapon, Object)
ATTRIB(Weapon, m_id, int, 0);
#include "quake2.qh"
+#include <common/items/_mod.qh>
+
//***********************
//QUAKE 2 ENTITIES - So people can play quake2 maps with the xonotic weapons
//***********************
#pragma once
-float warmup_limit;
#include <common/weapons/_all.qh>
#include <common/stats.qh>
/// game items.
/// \copyright GNU GPLv2 or any later version.
-#include <common/mutators/mutator/instagib/sv_instagib.qh>
-#include <common/mutators/mutator/overkill/hmg.qh>
-#include <common/mutators/mutator/overkill/rpc.qh>
+#include "g_subs.qh"
+#include <common/weapons/all.qh>
.bool m_isloot; ///< Holds whether item is loot.
/// \brief Header file that describes the functions related to game items.
/// \copyright GNU GPLv2 or any later version.
-#pragma once
-
/// \brief Creates a new item.
/// \param[in] class_name Class name of the item.
/// \param[in] position Position of the item.