Merge branch 'Mario/nades_mutator' into Mario/mutators
authorMario <mario.mario@y7mail.com>
Tue, 11 Jun 2013 04:32:43 +0000 (14:32 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 11 Jun 2013 04:32:43 +0000 (14:32 +1000)
33 files changed:
defaultXonotic.cfg
mutators.cfg [new file with mode: 0644]
qcsrc/server/autocvars.qh
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_physics.qc
qcsrc/server/cl_player.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/base.qh
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/mutator_bloodloss.qc [new file with mode: 0644]
qcsrc/server/mutators/mutator_footsteps.qc [new file with mode: 0644]
qcsrc/server/mutators/mutator_jump_grunt.qc [new file with mode: 0644]
qcsrc/server/mutators/mutator_melee_only.qc [new file with mode: 0644]
qcsrc/server/mutators/mutator_midair.qc [new file with mode: 0644]
qcsrc/server/mutators/mutator_minstagib.qc
qcsrc/server/mutators/mutator_multijump.qc [new file with mode: 0644]
qcsrc/server/mutators/mutator_norecoil.qc [new file with mode: 0644]
qcsrc/server/mutators/mutator_pinata.qc [new file with mode: 0644]
qcsrc/server/mutators/mutator_random_gravity.qc [new file with mode: 0644]
qcsrc/server/mutators/mutator_vampire.qc
qcsrc/server/mutators/mutators.qh
qcsrc/server/progs.src
qcsrc/server/sv_main.qc
qcsrc/server/t_jumppads.qc
qcsrc/server/teamplay.qc
qcsrc/server/w_hlac.qc
qcsrc/server/w_uzi.qc

index 038f99c..2693be7 100644 (file)
@@ -378,13 +378,6 @@ set g_weapon_throwable 1 "if set to 1, weapons can be dropped"
 set g_powerups -1 "if set to 0 the strength and shield (invincibility) will not spawn on the map, if 1 they will spawn in all game modes, -1 is game mode default"
 set g_use_ammunition 1 "if set to 0 all weapons have unlimited ammunition"
 set g_pickup_items -1 "if set to 0 all items (health, armor, ammo, weapons...) are removed from the map, if 1 they are forced to spawn"
-set g_minstagib 0      "enable minstagib"
-set g_minstagib_extralives 1   "how many extra lives you will get per powerup"
-set g_minstagib_ammo_start 10  "starting ammo"
-set g_minstagib_ammo_drop 5    "how much ammo you'll get for weapons or cells"
-set g_minstagib_invis_alpha 0.15
-set g_minstagib_speed_highspeed 1.5 "speed-multiplier that applies while you carry the invincibility powerup"
-set g_vampire 0 "set to 1 to enable the vampire mode, where the damage done to your opponent gets added to your own health"
 set g_weaponarena "0"  "put in a list of weapons to enable a weapon arena mode, or try \"all\" or \"most\""
 set g_weaponarena_random "0"   "if set to a number, only that weapon count is given on every spawn (randomly)"
 set g_weaponarena_random_with_laser "1"        "additionally, always provide the laser in random weapon arena games"
@@ -414,23 +407,6 @@ set g_player_alpha 1
 set g_player_brightness 0      "set to 2 for brighter players"
 seta g_balance_cloaked_alpha 0.25
 
-set g_sandbox 0 "allow players to spawn and edit objects around the map"
-set g_sandbox_info 1 "print object information to the server. 1 prints info about spawned / removed objects, 2 also prints info about edited objects"
-set g_sandbox_readonly 0 "when this mode is active, players cannot modify objects or use any sandbox commands"
-set g_sandbox_storage_name default "name of the selected storage to use"
-set g_sandbox_storage_autosave 5 "storage is automatically saved every specified number of seconds"
-set g_sandbox_storage_autoload 1 "if a storage file exists for the given map, automatically load it at startup"
-set g_sandbox_editor_flood 1 "players must wait this many seconds between spawning objects"
-set g_sandbox_editor_maxobjects 1000 "maximum number of objects that may exist at a time"
-set g_sandbox_editor_free 1 "0 = players can only copy or edit their own objects, 1 = players can copy but not edit other objects, 2 = players can copy and edit all object"
-set g_sandbox_editor_distance_spawn 200 "distance at which objects spawn in front of the player"
-set g_sandbox_editor_distance_edit 300 "distance at which players can edit or remove objects they are looking at"
-set g_sandbox_object_scale_min 0.1 "minimum scale that objects can be set to"
-set g_sandbox_object_scale_max 2 "maximum scale that objects can be set to"
-set g_sandbox_object_material_velocity_min 100 "velocity objects must have while colliding for material effects to be applied"
-set g_sandbox_object_material_velocity_factor 0.002 "velocity range which decides the intensity of material effects"
-set cl_sandbox_clipboard ""
-
 seta menu_sandbox_spawn_model ""
 seta menu_sandbox_attach_bone ""
 seta menu_sandbox_edit_skin 0
@@ -453,26 +429,9 @@ set welcome_message_time 8
 
 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"
-
-seta cl_dodging_timeout 0.2 "determines how long apart (in seconds) two taps on the same direction key are considered a dodge. use 0 to disable"
-
-set sv_dodging_wall_dodging 0 "set to 1 to allow dodging off walls. 0 to disable"
-set sv_dodging_delay 0.5 "determines how long a player has to wait to be able to dodge again after dodging"
-set sv_dodging_up_speed 200 "the jump velocity of the dodge"
-set sv_dodging_horiz_speed 400 "the horizontal velocity of the dodge"
-set sv_dodging_ramp_time 0.1 "a ramp so that the horizontal part of the dodge is added smoothly (seconds)"
-set sv_dodging_height_threshold 10 "the maximum height above ground where to allow dodging"
-set sv_dodging_wall_distance_threshold 10 "the maximum distance from a wall that still allows dodging"
-set sv_dodging_sound 1 "if 1 dodging makes a sound. if 0 dodging is silent"
-
 set g_spawn_alloweffects 1 "allow clients to enable spawn point and event effects such as particles and sounds, see cl_spawn_ cvars for more info"
 set g_spawn_furthest 1 "this amount of the spawns shall be far away from any players"
 set g_spawn_useallspawns 0 "use all spawns, e.g. also team spawns in non-teamplay, and all spawns, even enemy spawns, in teamplay"
-set g_spawn_near_teammate 0 "if set, players prefer spawns near a team mate"
-set g_spawn_near_teammate_distance 640 "max distance to consider a spawn to be near a team mate"
 // respawn delay
 set g_respawn_delay 2 "number of seconds you have to wait before you can respawn again"
 set g_respawn_waves 0 "respawn in waves (every n seconds), intended to decrease overwhelming base attacks"
@@ -749,13 +708,6 @@ bind F2 vno
 //used for spectate/observer mode
 bind F3 spec
 
-// NIX (No Items Xonotic) - at each time, everyone uses the same weapon,
-// and in regular intervals, this weapon is cycled
-set g_nix 0 "No Items Xonotic - instead of pickup items, everyone plays with the same weapon. After some time, a countdown will start, after which everyone will switch to another weapon, and so on"
-set g_nix_with_laser 0 "always carry the laser as an additional weapon in NIX"
-set g_nix_with_healtharmor 0 "when 1, health and armor still show up in NIX"
-set g_nix_with_powerups 0 "when 1, powerups still show up in NIX"
-
 // score log
 set sv_logscores_console 0     "print scores to server console"
 set sv_logscores_file 0        "print scores to file"
@@ -1086,10 +1038,6 @@ alias sethostname "set menu_use_default_hostname 0; hostname $*"
 
 set sv_foginterval 1 "force enable fog in regular intervals"
 
-set g_physical_items 0 "1 uses ODE physics for dropped weapons, 2 for all items, requires physics_ode to be enabled"
-set g_physical_items_damageforcescale 3 "how affected physical weapons are by damage"
-set g_physical_items_reset 1 "return map items to their original lotation after being picked up"
-
 // Audio track names (for old-style "cd loop NUMBER" usage)
 set _cdtrack_first "1"
 alias _cdtrack_0 "g_cdtracks_remaplist \"$g_cdtracks_remaplist $1\""
@@ -1172,12 +1120,6 @@ set g_bugrigs_speed_ref 400      "reference speed for accel and steer responsiveness"
 set g_bugrigs_speed_pow 2      "reference power for accel and steer responsiveness"
 set g_bugrigs_steer 1  "steering amount"
 
-set g_touchexplode 0
-set g_touchexplode_radius 50
-set g_touchexplode_damage 10
-set g_touchexplode_edgedamage 0
-set g_touchexplode_force 150
-
 set g_ban_sync_uri ""  "sync using this ban list provider (empty string to disable)"
 set g_ban_sync_interval 5      "sync every 5 minutes"
 set g_ban_sync_trusted_servers ""      "request ban lists from these xonotic servers (do not include your own server there, or unbanning may fail)"
@@ -1337,10 +1279,6 @@ seta cl_forcemyplayerskin 0 "set to the skin number you want to show yourself as
 seta cl_forcemyplayercolors 0 "set to the color value (encoding is same as _cl_color) for your own player model (ignored in teamplay; does not affect how enemies look with cl_forceplayermodels)"
 seta cl_movement_errorcompensation 1 "try to compensate for prediction errors and reduce preceived lag"
 
-// debug cvars for keyhunt attaching
-set _angles "0 0 0"
-set _origin "0 0 0"
-
 // campaign internal, set when loading a campaign map1G
 set _campaign_index ""
 set _campaign_name ""
@@ -1566,6 +1504,7 @@ exec turrets.cfg
 exec vehicles.cfg
 exec crosshairs.cfg
 exec gamemodes.cfg
+exec mutators.cfg
 exec notifications.cfg
 
 // load console command aliases and settings
@@ -1599,18 +1538,3 @@ set cl_simpleitems_postfix "_simple" "posfix to add fo model name when simple it
 set cl_fullbright_items 0 "enable fullbright items (if server allows, controled by g_fullbrightitems)"
 set cl_weapon_stay_color "2 0.5 0.5" "Color of picked up weapons when g_weapon_stay > 0"
 set cl_weapon_stay_alpha 0.75 "Alpha of picked up weapons when g_weapon_stay > 0"
-
-seta g_superspectate 0 "server side, allows extended spectator functions through the cmd interface. followpowerup, followstrength, followstshield or followfc [red|blue] will transfer spectation to the relevent player, if any"
-
-set g_nades 0 "enable off-hand grenades"
-set g_nades_spawn 1 "give nades right away when player spawns rather than delaying entire refire"
-set g_nades_nade_lifetime 3.5
-set g_nades_nade_minforce 400
-set g_nades_nade_maxforce 2000
-set g_nades_nade_health 25
-set g_nades_nade_refire 6
-set g_nades_nade_damage 225
-set g_nades_nade_edgedamage 90
-set g_nades_nade_radius 300
-set g_nades_nade_force 650
-set g_nades_nade_newton_style 0
diff --git a/mutators.cfg b/mutators.cfg
new file mode 100644 (file)
index 0000000..054a32c
--- /dev/null
@@ -0,0 +1,147 @@
+// =========================
+//  Config for all mutators
+// =========================
+
+
+// =========
+//  dodging
+// =========
+set g_dodging 0 "set to 1 to enable dodging in games"
+
+seta cl_dodging_timeout 0.2 "determines how long apart (in seconds) two taps on the same direction key are considered a dodge. use 0 to disable"
+
+set sv_dodging_wall_dodging 0 "set to 1 to allow dodging off walls. 0 to disable"
+set sv_dodging_delay 0.5 "determines how long a player has to wait to be able to dodge again after dodging"
+set sv_dodging_up_speed 200 "the jump velocity of the dodge"
+set sv_dodging_horiz_speed 400 "the horizontal velocity of the dodge"
+set sv_dodging_ramp_time 0.1 "a ramp so that the horizontal part of the dodge is added smoothly (seconds)"
+set sv_dodging_height_threshold 10 "the maximum height above ground where to allow dodging"
+set sv_dodging_wall_distance_threshold 10 "the maximum distance from a wall that still allows dodging"
+set sv_dodging_sound 1 "if 1 dodging makes a sound. if 0 dodging is silent"
+
+
+// ===========
+//  minstagib
+// ===========
+set g_minstagib 0 "enable minstagib"
+set g_minstagib_extralives 1 "how many extra lives you will get per powerup"
+set g_minstagib_ammo_start 10 "starting ammo"
+set g_minstagib_ammo_drop 5 "how much ammo you'll get for weapons or cells"
+set g_minstagib_invis_alpha 0.15
+set g_minstagib_speed_highspeed 1.5 "speed-multiplier that applies while you carry the invincibility powerup"
+
+
+// =========
+//  vampire
+// =========
+set g_vampire 0 "set to 1 to enable the vampire mode, where the damage done to your opponent gets added to your own health"
+
+
+// =========
+//  sandbox
+// =========
+set g_sandbox 0 "allow players to spawn and edit objects around the map"
+set g_sandbox_info 1 "print object information to the server. 1 prints info about spawned / removed objects, 2 also prints info about edited objects"
+set g_sandbox_readonly 0 "when this mode is active, players cannot modify objects or use any sandbox commands"
+set g_sandbox_storage_name default "name of the selected storage to use"
+set g_sandbox_storage_autosave 5 "storage is automatically saved every specified number of seconds"
+set g_sandbox_storage_autoload 1 "if a storage file exists for the given map, automatically load it at startup"
+set g_sandbox_editor_flood 1 "players must wait this many seconds between spawning objects"
+set g_sandbox_editor_maxobjects 1000 "maximum number of objects that may exist at a time"
+set g_sandbox_editor_free 1 "0 = players can only copy or edit their own objects, 1 = players can copy but not edit other objects, 2 = players can copy and edit all object"
+set g_sandbox_editor_distance_spawn 200 "distance at which objects spawn in front of the player"
+set g_sandbox_editor_distance_edit 300 "distance at which players can edit or remove objects they are looking at"
+set g_sandbox_object_scale_min 0.1 "minimum scale that objects can be set to"
+set g_sandbox_object_scale_max 2 "maximum scale that objects can be set to"
+set g_sandbox_object_material_velocity_min 100 "velocity objects must have while colliding for material effects to be applied"
+set g_sandbox_object_material_velocity_factor 0.002 "velocity range which decides the intensity of material effects"
+set cl_sandbox_clipboard ""
+
+
+// ========================
+//  invincible projectiles
+// ========================
+set g_invincible_projectiles 0 "set to 1 to disable any damage to projectiles in all balance configs, regardless of g_projectiles_damage"
+
+
+// ===============
+//  rocket flying
+// ===============
+set g_rocket_flying 0 "set to 1 to enable rocket flying in all balance configs"
+
+
+// =====================
+//  spawn near teammate
+// =====================
+set g_spawn_near_teammate 0 "if set, players prefer spawns near a team mate"
+set g_spawn_near_teammate_distance 640 "max distance to consider a spawn to be near a team mate"
+
+
+// ========================
+//  NIX (No Items Xonotic)
+// ========================
+// at each time, everyone uses the same weapon,
+// and in regular intervals, this weapon is cycled
+set g_nix 0 "No Items Xonotic - instead of pickup items, everyone plays with the same weapon. After some time, a countdown will start, after which everyone will switch to another weapon, and so on"
+set g_nix_with_laser 0 "always carry the laser as an additional weapon in NIX"
+set g_nix_with_healtharmor 0 "when 1, health and armor still show up in NIX"
+set g_nix_with_powerups 0 "when 1, powerups still show up in NIX"
+
+
+// ================
+//  physical items
+// ================
+set g_physical_items 0 "1 uses ODE physics for dropped weapons, 2 for all items, requires physics_ode to be enabled"
+set g_physical_items_damageforcescale 3 "how affected physical weapons are by damage"
+set g_physical_items_reset 1 "return map items to their original lotation after being picked up"
+
+
+// ===============
+//  touch explode
+// ===============
+set g_touchexplode 0 "touching other players causes an explosion"
+set g_touchexplode_radius 50
+set g_touchexplode_damage 10
+set g_touchexplode_edgedamage 0
+set g_touchexplode_force 150
+
+
+// ================
+//  super spectate
+// ================
+set g_superspectate 0 "server side, allows extended spectator functions through the cmd interface. followpowerup, followstrength, followstshield or followfc [red|blue] will transfer spectation to the relevent player, if any"
+
+
+// ==================
+//  melee only arena
+// ==================
+set g_melee_only 0 "enable melee only arena"
+
+
+// ================
+//  random gravity
+// ================
+set g_random_gravity 0 "enable random gravity mutator"
+set g_random_gravity_delay 3 "delay between gravity changes"
+set g_random_gravity_negative_chance 0.5 "chance of gravity being a negative value"
+set g_random_gravity_min -2000 "minimum gravity"
+set g_random_gravity_max 2000 "maximum gravity"
+set g_random_gravity_positive 1000 "positive gravity multiplier"
+set g_random_gravity_negative 1000 "negative gravity multiplier"
+
+
+// =======
+//  nades
+// =======
+set g_nades 0 "enable off-hand grenades"
+set g_nades_spawn 1 "give nades right away when player spawns rather than delaying entire refire"
+set g_nades_nade_lifetime 3.5
+set g_nades_nade_minforce 400
+set g_nades_nade_maxforce 2000
+set g_nades_nade_health 25
+set g_nades_nade_refire 6
+set g_nades_nade_damage 225
+set g_nades_nade_edgedamage 90
+set g_nades_nade_radius 300
+set g_nades_nade_force 650
+set g_nades_nade_newton_style 0
index 56a1f2b..2027349 100644 (file)
@@ -892,7 +892,6 @@ float autocvar_g_maxplayers;
 float autocvar_g_maxplayers_spectator_blocktime;
 float autocvar_g_maxpushtime;
 float autocvar_g_maxspeed;
-#define autocvar_g_midair cvar("g_midair")
 float autocvar_g_midair_shieldtime;
 #define autocvar_g_minstagib cvar("g_minstagib")
 float autocvar_g_minstagib_ammo_drop;
@@ -932,7 +931,6 @@ float autocvar_g_nix_with_laser;
 float autocvar_g_nix_with_powerups;
 float autocvar_g_nodepthtestitems;
 float autocvar_g_nodepthtestplayers;
-float autocvar_g_norecoil;
 float autocvar_g_onslaught_cp_buildhealth;
 float autocvar_g_onslaught_cp_buildtime;
 float autocvar_g_onslaught_cp_health;
@@ -1234,6 +1232,13 @@ float autocvar_g_touchexplode_radius;
 float autocvar_g_touchexplode_damage;
 float autocvar_g_touchexplode_edgedamage;
 float autocvar_g_touchexplode_force;
+#define autocvar_g_bloodloss cvar("g_bloodloss")
+float autocvar_g_random_gravity_negative_chance;
+float autocvar_g_random_gravity_min;
+float autocvar_g_random_gravity_max;
+float autocvar_g_random_gravity_positive;
+float autocvar_g_random_gravity_negative;
+float autocvar_g_random_gravity_delay;
 float autocvar_g_nades;
 float autocvar_g_nades_spawn;
 float autocvar_g_nades_nade_lifetime;
index a9a3ea9..5b889b8 100644 (file)
@@ -253,9 +253,6 @@ void havocbot_bunnyhop(vector dir)
        float maxspeed;
        vector gco, gno;
 
-       if(autocvar_g_midair)
-               return;
-
        // Don't jump when attacking
        if(self.aistatus & AI_STATUS_ATTACKING)
                return;
index 036bb45..9f2174a 100644 (file)
@@ -1517,15 +1517,6 @@ void player_powerups (void)
        if(autocvar_g_fullbrightplayers)
                self.effects = self.effects | EF_FULLBRIGHT;
 
-       // midair gamemode: damage only while in the air
-       // if in midair mode, being on ground grants temporary invulnerability
-       // (this is so that multishot weapon don't clear the ground flag on the
-       // first damage in the frame, leaving the player vulnerable to the
-       // remaining hits in the same frame)
-       if (self.flags & FL_ONGROUND)
-       if (g_midair)
-               self.spawnshieldtime = max(self.spawnshieldtime, time + autocvar_g_midair_shieldtime);
-
        if (time >= game_starttime)
        if (time < self.spawnshieldtime)
                self.effects = self.effects | (EF_ADDITIVE | EF_FULLBRIGHT);
@@ -2355,8 +2346,6 @@ void PlayerPreThink (void)
                float do_crouch = self.BUTTON_CROUCH;
                if(self.hook.state)
                        do_crouch = 0;
-               if(self.health <= g_bloodloss)
-                       do_crouch = 1;
                if(self.vehicle)
                        do_crouch = 0;
                if(self.freezetag_frozen)
@@ -2388,15 +2377,6 @@ void PlayerPreThink (void)
                        }
                }
 
-               if(self.health <= g_bloodloss && self.deadflag == DEAD_NO)
-               {
-                       if(self.bloodloss_timer < time)
-                       {
-                               self.event_damage(self, self, 1, DEATH_ROT, self.origin, '0 0 0');
-                               self.bloodloss_timer = time + 0.5 + random() * 0.5;
-                       }
-               }
-
                FixPlayermodel();
 
                GrapplingHookFrame();
@@ -2424,9 +2404,6 @@ void PlayerPreThink (void)
 
                if(frametime)
                        player_anim();
-
-               if(g_nexball)
-                       nexball_setstatus();
                
                // secret status
                secrets_setstatus();
index 5ce7b7d..3dd91df 100644 (file)
 .float wasFlying;
 .float spectatorspeed;
 
-.float multijump_count;
-.float multijump_ready;
-.float prevjumpbutton;
-
 /*
 =============
 PlayerJump
@@ -23,13 +19,16 @@ When you press the jump key
 */
 void PlayerJump (void)
 {
-       if(self.freezetag_frozen)
-               return; // no jumping in freezetag when frozen
+       float doublejump = FALSE;
 
-       float mjumpheight;
-       float doublejump;
+       player_multijump = doublejump;
+       if(MUTATOR_CALLHOOK(PlayerJump))
+               return;
+               
+       doublejump = player_multijump;
 
-       doublejump = FALSE;
+       float mjumpheight;
+       
        if (autocvar_sv_doublejump)
        {
                tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
@@ -52,56 +51,6 @@ void PlayerJump (void)
                return;
        }
 
-       if (autocvar_g_multijump)
-       {
-               if (self.prevjumpbutton == FALSE && !(self.flags & FL_ONGROUND)) // jump button pressed this frame and we are in midair
-                       self.multijump_ready = TRUE;  // this is necessary to check that we released the jump button and pressed it again
-               else
-                       self.multijump_ready = FALSE;
-       }
-
-       if(!doublejump && self.multijump_ready && self.multijump_count < autocvar_g_multijump && self.velocity_z > autocvar_g_multijump_speed)
-       {
-               // doublejump = FALSE; // checked above in the if
-               if (autocvar_g_multijump)
-               {
-                       if (autocvar_g_multijump_add == 0) // in this case we make the z velocity == jumpvelocity
-                       {
-                               if (self.velocity_z < mjumpheight)
-                               {
-                                       doublejump = TRUE;
-                                       self.velocity_z = 0;
-                               }
-                       }
-                       else
-                               doublejump = TRUE;
-
-                       if(doublejump)
-                       {
-                               if(self.movement_x != 0 || self.movement_y != 0) // don't remove all speed if player isnt pressing any movement keys
-                               {
-                                       float curspeed;
-                                       vector wishvel, wishdir;
-
-                                       curspeed = max(
-                                               vlen(vec2(self.velocity)), // current xy speed
-                                               vlen(vec2(antilag_takebackavgvelocity(self, max(self.lastteleporttime + sys_frametime, time - 0.25), time))) // average xy topspeed over the last 0.25 secs
-                                       );
-                                       makevectors(self.v_angle_y * '0 1 0');
-                                       wishvel = v_forward * self.movement_x + v_right * self.movement_y;
-                                       wishdir = normalize(wishvel);
-
-                                       self.velocity_x = wishdir_x * curspeed; // allow "dodging" at a multijump
-                                       self.velocity_y = wishdir_y * curspeed;
-                                       // keep velocity_z unchanged!
-                               }
-                               if (autocvar_g_multijump > 0)
-                                       self.multijump_count += 1;
-                       }
-               }
-               self.multijump_ready = FALSE; // require releasing and pressing the jump button again for the next jump
-       }
-
        if (!doublejump)
                if (!(self.flags & FL_ONGROUND))
                        return;
@@ -110,9 +59,6 @@ void PlayerJump (void)
                if (!(self.flags & FL_JUMPRELEASED))
                        return;
 
-       if(self.health <= g_bloodloss)
-               return;
-
        // sv_jumpspeedcap_min/sv_jumpspeedcap_max act as baseline
        // velocity bounds.  Final velocity is bound between (jumpheight *
        // min + jumpheight) and (jumpheight * max + jumpheight);
@@ -165,9 +111,6 @@ void PlayerJump (void)
 
        animdecide_setaction(self, ANIMACTION_JUMP, TRUE);
 
-       if(g_jump_grunt)
-               PlayerSound(playersound_jump, CH_PLAYER, VOICETYPE_PLAYERSOUND);
-
        self.restart_jump = -1; // restart jump anim next time
        // value -1 is used to not use the teleport bit (workaround for tiny hitch when re-jumping)
 }
@@ -201,14 +144,6 @@ void CheckWaterJump()
 }
 void CheckPlayerJump()
 {
-       if(self.flags & FL_ONGROUND)
-       {
-               if (autocvar_g_multijump > 0)
-                       self.multijump_count = 0;
-               else
-                       self.multijump_count = -2; // the cvar value for infinite jumps is -1, so this needs to be smaller
-       }
-
        if (self.BUTTON_JUMP)
                PlayerJump ();
        else
@@ -216,7 +151,6 @@ void CheckPlayerJump()
 
        if (self.waterlevel == WATERLEVEL_SWIMMING)
                CheckWaterJump ();
-       self.prevjumpbutton = self.BUTTON_JUMP;
 }
 
 float racecar_angle(float forward, float down)
@@ -915,29 +849,6 @@ void SV_PlayerPhysics()
                self.angles_z = 0;
        }
 
-       if(self.flags & FL_ONGROUND)
-       if(IS_PLAYER(self)) // no fall sounds for observers thank you very much
-       if(self.wasFlying)
-       {
-               self.wasFlying = 0;
-
-               if(self.waterlevel < WATERLEVEL_SWIMMING)
-               if(time >= self.ladder_time)
-               if not(self.hook)
-               {
-                       self.nextstep = time + 0.3 + random() * 0.1;
-                       trace_dphitq3surfaceflags = 0;
-                       tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 1', MOVE_NOMONSTERS, self);
-                       if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)
-                       {
-                               if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)
-                                       GlobalSound(globalsound_metalfall, CH_PLAYER, VOICETYPE_PLAYERSOUND);
-                               else
-                                       GlobalSound(globalsound_fall, CH_PLAYER, VOICETYPE_PLAYERSOUND);
-                       }
-               }
-       }
-
        if(IsFlying(self))
                self.wasFlying = 1;
 
index 68a2de3..5eb8247 100644 (file)
@@ -262,22 +262,9 @@ void player_anim (void)
 
 void SpawnThrownWeapon (vector org, float w)
 {
-       if(g_pinata)
-       {
-               float j;
-               for(j = WEP_FIRST; j <= WEP_LAST; ++j)
-               {
-                       if(WEPSET_CONTAINS_EW(self, j))
-                               if(W_IsWeaponThrowable(j))
-                                       W_ThrowNewWeapon(self, j, FALSE, org, randomvec() * 175 + '0 0 325');
-               }
-       }
-       else
-       {
-               if(WEPSET_CONTAINS_EW(self, self.weapon))
-                       if(W_IsWeaponThrowable(self.weapon))
-                               W_ThrowNewWeapon(self, self.weapon, FALSE, org, randomvec() * 125 + '0 0 200');
-       }
+       if(WEPSET_CONTAINS_EW(self, self.weapon))
+               if(W_IsWeaponThrowable(self.weapon))
+                       W_ThrowNewWeapon(self, self.weapon, FALSE, org, randomvec() * 125 + '0 0 200');
 }
 
 void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
index a98eb6f..2240482 100644 (file)
@@ -233,8 +233,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m
 
        ent.dphitcontentsmask = oldsolid; // restore solid type (generally SOLID_SLIDEBOX)
 
-       if (!g_norecoil)
-               ent.punchangle_x = recoil * -1;
+       ent.punchangle_x = recoil * -1;
 
        if (snd != "")
        {
index 7d35857..47e4ebe 100644 (file)
@@ -16,7 +16,7 @@ noref float require_spawnfunc_prefix; // if this float exists, only functions wi
 
 // Globals
 
-float g_cloaked, g_footsteps, g_jump_grunt, g_grappling_hook, g_midair, g_minstagib, g_pinata, g_norecoil, g_bloodloss;
+float g_cloaked, g_grappling_hook, g_minstagib;
 float g_warmup_limit;
 float g_warmup_allguns;
 float g_warmup_allow_timeout;
@@ -226,9 +226,6 @@ float alreadychangedlevel;
 .float in_swamp;              // bool
 .entity swampslug;            // Uses this to release from swamp ("untouch" fix)
 
-// footstep interval
-.float nextstep;
-
 float blockSpectators; //if set, new or existing spectators or observers will be removed unless they become a player within g_maxplayers_spectator_blocktime seconds
 .float spectatortime; //point in time since the client is spectating or observing
 void checkSpectatorBlock();
@@ -549,7 +546,6 @@ float client_cefc_accumulatortime;
 
 .float spectatee_status;
 .float zoomstate;
-.float bloodloss_timer;
 .float restriction;
 
 .entity clientdata;
index da013fc..f8a77a2 100644 (file)
@@ -772,7 +772,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
        // apply push
        if (self.damageforcescale)
        if (vlen(force))
-       if (!IS_PLAYER(self) || time >= self.spawnshieldtime || g_midair)
+       if (!IS_PLAYER(self) || time >= self.spawnshieldtime)
        {
                vector farce = damage_explosion_calcpush(self.damageforcescale * force, self.velocity, autocvar_g_balance_damagepush_speedfactor);
                if(self.movetype == MOVETYPE_PHYSICS)
index 3043a30..85bab3c 100644 (file)
@@ -703,14 +703,6 @@ void spawnfunc_worldspawn (void)
                        s = strcat(s, ":", autocvar_g_weaponarena, " arena");
 
                // TODO to mutator system
-               if(autocvar_g_norecoil)
-                       s = strcat(s, ":norecoil");
-
-               // TODO to mutator system
-               if(autocvar_g_midair)
-                       s = strcat(s, ":midair");
-
-               // TODO to mutator system
                if(autocvar_g_powerups == 0)
                        s = strcat(s, ":no_powerups");
                if(autocvar_g_powerups > 0)
index 923bcec..6e8b5d1 100644 (file)
@@ -767,7 +767,6 @@ void readplayerstartcvars()
 
        if (g_weaponarena)
        {
-               g_pinata = 0; // incompatible
                g_weapon_stay = 0; // incompatible
                WEPSET_COPY_AA(start_weapons, g_weaponarena_weapons);
                start_items |= IT_UNLIMITED_AMMO;
@@ -789,10 +788,7 @@ void readplayerstartcvars()
 
        if(!cvar("g_use_ammunition"))
                start_items |= IT_UNLIMITED_AMMO;
-
-       if(cvar("g_nexball"))
-               start_items |= IT_UNLIMITED_SUPERWEAPONS; // FIXME BAD BAD BAD BAD HACK, NEXBALL SHOULDN'T ABUSE PORTO'S WEAPON SLOT
-
+       
        if(start_items & IT_UNLIMITED_WEAPON_AMMO)
        {
                start_ammo_rockets = 999;
@@ -919,6 +915,15 @@ void readlevelcvars(void)
        CHECK_MUTATOR_ADD("g_rocket_flying", mutator_rocketflying, !cvar("g_minstagib"));
        CHECK_MUTATOR_ADD("g_vampire", mutator_vampire, !cvar("g_minstagib"));
        CHECK_MUTATOR_ADD("g_superspectate", mutator_superspec, 1);
+       CHECK_MUTATOR_ADD("g_pinata", mutator_pinata, !cvar("g_minstagib"));
+       CHECK_MUTATOR_ADD("g_midair", mutator_midair, 1);
+       CHECK_MUTATOR_ADD("g_bloodloss", mutator_bloodloss, !cvar("g_minstagib"));
+       CHECK_MUTATOR_ADD("g_random_gravity", mutator_random_gravity, 1);
+       CHECK_MUTATOR_ADD("g_norecoil", mutator_norecoil, 1);
+       CHECK_MUTATOR_ADD("g_multijump", mutator_multijump, 1);
+       CHECK_MUTATOR_ADD("g_jump_grunt", mutator_jump_grunt, 1);
+       CHECK_MUTATOR_ADD("g_footsteps", mutator_footsteps, 1);
+       CHECK_MUTATOR_ADD("g_melee_only", mutator_melee_only, !cvar("g_minstagib"));
        CHECK_MUTATOR_ADD("g_nades", mutator_nades, 1);
        CHECK_MUTATOR_ADD("g_sandbox", sandbox, 1);
        
@@ -950,13 +955,8 @@ void readlevelcvars(void)
        g_cloaked = cvar("g_cloaked");
     if(g_cts)
         g_cloaked = 1; // always enable cloak in CTS
-       g_jump_grunt = cvar("g_jump_grunt");
-       g_footsteps = cvar("g_footsteps");
        g_grappling_hook = cvar("g_grappling_hook");
        g_jetpack = cvar("g_jetpack");
-       g_midair = cvar("g_midair");
-       g_norecoil = cvar("g_norecoil");
-       g_bloodloss = cvar("g_bloodloss");
        sv_maxidle = cvar("sv_maxidle");
        sv_maxidle_spectatorsareidle = cvar("sv_maxidle_spectatorsareidle");
        sv_autotaunt = cvar("sv_autotaunt");
@@ -967,7 +967,7 @@ void readlevelcvars(void)
        g_warmup_allguns = cvar("g_warmup_allguns");
        g_warmup_allow_timeout = cvar("g_warmup_allow_timeout");
 
-       if ((g_race && g_race_qualifying == 2) || g_arena || g_minstagib || g_assault || cvar("g_campaign"))
+       if ((g_race && g_race_qualifying == 2) || g_arena || g_assault || cvar("g_campaign"))
                inWarmupStage = 0; // these modes cannot work together, sorry
 
        g_pickup_respawntime_weapon = cvar("g_pickup_respawntime_weapon");
@@ -1030,8 +1030,6 @@ void readlevelcvars(void)
        g_pickup_ammo_anyway = cvar("g_pickup_ammo_anyway");
        g_pickup_weapons_anyway = cvar("g_pickup_weapons_anyway");
 
-       g_pinata = cvar("g_pinata");
-
     g_weapon_stay = cvar(strcat("g_", GetGametype(), "_weapon_stay"));
     if(!g_weapon_stay)
         g_weapon_stay = cvar("g_weapon_stay");
@@ -1337,12 +1335,6 @@ void precache()
             precache_playermodel(s);
     }
 
-    if (g_footsteps)
-    {
-        PrecacheGlobalSound((globalsound_step = "misc/footstep0 6"));
-        PrecacheGlobalSound((globalsound_metalstep = "misc/metalfootstep0 6"));
-    }
-
     // gore and miscellaneous sounds
     //precache_sound ("misc/h2ohit.wav");
     precache_model ("models/hook.md3");
index ee0da7e..98a4494 100644 (file)
@@ -72,6 +72,11 @@ MUTATOR_HOOKABLE(PlayerDies);
                entity frag_attacker;
                entity frag_target; // same as self
                float frag_deathtype;
+               
+MUTATOR_HOOKABLE(PlayerJump);
+       // called when a player presses the jump key
+       // INPUT, OUTPUT:
+               float player_multijump;
 
 MUTATOR_HOOKABLE(GiveFragsForKill);
        // called when someone was fragged by "self", and is expected to change frag_score to adjust scoring for the kill
index 8214782..544c5ba 100644 (file)
@@ -539,6 +539,14 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDamage_Calculate)
        return 1;
 }
 
+MUTATOR_HOOKFUNCTION(freezetag_PlayerJump)
+{
+       if(self.freezetag_frozen)
+               return TRUE; // no jumping in freezetag when frozen
+       
+       return FALSE;
+}
+
 MUTATOR_HOOKFUNCTION(freezetag_ForbidThrowCurrentWeapon)
 {
        if (self.freezetag_frozen)
@@ -619,6 +627,7 @@ MUTATOR_DEFINITION(gamemode_freezetag)
        MUTATOR_HOOK(PlayerPreThink, freezetag_PlayerPreThink, CBC_ORDER_FIRST);
        MUTATOR_HOOK(PlayerPhysics, freezetag_PlayerPhysics, CBC_ORDER_FIRST);
        MUTATOR_HOOK(PlayerDamage_Calculate, freezetag_PlayerDamage_Calculate, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerJump, freezetag_PlayerJump, CBC_ORDER_ANY);
        MUTATOR_HOOK(ForbidThrowCurrentWeapon, freezetag_ForbidThrowCurrentWeapon, CBC_ORDER_ANY);
        MUTATOR_HOOK(ItemTouch, freezetag_ItemTouch, CBC_ORDER_ANY);
        MUTATOR_HOOK(HavocBot_ChooseRule, freezetag_BotRoles, CBC_ORDER_ANY);
index 78d9d70..adfb31a 100644 (file)
@@ -929,6 +929,9 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerPreThink)
                }
                
        }
+       
+       nexball_setstatus();
+       
        return FALSE;
 }
 
@@ -944,6 +947,13 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerSpawn)
        return FALSE;
 }
 
+MUTATOR_HOOKFUNCTION(nexball_SetStartItems)
+{
+       start_items |= IT_UNLIMITED_SUPERWEAPONS; // FIXME BAD BAD BAD BAD HACK, NEXBALL SHOULDN'T ABUSE PORTO'S WEAPON SLOT
+       
+       return FALSE;
+}
+
 MUTATOR_DEFINITION(gamemode_nexball)
 {
        MUTATOR_HOOK(PlayerDies, nexball_BallDrop, CBC_ORDER_ANY);
@@ -953,6 +963,7 @@ MUTATOR_DEFINITION(gamemode_nexball)
        MUTATOR_HOOK(BuildMutatorsString, nexball_BuildMutatorsString, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerSpawn, nexball_PlayerSpawn, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerPreThink, nexball_PlayerPreThink, CBC_ORDER_ANY);
+       MUTATOR_HOOK(SetStartItems, nexball_SetStartItems, CBC_ORDER_ANY);
 
        MUTATOR_ONADD
        {
diff --git a/qcsrc/server/mutators/mutator_bloodloss.qc b/qcsrc/server/mutators/mutator_bloodloss.qc
new file mode 100644 (file)
index 0000000..adffdec
--- /dev/null
@@ -0,0 +1,48 @@
+.float bloodloss_timer;
+
+MUTATOR_HOOKFUNCTION(bloodloss_PlayerThink)
+{
+       if(IS_PLAYER(self))
+       if(self.health <= autocvar_g_bloodloss && self.deadflag == DEAD_NO)
+       {
+               self.BUTTON_CROUCH = TRUE;
+               
+               if(time >= self.bloodloss_timer)
+               {
+                       self.event_damage(self, self, 1, DEATH_ROT, self.origin, '0 0 0');
+                       self.bloodloss_timer = time + 0.5 + random() * 0.5;
+               }
+       }
+       
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(bloodloss_PlayerJump)
+{
+       if(self.health <= autocvar_g_bloodloss)
+               return TRUE;
+               
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(bloodloss_BuildMutatorsString)
+{
+       ret_string = strcat(ret_string, ":bloodloss");
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(bloodloss_BuildMutatorsPrettyString)
+{
+       ret_string = strcat(ret_string, ", Blood loss");
+       return FALSE;
+}
+
+MUTATOR_DEFINITION(mutator_bloodloss)
+{
+       MUTATOR_HOOK(PlayerPreThink, bloodloss_PlayerThink, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerJump, bloodloss_PlayerJump, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsString, bloodloss_BuildMutatorsString, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsPrettyString, bloodloss_BuildMutatorsPrettyString, CBC_ORDER_ANY);
+
+       return FALSE;
+}
diff --git a/qcsrc/server/mutators/mutator_footsteps.qc b/qcsrc/server/mutators/mutator_footsteps.qc
new file mode 100644 (file)
index 0000000..1538c3f
--- /dev/null
@@ -0,0 +1,87 @@
+// footstep interval
+.float nextstep;
+
+MUTATOR_HOOKFUNCTION(footsteps_PlayerPhysics)
+{
+       if(self.flags & FL_ONGROUND)
+       if(IS_PLAYER(self)) // no fall sounds for observers thank you very much
+       if(self.wasFlying)
+       {
+               self.wasFlying = 0;
+
+               if(self.waterlevel < WATERLEVEL_SWIMMING)
+               if(time >= self.ladder_time)
+               if not(self.hook)
+               {
+                       self.nextstep = time + 0.3 + random() * 0.1;
+                       trace_dphitq3surfaceflags = 0;
+                       tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 1', MOVE_NOMONSTERS, self);
+                       if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)
+                       {
+                               if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)
+                                       GlobalSound(globalsound_metalfall, CH_PLAYER, VOICETYPE_PLAYERSOUND);
+                               else
+                                       GlobalSound(globalsound_fall, CH_PLAYER, VOICETYPE_PLAYERSOUND);
+                       }
+               }
+       }
+       
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(footsteps_StartFrame)
+{
+       entity oldself = self;
+       
+       if(gameover)
+               return FALSE;
+       
+       for(self = world; (self = findfloat(self, damagedbycontents, TRUE)); )
+       {
+               float velocity_len = vlen(self.velocity);
+               // play stupid sounds
+               if (self.flags & FL_ONGROUND)
+               if (velocity_len > autocvar_sv_maxspeed * 0.6)
+               if (!self.deadflag)
+               if (time < self.lastground + 0.2)
+               {
+                       if((time > self.nextstep) || (time < (self.nextstep - 10.0)))
+                       {
+                               self.nextstep = time + 0.3 + random() * 0.1;
+                               trace_dphitq3surfaceflags = 0;
+                               tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 1', MOVE_NOMONSTERS, self);
+                               if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)
+                               {
+                                       if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)
+                                               GlobalSound(globalsound_metalstep, CH_PLAYER, VOICETYPE_PLAYERSOUND);
+                                       else
+                                               GlobalSound(globalsound_step, CH_PLAYER, VOICETYPE_PLAYERSOUND);
+                               }
+                       }
+               }
+       }
+       self = oldself;
+       
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(footsteps_BuildMutatorsString)
+{
+       ret_string = strcat(ret_string, ":Footsteps");
+       return FALSE;
+}
+
+MUTATOR_DEFINITION(mutator_footsteps)
+{
+       MUTATOR_HOOK(PlayerPhysics, footsteps_PlayerPhysics, CBC_ORDER_ANY);
+       MUTATOR_HOOK(SV_StartFrame, footsteps_StartFrame, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsString, footsteps_BuildMutatorsString, CBC_ORDER_ANY);
+       
+       MUTATOR_ONADD
+       {
+               PrecacheGlobalSound((globalsound_step = "misc/footstep0 6"));
+        PrecacheGlobalSound((globalsound_metalstep = "misc/metalfootstep0 6"));
+       }
+
+       return FALSE;
+}
diff --git a/qcsrc/server/mutators/mutator_jump_grunt.qc b/qcsrc/server/mutators/mutator_jump_grunt.qc
new file mode 100644 (file)
index 0000000..e5cc74f
--- /dev/null
@@ -0,0 +1,21 @@
+MUTATOR_HOOKFUNCTION(grunt_PlayerJump)
+{
+       if(self.flags & FL_ONGROUND)
+               PlayerSound(playersound_jump, CH_PLAYER, VOICETYPE_PLAYERSOUND);
+               
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(grunt_BuildMutatorsString)
+{
+       ret_string = strcat(ret_string, ":JumpGrunt");
+       return FALSE;
+}
+
+MUTATOR_DEFINITION(mutator_jump_grunt)
+{
+       MUTATOR_HOOK(PlayerJump, grunt_PlayerJump, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsString, grunt_BuildMutatorsString, CBC_ORDER_ANY);
+
+       return FALSE;
+}
diff --git a/qcsrc/server/mutators/mutator_melee_only.qc b/qcsrc/server/mutators/mutator_melee_only.qc
new file mode 100644 (file)
index 0000000..639bba5
--- /dev/null
@@ -0,0 +1,44 @@
+MUTATOR_HOOKFUNCTION(melee_SetStartItems)
+{
+       start_ammo_shells = 0;
+       warmup_start_ammo_shells = 0;
+       
+       WEPSET_COPY_AW(start_weapons, WEP_SHOTGUN);
+       WEPSET_COPY_AW(warmup_start_weapons, WEP_SHOTGUN);
+               
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(melee_FilterItem)
+{
+       switch (self.items)
+       {
+               case IT_5HP:
+               case IT_ARMOR_SHARD:
+                       return FALSE;
+       }
+       
+       return TRUE;
+}
+
+MUTATOR_HOOKFUNCTION(melee_BuildMutatorsString)
+{
+       ret_string = strcat(ret_string, ":MeleeOnly");
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(melee_BuildMutatorsPrettyString)
+{
+       ret_string = strcat(ret_string, ", Melee Only Arena");
+       return FALSE;
+}
+
+MUTATOR_DEFINITION(mutator_melee_only)
+{
+       MUTATOR_HOOK(SetStartItems, melee_SetStartItems, CBC_ORDER_ANY);
+       MUTATOR_HOOK(FilterItem, melee_FilterItem, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsString, melee_BuildMutatorsString, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsPrettyString, melee_BuildMutatorsPrettyString, CBC_ORDER_ANY);
+
+       return FALSE;
+}
diff --git a/qcsrc/server/mutators/mutator_midair.qc b/qcsrc/server/mutators/mutator_midair.qc
new file mode 100644 (file)
index 0000000..0d48fef
--- /dev/null
@@ -0,0 +1,54 @@
+.float midair_shieldtime;
+
+MUTATOR_HOOKFUNCTION(midair_PlayerDamage)
+{
+       if(IS_PLAYER(frag_attacker))
+       if(IS_PLAYER(frag_target))
+       if(time < self.midair_shieldtime)
+               frag_damage = FALSE;
+
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(midair_PlayerPowerups)
+{
+       if(time >= game_starttime)
+       if(self.flags & FL_ONGROUND)
+       {
+               self.effects |= (EF_ADDITIVE | EF_FULLBRIGHT);
+               self.midair_shieldtime = max(self.midair_shieldtime, time + autocvar_g_midair_shieldtime);
+       }
+               
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(midair_PlayerSpawn)
+{
+       if(IS_BOT_CLIENT(self))
+               self.bot_moveskill = 0; // disable bunnyhopping
+
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(midair_BuildMutatorsString)
+{
+       ret_string = strcat(ret_string, ":midair");
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(midair_BuildMutatorsPrettyString)
+{
+       ret_string = strcat(ret_string, ", Midair");
+       return FALSE;
+}
+
+MUTATOR_DEFINITION(mutator_midair)
+{
+       MUTATOR_HOOK(PlayerDamage_Calculate, midair_PlayerDamage, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerPowerups, midair_PlayerPowerups, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerSpawn, midair_PlayerSpawn, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsString, midair_BuildMutatorsString, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsPrettyString, midair_BuildMutatorsPrettyString, CBC_ORDER_ANY);
+
+       return FALSE;
+}
index a0786b7..4a26bdb 100644 (file)
@@ -275,6 +275,7 @@ MUTATOR_HOOKFUNCTION(minstagib_SetStartItems)
        start_health = 100;
        start_armorvalue = 0;
        WEPSET_COPY_AW(start_weapons, WEP_MINSTANEX);
+       WEPSET_COPY_AW(warmup_start_weapons, WEP_MINSTANEX);
        start_items |= IT_UNLIMITED_SUPERWEAPONS;
                
        return FALSE;
diff --git a/qcsrc/server/mutators/mutator_multijump.qc b/qcsrc/server/mutators/mutator_multijump.qc
new file mode 100644 (file)
index 0000000..c945e1c
--- /dev/null
@@ -0,0 +1,88 @@
+.float multijump_count;
+.float multijump_ready;
+
+MUTATOR_HOOKFUNCTION(multijump_PlayerPhysics)
+{
+       if(self.flags & FL_ONGROUND)
+       {
+               if (autocvar_g_multijump > 0)
+                       self.multijump_count = 0;
+               else
+                       self.multijump_count = -2; // the cvar value for infinite jumps is -1, so this needs to be smaller
+       }
+               
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(multijump_PlayerJump)
+{
+       if (self.flags & FL_JUMPRELEASED && !(self.flags & FL_ONGROUND)) // jump button pressed this frame and we are in midair
+               self.multijump_ready = TRUE;  // this is necessary to check that we released the jump button and pressed it again
+       else
+               self.multijump_ready = FALSE;
+               
+       if(!player_multijump && self.multijump_ready && self.multijump_count < autocvar_g_multijump && self.velocity_z > autocvar_g_multijump_speed)
+       {
+               if (autocvar_g_multijump)
+               {
+                       if (autocvar_g_multijump_add == 0) // in this case we make the z velocity == jumpvelocity
+                       {
+                               if (self.velocity_z < autocvar_sv_jumpvelocity)
+                               {
+                                       player_multijump = TRUE;
+                                       self.velocity_z = 0;
+                               }
+                       }
+                       else
+                               player_multijump = TRUE;
+
+                       if(player_multijump)
+                       {
+                               if(self.movement_x != 0 || self.movement_y != 0) // don't remove all speed if player isnt pressing any movement keys
+                               {
+                                       float curspeed;
+                                       vector wishvel, wishdir;
+
+                                       curspeed = max(
+                                               vlen(vec2(self.velocity)), // current xy speed
+                                               vlen(vec2(antilag_takebackavgvelocity(self, max(self.lastteleporttime + sys_frametime, time - 0.25), time))) // average xy topspeed over the last 0.25 secs
+                                       );
+                                       makevectors(self.v_angle_y * '0 1 0');
+                                       wishvel = v_forward * self.movement_x + v_right * self.movement_y;
+                                       wishdir = normalize(wishvel);
+
+                                       self.velocity_x = wishdir_x * curspeed; // allow "dodging" at a multijump
+                                       self.velocity_y = wishdir_y * curspeed;
+                                       // keep velocity_z unchanged!
+                               }
+                               if (autocvar_g_multijump > 0)
+                                       self.multijump_count += 1;
+                       }
+               }
+               self.multijump_ready = FALSE; // require releasing and pressing the jump button again for the next jump
+       }
+
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(multijump_BuildMutatorsString)
+{
+       ret_string = strcat(ret_string, ":multijump");
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(multijump_BuildMutatorsPrettyString)
+{
+       ret_string = strcat(ret_string, ", Multi jump");
+       return FALSE;
+}
+
+MUTATOR_DEFINITION(mutator_multijump)
+{
+       MUTATOR_HOOK(PlayerPhysics, multijump_PlayerPhysics, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerJump, multijump_PlayerJump, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsString, multijump_BuildMutatorsString, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsPrettyString, multijump_BuildMutatorsPrettyString, CBC_ORDER_ANY);
+
+       return FALSE;
+}
diff --git a/qcsrc/server/mutators/mutator_norecoil.qc b/qcsrc/server/mutators/mutator_norecoil.qc
new file mode 100644 (file)
index 0000000..e2ce268
--- /dev/null
@@ -0,0 +1,21 @@
+MUTATOR_HOOKFUNCTION(norecoil_PlayerThink)
+{
+       if(IS_PLAYER(self))
+               self.punchangle = '0 0 0';
+               
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(norecoil_BuildMutatorsString)
+{
+       ret_string = strcat(ret_string, ":norecoil");
+       return FALSE;
+}
+
+MUTATOR_DEFINITION(mutator_norecoil)
+{
+       MUTATOR_HOOK(PlayerPreThink, norecoil_PlayerThink, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsString, norecoil_BuildMutatorsString, CBC_ORDER_ANY);
+
+       return FALSE;
+}
diff --git a/qcsrc/server/mutators/mutator_pinata.qc b/qcsrc/server/mutators/mutator_pinata.qc
new file mode 100644 (file)
index 0000000..e32c08a
--- /dev/null
@@ -0,0 +1,32 @@
+MUTATOR_HOOKFUNCTION(pinata_PlayerDies)
+{
+       float j;
+       for(j = WEP_FIRST; j <= WEP_LAST; ++j)
+       if(WEPSET_CONTAINS_EW(self, j))
+       if(self.switchweapon != j)
+       if(W_IsWeaponThrowable(j))
+               W_ThrowNewWeapon(self, j, FALSE, self.origin + (self.mins + self.maxs) * 0.5, randomvec() * 175 + '0 0 325');
+               
+       return TRUE;
+}
+
+MUTATOR_HOOKFUNCTION(pinata_BuildMutatorsString)
+{
+       ret_string = strcat(ret_string, ":Pinata");
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(pinata_BuildMutatorsPrettyString)
+{
+       ret_string = strcat(ret_string, ", Piñata");
+       return FALSE;
+}
+
+MUTATOR_DEFINITION(mutator_pinata)
+{
+       MUTATOR_HOOK(PlayerDies, pinata_PlayerDies, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsString, pinata_BuildMutatorsString, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsPrettyString, pinata_BuildMutatorsPrettyString, CBC_ORDER_ANY);
+
+       return FALSE;
+}
diff --git a/qcsrc/server/mutators/mutator_random_gravity.qc b/qcsrc/server/mutators/mutator_random_gravity.qc
new file mode 100644 (file)
index 0000000..e2832ac
--- /dev/null
@@ -0,0 +1,51 @@
+// Random Gravity
+//
+// Mutator by Mario
+// Inspired by Player 2
+
+float gravity_delay;
+
+MUTATOR_HOOKFUNCTION(gravity_StartFrame)
+{
+       if(gameover || !cvar("g_random_gravity")) return FALSE; 
+       if(time < gravity_delay) return FALSE;
+       if(time < game_starttime) return FALSE;
+       if(round_handler_IsActive() && !round_handler_IsRoundStarted()) return FALSE;
+       
+    if(random() >= autocvar_g_random_gravity_negative_chance) 
+        cvar_set("sv_gravity", ftos(bound(autocvar_g_random_gravity_min, random() - random() * -autocvar_g_random_gravity_negative, autocvar_g_random_gravity_max)));
+    else
+        cvar_set("sv_gravity", ftos(bound(autocvar_g_random_gravity_min, random() * autocvar_g_random_gravity_positive, autocvar_g_random_gravity_max)));
+       
+       gravity_delay = time + autocvar_g_random_gravity_delay;
+       
+       dprint("Gravity is now: ", ftos(autocvar_sv_gravity), "\n");
+       
+       return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(gravity_BuildMutatorsString)
+{
+       ret_string = strcat(ret_string, ":RandomGravity");
+       return 0;
+}
+
+MUTATOR_HOOKFUNCTION(gravity_BuildMutatorsPrettyString)
+{
+       ret_string = strcat(ret_string, ", Random gravity");
+       return 0;
+}
+
+MUTATOR_DEFINITION(mutator_random_gravity)
+{
+       MUTATOR_HOOK(SV_StartFrame, gravity_StartFrame, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsString, gravity_BuildMutatorsString, CBC_ORDER_ANY);
+       MUTATOR_HOOK(BuildMutatorsPrettyString, gravity_BuildMutatorsPrettyString, CBC_ORDER_ANY);
+       
+       MUTATOR_ONADD
+       {
+               cvar_settemp("sv_gravity", cvar_string("sv_gravity")); // settemp current gravity so it's restored on match end
+       }
+
+       return FALSE;
+}
index 1aa293b..edfcba4 100644 (file)
@@ -1,19 +1,14 @@
 MUTATOR_HOOKFUNCTION(vampire_PlayerDamage)
 {
-       if(time < self.spawnshieldtime)
-               return 0;
-       if(g_minstagib)
+       if(time >= frag_target.spawnshieldtime)
+       if(frag_target != frag_attacker)
+       if(frag_target.deadflag == DEAD_NO)
        {
-               // minstagib: each hit means +1 ammo
-               if(frag_attacker != frag_target)
-                       frag_attacker.ammo_cells += 2; // note: 1 cell was deducted for the shot
+               frag_attacker.health += bound(0, damage_take, frag_target.health);
+               frag_attacker.health = bound(0, frag_attacker.health, autocvar_g_balance_health_limit);
        }
-       else
-       {
-               // otherwise: each hit gets damage back
-               frag_attacker.health = frag_attacker.health + bound(0, damage_take, self.health);
-       }
-       return 0;
+               
+       return FALSE;
 }
 
 MUTATOR_HOOKFUNCTION(vampire_BuildMutatorsString)
index 4f2f87a..b3a3a4b 100644 (file)
@@ -21,6 +21,15 @@ MUTATOR_DECLARATION(mutator_vampire);
 MUTATOR_DECLARATION(mutator_superspec);
 MUTATOR_DECLARATION(mutator_minstagib);
 MUTATOR_DECLARATION(mutator_touchexplode);
+MUTATOR_DECLARATION(mutator_pinata);
+MUTATOR_DECLARATION(mutator_midair);
+MUTATOR_DECLARATION(mutator_bloodloss);
+MUTATOR_DECLARATION(mutator_random_gravity);
+MUTATOR_DECLARATION(mutator_norecoil);
+MUTATOR_DECLARATION(mutator_multijump);
+MUTATOR_DECLARATION(mutator_jump_grunt);
+MUTATOR_DECLARATION(mutator_footsteps);
+MUTATOR_DECLARATION(mutator_melee_only);
 MUTATOR_DECLARATION(mutator_nades);
 
 MUTATOR_DECLARATION(sandbox);
index 021b9b9..db5f416 100644 (file)
@@ -247,7 +247,15 @@ mutators/mutator_physical_items.qc
 mutators/sandbox.qc
 mutators/mutator_superspec.qc
 mutators/mutator_minstagib.qc
-mutators/mutator_touchexplode.qc
+mutators/mutator_pinata.qc
+mutators/mutator_midair.qc
+mutators/mutator_bloodloss.qc
+mutators/mutator_random_gravity.qc
+mutators/mutator_norecoil.qc
+mutators/mutator_multijump.qc
+mutators/mutator_jump_grunt.qc
+mutators/mutator_footsteps.qc
+mutators/mutator_melee_only.qc
 mutators/mutator_nades.qc
 
 ../warpzonelib/anglestransform.qc
index 538dcc6..e22cba6 100644 (file)
@@ -106,34 +106,6 @@ void CreatureFrame (void)
 
                        if(autocvar_g_maxspeed > 0 && velocity_len > autocvar_g_maxspeed)
                                Damage (self, world, world, 100000, DEATH_SHOOTING_STAR, self.origin, '0 0 0');
-                       // play stupid sounds
-                       if (g_footsteps)
-                       if (!gameover)
-                       if (self.flags & FL_ONGROUND)
-                       if (velocity_len > autocvar_sv_maxspeed * 0.6)
-                       if (!self.deadflag)
-                       if (time < self.lastground + 0.2)
-                       {
-                               if((time > self.nextstep) || (time < (self.nextstep - 10.0)))
-                               {
-                                       self.nextstep = time + 0.3 + random() * 0.1;
-                                       trace_dphitq3surfaceflags = 0;
-                                       tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 1', MOVE_NOMONSTERS, self);
-                                       /*
-                                       if(trace_fraction == 1)
-                                               dprint("nohit\n");
-                                       else
-                                               dprint(ftos(trace_dphitq3surfaceflags), "\n");
-                                       */
-                                       if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)
-                                       {
-                                               if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)
-                                                       GlobalSound(globalsound_metalstep, CH_PLAYER, VOICETYPE_PLAYERSOUND);
-                                               else
-                                                       GlobalSound(globalsound_step, CH_PLAYER, VOICETYPE_PLAYERSOUND);
-                                       }
-                               }
-                       }
                }
                
         self.oldvelocity = self.velocity;
index fba705c..0efb77d 100644 (file)
@@ -71,7 +71,7 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht)
         */
 
        // push him so high...
-       vz = sqrt(2 * grav * jumpheight); // NOTE: sqrt(positive)!
+       vz = sqrt(fabs(2 * grav * jumpheight)); // NOTE: sqrt(positive)!
 
        // we start with downwards velocity only if it's a downjump and the jump apex should be outside the jump!
        if(ht < 0)
index 0ba1e7c..b481f46 100644 (file)
@@ -286,14 +286,8 @@ string getwelcomemessage(void)
                modifications = strcat(modifications, ", Cloaked");
        if(g_grappling_hook)
                modifications = strcat(modifications, ", Hook");
-       if(g_midair)
-               modifications = strcat(modifications, ", Midair");
-       if(g_pinata)
-               modifications = strcat(modifications, ", Piñata");
        if(g_weapon_stay && !g_cts)
                modifications = strcat(modifications, ", Weapons stay");
-       if(g_bloodloss > 0)
-               modifications = strcat(modifications, ", Blood loss");
        if(g_jetpack)
                modifications = strcat(modifications, ", Jet pack");
        if(autocvar_g_powerups == 0)
index 0b5d386..ec2d672 100644 (file)
@@ -41,11 +41,9 @@ void W_HLAC_Attack (void)
 
        W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_A, autocvar_g_balance_hlac_primary_damage);
        pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
-       if (!g_norecoil)
-       {
-               self.punchangle_x = random () - 0.5;
-               self.punchangle_y = random () - 0.5;
-       }
+       
+       self.punchangle_x = random () - 0.5;
+       self.punchangle_y = random () - 0.5;
 
        missile = spawn ();
        missile.owner = missile.realowner = self;
@@ -128,12 +126,9 @@ void W_HLAC_Attack2 (void)
 
     for(i=autocvar_g_balance_hlac_secondary_shots;i>0;--i)
         W_HLAC_Attack2f();
-
-       if (!g_norecoil)
-       {
-               self.punchangle_x = random () - 0.5;
-               self.punchangle_y = random () - 0.5;
-       }
+       
+       self.punchangle_x = random () - 0.5;
+       self.punchangle_y = random () - 0.5;
 }
 
 // weapon frames
index 923ed95..a1fa8a9 100644 (file)
@@ -52,11 +52,9 @@ void UziFlash()
 void W_UZI_Attack (float deathtype)
 {
        W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage));
-       if (!g_norecoil)
-       {
-               self.punchangle_x = random () - 0.5;
-               self.punchangle_y = random () - 0.5;
-       }
+       
+       self.punchangle_x = random () - 0.5;
+       self.punchangle_y = random () - 0.5;
 
        // this attack_finished just enforces a cooldown at the end of a burst
        ATTACK_FINISHED(self) = time + autocvar_g_balance_uzi_first_refire * W_WeaponRateFactor();
@@ -129,11 +127,9 @@ void uzi_mode1_fire_auto()
        W_DecreaseAmmo(ammo_nails, autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_reload_ammo);
 
        W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_balance_uzi_sustained_damage);
-       if (!g_norecoil)
-       {
-               self.punchangle_x = random () - 0.5;
-               self.punchangle_y = random () - 0.5;
-       }
+       
+       self.punchangle_x = random () - 0.5;
+       self.punchangle_y = random () - 0.5;
 
        uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.misc_bulletcounter), autocvar_g_balance_uzi_spread_max);
        fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
@@ -156,11 +152,9 @@ void uzi_mode1_fire_auto()
 void uzi_mode1_fire_burst()
 {
        W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_balance_uzi_sustained_damage);
-       if (!g_norecoil)
-       {
-               self.punchangle_x = random () - 0.5;
-               self.punchangle_y = random () - 0.5;
-       }
+       
+       self.punchangle_x = random () - 0.5;
+       self.punchangle_y = random () - 0.5;
 
        fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_burst_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
        endFireBallisticBullet();