26 this.SendFlags |= ISF_LOCATION;
49 wep.owner = wep.enemy = own;
50 wep.flags |= FL_TOSSED;
51 wep.colormap = own.colormap;
52 wep.glowmod = weaponentity_glowmod(info, own, own.clientcolors, own.(weaponentity));
60 if(own.items & IT_UNLIMITED_SUPERWEAPONS)
67 FOREACH(Weapons, it != WEP_Null, {
69 if((
set & WEPSET_SUPERWEAPONS) && (STAT(WEAPONS, own) &
set)) ++superweapons;
73 wep.superweapons_finished = StatusEffects_gettime(STATUSEFFECT_Superweapons, own);
78 float timeleft = StatusEffects_gettime(STATUSEFFECT_Superweapons, own) -
time;
79 float weptimeleft = timeleft / superweapons;
80 wep.superweapons_finished =
time + weptimeleft;
84 own.statuseffects.statuseffect_time[STATUSEFFECT_Superweapons.m_id] -= weptimeleft;
85 StatusEffects_update(own);
95 wep.savenextthink = wep.nextthink;
96 wep.nextthink =
min(wep.nextthink,
time + 0.5);
97 wep.pickup_anyway =
true;
100 if(ammotype == RES_NONE)
109 int i = own.(weaponentity).m_weapon.m_id;
110 if(own.(weaponentity).(weapon_load[i]) > 0)
112 GiveResource(own, ammotype, own.(weaponentity).(weapon_load[i]));
120 int i = own.(weaponentity).m_weapon.m_id;
121 if(own.(weaponentity).(weapon_load[i]) > 0)
123 GiveResource(own, ammotype, own.(weaponentity).(weapon_load[i]));
146 if (w == WEP_Null.m_id)
155 Weapon w = this.(weaponentity).m_weapon;
158 if (
time < game_starttime)
164 if(this.(weaponentity).state !=
WS_READY)
170 if(!(STAT(WEAPONS,
this) &
set))
return;
171 STAT(WEAPONS,
this) &= ~set;
177 Send_Notification(NOTIF_ONE,
this, MSG_MULTI, ITEM_WEAPON_DROP, w.
m_id, a);
void weapon_defaultspawnfunc(entity this, Weapon wpn)
WepSet WEPSET_SUPERWEAPONS
float weapon_load[REGISTRY_MAX(Weapons)]
float autocvar_g_balance_superweapons_time
void W_SwitchWeapon_Force(Player this, Weapon w,.entity weaponentity)
Header file that describes the resource system.
#define w_getbestweapon(ent, wepent)
void SUB_VanishOrRemove(entity ent)
#define REGISTRY_GET(id, i)
void navigation_dynamicgoal_init(entity this, bool initially_static)
void W_ThrowWeapon(entity this,.entity weaponentity, vector velo, vector delta, float doreduce)
const int WS_READY
idle frame
void W_DropEvent(.void(Weapon, entity actor,.entity) event, entity player, float weapon_type, entity weapon_item,.entity weaponentity)
Effect is being forcibly removed without calling any additional mechanics.
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
Resource ammo_type
M: ammotype : main ammo type.
float W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo,.entity weaponentity)
void SpawnThrownWeapon(entity this, vector org, Weapon wep,.entity weaponentity)
void thrown_wep_think(entity this)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
void GiveResource(entity receiver, Resource res_type, float amount)
Gives an entity some resource.
bool W_IsWeaponThrowable(entity this, int w)
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
#define MUTATOR_CALLHOOK(id,...)
void SUB_SetFade(entity ent, float vanish_time, float fading_time)
bool autocvar_g_weapon_throwable
int autocvar_g_pickup_items
#define WepSet_FromWeapon(it)
Header file that describes the functions related to game items.
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
void Item_SetExpiring(entity item, bool expiring)
Sets the item expiring status (i.e.
#define FOREACH(list, cond, body)
void Item_SetLoot(entity item, bool loot)
Sets the item loot status.