]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/mutator_invincibleproj.qc
mutator_invincibleproj.qc: Add a mutator (like g_rocketflying) which allows projectil...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_invincibleproj.qc
1 MUTATOR_HOOKFUNCTION(invincibleprojectiles_EditProjectile)
2 {
3         if(other.health)
4         {
5                 // disable health which in effect disables damage calculations
6                 other.health = 0;
7         }
8         return 0;
9 }
10
11 MUTATOR_HOOKFUNCTION(invincibleprojectiles_BuildMutatorsString)
12 {
13         ret_string = strcat(ret_string, ":InvincibleProjectiles");
14         return 0;
15 }
16
17 MUTATOR_HOOKFUNCTION(invincibleprojectiles_BuildMutatorsPrettyString)
18 {
19         ret_string = strcat(ret_string, ", Invincible Projectiles");
20         return 0;
21 }
22
23 MUTATOR_DEFINITION(mutator_invincibleprojectiles)
24 {
25         MUTATOR_HOOK(EditProjectile, invincibleprojectiles_EditProjectile, CBC_ORDER_ANY);
26         MUTATOR_HOOK(BuildMutatorsString, invincibleprojectiles_BuildMutatorsString, CBC_ORDER_ANY);
27         MUTATOR_HOOK(BuildMutatorsPrettyString, invincibleprojectiles_BuildMutatorsPrettyString, CBC_ORDER_ANY);
28
29         return 0;
30 }