Merge branch 'master' into Mario/vaporizer_damage
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_pinata.qc
1 #include "../_all.qh"
2
3 #include "mutator.qh"
4
5 MUTATOR_HOOKFUNCTION(pinata_PlayerDies)
6 {
7         float j;
8         for(j = WEP_FIRST; j <= WEP_LAST; ++j)
9         if(self.weapons & WepSet_FromWeapon(j))
10         if(self.switchweapon != j)
11         if(W_IsWeaponThrowable(j))
12                 W_ThrowNewWeapon(self, j, false, self.origin + (self.mins + self.maxs) * 0.5, randomvec() * 175 + '0 0 325');
13
14         return true;
15 }
16
17 MUTATOR_HOOKFUNCTION(pinata_BuildMutatorsString)
18 {
19         ret_string = strcat(ret_string, ":Pinata");
20         return false;
21 }
22
23 MUTATOR_HOOKFUNCTION(pinata_BuildMutatorsPrettyString)
24 {
25         ret_string = strcat(ret_string, ", PiƱata");
26         return false;
27 }
28
29 MUTATOR_DEFINITION(mutator_pinata)
30 {
31         MUTATOR_HOOK(PlayerDies, pinata_PlayerDies, CBC_ORDER_ANY);
32         MUTATOR_HOOK(BuildMutatorsString, pinata_BuildMutatorsString, CBC_ORDER_ANY);
33         MUTATOR_HOOK(BuildMutatorsPrettyString, pinata_BuildMutatorsPrettyString, CBC_ORDER_ANY);
34
35         return false;
36 }