// other aliases
alias +hook +button6
alias -hook -button6
+alias +jetpack +button10
+alias -jetpack -button10
alias use "impulse 21"
// for backwards compatibility
seta cl_autoscreenshot 1 "Take a screenshot upon the end of a match... 0 = Disable completely, 1 = Allow sv_autoscreenshot to take a screenshot when requested, 2 = Always take an autoscreenshot anyway."
+seta cl_jetpack_jump 1 "Activate jetpack by pressing jump in the air. 0 = Disable, 1 = Stop when touching ground, 2 = Enable"
+
// must be at the bottom of this file:
set g_bugrigs 0
seta cl_gentle_messages 0 "client side gentle mode (only replaces frag messages/centerprints)"
seta cl_gentle_damage 0 "client side gentle mode (only replaces damage flash); when set to 1, a white flash replaces the blood image, when set to 2, a randomily colored flash is used instead"
-set g_jetpack 0 "Jetpack mutator (uses the hook's button, can't coexist with the offhand hook, but only with the onhand one)"
+set g_jetpack 0 "Jetpack mutator"
set g_running_guns 0 "... or wonder, till it drives you mad, what would have followed if you had."
set g_bastet 0 "don't try"
// sucks less than the old one
cl_decals_newsystem 1
- seta cl_cubemaps_extra 1
-
set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping machinegun and shotgun (for Q3A map compatibility in mapinfo files)"
set g_movement_highspeed 1 "movement speed modification factor (only changes movement when above maxspeed)"
METHOD(XonoticInputSettingsTab, fill, void(entity))
ATTRIB(XonoticInputSettingsTab, title, string, _("Input"))
ATTRIB(XonoticInputSettingsTab, intendedWidth, float, 0.9)
- ATTRIB(XonoticInputSettingsTab, rows, float, 14.5)
+ ATTRIB(XonoticInputSettingsTab, rows, float, 15.5)
ATTRIB(XonoticInputSettingsTab, columns, float, 6.2) // added extra .2 for center space
ENDCLASS(XonoticInputSettingsTab)
entity makeXonoticInputSettingsTab();
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Key Bindings")));
me.TR(me);
- me.TD(me, me.rows - 4, 3, kb);
- me.gotoRC(me, me.rows - 3, 0);
+ me.TD(me, me.rows - 3, 3, kb);
+ me.gotoRC(me, me.rows - 2, 0);
me.TD(me, 1, 1, e = makeXonoticButton(_("Change key..."), '0 0 0'));
e.onClick = KeyBinder_Bind_Change;
e.onClickEntity = kb;
me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_movement_track_canjump", _("Automatically repeat jumping if holding jump")));
e.sendCvars = TRUE;
me.TR(me);
+ me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Jetpack on jump:")));
+ me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_jetpack_jump"));
+ e.addValue(e, _("Disabled"), "0");
+ e.addValue(e, _("Air only"), "1");
+ e.addValue(e, _("All"), "2");
+ e.configureXonoticTextSliderValues(e);
+ e.sendCvars = TRUE;
me.TR(me);
if(cvar_type("joy_enable") & CVAR_TYPEFLAG_ENGINE)
{
// Wazat's grappling hook
SetGrappleHookBindings();
+ // Jetpack binds
+ stuffcmd(self, "alias +jetpack +button10\n");
+ stuffcmd(self, "alias -jetpack -button10\n");
+
// get version info from player
stuffcmd(self, "cmd clientversion $gameversion\n");
mina = autocvar_g_balance_armor_regenstable;
limith = autocvar_g_balance_health_limit;
limita = autocvar_g_balance_armor_limit;
-
+
max_mod = regen_mod_max;
regen_mod = regen_mod_regen;
rot_mod = regen_mod_rot;
return 1;
}
-
float SpectateSet()
{
if(self.enemy.classname != "player")
}
*/
- //pointparticles(particleeffectnum("machinegun_impact"), self.origin + self.view_ofs + '0 0 7', '0 0 0', 1);
-
if(self.waypointsprite_attachedforcarrier)
WaypointSprite_UpdateHealth(self.waypointsprite_attachedforcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON));
PlayerJump
When you press the jump key
+returns TRUE if handled
=============
*/
-void PlayerJump (void)
+float PlayerJump (void)
{
if(self.frozen)
- return; // no jumping in freezetag when frozen
+ return TRUE; // no jumping in freezetag when frozen
if(self.player_blocked)
- return; // no jumping while blocked
+ return TRUE; // no jumping while blocked
float doublejump = FALSE;
float mjumpheight = autocvar_sv_jumpvelocity;
player_multijump = doublejump;
player_jumpheight = mjumpheight;
if(MUTATOR_CALLHOOK(PlayerJump))
- return;
+ return TRUE;
doublejump = player_multijump;
mjumpheight = player_jumpheight;
if (self.waterlevel >= WATERLEVEL_SWIMMING)
{
self.velocity_z = self.stat_sv_maxspeed * 0.7;
- return;
+ return TRUE;
}
if (!doublejump)
if (!(self.flags & FL_ONGROUND))
- return;
+ return !(self.flags & FL_JUMPRELEASED);
if(self.cvar_cl_movement_track_canjump)
if (!(self.flags & FL_JUMPRELEASED))
- return;
+ return TRUE;
// sv_jumpspeedcap_min/sv_jumpspeedcap_max act as baseline
// velocity bounds. Final velocity is bound between (jumpheight *
self.restart_jump = -1; // restart jump anim next time
// value -1 is used to not use the teleport bit (workaround for tiny hitch when re-jumping)
+ return TRUE;
}
void CheckWaterJump()
{
}
}
}
+
+.float jetpack_stopped;
+// Hack: shouldn't need to know about this
+.float multijump_count;
void CheckPlayerJump()
{
- if (self.BUTTON_JUMP)
- PlayerJump ();
+ float was_flying = self.items & IT_USING_JETPACK;
+
+ if (self.cvar_cl_jetpack_jump < 2)
+ self.items &= ~IT_USING_JETPACK;
+
+ if (self.BUTTON_JUMP || self.BUTTON_JETPACK)
+ {
+ float air_jump = !PlayerJump() || self.multijump_count > 0; // PlayerJump() has important side effects
+ float activate = self.cvar_cl_jetpack_jump && air_jump && self.BUTTON_JUMP || self.BUTTON_JETPACK;
+ float has_fuel = !autocvar_g_jetpack_fuel || self.ammo_fuel || self.items & IT_UNLIMITED_WEAPON_AMMO;
+ if (self.jetpack_stopped) { }
+ else if (!has_fuel)
+ {
- if (was_flying)
- sprint(self, "You ran out of fuel for the ^2Jetpack\n");
++ if (was_flying) // TODO: ran out of fuel message
++ Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_JETPACK_NOFUEL);
+ else
- sprint(self, "You don't have any fuel for the ^2Jetpack\n");
++ Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_JETPACK_NOFUEL);
+ self.jetpack_stopped = TRUE;
+ self.items &= ~IT_USING_JETPACK;
+ }
+ else if (activate && !self.frozen)
+ self.items |= IT_USING_JETPACK;
+ }
else
+ {
+ self.jetpack_stopped = FALSE;
+ self.items &= ~IT_USING_JETPACK;
+ }
+ if (!self.BUTTON_JUMP)
self.flags |= FL_JUMPRELEASED;
if (self.waterlevel == WATERLEVEL_SWIMMING)
bot_think();
}
- self.items &= ~IT_USING_JETPACK;
-
if(IS_PLAYER(self))
{
if(self.race_penalty)
PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0, 0);
}
}
- else if ((self.items & IT_JETPACK) && self.BUTTON_HOOK && (!autocvar_g_jetpack_fuel || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO) && !self.frozen)
+ else if (self.items & IT_USING_JETPACK)
{
//makevectors(self.v_angle_y * '0 1 0');
makevectors(self.v_angle);
}
else if (self.flags & FL_ONGROUND)
{
+ // we get here if we ran out of ammo
+ if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32) && self.ammo_fuel < 0.01)
+ Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_JETPACK_NOFUEL);
+
// walking
makevectors(self.v_angle_y * '0 1 0');
wishvel = v_forward * self.movement_x + v_right * self.movement_y;
else
{
float wishspeed0;
+ // we get here if we ran out of ammo
+ if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32) && self.ammo_fuel < 0.01)
+ Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_JETPACK_NOFUEL);
if(maxspd_mod < 1)
{
{
pickedup = TRUE;
player.items |= it;
- sprint (player, strcat("You got the ^2", item.netname, "\n"));
+ Send_Notification(NOTIF_ONE, player, MSG_INFO, INFO_ITEM_WEAPON_GOT, item.netname);
}
if (item.strength_finished)
void spawnfunc_item_jetpack(void)
{
- if(g_grappling_hook)
- return; // sorry, but these two can't coexist (same button); spawn fuel instead
if(!self.ammo_fuel)
self.ammo_fuel = g_pickup_fuel_jetpack;
if(start_items & IT_JETPACK)