.float br_drop_time;
.float br_force_drop_distance;
.int br_drop_launch;
+.int br_drop_detached;
.entity br_bleeding_inflictor;
.entity br_bleeding_attacker;
}
}
+ if((STAT(DROP, player) == DROP_FALLING) && (player.br_drop_detached != 2) && IN_SQUAD(player) && (player != player.br_squad.br_squad_drop_leader)){
+ // atck2 has to be released then pressed to detach
+ if(!(STAT(PRESSED_KEYS, player) & KEY_ATCK2)){
+ if(player.br_drop_detached == 0){
+ player.br_drop_detached = 1;
+ }
+ }
+ else{
+ if(player.br_drop_detached == 1){
+ player.br_drop_detached = 2;
+ Kill_Notification(NOTIF_ONE_ONLY, player, MSG_CENTER, CPID_BR_DROP);
+ }
+ }
+ }
+
if(STAT(DROP, player) == DROP_TRANSPORT){
// jump has to be released then pressed to launch
if(!(STAT(PRESSED_KEYS, player) & KEY_JUMP) && (time > (player.br_squad.br_drop_time + br_drop_time_secs))){
const float inital_dropangle = 60; // 0 = straight down
player.effects &= ~EF_NODRAW;
set_movetype(player, MOVETYPE_WALK);
- Kill_Notification(NOTIF_ONE_ONLY, player, MSG_CENTER, CPID_BR_DROPSHIP);
+ Kill_Notification(NOTIF_ONE_ONLY, player, MSG_CENTER, CPID_BR_DROP);
STAT(DROP, player) = DROP_FALLING;
+ player.br_drop_detached = 0;
float maxdropspeed = PHYS_MAXAIRSPEED(player) * max(autocvar_g_br_drop_speed_max, 0); // no maxspeed_mod available here
player.br_drop_velocity.x = cos(player.angles.y * DEG2RAD);
player.br_drop_velocity.y = sin(player.angles.y * DEG2RAD);
FOREACH_CLIENT(IS_PLAYER(it) && (it != player) && SAME_SQUAD(it, player) && (STAT(DROP, it) == DROP_TRANSPORT), {
it.effects &= ~EF_NODRAW;
set_movetype(it, MOVETYPE_WALK);
- Kill_Notification(NOTIF_ONE_ONLY, it, MSG_CENTER, CPID_BR_DROPSHIP);
+ Kill_Notification(NOTIF_ONE_ONLY, it, MSG_CENTER, CPID_BR_DROP);
STAT(DROP, it) = DROP_FALLING;
+ it.br_drop_detached = 0;
+ Send_Notification(NOTIF_ONE_ONLY, it, MSG_CENTER, CENTER_BR_DROP_DETACH);
setorigin(it, player.origin + drop_offset); // FIXME: this can teleport players into brushes/void
drop_offset += drop_base_offset;
if(!IS_ONGROUND(player) && ((tracebox(player.origin, player.mins, player.maxs, player.origin - '0 0 1', MOVE_NOMONSTERS, player), trace_fraction) >= 1)) // IS_ONGROUND doesn't work if jump is held (jump is theoretically blocked until landed)
{
ITEMS_STAT(player) |= IT_USING_JETPACK;
- bool has_drop_leader = IN_SQUAD(player) && (player.br_squad.br_squad_drop_leader && (STAT(DROP, player.br_squad.br_squad_drop_leader) == DROP_FALLING));
+ bool has_drop_leader = IN_SQUAD(player) && (player.br_drop_detached != 2) && (player.br_squad.br_squad_drop_leader && (STAT(DROP, player.br_squad.br_squad_drop_leader) == DROP_FALLING));
bool player_is_drop_leader = has_drop_leader && (player == player.br_squad.br_squad_drop_leader);
if(player_is_drop_leader || !has_drop_leader)
{
if(player_is_drop_leader)
{
- FOREACH_CLIENT(IS_PLAYER(it) && (it != player) && SAME_SQUAD(it, player) && (STAT(DROP, it) == DROP_FALLING), {
+ FOREACH_CLIENT(IS_PLAYER(it) && (it != player) && SAME_SQUAD(it, player) && (it.br_drop_detached != 2) && (STAT(DROP, it) == DROP_FALLING), {
it.velocity = it.br_drop_velocity = player.br_drop_velocity;
it.angles = it.br_drop_angles = player.br_drop_angles;
});
}
+ else if((player.br_drop_detached != 2) && IN_SQUAD(player) && !has_drop_leader)
+ {
+ player.br_drop_detached = 2;
+ Kill_Notification(NOTIF_ONE_ONLY, player, MSG_CENTER, CPID_BR_DROP);
+ }
}
else
{
}
else
{
+ if((player.br_drop_detached != 2) && IN_SQUAD(player) && (player != player.br_squad.br_squad_drop_leader))
+ {
+ player.br_drop_detached = 2;
+ Kill_Notification(NOTIF_ONE_ONLY, player, MSG_CENTER, CPID_BR_DROP);
+ }
+
STAT(DROP, player) = DROP_LANDING;
ITEMS_STAT(player) &= ~IT_USING_JETPACK;
player.flags |= FL_PICKUPITEMS;
{
frag_target.effects &= ~EF_NODRAW;
set_movetype(frag_target, MOVETYPE_WALK);
- Kill_Notification(NOTIF_ONE_ONLY, frag_target, MSG_CENTER, CPID_BR_DROPSHIP);
+ Kill_Notification(NOTIF_ONE_ONLY, frag_target, MSG_CENTER, CPID_BR_DROP);
+ }
+
+ if(STAT(DROP, frag_target) == DROP_FALLING)
+ {
+ if((frag_target.br_drop_detached != 2) && IN_SQUAD(frag_target) && (frag_target != frag_target.br_squad.br_squad_drop_leader))
+ {
+ frag_target.br_drop_detached = 2;
+ Kill_Notification(NOTIF_ONE_ONLY, frag_target, MSG_CENTER, CPID_BR_DROP);
+ }
}
if(STAT(DROP, frag_target) != DROP_LANDED)
MSG_CENTER_NOTIF(BR_REVIVED, N_ENABLE, 1, 0, "s1", CPID_Null, "0 0", _("^K3You were revived by ^BG%s"), "")
MSG_CENTER_NOTIF(BR_DOWN, N_ENABLE, 1, 0, "s1", CPID_Null, "0 0", _("^K1You were downed by ^BG%s"), "")
MSG_CENTER_NOTIF(BR_DOWN_SELF, N_ENABLE, 0, 0, "", CPID_Null, "0 0", _("^K1You downed yourself"), "")
- MSG_CENTER_NOTIF(BR_DROPSHIP, N_ENABLE, 0, 0, "", CPID_BR_DROPSHIP, "-1 0", _("^BG^F1Jump^BG to drop"), "")
+ MSG_CENTER_NOTIF(BR_DROPSHIP, N_ENABLE, 0, 0, "", CPID_BR_DROP, "-1 0", _("^BG^F1Jump^BG to drop"), "")
+ MSG_CENTER_NOTIF(BR_DROP_DETACH, N_ENABLE, 0, 0, "", CPID_BR_DROP, "-1 0", _("^BG^F1Secondary fire^BG to detach"), "")
MSG_CENTER_NOTIF(BR_RING_WARN, N_ENABLE, 0, 0, "", CPID_Null, "0 0", _("^F4You are outside of ^F2the ring^F4, get back in fast!"), "")
MSG_CENTER_NOTIF(BR_RING_CLOSE, N_ENABLE, 0, 1, "f1", CPID_Null, "0 0", _("^F2Ring^F4 is closing! (strength: ^F1%s^F4)"), "")