X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fserver%2Fitems%2Fitems.qh;h=7a472aa94cd7f9ccbec9ab96548ca71f508a1227;hb=5dc828e3b59c65f75c870d4a57e34c023cdbdb86;hp=406f424fa34e9860e5ab1ce3bbbeb99a02ad8634;hpb=0b9df86c9a55dd9ed9031b21e430fc3094fac709;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/items/items.qh b/qcsrc/server/items/items.qh index 406f424fa..7a472aa94 100644 --- a/qcsrc/server/items/items.qh +++ b/qcsrc/server/items/items.qh @@ -2,6 +2,14 @@ #include +float autocvar_g_balance_superweapons_time; +bool autocvar_g_fullbrightitems; +float autocvar_g_items_mindist; +float autocvar_g_items_maxdist; +int autocvar_g_pickup_items; +bool autocvar_g_nodepthtestitems; +#define autocvar_g_weapon_stay cvar("g_weapon_stay") + void StartItem(entity this, entity a); .int item_group; .int item_group_count; @@ -13,11 +21,26 @@ bool have_pickup_item(entity this); const float ITEM_RESPAWN_TICKS = 10; +// string overrides entity +.string item_pickupsound; +.entity item_pickupsound_ent; +.entity item_model_ent; + .float max_armorvalue; .float pickup_anyway; +.int count; + +.float scheduledrespawntime; +.float respawntime; +.float respawntimejitter; +.float respawntimestart; .float item_respawncounter; +.float noalign; // if set to 1, the item or spawnpoint won't be dropped to the floor + +.float superweapons_finished; // NOTE: this field is used only by map entities, it does not directly apply the superweapons stat + // delay before this item can be picked up .float item_spawnshieldtime; @@ -86,12 +109,20 @@ spawnfunc(target_items); #define PREGIVE_WEAPONS(e) WepSet save_weapons; save_weapons = STAT(WEAPONS, e) #define PREGIVE(e,f) float save_##f; save_##f = (e).f +#define PREGIVE_STATUSEFFECT(e,f) bool save_##f = StatusEffects_active(f, (e)) #define PREGIVE_RESOURCE(e,f) float save_##f = GetResource((e), (f)) #define POSTGIVE_WEAPON(e,b,snd_incr,snd_decr) GiveSound((e), !!(save_weapons & WepSet_FromWeapon(b)), !!(STAT(WEAPONS, e) & WepSet_FromWeapon(b)), 0, snd_incr, snd_decr) #define POSTGIVE_BIT(e,f,b,snd_incr,snd_decr) GiveSound((e), save_##f & (b), (e).f & (b), 0, snd_incr, snd_decr) +#define POSTGIVE_STATUSEFFECT(e,f,snd_incr,snd_decr) GiveSound((e), save_##f, StatusEffects_active(f, (e)), 0, snd_incr, snd_decr) #define POSTGIVE_RESOURCE(e,f,t,snd_incr,snd_decr) GiveSound((e), save_##f, GetResource((e), (f)), t, snd_incr, snd_decr) #define POSTGIVE_RES_ROT(e,f,t,rotfield,rottime,regenfield,regentime,snd_incr,snd_decr) GiveRot((e),save_##f,GetResource((e),(f)),rotfield,rottime,regenfield,regentime);GiveSound((e),save_##f,GetResource((e),(f)),t,snd_incr,snd_decr) #define POSTGIVE_VALUE(e,f,t,snd_incr,snd_decr) GiveSound((e), save_##f, (e).f, t, snd_incr, snd_decr) #define POSTGIVE_VALUE_ROT(e,f,t,rotfield,rottime,regenfield,regentime,snd_incr,snd_decr) GiveRot((e), save_##f, (e).f, rotfield, rottime, regenfield, regentime); GiveSound((e), save_##f, (e).f, t, snd_incr, snd_decr) float GiveItems(entity e, float beginarg, float endarg); + +IntrusiveList g_items; +STATIC_INIT(g_items) { g_items = IL_NEW(); } + +#define ITEM_TOUCH_NEEDKILL() (((trace_dpstartcontents | trace_dphitcontents) & DPCONTENTS_NODROP) || (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)) +#define ITEM_DAMAGE_NEEDKILL(dt) (((dt) == DEATH_HURTTRIGGER.m_id) || ((dt) == DEATH_SLIME.m_id) || ((dt) == DEATH_LAVA.m_id) || ((dt) == DEATH_SWAMP.m_id))