]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into mirceakitsune/damage_effects
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 13 May 2011 20:11:55 +0000 (23:11 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 13 May 2011 20:11:55 +0000 (23:11 +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

diff --combined defaultXonotic.cfg
index 9faae7d8cdef479f5b4bf77b495b10bd1abb6aab,7a7daae6d279ba96c99ba32241d08ea6d0ba8721..99dcfd6213e189c49c9c5ef3cdf22547027d2e63
@@@ -205,6 -205,9 +205,9 @@@ seta crosshair_ring_nex_currentcharge_m
  seta crosshair_ring_minelayer 1
  seta crosshair_ring_minelayer_alpha 0.15
  
+ seta crosshair_ring_hagar 1
+ seta crosshair_ring_hagar_alpha 0.15
  seta crosshair_ring_reload 1 "main cvar to enable or disable ammo crosshair rings"
  seta crosshair_ring_reload_size 2.5   "reload ring size"
  seta crosshair_ring_reload_alpha 0.2  "reload ring alpha"
@@@ -355,12 -358,6 +358,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"
diff --combined qcsrc/client/Main.qc
index ebae7647ed6dce62b8a4b8a3771aa3ed01d304e6,41685f288beadf781c0c4329b236e6050f6fd3ad..1328147c77eed637ff7d585780a07613c616cbdf
@@@ -945,7 -945,6 +945,7 @@@ void(float bIsNewEntity) CSQC_Ent_Updat
                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;
@@@ -1078,6 -1077,8 +1078,8 @@@ void Ent_Init(
  
        minelayer_maxmines = ReadByte();
  
+       hagar_maxrockets = ReadByte();
        g_trueaim_minrange = ReadCoord();
  
        if(!postinit)
index e4c3170745ae499e30ac0ebb1cb369ab5eec8c7f,50b3e5bd90e1c7fb6e1d3369589dc2df9c5c7334..3294a896834973b9e54795fc53bd631b9717a608
@@@ -112,6 -112,8 +112,8 @@@ float autocvar_crosshair_ring
  float autocvar_crosshair_ring_inner;
  float autocvar_crosshair_ring_minelayer;
  float autocvar_crosshair_ring_minelayer_alpha;
+ float autocvar_crosshair_ring_hagar;
+ float autocvar_crosshair_ring_hagar_alpha;
  float autocvar_crosshair_ring_nex;
  float autocvar_crosshair_ring_nex_alpha;
  float autocvar_crosshair_ring_nex_currentcharge_movingavg_rate;
@@@ -309,5 -311,3 +311,5 @@@ var float autocvar_cl_eventchase_death 
  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 97db3ad052ec6679847765b01dddca720ab0d15d,b6e928f610ed8ec0ec86c5853f7e8e40358af2ae..96757d25732a21a7c28758843d88af80fef629be
@@@ -63,6 -63,7 +63,7 @@@ const float TE_CSQC_NOTIFY = 112
  const float TE_CSQC_WEAPONCOMPLAIN = 113;
  const float TE_CSQC_NEX_SCOPE = 116;
  const float TE_CSQC_MINELAYER_MAXMINES = 117;
+ const float TE_CSQC_HAGAR_MAXROCKETS = 118;
  
  const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
  const float RACE_NET_CHECKPOINT_CLEAR = 1;
@@@ -114,7 -115,6 +115,7 @@@ const float ENT_CLIENT_LGBEAM = 28
  const float ENT_CLIENT_GAUNTLET = 29;
  const float ENT_CLIENT_ACCURACY = 30;
  const float ENT_CLIENT_WARPZONE_TELEPORTED = 31;
 +const float ENT_CLIENT_DAMAGEEFFECT = 32;
  
  const float ENT_CLIENT_TURRET = 40;
  
@@@ -319,6 -319,7 +320,7 @@@ const float STAT_NEX_CHARGEPOOL = 53
  const float STAT_HIT_TIME = 54;
  const float STAT_TYPEHIT_TIME = 55;
  const float STAT_LAYED_MINES = 56;
+ const float STAT_HAGAR_LOAD = 57;
  
  // see DP source, quakedef.h
  const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
@@@ -628,6 -629,7 +630,7 @@@ float WR_RELOAD         = 9; // (SVQC) 
  float WR_RESETPLAYER    = 10; // (SVQC) does not need to do anything
  float WR_IMPACTEFFECT = 11; // (CSQC) impact effect
  float WR_SWITCHABLE   = 12; // (CSQC) impact effect
+ float WR_PLAYERDEATH    = 13; // (SVQC) does not need to do anything
  
  
  float HUD_PANEL_WEAPONS               = 0;
index d8350efc3441b3db245f0529a9f873639c1d1164,4af84f04782ea00057a6b472f20e73ac24a922ee..8135b999667742349f024ff923ff04b753e0b69c
@@@ -321,6 -321,12 +321,12 @@@ float autocvar_g_balance_hagar_primary_
  float autocvar_g_balance_hagar_primary_refire;
  float autocvar_g_balance_hagar_primary_speed;
  float autocvar_g_balance_hagar_secondary;
+ float autocvar_g_balance_hagar_secondary_load;
+ float autocvar_g_balance_hagar_secondary_load_speed;
+ float autocvar_g_balance_hagar_secondary_load_max;
+ float autocvar_g_balance_hagar_secondary_load_hold;
+ float autocvar_g_balance_hagar_secondary_load_releasedeath;
+ float autocvar_g_balance_hagar_secondary_load_abort;
  float autocvar_g_balance_hagar_secondary_ammo;
  float autocvar_g_balance_hagar_secondary_damage;
  float autocvar_g_balance_hagar_secondary_edgedamage;
@@@ -1221,9 -1227,6 +1227,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 aed2e2b575d7f14924e0e2ecba1b4d960cda4785,3ba9b3f8907b26488069d8dc7c9fc7d20761c463..0a56c7e4595a1e7ef731436628b6967200427282
@@@ -881,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;
                        if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
                                self.weapon_load[j] = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
                }
+               self.weapon_forbidchange = FALSE;
  
                oldself = self;
                self = spot;
@@@ -1138,6 -1137,7 +1139,7 @@@ float ClientInit_SendEntity(entity to, 
        WriteByte(MSG_ENTITY, autocvar_g_balance_sniperrifle_secondary); // client has to know if it should zoom or not
        WriteByte(MSG_ENTITY, serverflags); // client has to know if it should zoom or not
        WriteByte(MSG_ENTITY, autocvar_g_balance_minelayer_limit); // minelayer max mines
+       WriteByte(MSG_ENTITY, autocvar_g_balance_hagar_secondary_load_max); // hagar max loadable rockets
        WriteCoord(MSG_ENTITY, autocvar_g_trueaim_minrange);
        return TRUE;
  }
@@@ -1994,7 -1994,6 +1996,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);
@@@ -2387,6 -2386,7 +2389,7 @@@ void SpectateCopy(entity spectatee) 
        self.weapon = spectatee.weapon;
        self.nex_charge = spectatee.nex_charge;
        self.nex_chargepool_ammo = spectatee.nex_chargepool_ammo;
+       self.hagar_load = spectatee.hagar_load;
        self.minelayer_mines = spectatee.minelayer_mines;
        self.punchangle = spectatee.punchangle;
        self.view_ofs = spectatee.view_ofs;
@@@ -2746,7 -2746,26 +2749,26 @@@ void PlayerPreThink (void
                                        self.glowmod_z = -1;
                        }
                        else
+                       {
+                               // set weapon and player glowmod
                                self.glowmod = colormapPaletteColor(self.clientcolors & 0x0F, TRUE) * 2;
+                               if(self.weapon == WEP_NEX && autocvar_g_balance_nex_charge)
+                               {
+                                       self.weaponentity_glowmod_x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_animlimit);
+                                       self.weaponentity_glowmod_y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_animlimit);
+                                       self.weaponentity_glowmod_z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_animlimit);
+                                       if(self.nex_charge > autocvar_g_balance_nex_charge_animlimit)
+                                       {
+                                               self.weaponentity_glowmod_x = self.weaponentity_glowmod_x + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_full * (self.nex_charge - autocvar_g_balance_nex_charge_animlimit) / (1 - autocvar_g_balance_nex_charge_animlimit);
+                                               self.weaponentity_glowmod_y = self.weaponentity_glowmod_y + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_full * (self.nex_charge - autocvar_g_balance_nex_charge_animlimit) / (1 - autocvar_g_balance_nex_charge_animlimit);
+                                               self.weaponentity_glowmod_z = self.weaponentity_glowmod_z + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (self.nex_charge - autocvar_g_balance_nex_charge_animlimit) / (1 - autocvar_g_balance_nex_charge_animlimit);
+                                       }
+                               }
+                               else
+                                       self.weaponentity_glowmod = self.glowmod;
+                       }
                        player_powerups();
                }
  
index 235fa72cd0b8da94d4d84291d234d15a110c4b09,202dce58c15b487902a2d17ef9ce06928d9d6566..690cf1271f41f69c1fa4c33bf9abf8ad5a57da19
@@@ -146,9 -146,6 +146,9 @@@ void CopyBody(float keepvelocity
  
        Drag_MoveDrag(oldself, self);
  
 +      Violence_DamageEffect_Copy(oldself, self);
 +
 +      self.owner = oldself;
        self = oldself;
  }
  
@@@ -374,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
        }
  }
  
@@@ -633,6 -629,7 +633,7 @@@ void PlayerDamage (entity inflictor, en
                frag_inflictor = inflictor;
                frag_target = self;
                MUTATOR_CALLHOOK(PlayerDies);
+               weapon_action(self.weapon, WR_PLAYERDEATH);
  
                if(self.flagcarried)
                {
diff --combined qcsrc/server/defs.qh
index 47da35c1e14ea435be7adafbfce1c6eb3426b7ea,543dc085fb12a7fedcba89b48f2e38f7631d75f6..13447e027c3076135e211157d1719da88c22fedc
@@@ -210,6 -210,7 +210,7 @@@ void w_clear()
  void w_ready();
  // VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies)
  .float weapon_nextthink;
+ .float weapon_forbidchange;
  .void() weapon_think;
  
  //float       PLAYER_WEAPONSELECTION_DELAY = );
@@@ -507,8 -508,6 +508,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;
@@@ -662,6 -661,8 +663,8 @@@ string deathmessage
  .float nex_charge_rottime;
  .float nex_chargepool_ammo;
  
+ .float hagar_load;
  float allowed_to_spawn; // boolean variable used by the clan arena code to determine if a player can spawn (after the round has ended)
  
  float serverflags;