]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into samual/change_default_balance
authorRudolf Polzer <divVerent@xonotic.org>
Wed, 23 Mar 2011 06:16:50 +0000 (07:16 +0100)
committerRudolf Polzer <divVerent@xonotic.org>
Wed, 23 Mar 2011 06:16:50 +0000 (07:16 +0100)
effectinfo.txt
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/hud.qc
qcsrc/client/waypointsprites.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/w_crylink.qc
qcsrc/server/w_hlac.qc
qcsrc/server/w_hook.qc
qcsrc/server/w_uzi.qc

index 1ea0ce45b678abaaa38263e32b61f429ed52c6f4..e2b476ce8a0726bbca58256968631ad979045a17 100644 (file)
@@ -1691,11 +1691,11 @@ effect crylink_impact
 countabsolute 1
 type decal
 tex 47 47
-size 8 8
+size 24 24
 alpha 256 256 0
 originjitter 12 12 12
-//lightradius 60
-//lightradiusfade 300
+//lightradius 200
+//lightradiusfade 800
 //lightcolor 3.2 0.4 4
 // purple flare effect
 effect crylink_impact
@@ -1703,34 +1703,34 @@ countabsolute 1
 type static
 tex 39 39
 color 0x504060 0x504060
-size 8 8
+size 24 24
 alpha 256 256 512
 // purple sparks
 effect crylink_impact
-count 10
+count 40
 type spark
 tex 41 41
 color 0xA040C0 0xA040C0
 bounce 2
-size 1 2
+size 6 6
 alpha 256 256 1024
-velocityjitter 256 256 256
+velocityjitter 512 512 512
 // purple splash
 effect crylink_impact
 count 1.5
 type static
 color 0xE070FF 0xE070FF
-size 8 8
+size 16 16
 alpha 256 256 512
-velocityjitter 8 8 8
+velocityjitter 32 32 32
 // purple splash
 effect crylink_impact
-count 1.5
+count 3
 type static
 color 0xE070FF 0xE070FF
-size 8 8
+size 16 16
 alpha 256 256 1024
-velocityjitter 32 32 32
+velocityjitter 256 256 256
 
 
 
index bec75c2ee06f920b989780955c77211ccf9bc231..91ce464793bcbc0f33879a90222c2934165fdb3a 100644 (file)
@@ -151,6 +151,9 @@ void CSQC_Init(void)
        }
        Tuba_Precache();
 
+       if(autocvar_cl_reticle_item_normal) precache_pic("gfx/reticle_normal");
+       if(autocvar_cl_reticle_item_nex) precache_pic("gfx/reticle_nex");
+
        get_mi_min_max_texcoords(1); // try the CLEVER way first
        minimapname = strcat("gfx/", mi_shortname, "_radar.tga");
        shortmapname = mi_shortname;
index 6cab5fefd37009350370ae3fddeb0796674f1ca6..5d7f1ed561cdc6873c2e34beea7957d97bbd9acc 100644 (file)
@@ -644,35 +644,36 @@ void CSQC_UpdateView(float w, float h)
        else if(activeweapon == WEP_NEX && button_attack2 || activeweapon == WEP_SNIPERRIFLE && button_attack2)
                reticle_type = 2; // nex zoom
 
-       if(autocvar_cl_reticle_stretch)
+       if (reticle_type)
        {
-               reticle_size_x = vid_conwidth;
-               reticle_size_y = vid_conheight;
-               reticle_pos_x = 0;
-               reticle_pos_y = 0;
-       }
-       else
-       {
-               reticle_size_x = max(vid_conwidth, vid_conheight);
-               reticle_size_y = max(vid_conwidth, vid_conheight);
-               reticle_pos_x = (vid_conwidth - reticle_size_x) / 2;
-               reticle_pos_y = (vid_conheight - reticle_size_y) / 2;
-       }
+               if(autocvar_cl_reticle_stretch)
+               {
+                       reticle_size_x = vid_conwidth;
+                       reticle_size_y = vid_conheight;
+                       reticle_pos_x = 0;
+                       reticle_pos_y = 0;
+               }
+               else
+               {
+                       reticle_size_x = max(vid_conwidth, vid_conheight);
+                       reticle_size_y = max(vid_conwidth, vid_conheight);
+                       reticle_pos_x = (vid_conwidth - reticle_size_x) / 2;
+                       reticle_pos_y = (vid_conheight - reticle_size_y) / 2;
+               }
 
-       f = current_zoomfraction;
-       if(zoomscript_caught)
-               f = 1;
-       if(autocvar_cl_reticle_item_normal)
-       {
-               precache_pic("gfx/reticle_normal");
-               if(reticle_type == 1 && f)
-                       drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', f * autocvar_cl_reticle_item_normal, DRAWFLAG_NORMAL);
-       }
-       if(autocvar_cl_reticle_item_nex)
-       {
-               precache_pic("gfx/reticle_nex");
-               if(reticle_type == 2 && f)
-                       drawpic(reticle_pos, "gfx/reticle_nex", reticle_size, '1 1 1', f * autocvar_cl_reticle_item_nex, DRAWFLAG_NORMAL);
+               f = current_zoomfraction;
+               if(zoomscript_caught)
+                       f = 1;
+               if(autocvar_cl_reticle_item_normal)
+               {
+                       if(reticle_type == 1 && f)
+                               drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', f * autocvar_cl_reticle_item_normal, DRAWFLAG_NORMAL);
+               }
+               if(autocvar_cl_reticle_item_nex)
+               {
+                       if(reticle_type == 2 && f)
+                               drawpic(reticle_pos, "gfx/reticle_nex", reticle_size, '1 1 1', f * autocvar_cl_reticle_item_nex, DRAWFLAG_NORMAL);
+               }
        }
 
 
index 1053c5e5ff5178c2dfff9035f0b5d2a8cb5239a7..4dfb60c2df4d040fb17aff874bcecf767902d313 100644 (file)
@@ -1619,7 +1619,7 @@ void HUD_Weapons(void)
        }
 
        // TODO make this configurable
-       if(weaponorder_bypriority != autocvar_cl_weaponpriority)
+       if(weaponorder_bypriority != autocvar_cl_weaponpriority || !weaponorder[0])
        {
                if(weaponorder_bypriority)
                        strunzone(weaponorder_bypriority);
index 8ecadaeb857f72f4745a33b2cd3d2748e774a388..bcd8c433e07b185d3eb997f60d976daee526b2d2 100644 (file)
@@ -406,6 +406,29 @@ void Ent_WaypointSprite()
        self.entremove = Ent_RemoveWaypointSprite;
 }
 
+void WaypointSprite_Load_Frames(string ext)
+{
+       float dh, n, i, o, f;
+       string s, sname, sframes;
+       dh = search_begin(strcat("models/sprites/*_frame*", ext), FALSE, FALSE);
+       if (dh < 0)
+                return;
+       float ext_len = strlen(ext);
+       n = search_getsize(dh);
+       for(i = 0; i < n; ++i)
+       {
+               s = search_getfilename(dh, i);
+               s = substring(s, 15, strlen(s) - 15 - ext_len); // strip models/sprites/ and extension
+
+               o = strstrofs(s, "_frame", 0);
+               sname = strcat("/spriteframes/", substring(s, 0, o));
+               sframes = substring(s, o + 6, strlen(s) - o - 6);
+               f = stof(sframes) + 1;
+               db_put(tempdb, sname, ftos(max(f, stof(db_get(tempdb, sname)))));
+       }
+       search_end(dh);
+}
+
 void WaypointSprite_Load()
 {
        waypointsprite_fadedistance = vlen(mi_scale);
@@ -428,38 +451,8 @@ void WaypointSprite_Load()
 
        if(!waypointsprite_initialized)
        {
-               float dh, n, i, o, f;
-               string s, sname, sframes;
-
-               dh = search_begin("models/sprites/*_frame*.tga", FALSE, FALSE);
-               n = search_getsize(dh);
-               for(i = 0; i < n; ++i)
-               {
-                       s = search_getfilename(dh, i);
-                       s = substring(s, 15, strlen(s) - 15 - 4); // strip models/sprites/ and .tga
-
-                       o = strstrofs(s, "_frame", 0);
-                       sname = strcat("/spriteframes/", substring(s, 0, o));
-                       sframes = substring(s, o + 6, strlen(s) - o - 6);
-                       f = stof(sframes) + 1;
-                       db_put(tempdb, sname, ftos(max(f, stof(db_get(tempdb, sname)))));
-               }
-               search_end(dh);
-
-               dh = search_begin("models/sprites/*_frame*.jpg", FALSE, FALSE);
-               n = search_getsize(dh);
-               for(i = 0; i < n; ++i)
-               {
-                       s = search_getfilename(dh, i);
-                       s = substring(s, 15, strlen(s) - 15 - 4); // strip models/sprites/ and .jpg
-
-                       o = strstrofs(s, "_frame", 0);
-                       sname = strcat("/spriteframes/", substring(s, 0, o));
-                       sframes = substring(s, o + 6, strlen(s) - o - 6);
-                       f = stof(sframes) + 1;
-                       db_put(tempdb, sname, ftos(max(f, stof(db_get(tempdb, sname)))));
-               }
-               search_end(dh);
+               WaypointSprite_Load_Frames(".tga");
+               WaypointSprite_Load_Frames(".jpg");
                waypointsprite_initialized = true;
        }
 }
index 2e5a8434d74a91848f20eb9891a3ba735948dfc6..f9543785ba484588bb4e6d235cd1067d8537360d 100644 (file)
@@ -1640,15 +1640,14 @@ void W_ReloadedAndReady()
        self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
 
        // if the gun uses no ammo, max out weapon load, else decrease ammo as we increase weapon load
-       if(!self.reload_ammo_min)
+       if(!self.reload_ammo_min || self.items & IT_UNLIMITED_WEAPON_AMMO)
                self.clip_load = self.reload_ammo_amount;
        else
        {
                while(self.clip_load < self.reload_ammo_amount && self.(self.current_ammo)) // make sure we don't add more ammo than we have
                {
                        self.clip_load += 1;
-                       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-                               self.(self.current_ammo) -= 1;
+                       self.(self.current_ammo) -= 1;
                }
        }
        self.weapon_load[self.weapon] = self.clip_load;
@@ -1693,6 +1692,7 @@ void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, stri
 
        // no ammo, so nothing to load
        if(!self.(self.current_ammo) && self.reload_ammo_min)
+       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
        {
                if(clienttype(self) == CLIENTTYPE_REAL && self.reload_complain < time)
                {
index c3d14fd4cf67cd9df9bb2418370ac33a5b4e9894..95a96344fedc8e0821e00af4efa992e74d861045 100644 (file)
@@ -583,6 +583,7 @@ float w_crylink(float req)
                                }
                                self.crylink_waitrelease = 0;
                                if(!w_crylink(WR_CHECKAMMO1) && !w_crylink(WR_CHECKAMMO2))
+                               if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
                                {
                                        // ran out of ammo!
                                        self.cnt = WEP_CRYLINK;
index 8bb4c1de9d8da41a36368aae8b1b94533f28c655..0cf25e4f60c10922e09dd9c3273ec88bd889116d 100644 (file)
@@ -137,6 +137,7 @@ void HLAC_fire1_02()
        if (self.BUTTON_ATCK)
        {
                if (!weapon_action(self.weapon, WR_CHECKAMMO1))
+               if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
                {
                        W_SwitchWeapon_Force(self, w_getbestweapon(self));
                        w_ready();
index c3a1768beb0ab9335031a8762284292ca8711cea..80c40b10fd8704cc94f46ec2640d30fafc1f834c 100644 (file)
@@ -62,8 +62,7 @@ void W_Hook_Attack2()
 {
        local entity gren;
 
-       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               W_DecreaseAmmo(ammo_cells, autocvar_g_balance_hook_secondary_ammo, FALSE);
+       W_DecreaseAmmo(ammo_cells, autocvar_g_balance_hook_secondary_ammo, FALSE);
        W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", CHAN_WEAPON, autocvar_g_balance_hook_secondary_damage);
 
        gren = spawn ();
@@ -126,8 +125,7 @@ float w_hook(float req)
                        if (time > self.hook_refire)
                        if (weapon_prepareattack(0, -1))
                        {
-                               if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-                                       W_DecreaseAmmo(ammo_fuel, autocvar_g_balance_hook_primary_fuel, FALSE);
+                               W_DecreaseAmmo(ammo_fuel, autocvar_g_balance_hook_primary_fuel, FALSE);
                                self.hook_state |= HOOK_FIRING;
                                weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hook_primary_animtime, w_ready);                         
                        }
index e4531680035608473b0a3e286a43bfe52465a076..2f5b9bc7833badd1167a4205bc32c940e7550a1c 100644 (file)
@@ -83,6 +83,7 @@ void uzi_fire1_02()
        if (self.BUTTON_ATCK)
        {
                if (!weapon_action(self.weapon, WR_CHECKAMMO2))
+               if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
                {
                        W_SwitchWeapon_Force(self, w_getbestweapon(self));
                        w_ready();
@@ -113,6 +114,7 @@ void uzi_mode1_fire_auto()
        }
 
        if (!weapon_action(self.weapon, WR_CHECKAMMO1))
+       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
        {
                W_SwitchWeapon_Force(self, w_getbestweapon(self));
                w_ready();