 |
Black Ops 3 Source Code Explorer
0.1
An script explorer for Black Ops 3 by ZeRoY
|
Go to the documentation of this file. 1 #using scripts\codescripts\struct;
3 #using scripts\shared\challenges_shared;
4 #using scripts\shared\clientfield_shared;
5 #using scripts\shared\scoreevents_shared;
6 #using scripts\shared\util_shared;
8 #using scripts\mp\_challenges;
9 #using scripts\mp\_util;
10 #using scripts\mp\gametypes\_battlechatter;
11 #using scripts\mp\gametypes\_globallogic_audio;
12 #using scripts\mp\gametypes\_spawning;
13 #using scripts\mp\killstreaks\_airsupport;
14 #using scripts\mp\killstreaks\_killstreakrules;
15 #using scripts\mp\killstreaks\_killstreaks;
16 #using scripts\mp\killstreaks\_satellite;
18 #insert scripts\mp\_hacker_tool.gsh;
19 #insert scripts\shared\shared.gsh;
20 #insert scripts\shared\version.gsh;
22 #define PLANE_MORTAR_MODEL "veh_t7_mil_vtol_fighter_mp"
23 #define PLANE_MORTAR_MODEL_ENEMY "veh_t7_mil_vtol_fighter_mp_dark"
24 #define PLANE_MORTAR_LOCATION_SELECTOR "map_mortar_selector"
25 #define PLANE_MORTAR_LOCATION_SELECTOR_DONE "map_mortar_selector_done"
26 #define PLANE_MORTAR_SELECTION_RADIUS 800
27 #define PLANE_MORTAR_AIM_ASSIST_RADIUS_SQ 250000
28 #define PLANE_MORTAR_SELECTION_COUNT 3
29 #define PLANE_MORTAR_DELAY 0.8
30 #define PLANE_WINGMAN_DELAY 0.15
31 #define PLANE_WINGMAN_OFFSET 500
32 #define PLANE_MORTAR_FLIGHT_RADIUS 12000
33 #define PLANE_MORTAR_FLIGHT_SPEED 12000
34 #define PLANE_MORTAR_FLIGHT_TIME ( PLANE_MORTAR_FLIGHT_RADIUS * 2 / PLANE_MORTAR_FLIGHT_SPEED )
36 #precache( "locationselector", PLANE_MORTAR_LOCATION_SELECTOR );
37 #precache( "locationselector", PLANE_MORTAR_LOCATION_SELECTOR_DONE );
38 #precache( "string", "MP_EARNED_PLANEMORTAR" );
39 #precache( "string", "KILLSTREAK_PLANEMORTAR_NOT_AVAILABLE" );
40 #precache( "string", "MP_WAR_PLANEMORTAR_INBOUND" );
41 #precache( "string", "MP_WAR_PLANEMORTAR_INBOUND_NEAR_YOUR_POSITION" );
42 #precache( "string", "KILLSTREAK_PLANEMORTAR_HACKED" );
43 #precache( "eventstring", "mpl_killstreak_planemortar" );
44 #precache( "fx", "killstreaks/fx_ls_exhaust_afterburner" );
46 #namespace planemortar;
50 level.planeMortarExhaustFX =
"killstreaks/fx_ls_exhaust_afterburner";
53 killstreaks::register_strings(
"planemortar", &
"MP_EARNED_PLANEMORTAR", &
"KILLSTREAK_PLANEMORTAR_NOT_AVAILABLE", &
"MP_WAR_PLANEMORTAR_INBOUND", &
"MP_WAR_PLANEMORTAR_INBOUND_NEAR_YOUR_POSITION", &
"KILLSTREAK_PLANEMORTAR_HACKED" );
54 killstreaks::register_dialog(
"planemortar",
"mpl_killstreak_planemortar",
"planeMortarDialogBundle",
"planeMortarPilotDialogBundle",
"friendlyPlaneMortar",
"enemyPlaneMortar",
"enemyPlaneMortarMultiple",
"friendlyPlaneMortarHacked",
"enemyPlaneMortarHacked",
"requestPlaneMortar" );
77 self endon(
"emp_jammed" );
78 self endon(
"emp_grenaded" );
80 self waittill(
"confirm_location", location );
88 self.selectingLocation =
true;
93 if (!isdefined(
self.pers[
"mortarRadarUsed"]) || !
self.pers[
"mortarRadarUsed"])
106 if( !isdefined(
self ) )
109 if ( !isdefined( location ) )
111 self.pers[
"mortarRadarUsed"] =
true;
112 self notify(
"cancel_selection");
117 locations[i] = location;
122 self.pers[
"mortarRadarUsed"] =
true;
123 self notify(
"cancel_selection");
127 self.pers[
"mortarRadarUsed"] =
false;
134 self endon (
"death" );
135 self endon (
"disconnect" );
137 playbackTime = soundgetplaybacktime ( soundAlias );
139 if ( playbackTime >= 0 )
141 waitTime = playbackTime * .001;
149 self notify ( soundAlias );
154 self endon(
"disconnect" );
155 self endon(
"cancel_selection");
160 self PlayLocalSound(
"mpl_killstreak_satellite");
162 if ( level.teamBased )
171 if (
self.hasSpyplane == 0 && !has_satellite && !level.forceRadar )
179 self setClientUIVisibilityFlag(
"g_compassShowEnemies", 1 );
183 self setClientUIVisibilityFlag(
"g_compassShowEnemies", 0 );
190 if ( killstreak_id == -1 )
200 self AddWeaponStat( GetWeapon(
"planemortar" ),
"used", 1 );
209 self endon(
"emp_jammed" );
210 self endon(
"disconnect" );
212 yaw = RandomIntRange( 0,360 );
215 foreach( position
in positions )
218 self thread
doBombRun( position, yaw, team );
222 yaw = ( yaw + 35 ) % 360;
226 yaw = ( yaw + 290 ) % 360;
228 odd = ( odd + 1 ) % 2;
233 self notify(
"planemortarcomplete" );
240 if ( isdefined(
self.planeMortarBda ) )
242 if (
self.planeMortarBda === 1)
246 else if (
self.planeMortarBda === 2)
250 else if (
self.planeMortarBda === 3)
254 else if (isdefined(
self.planeMortarBda ) &&
self.planeMortarBda > 3)
256 bdaDialog =
"killMultiple";
276 self.planeMortarBda = undefined;
281 self util::waittill_any(
"disconnect",
"joined_team",
"joined_spectators",
"planemortarcomplete",
"emp_jammed" );
294 self endon(
"emp_jammed" );
298 direction = AnglesToForward( angles );
301 position = ( position[0], position[1], height );
305 startPoint = ( startPoint[0], startPoint[1], height );
306 position = ( position[0], position[1], height );
307 endPoint = ( endPoint[0], endPoint[1], height );
309 plane = SpawnPlane(
self,
"script_model", startPoint );
311 plane.targetname =
"plane_mortar";
314 plane endon(
"delete" );
315 plane endon(
"death" );
319 plane.angles = angles;
324 plane playsound(
"mpl_lightning_flyover_boom" );
325 plane SetDrawInfrared(
true );
327 plane.killcamEnt =
spawn(
"script_model", plane.origin+(0,0,700)+VectorScale( direction, -1 * 1500 ) );
329 plane.killcamEnt.angles = (15,yaw,0);
330 plane.killcamEnt.startTime = gettime();
331 plane.killcamEnt LinkTo( plane );
332 start = (position[0], position[1], plane.origin[2]);
333 impact = BulletTrace( start, start + (0,0,-100000),
true, plane);
337 plane.killcamEnt thread
followBomb( plane, position, direction, impact, player );
340 if ( isdefined (
self ) )
342 self thread
dropBomb( plane, position );
349 function followBomb( plane, position, direction, impact, player )
351 player endon(
"emp_jammed" );
354 plane.killcamEnt Unlink();
355 plane.killcamEnt MoveTo( impact[
"position"] + (0,0,1000) + VectorScale( direction, -1 * 600 ), 0.8, 0, 0.2);
360 while (isdefined(
self) && isdefined( bomb ))
362 angles = vectorToAngles( VectorNormalize( bomb.origin -
self.origin ));
363 self.angles = ( max(angles[0], 15), angles[1], angles[2] );
370 self endon(
"delete" );
371 self endon(
"death" );
373 self waittill(
"emp_deployed", attacker );
384 attacker endon(
"disconnect" );
385 attacker notify(
"planeAwardScoreEvent_singleton" );
386 attacker endon(
"planeAwardScoreEvent_singleton" );
390 if( isdefined( attacker ) && ( !isdefined( plane.owner ) || plane.owner
util::IsEnemyPlayer( attacker ) ) )
406 if ( !isdefined( plane.owner ) )
409 targets = getplayers();
410 foreach( target
in targets )
414 if( BulletTracePassed( (target.origin[0], target.origin[1], plane.origin[2]), target.origin,
false, plane) )
416 bombPosition = target.origin;
422 bombPosition = (bombPosition[0],bombPosition[1],plane.origin[2]);
423 bomb =
self LaunchBomb( GetWeapon(
"planemortar" ), bombPosition, (0,0,-5000) );
424 bomb.soundmod =
"heli";
425 bomb playsound(
"mpl_lightning_bomb_incoming" );
426 bomb.killcamEnt = plane.killcamEnt;
function dialog_chance(chanceKey)
function processScoreEvent(event, player, victim, weapon)
function doBombRun(position, yaw, team)
function waitPlayBackTime(soundAlias)
function create_enemy_influencer(name, origin, team)
function planeWatchForEmp(owner)
function finishHardpointLocationUsage(location, usedCallback)
function plane_mortar_bda_dialog()
function getMinimumFlyHeight()
function planeMortar_watchForEndNotify(team, killstreak_id)
function dropBomb(plane, bombPosition)
function play_killstreak_start_dialog(killstreakType, team, killstreakId)
function deleteAfterTime(time)
function play_taacom_dialog_response(dialogKey, killstreakType, killstreakId, pilotIndex)
function addFlySwatterStat(weapon, aircraft)
function spawn(v_origin=(0, 0, 0), v_angles=(0, 0, 0))
#define PLANE_MORTAR_FLIGHT_RADIUS
function play_pilot_dialog(dialogKey, killstreakType, killstreakId, pilotIndex)
function getOtherTeam(team)
function IsEnemyPlayer(player)
function followBomb(plane, position, direction, impact, player)
function doPlaneMortar(positions, team, killstreak_id)
#define PLANE_MORTAR_MODEL_ENEMY
function destroyedAircraft(attacker, weapon, playerControlled)
function planeAwardScoreEvent(attacker, plane)
#define PLANE_MORTAR_LOCATION_SELECTOR
#define PLANE_MORTAR_DELAY
#define PLANE_MORTAR_LOCATION_SELECTOR_DONE
function isKillstreakAllowed(hardpointType, team)
function set_team_kill_penalty_scale(killstreakType, scale, isInventory)
function getNoFlyZoneHeightCrossed(start, end, minHeight)
function get_random_pilot_index(killstreakType)
function HasSatellite(team_or_entnum)
#define PLANE_MORTAR_FLIGHT_TIME
function waittill_any(str_notify1, str_notify2, str_notify3, str_notify4, str_notify5)
function singleRadarSweep()
function waittill_confirm_location()
function register_dialog(killstreakType, informDialog, taacomDialogBundleKey, pilotDialogArrayKey, startDialogKey, enemyStartDialogKey, enemyStartMultipleDialogKey, hackedDialogKey, hackedStartDialogKey, requestDialogKey, threatDialogKey, isInventory)
function usePlaneMortar(positions)
#define PLANE_MORTAR_AIM_ASSIST_RADIUS_SQ
function register_strings(killstreakType, receivedText, notUsableText, inboundText, inboundNearPlayerText, hackedText, utilizesAirspace=true, isInventory=false)
function killstreakStop(hardpointType, team, id)
#define PLANE_MORTAR_MODEL
function killstreakStart(hardpointType, team, hacked, displayTeamMessage)
function useKillstreakPlaneMortar(hardpointType)
function set(str_field_name, n_value)
function leader_dialog(dialogKey, team, excludeList, objectiveKey, killstreakId, dialogBufferKey)
#define PLANE_MORTAR_SELECTION_RADIUS
function lookAtExplosion(bomb)
function play_taacom_dialog(dialogKey, killstreakType, killstreakId)
function Plane_CleanUpOnDeath()
function result(death, attacker, mod, weapon)
function endSelectionThink()
function planeMortar_killstreakStop(team, killstreak_id)
#define WAIT_SERVER_FRAME
function selectPlaneMortarLocation(hardpointType)
#define PLANE_MORTAR_SELECTION_COUNT