void SpawnThrownWeapon (vector org, float w)
{
- if(g_pinata)
- {
- float j;
- for(j = WEP_FIRST; j <= WEP_LAST; ++j)
- {
- if(WEPSET_CONTAINS_EW(self, j))
- if(W_IsWeaponThrowable(j))
- W_ThrowNewWeapon(self, j, FALSE, org, randomvec() * 175 + '0 0 325');
- }
- }
- else
- {
- if(WEPSET_CONTAINS_EW(self, self.weapon))
- if(W_IsWeaponThrowable(self.weapon))
- W_ThrowNewWeapon(self, self.weapon, FALSE, org, randomvec() * 125 + '0 0 200');
- }
+ if(WEPSET_CONTAINS_EW(self, self.weapon))
+ if(W_IsWeaponThrowable(self.weapon))
+ W_ThrowNewWeapon(self, self.weapon, FALSE, org, randomvec() * 125 + '0 0 200');
}
void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
// Globals
-float g_cloaked, g_footsteps, g_jump_grunt, g_grappling_hook, g_midair, g_minstagib, g_pinata, g_norecoil, g_bloodloss;
+float g_cloaked, g_footsteps, g_jump_grunt, g_grappling_hook, g_midair, g_minstagib, g_norecoil, g_bloodloss;
float g_warmup_limit;
float g_warmup_allguns;
float g_warmup_allow_timeout;
if (g_weaponarena)
{
- g_pinata = 0; // incompatible
g_weapon_stay = 0; // incompatible
WEPSET_COPY_AA(start_weapons, g_weaponarena_weapons);
start_items |= IT_UNLIMITED_AMMO;
CHECK_MUTATOR_ADD("g_rocket_flying", mutator_rocketflying, !cvar("g_minstagib"));
CHECK_MUTATOR_ADD("g_vampire", mutator_vampire, !cvar("g_minstagib"));
CHECK_MUTATOR_ADD("g_superspectate", mutator_superspec, 1);
+ CHECK_MUTATOR_ADD("g_pinata", mutator_pinata, !cvar("g_minstagib"));
CHECK_MUTATOR_ADD("g_sandbox", sandbox, 1);
#undef CHECK_MUTATOR_ADD
g_pickup_ammo_anyway = cvar("g_pickup_ammo_anyway");
g_pickup_weapons_anyway = cvar("g_pickup_weapons_anyway");
- g_pinata = cvar("g_pinata");
-
g_weapon_stay = cvar(strcat("g_", GetGametype(), "_weapon_stay"));
if(!g_weapon_stay)
g_weapon_stay = cvar("g_weapon_stay");
--- /dev/null
+MUTATOR_HOOKFUNCTION(pinata_PlayerDies)
+{
+ float j;
+ for(j = WEP_FIRST; j <= WEP_LAST; ++j)
+ if(WEPSET_CONTAINS_EW(self, j))
+ if(self.switchweapon != j)
+ if(W_IsWeaponThrowable(j))
+ W_ThrowNewWeapon(self, j, FALSE, self.origin + (self.mins + self.maxs) * 0.5, randomvec() * 175 + '0 0 325');
+
+ return TRUE;
+}
+
+MUTATOR_HOOKFUNCTION(pinata_BuildMutatorsString)
+{
+ ret_string = strcat(ret_string, ":Pinata");
+ return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(pinata_BuildMutatorsPrettyString)
+{
+ ret_string = strcat(ret_string, ", Piñata");
+ return FALSE;
+}
+
+MUTATOR_DEFINITION(mutator_pinata)
+{
+ MUTATOR_HOOK(PlayerDies, pinata_PlayerDies, CBC_ORDER_ANY);
+ MUTATOR_HOOK(BuildMutatorsString, pinata_BuildMutatorsString, CBC_ORDER_ANY);
+ MUTATOR_HOOK(BuildMutatorsPrettyString, pinata_BuildMutatorsPrettyString, CBC_ORDER_ANY);
+
+ return FALSE;
+}
MUTATOR_DECLARATION(mutator_superspec);
MUTATOR_DECLARATION(mutator_minstagib);
MUTATOR_DECLARATION(mutator_touchexplode);
+MUTATOR_DECLARATION(mutator_pinata);
MUTATOR_DECLARATION(sandbox);
mutators/mutator_superspec.qc
mutators/mutator_minstagib.qc
mutators/mutator_touchexplode.qc
+mutators/mutator_pinata.qc
../warpzonelib/anglestransform.qc
../warpzonelib/mathlib.qc
modifications = strcat(modifications, ", Hook");
if(g_midair)
modifications = strcat(modifications, ", Midair");
- if(g_pinata)
- modifications = strcat(modifications, ", Piñata");
if(g_weapon_stay && !g_cts)
modifications = strcat(modifications, ", Weapons stay");
if(g_bloodloss > 0)