mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-10 15:17:57 -05:00
Grief: improve headstomp
This commit is contained in:
@ -1690,85 +1690,7 @@ playerhealthregen()
|
||||
|
||||
track_players_intersection_tracker()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self endon( "death" );
|
||||
level endon( "end_game" );
|
||||
|
||||
wait 5;
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
players = getPlayers();
|
||||
i = 0;
|
||||
while ( i < players.size )
|
||||
{
|
||||
playeri_on_top = 0;
|
||||
|
||||
if ( players[ i ] maps/mp/zombies/_zm_laststand::player_is_in_laststand() || players[ i ].sessionstate != "playing" )
|
||||
{
|
||||
players[i].time_on_top_of_player = undefined;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
j = 0;
|
||||
while ( j < players.size )
|
||||
{
|
||||
if ( j == i || players[ j ] maps/mp/zombies/_zm_laststand::player_is_in_laststand() || players[ j ].sessionstate != "playing" )
|
||||
{
|
||||
j++;
|
||||
continue;
|
||||
}
|
||||
|
||||
playeri_origin = players[ i ].origin;
|
||||
playerj_origin = players[ j ].origin;
|
||||
|
||||
if ( abs( playeri_origin[ 2 ] - playerj_origin[ 2 ] ) > 75 )
|
||||
{
|
||||
j++;
|
||||
continue;
|
||||
}
|
||||
|
||||
distance_apart = distance2d( playeri_origin, playerj_origin );
|
||||
if ( abs( distance_apart ) > 18 )
|
||||
{
|
||||
j++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(players[i].origin[2] > players[j].origin[2])
|
||||
{
|
||||
if(getDvar("g_gametype") == "zgrief" && players[i]._encounters_team != players[j]._encounters_team)
|
||||
{
|
||||
players[j] [[level.store_player_damage_info_func]](players[i], "none", "MOD_FALLING");
|
||||
players[j] dodamage( 1000, (0, 0, 0) );
|
||||
}
|
||||
|
||||
playeri_on_top = 1;
|
||||
if(!isDefined(players[i].time_on_top_of_player))
|
||||
{
|
||||
players[i].time_on_top_of_player = getTime();
|
||||
}
|
||||
|
||||
if((getTime() - players[i].time_on_top_of_player) >= 1000)
|
||||
{
|
||||
players[i] random_push();
|
||||
}
|
||||
}
|
||||
|
||||
j++;
|
||||
}
|
||||
|
||||
if(!playeri_on_top)
|
||||
{
|
||||
players[i].time_on_top_of_player = undefined;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
wait 0.05;
|
||||
}
|
||||
// BO2 has built in push mechanic
|
||||
}
|
||||
|
||||
random_push()
|
||||
|
@ -160,7 +160,6 @@ set_grief_vars()
|
||||
level.grief_score["B"] = 0;
|
||||
level.game_mode_shellshock_time = 0.75;
|
||||
level.game_mode_griefed_time = 2.5;
|
||||
level.store_player_damage_info_func = ::store_player_damage_info;
|
||||
|
||||
flag_wait( "start_zombie_round_logic" ); // needs a wait
|
||||
|
||||
@ -174,6 +173,7 @@ grief_onplayerconnect()
|
||||
self thread on_player_downed();
|
||||
self thread on_player_bleedout();
|
||||
self thread on_player_revived();
|
||||
self thread headstomp_watcher();
|
||||
self thread maps/mp/gametypes_zm/zmeat::create_item_meat_watcher();
|
||||
self.killsconfirmed = 0;
|
||||
}
|
||||
@ -280,6 +280,47 @@ add_grief_bleedout_score()
|
||||
}
|
||||
}
|
||||
|
||||
headstomp_watcher()
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
||||
while(1)
|
||||
{
|
||||
if(self.sessionstate != "playing")
|
||||
{
|
||||
wait 0.05;
|
||||
continue;
|
||||
}
|
||||
|
||||
players = get_players();
|
||||
foreach(player in players)
|
||||
{
|
||||
if(player != self && player.team != self.team && is_player_valid(player) && self.origin[2] > player.origin[2])
|
||||
{
|
||||
max_horz_dist = 24;
|
||||
max_vert_dist = 68;
|
||||
|
||||
if(player getStance() == "crouch")
|
||||
{
|
||||
max_vert_dist = 52;
|
||||
}
|
||||
else if(player getStance() == "prone")
|
||||
{
|
||||
max_vert_dist = 36;
|
||||
}
|
||||
|
||||
if(distance2d(self.origin, player.origin) <= max_horz_dist && (self.origin[2] - player.origin[2]) <= max_vert_dist)
|
||||
{
|
||||
player store_player_damage_info(self, "none", "MOD_FALLING");
|
||||
player dodamage( 1000, (0, 0, 0) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wait 0.05;
|
||||
}
|
||||
}
|
||||
|
||||
init_round_start_wait(time)
|
||||
{
|
||||
flag_clear("spawn_zombies");
|
||||
@ -982,7 +1023,7 @@ game_module_player_damage_callback( einflictor, eattacker, idamage, idflags, sme
|
||||
self playsound( "zmb_player_hit_ding" );
|
||||
|
||||
self thread stun_score_steal(eattacker, 10);
|
||||
self thread [[level.store_player_damage_info_func]](eattacker, sweapon, smeansofdeath);
|
||||
self thread store_player_damage_info(eattacker, sweapon, smeansofdeath);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user