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
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
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.
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
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
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.
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
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
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.
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
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
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.
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
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 ?=
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)
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)
{
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)
if(coords_y <= 1 - margin_y)
{
me.prevcoords = coords;
+ me.saveCvars(me);
}
return 1;
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
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;
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;
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;
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;
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)
#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
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);
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)
{
}
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))
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