]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/mutator_vampire.qc
Merge branch 'master' into terencehill/ca_arena_mutators
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_vampire.qc
1 MUTATOR_HOOKFUNCTION(vampire_PlayerDamage)
2 {
3         if(time < self.spawnshieldtime)
4                 return 0;
5         if(g_minstagib)
6         {
7                 // minstagib: each hit means +1 ammo
8                 frag_attacker.ammo_cells += 2; // note: 1 cell was deducted for the shot
9         }
10         else
11         {
12                 // otherwise: each hit gets damage back
13                 frag_attacker.health = frag_attacker.health + bound(0, damage_take, self.health);
14         }
15         return 0;
16 }
17
18 MUTATOR_HOOKFUNCTION(vampire_BuildMutatorsString)
19 {
20         ret_string = strcat(ret_string, ":Vampire");
21         return 0;
22 }
23
24 MUTATOR_HOOKFUNCTION(vampire_BuildMutatorsPrettyString)
25 {
26         ret_string = strcat(ret_string, ", Vampire");
27         return 0;
28 }
29
30 MUTATOR_DEFINITION(mutator_vampire)
31 {
32         MUTATOR_HOOK(PlayerDamage_SplitHealthArmor, vampire_PlayerDamage, CBC_ORDER_ANY);
33         MUTATOR_HOOK(BuildMutatorsString, vampire_BuildMutatorsString, CBC_ORDER_ANY);
34         MUTATOR_HOOK(BuildMutatorsPrettyString, vampire_BuildMutatorsPrettyString, CBC_ORDER_ANY);
35
36         return 0;
37 }