X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Fitem%2Fammo.qh;h=d7c3e9408c3e6786874eec9656d5f5ecde99f572;hb=1e8a03349941343726e0ab7fc2dc77b612c26968;hp=41e2ac831c25b1dca2e7b1a54d635cf9864eb666;hpb=6e12e42c14caa13f188ad12ce1fce1358428bee4;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/item/ammo.qh b/qcsrc/common/items/item/ammo.qh index 41e2ac831..d7c3e9408 100644 --- a/qcsrc/common/items/item/ammo.qh +++ b/qcsrc/common/items/item/ammo.qh @@ -1,9 +1,99 @@ -#ifndef AMMO_H -#define AMMO_H +#pragma once + #include "pickup.qh" +#ifdef SVQC +PROPERTY(float, g_pickup_ammo_anyway); +#endif + CLASS(Ammo, Pickup) #ifdef SVQC - ATTRIB(Ammo, m_pickupevalfunc, float(entity player, entity item), commodity_pickupevalfunc) + ATTRIB(Ammo, m_pickupevalfunc, float(entity player, entity item), ammo_pickupevalfunc); + ATTRIB(Ammo, m_respawntime, float(), GET(g_pickup_respawntime_ammo)); + ATTRIB(Ammo, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_ammo)); + ATTRIB(Ammo, m_pickupanyway, float(), GET(g_pickup_ammo_anyway)); #endif ENDCLASS(Ammo) + +#ifdef SVQC + #include +#endif + +#ifdef GAMEQC +MODEL(Bullets_ITEM, Item_Model("a_bullets.mdl")); +#endif + +REGISTER_ITEM(Bullets, Ammo) { +#ifdef GAMEQC + this.m_model = MDL_Bullets_ITEM; +#endif + this.m_name = "bullets"; + this.m_icon = "ammo_bullets"; +#ifdef SVQC + this.m_botvalue = 1500; + this.m_itemid = IT_NAILS; +#endif +} + +#ifdef GAMEQC +MODEL(Cells_ITEM, Item_Model("a_cells.md3")); +#endif + +REGISTER_ITEM(Cells, Ammo) { +#ifdef GAMEQC + this.m_model = MDL_Cells_ITEM; +#endif + this.m_name = "cells"; + this.m_icon = "ammo_cells"; +#ifdef SVQC + this.m_botvalue = 1500; + this.m_itemid = IT_CELLS; +#endif +} + +#ifdef GAMEQC +MODEL(Plasma_ITEM, Item_Model("a_cells.md3")); +#endif + +REGISTER_ITEM(Plasma, Ammo) { +#ifdef GAMEQC + this.m_model = MDL_Plasma_ITEM; +#endif + this.m_name = "plasma"; + this.m_icon = "ammo_plasma"; +#ifdef SVQC + this.m_botvalue = 1500; + this.m_itemid = IT_PLASMA; +#endif +} + +#ifdef GAMEQC +MODEL(Rockets_ITEM, Item_Model("a_rockets.md3")); +#endif + +REGISTER_ITEM(Rockets, Ammo) { +#ifdef GAMEQC + this.m_model = MDL_Rockets_ITEM; +#endif + this.m_name = "rockets"; + this.m_icon = "ammo_rockets"; +#ifdef SVQC + this.m_botvalue = 1500; + this.m_itemid = IT_ROCKETS; +#endif +} + +#ifdef GAMEQC +MODEL(Shells_ITEM, Item_Model("a_shells.md3")); +#endif + +REGISTER_ITEM(Shells, Ammo) { +#ifdef GAMEQC + this.m_model = MDL_Shells_ITEM; +#endif + this.m_name = "shells"; + this.m_icon = "ammo_shells"; +#ifdef SVQC + this.m_botvalue = 1000; + this.m_itemid = IT_SHELLS; #endif +}