Fixes custom maps for harriers

This commit is contained in:
INeedBots 2020-09-28 22:45:50 -06:00
parent 43edbaa930
commit 90c32a5d26
3 changed files with 36 additions and 2 deletions

View File

@ -583,3 +583,6 @@ set scr_uav_timeout "30"
set scr_counter_uav_timeout "30"
set scr_uav_forceon "0"
set scr_uav_does_print "1"
// _airstrike
set scr_harrier_duration "30"

View File

@ -1,3 +1,13 @@
/*
_airstrike modded
Author: INeedGames
Date: 09/26/2020
DVAR:
- scr_harrier_duration <int>
45 - (default) amount of seconds a harrier sticks around for
*/
#include maps\mp\_utility;
#include maps\mp\killstreaks\_harrier;
#include maps\mp\gametypes\_hud_util;
@ -26,6 +36,9 @@ init()
PrecacheMiniMapIcon( "hud_minimap_harrier_green" );
PrecacheMiniMapIcon( "hud_minimap_harrier_red" );
setDvarIfUninitialized( "scr_harrier_duration", 45 );
level.harrierDuration = getDvarInt( "scr_harrier_duration" );
level.onfirefx = loadfx ("fire/fire_smoke_trail_L");
level.airstrikefx = loadfx ("explosions/clusterbomb");

View File

@ -1,3 +1,10 @@
/*
_harrier modded
Author: INeedGames
Date: 09/26/2020
Uses the harrier duration, and fixes harrier leaving on custom maps.
*/
#include maps\mp\_utility;
#include common_scripts\utility;
@ -136,6 +143,15 @@ engageGround()
self waittill ( "goal" );
}
forceLeaveAfterTime(time)
{
self endon( "death" );
wait time;
self.force_harrier_leave = true;
}
harrierLeave()
{
self endon( "death" );
@ -145,6 +161,8 @@ harrierLeave()
self breakTarget( true );
self notify("stopRand");
self thread forceLeaveAfterTime(5);
for ( ;; )
{
self Vehicle_SetSpeed( 35, 25 );
@ -152,7 +170,7 @@ harrierLeave()
pathGoal += ( 0,0,900);
leaveTrace = BulletTrace(self.origin, self.origin+(0,0,900), false, self );
if( leaveTrace["surfacetype"] == "none" )
if( leaveTrace["surfacetype"] == "none" || isDefined(self.force_harrier_leave) )
break;
wait( 0.10 );
@ -183,7 +201,7 @@ harrierTimer()
{
self endon( "death" );
maps\mp\gametypes\_hostmigration::waitLongDurationWithHostMigrationPause( 45 );
maps\mp\gametypes\_hostmigration::waitLongDurationWithHostMigrationPause( level.harrierDuration );
self harrierLeave();
}