set g_balance_devastator_reload_time 2
set g_balance_devastator_remote_damage 70
set g_balance_devastator_remote_edgedamage 35
-set g_balance_devastator_remote_force 450
+set g_balance_devastator_remote_force 300
set g_balance_devastator_remote_jump_damage 70
-set g_balance_devastator_remote_jump_radius 0
-set g_balance_devastator_remote_jump_velocity_z_add 400
+set g_balance_devastator_remote_jump_force 450
+set g_balance_devastator_remote_jump_radius 100
+set g_balance_devastator_remote_jump_velocity_z_add 0
set g_balance_devastator_remote_jump_velocity_z_max 1500
set g_balance_devastator_remote_jump_velocity_z_min 400
set g_balance_devastator_remote_radius 110
set g_balance_devastator_remote_edgedamage 40
set g_balance_devastator_remote_force 600
set g_balance_devastator_remote_jump_damage 70
+set g_balance_devastator_remote_jump_force 0
set g_balance_devastator_remote_jump_radius 0
set g_balance_devastator_remote_jump_velocity_z_add 400
set g_balance_devastator_remote_jump_velocity_z_max 1500
set g_balance_machinegun_solidpenetration 13.1
set g_balance_machinegun_spread_add 0.012
set g_balance_machinegun_spread_max 0.05
-set g_balance_machinegun_spread_min 0.02
+set g_balance_machinegun_spread_min 0
set g_balance_machinegun_sustained_ammo 1
set g_balance_machinegun_sustained_damage 25
set g_balance_machinegun_sustained_force 5
set g_balance_vortex_charge_start 0.5
set g_balance_vortex_charge_velocity_rate 0
set g_balance_vortex_primary_ammo 10
-set g_balance_vortex_primary_animtime 0.95
+set g_balance_vortex_primary_animtime 0.65
set g_balance_vortex_primary_damage 100
set g_balance_vortex_primary_damagefalloff_forcehalflife 0
set g_balance_vortex_primary_damagefalloff_halflife 0
set g_balance_vortex_secondary_damagefalloff_mindist 0
set g_balance_vortex_secondary_force 0
set g_balance_vortex_secondary_refire 0
-set g_balance_vortex_switchdelay_drop 0.25
-set g_balance_vortex_switchdelay_raise 0.25
+set g_balance_vortex_switchdelay_drop 0.2
+set g_balance_vortex_switchdelay_raise 0.2
set g_balance_vortex_weaponreplace ""
set g_balance_vortex_weaponstart 0
set g_balance_vortex_weaponstartoverride -1
set g_balance_devastator_remote_edgedamage 35
set g_balance_devastator_remote_force 300
set g_balance_devastator_remote_jump_damage 70
+set g_balance_devastator_remote_jump_force 0
set g_balance_devastator_remote_jump_radius 0
set g_balance_devastator_remote_jump_velocity_z_add 400
set g_balance_devastator_remote_jump_velocity_z_max 1500
// }}}
// {{{ #21: Heavy Machine Gun
set g_balance_hmg_ammo 1
-set g_balance_hmg_damage 10
-set g_balance_hmg_force 5
+set g_balance_hmg_damage 30
+set g_balance_hmg_force 10
set g_balance_hmg_refire 0.05
set g_balance_hmg_reload_ammo 120
set g_balance_hmg_reload_time 1
set g_balance_hmg_solidpenetration 32
-set g_balance_hmg_spread_add 0.01
-set g_balance_hmg_spread_max 0.05
-set g_balance_hmg_spread_min 0.02
+set g_balance_hmg_spread_add 0.005
+set g_balance_hmg_spread_max 0.06
+set g_balance_hmg_spread_min 0.01
set g_balance_hmg_switchdelay_drop 0.2
set g_balance_hmg_switchdelay_raise 0.2
set g_balance_hmg_weaponreplace ""
set g_balance_devastator_remote_edgedamage 35
set g_balance_devastator_remote_force 400
set g_balance_devastator_remote_jump_damage 40
+set g_balance_devastator_remote_jump_force 0
set g_balance_devastator_remote_jump_radius 200
set g_balance_devastator_remote_jump_velocity_z_add 500
set g_balance_devastator_remote_jump_velocity_z_max 1500
set g_balance_devastator_remote_edgedamage 35
set g_balance_devastator_remote_force 350
set g_balance_devastator_remote_jump_damage 70
+set g_balance_devastator_remote_jump_force 0
set g_balance_devastator_remote_jump_radius 0
set g_balance_devastator_remote_jump_velocity_z_add 400
set g_balance_devastator_remote_jump_velocity_z_max 1500
set g_balance_vortex_secondary_damagefalloff_mindist 0
set g_balance_vortex_secondary_force 0
set g_balance_vortex_secondary_refire 0
-set g_balance_vortex_switchdelay_drop 0.25
-set g_balance_vortex_switchdelay_raise 0.25
+set g_balance_vortex_switchdelay_drop 0.2
+set g_balance_vortex_switchdelay_raise 0.2
set g_balance_vortex_weaponreplace ""
set g_balance_vortex_weaponstart 0
set g_balance_vortex_weaponstartoverride -1
set g_balance_devastator_remote_edgedamage 35
set g_balance_devastator_remote_force 300
set g_balance_devastator_remote_jump_damage 70
+set g_balance_devastator_remote_jump_force 0
set g_balance_devastator_remote_jump_radius 0
set g_balance_devastator_remote_jump_velocity_z_add 400
set g_balance_devastator_remote_jump_velocity_z_max 1500
set g_balance_vortex_secondary_damagefalloff_mindist 0
set g_balance_vortex_secondary_force 0
set g_balance_vortex_secondary_refire 0
-set g_balance_vortex_switchdelay_drop 0.25
-set g_balance_vortex_switchdelay_raise 0.25
+set g_balance_vortex_switchdelay_drop 0.2
+set g_balance_vortex_switchdelay_raise 0.2
set g_balance_vortex_weaponreplace ""
set g_balance_vortex_weaponstart 0
set g_balance_vortex_weaponstartoverride -1
set g_balance_devastator_remote_edgedamage 35
set g_balance_devastator_remote_force 300
set g_balance_devastator_remote_jump_damage 70
+set g_balance_devastator_remote_jump_force 0
set g_balance_devastator_remote_jump_radius 0
set g_balance_devastator_remote_jump_velocity_z_add 400
set g_balance_devastator_remote_jump_velocity_z_max 1500
set g_pickup_fuel_max 100
set g_pickup_armorsmall 5
set g_pickup_armorsmall_max 20
-set g_pickup_armorsmall_anyway 0
+set g_pickup_armorsmall_anyway 1
set g_pickup_armormedium 25
-set g_pickup_armormedium_max 200
+set g_pickup_armormedium_max 100
set g_pickup_armormedium_anyway 1
set g_pickup_armorbig 50
-set g_pickup_armorbig_max 200
+set g_pickup_armorbig_max 100
set g_pickup_armorbig_anyway 1
set g_pickup_armorlarge 100
-set g_pickup_armorlarge_max 200
+set g_pickup_armorlarge_max 100
set g_pickup_armorlarge_anyway 1
set g_pickup_healthsmall 5
set g_pickup_healthsmall_max 200
set g_balance_armor_regenlinear 0
set g_balance_armor_rot 0
set g_balance_armor_rotlinear 1
-set g_balance_pause_armor_rot 1
+set g_balance_pause_armor_rot 5
set g_balance_pause_armor_rot_spawn 5
set g_balance_armor_regenstable 100
set g_balance_armor_rotstable 0
set g_balance_armor_limit 999
-set g_balance_armor_blockpercent 0.7
+set g_balance_armor_blockpercent 0.6
set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
set g_balance_fuel_regenlinear 0
set g_balance_pause_fuel_regen 2 // other than this, fuel uses the health regen counter
seta notification_ANNCE_VOTE_CALL "2" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
seta notification_ANNCE_VOTE_FAIL "2" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
-// MSG_INFO notifications (count = 316):
+// MSG_INFO notifications (count = 320):
seta notification_INFO_CA_JOIN_LATE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_INFO_CA_LEAVE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_INFO_CHAT_NOSPECTATORS "2" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_INFO_LMS_NOLIVES "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_INFO_MINIGAME_INVITE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_INFO_MONSTERS_DISABLED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_NEXBALL_RETURN_HELD_BLUE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_NEXBALL_RETURN_HELD_PINK "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_NEXBALL_RETURN_HELD_RED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_NEXBALL_RETURN_HELD_YELLOW "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_INFO_ONSLAUGHT_CAPTURE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_INFO_ONSLAUGHT_CPDESTROYED_BLUE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_INFO_ONSLAUGHT_CPDESTROYED_PINK "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
seta notification_show_sprees_info_newline "1" "Show attacker spree information for MSG_INFO messages on a separate line than the death notification itself"
seta notification_show_sprees_info_specialonly "1" "Don't show attacker spree information in MSG_INFO messages if it isn't an achievement"
-// Notification counts (total = 816): MSG_ANNCE = 89, MSG_INFO = 316, MSG_CENTER = 230, MSG_MULTI = 153, MSG_CHOICE = 28
+// Notification counts (total = 820): MSG_ANNCE = 89, MSG_INFO = 320, MSG_CENTER = 230, MSG_MULTI = 153, MSG_CHOICE = 28
#include "centerprint.qh"
#include "scoreboard.qh"
+#include <common/notifications/all.qh>
// CenterPrint (#16)
else // Expiring soon, so fade it out.
a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out);
+ if(centerprint_msgID[j] == CPID_TIMEIN)
+ a = 1;
+
// while counting down show it anyway in order to hold the current message position
if (a <= 0.5/255.0 && centerprint_countdown_num[j] == 0) // Guaranteed invisible - don't show.
continue;
MACRO_END
// #define PROP(public, fld, set, sv, cl)
-#define ENTCS_NETPROPS(PROP) PROP(false, sv_entnum, ENTCS_SET_NORMAL, {}, {}) /* sentinel */ \
+#define ENTCS_NETPROPS(ent, PROP) PROP(false, sv_entnum, ENTCS_SET_NORMAL, {}, {}) /* sentinel */ \
PROP(false, origin, ENTCS_SET_NORMAL, \
- { WriteShort(chan, this.origin.x); WriteShort(chan, this.origin.y); \
- WriteShort(chan, this.origin.z); }, \
- { this.has_sv_origin = true; vector v; v.x = ReadShort(); v.y = ReadShort(); v.z = ReadShort(); setorigin(this, v); }) \
+ { WriteShort(chan, ent.origin.x); WriteShort(chan, ent.origin.y); \
+ WriteShort(chan, ent.origin.z); }, \
+ { ent.has_sv_origin = true; vector v; v.x = ReadShort(); v.y = ReadShort(); v.z = ReadShort(); setorigin(ent, v); }) \
\
PROP(false, angles_y, ENTCS_SET_NORMAL, \
- { WriteByte(chan, this.angles.y / 360 * 256); }, \
- { vector v = '0 0 0'; v.y = ReadByte() / 256 * 360; this.angles = v; }) \
+ { WriteByte(chan, ent.angles.y / 360 * 256); }, \
+ { vector v = '0 0 0'; v.y = ReadByte() / 256 * 360; ent.angles = v; }) \
\
PROP(false, health, ENTCS_SET_NORMAL, \
- { WriteByte(chan, bound(0, this.health / 10, 255)); /* FIXME: use a better scale? */ }, \
- { this.healthvalue = ReadByte() * 10; }) \
+ { WriteByte(chan, bound(0, ent.health / 10, 255)); /* FIXME: use a better scale? */ }, \
+ { ent.healthvalue = ReadByte() * 10; }) \
\
PROP(false, armorvalue, ENTCS_SET_NORMAL, \
- { WriteByte(chan, bound(0, this.armorvalue / 10, 255)); /* FIXME: use a better scale? */ }, \
- { this.armorvalue = ReadByte() * 10; }) \
+ { WriteByte(chan, bound(0, ent.armorvalue / 10, 255)); /* FIXME: use a better scale? */ }, \
+ { ent.armorvalue = ReadByte() * 10; }) \
\
PROP(true, netname, ENTCS_SET_MUTABLE_STRING, \
- { WriteString(chan, this.netname); }, \
- { if (this.netname) strunzone(this.netname); this.netname = strzone(ReadString()); }) \
+ { WriteString(chan, ent.netname); }, \
+ { if (ent.netname) strunzone(ent.netname); ent.netname = strzone(ReadString()); }) \
\
PROP(true, model, ENTCS_SET_NORMAL, \
- { WriteString(chan, this.model); }, \
- { if (this.model) strunzone(this.model); this.model = strzone(ReadString()); }) \
+ { WriteString(chan, ent.model); }, \
+ { if (ent.model) strunzone(ent.model); ent.model = strzone(ReadString()); }) \
\
PROP(true, skin, ENTCS_SET_NORMAL, \
- { WriteByte(chan, this.skin); }, \
- { this.skin = ReadByte(); }) \
+ { WriteByte(chan, ent.skin); }, \
+ { ent.skin = ReadByte(); }) \
\
PROP(true, clientcolors, ENTCS_SET_NORMAL, \
- { WriteByte(chan, this.clientcolors); }, \
- { this.colormap = ReadByte(); }) \
+ { WriteByte(chan, ent.clientcolors); }, \
+ { ent.colormap = ReadByte(); }) \
\
PROP(true, frags, ENTCS_SET_NORMAL, \
- { WriteShort(chan, this.frags); }, \
- { this.frags = ReadShort(); }) \
+ { WriteShort(chan, ent.frags); }, \
+ { ent.frags = ReadShort(); }) \
\
/**/
} \
i += 1; \
}
- ENTCS_NETPROPS(X);
+ ENTCS_NETPROPS(this, X);
#undef X
if (i >= BITS(16 - 1)) LOG_FATAL("Exceeded ENTCS_NETPROPS limit");
}
} \
i += 1; \
}
- ENTCS_NETPROPS(X);
+ ENTCS_NETPROPS(this, X);
#undef X
return true;
}
} \
i += 1; \
}
- ENTCS_NETPROPS(X);
+ ENTCS_NETPROPS(this, X);
#undef X
setorigin(this, this.origin); // relink
}
} \
i += 1; \
}
- ENTCS_NETPROPS(X);
+ ENTCS_NETPROPS(e, X);
#undef X
e.iflags |= IFLAG_ORIGIN;
InterpolateOrigin_Note(e);
{
if(this.ballcarried.teamtime && (this.ballcarried.teamtime < time))
{
- bprint("The ", Team_ColoredFullName(this.team), " held the ball for too long.\n");
- DropBall(this.ballcarried, this.ballcarried.owner.origin, '0 0 0');
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_NEXBALL_RETURN_HELD));
entity e = this.ballcarried;
+ DropBall(this.ballcarried, this.ballcarried.owner.origin, '0 0 0');
ResetBall(e);
}
else
if(this.cnt < 2) // step 1
{
if(time == this.teamtime)
- bprint("The ", Team_ColoredFullName(this.team), " held the ball for too long.\n");
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_NEXBALL_RETURN_HELD));
settouch(this, func_null);
set_movetype(this, MOVETYPE_NOCLIP);
{
if(SAME_TEAM(tmp_entity, player))
if(random_target)
- RandomSelection_Add(tmp_entity, 0, string_null, 1, 1);
+ RandomSelection_AddEnt(tmp_entity, 1, 1);
else if(vlen2(tmp_entity.origin - spawn_loc) <= vlen2(closest_target.origin - spawn_loc) || closest_target == NULL)
closest_target = tmp_entity;
}
for(tmp_entity = ons_worldgeneratorlist; tmp_entity; tmp_entity = tmp_entity.ons_worldgeneratornext)
{
if(random_target)
- RandomSelection_Add(tmp_entity, 0, string_null, 1, 1);
+ RandomSelection_AddEnt(tmp_entity, 1, 1);
else
{
if(SAME_TEAM(tmp_entity, player))
{
string pos = minigame_tile_buildname(i, j);
if(!snake_find_piece(minigame, pos))
- RandomSelection_Add(NULL, 0, pos, 1, 1);
+ RandomSelection_AddString(pos, 1, 1);
}
entity piece = msle_spawn(minigame,"minigame_board_piece");
{
string pos = minigame_tile_buildname(i, j);
if(!snake_find_piece(minigame, pos))
- RandomSelection_Add(NULL, 0, pos, 1, 1);
+ RandomSelection_AddString(pos, 1, 1);
}
entity piece = msle_spawn(minigame,"minigame_board_piece");
for ( int i = 0; i < 9; i++ )
{
if ( piecemask & f )
- RandomSelection_Add(NULL, f, string_null, 1, 1);
+ RandomSelection_AddFloat(f, 1, 1);
f <<= 1;
}
RandomSelection_Init();
FOREACH(Monsters, it != MON_Null,
{
- RandomSelection_Add(it, 0, string_null, 1, 1);
+ RandomSelection_AddEnt(it, 1, 1);
});
monster_id = RandomSelection_chosen_ent.monsterid;
FOREACH(Buffs, buff_Available(it), LAMBDA(
it.buff_seencount += 1;
// if it's already been chosen, give it a lower priority
- RandomSelection_Add(NULL, it.m_itemid, string_null, 1, max(0.2, 1 / it.buff_seencount));
+ RandomSelection_AddFloat(it.m_itemid, 1, max(0.2, 1 / it.buff_seencount));
));
ent.buffs = RandomSelection_chosen_float;
}
#include "sv_melee_only.qh"
-REGISTER_MUTATOR(melee_only, cvar("g_melee_only") && !cvar("g_instagib") && !g_nexball);
+REGISTER_MUTATOR(melee_only, cvar("g_melee_only") && !cvar("g_instagib") && !cvar("g_overkill") && !g_nexball);
-MUTATOR_HOOKFUNCTION(melee_only, SetStartItems)
+MUTATOR_HOOKFUNCTION(melee_only, SetStartItems, CBC_ORDER_LAST)
{
start_ammo_shells = warmup_start_ammo_shells = 0;
start_weapons = warmup_start_weapons = WEPSET(SHOTGUN);
if(d < dist)
{
e.fireball_impactvec = p;
- RandomSelection_Add(e, 0, string_null, 1 / (1 + d), !Fire_IsBurning(e));
+ RandomSelection_AddEnt(e, 1 / (1 + d), !Fire_IsBurning(e));
}
}
if(RandomSelection_chosen_ent)
RandomSelection_Init();
FOREACH(Weapons, it != WEP_Null, LAMBDA(
if(NIX_CanChooseWeapon(it.m_id))
- RandomSelection_Add(NULL, it.m_id, string_null, 1, (it.m_id != nix_weapon));
+ RandomSelection_AddFloat(it.m_id, 1, (it.m_id != nix_weapon));
));
nix_nextweapon = RandomSelection_chosen_float;
}
.float ok_use_ammocharge = _STAT(OK_AMMO_CHARGE);
.float ok_ammo_charge = _STAT(OK_AMMO_CHARGEPOOL);
-.float ok_pauseregen_finished;
-
void(entity ent, float wep) ok_DecreaseCharge;
void ok_Initialize();
if(!IS_DEAD(frag_target))
{
Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_SECONDARY_NODAMAGE);
- M_ARGV(6, vector) = '0 0 0';
+ M_ARGV(6, vector) = '0 0 0'; // force
}
- M_ARGV(4, float) = 0;
+ M_ARGV(4, float) = 0; // damage
}
}
-MUTATOR_HOOKFUNCTION(ok, PlayerDamage_SplitHealthArmor)
-{
- entity frag_target = M_ARGV(2, entity);
- float damage_take = M_ARGV(4, float);
-
- if(damage_take)
- frag_target.ok_pauseregen_finished = max(frag_target.ok_pauseregen_finished, time + 2);
-}
-
void ok_DropItem(entity this, entity targ)
{
entity e = new(droppedweapon); // hax
ok_DropItem(mon, frag_attacker);
}
-MUTATOR_HOOKFUNCTION(ok, PlayerRegen)
-{
- entity player = M_ARGV(0, entity);
-
- // overkill's values are different, so use custom regen
- if(!STAT(FROZEN, player))
- {
- player.armorvalue = CalcRotRegen(player.armorvalue, autocvar_g_balance_armor_regenstable, autocvar_g_balance_armor_regen, autocvar_g_balance_armor_regenlinear,
- 1 * frametime * (time > player.ok_pauseregen_finished), 0, 0, 1, 1 * frametime * (time > player.pauserotarmor_finished), autocvar_g_balance_armor_limit);
- player.health = CalcRotRegen(player.health, autocvar_g_balance_health_regenstable, 0, 100, 1 * frametime * (time > player.ok_pauseregen_finished), 200, 0,
- autocvar_g_balance_health_rotlinear, 1 * frametime * (time > player.pauserothealth_finished), autocvar_g_balance_health_limit);
-
- float minf, maxf, limitf;
-
- maxf = autocvar_g_balance_fuel_rotstable;
- minf = autocvar_g_balance_fuel_regenstable;
- limitf = autocvar_g_balance_fuel_limit;
-
- player.ammo_fuel = CalcRotRegen(player.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear,
- frametime * (time > player.pauseregen_finished) * ((player.items & ITEM_JetpackRegen.m_itemid) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > player.pauserotfuel_finished), limitf);
- }
- return true; // return true anyway, as frozen uses no regen
-}
-
MUTATOR_HOOKFUNCTION(ok, ForbidThrowCurrentWeapon)
{
return true;
ok_IncreaseCharge(player, PS(player).m_weapon.m_id);
if(PHYS_INPUT_BUTTON_ATCK2(player))
- if(!forbidWeaponUse(player) || player.weapon_blocked) // allow if weapon is blocked
+ if( !forbidWeaponUse(player) || player.weapon_blocked // allow if weapon is blocked
+ || (round_handler_IsActive() && !round_handler_IsRoundStarted()) )
if(time >= player.jump_interval)
{
player.jump_interval = time + WEP_CVAR_PRI(blaster, refire) * W_WeaponRateFactor(player);
// if player changed their weapon while dead, don't switch to their death weapon
if(player.impulse)
player.ok_lastwep = 0;
-
- player.ok_pauseregen_finished = time + 2;
}
void self_spawnfunc_weapon_hmg(entity this) { spawnfunc_weapon_hmg(this); }
client.ok_use_ammocharge = spectatee.ok_use_ammocharge;
}
-MUTATOR_HOOKFUNCTION(ok, SetStartItems)
+MUTATOR_HOOKFUNCTION(ok, SetStartItems, CBC_ORDER_LAST)
{
WepSet ok_start_items = (WEPSET(MACHINEGUN) | WEPSET(VORTEX) | WEPSET(SHOTGUN));
continue;
if(!checkpvs(spawn_spot.origin, it))
continue;
- RandomSelection_Add(it, 0, string_null, 1, 1);
+ RandomSelection_AddEnt(it, 1, 1);
));
if(RandomSelection_chosen_ent)
MSG_INFO_NOTIF(MONSTERS_DISABLED, 1, 0, 0, "", "", "", _("^BGMonsters are currently disabled"), "")
+ MULTITEAM_INFO(NEXBALL_RETURN_HELD, 4, 1, 0, 0, "", "", "", _("^BGThe ^TC^TT^BG team held the ball for too long"), "", NAME)
+
MSG_INFO_NOTIF(ONSLAUGHT_CAPTURE, 1, 2, 0, "s1 s2", "", "", _("^BG%s^BG captured %s^BG control point"), "")
MULTITEAM_INFO(ONSLAUGHT_CPDESTROYED, 4, 1, 2, 0, "s1 s2", "", "", _("^TC^TT^BG team %s^BG control point has been destroyed by %s"), "", NAME)
MULTITEAM_INFO(ONSLAUGHT_GENDESTROYED, 4, 1, 0, 0, "", "", "", _("^TC^TT^BG generator has been destroyed"), "", GENERATOR)
MSG_CENTER_NOTIF(TEAMCHANGE_SUICIDE, 1, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^K1Suicide in ^COUNT"), "")
MSG_CENTER_NOTIF(TIMEOUT_BEGINNING, 1, 0, 1, "", CPID_TIMEOUT, "1 f1", _("^F4Timeout begins in ^COUNT"), "")
- MSG_CENTER_NOTIF(TIMEOUT_ENDING, 1, 0, 1, "", CPID_TIMEOUT, "1 f1", _("^F4Timeout ends in ^COUNT"), "")
+ MSG_CENTER_NOTIF(TIMEOUT_ENDING, 1, 0, 1, "", CPID_TIMEIN, "1 f1", _("^F4Timeout ends in ^COUNT"), "")
MSG_CENTER_NOTIF(JOIN_PREVENT_MINIGAME, 1, 0, 0, "", CPID_Null, "0 0", _("^K1Cannot join given minigame session!"), "" )
CASE(CPID, RACE_FINISHLAP)
CASE(CPID, TEAMCHANGE)
CASE(CPID, TIMEOUT)
+ CASE(CPID, TIMEIN)
CASE(CPID, VEHICLES)
CASE(CPID, VEHICLES_OTHER)
/** always last */
if(it.classname != "item_flag_team" && it.classname != "item_kh_key")
{
Item_Show(it, -1);
- RandomSelection_Add(it, 0, string_null, it.cnt, 0);
+ RandomSelection_AddEnt(it, it.cnt, 0);
}
});
e = RandomSelection_chosen_ent;
IL_EACH(g_items, it.team == this.team,
{
if(it.classname != "item_flag_team" && it.classname != "item_kh_key")
- RandomSelection_Add(it, 0, string_null, it.cnt, 0);
+ RandomSelection_AddEnt(it, it.cnt, 0);
});
e = RandomSelection_chosen_ent;
RandomSelection_Init();
FOREACH_WORD(teleporter.noise, true,
{
- RandomSelection_Add(NULL, 0, it, 1, 1);
+ RandomSelection_AddString(it, 1, 1);
});
thesound = RandomSelection_chosen_string;
}
if(check_tdeath(player, locout, '0 0 0', '0 0 0'))
p = 0;
}
- RandomSelection_Add(it, 0, string_null, (it.cnt ? it.cnt : 1), p);
+ RandomSelection_AddEnt(it, (it.cnt ? it.cnt : 1), p);
});
e = RandomSelection_chosen_ent;
}
for(e = NULL; (e = find(e, targetname, this.target)); )
{
if(e.cnt)
- RandomSelection_Add(e, 0, string_null, e.cnt, 1);
+ RandomSelection_AddEnt(e, e.cnt, 1);
else
- RandomSelection_Add(e, 0, string_null, 1, 1);
+ RandomSelection_AddEnt(e, 1, 1);
}
toucher.velocity = trigger_push_calculatevelocity(toucher.origin, RandomSelection_chosen_ent, this.height);
}
{
if(this.target_random)
{
- RandomSelection_Add(t, 0, string_null, 1, 0);
+ RandomSelection_AddEnt(t, 1, 0);
}
else
{
RandomSelection_Init();
FOREACH(Weapons, it != WEP_Null, {
if (remaining & (it.m_wepset))
- RandomSelection_Add(it, 0, string_null, 1, 1);
+ RandomSelection_AddEnt(it, 1, 1);
});
Weapon w = RandomSelection_chosen_ent;
result |= WepSet_FromWeapon(w);
P(class, prefix, remote_edgedamage, float, NONE) \
P(class, prefix, remote_force, float, NONE) \
P(class, prefix, remote_jump_damage, float, NONE) \
+ P(class, prefix, remote_jump_force, float, NONE) \
P(class, prefix, remote_jump_radius, float, NONE) \
P(class, prefix, remote_jump_velocity_z_add, float, NONE) \
P(class, prefix, remote_jump_velocity_z_max, float, NONE) \
this.event_damage = func_null;
this.takedamage = DAMAGE_NO;
- float handled_as_rocketjump = false;
+ bool handled_as_rocketjump = false;
+ entity head = NULL;
- entity head = WarpZone_FindRadius(
- this.origin,
- WEP_CVAR(devastator, remote_jump_radius),
- false
- );
-
- while(head)
+ if(WEP_CVAR(devastator, remote_jump_radius))
{
- if(head.takedamage && (head == this.realowner))
+ head = WarpZone_FindRadius(
+ this.origin,
+ WEP_CVAR(devastator, remote_jump_radius),
+ false
+ );
+
+ while(head)
{
- float distance_to_head = vlen(this.origin - head.WarpZone_findradius_nearest);
- if(distance_to_head <= WEP_CVAR(devastator, remote_jump_radius))
+ if(head.takedamage && (head == this.realowner))
{
- // we handled this as a rocketjump :)
- handled_as_rocketjump = true;
-
- // modify velocity
- head.velocity_x *= 0.9;
- head.velocity_y *= 0.9;
- head.velocity_z = bound(
- WEP_CVAR(devastator, remote_jump_velocity_z_min),
- head.velocity.z + WEP_CVAR(devastator, remote_jump_velocity_z_add),
- WEP_CVAR(devastator, remote_jump_velocity_z_max)
- );
-
- // now do the damage
- RadiusDamage(
- this,
- head,
- WEP_CVAR(devastator, remote_jump_damage),
- WEP_CVAR(devastator, remote_jump_damage),
- WEP_CVAR(devastator, remote_jump_radius),
- NULL,
- head,
- 0,
- this.projectiledeathtype | HITTYPE_BOUNCE,
- NULL
- );
- break;
+ if(vdist(this.origin - head.WarpZone_findradius_nearest, <=, WEP_CVAR(devastator, remote_jump_radius)))
+ {
+ // we handled this as a rocketjump :)
+ handled_as_rocketjump = true;
+
+ // modify velocity
+ if(WEP_CVAR(devastator, remote_jump_velocity_z_add))
+ {
+ head.velocity_x *= 0.9;
+ head.velocity_y *= 0.9;
+ head.velocity_z = bound(
+ WEP_CVAR(devastator, remote_jump_velocity_z_min),
+ head.velocity.z + WEP_CVAR(devastator, remote_jump_velocity_z_add),
+ WEP_CVAR(devastator, remote_jump_velocity_z_max)
+ );
+ }
+
+ // now do the damage
+ RadiusDamage(
+ this,
+ head,
+ WEP_CVAR(devastator, remote_jump_damage),
+ WEP_CVAR(devastator, remote_jump_damage),
+ WEP_CVAR(devastator, remote_jump_radius),
+ NULL,
+ head,
+ (WEP_CVAR(devastator, remote_jump_force) ? WEP_CVAR(devastator, remote_jump_force) : 0),
+ this.projectiledeathtype | HITTYPE_BOUNCE,
+ NULL
+ );
+ break;
+ }
}
+ head = head.chain;
}
- head = head.chain;
}
RadiusDamage(
if(d < dist)
{
e.fireball_impactvec = p;
- RandomSelection_Add(e, 0, string_null, 1 / (1 + d), !Fire_IsBurning(e));
+ RandomSelection_AddEnt(e, 1 / (1 + d), !Fire_IsBurning(e));
}
}
if(RandomSelection_chosen_ent)
break;
}
- if((this.owner.sv_entnum == player_localentnum - 1) && autocvar_chase_active <= 0)
+ if((this.owner.sv_entnum == player_localentnum - 1))
{
switch(this.HookType)
{
default:
case NET_ENT_CLIENT_HOOK:
- a = view_origin + view_forward * vs.x + view_right * -vs.y + view_up * vs.z;
+ if(autocvar_chase_active > 0)
+ a = csqcplayer.origin;
+ else
+ a = view_origin + view_forward * vs.x + view_right * -vs.y + view_up * vs.z;
b = this.origin;
break;
case NET_ENT_CLIENT_ARC_BEAM:
RandomSelection_best_priority = -1;
}
-void RandomSelection_Add(entity e, float f, string s, float weight, float priority)
+void RandomSelection_Add(entity e, float f, string s, vector v, float weight, float priority)
{
if (priority > RandomSelection_best_priority)
{
RandomSelection_chosen_ent = e;
RandomSelection_chosen_float = f;
RandomSelection_chosen_string = s;
+ RandomSelection_chosen_vec = v;
RandomSelection_totalweight = weight;
}
else if (priority == RandomSelection_best_priority)
RandomSelection_chosen_ent = e;
RandomSelection_chosen_float = f;
RandomSelection_chosen_string = s;
+ RandomSelection_chosen_vec = v;
}
}
}
entity RandomSelection_chosen_ent;
float RandomSelection_chosen_float;
string RandomSelection_chosen_string;
+vector RandomSelection_chosen_vec;
void RandomSelection_Init();
-void RandomSelection_Add(entity e, float f, string s, float weight, float priority);
+void RandomSelection_Add(entity e, float f, string s, vector v, float weight, float priority);
+#define RandomSelection_AddEnt(e, weight, priority) RandomSelection_Add(e, 0, string_null, '0 0 0', weight, priority)
+#define RandomSelection_AddFloat(f, weight, priority) RandomSelection_Add(NULL, f, string_null, '0 0 0', weight, priority)
+#define RandomSelection_AddString(s, weight, priority) RandomSelection_Add(NULL, 0, s, '0 0 0', weight, priority)
+#define RandomSelection_AddVec(v, weight, priority) RandomSelection_Add(NULL, 0, string_null, v, weight, priority)
// prandom - PREDICTABLE random number generator
break;
}
));
- RandomSelection_Add(NULL, 0, readfile, 1, prio);
+ RandomSelection_AddString(readfile, 1, prio);
}
readfile = RandomSelection_chosen_string;
fclose(file);
case CHIMPULSE_R00T.impulse:
IS_CHEAT(this, imp, 0, 0);
RandomSelection_Init();
- FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it) && DIFF_TEAM(it, this), LAMBDA(RandomSelection_Add(it, 0, string_null, 1, 1)));
+ FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it) && DIFF_TEAM(it, this), LAMBDA(RandomSelection_AddEnt(it, 1, 1)));
if(RandomSelection_chosen_ent)
e = RandomSelection_chosen_ent;
else
RandomSelection_Init();
crosshair_trace(this);
for(entity e = NULL; (e = find(e, classname, "dragbox_box")); )
- RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos));
+ RandomSelection_AddEnt(e, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos));
for(entity e = NULL; (e = find(e, classname, "dragpoint")); )
- RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos));
+ RandomSelection_AddEnt(e, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos));
if(RandomSelection_chosen_ent)
{
delete(RandomSelection_chosen_ent.killindicator.killindicator);
RandomSelection_Init();
crosshair_trace(this);
for(entity e = NULL; (e = find(e, classname, "dragbox_box")); )
- RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos));
+ RandomSelection_AddEnt(e, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos));
for(entity e = NULL; (e = find(e, classname, "dragpoint")); )
- RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos));
+ RandomSelection_AddEnt(e, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos));
if(RandomSelection_chosen_ent)
{
if(substring(argv(1), 0, 1) == "*")
}
else // time to end the timeout
{
+ Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_TIMEIN);
timeout_status = TIMEOUT_INACTIVE;
// reset the slowmo value back to normal
stuffcmd(e, "\nscr_printspeed 1000000\n");
RandomSelection_Init();
FOREACH_WORD(autocvar_sv_intermission_cdtrack, true, LAMBDA(
- RandomSelection_Add(NULL, 0, it, 1, 1);
+ RandomSelection_AddString(it, 1, 1);
));
if (RandomSelection_chosen_string != "")
{
for(i = 0; i < mapvote_count_real; ++i)
if ( mapvote_maps_flags[i] & GTV_AVAILABLE )
{
- RandomSelection_Add(NULL, i, string_null, 1, mapvote_selections[i]);
+ RandomSelection_AddFloat(i, 1, mapvote_selections[i]);
if ( gametypevote && mapvote_maps[i] == MapInfo_Type_ToString(MapInfo_CurrentGametype()) )
{
currentVotes = mapvote_selections[i];
for(i = 0; i < mapvote_count_real; ++i)
if(i != firstPlace)
if ( mapvote_maps_flags[i] & GTV_AVAILABLE )
- RandomSelection_Add(NULL, i, string_null, 1, mapvote_selections[i]);
+ RandomSelection_AddFloat(i, 1, mapvote_selections[i]);
secondPlace = RandomSelection_chosen_float;
secondPlaceVotes = RandomSelection_best_priority;
//dprint("Second place: ", ftos(secondPlace), "\n");
{
if((it.spawnflags & MONSTER_TYPE_FLY) || (it.spawnflags & MONSTER_TYPE_SWIM) || (it.spawnflags & MONSTER_SIZE_QUAKE) || ((it.spawnflags & MON_FLAG_SUPERMONSTER) && supermonster_count >= 1))
continue;
- RandomSelection_Add(NULL, it.monsterid, string_null, 1, 1);
+ RandomSelection_AddFloat(it.monsterid, 1, 1);
});
return RandomSelection_chosen_float;
IL_EACH(g_invasion_spawns, true,
{
- RandomSelection_Add(it, 0, string_null, 1, ((time >= it.spawnshieldtime) ? 0.2 : 1)); // give recently used spawnpoints a very low rating
+ RandomSelection_AddEnt(it, 1, ((time >= it.spawnshieldtime) ? 0.2 : 1)); // give recently used spawnpoints a very low rating
it.spawnshieldtime = time + autocvar_g_invasion_spawnpoint_spawn_delay;
});
else
{
RandomSelection_Init();
- if(inv_monsters_perteam[NUM_TEAM_1] > 0) RandomSelection_Add(NULL, NUM_TEAM_1, string_null, 1, 1);
- if(inv_monsters_perteam[NUM_TEAM_2] > 0) RandomSelection_Add(NULL, NUM_TEAM_2, string_null, 1, 1);
- if(invasion_teams >= 3) if(inv_monsters_perteam[NUM_TEAM_3] > 0) { RandomSelection_Add(NULL, NUM_TEAM_3, string_null, 1, 1); }
- if(invasion_teams >= 4) if(inv_monsters_perteam[NUM_TEAM_4] > 0) { RandomSelection_Add(NULL, NUM_TEAM_4, string_null, 1, 1); }
+ if(inv_monsters_perteam[NUM_TEAM_1] > 0) RandomSelection_AddFloat(NUM_TEAM_1, 1, 1);
+ if(inv_monsters_perteam[NUM_TEAM_2] > 0) RandomSelection_AddFloat(NUM_TEAM_2, 1, 1);
+ if(invasion_teams >= 3) if(inv_monsters_perteam[NUM_TEAM_3] > 0) { RandomSelection_AddFloat(NUM_TEAM_3, 1, 1); }
+ if(invasion_teams >= 4) if(inv_monsters_perteam[NUM_TEAM_4] > 0) { RandomSelection_AddFloat(NUM_TEAM_4, 1, 1); }
monster.team = RandomSelection_chosen_float;
}
RandomSelection_Init();
for(spot = firstspot; spot; spot = spot.chain)
- RandomSelection_Add(spot, 0, string_null, pow(bound(lower, spot.spawnpoint_score.y, upper), exponent) * spot.cnt, (spot.spawnpoint_score.y >= lower) * 0.5 + spot.spawnpoint_score.x);
+ RandomSelection_AddEnt(spot, pow(bound(lower, spot.spawnpoint_score.y, upper), exponent) * spot.cnt, (spot.spawnpoint_score.y >= lower) * 0.5 + spot.spawnpoint_score.x);
return RandomSelection_chosen_ent;
}
// now t is the minimum, or A minimum!
if(t == 1 || TeamSmallerEqThanTeam(1, t, pl))
- RandomSelection_Add(NULL, 1, string_null, 1, 1);
+ RandomSelection_AddFloat(1, 1, 1);
if(t == 2 || TeamSmallerEqThanTeam(2, t, pl))
- RandomSelection_Add(NULL, 2, string_null, 1, 1);
+ RandomSelection_AddFloat(2, 1, 1);
if(t == 3 || TeamSmallerEqThanTeam(3, t, pl))
- RandomSelection_Add(NULL, 3, string_null, 1, 1);
+ RandomSelection_AddFloat(3, 1, 1);
if(t == 4 || TeamSmallerEqThanTeam(4, t, pl))
- RandomSelection_Add(NULL, 4, string_null, 1, 1);
+ RandomSelection_AddFloat(4, 1, 1);
return RandomSelection_chosen_float;
}