]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into samual/menu_updates
authorRudolf Polzer <divverent@alientrap.org>
Sat, 21 Jan 2012 19:01:19 +0000 (20:01 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 21 Jan 2012 19:01:19 +0000 (20:01 +0100)
balance25.cfg
balanceFruitieX.cfg
balanceXPM.cfg
balanceXonotic.cfg
defaultXonotic.cfg
qcsrc/Makefile
qcsrc/common/util.qc
qcsrc/menu/xonotic/colorpicker_string.c
qcsrc/server/autocvars.qh
qcsrc/server/cheats.qc
qcsrc/server/w_fireball.qc

index cd770d72eaae8cbfc197ba5fdb95358c762883c9..420020622c5c7b3f124370841597d0b4cf800bec 100644 (file)
@@ -741,7 +741,6 @@ set g_balance_tuba_force 40
 set g_balance_tuba_pitchstep 6
 // }}}
 // {{{ fireball
-set g_balance_fireball_primary_ammo 40
 set g_balance_fireball_primary_animtime 0.15
 set g_balance_fireball_primary_bfgdamage 100
 set g_balance_fireball_primary_bfgforce 0
@@ -761,7 +760,6 @@ set g_balance_fireball_primary_refire 5
 set g_balance_fireball_primary_refire2 0
 set g_balance_fireball_primary_speed 650
 set g_balance_fireball_primary_spread 0
-set g_balance_fireball_secondary_ammo 5
 set g_balance_fireball_secondary_animtime 0.3
 set g_balance_fireball_secondary_damage 40
 set g_balance_fireball_secondary_damageforcescale 4
@@ -777,8 +775,6 @@ set g_balance_fireball_secondary_speed 900
 set g_balance_fireball_secondary_speed_up 100
 set g_balance_fireball_secondary_speed_z 0
 set g_balance_fireball_secondary_spread 0
-set g_balance_fireball_reload_ammo 0 //default: 60
-set g_balance_fireball_reload_time 2
 // }}}
 // {{{ seeker
 set g_balance_seeker_type 0 // 0 = old seeker, 1 = new seeker. THIS IS A TEMPORARY CVAR FOR TESTING, will be removed later.
index 2218946272587e8d0eeebe1db0b632bdfb031254..221f725a5284cb855e060f3c863f9e8c8c1250a2 100644 (file)
@@ -741,7 +741,6 @@ set g_balance_tuba_force 40
 set g_balance_tuba_pitchstep 6
 // }}}
 // {{{ fireball
-set g_balance_fireball_primary_ammo 40
 set g_balance_fireball_primary_animtime 0.2
 set g_balance_fireball_primary_bfgdamage 100
 set g_balance_fireball_primary_bfgforce 0
@@ -761,7 +760,6 @@ set g_balance_fireball_primary_refire 5
 set g_balance_fireball_primary_refire2 0
 set g_balance_fireball_primary_speed 650
 set g_balance_fireball_primary_spread 0
-set g_balance_fireball_secondary_ammo 5
 set g_balance_fireball_secondary_animtime 0.2
 set g_balance_fireball_secondary_damage 40
 set g_balance_fireball_secondary_damageforcescale 4
@@ -777,8 +775,6 @@ set g_balance_fireball_secondary_speed 900
 set g_balance_fireball_secondary_speed_up 100
 set g_balance_fireball_secondary_speed_z 0
 set g_balance_fireball_secondary_spread 0
-set g_balance_fireball_reload_ammo 0 //default: 60
-set g_balance_fireball_reload_time 2
 // }}}
 // {{{ seeker
 set g_balance_seeker_type 0 // 0 = old seeker, 1 = new seeker. THIS IS A TEMPORARY CVAR FOR TESTING, will be removed later.
index 001e1d2dc544a7fbe767979ad678c41474364952..a358d9ea68dc24431ff860efba0faf1a6c557b49 100644 (file)
@@ -741,7 +741,6 @@ set g_balance_tuba_force 40
 set g_balance_tuba_pitchstep 6
 // }}}
 // {{{ fireball // this is a superweapon -- lets make it behave as one. 
-set g_balance_fireball_primary_ammo 20
 set g_balance_fireball_primary_animtime 0.2
 set g_balance_fireball_primary_bfgdamage 100
 set g_balance_fireball_primary_bfgforce 0
@@ -761,7 +760,6 @@ set g_balance_fireball_primary_refire 2
 set g_balance_fireball_primary_refire2 0
 set g_balance_fireball_primary_speed 1200
 set g_balance_fireball_primary_spread 0
-set g_balance_fireball_secondary_ammo 5
 set g_balance_fireball_secondary_animtime 0.3
 set g_balance_fireball_secondary_damage 40
 set g_balance_fireball_secondary_damageforcescale 4
@@ -777,8 +775,6 @@ set g_balance_fireball_secondary_speed 900
 set g_balance_fireball_secondary_speed_up 100
 set g_balance_fireball_secondary_speed_z 0
 set g_balance_fireball_secondary_spread 0
-set g_balance_fireball_reload_ammo 0 //default: 100
-set g_balance_fireball_reload_time 2
 // }}}
 // {{{ seeker
 set g_balance_seeker_type 1 // 0 = old seeker, 1 = new seeker. THIS IS A TEMPORARY CVAR FOR TESTING, will be removed later.
index 24adbdc31c4858bf863abfcd73cd6b8e36d0b880..b351d22c6000a85d48781bec30b09ce313fe037d 100644 (file)
@@ -741,7 +741,6 @@ set g_balance_tuba_force 40
 set g_balance_tuba_pitchstep 6
 // }}}
 // {{{ fireball // this is a superweapon -- lets make it behave as one. 
-set g_balance_fireball_primary_ammo 20
 set g_balance_fireball_primary_animtime 0.2
 set g_balance_fireball_primary_bfgdamage 100
 set g_balance_fireball_primary_bfgforce 0
@@ -761,7 +760,6 @@ set g_balance_fireball_primary_refire 2
 set g_balance_fireball_primary_refire2 0
 set g_balance_fireball_primary_speed 1200
 set g_balance_fireball_primary_spread 0
-set g_balance_fireball_secondary_ammo 5
 set g_balance_fireball_secondary_animtime 0.3
 set g_balance_fireball_secondary_damage 40
 set g_balance_fireball_secondary_damageforcescale 4
@@ -777,8 +775,6 @@ set g_balance_fireball_secondary_speed 900
 set g_balance_fireball_secondary_speed_up 100
 set g_balance_fireball_secondary_speed_z 0
 set g_balance_fireball_secondary_spread 0
-set g_balance_fireball_reload_ammo 0 //default: 100
-set g_balance_fireball_reload_time 2
 // }}}
 // {{{ seeker
 set g_balance_seeker_type 1 // 0 = old seeker, 1 = new seeker. THIS IS A TEMPORARY CVAR FOR TESTING, will be removed later.
index ccab212d4ea6f931658e61b876fa549434cfc13d..7be6999a4dc1690df4463d59027daed97eb363f8 100644 (file)
@@ -1851,6 +1851,9 @@ set g_weapon_charge_colormod_blue_full -1
 set g_playerstats_uri ""
 set g_playerstats_debug 0 "when 1, player stats are dumped to the console too"
 
+// autoscreenshots
+set g_max_info_autoscreenshot 3 "how many info_autoscreenshot entities are allowed"
+
 // session locking
 locksession 1
 
index a05d13ff841e2c09a12ce3318baefa9d51540ca3..618e3ad4e234fc465e927bd80493429d9d5bcc16 100644 (file)
@@ -3,7 +3,7 @@ FTEQCC ?= fteqcc
 PERL ?= perl
 
 FTEQCCFLAGS_WATERMARK ?= -DWATERMARK='"$(shell git describe)"' -DCVAR_POPCON
-FTEQCCFLAGS ?= -Werror -Wno-Q302 -O3 -Ono-c -Ono-cs -fno-fastarrays $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK)
+FTEQCCFLAGS ?= -Werror -Wno-Q302 -O3 -fno-fastarrays $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK)
 FTEQCCFLAGS_PROGS ?=
 FTEQCCFLAGS_MENU ?=
 
index 1930d7c6fc4a04f2c7d33d029631f79bae308c29..23354397aacfd044f30d1ea744d64211fc1cd922 100644 (file)
@@ -1580,6 +1580,10 @@ void check_unacceptable_compiler_bugs()
        tokenize_console("foo bar");
        if(strcat(argv(0), substring("foo bar", 4, 7 - argv_start_index(1))) == "barbar")
                error("fteqcc bug introduced with revision 3178 detected. Please upgrade fteqcc to a later revision, downgrade fteqcc to revision 3177, or pester Spike until he fixes it. You can set _allow_unacceptable_compiler_bugs 1 to skip this check, but expect stuff to be horribly broken then.");
+
+       string s = "";
+       if not(s)
+               error("The empty string counts as false. We do not want that!");
 }
 
 float compressShotOrigin(vector v)
index f57c768a5fcb3d80ce4da5bc16d65845fcb5164a..c3593056c284d6f75339a8c93c180cbcb665170c 100644 (file)
@@ -5,6 +5,8 @@ CLASS(XonoticColorpickerString) EXTENDS(Image)
        METHOD(XonoticColorpickerString, mouseRelease, float(entity, vector))
        METHOD(XonoticColorpickerString, mouseDrag, float(entity, vector))
        ATTRIB(XonoticColorpickerString, cvarName, string, string_null)
+       METHOD(XonoticColorPickerString, loadCvars, void(entity))
+       METHOD(XonoticColorPickerString, saveCvars, void(entity))
        ATTRIB(XonoticColorpickerString, prevcoords, vector, '0 0 0')
        ATTRIB(XonoticColorpickerString, image, string, SKINGFX_COLORPICKER)
        ATTRIB(XonoticColorpickerString, imagemargin, vector, SKINMARGIN_COLORPICKER)
@@ -28,10 +30,45 @@ void XonoticColorpickerString_configureXonoticColorpickerString(entity me, strin
 {
        me.cvarName = theCvar;
        me.configureImage(me, me.image);
-       if(cvar_string(theCvar) != "")
-               me.prevcoords = color_hslimage(stov(cvar_string(theCvar)), me.imagemargin);
-       else // use default
-               me.prevcoords = color_hslimage(stov(cvar_string(theDefaultCvar)), me.imagemargin);
+       if(theCvar)
+       {
+               me.cvarName = theCvar;
+               me.tooltip = getZonedTooltipForIdentifier(theCvar);
+               me.loadCvars(me);
+       }
+}
+
+void XonoticColorPickerString_loadCvars(entity me)
+{
+       if not(me.cvarName)
+               return;
+
+       if(substring(me.cvarName, -1, 1) == "_")
+       {
+               me.prevcoords = color_hslimage(
+                       eX * cvar(strcat(me.cvarName, "red")) +
+                       eY * cvar(strcat(me.cvarName, "green")) +
+                       eZ * cvar(strcat(me.cvarName, "blue")),
+                       me.imagemargin);
+       }
+       else
+               me.prevcoords = color_hslimage(stov(cvar_string(me.cvarName)), me.imagemargin);
+}
+
+void XonoticColorPickerString_saveCvars(entity me)
+{
+       if not(me.cvarName)
+               return;
+
+       if(substring(me.cvarName, -1, 1) == "_")
+       {
+               vector v = hslimage_color(me.prevcoords, me.imagemargin);
+               cvar_set(strcat(me.cvarName, "red"), ftos(v_x));
+               cvar_set(strcat(me.cvarName, "green"), ftos(v_y));
+               cvar_set(strcat(me.cvarName, "blue"), ftos(v_z));
+       }
+       else
+               cvar_set(me.cvarName, sprintf("%v", hslimage_color(me.prevcoords, me.imagemargin)));
 }
 
 float XonoticColorpickerString_mousePress(entity me, vector coords)
@@ -52,6 +89,7 @@ float XonoticColorpickerString_mouseDrag(entity me, vector coords)
        if(coords_y <= 1 - margin_y)
        {
                me.prevcoords = coords;
+               me.saveCvars(me);
        }
 
        return 1;
@@ -77,10 +115,8 @@ void XonoticColorpickerString_draw(entity me)
        sz = globalToBoxSize(sz, draw_scale);
 
        if(!me.disabled)
-       {
-               cvar_set(me.cvarName, sprintf("%v", hslimage_color(me.prevcoords, me.imagemargin)));
                draw_Picture(me.imgOrigin + me.prevcoords - 0.5 * sz, strcat(me.src, "_selected"), sz, '1 1 1', 1);
-       }
+
        draw_alpha = save;
 }
 #endif
index bdf262cfea962e35341e271fed5d58e96e2b9c3b..e336efc538db42d1d1f737b96713047762903fe5 100644 (file)
@@ -236,7 +236,6 @@ float autocvar_g_balance_falldamage_deadminspeed;
 float autocvar_g_balance_falldamage_factor;
 float autocvar_g_balance_falldamage_maxdamage;
 float autocvar_g_balance_falldamage_minspeed;
-float autocvar_g_balance_fireball_primary_ammo;
 float autocvar_g_balance_fireball_primary_animtime;
 float autocvar_g_balance_fireball_primary_bfgdamage;
 float autocvar_g_balance_fireball_primary_bfgforce;
@@ -255,7 +254,6 @@ float autocvar_g_balance_fireball_primary_radius;
 float autocvar_g_balance_fireball_primary_refire;
 float autocvar_g_balance_fireball_primary_refire2;
 float autocvar_g_balance_fireball_primary_speed;
-float autocvar_g_balance_fireball_secondary_ammo;
 float autocvar_g_balance_fireball_secondary_animtime;
 float autocvar_g_balance_fireball_secondary_damage;
 float autocvar_g_balance_fireball_secondary_damageforcescale;
@@ -268,8 +266,6 @@ float autocvar_g_balance_fireball_secondary_lifetime;
 float autocvar_g_balance_fireball_secondary_refire;
 float autocvar_g_balance_fireball_secondary_speed;
 float autocvar_g_balance_fireball_secondary_speed_up;
-float autocvar_g_balance_fireball_reload_ammo;
-float autocvar_g_balance_fireball_reload_time;
 float autocvar_g_balance_firetransfer_damage;
 float autocvar_g_balance_firetransfer_time;
 float autocvar_g_balance_fuel_limit;
@@ -1216,3 +1212,4 @@ float autocvar_g_sandbox_object_scale_min;
 float autocvar_g_sandbox_object_scale_max;
 float autocvar_g_sandbox_object_material_velocity_min;
 float autocvar_g_sandbox_object_material_velocity_factor;
+float autocvar_g_max_info_autoscreenshot;
index e7154b7f52f17617b9a79c7560aba4e551f99161..5ba860940a014344a3338f27551448ddbce0ad31 100644 (file)
@@ -92,9 +92,32 @@ float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as a
        if((++attempting, !CheatsAllowed(i,argc,fr))) \
                break
 
+float num_autoscreenshot;
+void info_autoscreenshot_findtarget()
+{
+       entity e;
+       e = find(world, targetname, self.target);
+       if(!e)
+       {
+               objerror("Missing target. FAIL!");
+               return;
+       }
+       vector a = vectoangles(e.origin - self.origin);
+       a_x = -a_x; // don't ask
+       self.angles_x = a_x;
+       self.angles_y = a_y;
+       // we leave Rick Roll alone
+}
 void spawnfunc_info_autoscreenshot()
 {
-       // empty spawnfunc just so this entity can exist
+       if(++num_autoscreenshot > autocvar_g_max_info_autoscreenshot)
+       {
+               objerror("Too many info_autoscreenshot entitites. FAIL!");
+               return;
+       }
+       if(self.target != "")
+               InitializeEntity(self, info_autoscreenshot_findtarget, INITPRIO_FINDTARGET);
+       // this one just has to exist
 }
 
 float CheatImpulse(float i)
index 02463c2c007444ec0b3305b55fd1c7b6cf1b222e..77c67b46bb9f96e548731ad022d702ae1f005fdd 100644 (file)
@@ -1,5 +1,5 @@
 #ifdef REGISTER_WEAPON
-REGISTER_WEAPON(FIREBALL, w_fireball, IT_FUEL, 9, WEP_FLAG_RELOADABLE | WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "fireball", "fireball", _("Fireball"));
+REGISTER_WEAPON(FIREBALL, w_fireball, 0, 9, WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "fireball", "fireball", _("Fireball"));
 #else
 #ifdef SVQC
 .float bot_primary_fireballmooth; // whatever a mooth is
@@ -198,8 +198,6 @@ void W_Fireball_Attack1_Frame1()
 
 void W_Fireball_Attack1_Frame0()
 {
-       W_DecreaseAmmo(ammo_fuel, autocvar_g_balance_fireball_primary_ammo, autocvar_g_balance_fireball_reload_ammo);
-
        W_Fireball_AttackEffect(0, '-1.25 -3.75 0');
        sound (self, CH_WEAPON_SINGLE, "weapons/fireball_prefire2.wav", VOL_BASE, ATTN_NORM);
        weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_fireball_primary_animtime, W_Fireball_Attack1_Frame1);
@@ -249,8 +247,6 @@ void W_Fireball_Attack2()
        vector f_diff;
        float c;
 
-       W_DecreaseAmmo(ammo_fuel, autocvar_g_balance_fireball_secondary_ammo, autocvar_g_balance_fireball_reload_ammo);
-
        c = mod(self.bulletcounter, 4);
        switch(c)
        {
@@ -330,9 +326,7 @@ float w_fireball(float req)
        }
        else if (req == WR_THINK)
        {
-               if(autocvar_g_balance_fireball_reload_ammo && self.clip_load < min(autocvar_g_balance_fireball_primary_ammo, autocvar_g_balance_fireball_secondary_ammo)) // forced reload
-                       weapon_action(self.weapon, WR_RELOAD);
-               else if (self.BUTTON_ATCK)
+               if (self.BUTTON_ATCK)
                {
                        if (time >= self.fireball_primarytime)
                        if (weapon_prepareattack(0, autocvar_g_balance_fireball_primary_refire))
@@ -364,32 +358,20 @@ float w_fireball(float req)
        else if (req == WR_SETUP)
        {
                weapon_setup(WEP_FIREBALL);
-               self.current_ammo = ammo_fuel;
+               self.current_ammo = ammo_none;
        }
        else if (req == WR_CHECKAMMO1)
        {
-               ammo_amount = self.ammo_fuel >= autocvar_g_balance_fireball_primary_ammo;
-               ammo_amount += self.(weapon_load[WEP_FIREBALL]) >= autocvar_g_balance_fireball_primary_ammo;
-               return ammo_amount;
+               return 1;
        }
        else if (req == WR_CHECKAMMO2)
        {
-               ammo_amount = self.ammo_fuel >= autocvar_g_balance_fireball_secondary_ammo;
-               ammo_amount += self.(weapon_load[WEP_FIREBALL]) >= autocvar_g_balance_fireball_secondary_ammo;
-               return ammo_amount;
+               return 1;
        }
        else if (req == WR_RESETPLAYER)
        {
                self.fireball_primarytime = time;
        }
-       else if (req == WR_RELOAD)
-       {
-               // fuel can be a non-whole number, which brakes stuff here when between 0 and 1
-               if(self.ammo_fuel < 1)
-                       self.ammo_fuel = 0;
-
-               W_Reload(min(autocvar_g_balance_fireball_primary_ammo, autocvar_g_balance_fireball_secondary_ammo), autocvar_g_balance_fireball_reload_ammo, autocvar_g_balance_fireball_reload_time, "weapons/reload.wav");
-       }
        return TRUE;
 }
 #endif