]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/base.qh
Merge remote-tracking branch 'origin/terencehill/misc_bugfixes'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / base.qh
index 73c16a9cd01c371a05d151d24499c82bf660faa8..05a5187e508709528c16cee43e7938027fb64d5b 100644 (file)
@@ -16,11 +16,12 @@ float CallbackChain_Call(entity cb);
 
 #define MUTATOR_REMOVING 0
 #define MUTATOR_ADDING 1
-float Mutator_Add(float(float) func);
-void Mutator_Remove(float(float) func); // calls error() on fail
+typedef float(float) mutatorfunc_t;
+float Mutator_Add(mutatorfunc_t func, string name);
+void Mutator_Remove(mutatorfunc_t func, string name); // calls error() on fail
 
-#define MUTATOR_ADD(name) Mutator_Add(MUTATOR_##name)
-#define MUTATOR_REMOVE(name) Mutator_Remove(MUTATOR_##name)
+#define MUTATOR_ADD(name) Mutator_Add(MUTATOR_##name, #name)
+#define MUTATOR_REMOVE(name) Mutator_Remove(MUTATOR_##name, #name)
 #define MUTATOR_DEFINITION(name) float MUTATOR_##name(float mode)
 #define MUTATOR_DECLARATION(name) float MUTATOR_##name(float mode)
 #define MUTATOR_HOOKFUNCTION(name) float HOOKFUNCTION_##name()
@@ -94,6 +95,10 @@ MUTATOR_HOOKABLE(FilterItem);
        // checks if the current item may be spawned (self.items and self.weapons may be read and written to, as well as the ammo_ fields)
        // return error to request removal
 
+MUTATOR_HOOKABLE(TurretSpawn);
+       // return error to request removal
+       // INPUT: self - turret
+       
 MUTATOR_HOOKABLE(OnEntityPreSpawn);
        // return error to prevent entity spawn, or modify the entity
 
@@ -112,3 +117,37 @@ MUTATOR_HOOKABLE(GetCvars);
        // INPUT:
                float get_cvars_f;
                string get_cvars_s;
+
+MUTATOR_HOOKABLE(EditProjectile);
+       // can edit any "just fired" projectile
+       // INPUT:
+               entity self;
+               entity other;
+
+MUTATOR_HOOKABLE(PlayerDamage_SplitHealthArmor);
+       // called when a player gets damaged to e.g. remove stuff he was carrying.
+       // INPUT:
+               entity frag_inflictor;
+               entity frag_attacker;
+               entity frag_target; // same as self
+               vector damage_force; // NOTE: this force already HAS been applied
+       // INPUT, OUTPUT:
+               float damage_take;
+               float damage_save;
+               
+MUTATOR_HOOKABLE(PlayerDamage_Calculate);
+       // called to adjust damage and force values which are applied to the player, used for e.g. strength damage/force multiplier or runematch runes
+       // i'm not sure if I should change this around slightly (Naming of the entities, and also how they're done in g_damage).
+       // INPUT:
+               entity frag_attacker;
+               entity frag_target;
+               float frag_deathtype;
+       // INPUT, OUTPUT:
+               float frag_damage;
+               vector frag_force;
+
+MUTATOR_HOOKABLE(PlayerPowerups);
+       // called at the end of player_powerups() in cl_client.qc, used for manipulating the values which are set by powerup items.
+       // INPUT
+       entity self;
+       float olditems; // also technically output, but since it is at the end of the function it's useless for that :P