30{
31 wpn = wpn.m_spawnfunc_hookreplace(wpn, this);
32 this.
classname = wpn.m_canonical_spawnfunc;
34 {
36 {
37
39 return;
40 }
41
45 if (s == "")
46 {
47 delete(this);
49 return;
50 }
52 if (t >= 2)
53 {
55 for (int i = 1; i < t; ++i)
56 {
59 if (wep != WEP_Null)
60 {
63 replacement.m_isreplaced = true;
65 }
66 }
67 }
68 if (t >= 1)
69 {
72 }
73 if (wpn == WEP_Null)
74 {
75 delete(this);
77 return;
78 }
79 }
80
83
85 {
86 delete(this);
88 return;
89 }
90
92 {
94 {
97 }
98 else
99 {
102 }
103 }
104
106 && !this.superweapons_finished)
108
109
110
111 if (wpn.ammo_type != RES_NONE && !
GetResource(
this, wpn.ammo_type))
114
115 #if 0
116 if (wpn.items)
117 for (int i = 0, j = 1; i < 24; ++i, j <<= 1)
118 if (wpn.items & j)
119 {
120 ammotype = Item_CounterField(j);
121 if (!this.ammotype)
122 this.ammotype =
cvar(
strcat(
"g_pickup_", Item_CounterFieldName(j),
"_weapon"));
123 }
124 #endif
125
126
129
132 else
134
136
137 #if 0
139 wpn.wr_init(wpn);
140 #endif
141}
#define MUTATOR_CALLHOOK(id,...)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
#define colormapPaletteColor(c, isPants)
vector weaponsInMapAll
all the weapons placed by the mapper (weaponreplace applied), ignores most filters
bool Item_IsDefinitionAllowed(entity definition)
Checks whether the items with the specified definition are allowed to spawn.
#define ITEM_IS_LOOT(item)
Returns whether the item is loot.
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
void Item_CopyFields(entity this, entity to)
void StartItem(entity this, entity def)
float autocvar_g_balance_superweapons_time
float superweapons_finished
int GetAmmoConsumption(entity wpn)
Returns ammo consumed per shot by the primary/default fire mode.
#define WEP_CVAR(wep, name)
#define WepSet_FromWeapon(it)
bool m_isreplaced
Holds whether the weapon has been replaced.
string W_Apply_Weaponreplace(string in)
float autocvar_g_pickup_respawntimejitter_weapon
bool autocvar_g_pickup_weapons_anyway
float autocvar_g_pickup_respawntimejitter_superweapon
float autocvar_g_pickup_respawntime_weapon
float autocvar_g_pickup_respawntime_superweapon
void weapon_defaultspawnfunc(entity this, Weapon e)
const int WEP_FLAG_SUPERWEAPON
const int WEP_FLAG_MUTATORBLOCKED