]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into mirceakitsune/damage_effects
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 10 May 2011 23:09:07 +0000 (02:09 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 10 May 2011 23:09:07 +0000 (02:09 +0300)
1  2 
defaultXonotic.cfg
qcsrc/client/Main.qc
qcsrc/client/autocvars.qh
qcsrc/common/constants.qh
qcsrc/server/autocvars.qh
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/defs.qh
qcsrc/server/miscfunctions.qc

diff --combined defaultXonotic.cfg
index 925c55354e752dab82fb30c1c1f288e14e8689fb,73d5d635246e93f15955c53141e14c587376fcfd..9faae7d8cdef479f5b4bf77b495b10bd1abb6aab
@@@ -316,6 -316,11 +316,11 @@@ set sv_ready_restart_repeatable 0        "allo
  seta cl_hitsound 1 "play a hit notifier sound when you have hit an enemy"
  set cl_hitsound_antispam_time 0.05 "don't play the hitsound more often than this"
  
+ seta cl_eventchase_death 0 "camera goes into 3rd person mode when the player is dead"
+ seta cl_eventchase_intermission 0 "camera goes into 3rd person mode when the match ends"
+ seta cl_eventchase_distance 140 "final camera distance"
+ seta cl_eventchase_speed 1.3 "how fast the camera slides back, 0 is instant"
  //nifreks lockonrestart feature, used in team-based game modes, if set to 1 and all players readied up no other player can then join the game anymore, useful to block spectators from joining
  set teamplay_lockonrestart 0 "it set to 1 in a team-based game, the teams are locked once all players readied up and the game restarted (no new players can join after restart unless using the server-command unlockteams)"
  
@@@ -350,12 -355,6 +355,12 @@@ set g_telefrags_teamplay 1 "never telef
  set g_telefrags_avoid 1 "when teleporters have a random destination, avoid teleporting to locations where a telefrag would happen"
  set g_teleport_maxspeed 0 "maximum speed that a player can keep when going through a teleporter (if a misc_teleporter_dest also has a cap the smallest one of these will be used), 0 = don't limit, -1 = keep no speed"
  
 +set sv_damageeffect_tick 0.05 "how often the damage effect is updated (particles per second), low values might cause lag"
 +set sv_damageeffect_lifetime 0.04 "how much a damage effect lasts, multiplied by damage amount"
 +set sv_damageeffect_lifetime_max 5 "maximum amount of lifetime a damage effect may have at a time"
 +set cl_damageeffect 1 "enable weapon damage effects on players, values between 0 and 1 specify probability of the effect showing on players each tick (used to reduce the effect)"
 +set cl_damageeffect_gibs 0.15 "probability of the effect showing on gibs each tick (used to reduce the effect)"
 +
  set g_respawn_ghosts 1 "if 1 dead bodies become ghosts and float away when the player respawns"
  set g_respawn_ghosts_speed 5 "the speed with which respawn ghosts float and rotate"
  set g_respawn_ghosts_maxtime 6 "maximum amount of time a respawn ghost can last, minimum time is half this value. 0 disables and ghosts fade when the body would"
@@@ -1191,7 -1190,7 +1196,7 @@@ seta sv_servermodelsonly 
  cl_curl_enabled 1
  cl_curl_maxspeed 300
  sv_curl_defaulturl "http://www.xonotic.com/contentdownload/getmap.php?file="
- set sv_curl_serverpackages_auto 0 "automatically add packs with *.serverpackage files to sv_curl_serverpackages"
+ set sv_curl_serverpackages_auto 1 "automatically add packs with *.serverpackage files to sv_curl_serverpackages"
  
  set sv_motd ""
  
@@@ -1596,7 -1595,7 +1601,7 @@@ gl_texturecompression_lightcubemaps 
  gl_texturecompression_q3bsplightmaps 0
  gl_texturecompression_sky 1
  
- set menu_mouse_absolute 0     "TODO make this seta if the engine understands this right"
+ seta menu_mouse_absolute 1 "use the OS mouse pointer motion for menu"
  seta menu_mouse_speed 1 "speed multiplier for the mouse in the menu (does not affect in-game aiming)"
  set menu_use_default_hostname 1
  alias sethostname "set menu_use_default_hostname 0; hostname $*"
@@@ -2135,9 -2134,3 +2140,3 @@@ exec hud_luminos.cf
  // enable menu syncing
  alias menu_sync "menu_cmd sync"
  alias scoreboard_columns_set  "cl_cmd scoreboard_columns_set $*"
- // BALANCE TESTING (TEMPORARY, PLEASE REMOVE LATER)
- alias balanceSamual   "exec balanceSamual.cfg; restart"
- alias balanceFruitieX "exec balanceXonotic.cfg; restart"
- bind f7 balanceSamual
- bind f8 balanceFruitieX
diff --combined qcsrc/client/Main.qc
index 5a47b6b08042c25e9a5f16e9fb3abe07468883a8,0609b3d177b74e43840d12e454dae0ac4779c4e5..ebae7647ed6dce62b8a4b8a3771aa3ed01d304e6
@@@ -63,7 -63,7 +63,7 @@@ void CSQC_Init(void
        check_unacceptable_compiler_bugs();
  
  #ifdef WATERMARK
-       print(sprintf(_("^4CSQC Build information: %s\n"), WATERMARK()));
+       print(sprintf(_("^4CSQC Build information: ^1%s\n"), WATERMARK()));
  #endif
  
        float i;
        registercmd("hud_save");
        //registercmd("menu_action");
  
-       registercmd("+button3");
-       registercmd("-button3");
-       registercmd("+button4");
-       registercmd("-button4");
        registercmd("+showscores");registercmd("-showscores");
        registercmd("+showaccuracy");registercmd("-showaccuracy");
  
@@@ -203,6 -199,10 +199,10 @@@ void CSQC_Shutdown(void
        if(camera_active)
                cvar_set("chase_active",ftos(chase_active_backup));
  
+       // unset the event chasecam's chase_active
+       if(autocvar_chase_active < 0)
+               cvar_set("chase_active", "0");
        if not(isdemo())
        {
                if not(calledhooks & HOOK_START)
@@@ -367,29 -367,6 +367,6 @@@ float CSQC_ConsoleCommand(string strMes
                else
                        HUD_Panel_ExportCfg(argv(1));
                return true;
-       } else if(strCmd == "+button4") { // zoom
-               // return false, because the message shall be sent to the server anyway (for demos/speccing)
-               if(ignore_plus_zoom)
-               {
-                       --ignore_plus_zoom;
-                       return false;
-               }
-               button_zoom = 1;
-               return true;
-       } else if(strCmd == "-button4") { // zoom
-               if(ignore_minus_zoom)
-               {
-                       --ignore_minus_zoom;
-                       return false;
-               }
-               button_zoom = 0;
-               return true;
-       } else if(strCmd == "+button3") { // secondary
-               button_attack2 = 1;
-               return false;
-       } else if(strCmd == "-button3") { // secondary
-               button_attack2 = 0;
-               return false;
        } else if(strCmd == "+showscores") {
                scoreboard_showscores = true;
                return true;
@@@ -962,12 -939,12 +939,13 @@@ void(float bIsNewEntity) CSQC_Ent_Updat
                case ENT_CLIENT_TUBANOTE: Ent_TubaNote(bIsNewEntity); break;
                case ENT_CLIENT_WARPZONE: WarpZone_Read(bIsNewEntity); break;
                case ENT_CLIENT_WARPZONE_CAMERA: WarpZone_Camera_Read(bIsNewEntity); break;
+               case ENT_CLIENT_WARPZONE_TELEPORTED: WarpZone_Teleported_Read(bIsNewEntity); break;
                case ENT_CLIENT_TRIGGER_MUSIC: Ent_ReadTriggerMusic(); break;
                case ENT_CLIENT_HOOK: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_HOOK); break;
                case ENT_CLIENT_LGBEAM: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_LGBEAM); break;
                case ENT_CLIENT_GAUNTLET: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_GAUNTLET); break;
                case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break;
 +              case ENT_CLIENT_DAMAGEEFFECT: Ent_DamageEffect(); break;
                default:
                        error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype));
                        break;
index 8f84144643d30ac2c22583de71cb34bb6aa81d9b,6d157405b04653cadafb3933e162022de10aec41..e4c3170745ae499e30ac0ebb1cb369ab5eec8c7f
@@@ -305,5 -305,7 +305,9 @@@ float autocvar_viewsize
  float autocvar_crosshair_color_by_health;
  float autocvar_cl_hitsound;
  float autocvar_cl_hitsound_antispam_time;
+ var float autocvar_cl_eventchase_death = 1;
+ var float autocvar_cl_eventchase_intermission = 1;
+ var float autocvar_cl_eventchase_distance = 140;
+ var float autocvar_cl_eventchase_speed = 1.3;
 +float autocvar_cl_damageeffect;
 +float autocvar_cl_damageeffect_gibs;
index 65a64aa3a86d219d800070aa90a33c942fcd389d,64dcaa44e1fb25f1fdb12c3c08767d1286632aad..97db3ad052ec6679847765b01dddca720ab0d15d
@@@ -113,7 -113,7 +113,8 @@@ const float ENT_CLIENT_HOOK = 27
  const float ENT_CLIENT_LGBEAM = 28;
  const float ENT_CLIENT_GAUNTLET = 29;
  const float ENT_CLIENT_ACCURACY = 30;
- const float ENT_CLIENT_DAMAGEEFFECT = 31;
+ const float ENT_CLIENT_WARPZONE_TELEPORTED = 31;
++const float ENT_CLIENT_DAMAGEEFFECT = 32;
  
  const float ENT_CLIENT_TURRET = 40;
  
index 12c4ee67c73254f769c5440d1513d48234b42f50,4d8083fe779f7a1865af178f492fcf110aaf0bcc..d8350efc3441b3db245f0529a9f873639c1d1164
@@@ -646,6 -646,7 +646,7 @@@ float autocvar_g_balance_shotgun_second
  float autocvar_g_balance_shotgun_secondary_melee_range;
  float autocvar_g_balance_shotgun_secondary_melee_swing;
  float autocvar_g_balance_shotgun_secondary_melee_time;
+ float autocvar_g_balance_shotgun_secondary_melee_no_doubleslap;
  float autocvar_g_balance_shotgun_secondary_refire;
  float autocvar_g_balance_shotgun_reload_ammo;
  float autocvar_g_balance_shotgun_reload_time;
@@@ -1220,9 -1221,6 +1221,9 @@@ float autocvar_sv_warsowbunny_topspeed
  float autocvar_sv_warsowbunny_turnaccel;
  string autocvar_sv_weaponstats_file;
  float autocvar_sv_gibhealth;
 +float autocvar_sv_damageeffect_tick;
 +float autocvar_sv_damageeffect_lifetime;
 +float autocvar_sv_damageeffect_lifetime_max;
  float autocvar_sys_ticrate;
  float autocvar_teamplay_lockonrestart;
  float autocvar_teamplay_mode;
index 1cad2e2acd5e2c3f5d41e248df7add2a35bf146c,bd1149b6277093599beb92ae15b519c0d9f8f637..aed2e2b575d7f14924e0e2ecba1b4d960cda4785
@@@ -328,13 -328,28 +328,28 @@@ entity SelectSpawnPoint (float anypoint
        if(anypoint)
                teamcheck = -1;
        else if(have_team_spawns > 0)
-               teamcheck = self.team; // MUST be team
-       else if(have_team_spawns == 0 && have_noteam_spawns)
+       {
+               if(have_team_spawns_forteam[self.team] == 0)
+               {
+                       // we request a spawn for a team, and we have team
+                       // spawns, but that team has no spawns?
+                       if(have_team_spawns[0])
+                               // try noteam spawns
+                               teamcheck = 0;
+                       else
+                               // if not, any spawn has to do
+                               teamcheck = -1;
+               }
+               else
+                       teamcheck = self.team; // MUST be team
+       }
+       else if(have_team_spawns == 0 && have_team_spawns[0])
                teamcheck = 0; // MUST be noteam
        else
                teamcheck = -1;
                // if we get here, we either require team spawns but have none, or we require non-team spawns and have none; use any spawn then
  
        // get the list of players
        playerlist = findchain(classname, "player");
        // get the entire list of spots
@@@ -866,8 -881,6 +881,8 @@@ void PutClientInServer (void
  
                RemoveGrapplingHook(self); // Wazat's Grappling Hook
  
 +              Violence_DamageEffect_Remove(self);
 +
                self.classname = "player";
                self.wasplayer = TRUE;
                self.iscreature = TRUE;
@@@ -1526,7 -1539,7 +1541,7 @@@ void ClientConnect (void
        DecodeLevelParms();
  
  #ifdef WATERMARK
-       sprint(self, strcat("^4SVQC Build information: ", WATERMARK(), "\n"));
+       sprint(self, strcat("^4SVQC Build information: ^1", WATERMARK(), "\n"));
  #endif
  
        self.classname = "player_joining";
@@@ -1979,7 -1992,6 +1994,7 @@@ void respawn(void
                pointparticles(particleeffectnum("respawn_ghost"), self.origin, '0 0 0', 1);
                if(autocvar_g_respawn_ghosts_maxtime)
                        SUB_SetFade (self, time + autocvar_g_respawn_ghosts_maxtime / 2 + random () * (autocvar_g_respawn_ghosts_maxtime - autocvar_g_respawn_ghosts_maxtime / 2), 1.5);
 +              Violence_DamageEffect_Remove(self);
        }
  
        CopyBody(1);
@@@ -2617,6 -2629,8 +2632,8 @@@ void() nexball_setstatus
  .float items_added;
  void PlayerPreThink (void)
  {
+       WarpZone_PlayerPhysics_FixVAngle();
        self.stat_game_starttime = game_starttime;
        self.stat_allow_oldnexbeam = autocvar_g_allow_oldnexbeam;
        self.stat_leadlimit = autocvar_leadlimit;
        }
  
        if(!zoomstate_set)
-               SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_SNIPERRIFLE && autocvar_g_balance_sniperrifle_secondary == 0));
+               SetZoomState(self.BUTTON_ZOOM || self.BUTTON_ZOOMSCRIPT || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_SNIPERRIFLE && autocvar_g_balance_sniperrifle_secondary == 0));
  
        float oldspectatee_status;
        oldspectatee_status = self.spectatee_status;
index cae07abd4aebb9d3ac82ad31eb924e6573b8cd18,a8a752269f3f2613ab5d4794234dc271c71b602f..235fa72cd0b8da94d4d84291d234d15a110c4b09
@@@ -146,9 -146,6 +146,9 @@@ void CopyBody(float keepvelocity
  
        Drag_MoveDrag(oldself, self);
  
 +      Violence_DamageEffect_Copy(oldself, self);
 +
 +      self.owner = oldself;
        self = oldself;
  }
  
@@@ -191,6 -188,7 +191,7 @@@ void player_setupanimsformodel(
        self.anim_forwardleft = '20 1 1';
        self.anim_backright = '21 1 1';
        self.anim_backleft  = '22 1 1';
+       self.anim_melee = '23 1 1';
        animparseerror = FALSE;
        animfilename = strcat(self.model, ".animinfo");
        animfile = fopen(animfilename, FILE_READ);
                self.anim_forwardleft  = animparseline(animfile);
                self.anim_backright    = animparseline(animfile);
                self.anim_backleft     = animparseline(animfile);
+               self.anim_melee        = animparseline(animfile);
                fclose(animfile);
  
                // derived anims
@@@ -372,7 -371,6 +374,7 @@@ void PlayerCorpseDamage (entity inflict
                Violence_GibSplash(self, 1, 1, attacker);
                self.modelindex = 0; // restore later
                self.solid = SOLID_NOT; // restore later
 +              self.takedamage = DAMAGE_NO; // restore later
        }
  }
  
diff --combined qcsrc/server/defs.qh
index e430e3e0909612a4f785fa7669f1befd279adbc8,f6ddad26946b0a2a61fd141b1f476e995323dfa8..47da35c1e14ea435be7adafbfce1c6eb3426b7ea
@@@ -2,16 -2,17 +2,17 @@@
  
  float require_spawnfunc_prefix; // if this float exists, only functions with spawnfunc_ name prefix qualify as spawn functions
  
- #define BUTTON_ATCK   button0
- #define BUTTON_JUMP   button2
- #define BUTTON_ATCK2  button3
- #define BUTTON_ZOOM   button4
- #define BUTTON_CROUCH button5
- #define BUTTON_HOOK   button6
- #define BUTTON_INFO   button7
- #define BUTTON_CHAT   buttonchat
- #define BUTTON_USE    buttonuse
- #define BUTTON_DRAG   button8
+ #define BUTTON_ATCK       button0
+ #define BUTTON_JUMP       button2
+ #define BUTTON_ATCK2      button3
+ #define BUTTON_ZOOM       button4
+ #define BUTTON_CROUCH     button5
+ #define BUTTON_HOOK       button6
+ #define BUTTON_INFO       button7
+ #define BUTTON_CHAT       buttonchat
+ #define BUTTON_USE        buttonuse
+ #define BUTTON_DRAG       button8
+ #define BUTTON_ZOOMSCRIPT button9
  
  // Globals
  
@@@ -147,6 -148,7 +148,7 @@@ float maxclients
  .vector anim_forwardleft; // player running forward and left
  .vector anim_backright; // player running backward and right
  .vector anim_backleft; // player running back and left
+ .vector anim_melee; // player doing the melee action
  
  // weapon animation vectors:
  .vector anim_fire1;
@@@ -410,7 -412,7 +412,7 @@@ float TemporaryDB
  
  float some_spawn_has_been_used;
  float have_team_spawns; // 0 = no team spawns requested, -1 = team spawns requested but none found, 1 = team spawns requested and found
- float have_noteam_spawns; // 0 = no no-team spawns, 1 = no-team spawns exist
+ float have_team_spawns_forteam[17]; // 0 = this team has no spawns, 1 = this team has spawns; team 0 is the "no-team"
  
  // set when showing a kill countdown
  .entity killindicator;
@@@ -505,8 -507,6 +507,8 @@@ float GetPlayerSoundSampleField_notFoun
  .float cvar_cl_voice_directional;
  .float cvar_cl_voice_directional_taunt_attenuation;
  
 +.float cvar_cl_damageeffect;
 +
  .float version_mismatch;
  
  float independent_players;
index 0d75fe890151c6713a892b6230c7a02cd150438c,0c8162b54464275c9df9537dd1aad11d4f9af682..ef7fba5cf4bea2cc53ef22dab84a8a138d977e26
@@@ -236,8 -236,7 +236,7 @@@ void relocate_spawnpoint(
      if (have_team_spawns != 0)
          if (self.team)
              have_team_spawns = 1;
-     if (!self.team)
-         have_noteam_spawns = 1;
+     have_team_spawns_forteam[self.team] = 1;
  
      if (autocvar_r_showbboxes)
      {
@@@ -602,7 -601,6 +601,7 @@@ void GetCvars(float f
        GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriorities[9], "cl_weaponpriority9", W_FixWeaponOrder_AllowIncomplete);
        GetCvars_handleFloat(s, f, cvar_cl_weaponimpulsemode, "cl_weaponimpulsemode");
        GetCvars_handleFloat(s, f, cvar_cl_autotaunt, "cl_autotaunt");
 +      GetCvars_handleFloat(s, f, cvar_cl_damageeffect, "cl_damageeffect");
        GetCvars_handleFloat(s, f, cvar_cl_noantilag, "cl_noantilag");
        GetCvars_handleFloat(s, f, cvar_cl_voice_directional, "cl_voice_directional");
        GetCvars_handleFloat(s, f, cvar_cl_voice_directional_taunt_attenuation, "cl_voice_directional_taunt_attenuation");