set g_grappling_hook 0 "let players spawn with the grappling hook which allows them to pull themselves up"
+set g_invincible_projectiles 0 "set to 1 to disable any damage to projectiles in all balance configs, regardless of g_projectiles_damage"
set g_dodging 0 "set to 1 to enable dodging in games"
set g_rocket_flying 0 "set to 1 to enable rocket flying in all balance configs"
s = strcat(s, ", ", _("NIX"));
if(cvar("g_rocket_flying"))
s = strcat(s, ", ", _("Rocket Flying"));
+ if(cvar("g_invincible_projectiles"))
+ s = strcat(s, ", ", _("Invincible Projectiles"));
if(cvar_string("g_weaponarena") != "0")
s = strcat(s, ", ", WeaponArenaString());
if(cvar("g_start_weapon_laser") == 0)
me.TR(me);
me.TDempty(me, 0.4);
me.TD(me, 1, 1.8, s);
- me.TR(me);
me.TR(me);
me.TD(me, 1, 2, makeXonoticTextLabel(0, _("Weapon & item mutators:")));
me.TR(me);
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_jetpack", _("Jet pack")));
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_invincible_projectiles", _("Invincible Projectiles")));
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_rocket_flying", _("Rocket Flying")));
void readlevelcvars(void)
{
// first load all the mutators
+ if(cvar("g_invincible_projectiles"))
+ MUTATOR_ADD(mutator_invincibleprojectiles);
if(cvar("g_nix"))
MUTATOR_ADD(mutator_nix);
if(cvar("g_dodging"))
--- /dev/null
+MUTATOR_HOOKFUNCTION(invincibleprojectiles_EditProjectile)
+{
+ if(other.health)
+ {
+ // disable health which in effect disables damage calculations
+ other.health = 0;
+ }
+ return 0;
+}
+
+MUTATOR_HOOKFUNCTION(invincibleprojectiles_BuildMutatorsString)
+{
+ ret_string = strcat(ret_string, ":InvincibleProjectiles");
+ return 0;
+}
+
+MUTATOR_HOOKFUNCTION(invincibleprojectiles_BuildMutatorsPrettyString)
+{
+ ret_string = strcat(ret_string, ", Invincible Projectiles");
+ return 0;
+}
+
+MUTATOR_DEFINITION(mutator_invincibleprojectiles)
+{
+ MUTATOR_HOOK(EditProjectile, invincibleprojectiles_EditProjectile, CBC_ORDER_ANY);
+ MUTATOR_HOOK(BuildMutatorsString, invincibleprojectiles_BuildMutatorsString, CBC_ORDER_ANY);
+ MUTATOR_HOOK(BuildMutatorsPrettyString, invincibleprojectiles_BuildMutatorsPrettyString, CBC_ORDER_ANY);
+
+ return 0;
+}
MUTATOR_DECLARATION(gamemode_freezetag);
MUTATOR_DECLARATION(gamemode_keepaway);
+MUTATOR_DECLARATION(mutator_invincibleprojectiles);
MUTATOR_DECLARATION(mutator_nix);
MUTATOR_DECLARATION(mutator_dodging);
MUTATOR_DECLARATION(mutator_rocketflying);
mutators/gamemode_keyhunt.qc
mutators/gamemode_freezetag.qc
mutators/gamemode_keepaway.qc
+mutators/mutator_invincibleproj.qc
mutators/mutator_nix.qc
mutators/mutator_dodging.qc
mutators/mutator_rocketflying.qc