mirror of
https://github.com/ineedbots/t5_bot_warfare.git
synced 2025-06-25 13:51:53 +00:00
1.03
This commit is contained in:
1957
mods/mp_patch/maps/mp/_dogs.gsc
Normal file
1957
mods/mp_patch/maps/mp/_dogs.gsc
Normal file
File diff suppressed because it is too large
Load Diff
2202
mods/mp_patch/maps/mp/_utility.gsc
Normal file
2202
mods/mp_patch/maps/mp/_utility.gsc
Normal file
File diff suppressed because it is too large
Load Diff
7247
mods/mp_patch/maps/mp/gametypes/_bot.gsc
Normal file
7247
mods/mp_patch/maps/mp/gametypes/_bot.gsc
Normal file
File diff suppressed because it is too large
Load Diff
2629
mods/mp_patch/maps/mp/gametypes/_globallogic_player.gsc
Normal file
2629
mods/mp_patch/maps/mp/gametypes/_globallogic_player.gsc
Normal file
File diff suppressed because it is too large
Load Diff
1070
mods/mp_patch/maps/mp/gametypes/_globallogic_score.gsc
Normal file
1070
mods/mp_patch/maps/mp/gametypes/_globallogic_score.gsc
Normal file
File diff suppressed because it is too large
Load Diff
1574
mods/mp_patch/maps/mp/gametypes/_spawning.gsc
Normal file
1574
mods/mp_patch/maps/mp/gametypes/_spawning.gsc
Normal file
File diff suppressed because it is too large
Load Diff
1517
mods/mp_patch/maps/mp/gametypes/ctf.gsc
Normal file
1517
mods/mp_patch/maps/mp/gametypes/ctf.gsc
Normal file
File diff suppressed because it is too large
Load Diff
1319
mods/mp_patch/maps/mp/gametypes/dem.gsc
Normal file
1319
mods/mp_patch/maps/mp/gametypes/dem.gsc
Normal file
File diff suppressed because it is too large
Load Diff
1426
mods/mp_patch/maps/mp/gametypes/dom.gsc
Normal file
1426
mods/mp_patch/maps/mp/gametypes/dom.gsc
Normal file
File diff suppressed because it is too large
Load Diff
1106
mods/mp_patch/maps/mp/gametypes/koth.gsc
Normal file
1106
mods/mp_patch/maps/mp/gametypes/koth.gsc
Normal file
File diff suppressed because it is too large
Load Diff
958
mods/mp_patch/maps/mp/gametypes/sab.gsc
Normal file
958
mods/mp_patch/maps/mp/gametypes/sab.gsc
Normal file
@ -0,0 +1,958 @@
|
||||
#include maps\mp\_utility;
|
||||
#include maps\mp\gametypes\_hud_util;
|
||||
/*
|
||||
Sabotage
|
||||
|
||||
// ...etc...
|
||||
*/
|
||||
|
||||
/*QUAKED mp_sab_spawn_axis (0.75 0.0 0.5) (-16 -16 0) (16 16 72)
|
||||
Axis players spawn away from enemies and near their team at one of these positions.*/
|
||||
|
||||
/*QUAKED mp_sab_spawn_allies (0.0 0.75 0.5) (-16 -16 0) (16 16 72)
|
||||
Allied players spawn away from enemies and near their team at one of these positions.*/
|
||||
|
||||
/*QUAKED mp_sab_spawn_axis_start (1.0 0.0 0.5) (-16 -16 0) (16 16 72)
|
||||
Axis players spawn away from enemies and near their team at one of these positions at the start of a round.*/
|
||||
|
||||
/*QUAKED mp_sab_spawn_allies_start (0.0 1.0 0.5) (-16 -16 0) (16 16 72)
|
||||
Allied players spawn away from enemies and near their team at one of these positions at the start of a round.*/
|
||||
|
||||
main()
|
||||
{
|
||||
if ( GetDvar( #"mapname") == "mp_background" )
|
||||
return;
|
||||
|
||||
maps\mp\gametypes\_globallogic::init();
|
||||
maps\mp\gametypes\_callbacksetup::SetupCallbacks();
|
||||
maps\mp\gametypes\_globallogic::SetupCallbacks();
|
||||
|
||||
level.teamBased = true;
|
||||
level.overrideTeamScore = true;
|
||||
|
||||
maps\mp\gametypes\_globallogic_utils::registerRoundSwitchDvar( level.gameType, 0, 0, 9 );
|
||||
maps\mp\gametypes\_globallogic_utils::registerTimeLimitDvar( level.gameType, 10, 0, 1440 );
|
||||
maps\mp\gametypes\_globallogic_utils::registerScoreLimitDvar( level.gameType, 0, 0, 500 );
|
||||
maps\mp\gametypes\_globallogic_utils::registerRoundLimitDvar( level.gameType, 1, 0, 10 );
|
||||
maps\mp\gametypes\_globallogic_utils::registerNumLivesDvar( level.gameType, 0, 0, 10 );
|
||||
maps\mp\gametypes\_globallogic_utils::registerRoundWinLimitDvar( level.gameType, 0, 0, 10 );
|
||||
|
||||
maps\mp\gametypes\_weapons::registerGrenadeLauncherDudDvar( level.gameType, 10, 0, 1440 );
|
||||
maps\mp\gametypes\_weapons::registerThrownGrenadeDudDvar( level.gameType, 0, 0, 1440 );
|
||||
maps\mp\gametypes\_weapons::registerKillstreakDelay( level.gameType, 0, 0, 1440 );
|
||||
|
||||
maps\mp\gametypes\_globallogic::registerFriendlyFireDelay( level.gameType, 15, 0, 1440 );
|
||||
|
||||
level.onStartGameType = ::onStartGameType;
|
||||
level.onSpawnPlayer = ::onSpawnPlayer;
|
||||
level.onSpawnPlayerUnified = ::onSpawnPlayerUnified;
|
||||
level.gamemodeSpawnDvars = ::sab_gamemodeSpawnDvars;
|
||||
level.onRoundEndGame = ::onRoundEndGame;
|
||||
|
||||
if ( !game["tiebreaker"] )
|
||||
{
|
||||
level.onPrecacheGameType = ::onPrecacheGameType;
|
||||
level.onTimeLimit = ::onTimeLimit;
|
||||
level.onDeadEvent = ::onDeadEvent;
|
||||
level.onRoundSwitch = ::onRoundSwitch;
|
||||
level.onPlayerKilled = ::onPlayerKilled;
|
||||
|
||||
level.endGameOnScoreLimit = false;
|
||||
|
||||
game["dialog"]["gametype"] = "sab_start";
|
||||
game["dialog"]["gametype_hardcore"] = "hcsab_start";
|
||||
game["dialog"]["offense_obj"] = "destroy_start";
|
||||
game["dialog"]["defense_obj"] = "destroy_start";
|
||||
game["dialog"]["sudden_death"] = "suddendeath";
|
||||
game["dialog"]["sudden_death_boost"] = "generic_boost";
|
||||
}
|
||||
else
|
||||
{
|
||||
level.onEndGame = ::onEndGame;
|
||||
|
||||
level.endGameOnScoreLimit = false;
|
||||
|
||||
game["dialog"]["gametype"] = "sab_start";
|
||||
game["dialog"]["gametype_hardcore"] = "hcsab_start";
|
||||
game["dialog"]["offense_obj"] = "generic_boost";
|
||||
game["dialog"]["defense_obj"] = "generic_boost";
|
||||
game["dialog"]["sudden_death"] = "suddendeath";
|
||||
game["dialog"]["sudden_death_boost"] = "generic_boost";
|
||||
|
||||
maps\mp\gametypes\_globallogic_utils::registerNumLivesDvar( "tb", 1, 1, 1 );
|
||||
maps\mp\gametypes\_globallogic_utils::registerTimeLimitDvar( "tb", 0, 0, 0 );
|
||||
}
|
||||
|
||||
badtrig = getent( "sab_bomb_defuse_allies", "targetname" );
|
||||
if ( isdefined( badtrig ) )
|
||||
badtrig delete();
|
||||
|
||||
badtrig = getent( "sab_bomb_defuse_axis", "targetname" );
|
||||
if ( isdefined( badtrig ) )
|
||||
badtrig delete();
|
||||
|
||||
level.lastDialogTime = 0;
|
||||
|
||||
// Sets the scoreboard columns and determines with data is sent across the network
|
||||
setscoreboardcolumns( "kills", "deaths", "plants", "defuses" );
|
||||
}
|
||||
|
||||
onPrecacheGameType()
|
||||
{
|
||||
game["bomb_dropped_sound"] = "mp_war_objective_lost";
|
||||
game["bomb_recovered_sound"] = "mp_war_objective_taken";
|
||||
|
||||
precacheShader("waypoint_bomb");
|
||||
precacheShader("waypoint_kill");
|
||||
precacheShader("waypoint_bomb_enemy");
|
||||
precacheShader("waypoint_defend");
|
||||
precacheShader("waypoint_defuse");
|
||||
precacheShader("waypoint_target");
|
||||
precacheShader("compass_waypoint_bomb");
|
||||
precacheShader("compass_waypoint_defend");
|
||||
precacheShader("compass_waypoint_defuse");
|
||||
precacheShader("compass_waypoint_target");
|
||||
precacheShader("hud_suitcase_bomb");
|
||||
|
||||
precacheString(&"MP_EXPLOSIVES_RECOVERED_BY");
|
||||
precacheString(&"MP_EXPLOSIVES_RECOVERED_BY");
|
||||
precacheString(&"MP_EXPLOSIVES_DROPPED_BY");
|
||||
precacheString(&"MP_EXPLOSIVES_PLANTED_BY");
|
||||
precacheString(&"MP_EXPLOSIVES_DEFUSED_BY");
|
||||
precacheString(&"MP_YOU_HAVE_RECOVERED_THE_BOMB");
|
||||
precacheString(&"PLATFORM_HOLD_TO_PLANT_EXPLOSIVES");
|
||||
precacheString(&"PLATFORM_HOLD_TO_DEFUSE_EXPLOSIVES");
|
||||
precacheString(&"MP_PLANTING_EXPLOSIVE");
|
||||
precacheString(&"MP_DEFUSING_EXPLOSIVE");
|
||||
precacheString(&"MP_TARGET_DESTROYED");
|
||||
precacheString(&"MP_NO_RESPAWN");
|
||||
precacheString(&"MP_TIE_BREAKER");
|
||||
precacheString(&"MP_NO_RESPAWN");
|
||||
precacheString(&"MP_SUDDEN_DEATH");
|
||||
}
|
||||
|
||||
|
||||
onRoundSwitch()
|
||||
{
|
||||
if ( !isdefined( game["switchedsides"] ) )
|
||||
game["switchedsides"] = false;
|
||||
|
||||
if ( game["teamScores"]["allies"] == level.scorelimit - 1 && game["teamScores"]["axis"] == level.scorelimit - 1 )
|
||||
{
|
||||
level.halftimeType = "overtime";
|
||||
level.halftimeSubCaption = &"MP_TIE_BREAKER";
|
||||
game["tiebreaker"] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
level.halftimeType = "halftime";
|
||||
game["switchedsides"] = !game["switchedsides"];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onStartGameType()
|
||||
{
|
||||
if ( !isdefined( game["switchedsides"] ) )
|
||||
game["switchedsides"] = false;
|
||||
|
||||
setClientNameMode("auto_change");
|
||||
|
||||
game["strings"]["target_destroyed"] = &"MP_TARGET_DESTROYED";
|
||||
|
||||
if ( !game["tiebreaker"] )
|
||||
{
|
||||
maps\mp\gametypes\_globallogic_ui::setObjectiveText( "allies", &"OBJECTIVES_SAB" );
|
||||
maps\mp\gametypes\_globallogic_ui::setObjectiveText( "axis", &"OBJECTIVES_SAB" );
|
||||
|
||||
if ( level.splitscreen )
|
||||
{
|
||||
maps\mp\gametypes\_globallogic_ui::setObjectiveScoreText( "allies", &"OBJECTIVES_SAB" );
|
||||
maps\mp\gametypes\_globallogic_ui::setObjectiveScoreText( "axis", &"OBJECTIVES_SAB" );
|
||||
}
|
||||
else
|
||||
{
|
||||
maps\mp\gametypes\_globallogic_ui::setObjectiveScoreText( "allies", &"OBJECTIVES_SAB_SCORE" );
|
||||
maps\mp\gametypes\_globallogic_ui::setObjectiveScoreText( "axis", &"OBJECTIVES_SAB_SCORE" );
|
||||
}
|
||||
maps\mp\gametypes\_globallogic_ui::setObjectiveHintText( "allies", &"OBJECTIVES_SAB_HINT" );
|
||||
maps\mp\gametypes\_globallogic_ui::setObjectiveHintText( "axis", &"OBJECTIVES_SAB_HINT" );
|
||||
}
|
||||
else
|
||||
{
|
||||
maps\mp\gametypes\_globallogic_ui::setObjectiveText( "allies", &"OBJECTIVES_TDM" );
|
||||
maps\mp\gametypes\_globallogic_ui::setObjectiveText( "axis", &"OBJECTIVES_TDM" );
|
||||
|
||||
if ( level.splitscreen )
|
||||
{
|
||||
maps\mp\gametypes\_globallogic_ui::setObjectiveScoreText( "allies", &"OBJECTIVES_TDM" );
|
||||
maps\mp\gametypes\_globallogic_ui::setObjectiveScoreText( "axis", &"OBJECTIVES_TDM" );
|
||||
}
|
||||
else
|
||||
{
|
||||
maps\mp\gametypes\_globallogic_ui::setObjectiveScoreText( "allies", &"OBJECTIVES_TDM_SCORE" );
|
||||
maps\mp\gametypes\_globallogic_ui::setObjectiveScoreText( "axis", &"OBJECTIVES_TDM_SCORE" );
|
||||
}
|
||||
maps\mp\gametypes\_globallogic_ui::setObjectiveHintText( "allies", &"OBJECTIVES_TDM_HINT" );
|
||||
maps\mp\gametypes\_globallogic_ui::setObjectiveHintText( "axis", &"OBJECTIVES_TDM_HINT" );
|
||||
}
|
||||
|
||||
level.spawnMins = ( 0, 0, 0 );
|
||||
level.spawnMaxs = ( 0, 0, 0 );
|
||||
maps\mp\gametypes\_spawnlogic::placeSpawnPoints( "mp_sab_spawn_allies_start" );
|
||||
maps\mp\gametypes\_spawnlogic::placeSpawnPoints( "mp_sab_spawn_axis_start" );
|
||||
maps\mp\gametypes\_spawnlogic::addSpawnPoints( "allies", "mp_sab_spawn_allies" );
|
||||
maps\mp\gametypes\_spawnlogic::addSpawnPoints( "axis", "mp_sab_spawn_axis" );
|
||||
maps\mp\gametypes\_spawning::updateAllSpawnPoints();
|
||||
|
||||
level.mapCenter = maps\mp\gametypes\_spawnlogic::findBoxCenter( level.spawnMins, level.spawnMaxs );
|
||||
setMapCenter( level.mapCenter );
|
||||
|
||||
spawnpoint = maps\mp\gametypes\_spawnlogic::getRandomIntermissionPoint();
|
||||
setDemoIntermissionPoint( spawnpoint.origin, spawnpoint.angles );
|
||||
|
||||
level.spawn_axis = maps\mp\gametypes\_spawnlogic::getSpawnpointArray( "mp_sab_spawn_axis" );
|
||||
level.spawn_allies = maps\mp\gametypes\_spawnlogic::getSpawnpointArray( "mp_sab_spawn_allies" );
|
||||
level.spawn_axis_start = maps\mp\gametypes\_spawnlogic::getSpawnpointArray( "mp_sab_spawn_axis_start" );
|
||||
level.spawn_allies_start = maps\mp\gametypes\_spawnlogic::getSpawnpointArray( "mp_sab_spawn_allies_start" );
|
||||
|
||||
maps\mp\gametypes\_rank::registerScoreInfo( "plant", 500 );
|
||||
maps\mp\gametypes\_rank::registerScoreInfo( "defuse", 500 );
|
||||
|
||||
allowed[0] = "sab";
|
||||
maps\mp\gametypes\_gameobjects::main(allowed);
|
||||
|
||||
// now that the game objects have been deleted place the influencers
|
||||
maps\mp\gametypes\_spawning::create_map_placed_influencers();
|
||||
|
||||
thread updateGametypeDvars();
|
||||
|
||||
thread sabotage();
|
||||
}
|
||||
|
||||
|
||||
onTimeLimit()
|
||||
{
|
||||
if ( level.inOvertime )
|
||||
return;
|
||||
|
||||
thread onOvertime();
|
||||
}
|
||||
|
||||
|
||||
onOvertime()
|
||||
{
|
||||
level endon ( "game_ended" );
|
||||
|
||||
level.timeLimitOverride = true;
|
||||
level.inOvertime = true;
|
||||
maps\mp\gametypes\_globallogic_audio::leaderDialog( "sudden_death" );
|
||||
maps\mp\gametypes\_globallogic_audio::leaderDialog( "sudden_death_boost" );
|
||||
for ( index = 0; index < level.players.size; index++ )
|
||||
{
|
||||
level.players[index] notify("force_spawn");
|
||||
level.players[index] thread maps\mp\gametypes\_hud_message::oldNotifyMessage( &"MP_SUDDEN_DEATH", &"MP_NO_RESPAWN", undefined, (1, 0, 0), "mp_last_stand" );
|
||||
|
||||
level.players[index] setClientUIVisibilityFlag( "g_compassShowEnemies", 1 );
|
||||
}
|
||||
|
||||
SetMatchTalkFlag( "DeadChatWithDead", 1 );
|
||||
SetMatchTalkFlag( "DeadChatWithTeam", 0 );
|
||||
SetMatchTalkFlag( "DeadHearTeamLiving", 0 );
|
||||
SetMatchTalkFlag( "DeadHearAllLiving", 0 );
|
||||
SetMatchTalkFlag( "EveryoneHearsEveryone", 0 );
|
||||
|
||||
waitTime = 0;
|
||||
while ( waitTime < 90 )
|
||||
{
|
||||
if ( !level.bombPlanted )
|
||||
{
|
||||
waitTime += 1;
|
||||
setGameEndTime( getTime() + ((90-waitTime)*1000) );
|
||||
}
|
||||
wait ( 1.0 );
|
||||
}
|
||||
|
||||
thread maps\mp\gametypes\_globallogic::endGame( "tie", game["strings"]["tie"] );
|
||||
}
|
||||
|
||||
|
||||
onDeadEvent( team )
|
||||
{
|
||||
if ( level.bombExploded )
|
||||
return;
|
||||
|
||||
if ( team == "all" )
|
||||
{
|
||||
if ( level.bombPlanted )
|
||||
{
|
||||
[[level._setTeamScore]]( level.bombPlantedBy, [[level._getTeamScore]]( level.bombPlantedBy ) + 1 );
|
||||
thread maps\mp\gametypes\_globallogic::endGame( level.bombPlantedBy, game["strings"][level.bombPlantedBy+"_mission_accomplished"] );
|
||||
}
|
||||
else
|
||||
{
|
||||
thread maps\mp\gametypes\_globallogic::endGame( "tie", game["strings"]["tie"] );
|
||||
}
|
||||
}
|
||||
else if ( level.bombPlanted )
|
||||
{
|
||||
if ( team == level.bombPlantedBy )
|
||||
{
|
||||
level.plantingTeamDead = true;
|
||||
return;
|
||||
}
|
||||
|
||||
[[level._setTeamScore]]( level.bombPlantedBy, [[level._getTeamScore]]( level.bombPlantedBy ) + 1 );
|
||||
thread maps\mp\gametypes\_globallogic::endGame( level.bombPlantedBy, game["strings"][level.otherTeam[level.bombPlantedBy]+"_eliminated"] );
|
||||
}
|
||||
else
|
||||
{
|
||||
[[level._setTeamScore]]( level.otherTeam[team], [[level._getTeamScore]]( level.otherTeam[team] ) + 1 );
|
||||
thread maps\mp\gametypes\_globallogic::endGame( level.otherTeam[team], game["strings"][team+"_eliminated"] );
|
||||
}
|
||||
}
|
||||
|
||||
onSpawnPlayerUnified()
|
||||
{
|
||||
self.isPlanting = false;
|
||||
self.isDefusing = false;
|
||||
self.isBombCarrier = false;
|
||||
|
||||
if ( game["tiebreaker"] )
|
||||
{
|
||||
self thread maps\mp\gametypes\_hud_message::oldNotifyMessage( &"MP_TIE_BREAKER", &"MP_NO_RESPAWN", undefined, (1, 0, 0), "mp_last_stand" );
|
||||
|
||||
hintMessage = maps\mp\gametypes\_globallogic_ui::getObjectiveHintText( self.pers["team"] );
|
||||
if ( isDefined( hintMessage ) )
|
||||
self DisplayGameModeMessage( hintMessage, "uin_alert_slideout" );
|
||||
|
||||
self setClientUIVisibilityFlag( "g_compassShowEnemies", 1 );
|
||||
|
||||
// this is being redundantly set everytime a player spawns
|
||||
// need to move this to a once only for eveyone when tiebreaker round
|
||||
// starts
|
||||
SetMatchTalkFlag( "DeadChatWithDead", 1 );
|
||||
SetMatchTalkFlag( "DeadChatWithTeam", 0 );
|
||||
SetMatchTalkFlag( "DeadHearTeamLiving", 0 );
|
||||
SetMatchTalkFlag( "DeadHearAllLiving", 0 );
|
||||
SetMatchTalkFlag( "EveryoneHearsEveryone", 0 );
|
||||
}
|
||||
|
||||
maps\mp\gametypes\_spawning::onSpawnPlayer_Unified();
|
||||
}
|
||||
|
||||
|
||||
onSpawnPlayer()
|
||||
{
|
||||
self.isPlanting = false;
|
||||
self.isDefusing = false;
|
||||
self.isBombCarrier = false;
|
||||
|
||||
spawnteam = self.pers["team"];
|
||||
if ( game["switchedsides"] )
|
||||
spawnteam = getOtherTeam( spawnteam );
|
||||
|
||||
if ( level.useStartSpawns )
|
||||
{
|
||||
if (spawnteam == "axis")
|
||||
spawnpoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_Random(level.spawn_axis_start);
|
||||
else
|
||||
spawnpoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_Random(level.spawn_allies_start);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (spawnteam == "axis")
|
||||
spawnpoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_NearTeam(level.spawn_axis);
|
||||
else
|
||||
spawnpoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_NearTeam(level.spawn_allies);
|
||||
}
|
||||
|
||||
if ( game["tiebreaker"] )
|
||||
{
|
||||
self thread maps\mp\gametypes\_hud_message::oldNotifyMessage( &"MP_TIE_BREAKER", &"MP_NO_RESPAWN", undefined, (1, 0, 0), "mp_last_stand" );
|
||||
|
||||
hintMessage = maps\mp\gametypes\_globallogic_ui::getObjectiveHintText( self.pers["team"] );
|
||||
if ( isDefined( hintMessage ) )
|
||||
self DisplayGameModeMessage( hintMessage, "uin_alert_slideout" );
|
||||
|
||||
self setClientUIVisibilityFlag( "g_compassShowEnemies", 1 );
|
||||
// this is being redundantly set everytime a player spawns
|
||||
// need to move this to a once only for eveyone when tiebreaker round
|
||||
// starts
|
||||
SetMatchTalkFlag( "DeadChatWithDead", 1 );
|
||||
SetMatchTalkFlag( "DeadChatWithTeam", 0 );
|
||||
SetMatchTalkFlag( "DeadHearTeamLiving", 0 );
|
||||
SetMatchTalkFlag( "DeadHearAllLiving", 0 );
|
||||
SetMatchTalkFlag( "EveryoneHearsEveryone", 0 );
|
||||
}
|
||||
|
||||
assert( isDefined(spawnpoint) );
|
||||
|
||||
self spawn( spawnpoint.origin, spawnpoint.angles, "sab" );
|
||||
}
|
||||
|
||||
|
||||
updateGametypeDvars()
|
||||
{
|
||||
level.plantTime = dvarFloatValue( "planttime", 5, 0, 20 );
|
||||
level.defuseTime = dvarFloatValue( "defusetime", 5, 0, 20 );
|
||||
level.bombTimer = dvarFloatValue( "bombtimer", 45, 1, 300 );
|
||||
level.hotPotato = dvarIntValue( "hotpotato", 1, 0, 1 );
|
||||
}
|
||||
|
||||
|
||||
sabotage()
|
||||
{
|
||||
level.bombPlanted = false;
|
||||
level.bombExploded = false;
|
||||
|
||||
level._effect["bombexplosion"] = loadfx("maps/mp_maps/fx_mp_exp_bomb");
|
||||
|
||||
trigger = getEnt( "sab_bomb_pickup_trig", "targetname" );
|
||||
if ( !isDefined( trigger ) )
|
||||
{
|
||||
error( "No sab_bomb_pickup_trig trigger found in map." );
|
||||
return;
|
||||
}
|
||||
|
||||
visuals[0] = getEnt( "sab_bomb", "targetname" );
|
||||
if ( !isDefined( visuals[0] ) )
|
||||
{
|
||||
error( "No sab_bomb script_model found in map." );
|
||||
return;
|
||||
}
|
||||
|
||||
//precacheModel( "t5_weapon_briefcase_world" );
|
||||
//visuals[0] setModel( "t5_weapon_briefcase_world" );
|
||||
level.sabBomb = maps\mp\gametypes\_gameobjects::createCarryObject( "neutral", trigger, visuals, (0,0,32) );
|
||||
level.sabBomb maps\mp\gametypes\_gameobjects::allowCarry( "any" );
|
||||
level.sabBomb maps\mp\gametypes\_gameobjects::set2DIcon( "enemy", "compass_waypoint_bomb" );
|
||||
level.sabBomb maps\mp\gametypes\_gameobjects::set3DIcon( "enemy", "waypoint_bomb" );
|
||||
level.sabBomb maps\mp\gametypes\_gameobjects::set2DIcon( "friendly", "compass_waypoint_bomb" );
|
||||
level.sabBomb maps\mp\gametypes\_gameobjects::set3DIcon( "friendly", "waypoint_bomb" );
|
||||
level.sabBomb maps\mp\gametypes\_gameobjects::setCarryIcon( "hud_suitcase_bomb" );
|
||||
level.sabBomb maps\mp\gametypes\_gameobjects::setVisibleTeam( "any" );
|
||||
level.sabBomb.objIDPingEnemy = true;
|
||||
level.sabBomb.onPickup = ::onPickup;
|
||||
level.sabBomb.onDrop = ::onDrop;
|
||||
level.sabBomb.allowWeapons = true;
|
||||
level.sabBomb.objPoints["allies"].archived = true;
|
||||
level.sabBomb.objPoints["axis"].archived = true;
|
||||
level.sabBomb.autoResetTime = 60.0;
|
||||
|
||||
if ( !isDefined( getEnt( "sab_bomb_axis", "targetname" ) ) )
|
||||
{
|
||||
error("No sab_bomb_axis trigger found in map.");
|
||||
return;
|
||||
}
|
||||
if ( !isDefined( getEnt( "sab_bomb_allies", "targetname" ) ) )
|
||||
{
|
||||
error("No sab_bomb_allies trigger found in map.");
|
||||
return;
|
||||
}
|
||||
|
||||
if ( game["switchedsides"] )
|
||||
{
|
||||
level.bombZones["allies"] = createBombZone( "allies", getEnt( "sab_bomb_axis", "targetname" ) );
|
||||
level.bombZones["axis"] = createBombZone( "axis", getEnt( "sab_bomb_allies", "targetname" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
level.bombZones["allies"] = createBombZone( "allies", getEnt( "sab_bomb_allies", "targetname" ) );
|
||||
level.bombZones["axis"] = createBombZone( "axis", getEnt( "sab_bomb_axis", "targetname" ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
createBombZone( team, trigger )
|
||||
{
|
||||
visuals = getEntArray( trigger.target, "targetname" );
|
||||
|
||||
bombZone = maps\mp\gametypes\_gameobjects::createUseObject( team, trigger, visuals, (0,0,64) );
|
||||
bombZone resetBombsite();
|
||||
bombZone.onUse = ::onUse;
|
||||
bombZone.onBeginUse = ::onBeginUse;
|
||||
bombZone.onEndUse = ::onEndUse;
|
||||
bombZone.onCantUse = ::onCantUse;
|
||||
bombZone.useWeapon = "briefcase_bomb_mp";
|
||||
bombZone.visuals[0].killCamEnt = spawn( "script_model", bombZone.visuals[0].origin + (0,0,128) );
|
||||
|
||||
for ( i = 0; i < visuals.size; i++ )
|
||||
{
|
||||
if ( isDefined( visuals[i].script_exploder ) )
|
||||
{
|
||||
bombZone.exploderIndex = visuals[i].script_exploder;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return bombZone;
|
||||
}
|
||||
|
||||
|
||||
onBeginUse( player )
|
||||
{
|
||||
// planted the bomb
|
||||
if ( !self maps\mp\gametypes\_gameobjects::isFriendlyTeam( player.pers["team"] ) )
|
||||
{
|
||||
player.isPlanting = true;
|
||||
player thread maps\mp\gametypes\_battlechatter_mp::gametypeSpecificBattleChatter( "sd_friendlyplant", player.pers["team"] );
|
||||
}
|
||||
else
|
||||
{
|
||||
player.isDefusing = true;
|
||||
player thread maps\mp\gametypes\_battlechatter_mp::gametypeSpecificBattleChatter( "sd_enemyplant", player.pers["team"] );
|
||||
}
|
||||
|
||||
player playSound( "fly_bomb_raise_plr" );
|
||||
}
|
||||
|
||||
onEndUse( team, player, result )
|
||||
{
|
||||
if ( !isAlive( player ) )
|
||||
return;
|
||||
|
||||
player.isPlanting = false;
|
||||
player.isDefusing = false;
|
||||
player notify( "event_ended" );
|
||||
}
|
||||
|
||||
|
||||
onPickup( player )
|
||||
{
|
||||
level notify ( "bomb_picked_up" );
|
||||
|
||||
self.autoResetTime = 60.0;
|
||||
|
||||
level.useStartSpawns = false;
|
||||
|
||||
team = player.pers["team"];
|
||||
|
||||
if ( team == "allies" )
|
||||
otherTeam = "axis";
|
||||
else
|
||||
otherTeam = "allies";
|
||||
|
||||
//player iPrintLnBold( &"MP_YOU_HAVE_RECOVERED_THE_BOMB" );
|
||||
player playLocalSound( "mp_suitcase_pickup" );
|
||||
player logString( "bomb taken" );
|
||||
|
||||
excludeList[0] = player;
|
||||
|
||||
if( getTime() - level.lastDialogTime > 10000 )
|
||||
{
|
||||
maps\mp\gametypes\_globallogic_audio::leaderDialog( "bomb_acquired", team );
|
||||
player maps\mp\gametypes\_globallogic_audio::leaderDialogOnPlayer( "obj_destroy", "bomb" );
|
||||
|
||||
|
||||
if ( !level.splitscreen )
|
||||
{
|
||||
maps\mp\gametypes\_globallogic_audio::leaderDialog( "bomb_taken", otherTeam );
|
||||
maps\mp\gametypes\_globallogic_audio::leaderDialog( "obj_defend", otherTeam );
|
||||
}
|
||||
|
||||
level.lastDialogTime = getTime();
|
||||
}
|
||||
player.isBombCarrier = true;
|
||||
|
||||
player maps\mp\gametypes\_persistence::statAddWithGameType( "PICKUPS", 1 );
|
||||
|
||||
|
||||
// recovered the bomb before abandonment timer elapsed
|
||||
if ( team == self maps\mp\gametypes\_gameobjects::getOwnerTeam() )
|
||||
{
|
||||
printOnTeamArg( &"MP_EXPLOSIVES_RECOVERED_BY", team, player );
|
||||
playSoundOnPlayers( game["bomb_recovered_sound"], team );
|
||||
}
|
||||
else
|
||||
{
|
||||
printOnTeamArg( &"MP_EXPLOSIVES_RECOVERED_BY", team, player );
|
||||
// printOnTeamArg( &"MP_EXPLOSIVES_RECOVERED_BY", otherTeam, &"MP_THE_ENEMY" );
|
||||
playSoundOnPlayers( game["bomb_recovered_sound"] );
|
||||
}
|
||||
|
||||
self maps\mp\gametypes\_gameobjects::setOwnerTeam( team );
|
||||
self maps\mp\gametypes\_gameobjects::setVisibleTeam( "any" );
|
||||
self maps\mp\gametypes\_gameobjects::set2DIcon( "enemy", "compass_waypoint_target" );
|
||||
self maps\mp\gametypes\_gameobjects::set3DIcon( "enemy", "waypoint_kill" );
|
||||
self maps\mp\gametypes\_gameobjects::set2DIcon( "friendly", "compass_waypoint_defend" );
|
||||
self maps\mp\gametypes\_gameobjects::set3DIcon( "friendly", "waypoint_defend" );
|
||||
|
||||
level.bombZones[team] maps\mp\gametypes\_gameobjects::setVisibleTeam( "none" );
|
||||
level.bombZones[otherTeam] maps\mp\gametypes\_gameobjects::setVisibleTeam( "any" );
|
||||
|
||||
level.bombZones[otherTeam].trigger SetInvisibleToAll();
|
||||
level.bombZones[otherTeam].trigger SetVisibleToPlayer( player );
|
||||
}
|
||||
|
||||
|
||||
onDrop( player )
|
||||
{
|
||||
if ( level.bombPlanted )
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( isDefined( player ) )
|
||||
printOnTeamArg( &"MP_EXPLOSIVES_DROPPED_BY", self maps\mp\gametypes\_gameobjects::getOwnerTeam(), player );
|
||||
// else
|
||||
// printOnTeamArg( &"MP_EXPLOSIVES_DROPPED_BY", self maps\mp\gametypes\_gameobjects::getOwnerTeam(), &"MP_YOUR_TEAM" );
|
||||
|
||||
playSoundOnPlayers( game["bomb_dropped_sound"], self maps\mp\gametypes\_gameobjects::getOwnerTeam() );
|
||||
if ( isDefined( player ) )
|
||||
player logString( "bomb dropped" );
|
||||
else
|
||||
logString( "bomb dropped" );
|
||||
|
||||
maps\mp\gametypes\_globallogic_audio::leaderDialog( "bomb_lost", self maps\mp\gametypes\_gameobjects::getOwnerTeam() );
|
||||
|
||||
player notify( "event_ended" );
|
||||
|
||||
level.bombZones["axis"].trigger SetInvisibleToAll();
|
||||
level.bombZones["allies"].trigger SetInvisibleToAll();
|
||||
|
||||
thread abandonmentThink( 0.0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
abandonmentThink( delay )
|
||||
{
|
||||
level endon ( "bomb_picked_up" );
|
||||
|
||||
wait ( delay );
|
||||
|
||||
if ( isDefined( self.carrier ) )
|
||||
return;
|
||||
|
||||
if ( self maps\mp\gametypes\_gameobjects::getOwnerTeam() == "allies" )
|
||||
otherTeam = "axis";
|
||||
else
|
||||
otherTeam = "allies";
|
||||
|
||||
// printOnTeamArg( &"MP_EXPLOSIVES_DROPPED_BY", otherTeam, &"MP_THE_ENEMY" );
|
||||
playSoundOnPlayers( game["bomb_dropped_sound"], otherTeam );
|
||||
|
||||
self maps\mp\gametypes\_gameobjects::setOwnerTeam( "neutral" );
|
||||
self maps\mp\gametypes\_gameobjects::setVisibleTeam( "any" );
|
||||
self maps\mp\gametypes\_gameobjects::set2DIcon( "enemy", "compass_waypoint_bomb" );
|
||||
self maps\mp\gametypes\_gameobjects::set3DIcon( "enemy", "waypoint_bomb" );
|
||||
self maps\mp\gametypes\_gameobjects::set2DIcon( "friendly", "compass_waypoint_bomb" );
|
||||
self maps\mp\gametypes\_gameobjects::set3DIcon( "friendly", "waypoint_bomb" );
|
||||
|
||||
level.bombZones["allies"] maps\mp\gametypes\_gameobjects::setVisibleTeam( "none" );
|
||||
level.bombZones["axis"] maps\mp\gametypes\_gameobjects::setVisibleTeam( "none" );
|
||||
}
|
||||
|
||||
|
||||
onUse( player )
|
||||
{
|
||||
team = player.pers["team"];
|
||||
otherTeam = level.otherTeam[team];
|
||||
// planted the bomb
|
||||
if ( !self maps\mp\gametypes\_gameobjects::isFriendlyTeam( player.pers["team"] ) )
|
||||
{
|
||||
player notify ( "bomb_planted" );
|
||||
// removed old playsound entry CDC 2/18/10
|
||||
// player playSound( "mpl_sab_bomb_plant" );
|
||||
player logString( "bomb planted" );
|
||||
|
||||
if( isdefined(player.pers["plants"]) )
|
||||
{
|
||||
player.pers["plants"]++;
|
||||
player.plants = player.pers["plants"];
|
||||
}
|
||||
|
||||
player maps\mp\_medals::saboteur();
|
||||
|
||||
player maps\mp\gametypes\_persistence::statAddWithGameType( "PLANTS", 1 );
|
||||
|
||||
level thread maps\mp\_popups::DisplayTeamMessageToAll( &"MP_EXPLOSIVES_PLANTED_BY", player );
|
||||
|
||||
//thread playSoundOnPlayers( "mus_sab_planted"+"_"+level.teamPostfix[team] );
|
||||
// Play Action music
|
||||
//maps\mp\_music::setmusicstate( "ACTION" );
|
||||
|
||||
maps\mp\gametypes\_globallogic_audio::leaderDialog( "bomb_planted", team );
|
||||
|
||||
maps\mp\gametypes\_globallogic_audio::leaderDialog( "bomb_planted", otherTeam );
|
||||
|
||||
maps\mp\gametypes\_globallogic_score::givePlayerScore( "plant", player );
|
||||
//player thread [[level.onXPEvent]]( "plant" );
|
||||
|
||||
level thread bombPlanted( self, player.pers["team"] );
|
||||
|
||||
level.bombOwner = player;
|
||||
|
||||
player.isBombCarrier = false;
|
||||
|
||||
// self.keyObject maps\mp\gametypes\_gameobjects::disableObject();
|
||||
level.sabBomb.autoResetTime = undefined;
|
||||
level.sabBomb maps\mp\gametypes\_gameobjects::allowCarry( "none" );
|
||||
level.sabBomb maps\mp\gametypes\_gameobjects::setVisibleTeam( "none" );
|
||||
level.sabBomb maps\mp\gametypes\_gameobjects::setDropped();
|
||||
self.useWeapon = "briefcase_bomb_defuse_mp";
|
||||
|
||||
self setUpForDefusing();
|
||||
}
|
||||
else // defused the bomb
|
||||
{
|
||||
player notify ( "bomb_defused" );
|
||||
player logString( "bomb defused" );
|
||||
|
||||
if( isdefined(player.pers["defuses"]) )
|
||||
{
|
||||
player.pers["defuses"]++;
|
||||
player.defuses = player.pers["defuses"];
|
||||
}
|
||||
|
||||
player maps\mp\_medals::hero();
|
||||
|
||||
player maps\mp\gametypes\_persistence::statAddWithGameType( "DEFUSES", 1 );
|
||||
|
||||
level thread maps\mp\_popups::DisplayTeamMessageToAll( &"MP_EXPLOSIVES_DEFUSED_BY", player );
|
||||
//thread playSoundOnPlayers( "mus_sab_defused"+"_"+level.teamPostfix[team] );
|
||||
maps\mp\gametypes\_globallogic_audio::set_music_on_team( "UNDERSCORE", "both", true );
|
||||
|
||||
maps\mp\gametypes\_globallogic_audio::leaderDialog( "bomb_defused" );
|
||||
|
||||
maps\mp\gametypes\_globallogic_score::givePlayerScore( "defuse", player );
|
||||
//player thread [[level.onXPEvent]]( "defuse" );
|
||||
|
||||
level thread bombDefused( self );
|
||||
|
||||
if ( level.inOverTime && isDefined( level.plantingTeamDead ) )
|
||||
{
|
||||
thread maps\mp\gametypes\_globallogic::endGame( player.pers["team"], game["strings"][level.bombPlantedBy+"_eliminated"] );
|
||||
return;
|
||||
}
|
||||
|
||||
self resetBombsite();
|
||||
|
||||
level.sabBomb maps\mp\gametypes\_gameobjects::allowCarry( "any" );
|
||||
level.sabBomb maps\mp\gametypes\_gameobjects::setPickedUp( player );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onCantUse( player )
|
||||
{
|
||||
player iPrintLnBold( &"MP_CANT_PLANT_WITHOUT_BOMB" );
|
||||
}
|
||||
|
||||
|
||||
bombPlanted( destroyedObj, team )
|
||||
{
|
||||
game["challenge"][team]["plantedBomb"] = true;
|
||||
maps\mp\gametypes\_globallogic_utils::pauseTimer();
|
||||
level.bombPlanted = true;
|
||||
level.bombPlantedBy = team;
|
||||
level.timeLimitOverride = true;
|
||||
setMatchFlag( "bomb_timer", 1 );
|
||||
|
||||
// communicate timer information to menus
|
||||
setGameEndTime( int( getTime() + (level.bombTimer * 1000) ) );
|
||||
|
||||
destroyedObj.visuals[0] thread maps\mp\gametypes\_globallogic_utils::playTickingSound( "mpl_sab_ui_suitcasebomb_timer" );
|
||||
|
||||
starttime = gettime();
|
||||
bombTimerWait();
|
||||
|
||||
setMatchFlag( "bomb_timer", 0 );
|
||||
destroyedObj.visuals[0] maps\mp\gametypes\_globallogic_utils::stopTickingSound();
|
||||
|
||||
if ( !level.bombPlanted )
|
||||
{
|
||||
if ( level.hotPotato )
|
||||
{
|
||||
timePassed = (gettime() - starttime) / 1000;
|
||||
level.bombTimer -= timePassed;
|
||||
}
|
||||
return;
|
||||
}
|
||||
/*
|
||||
for ( index = 0; index < level.players.size; index++ )
|
||||
{
|
||||
player = level.players[index];
|
||||
if ( player.pers["team"] == team )
|
||||
player thread maps\mp\gametypes\_hud_message::oldNotifyMessage( "Your team scored!", undefined, undefined, (0, 1, 0) );
|
||||
else if ( player.pers["team"] == level.otherTeam[team] )
|
||||
player thread maps\mp\gametypes\_hud_message::oldNotifyMessage( "Enemy team scored!", undefined, undefined, (1, 0, 0) );
|
||||
}
|
||||
*/
|
||||
explosionOrigin = level.sabBomb.visuals[0].origin+(0,0,12);
|
||||
level.bombExploded = true;
|
||||
|
||||
|
||||
if ( isdefined( level.bombowner ) )
|
||||
{
|
||||
destroyedObj.visuals[0] radiusDamage( explosionOrigin, 512, 200, 20, level.bombowner, "MOD_EXPLOSIVE", "briefcase_bomb_mp" );
|
||||
level thread maps\mp\_popups::DisplayTeamMessageToAll( &"MP_EXPLOSIVES_BLOWUP_BY", level.bombowner );
|
||||
level.bombowner maps\mp\_medals::bomber();
|
||||
|
||||
level.bombowner maps\mp\gametypes\_persistence::statAddWithGameType( "DESTRUCTIONS", 1 );
|
||||
|
||||
}
|
||||
else
|
||||
destroyedObj.visuals[0] radiusDamage( explosionOrigin, 512, 200, 20, undefined, "MOD_EXPLOSIVE", "briefcase_bomb_mp" );
|
||||
|
||||
rot = randomfloat(360);
|
||||
explosionEffect = spawnFx( level._effect["bombexplosion"], explosionOrigin + (0,0,50), (0,0,1), (cos(rot),sin(rot),0) );
|
||||
triggerFx( explosionEffect );
|
||||
|
||||
thread playSoundinSpace( "mpl_sab_exp_suitcase_bomb_main", explosionOrigin );
|
||||
|
||||
if ( isDefined( destroyedObj.exploderIndex ) )
|
||||
exploder( destroyedObj.exploderIndex );
|
||||
|
||||
[[level._setTeamScore]]( team, [[level._getTeamScore]]( team ) + 1 );
|
||||
|
||||
setGameEndTime( 0 );
|
||||
|
||||
level.bombZones["allies"] maps\mp\gametypes\_gameobjects::setVisibleTeam( "none" );
|
||||
level.bombZones["axis"] maps\mp\gametypes\_gameobjects::setVisibleTeam( "none" );
|
||||
wait 3;
|
||||
|
||||
// end the round without resetting the timer
|
||||
thread maps\mp\gametypes\_globallogic::endGame( team, game["strings"]["target_destroyed"] );
|
||||
}
|
||||
|
||||
bombTimerWait()
|
||||
{
|
||||
level endon("bomb_defused");
|
||||
maps\mp\gametypes\_hostmigration::waitLongDurationWithGameEndTimeUpdate( level.bombTimer );
|
||||
}
|
||||
|
||||
|
||||
resetBombsite()
|
||||
{
|
||||
self maps\mp\gametypes\_gameobjects::allowUse( "enemy" );
|
||||
self maps\mp\gametypes\_gameobjects::setUseTime( level.plantTime );
|
||||
self maps\mp\gametypes\_gameobjects::setUseText( &"MP_PLANTING_EXPLOSIVE" );
|
||||
self maps\mp\gametypes\_gameobjects::setUseHintText( &"PLATFORM_HOLD_TO_PLANT_EXPLOSIVES" );
|
||||
self maps\mp\gametypes\_gameobjects::setKeyObject( level.sabBomb );
|
||||
self maps\mp\gametypes\_gameobjects::set2DIcon( "friendly", "compass_waypoint_defend" );
|
||||
self maps\mp\gametypes\_gameobjects::set3DIcon( "friendly", "waypoint_defend" );
|
||||
self maps\mp\gametypes\_gameobjects::set2DIcon( "enemy", "compass_waypoint_target" );
|
||||
self maps\mp\gametypes\_gameobjects::set3DIcon( "enemy", "waypoint_target" );
|
||||
self maps\mp\gametypes\_gameobjects::setVisibleTeam( "none" );
|
||||
self.trigger SetInvisibleToAll();
|
||||
self.useWeapon = "briefcase_bomb_mp";
|
||||
}
|
||||
|
||||
setUpForDefusing()
|
||||
{
|
||||
self maps\mp\gametypes\_gameobjects::allowUse( "friendly" );
|
||||
self maps\mp\gametypes\_gameobjects::setUseTime( level.defuseTime );
|
||||
self maps\mp\gametypes\_gameobjects::setUseText( &"MP_DEFUSING_EXPLOSIVE" );
|
||||
self maps\mp\gametypes\_gameobjects::setUseHintText( &"PLATFORM_HOLD_TO_DEFUSE_EXPLOSIVES" );
|
||||
self maps\mp\gametypes\_gameobjects::setKeyObject( undefined );
|
||||
self maps\mp\gametypes\_gameobjects::set2DIcon( "friendly", "compass_waypoint_defuse" );
|
||||
self maps\mp\gametypes\_gameobjects::set3DIcon( "friendly", "waypoint_defuse" );
|
||||
self maps\mp\gametypes\_gameobjects::set2DIcon( "enemy", "compass_waypoint_defend" );
|
||||
self maps\mp\gametypes\_gameobjects::set3DIcon( "enemy", "waypoint_defend" );
|
||||
self maps\mp\gametypes\_gameobjects::setVisibleTeam( "any" );
|
||||
self.trigger SetVisibleToAll();
|
||||
}
|
||||
|
||||
bombDefused( object )
|
||||
{
|
||||
setMatchFlag( "bomb_timer", 0 );
|
||||
maps\mp\gametypes\_globallogic_utils::resumeTimer();
|
||||
level.bombPlanted = false;
|
||||
if ( !level.inOvertime )
|
||||
level.timeLimitOverride = false;
|
||||
|
||||
level notify("bomb_defused");
|
||||
}
|
||||
|
||||
onPlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration)
|
||||
{
|
||||
inBombZone = false;
|
||||
inBombZoneTeam = "none";
|
||||
|
||||
if ( isdefined( sWeapon ) && maps\mp\gametypes\_hardpoints::isKillstreakWeapon( sWeapon ) )
|
||||
return;
|
||||
|
||||
if ( isdefined( level.bombZones["allies"] ) )
|
||||
{
|
||||
dist = Distance2d(self.origin, level.bombZones["allies"].curorigin);
|
||||
if ( dist < level.defaultOffenseRadius )
|
||||
{
|
||||
inBombZoneTeam = "allies";
|
||||
inBombZone = true;
|
||||
}
|
||||
}
|
||||
if ( isdefined( level.bombZones["axis"] ) )
|
||||
{
|
||||
dist = Distance2d(self.origin, level.bombZones["axis"].curorigin);
|
||||
if ( dist < level.defaultOffenseRadius )
|
||||
{
|
||||
inBombZoneTeam = "axis";
|
||||
inBombZone = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( inBombZone && isPlayer( attacker ) && attacker.pers["team"] != self.pers["team"] )
|
||||
{
|
||||
if ( inBombZoneTeam == self.pers["team"] )
|
||||
{
|
||||
attacker maps\mp\_medals::offense( sWeapon );
|
||||
attacker maps\mp\gametypes\_persistence::statAddWithGameType( "OFFENDS", 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( isdefined(attacker.pers["defends"]) )
|
||||
{
|
||||
attacker.pers["defends"]++;
|
||||
attacker.defends = attacker.pers["defends"];
|
||||
}
|
||||
|
||||
attacker maps\mp\_medals::defense( sWeapon );
|
||||
attacker maps\mp\gametypes\_persistence::statAddWithGameType( "DEFENDS", 1 );
|
||||
}
|
||||
}
|
||||
|
||||
if ( isPlayer( attacker ) && attacker.pers["team"] != self.pers["team"] && isdefined( self.isBombCarrier ) && self.isBombCarrier == true )
|
||||
attacker maps\mp\_challenges::killedBombCarrier();
|
||||
}
|
||||
|
||||
onEndGame( winningTeam )
|
||||
{
|
||||
if ( isdefined( winningTeam ) && (winningTeam == "allies" || winningTeam == "axis") )
|
||||
[[level._setTeamScore]]( winningTeam, [[level._getTeamScore]]( winningTeam ) + 1 );
|
||||
}
|
||||
|
||||
onRoundEndGame( roundWinner )
|
||||
{
|
||||
if ( game["roundswon"]["allies"] == game["roundswon"]["axis"] )
|
||||
winner = "tie";
|
||||
else if ( game["roundswon"]["axis"] > game["roundswon"]["allies"] )
|
||||
winner = "axis";
|
||||
else
|
||||
winner = "allies";
|
||||
|
||||
return winner;
|
||||
}
|
||||
|
||||
sab_gamemodeSpawnDvars(reset_dvars)
|
||||
{
|
||||
ss = level.spawnsystem;
|
||||
|
||||
// sabotage: influencer around friendly base
|
||||
ss.sab_friendly_base_influencer_score = set_dvar_float_if_unset("scr_spawn_sab_friendly_base_influencer_score", "100", reset_dvars);
|
||||
ss.sab_friendly_base_influencer_score_curve = set_dvar_if_unset("scr_spawn_sab_friendly_base_influencer_score_curve", "constant", reset_dvars);
|
||||
ss.sab_friendly_base_influencer_radius = set_dvar_float_if_unset("scr_spawn_sab_friendly_base_influencer_radius", "" + 15.0*get_player_height(), reset_dvars);
|
||||
|
||||
// sabotage: influencer around enemy base
|
||||
ss.sab_enemy_base_influencer_score = set_dvar_float_if_unset("scr_spawn_sab_enemy_base_influencer_score", "-500", reset_dvars);
|
||||
ss.sab_enemy_base_influencer_score_curve = set_dvar_if_unset("scr_spawn_sab_enemy_base_influencer_score_curve", "constant", reset_dvars);
|
||||
ss.sab_enemy_base_influencer_radius = set_dvar_float_if_unset("scr_spawn_sab_enemy_base_influencer_radius", "" + 15.0*get_player_height(), reset_dvars);
|
||||
|
||||
// sabotage: negative influencer around carrier
|
||||
ss.sab_carrier_influencer_score = set_dvar_float_if_unset("scr_spawn_sab_carrier_influencer_score", "-75", reset_dvars);
|
||||
ss.sab_carrier_influencer_score_curve = set_dvar_if_unset("scr_spawn_sab_carrier_influencer_score_curve", "linear", reset_dvars);
|
||||
ss.sab_carrier_influencer_radius = set_dvar_float_if_unset("scr_spawn_sab_carrier_influencer_radius", "" + 8.0*get_player_height(), reset_dvars);
|
||||
|
||||
}
|
152
mods/mp_patch/maps/mp/mp_array.gsc
Normal file
152
mods/mp_patch/maps/mp/mp_array.gsc
Normal file
@ -0,0 +1,152 @@
|
||||
#include maps\mp\_utility;
|
||||
#include common_scripts\utility;
|
||||
|
||||
main()
|
||||
{
|
||||
//needs to be first for create fx
|
||||
maps\mp\mp_array_fx::main();
|
||||
|
||||
precachemodel("collision_geo_10x10x512");
|
||||
precachemodel("collision_geo_64x64x64");
|
||||
precachemodel("collision_wall_64x64x10");
|
||||
precachemodel("collision_wall_512x512x10");
|
||||
precachemodel("collision_geo_64x64x256");
|
||||
precachemodel("p_glo_concrete_barrier_damaged");
|
||||
|
||||
maps\mp\_load::main();
|
||||
if ( GetDvarInt( #"xblive_wagermatch" ) == 1 )
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_array_wager");
|
||||
}
|
||||
else
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_array");
|
||||
}
|
||||
|
||||
maps\mp\mp_array_amb::main();
|
||||
|
||||
// If the team nationalites change in this file,
|
||||
// you must update the team nationality in the level's csc file as well!
|
||||
maps\mp\gametypes\_teamset_winterspecops::level_init();
|
||||
|
||||
// Set up the default range of the compass
|
||||
setdvar("compassmaxrange","2100");
|
||||
|
||||
// Set up some generic War Flag Names.
|
||||
// Example from COD5: CALLSIGN_SEELOW_A is the name of the 1st flag in Selow whose string is "Cottage"
|
||||
// The string must have MPUI_CALLSIGN_ and _A. Replace Mapname with the name of your map/bsp and in the
|
||||
// actual string enter a keyword that names the location (Roundhouse, Missle Silo, Launchpad, Guard Tower, etc)
|
||||
|
||||
game["strings"]["war_callsign_a"] = &"MPUI_CALLSIGN_MAPNAME_A";
|
||||
game["strings"]["war_callsign_b"] = &"MPUI_CALLSIGN_MAPNAME_B";
|
||||
game["strings"]["war_callsign_c"] = &"MPUI_CALLSIGN_MAPNAME_C";
|
||||
game["strings"]["war_callsign_d"] = &"MPUI_CALLSIGN_MAPNAME_D";
|
||||
game["strings"]["war_callsign_e"] = &"MPUI_CALLSIGN_MAPNAME_E";
|
||||
|
||||
game["strings_menu"]["war_callsign_a"] = "@MPUI_CALLSIGN_MAPNAME_A";
|
||||
game["strings_menu"]["war_callsign_b"] = "@MPUI_CALLSIGN_MAPNAME_B";
|
||||
game["strings_menu"]["war_callsign_c"] = "@MPUI_CALLSIGN_MAPNAME_C";
|
||||
game["strings_menu"]["war_callsign_d"] = "@MPUI_CALLSIGN_MAPNAME_D";
|
||||
game["strings_menu"]["war_callsign_e"] = "@MPUI_CALLSIGN_MAPNAME_E";
|
||||
|
||||
|
||||
// collision keeping players from poking their heads into the tree near B3.
|
||||
spawncollision("collision_geo_10x10x512","collider",(1397, 1095, 346), (0, 0, 0));
|
||||
spawncollision("collision_geo_10x10x512","collider",(1387, 1095, 346), (0, 0, 0));
|
||||
|
||||
// collision to prevent players from jumping behind electrical cabinets and getting stuck
|
||||
spawncollision("collision_geo_64x64x64","collider",(-399, 1615, 614), (0, 15, 0));
|
||||
spawncollision("collision_wall_64x64x10","collider",(-445, 1593, 642), (0, 150, 0));
|
||||
|
||||
// collision that will keep player from jumping out of the map and landing in the rocks.
|
||||
spawncollision("collision_wall_512x512x10","collider",(-1682, 1046, 496), (0, 30, 0));
|
||||
|
||||
// collision to stop players from getting stuck behind the steel girders.
|
||||
spawncollision("collision_geo_64x64x64","collider",(-387, 307, 346), (0, 360, 0));
|
||||
|
||||
// spawn collision underneathe the corner of the center building. This is to keep players from calling the RCXD and pushing themselves outside of the map.
|
||||
spawncollision("collision_geo_64x64x256","collider",(-852, 852, 496), (0,15,90));
|
||||
spawncollision("collision_geo_64x64x256","collider",(-788, 652, 492), (0,15,90));
|
||||
|
||||
// spawn a trigger to keep players from planting turrets into the large tanks.
|
||||
addNoTurretTrigger( (-692, 3292, 500), 180, 800 );
|
||||
addNoTurretTrigger( (-1236, 3292, 500), 180, 800 );
|
||||
|
||||
// spawn a couple of K Rails to make sense of the collision spawned under the center building.
|
||||
kRail1 = Spawn("script_model", (-824, 672, 480) );
|
||||
if ( IsDefined(kRail1) )
|
||||
{
|
||||
kRail1.angles = (0, 105, 0);
|
||||
kRail1 SetModel("p_glo_concrete_barrier_damaged");
|
||||
}
|
||||
|
||||
kRail2 = Spawn("script_model", (-804, 600, 468) );
|
||||
if ( IsDefined(kRail2) )
|
||||
{
|
||||
kRail2.angles = (15, 285, 0);
|
||||
kRail2 SetModel("p_glo_concrete_barrier_damaged");
|
||||
}
|
||||
|
||||
// enable new spawning system
|
||||
maps\mp\gametypes\_spawning::level_use_unified_spawning(true);
|
||||
|
||||
radar_move_init();
|
||||
}
|
||||
|
||||
radar_move_init()
|
||||
{
|
||||
level endon ("game_ended");
|
||||
|
||||
dish_top = GetEnt( "dish_top", "targetname" );
|
||||
dish_base = GetEnt( "dish_base", "targetname" );
|
||||
dish_inside = GetEnt( "dish_inside", "targetname" );
|
||||
dish_gears = GetEntArray( "dish_gear", "targetname");
|
||||
|
||||
total_time_for_rotation_outside = 240;
|
||||
total_time_for_rotation_inside = 60;
|
||||
|
||||
dish_top LinkTo(dish_base);
|
||||
dish_base thread rotate_dish_top(total_time_for_rotation_outside);
|
||||
dish_inside thread rotate_dish_top(total_time_for_rotation_inside);
|
||||
|
||||
if(dish_gears.size > 0)
|
||||
{
|
||||
array_thread(dish_gears, ::rotate_dish_gears, total_time_for_rotation_inside);
|
||||
}
|
||||
}
|
||||
|
||||
rotate_dish_top( time )
|
||||
{
|
||||
self endon ("game_ended");
|
||||
|
||||
while(1)
|
||||
{
|
||||
self RotateYaw( 360, time );
|
||||
self waittill( "rotatedone" );
|
||||
}
|
||||
}
|
||||
|
||||
rotate_dish_gears( time )
|
||||
{
|
||||
self endon ("game_ended");
|
||||
|
||||
gear_ratio = 5.0 / 60.0;
|
||||
inverse_gear_ratio = 1.0 / gear_ratio;
|
||||
|
||||
while(1)
|
||||
{
|
||||
self RotateYaw( 360 * inverse_gear_ratio, time );
|
||||
self waittill( "rotatedone" );
|
||||
}
|
||||
}
|
||||
|
||||
addNoTurretTrigger( position, radius, height )
|
||||
{
|
||||
while( !IsDefined( level.noTurretPlacementTriggers ) )
|
||||
wait( 0.1 );
|
||||
|
||||
trigger = Spawn( "trigger_radius", position, 0, radius, height );
|
||||
|
||||
level.noTurretPlacementTriggers[level.noTurretPlacementTriggers.size] = trigger;
|
||||
}
|
||||
|
40
mods/mp_patch/maps/mp/mp_cairo.gsc
Normal file
40
mods/mp_patch/maps/mp/mp_cairo.gsc
Normal file
@ -0,0 +1,40 @@
|
||||
#include maps\mp\_utility;
|
||||
main()
|
||||
{
|
||||
//needs to be first for create fx
|
||||
maps\mp\mp_cairo_fx::main();
|
||||
|
||||
precachemodel("collision_geo_10x10x512");
|
||||
precachemodel("collision_wall_128x128x10");
|
||||
|
||||
maps\mp\_load::main();
|
||||
if ( GetDvarInt( #"xblive_wagermatch" ) == 1 )
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_cairo_wager");
|
||||
}
|
||||
else
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_cairo");
|
||||
}
|
||||
|
||||
maps\mp\mp_cairo_amb::main();
|
||||
|
||||
|
||||
// If the team nationalites change in this file,
|
||||
// you must update the team nationality in the level's csc file as well!
|
||||
maps\mp\gametypes\_teamset_cubans::level_init();
|
||||
|
||||
//setdvar("compassmaxrange","2100");
|
||||
|
||||
// spawn collision to prevent players from standing inside telephone poles
|
||||
spawncollision("collision_geo_10x10x512","collider",(2264, -240, -61), (0, 0, 0));
|
||||
spawncollision("collision_geo_10x10x512","collider",(-1437, -529, -61), (0, 0, 0));
|
||||
|
||||
// spawn collision to prevent players from standing on top of a doorway behind the cigar building
|
||||
spawncollision("collision_wall_128x128x10","collider",(716, 1181, 219), (0, 270, 0));
|
||||
|
||||
|
||||
|
||||
// enable new spawning system
|
||||
maps\mp\gametypes\_spawning::level_use_unified_spawning(true);
|
||||
}
|
716
mods/mp_patch/maps/mp/mp_cosmodrome.gsc
Normal file
716
mods/mp_patch/maps/mp/mp_cosmodrome.gsc
Normal file
@ -0,0 +1,716 @@
|
||||
#include maps\mp\_utility;
|
||||
#include common_scripts\utility;
|
||||
#include maps\mp\_events;
|
||||
|
||||
main()
|
||||
{
|
||||
precachemodel("tag_origin");
|
||||
|
||||
level.onSpawnIntermission = ::cosmodrome_intermission;
|
||||
|
||||
/#
|
||||
level thread devgui_cosmodrome();
|
||||
execdevgui( "devgui_mp_cosmodrome" );
|
||||
#/
|
||||
|
||||
//needs to be first for create fx
|
||||
maps\mp\mp_cosmodrome_fx::main();
|
||||
|
||||
precachemodel("collision_wall_128x128x10");
|
||||
precachemodel("collision_geo_128x128x128");
|
||||
precachemodel("collision_wall_512x512x10");
|
||||
precachemodel("collision_geo_mc_8x560x190");
|
||||
precachemodel("collision_geo_mc_4x52x190");
|
||||
precachemodel("collision_geo_mc_4x156x190");
|
||||
|
||||
maps\mp\_load::main();
|
||||
if ( GetDvarInt( #"xblive_wagermatch" ) == 1 )
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_cosmodrome_wager");
|
||||
}
|
||||
else
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_cosmodrome");
|
||||
}
|
||||
maps\mp\mp_cosmodrome_amb::main();
|
||||
|
||||
// If the team nationalites change in this file,
|
||||
// you must update the team nationality in the level's csc file as well!
|
||||
maps\mp\gametypes\_teamset_urbanspecops::level_init();
|
||||
|
||||
level thread rocket_arm_think();
|
||||
level thread rocket_think();
|
||||
level thread radar_dish_think();
|
||||
level thread distant_rockets_think();
|
||||
|
||||
// spawn collision to prevent players from sneaking under a small area by the rocket
|
||||
spawncollision("collision_wall_128x128x10","collider",(1558, -179, -362), (0, 225, 0));
|
||||
|
||||
// spawn collision to prevent players from sneaking inside 2 vents
|
||||
spawncollision("collision_wall_128x128x10","collider",(-699, 1457, -60), (0, 270, 0));
|
||||
spawncollision("collision_wall_128x128x10","collider",(-699, 1329, -60), (0, 270, 0));
|
||||
|
||||
// spawn collision to prevent players from strafe jumping onto pipes.
|
||||
spawncollision("collision_geo_128x128x128","collider",(1408.5, 863, -126.5), (0, 0, 0));
|
||||
spawncollision("collision_geo_128x128x128","collider",(1536.5, 863, -126.5), (0, 0, 0));
|
||||
|
||||
// spawn collision to prevent players from jumping up onto walls by the rocket
|
||||
spawncollision("collision_wall_512x512x10","collider",(1224, -160, 240), (0, 0, 0));
|
||||
spawncollision("collision_wall_512x512x10","collider",(1348, -160, 240), (0, 0, 0));
|
||||
|
||||
// Spawn collision to keep players from walking onto a small ledge of collision on the green girders.
|
||||
spawncollision("collision_wall_128x128x10","collider",(1911, 1018, -82), (0, 270, 0));
|
||||
|
||||
// not sure if this is the best way to determine that the map has been trimmed down
|
||||
if ( isSmallMapVersion() )
|
||||
{
|
||||
//spawning missile clip collision to catch grenades, rockets and crossbow bolts on the wager match boundary
|
||||
spawncollision("collision_geo_mc_8x560x190","collider",(-393, 396.5, -72), (0, 270, 0));
|
||||
spawncollision("collision_geo_mc_4x52x190","collider",(-358, 676.5, -74), (0, 0, 0));
|
||||
spawncollision("collision_geo_mc_4x156x190","collider",(-328.5, 758, -74), (0, 270, 0));
|
||||
}
|
||||
|
||||
// enable new spawning system
|
||||
maps\mp\gametypes\_spawning::level_use_unified_spawning(true);
|
||||
|
||||
SetDvar( "scr_spawn_enemy_influencer_radius", 1700 );
|
||||
SetDvar( "scr_spawn_dead_friend_influencer_radius", 1300 );
|
||||
SetDvar( "scr_spawn_dead_friend_influencer_timeout_seconds", 10 );
|
||||
SetDvar( "scr_spawn_dead_friend_influencer_count", 7 );
|
||||
}
|
||||
|
||||
isSmallMapVersion()
|
||||
{
|
||||
if ( GetDvarInt( #"xblive_wagermatch" ) == 1 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
gametype = getDvar( #"g_gametype" );
|
||||
if ( gametype == "oic" )
|
||||
return true;
|
||||
|
||||
if ( gametype == "hlnd" )
|
||||
return true;
|
||||
|
||||
if ( gametype == "shrp" )
|
||||
return true;
|
||||
|
||||
if ( gametype == "gun" )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
cosmodrome_intermission()
|
||||
{
|
||||
maps\mp\gametypes\_globallogic_defaults::default_onSpawnIntermission();
|
||||
|
||||
rocket_base = GetEnt( "cosmodrome_rocket_base", "script_noteworthy" );
|
||||
|
||||
if ( !IsDefined( rocket_base ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( IsDefined( level.rocket_camera ) && level.rocket_camera == true )
|
||||
{
|
||||
lookat = Spawn( "script_model", rocket_base.origin + ( 0, 0, 1024 ) );
|
||||
lookat SetModel( "tag_origin" );
|
||||
lookat LinkTo( rocket_base );
|
||||
|
||||
self CameraSetPosition( self.origin );
|
||||
self CameraSetLookAt( lookat );
|
||||
self CameraActivate( true );
|
||||
}
|
||||
}
|
||||
|
||||
rocket_arm_think()
|
||||
{
|
||||
start_pitch = set_dvar_int_if_unset( "scr_rocket_arm_pitch", "90" );
|
||||
rotate_time = set_dvar_int_if_unset( "scr_rocket_arm_rotate_secs", "30" );
|
||||
wait_time = set_dvar_int_if_unset( "scr_rocket_arm_wait_secs", "5" );
|
||||
|
||||
arm_base = GetEnt( "cosmodrome_rocket_arm_base", "targetname" );
|
||||
AssertEx( IsDefined( arm_base ), "Unable to find entity with targetname: 'cosmodrome_rocket_arm_base'" );
|
||||
|
||||
arm = GetEntArray( "cosmodrome_rocket_arm", "targetname" );
|
||||
AssertEx( IsDefined( arm ), "Unable to find entity with targetname: 'cosmodrome_rocket_arm'" );
|
||||
|
||||
for ( i = 0; i < arm.size; i++ )
|
||||
{
|
||||
arm[i] LinkTo( arm_base );
|
||||
}
|
||||
|
||||
if ( !IsDefined( arm_base.angles_target ) )
|
||||
{
|
||||
arm_base.angles_target = arm_base.angles;
|
||||
}
|
||||
|
||||
arm_base.angles = ( start_pitch, arm_base.angles[1], arm_base.angles[2] );
|
||||
//IPrintLnBold ("rocket is MOVING?");
|
||||
|
||||
wait ( wait_time );
|
||||
|
||||
//IPrintLnBold ("start arm sound");
|
||||
arm_base playloopsound("evt_rocket_lp",.2);
|
||||
arm_base PlaySound ("evt_rocket_start");
|
||||
arm_base RotateTo( arm_base.angles_target, rotate_time );
|
||||
|
||||
|
||||
wait(rotate_time);
|
||||
arm_base stoploopsound(.3);
|
||||
arm_base PlaySound ("evt_rocket_end");
|
||||
// IPrintLnBold (rotate_time);
|
||||
// stop loppsound with fade
|
||||
// play oneshot attach
|
||||
// stop loop sound
|
||||
}
|
||||
|
||||
rocket_prelaunch( rocket_base )
|
||||
{
|
||||
//this will play vo for countdown and delay the launch by 10 seconds
|
||||
snd_countdown ();
|
||||
|
||||
// move the claw arms away from the rocket
|
||||
claw_r = GetEntArray("claw_r", "targetname");
|
||||
claw_l = GetEntArray("claw_l", "targetname");
|
||||
claw_arm_r = GetEntArray("claw_arm_r", "targetname");
|
||||
claw_arm_l = GetEntArray("claw_arm_l", "targetname");
|
||||
mover_r = GetEnt("claw_r_mover", "targetname");
|
||||
mover_l = GetEnt("claw_l_mover", "targetname");
|
||||
move_here_r = GetEnt("claw_r_move_here", "targetname");
|
||||
move_here_l = GetEnt("claw_l_move_here", "targetname");
|
||||
|
||||
for(i = 0 ; i < claw_r.size; i++)
|
||||
{
|
||||
claw_r[i] LinkTo(mover_r);
|
||||
}
|
||||
for(i = 0 ; i < claw_l.size; i++)
|
||||
{
|
||||
claw_l[i] LinkTo(mover_l);
|
||||
}
|
||||
mover_r MoveTo(move_here_r.origin, 3.0);
|
||||
mover_l MoveTo(move_here_l.origin, 3.0);
|
||||
|
||||
// play sound on the arms
|
||||
thread snd_rocket_gantry ( mover_r, mover_l);
|
||||
|
||||
wait(4.0);
|
||||
for(i = 0; i < claw_r.size; i++)
|
||||
{
|
||||
claw_r[i] Unlink();
|
||||
claw_r[i] LinkTo(move_here_r);
|
||||
}
|
||||
for(i = 0; i < claw_l.size; i++)
|
||||
{
|
||||
claw_l[i] Unlink();
|
||||
claw_l[i] LinkTo(move_here_l);
|
||||
}
|
||||
|
||||
for(i = 0; i < claw_arm_r.size; i++)
|
||||
{
|
||||
claw_arm_r[i] LinkTo(move_here_r);
|
||||
}
|
||||
for(i = 0; i < claw_arm_l.size; i++)
|
||||
{
|
||||
claw_arm_l[i] LinkTo(move_here_l);
|
||||
}
|
||||
move_here_r RotateYaw(75, 3.0);
|
||||
move_here_l RotateYaw(-75, 3.0);
|
||||
|
||||
// wait to launch
|
||||
rocket_base playsound ("evt_cosmo_launch");
|
||||
playsoundatposition("evt_cosmo_air_distf",(0,0,0));
|
||||
playsoundatposition("evt_cosmo_air_distr",(0,0,0));
|
||||
|
||||
wait(5);
|
||||
}
|
||||
|
||||
Rocket_Think()
|
||||
{
|
||||
level.const_fx_exploder_rocket_coolant = 2;
|
||||
|
||||
level.rocket_camera = false;
|
||||
flag_init( "rocket_launch_grenade_detonate" );
|
||||
|
||||
rocket = GetEntArray( "cosmodrome_rocket", "targetname" );
|
||||
AssertEx( IsDefined( rocket ), "Unable to find entity with targetname: 'cosmodrome_rocket'" );
|
||||
array_thread( rocket, ::rocket_sticky_grenade_think );
|
||||
|
||||
rocket_base = GetEnt( "cosmodrome_rocket_base", "script_noteworthy" );
|
||||
AssertEx( IsDefined( rocket_base ), "Unable to find entity with script_noteworthy: 'cosmodrome_rocket_base'" );
|
||||
level.rocket_base = rocket_base;
|
||||
|
||||
rocket_damage_triggers = GetEntArray( "cosmodrome_rocket_damage_trigger", "targetname" );
|
||||
rocket_collision = GetEntArray( "rocket_collision", "targetname" );
|
||||
|
||||
killCamEnt = spawn( "script_model", rocket_base.origin );
|
||||
rocket_base.killCamEnt = killCamEnt;
|
||||
killCamEnt.startTime = gettime();
|
||||
killCamEnt linkTo( rocket_base, "tag_origin", (50,0,-1000), ( 0,0,0 ) );
|
||||
|
||||
|
||||
rocket_timer_init();
|
||||
|
||||
wait( 3 );
|
||||
exploder( level.const_fx_exploder_rocket_coolant );
|
||||
|
||||
event = level waittill_any_return( "rocket_launch", "rocket_launch_skip_prelaunch" );
|
||||
|
||||
if ( event == "rocket_launch" )
|
||||
{
|
||||
rocket_prelaunch( rocket_base );
|
||||
}
|
||||
|
||||
level.rocket_camera = true;
|
||||
|
||||
// pre-launch fx
|
||||
earthquake_origin = rocket_base GetTagOrigin( "tag_engine" );
|
||||
earthquake( .25, 4, earthquake_origin, 4096 );
|
||||
|
||||
//play 3d launch aounds on rocket_base, and 2 st 2d sounds
|
||||
|
||||
|
||||
wait( 3.5 );
|
||||
flag_set( "rocket_launch_grenade_detonate" );
|
||||
|
||||
// launch fx
|
||||
earthquake( .35, 15, earthquake_origin, 4096 );
|
||||
array_thread( rocket_damage_triggers, ::rocket_damage_think );
|
||||
array_thread( rocket_damage_triggers, ::destroy_greandes_in_trigger );
|
||||
rocket_base SetClientFlag( level.const_flag_rocket_fx );
|
||||
exploder_stop( level.const_fx_exploder_rocket_coolant );
|
||||
|
||||
// move pieces
|
||||
array_thread( rocket, ::rocket_move );
|
||||
|
||||
// stop damage
|
||||
wait( 6 );
|
||||
level notify( "rocket_damage_stop" );
|
||||
|
||||
wait( 2 );
|
||||
level.rocket_camera = false;
|
||||
|
||||
for ( i = 0; i < rocket_damage_triggers.size; i++ )
|
||||
{
|
||||
rocket_damage_triggers[i] delete();
|
||||
}
|
||||
|
||||
for ( i = 0; i < rocket_collision.size; i++ )
|
||||
{
|
||||
rocket_collision[i] delete();
|
||||
}
|
||||
}
|
||||
|
||||
snd_rocket_gantry ( orignr, originl)
|
||||
{
|
||||
orignr playsound ("evt_gantry_disengage");
|
||||
orignr playsound ("evt_rocket_start");
|
||||
// originl playsound ("evt_rocket_start");
|
||||
}
|
||||
snd_countdown()
|
||||
{
|
||||
//wait 2;
|
||||
countdownl = spawn("script_origin", (480, -1256, 224));
|
||||
countdownr = spawn("script_origin", (152, 1488, 224));
|
||||
|
||||
clientnotify ( "snd_rocket_launch" );
|
||||
|
||||
|
||||
if( IsDefined(countdownl)&& IsDefined(countdownr) )
|
||||
{
|
||||
countdownl playsound( "vox_mp_com_1a_rua1" );
|
||||
wait .112;
|
||||
countdownr playsound( "vox_mp_com_1a_rua1" );
|
||||
wait 16.5;
|
||||
|
||||
thread snd_launch ();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
snd_launch ()
|
||||
{
|
||||
countdownl = spawn("script_origin", (480, -1256, 224));
|
||||
countdownr = spawn("script_origin", (152, 1488, 224));
|
||||
wait 2;
|
||||
countdownl playsound( "vox_mp_com_2a_rua1" );
|
||||
wait .112;
|
||||
countdownr playsound( "vox_mp_com_2a_rua1" );
|
||||
|
||||
}
|
||||
rocket_sticky_grenade_think()
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill( "grenade_stuck", grenade_ent );
|
||||
grenade_ent thread sticky_grenade_think();
|
||||
}
|
||||
}
|
||||
|
||||
sticky_grenade_think()
|
||||
{
|
||||
self endon( "death" );
|
||||
level endon( "rocket_damage_stop" );
|
||||
|
||||
flag_wait( "rocket_launch_grenade_detonate" );
|
||||
wait( 0.05 );
|
||||
|
||||
self Detonate();
|
||||
}
|
||||
|
||||
//Self is the trigger. This loops to make sure any grenade or claymore that's touching the damage trigger explodes.
|
||||
destroy_greandes_in_trigger()
|
||||
{
|
||||
self endon( "death" );
|
||||
level endon( "rocket_damage_stop" );
|
||||
|
||||
flag_wait( "rocket_launch_grenade_detonate" );
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
grenades = GetEntArray( "grenade", "classname" );
|
||||
|
||||
for ( i = 0; i < grenades.size; i++ )
|
||||
{
|
||||
if( grenades[i] IsTouching( self ))
|
||||
{
|
||||
grenades[i] Detonate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
wait 1;
|
||||
}
|
||||
}
|
||||
|
||||
rocket_timer_init()
|
||||
{
|
||||
level waittill( "prematch_over" );
|
||||
|
||||
event = set_dvar_if_unset( "scr_rocket_event", "end" );
|
||||
trigger1 = set_dvar_int_if_unset( "scr_rocket_event_trigger1", "0" );
|
||||
trigger2 = set_dvar_int_if_unset( "scr_rocket_event_trigger2", "0" );
|
||||
|
||||
if ( rocket_launch_abort() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch ( event )
|
||||
{
|
||||
case "end":
|
||||
add_timed_event( 0, "rocket_launch" );
|
||||
add_score_event( level.scorelimit, "rocket_launch" );
|
||||
// AE 11-2-09: putting in the distant rocket timing
|
||||
add_score_event( int(level.scorelimit * 0.5), "distant_rocket_launch" );
|
||||
break;
|
||||
|
||||
case "time":
|
||||
assert( trigger1 >= 0 );
|
||||
add_timed_event( trigger1, "rocket_launch" );
|
||||
// AE 11-2-09: putting in the distant rocket timing
|
||||
add_timed_event( int(trigger1 * 0.5), "distant_rocket_launch" );
|
||||
break;
|
||||
|
||||
case "percent":
|
||||
assert( trigger1 >= 0 );
|
||||
assert( trigger1 <= 100 );
|
||||
|
||||
minutes = ( trigger1 * 0.01 ) * level.timelimit;
|
||||
add_timed_event( minutes * 60, "rocket_launch" );
|
||||
// AE 11-2-09: putting in the distant rocket timing
|
||||
add_timed_event( int(minutes * 60 * 0.5), "distant_rocket_launch" );
|
||||
|
||||
score = ( trigger1 * 0.01 ) * level.scorelimit;
|
||||
add_score_event( score, "rocket_launch" );
|
||||
// AE 11-2-09: putting in the distant rocket timing
|
||||
add_score_event( int(score * 0.5), "distant_rocket_launch" );
|
||||
break;
|
||||
|
||||
case "random_time":
|
||||
assert( trigger1 >= 0 );
|
||||
assert( trigger2 >= 0 );
|
||||
assert( trigger1 < trigger2 );
|
||||
|
||||
time = RandomIntRange( trigger1, trigger2 + 1 );
|
||||
add_timed_event( trigger1, "rocket_launch" );
|
||||
// AE 11-2-09: putting in the distant rocket timing
|
||||
add_timed_event( int(trigger1 * 0.5), "distant_rocket_launch" );
|
||||
break;
|
||||
|
||||
case "random_percent":
|
||||
assert( trigger1 >= 0 );
|
||||
assert( trigger1 <= 100 );
|
||||
assert( trigger2 >= 0 );
|
||||
assert( trigger2 <= 100 );
|
||||
assert( trigger1 < trigger2 );
|
||||
|
||||
percent = RandomIntRange( trigger1, trigger2 + 1 );
|
||||
minutes = ( percent * 0.01 ) * level.timelimit;
|
||||
add_timed_event( minutes * 60, "rocket_launch" );
|
||||
// AE 11-2-09: putting in the distant rocket timing
|
||||
add_timed_event( int(minutes * 60 * 0.5), "distant_rocket_launch" );
|
||||
|
||||
percent = RandomIntRange( trigger1, trigger2 + 1 );
|
||||
score = ( percent * 0.01 ) * level.scorelimit;
|
||||
add_score_event( score, "rocket_launch" );
|
||||
// AE 11-2-09: putting in the distant rocket timing
|
||||
add_score_event( int(score * 0.5), "distant_rocket_launch" );
|
||||
break;
|
||||
|
||||
default:
|
||||
error( "Unknown event type: '" + event + "' used in dvar 'scr_rocket_event'" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
rocket_launch_abort()
|
||||
{
|
||||
launch_abort = set_dvar_int_if_unset( "scr_rocket_event_off", "0" );
|
||||
assert( launch_abort >= 0 );
|
||||
assert( launch_abort <= 100 );
|
||||
|
||||
if ( RandomInt( 101 ) < launch_abort )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
rocket_move()
|
||||
{
|
||||
self MoveTo( self.origin + ( 0, 0, 50000 ), 50, 45 );
|
||||
|
||||
self waittill( "movedone" );
|
||||
self delete();
|
||||
}
|
||||
|
||||
rocket_damage_think()
|
||||
{
|
||||
level endon( "rocket_damage_stop" );
|
||||
damage_interval_secs = 1;
|
||||
|
||||
assert( self.classname == "trigger_radius" );
|
||||
|
||||
/#
|
||||
if ( set_dvar_int_if_unset( "scr_rocket_debug", "0" ) != 0 )
|
||||
{
|
||||
drawcylinder( self.origin, self.radius, self.height, undefined, "rocket_damage_stop" );
|
||||
}
|
||||
#/
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
self waittill( "trigger", ent );
|
||||
|
||||
if(IsPlayer(ent))
|
||||
{
|
||||
player = ent;
|
||||
|
||||
if ( player.sessionstate != "playing" )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !IsDefined( player.rocket_damage_time ) )
|
||||
{
|
||||
player.rocket_damage_time = GetTime();
|
||||
}
|
||||
|
||||
if ( player.rocket_damage_time > GetTime() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
player shellshock( "tabun_gas_mp", damage_interval_secs );
|
||||
player.rocket_damage_time = GetTime() + ( damage_interval_secs * 1000 );
|
||||
player DoDamage( RandomIntRange( 40, 60 ), self.origin, self, level.rocket_base, 0, "MOD_SUICIDE" );
|
||||
}
|
||||
//This kill dogs in the radius trigger
|
||||
else if ( IsAI( ent ))
|
||||
{
|
||||
ent DoDamage( ent.health * 2, ent.origin);
|
||||
}
|
||||
//This kills RC bombs in the radius trigger
|
||||
else if(IsDefined( ent.targetname ) && ent.targetname == "rcbomb" )
|
||||
{
|
||||
//Destroy RC bomb
|
||||
ent maps\mp\_rcbomb::rcbomb_force_explode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
radar_dish_think()
|
||||
{
|
||||
radar_dish = GetEnt( "cosmodrome_radar_dish", "targetname" );
|
||||
AssertEx( IsDefined( radar_dish ), "Unable to find entity with targetname: 'cosmodrome_radar_dish'" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
rotate_time = set_dvar_int_if_unset( "scr_radar_dish_rotate_secs", "30" );
|
||||
|
||||
if ( rotate_time <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
radar_dish RotateYaw( 360, rotate_time );
|
||||
radar_dish waittill( "rotatedone" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
devgui_cosmodrome( cmd )
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
wait( 0.5 );
|
||||
|
||||
devgui_string = GetDvar( #"devgui_notify" );
|
||||
|
||||
switch( devgui_string )
|
||||
{
|
||||
case "":
|
||||
break;
|
||||
|
||||
case "rocket_arm":
|
||||
SetDvar( "scr_rocket_arm_wait_secs", "0" );
|
||||
level thread rocket_arm_think();
|
||||
break;
|
||||
|
||||
default:
|
||||
level notify( devgui_string );
|
||||
break;
|
||||
}
|
||||
|
||||
SetDvar( "devgui_notify", "" );
|
||||
}
|
||||
}
|
||||
|
||||
distant_rockets_think()
|
||||
{
|
||||
// have the rockets in the distance going off
|
||||
|
||||
distant_rocket = GetEntArray( "distant_rocket", "targetname" );
|
||||
AssertEx( IsDefined( distant_rocket ), "Unable to find entity with targetname: 'distant_rocket'" );
|
||||
|
||||
distant_rocket_gantry1 = GetEntArray("distant_rocket_gantry1", "targetname");
|
||||
AssertEx( IsDefined( distant_rocket_gantry1 ), "Unable to find entity with targetname: 'distant_rocket_gantry1'" );
|
||||
distant_rocket_gantry2 = GetEntArray("distant_rocket_gantry2", "targetname");
|
||||
AssertEx( IsDefined( distant_rocket_gantry2 ), "Unable to find entity with targetname: 'distant_rocket_gantry2'" );
|
||||
|
||||
distant_rocket_arm1 = GetEntArray( "distant_rocket_arm1", "targetname" );
|
||||
AssertEx( IsDefined( distant_rocket_arm1 ), "Unable to find entity with targetname: 'distant_rocket_arm1'" );
|
||||
distant_rocket_arm2 = GetEntArray( "distant_rocket_arm2", "targetname" );
|
||||
AssertEx( IsDefined( distant_rocket_arm2 ), "Unable to find entity with targetname: 'distant_rocket_arm2'" );
|
||||
distant_rocket_arm3 = GetEntArray( "distant_rocket_arm3", "targetname" );
|
||||
AssertEx( IsDefined( distant_rocket_arm3 ), "Unable to find entity with targetname: 'distant_rocket_arm3'" );
|
||||
distant_rocket_arm4 = GetEntArray( "distant_rocket_arm4", "targetname" );
|
||||
AssertEx( IsDefined( distant_rocket_arm4 ), "Unable to find entity with targetname: 'distant_rocket_arm4'" );
|
||||
|
||||
distant_rocket_engine = GetEnt( "distant_rocket_engine", "script_noteworthy" );
|
||||
AssertEx( IsDefined( distant_rocket_engine ), "Unable to find entity with script_noteworthy: 'distant_rocket_engine'" );
|
||||
distant_rocket_engine SetModel("tag_origin");
|
||||
distant_rocket_engine.angles = (-90, 0, 0);
|
||||
|
||||
wait( 3 );
|
||||
|
||||
level waittill( "distant_rocket_launch" );
|
||||
|
||||
// splay sound on the gantry
|
||||
thread snd_distant_gantry (distant_rocket_engine, distant_rocket_engine);
|
||||
// play sound for arms
|
||||
thread snd_distant_rocket_arm (distant_rocket_engine);
|
||||
|
||||
// move the gantry away from the rocket
|
||||
array_thread( distant_rocket_gantry1, ::distant_rocket_gantry1_move );
|
||||
array_thread( distant_rocket_gantry2, ::distant_rocket_gantry2_move );
|
||||
|
||||
wait(10);
|
||||
|
||||
// move the arms away from the rocket
|
||||
array_thread( distant_rocket_arm1, ::distant_rocket_arm1_move );
|
||||
array_thread( distant_rocket_arm2, ::distant_rocket_arm2_move );
|
||||
array_thread( distant_rocket_arm3, ::distant_rocket_arm3_move );
|
||||
array_thread( distant_rocket_arm4, ::distant_rocket_arm4_move );
|
||||
|
||||
|
||||
|
||||
// wait to launch
|
||||
wait(8);
|
||||
|
||||
// pre-launch fx
|
||||
// TODO: small earthquakes??
|
||||
//earthquake_origin = rocket_base GetTagOrigin( "tag_engine" );
|
||||
//earthquake( .25, 4, earthquake_origin, 4096 );
|
||||
|
||||
// play 3d launch aounds on distant_rocket_engine, and 2 st 2d sounds
|
||||
distant_rocket_engine playsound ("evt_dist_cosmo_launch");
|
||||
//playsoundatposition("evt_dist_cosmo_air_distf",(0,0,0));
|
||||
distant_rocket_engine playsound ("evt_dist_cosmo_air_distf");
|
||||
wait( 3.5 );
|
||||
|
||||
// launch fx
|
||||
//earthquake( .35, 15, earthquake_origin, 4096 );
|
||||
|
||||
playfxontag( level._effect["rocket_blast_trail"], distant_rocket_engine, "tag_origin" );
|
||||
|
||||
// move pieces
|
||||
array_thread( distant_rocket, ::rocket_move );
|
||||
|
||||
}
|
||||
|
||||
distant_rocket_gantry1_move() // self == distant_rocket_gantry
|
||||
{
|
||||
self RotatePitch(-45, 10.0);
|
||||
self waittill("rotatedone");
|
||||
}
|
||||
distant_rocket_gantry2_move() // self == distant_rocket_gantry
|
||||
{
|
||||
self RotatePitch(45, 10.0);
|
||||
self waittill("rotatedone");
|
||||
}
|
||||
|
||||
distant_rocket_arm1_move() // self == distant_rocket_arm
|
||||
{
|
||||
self RotatePitch(-45, 6.0);
|
||||
self waittill("rotatedone");
|
||||
}
|
||||
distant_rocket_arm2_move() // self == distant_rocket_arm
|
||||
{
|
||||
self RotateRoll(-45, 6.0);
|
||||
self waittill("rotatedone");
|
||||
}
|
||||
distant_rocket_arm3_move() // self == distant_rocket_arm
|
||||
{
|
||||
self RotatePitch(45, 6.0);
|
||||
self waittill("rotatedone");
|
||||
}
|
||||
distant_rocket_arm4_move() // self == distant_rocket_arm
|
||||
{
|
||||
self RotateRoll(45, 6.0);
|
||||
self waittill("rotatedone");
|
||||
}
|
||||
snd_distant_rocket_arm ( distant_rocket_engine )
|
||||
{
|
||||
|
||||
//IPrintLnBold ("this is in the distant rocket arm section - snd_distant_rocket_arm");
|
||||
distant_rocket_engine playloopsound ("evt_dist_rocket_lp", .5);
|
||||
distant_rocket_engine PlaySound ("evt_dist_rocket_start");
|
||||
//self waittill("rotatedone");
|
||||
wait (16);
|
||||
distant_rocket_engine stoploopsound(.3);
|
||||
distant_rocket_engine PlaySound ("evt_dist_rocket_end");
|
||||
|
||||
}
|
||||
snd_distant_gantry ( orignr, originl)
|
||||
{
|
||||
//IPrintLnBold ("this is playing dist rocket start");
|
||||
orignr playsound ("evt_dist_gantry_disengage");
|
||||
orignr playsound ("evt_dist_rocket_start");
|
||||
}
|
35
mods/mp_patch/maps/mp/mp_crisis.gsc
Normal file
35
mods/mp_patch/maps/mp/mp_crisis.gsc
Normal file
@ -0,0 +1,35 @@
|
||||
#include maps\mp\_utility;
|
||||
main()
|
||||
{
|
||||
//needs to be first for create fx
|
||||
maps\mp\mp_crisis_fx::main();
|
||||
|
||||
precachemodel("collision_geo_128x128x10");
|
||||
|
||||
maps\mp\_load::main();
|
||||
|
||||
if ( GetDvarInt( #"xblive_wagermatch" ) == 1 )
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_crisis_wager");
|
||||
}
|
||||
else
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_crisis");
|
||||
}
|
||||
|
||||
//maps\mp\mp_crisis_amb::main();
|
||||
|
||||
|
||||
// If the team nationalites change in this file,
|
||||
// you must update the team nationality in the level's csc file as well!
|
||||
maps\mp\gametypes\_teamset_cubans::level_init();
|
||||
|
||||
//setdvar("compassmaxrange","2100");
|
||||
|
||||
|
||||
// spawn collision to prevent players from seeing through the LVT
|
||||
spawncollision("collision_geo_128x128x10","collider",(2891, 1282.5, 72.5), (3.6, 36.48, -1.65));
|
||||
|
||||
// enable new spawning system
|
||||
maps\mp\gametypes\_spawning::level_use_unified_spawning(true);
|
||||
}
|
178
mods/mp_patch/maps/mp/mp_duga.gsc
Normal file
178
mods/mp_patch/maps/mp/mp_duga.gsc
Normal file
@ -0,0 +1,178 @@
|
||||
#include maps\mp\_utility;
|
||||
#include common_scripts\utility;
|
||||
#include maps\mp\_events;
|
||||
|
||||
main()
|
||||
{
|
||||
///#
|
||||
//execdevgui( "devgui_mp_duga" );
|
||||
//#/
|
||||
|
||||
//needs to be first for create fx
|
||||
maps\mp\mp_duga_fx::main();
|
||||
|
||||
maps\mp\_load::main();
|
||||
|
||||
maps\mp\mp_duga_amb::main();
|
||||
|
||||
// If the team nationalites change in this file,
|
||||
// you must update the team nationality in the level's csc file as well!
|
||||
maps\mp\gametypes\_teamset_winterspecops::level_init();
|
||||
|
||||
precachemodel("collision_geo_mc_8x560x190");
|
||||
precachemodel("collision_geo_mc_4x52x190");
|
||||
|
||||
// enable new spawning system
|
||||
maps\mp\gametypes\_spawning::level_use_unified_spawning(true);
|
||||
|
||||
if ( GetDvarInt( #"xblive_wagermatch" ) == 1 )
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_duga_wager");
|
||||
}
|
||||
else
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_duga");
|
||||
}
|
||||
|
||||
//Increase sample size so as to resolve lighting issue
|
||||
SetDvar("sm_sunSampleSizeNear", ".5" );
|
||||
|
||||
//Sets it up so my events go off at times based on the game time and score limit
|
||||
//level thread transformer_timer_init();
|
||||
///#
|
||||
//level thread devgui_duga();
|
||||
//#/
|
||||
|
||||
glasses = GetStructArray( "glass_shatter_on_spawn", "targetname" );
|
||||
|
||||
for ( i = 0; i < glasses.size; i++ )
|
||||
{
|
||||
RadiusDamage( glasses[i].origin, 64, 101, 100 );
|
||||
}
|
||||
|
||||
// weapon collision to keep grenades from falling out of the map through a gap between the terrain and the wall.
|
||||
spawncollision("collision_geo_mc_8x560x190","collider",(462, -3840, -165), (0, 0, 0));
|
||||
spawncollision("collision_geo_mc_4x52x190","collider",(184, -3870, -164), (0, 270, 0));
|
||||
spawncollision("collision_geo_mc_4x52x190","collider",(184, -3922, -164), (0, 270, 0));
|
||||
spawncollision("collision_geo_mc_4x52x190","collider",(188, -3922, -169), (0, 270, 0));
|
||||
}
|
||||
|
||||
//Sets it up so events can happen based on match time and score changes
|
||||
transformer_timer_init()
|
||||
{
|
||||
first_transformer_structs = getstructarray("transformer_struct","targetname");
|
||||
|
||||
level._transformer_array = [];
|
||||
|
||||
for( i=0; i < first_transformer_structs.size; i++)
|
||||
{
|
||||
current_struct = first_transformer_structs[i];
|
||||
level._transformer_array = add_to_array(level._transformer_array, current_struct);
|
||||
|
||||
while(IsDefined(current_struct.target))
|
||||
{
|
||||
current_struct = getstruct(current_struct.target, "targetname");
|
||||
level._transformer_array = add_to_array(level._transformer_array, current_struct);
|
||||
}
|
||||
}
|
||||
|
||||
level waittill( "prematch_over" );
|
||||
|
||||
|
||||
if( (IsDefined(level.timelimit)) && (level.timelimit > 0))
|
||||
{
|
||||
//Electric transformers explode in pairs. The number of pairs is critical to determine how many 'events' we need.
|
||||
transformer_pairs = level._transformer_array.size / 2;
|
||||
total_seconds = level.timelimit * 60;
|
||||
//We want to space out the transformer pair explosion evenly thourought the match
|
||||
interval = total_seconds / transformer_pairs;
|
||||
|
||||
//This creates events based on how many we need. The event sends a notify to duga.csc to set off explosions.
|
||||
for( i = total_seconds; i >= interval; i -= interval )
|
||||
{
|
||||
println( "Seconds: " + i );
|
||||
add_timed_event( int( i ), undefined, "go" );
|
||||
}
|
||||
|
||||
//This event sets off with a tenth of a second left in the game. The duga.csc waits for the notify.
|
||||
add_timed_event( .1, undefined, "fin" );
|
||||
}
|
||||
//add_score_event( Int(level.scorelimit * .99), undefined, "final_boom" );
|
||||
//add_score_event( Int(level.scorelimit * 0.1),undefined, "next_boom" );
|
||||
//add_score_event( Int(level.scorelimit * 0.2),undefined, "next_boom" );
|
||||
}
|
||||
|
||||
devgui_duga( cmd )
|
||||
{
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
wait( 0.5 );
|
||||
|
||||
devgui_string = GetDvar( #"devgui_notify" );
|
||||
|
||||
switch( devgui_string )
|
||||
{
|
||||
case "":
|
||||
break;
|
||||
|
||||
case "transformer_explode1":
|
||||
level ClientNotify ("transformer_explode");
|
||||
break;
|
||||
|
||||
case "transformer_explode2":
|
||||
level ClientNotify ("transformer_explode");
|
||||
break;
|
||||
|
||||
case "transformer_explode3":
|
||||
level ClientNotify ("transformer_explode");
|
||||
break;
|
||||
|
||||
case "transformer_explode4":
|
||||
level ClientNotify ("transformer_explode");
|
||||
break;
|
||||
|
||||
case "transformer_explode5":
|
||||
level ClientNotify ("transformer_explode");
|
||||
break;
|
||||
|
||||
case "transformer_explode6":
|
||||
level ClientNotify ("transformer_explode");
|
||||
break;
|
||||
|
||||
case "transformer_explode7":
|
||||
level ClientNotify ("transformer_explode");
|
||||
break;
|
||||
|
||||
case "transformer_explode8":
|
||||
level ClientNotify ("transformer_explode");
|
||||
break;
|
||||
|
||||
case "transformer_explode9":
|
||||
level ClientNotify ("transformer_explode");
|
||||
break;
|
||||
|
||||
case "transformer_explode10":
|
||||
level ClientNotify ("transformer_explode");
|
||||
break;
|
||||
|
||||
case "transformer_explode11":
|
||||
level ClientNotify ("transformer_explode");
|
||||
break;
|
||||
|
||||
case "transformer_explode12":
|
||||
level ClientNotify ("transformer_explode");
|
||||
break;
|
||||
|
||||
//case "final_explode":
|
||||
//transformer_array[5] notify ("final_explode");
|
||||
//break;
|
||||
|
||||
default:
|
||||
level notify( devgui_string );
|
||||
break;
|
||||
}
|
||||
|
||||
SetDvar( "devgui_notify", "" );
|
||||
}
|
||||
}
|
411
mods/mp_patch/maps/mp/mp_firingrange.gsc
Normal file
411
mods/mp_patch/maps/mp/mp_firingrange.gsc
Normal file
@ -0,0 +1,411 @@
|
||||
#include maps\mp\_utility;
|
||||
|
||||
|
||||
main()
|
||||
{
|
||||
//needs to be first for create fx
|
||||
maps\mp\mp_firingrange_fx::main();
|
||||
|
||||
precachemodel("collision_geo_10x10x512");
|
||||
|
||||
maps\mp\_load::main();
|
||||
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_firingrange");
|
||||
|
||||
maps\mp\mp_firingrange_amb::main();
|
||||
|
||||
// If the team nationalites change in this file,
|
||||
// you must update the team nationality in the level's csc file as well!
|
||||
maps\mp\gametypes\_teamset_cubans::level_init();
|
||||
|
||||
/****** GET ENTITIES ******/
|
||||
//TRIGGERS
|
||||
alleyTrigger = getent("alleyTrigger","targetname");
|
||||
windowTrigger = getent("triggerwindowTarget","targetname");
|
||||
|
||||
//TARGETS
|
||||
target1 = getent("fieldTarget_BackLeft","targetname");
|
||||
target2 = getent("fieldTarget_FrontLeft","targetname");
|
||||
target3 = getent("fieldTarget_Middle","targetname");
|
||||
target4 = getent("fieldTarget_BackRight","targetname");
|
||||
target5 = getent("fieldTarget_FrontRight","targetname");
|
||||
target6 = getent("trenchTarget_GroundWall","targetname");
|
||||
target7 = getent("trailerTarget_Window","targetname");
|
||||
target8 = getent("alleyTarget_Cover","targetname");
|
||||
target9 = getent("alleyTarget_Path","targetname");
|
||||
target10 = getent("centerTarget_Sandbags","targetname");
|
||||
target11 = getent("towerTarget_Front","targetname");
|
||||
target12 = getent("towerTarget_Back","targetname");
|
||||
target13 = getent("centerTarget_Path","targetname");
|
||||
target14 = getent("centerTarget_PathBunkerL","targetname");
|
||||
target15 = getent("centerTarget_PathBunkerR","targetname");
|
||||
target16 = getent("steelBuildingTarget_Slide1","targetname");
|
||||
target17 = getent("steelBuildingTarget_PopUp","targetname");
|
||||
target18 = getent("target_alleyWindow1","targetname");
|
||||
target19 = getent("target_alleyWindow2","targetname");
|
||||
target20 = getent("target_alleyWindow3","targetname");
|
||||
|
||||
//TARGET LIGHTs
|
||||
|
||||
//Props
|
||||
targetLight1_off = getent("steelBuildingTargetLight1_off", "targetname");
|
||||
targetLight1_on = getent("steelBuildingTargetLight1_on", "targetname");
|
||||
|
||||
targetLight2_off = getent("steelBuildingTargetLight2_off", "targetname");
|
||||
targetLight2_on = getent("steelBuildingTargetLight2_on", "targetname");
|
||||
|
||||
//Lights
|
||||
|
||||
level.const_fx_exploder_red_light_1 = 1001;
|
||||
level.const_fx_exploder_red_light_2 = 1002;
|
||||
|
||||
//LOUDSPEAKERS
|
||||
speaker1 = getent("loudspeaker1", "targetname");
|
||||
speaker2 = getent("loudspeaker2", "targetname");
|
||||
|
||||
//PROPANE TANKS
|
||||
/*propaneTank1 = getent("explodingPropaneTank","targetname");
|
||||
propaneTank2 = getent("explodingPropaneTank2","targetname");
|
||||
propaneTank3 = getent("explodingPropaneTank3","targetname");*/
|
||||
|
||||
/****** HIDE ON TARGET LIGHTS ******/
|
||||
//Keep the on versions of the light model hidden until appropriate target takes damage.
|
||||
targetLight1_on Hide();
|
||||
targetLight2_on Hide();
|
||||
|
||||
/****** DAMAGE OBJECTS ********/
|
||||
|
||||
//TARGETS
|
||||
target1 SetCanDamage(true);
|
||||
target2 SetCanDamage(true);
|
||||
target3 SetCanDamage(true);
|
||||
target4 SetCanDamage(true);
|
||||
target5 SetCanDamage(true);
|
||||
target8 SetCanDamage(true);
|
||||
target9 SetCanDamage(true);
|
||||
target10 SetCanDamage(true);
|
||||
target13 SetCanDamage(true);
|
||||
target14 SetCanDamage(true);
|
||||
target15 SetCanDamage(true);
|
||||
target16 SetCanDamage(true);
|
||||
target17 SetCanDamage(true);
|
||||
target18 SetCanDamage(true);
|
||||
target19 SetCanDamage(true);
|
||||
target20 SetCanDamage(true);
|
||||
|
||||
target1 thread damageTarget(1);
|
||||
target2 thread damageTarget(1);
|
||||
target3 thread damageTarget(1);
|
||||
target4 thread damageTarget(1);
|
||||
target5 thread damageTarget(1);
|
||||
target8 thread damageTarget(2);
|
||||
target9 thread damageTarget(2);
|
||||
target10 thread damageTarget(2);
|
||||
target13 thread damageTarget(2);
|
||||
target14 thread damageTarget(3);
|
||||
target15 thread damageTarget(3);
|
||||
target16 thread damageTargetLights(targetLight1_on, targetLight1_off, speaker1, "amb_target_buzzer", level.const_fx_exploder_red_light_2 );
|
||||
target17 thread damageTargetLights(targetLight2_on, targetLight2_off, speaker2, "amb_target_buzzer", level.const_fx_exploder_red_light_1 );
|
||||
target18 thread damageTarget(4);
|
||||
target19 thread damageTarget(4);
|
||||
target20 thread damageTarget(5);
|
||||
|
||||
//PROPANE TANKS
|
||||
/*propaneTank1 SetCanDamage(true);
|
||||
propaneTank2 SetCanDamage(true);
|
||||
propaneTank3 SetCanDamage(true);
|
||||
|
||||
propaneTank1 thread damagePropaneTank("mpl_kls_artillery_impact");
|
||||
propaneTank2 thread damagePropaneTank("mpl_kls_artillery_impact");
|
||||
propaneTank3 thread damagePropaneTank("mpl_kls_artillery_impact");*/
|
||||
|
||||
|
||||
/****** MOVE TARGETS ******/
|
||||
//Sliding Targets
|
||||
target1 thread moveTarget(4, 220, 10.1);
|
||||
target2 thread moveTarget(4, 220, 5.2);
|
||||
target3 thread moveTarget(4, 220, 10.3);
|
||||
target4 thread moveTarget(3, 290, 8.4);
|
||||
target5 thread moveTarget(3, 285, 3);
|
||||
target6 thread moveTarget(1, 228, 8.1);
|
||||
target7 thread moveTarget(7, (57, 23, 0), 3);
|
||||
target8 thread moveTarget(1, 250, 5.5);
|
||||
target9 thread moveTarget(1, 146, 8.6);
|
||||
target10 thread moveTarget(1, 165, 8.7);
|
||||
target11 thread moveTarget(4, 136, 5.05);
|
||||
target12 thread moveTarget(3, 136, 7.15);
|
||||
target13 thread moveTarget(1, 228, 8.25);
|
||||
target16 thread moveTarget(4, 164, 5.35);
|
||||
target17 thread moveTarget(5, 48, 5.45);
|
||||
target18 thread moveTarget(3, 270, 8.55);
|
||||
target19 thread moveTarget(6, 70, 6.65);
|
||||
target20 thread moveTarget(1, 130, 5.75);
|
||||
|
||||
|
||||
|
||||
//Hinge Targets
|
||||
//targetHinge1 thread rotateTarget(2, 90, 0.5, 3); //-Z direction, 90 degrees, in .5 seconds, wait inbetween for 3 seconds.
|
||||
target11 thread rotateTarget(2, 90, 0.5, 2);
|
||||
target12 thread rotateTarget(1, 90, 0.7, 3);
|
||||
|
||||
//Triggers
|
||||
alleyTrigger thread triggerCheck(target9);
|
||||
windowTrigger thread triggerCheck(target7);
|
||||
|
||||
|
||||
// collision keeping players from capping the HQ point from outside the room.
|
||||
spawncollision("collision_geo_10x10x512","collider",(-415, -429, -128), (0, 0, 0));
|
||||
spawncollision("collision_geo_10x10x512","collider",(-415, -419, -128), (0, 0, 0));
|
||||
|
||||
|
||||
// enable new spawning system
|
||||
maps\mp\gametypes\_spawning::level_use_unified_spawning(true);
|
||||
SetDvar( "scr_spawn_enemy_influencer_radius", 1600 );
|
||||
SetDvar( "scr_spawn_dead_friend_influencer_radius", 1300 );
|
||||
SetDvar( "scr_spawn_dead_friend_influencer_timeout_seconds", 13 );
|
||||
SetDvar( "scr_spawn_dead_friend_influencer_count", 7 );
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
triggerCheck(target)
|
||||
{
|
||||
self endon("game_ended");
|
||||
while(1)
|
||||
{
|
||||
self waittill("trigger", player);
|
||||
|
||||
//If the target is close enough to the player to cause a possible issue, tell the target to go back the other direction.
|
||||
distance = Distance(target.origin, self.origin);
|
||||
if(distance <= 90)
|
||||
{
|
||||
target notify( "targetStopMoving" );
|
||||
while( isdefined( player) && player isTouching(self) && distance <= 90)
|
||||
{
|
||||
if ( DistanceSquared( target.origin, target.railPoints[0] ) < DistanceSquared( player.origin, target.railPoints[0] ) )
|
||||
target.preferredNextPos = 0;
|
||||
else
|
||||
target.preferredNextPos = 1;
|
||||
wait( 0.25 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
damageTarget(dir)
|
||||
{
|
||||
self endon("game_ended");
|
||||
while(1)
|
||||
{
|
||||
self waittill("damage", damage, attacker, direction);
|
||||
|
||||
switch(dir)
|
||||
{
|
||||
case 1:
|
||||
self rotateroll(self.angles[1] + 90, .1);
|
||||
wait(.2);
|
||||
self rotateroll(self.angles[1] - 90, .1);
|
||||
wait(.2);
|
||||
self PlaySound ("amb_target_flip");
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
rotation = 1;
|
||||
if ( isdefined( attacker ) && isPlayer( attacker ) )
|
||||
{
|
||||
yaw = get2DYaw( attacker.origin, self.origin );
|
||||
if ( attacker.angles[1] > yaw )
|
||||
rotation = -1;
|
||||
|
||||
}
|
||||
|
||||
self rotateyaw(self.angles[2] + (180 * rotation), .3);
|
||||
self PlaySound ("amb_target_twirl");
|
||||
self waittill("rotatedone");
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
self rotatepitch(self.angles[1] + 90, .1);
|
||||
wait(.2);
|
||||
self rotatepitch(self.angles[1] - 90, .1);
|
||||
wait(.2);
|
||||
self PlaySound ("amb_target_flip");
|
||||
break;
|
||||
case 4:
|
||||
self rotateroll(self.angles[1] - 90, .1);
|
||||
wait(.2);
|
||||
self rotateroll(self.angles[1] + 90, .1);
|
||||
wait(.2);
|
||||
self PlaySound ("amb_target_flip");
|
||||
break;
|
||||
case 5:
|
||||
self rotatepitch(self.angles[1] - 90, .1);
|
||||
wait(.2);
|
||||
self rotatepitch(self.angles[1] + 90, .1);
|
||||
wait(.2);
|
||||
self PlaySound ("amb_target_flip");
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Another damage target function that handles Light style damage responses.
|
||||
damageTargetLights(light_on, light_off, speaker, alias, exploderHandle)
|
||||
{
|
||||
self endon("game_ended");
|
||||
while(1)
|
||||
{
|
||||
self waittill("damage");
|
||||
|
||||
speaker PlaySound(alias);
|
||||
exploder(exploderHandle);
|
||||
light_off Hide();
|
||||
light_on Show();
|
||||
wait(0.5);
|
||||
exploder_stop(exploderHandle);
|
||||
light_off Show();
|
||||
light_on Hide();
|
||||
}
|
||||
}
|
||||
|
||||
/*damagePropaneTank(soundAlias)
|
||||
{
|
||||
self endon("game_ended");
|
||||
|
||||
while(1)
|
||||
{
|
||||
self waittill("damage");
|
||||
|
||||
RadiusDamage(self.origin, 500, 100, 50);
|
||||
PlayFX(level._effect["rcbombexplosion"] , self.origin);
|
||||
self PlaySound(soundAlias);
|
||||
self Delete();
|
||||
}
|
||||
}*/
|
||||
|
||||
//Pass in one of the following to define the start direction of the target: 1 for +y, 2 for -y, 3 for +x, 4 for -x, 5 for +Z, 6 for -Z.
|
||||
//Pass in the distance in units the target is to travel.
|
||||
//Pass in the ammount of time in seconds that it will take the target to travel that distance.
|
||||
moveTarget(dir, dis, speed)
|
||||
{
|
||||
self endon("game_ended");
|
||||
keepMoving = true; //Local var to decide if the target needs to be paused or not.
|
||||
|
||||
//Get the targets starting position or nearPos
|
||||
startPOS = self.origin;
|
||||
//Find out the targets far position.
|
||||
FarPOS = self.origin;
|
||||
|
||||
sound = Spawn ("script_origin", self.origin);
|
||||
sound LinkTo(self);
|
||||
sound PlayLoopSound ("amb_target_chain");
|
||||
|
||||
switch(dir)
|
||||
{
|
||||
case 1://+Y
|
||||
farPOS = self.origin + (0,dis,0);
|
||||
break;
|
||||
case 2://-Y
|
||||
farPOS = self.origin - (0,dis,0);
|
||||
break;
|
||||
case 3://+X
|
||||
farPOS = self.origin + (dis,0,0);
|
||||
break;
|
||||
case 4://-X
|
||||
farPOS = self.origin - (dis,0,0);
|
||||
break;
|
||||
case 5://+Z
|
||||
farPOS = self.origin + (0,0,dis);
|
||||
break;
|
||||
case 6://-Z
|
||||
farPOS = self.origin - (0,0,dis);
|
||||
break;
|
||||
case 7://Custom
|
||||
farPOS = self.origin - dis;
|
||||
break;
|
||||
}
|
||||
|
||||
self.railPoints = [];
|
||||
self.railPoints[0] = startPos;
|
||||
self.railPoints[1] = FarPos;
|
||||
self.preferredNextPos = 1;
|
||||
self.playerTrigger = false;
|
||||
//Move the target
|
||||
while(1)
|
||||
{
|
||||
nextPos = self.railPoints[self.preferredNextPos];
|
||||
if ( self.preferredNextPos == 0 )
|
||||
self.preferredNextPos = 1;
|
||||
else
|
||||
self.preferredNextPos = 0;
|
||||
|
||||
self moveto(nextPos, speed);
|
||||
self waittill_either("movedone","targetStopMoving");
|
||||
self PlaySound ("amb_target_stop");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
rotateTarget(dir, deg, speed, pauseTime)
|
||||
{
|
||||
self endon("game_ended");
|
||||
while(1)
|
||||
{
|
||||
switch(dir)
|
||||
{
|
||||
case 1: //+Z
|
||||
self rotateyaw(self.angles[2] + deg, speed);
|
||||
self PlaySound ("amb_target_rotate");
|
||||
wait(pauseTime);
|
||||
self rotateyaw(self.angles[2] - deg, speed);
|
||||
self PlaySound ("amb_target_rotate");
|
||||
wait(pauseTime);
|
||||
break;
|
||||
case 2: //-Z
|
||||
self rotateyaw(self.angles[2] - deg, speed);
|
||||
self PlaySound ("amb_target_rotate");
|
||||
wait(pauseTime);
|
||||
self rotateyaw(self.angles[2] + deg, speed);
|
||||
self PlaySound ("amb_target_rotate");
|
||||
wait(pauseTime);
|
||||
break;
|
||||
case 3: //+X
|
||||
self rotateroll(self.angles[0] + deg, speed);
|
||||
self PlaySound ("amb_target_rotate");
|
||||
wait(pauseTime);
|
||||
self rotateroll(self.angles[0] - deg, speed);
|
||||
self PlaySound ("amb_target_rotate");
|
||||
wait(pauseTime);
|
||||
break;
|
||||
case 4: //-X
|
||||
self rotateroll(self.angles[0] - deg, speed);
|
||||
self PlaySound ("amb_target_rotate");
|
||||
wait(pauseTime);
|
||||
self rotateroll(self.angles[0] + deg, speed);
|
||||
self PlaySound ("amb_target_rotate");
|
||||
wait(pauseTime);
|
||||
break;
|
||||
case 5: //+Y
|
||||
self rotateroll(self.angles[1] + deg, speed);
|
||||
self PlaySound ("amb_target_rotate");
|
||||
wait(pauseTime);
|
||||
self rotateroll(self.angles[1] - deg, speed);
|
||||
self PlaySound ("amb_target_rotate");
|
||||
wait(pauseTime);
|
||||
break;
|
||||
case 6: //-Y
|
||||
self rotatepitch(self.angles[1] - deg, speed);
|
||||
wait(pauseTime);
|
||||
self rotatepitch(self.angles[1] + deg, speed);
|
||||
wait(pauseTime);
|
||||
break;
|
||||
case 7: //Custom
|
||||
self rotateto( (self.angles[0] + 90, self.angles[1] - 90, self.angles[2] + 45), speed);
|
||||
wait(pauseTime);
|
||||
self rotateto( (self.angles[0] - 90, self.angles[1] + 90, self.angles[2] - 45), speed);
|
||||
wait(pauseTime);
|
||||
}
|
||||
}
|
||||
}
|
386
mods/mp_patch/maps/mp/mp_golfcourse.gsc
Normal file
386
mods/mp_patch/maps/mp/mp_golfcourse.gsc
Normal file
@ -0,0 +1,386 @@
|
||||
#include maps\mp\_utility;
|
||||
#include common_scripts\utility;
|
||||
#include maps\mp\_events;
|
||||
|
||||
main()
|
||||
{
|
||||
//needs to be first for create fx
|
||||
maps\mp\mp_golfcourse_fx::main();
|
||||
|
||||
precachemodel("collision_geo_64x64x256");
|
||||
precachemodel("collision_wall_256x256x10");
|
||||
|
||||
maps\mp\_load::main();
|
||||
// maps\mp\_compass::setupMiniMap("compass_map_mp_golfcourse");
|
||||
if ( GetDvarInt( #"xblive_wagermatch" ) == 1 )
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_golfcourse_wager");
|
||||
}
|
||||
else
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_golfcourse");
|
||||
}
|
||||
|
||||
maps\mp\mp_golfcourse_amb::main();
|
||||
|
||||
// If the team nationalites change in this file, you must also update the level's csc file,
|
||||
// the level's csv file, and the share/raw/mp/mapsTable.csv
|
||||
maps\mp\gametypes\_teamset_cubans::level_init();
|
||||
|
||||
// Set up the default range of the compass
|
||||
setdvar("compassmaxrange","2100");
|
||||
|
||||
// Set up some generic War Flag Names.
|
||||
// Example from COD5: CALLSIGN_SEELOW_A is the name of the 1st flag in Selow whose string is "Cottage"
|
||||
// The string must have MPUI_CALLSIGN_ and _A. Replace Mapname with the name of your map/bsp and in the
|
||||
// actual string enter a keyword that names the location (Roundhouse, Missle Silo, Launchpad, Guard Tower, etc)
|
||||
|
||||
game["strings"]["war_callsign_a"] = &"MPUI_CALLSIGN_MAPNAME_A";
|
||||
game["strings"]["war_callsign_b"] = &"MPUI_CALLSIGN_MAPNAME_B";
|
||||
game["strings"]["war_callsign_c"] = &"MPUI_CALLSIGN_MAPNAME_C";
|
||||
game["strings"]["war_callsign_d"] = &"MPUI_CALLSIGN_MAPNAME_D";
|
||||
game["strings"]["war_callsign_e"] = &"MPUI_CALLSIGN_MAPNAME_E";
|
||||
|
||||
game["strings_menu"]["war_callsign_a"] = "@MPUI_CALLSIGN_MAPNAME_A";
|
||||
game["strings_menu"]["war_callsign_b"] = "@MPUI_CALLSIGN_MAPNAME_B";
|
||||
game["strings_menu"]["war_callsign_c"] = "@MPUI_CALLSIGN_MAPNAME_C";
|
||||
game["strings_menu"]["war_callsign_d"] = "@MPUI_CALLSIGN_MAPNAME_D";
|
||||
game["strings_menu"]["war_callsign_e"] = "@MPUI_CALLSIGN_MAPNAME_E";
|
||||
|
||||
// enable new spawning system
|
||||
maps\mp\gametypes\_spawning::level_use_unified_spawning(true);
|
||||
|
||||
level thread sprinklers_init();
|
||||
level thread gopher_init();
|
||||
|
||||
//spawning collision in wager match so players can't hide in the spawned in columns
|
||||
if ( GetDvarInt( #"xblive_wagermatch" ) == 1 || isPregame() )
|
||||
{
|
||||
spawncollision("collision_geo_64x64x256","collider",(-1075, -797, -105), (0, 340.8, 0));
|
||||
spawncollision("collision_geo_64x64x256","collider",(-551, -965, -105), (0, 340.8, 0));
|
||||
}
|
||||
|
||||
//spawning collision wall to stop players from getting out of the map by the pond
|
||||
spawncollision("collision_wall_256x256x10","collider",(416, 592, -172), (0, 45, -7));
|
||||
|
||||
//spawn p_gc_signpost_short model to cover hole in geo under scoreboard
|
||||
|
||||
scoreboard1 = Spawn("script_model", (-2046, 839, -215) );
|
||||
if ( IsDefined(scoreboard1) )
|
||||
{
|
||||
scoreboard1.angles = (0, 180, 0);
|
||||
scoreboard1 SetModel("p_gc_signpost_short");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sprinklers_init()
|
||||
{
|
||||
wait( 3 );
|
||||
|
||||
exploders = [];
|
||||
exploders[ exploders.size ] = 1001; //sprinkler by sand trap
|
||||
exploders[ exploders.size ] = 1002; //sprinkler in middle of map
|
||||
exploders[ exploders.size ] = 1003; //sprinkler by bridge
|
||||
exploders[ exploders.size ] = 1004;
|
||||
exploders[ exploders.size ] = 1005;
|
||||
exploders[ exploders.size ] = 1006;
|
||||
exploders[ exploders.size ] = 1007;
|
||||
exploders[ exploders.size ] = 3001;
|
||||
exploders[ exploders.size ] = 3002;
|
||||
exploders[ exploders.size ] = 3003;
|
||||
exploders[ exploders.size ] = 3004;
|
||||
exploders[ exploders.size ] = 3005;
|
||||
exploders[ exploders.size ] = 3006;
|
||||
exploders[ exploders.size ] = 3007;
|
||||
exploders[ exploders.size ] = 3008;
|
||||
exploders[ exploders.size ] = 3009;
|
||||
exploders[ exploders.size ] = 3010;
|
||||
exploders[ exploders.size ] = 3011;
|
||||
exploders[ exploders.size ] = 3012;
|
||||
|
||||
for ( i = 0; i < exploders.size; i++ )
|
||||
{
|
||||
sprinkler_init( exploders[ i ] );
|
||||
}
|
||||
}
|
||||
|
||||
sprinkler_init( exploder_num )
|
||||
{
|
||||
create_fx_ent = exploder_find( exploder_num );
|
||||
assertex( IsDefined( create_fx_ent ), "unknown sprinkler exploder: " + exploder_num );
|
||||
|
||||
create_fx_ent.fake_health = 40;
|
||||
|
||||
radius = 10;
|
||||
height = 10;
|
||||
|
||||
create_fx_ent.damage_trigger = Spawn( "trigger_damage", create_fx_ent.v[ "origin" ] - ( 0, 0, 5 ), 0, radius, height );
|
||||
|
||||
/#
|
||||
//create_fx_ent.damage_trigger thread trigger_debug( radius, height );
|
||||
//create_fx_ent.damage_trigger thread sprinkler_debug( create_fx_ent );
|
||||
#/
|
||||
|
||||
create_fx_ent.destroyed_exploder = exploder_num + 1000;
|
||||
|
||||
if ( exploder_num == 1001 || exploder_num == 1002 || exploder_num == 1003 )
|
||||
{
|
||||
radius = 125;
|
||||
height = 150;
|
||||
|
||||
start = create_fx_ent.v[ "origin" ] + vector_scale( create_fx_ent.v[ "forward" ], 384 );
|
||||
|
||||
end = start + ( 0, 0, -8000 );
|
||||
trace = BulletTrace( start, end, false, undefined, false, false );
|
||||
origin = trace[ "position" ];
|
||||
|
||||
create_fx_ent thread sprinkler_water_think( origin, radius, height );
|
||||
create_fx_ent.soundent = spawn ( "script_origin", create_fx_ent.v[ "origin" ] );
|
||||
create_fx_ent.soundent playloopsound ("amb_sprinkler");
|
||||
}
|
||||
|
||||
// spawn sound ents
|
||||
|
||||
create_fx_ent thread sprinkler_think(exploder_num);
|
||||
exploder( exploder_num );
|
||||
}
|
||||
|
||||
sprinkler_think(exploder_num)
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
self.damage_trigger waittill( "damage", amount, attacker, direction, point, type );
|
||||
|
||||
if ( IsDefined( type ) )
|
||||
{
|
||||
if ( type == "MOD_MELEE" || type == "MOD_EXPLOSIVE" || type == "MOD_IMPACT" )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
self.fake_health -= amount;
|
||||
|
||||
if ( self.fake_health <= 0 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isdefined (self.soundent))
|
||||
{
|
||||
self.soundent stoploopsound();
|
||||
clientnotify("so_"+exploder_num);
|
||||
}
|
||||
playsoundatposition ("amb_sprinkler_geyser", self.v[ "origin" ] );
|
||||
|
||||
self.damage_trigger delete();
|
||||
|
||||
// delete sound ents
|
||||
|
||||
// stop exploder
|
||||
exploder( self.destroyed_exploder );
|
||||
self exploder_fade();
|
||||
|
||||
if ( IsDefined( self.water_trigger ) )
|
||||
{
|
||||
self.water_trigger delete();
|
||||
}
|
||||
|
||||
wait( 0.25 );
|
||||
|
||||
self thread sprinkler_water_think( self.v[ "origin" ], 50, 100 );
|
||||
|
||||
wait( 1 );
|
||||
|
||||
exploder_stop( self.v[ "exploder" ] );
|
||||
|
||||
wait( 5 );
|
||||
self.water_trigger delete();
|
||||
}
|
||||
|
||||
sprinkler_water_think( origin, radius, height )
|
||||
{
|
||||
self.water_trigger = Spawn( "trigger_radius", origin, 0, radius, height );
|
||||
/#
|
||||
//self.water_trigger thread trigger_debug( radius, height );
|
||||
#/
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self.water_trigger waittill( "trigger", entity );
|
||||
|
||||
if ( !IsDefined( entity ) || !IsPlayer( entity ) || !IsAlive( entity ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
player = entity;
|
||||
|
||||
if ( player.sessionstate != "playing" )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !IsDefined( player.golfcourse_water_drops ) )
|
||||
{
|
||||
player.golfcourse_water_drops = false;
|
||||
}
|
||||
|
||||
if ( player.golfcourse_water_drops )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
player thread sprinkler_water_drops( self.water_trigger );
|
||||
}
|
||||
}
|
||||
|
||||
sprinkler_water_drops( trigger )
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "disconnect" );
|
||||
trigger endon( "death" );
|
||||
|
||||
self thread water_drop_end_think();
|
||||
trigger thread water_drop_death_think( self );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
if ( !self IsTouching( trigger ) )
|
||||
{
|
||||
self notify( "water_drop_end" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !self.golfcourse_water_drops )
|
||||
{
|
||||
self.golfcourse_water_drops = true;
|
||||
self SetWaterDrops( 50 );
|
||||
}
|
||||
|
||||
wait( RandomIntRange( 1, 3 ) );
|
||||
}
|
||||
}
|
||||
|
||||
water_drop_end_think()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
|
||||
self waittill_any( "death", "water_drop_end" );
|
||||
self.golfcourse_water_drops = false;
|
||||
self SetWaterDrops( 0 );
|
||||
}
|
||||
|
||||
water_drop_death_think( player )
|
||||
{
|
||||
player endon( "death" );
|
||||
player endon( "disconnect" );
|
||||
player endon( "water_drop_end" );
|
||||
|
||||
self waittill( "death" );
|
||||
player notify( "water_drop_end" );
|
||||
}
|
||||
|
||||
exploder_find( num )
|
||||
{
|
||||
num = int( num );
|
||||
|
||||
for( i = 0; i < level.createFXent.size; i++ )
|
||||
{
|
||||
ent = level.createFXent[ i ];
|
||||
|
||||
if( !isdefined( ent ) )
|
||||
continue;
|
||||
|
||||
if( ent.v[ "type" ] != "exploder" )
|
||||
continue;
|
||||
|
||||
if( !isdefined( ent.v[ "exploder" ] ) )
|
||||
continue;
|
||||
|
||||
if( ent.v[ "exploder" ] != num )
|
||||
continue;
|
||||
|
||||
return ent;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
exploder_fade()
|
||||
{
|
||||
assert( IsDefined( self.looper ) );
|
||||
TriggerFx( self.looper, GetTime()/1000 + 100 );
|
||||
}
|
||||
|
||||
gopher_init()
|
||||
{
|
||||
level waittill( "prematch_over" );
|
||||
|
||||
if ( !IsDefined( game[ "gopher_fx" ] ) )
|
||||
{
|
||||
game[ "gopher_fx" ] = false;
|
||||
}
|
||||
|
||||
if ( isRoundBased() && getRoundsPlayed() >= 3 && getRoundsPlayed() % 3 == 0 )
|
||||
{
|
||||
game[ "gopher_fx" ] = false;
|
||||
}
|
||||
|
||||
if ( game[ "gopher_fx" ] )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( cointoss() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
exploders = [];
|
||||
exploders[ exploders.size ] = 5001;
|
||||
exploders[ exploders.size ] = 5002;
|
||||
exploders[ exploders.size ] = 5003;
|
||||
exploders[ exploders.size ] = 5004;
|
||||
|
||||
percent = RandomIntRange( 20, 90 );
|
||||
minutes = ( percent * 0.01 ) * level.timelimit;
|
||||
add_timed_event( minutes * 60, "gopher_fx" );
|
||||
|
||||
percent = RandomIntRange( 20, 90 );
|
||||
score = ( percent * 0.01 ) * level.scorelimit;
|
||||
add_score_event( score, "gopher_fx" );
|
||||
|
||||
level waittill( "gopher_fx" );
|
||||
game[ "gopher_fx" ] = true;
|
||||
|
||||
exploder( random( exploders ) );
|
||||
}
|
||||
|
||||
/#
|
||||
sprinkler_debug( create_fx_ent )
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
print3d( self.origin, create_fx_ent.fake_health );
|
||||
wait( 0.05 );
|
||||
}
|
||||
}
|
||||
|
||||
trigger_debug( radius, height )
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
drawcylinder( self.origin, radius, height, 1 );
|
||||
wait( 1 );
|
||||
}
|
||||
|
||||
}
|
||||
#/
|
||||
|
234
mods/mp_patch/maps/mp/mp_mountain.gsc
Normal file
234
mods/mp_patch/maps/mp/mp_mountain.gsc
Normal file
@ -0,0 +1,234 @@
|
||||
#include maps\mp\_utility;
|
||||
#include common_scripts\utility;
|
||||
|
||||
main()
|
||||
{
|
||||
/#
|
||||
level thread devgui_mountain();
|
||||
execdevgui( "devgui_mp_mountain" );
|
||||
#/
|
||||
|
||||
//needs to be first for create fx
|
||||
maps\mp\mp_mountain_fx::main();
|
||||
|
||||
precachemodel("collision_vehicle_64x64x64");
|
||||
precachemodel("collision_wall_512x512x10");
|
||||
precachemodel("collision_geo_128x128x128");
|
||||
|
||||
maps\mp\_load::main();
|
||||
|
||||
maps\mp\mp_mountain_amb::main();
|
||||
|
||||
if ( GetDvarInt( #"xblive_wagermatch" ) == 1 )
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_mountain_wager");
|
||||
}
|
||||
else
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_mountain");
|
||||
}
|
||||
|
||||
//setExpFog(2048, 6000, 1, 0.5, 0.5, 0);
|
||||
|
||||
|
||||
// If the team nationalites change in this file,
|
||||
// you must update the team nationality in the level's csc file as well!
|
||||
maps\mp\gametypes\_teamset_winterspecops::level_init();
|
||||
|
||||
// Set up the default range of the compass
|
||||
//setdvar("compassmaxrange","2100");
|
||||
|
||||
// Set up some generic War Flag Names.
|
||||
// Example from COD5: CALLSIGN_SEELOW_A is the name of the 1st flag in Selow whose string is "Cottage"
|
||||
// The string must have MPUI_CALLSIGN_ and _A. Replace Mapname with the name of your map/bsp and in the
|
||||
// actual string enter a keyword that names the location (Roundhouse, Missle Silo, Launchpad, Guard Tower, etc)
|
||||
|
||||
game["strings"]["war_callsign_a"] = &"MPUI_CALLSIGN_MAPNAME_A";
|
||||
game["strings"]["war_callsign_b"] = &"MPUI_CALLSIGN_MAPNAME_B";
|
||||
game["strings"]["war_callsign_c"] = &"MPUI_CALLSIGN_MAPNAME_C";
|
||||
game["strings"]["war_callsign_d"] = &"MPUI_CALLSIGN_MAPNAME_D";
|
||||
game["strings"]["war_callsign_e"] = &"MPUI_CALLSIGN_MAPNAME_E";
|
||||
|
||||
game["strings_menu"]["war_callsign_a"] = "@MPUI_CALLSIGN_MAPNAME_A";
|
||||
game["strings_menu"]["war_callsign_b"] = "@MPUI_CALLSIGN_MAPNAME_B";
|
||||
game["strings_menu"]["war_callsign_c"] = "@MPUI_CALLSIGN_MAPNAME_C";
|
||||
game["strings_menu"]["war_callsign_d"] = "@MPUI_CALLSIGN_MAPNAME_D";
|
||||
game["strings_menu"]["war_callsign_e"] = "@MPUI_CALLSIGN_MAPNAME_E";
|
||||
|
||||
// spawn vehicle collision to prevent rc car from entering a large rock
|
||||
spawncollision("collision_vehicle_64x64x64","collider",(1740, -1585, 240), (0, 36.8, 0));
|
||||
spawncollision("collision_vehicle_64x64x64","collider",(1715, -1580, 240), (0, 26.4, 0));
|
||||
|
||||
// spawn collision to prevent players from leaping to a rock in the vista
|
||||
spawncollision("collision_wall_512x512x10","collider",(3931, -2522, 288), (0, 45, 0));
|
||||
spawncollision("collision_wall_512x512x10","collider",(3931, -2522, 800), (0, 45, 0));
|
||||
|
||||
// spawn collision to prevent players from leaping to a rock in the vista over top of the killbrush.
|
||||
spawncollision("collision_wall_512x512x10","collider",(3709, -2538, 560), (0, 180, 0));
|
||||
|
||||
// spawn collision to prevent players from sitting in a rock by the ice bridge
|
||||
spawncollision("collision_geo_128x128x128","collider",(2242.2, 128.3, 260), (0, 310.2, 0));
|
||||
|
||||
|
||||
|
||||
// enable new spawning system
|
||||
maps\mp\gametypes\_spawning::level_use_unified_spawning(true);
|
||||
|
||||
SetDvar( "scr_spawn_enemy_influencer_radius", 1620 );
|
||||
|
||||
level thread gondola_sway();
|
||||
level thread glass_exploder_init();
|
||||
|
||||
glasses = GetStructArray( "glass_shatter_on_spawn", "targetname" );
|
||||
|
||||
for ( i = 0; i < glasses.size; i++ )
|
||||
{
|
||||
RadiusDamage( glasses[i].origin, 64, 101, 100 );
|
||||
}
|
||||
}
|
||||
|
||||
devgui_mountain( cmd )
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
wait( 0.5 );
|
||||
|
||||
devgui_string = GetDvar( #"devgui_notify" );
|
||||
|
||||
switch( devgui_string )
|
||||
{
|
||||
case "":
|
||||
break;
|
||||
|
||||
default:
|
||||
level notify( devgui_string );
|
||||
break;
|
||||
}
|
||||
|
||||
SetDvar( "devgui_notify", "" );
|
||||
}
|
||||
}
|
||||
|
||||
//Picks randomly from 2 sway strengths
|
||||
gondola_sway()
|
||||
{
|
||||
level endon ("gondola_triggered");
|
||||
|
||||
gondola_cab = GetEnt( "gondola_cab", "targetname" );
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
randomSwingAngle = RandomFloatRange( 2, 5 );
|
||||
randomSwingTime = RandomFloatRange( 2, 3 );
|
||||
|
||||
gondola_cab RotateTo( (randomSwingAngle*0.5,(randomSwingAngle*0.6)+90,randomSwingAngle*.8), randomSwingTime, randomSwingTime*0.3, randomSwingTime*0.3 );
|
||||
gondola_cab playsound ("amb_gondola_swing");
|
||||
wait( randomSwingTime );
|
||||
gondola_cab RotateTo( ((randomSwingAngle*0.5)*-1,(randomSwingAngle*-1*0.6)+90,randomSwingAngle*.8*-1), randomSwingTime, randomSwingTime*0.3, randomSwingTime*0.3 );
|
||||
gondola_cab playsound ("amb_gondola_swing_back");
|
||||
wait( randomSwingTime );
|
||||
}
|
||||
}
|
||||
|
||||
glass_exploder_init()
|
||||
{
|
||||
single_exploders = [];
|
||||
|
||||
for ( i = 0; i < level.createFXent.size; i++ )
|
||||
{
|
||||
ent = level.createFXent[ i ];
|
||||
|
||||
if ( !IsDefined( ent ) )
|
||||
continue;
|
||||
|
||||
if ( ent.v[ "type" ] != "exploder" )
|
||||
continue;
|
||||
|
||||
if ( ent.v[ "exploder" ] == 201 || ent.v[ "exploder" ] == 202 )
|
||||
{
|
||||
ent thread glass_group_exploder_think();
|
||||
}
|
||||
else if ( ent.v[ "exploder" ] >= 101 && ent.v[ "exploder" ] <= 106 )
|
||||
{
|
||||
single_exploders[ single_exploders.size ] = ent;
|
||||
}
|
||||
else if ( ent.v[ "exploder" ] == 301 || ent.v[ "exploder" ] == 302 )
|
||||
{
|
||||
single_exploders[ single_exploders.size ] = ent;
|
||||
}
|
||||
}
|
||||
|
||||
level thread glass_exploder_think( single_exploders );
|
||||
}
|
||||
|
||||
glass_group_exploder_think()
|
||||
{
|
||||
thresholdSq = 160 * 160;
|
||||
count = 0;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
level waittill( "glass_smash", origin );
|
||||
|
||||
if ( DistanceSquared( self.v[ "origin" ], origin ) < thresholdSq )
|
||||
{
|
||||
count++;
|
||||
}
|
||||
|
||||
if ( count >= 3 )
|
||||
{
|
||||
exploder( self.v[ "exploder" ] );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glass_exploder_think( exploders )
|
||||
{
|
||||
thresholdSq = 160 * 160;
|
||||
|
||||
if ( exploders.size <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
closest = 999 * 999;
|
||||
closest_exploder = undefined;
|
||||
|
||||
level waittill( "glass_smash", origin );
|
||||
|
||||
for ( i = 0; i < exploders.size; i++ )
|
||||
{
|
||||
if ( !IsDefined( exploders[i] ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( IsDefined( exploders[i].glass_broken ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
distSq = DistanceSquared( exploders[i].v[ "origin" ], origin );
|
||||
|
||||
if ( distSq > thresholdSq )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( distSq < closest )
|
||||
{
|
||||
closest_exploder = exploders[i];
|
||||
closest = distSq;
|
||||
}
|
||||
}
|
||||
|
||||
if ( IsDefined( closest_exploder ) )
|
||||
{
|
||||
closest_exploder.glass_broken = true;
|
||||
exploder( closest_exploder.v[ "exploder" ] );
|
||||
}
|
||||
}
|
||||
}
|
405
mods/mp_patch/maps/mp/mp_nuked.gsc
Normal file
405
mods/mp_patch/maps/mp/mp_nuked.gsc
Normal file
@ -0,0 +1,405 @@
|
||||
#include maps\mp\_utility;
|
||||
#include common_scripts\utility;
|
||||
|
||||
main()
|
||||
{
|
||||
//needs to be first for create fx
|
||||
maps\mp\mp_nuked_fx::main();
|
||||
|
||||
precachemodel("collision_wall_128x128x10");
|
||||
|
||||
// move a dom spawn that is sharing space with one of the mannequins
|
||||
move_spawn_point( "mp_dom_spawn", (791, 449, -20), ( 779, 445, -20 ) );
|
||||
|
||||
maps\mp\_load::main();
|
||||
|
||||
maps\mp\mp_nuked_amb::main();
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_nuked");
|
||||
|
||||
level.onSpawnIntermission = ::nuked_intermission;
|
||||
|
||||
/#
|
||||
level thread devgui_nuked();
|
||||
execdevgui( "devgui_mp_nuked" );
|
||||
#/
|
||||
|
||||
// If the team nationalites change in this file,
|
||||
// you must update the team nationality in the level's csc file as well!
|
||||
maps\mp\gametypes\_teamset_urbanspecops::level_init();
|
||||
|
||||
// Set up the default range of the compass
|
||||
setdvar("compassmaxrange","2100");
|
||||
|
||||
// Set up some generic War Flag Names.
|
||||
// Example from COD5: CALLSIGN_SEELOW_A is the name of the 1st flag in Selow whose string is "Cottage"
|
||||
// The string must have MPUI_CALLSIGN_ and _A. Replace Mapname with the name of your map/bsp and in the
|
||||
// actual string enter a keyword that names the location (Roundhouse, Missle Silo, Launchpad, Guard Tower, etc)
|
||||
|
||||
game["strings"]["war_callsign_a"] = &"MPUI_CALLSIGN_MAPNAME_A";
|
||||
game["strings"]["war_callsign_b"] = &"MPUI_CALLSIGN_MAPNAME_B";
|
||||
game["strings"]["war_callsign_c"] = &"MPUI_CALLSIGN_MAPNAME_C";
|
||||
game["strings"]["war_callsign_d"] = &"MPUI_CALLSIGN_MAPNAME_D";
|
||||
game["strings"]["war_callsign_e"] = &"MPUI_CALLSIGN_MAPNAME_E";
|
||||
|
||||
game["strings_menu"]["war_callsign_a"] = "@MPUI_CALLSIGN_MAPNAME_A";
|
||||
game["strings_menu"]["war_callsign_b"] = "@MPUI_CALLSIGN_MAPNAME_B";
|
||||
game["strings_menu"]["war_callsign_c"] = "@MPUI_CALLSIGN_MAPNAME_C";
|
||||
game["strings_menu"]["war_callsign_d"] = "@MPUI_CALLSIGN_MAPNAME_D";
|
||||
game["strings_menu"]["war_callsign_e"] = "@MPUI_CALLSIGN_MAPNAME_E";
|
||||
|
||||
// enable new spawning system
|
||||
maps\mp\gametypes\_spawning::level_use_unified_spawning(true);
|
||||
SetDvar( "scr_spawn_enemy_influencer_radius", 1600 );
|
||||
SetDvar( "scr_spawn_dead_friend_influencer_radius", 1300 );
|
||||
SetDvar( "scr_spawn_dead_friend_influencer_timeout_seconds", 8 );
|
||||
SetDvar( "scr_spawn_dead_friend_influencer_count", 7 );
|
||||
|
||||
//spawn collision in yellow house to prevent players from jump-crouching into a door.
|
||||
spawncollision("collision_wall_128x128x10","collider",(769.2, 329.3, 143), (0, 290.6, 0));
|
||||
spawncollision("collision_wall_128x128x10","collider",(769.2, 329.3, 271), (0, 290.6, 0));
|
||||
|
||||
level.const_fx_exploder_end_game_glass_shatter = 5001;
|
||||
level.disableOutroVisionSet = true;
|
||||
|
||||
level thread nuked_mannequin_init();
|
||||
nuked_doomsday_clock_init();
|
||||
level thread maps\mp\mp_nuked_platform::main();
|
||||
|
||||
level thread nuked_population_sign_think();
|
||||
level thread nuked_bomb_drop_think();
|
||||
|
||||
/#
|
||||
level thread nuked_bomb_drop_dev();
|
||||
#/
|
||||
|
||||
}
|
||||
|
||||
move_spawn_point( targetname, start_point, new_point )
|
||||
{
|
||||
spawn_points = getentarray( targetname, "classname" );
|
||||
|
||||
for ( i = 0; i < spawn_points.size; i++ )
|
||||
{
|
||||
if ( distancesquared( spawn_points[i].origin, start_point ) < 1 )
|
||||
{
|
||||
spawn_points[i].origin = new_point;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nuked_mannequin_init()
|
||||
{
|
||||
keep_count = 28;
|
||||
level.mannequin_count = 0;
|
||||
|
||||
destructibles = GetEntArray( "destructible", "targetname" );
|
||||
mannequins = nuked_mannequin_filter( destructibles );
|
||||
|
||||
if ( mannequins.size <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
remove_count = mannequins.size - keep_count;
|
||||
remove_count = clamp( remove_count, 0, remove_count );
|
||||
|
||||
mannequins = array_randomize( mannequins );
|
||||
|
||||
for ( i = 0; i < remove_count; i++ )
|
||||
{
|
||||
assert( IsDefined( mannequins[i].target ) );
|
||||
|
||||
collision = GetEnt( mannequins[i].target, "targetname" );
|
||||
assert( IsDefined( collision ) );
|
||||
|
||||
collision delete();
|
||||
mannequins[i] delete();
|
||||
level.mannequin_count--;
|
||||
}
|
||||
|
||||
level waittill( "prematch_over" );
|
||||
level.mannequin_time = GetTime();
|
||||
}
|
||||
|
||||
nuked_mannequin_filter( destructibles )
|
||||
{
|
||||
mannequins = [];
|
||||
|
||||
for ( i = 0; i < destructibles.size; i++ )
|
||||
{
|
||||
destructible = destructibles[i];
|
||||
|
||||
if ( IsSubStr( destructible.destructibledef, "male" ) )
|
||||
{
|
||||
mannequins[ mannequins.size ] = destructible;
|
||||
level.mannequin_count++;
|
||||
}
|
||||
}
|
||||
|
||||
return mannequins;
|
||||
}
|
||||
|
||||
nuked_intermission()
|
||||
{
|
||||
maps\mp\gametypes\_globallogic_defaults::default_onSpawnIntermission();
|
||||
|
||||
if ( wasLastRound() )
|
||||
{
|
||||
level notify( "bomb_drop" );
|
||||
}
|
||||
}
|
||||
|
||||
nuked_bomb_drop_think()
|
||||
{
|
||||
cameraStart = GetStruct( "endgame_camera_start", "targetname" );
|
||||
cameraEnd = GetStruct( cameraStart.target, "targetname" );
|
||||
|
||||
bomb = GetEnt( "nuked_bomb", "targetname" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
camera = Spawn( "script_model", cameraStart.origin );
|
||||
camera.angles = cameraStart.angles;
|
||||
camera SetModel( "tag_origin" );
|
||||
|
||||
level waittill( "bomb_drop" );
|
||||
|
||||
if( level.finalkillcam && IsDefined(level.lastKillCam ) )
|
||||
{
|
||||
wait( 0.1 );
|
||||
while( level.inFinalKillcam )
|
||||
{
|
||||
wait( 0.1 );
|
||||
}
|
||||
}
|
||||
|
||||
for ( i = 0; i < get_players().size; i++ )
|
||||
{
|
||||
player = get_players()[i];
|
||||
player CameraSetPosition( camera );
|
||||
player CameraSetLookAt();
|
||||
player CameraActivate( true );
|
||||
}
|
||||
|
||||
cam_move_time = set_dvar_float_if_unset( "scr_cam_move_time", "2.5" );
|
||||
bomb_explode_delay = set_dvar_float_if_unset( "scr_bomb_explode_delay", "1.5" );
|
||||
glass_break_delay = set_dvar_float_if_unset( "scr_glass_break_delay", "0.5" );
|
||||
//white_out_delay = set_dvar_float_if_unset( "scr_white_out_delay", "1.0" );
|
||||
|
||||
camera MoveTo( cameraEnd.origin, cam_move_time, 0, 0 );
|
||||
camera RotateTo( cameraEnd.angles, cam_move_time, 0, 0 );
|
||||
|
||||
bomb playSound ("amb_end_nuke");
|
||||
|
||||
dest = ( bomb.origin[0], bomb.origin[1], bomb.origin[2] - 3700 );
|
||||
|
||||
time = set_dvar_float_if_unset( "scr_bomb_time", "1.5" );
|
||||
accel_time = set_dvar_float_if_unset( "scr_bomb_accel_time", ".75" );
|
||||
|
||||
bomb MoveTo( dest, time, accel_time, 0 );
|
||||
|
||||
wait( bomb_explode_delay );
|
||||
playfx ( level._effect["fx_mp_nuked_nuclear_explosion"], bomb.origin);
|
||||
wait( glass_break_delay );
|
||||
level thread waitForGlassBreak();
|
||||
cameraForward = anglestoforward( cameraEnd.angles );
|
||||
explodePoint = cameraEnd.origin + 20*cameraForward;
|
||||
//black = ( 0.2, 0.2, 0.2 );
|
||||
//debugstar(explodePoint, 2 * 1000, black);
|
||||
physicsExplosionSphere( explodePoint, 128, 128, 1 );
|
||||
RadiusDamage( explodePoint, 128, 128, 128 );
|
||||
//wait( white_out_delay );
|
||||
|
||||
camera thread vibrate();
|
||||
|
||||
//PrintLn( "SND NUKE play" );
|
||||
//VisionSetNaked( "flash_grenade", .4 );
|
||||
|
||||
/#
|
||||
//bomb waittill( "movedone" );
|
||||
|
||||
wait( 3.5 - glass_break_delay );
|
||||
level notify( "bomb_reset" );
|
||||
camera delete();
|
||||
#/
|
||||
}
|
||||
}
|
||||
|
||||
vibrate()
|
||||
{
|
||||
self endon( "death" );
|
||||
|
||||
pitchVibrateAmplitude = 1;
|
||||
|
||||
vibrateAmplitude = 2;
|
||||
vibrateTime = 0.05;
|
||||
|
||||
originalAngles = self.angles;
|
||||
|
||||
angles0 = ( originalAngles[0], originalAngles[1], originalAngles[2] - vibrateAmplitude );
|
||||
angles1 = ( originalAngles[0], originalAngles[1], originalAngles[2] + vibrateAmplitude );
|
||||
|
||||
for(;;)
|
||||
{
|
||||
angles0 = ( originalAngles[0] - pitchVibrateAmplitude , originalAngles[1], originalAngles[2] - vibrateAmplitude );
|
||||
angles1 = ( originalAngles[0] + pitchVibrateAmplitude, originalAngles[1], originalAngles[2] + vibrateAmplitude );
|
||||
|
||||
self RotateTo(angles0, vibrateTime );
|
||||
self waittill( "rotatedone" );
|
||||
self RotateTo(angles1, vibrateTime );
|
||||
self waittill( "rotatedone" );
|
||||
|
||||
if ( vibrateAmplitude > 0 )
|
||||
vibrateAmplitude -= 0.25;
|
||||
pitchVibrateAmplitude = 0 - pitchVibrateAmplitude;
|
||||
pitchVibrateAmplitude *= 0.66;
|
||||
}
|
||||
}
|
||||
|
||||
waitForGlassBreak()
|
||||
{
|
||||
level endon( "bomb_reset" );
|
||||
level waittill( "glass_smash", origin );
|
||||
|
||||
exploder( level.const_fx_exploder_end_game_glass_shatter );
|
||||
}
|
||||
|
||||
nuked_population_sign_think()
|
||||
{
|
||||
tens_model = GetEnt( "counter_tens", "targetname" );
|
||||
ones_model = GetEnt( "counter_ones", "targetname" );
|
||||
|
||||
step = ( 360 / 10 ); // 10 digits (0-9) on the dial
|
||||
|
||||
// put the dials at 0
|
||||
ones = 0;
|
||||
tens = 0;
|
||||
|
||||
tens_model RotateRoll( step, 0.05 );
|
||||
ones_model RotateRoll( step, 0.05 );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
wait( 1 );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
num_players = get_players().size;
|
||||
|
||||
dial = ones + ( tens * 10 );
|
||||
|
||||
if ( num_players < dial )
|
||||
{
|
||||
ones--;
|
||||
time = set_dvar_float_if_unset( "scr_dial_rotate_time", "0.5" );
|
||||
|
||||
if ( ones < 0 )
|
||||
{
|
||||
ones = 9;
|
||||
tens_model RotateRoll( 0 - step, time );
|
||||
tens--;
|
||||
}
|
||||
|
||||
ones_model RotateRoll( 0 - step, time );
|
||||
ones_model waittill( "rotatedone" );
|
||||
}
|
||||
else if ( num_players > dial )
|
||||
{
|
||||
ones++;
|
||||
time = set_dvar_float_if_unset( "scr_dial_rotate_time", "0.5" );
|
||||
|
||||
if ( ones > 9 )
|
||||
{
|
||||
ones = 0;
|
||||
tens_model RotateRoll( step, time );
|
||||
tens++;
|
||||
}
|
||||
|
||||
ones_model RotateRoll( step, time );
|
||||
ones_model waittill( "rotatedone" );
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nuked_doomsday_clock_init()
|
||||
{
|
||||
min_hand_model = GetEnt( "clock_min_hand", "targetname" );
|
||||
sec_hand_model = GetEnt( "clock_sec_hand", "targetname" );
|
||||
|
||||
start_angle = 318;
|
||||
|
||||
min_hand_model RotatePitch( start_angle, 0.05 );
|
||||
min_hand_model waittill( "rotatedone" );
|
||||
|
||||
if ( level.timelimit > 0 )
|
||||
{
|
||||
min_hand_model RotatePitch( 360 - start_angle, level.timelimit * 60 );
|
||||
sec_hand_model RotatePitch( 360 * level.timelimit, level.timelimit * 60 );
|
||||
}
|
||||
else
|
||||
{
|
||||
sec_hand_model thread nuked_doomsday_clock_seconds_think();
|
||||
}
|
||||
}
|
||||
|
||||
nuked_doomsday_clock_seconds_think()
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
self RotatePitch( 360, 60 );
|
||||
self waittill( "rotatedone" );
|
||||
}
|
||||
}
|
||||
|
||||
/#
|
||||
nuked_bomb_drop_dev()
|
||||
{
|
||||
bomb = GetEnt( "nuked_bomb", "targetname" );
|
||||
bomb_origin = bomb.origin;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
level waittill( "bomb_reset" );
|
||||
bomb.origin = bomb_origin;
|
||||
|
||||
player = getHostPlayer();
|
||||
player CameraActivate( false );
|
||||
VisionSetNaked( "mp_nuked", 0 );
|
||||
}
|
||||
}
|
||||
|
||||
devgui_nuked( cmd )
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
wait( 0.5 );
|
||||
|
||||
devgui_string = GetDvar( #"devgui_notify" );
|
||||
|
||||
switch( devgui_string )
|
||||
{
|
||||
case "":
|
||||
break;
|
||||
|
||||
case "warp_to_bomb":
|
||||
player = getHostPlayer();
|
||||
AddDebugCommand( "noclip" );
|
||||
player SetOrigin( ( 3969, 8094, 1052 ) );
|
||||
player SetPlayerAngles( ( -19, 94, 0 ) );
|
||||
break;
|
||||
|
||||
default:
|
||||
level notify( devgui_string );
|
||||
break;
|
||||
}
|
||||
|
||||
SetDvar( "devgui_notify", "" );
|
||||
}
|
||||
}
|
||||
#/
|
852
mods/mp_patch/maps/mp/mp_radiation.gsc
Normal file
852
mods/mp_patch/maps/mp/mp_radiation.gsc
Normal file
@ -0,0 +1,852 @@
|
||||
#include maps\mp\_utility;
|
||||
#include common_scripts\utility;
|
||||
|
||||
|
||||
main()
|
||||
{
|
||||
precachemodel("tag_origin");
|
||||
|
||||
/#
|
||||
level thread devgui_radiation();
|
||||
execdevgui("devgui_mp_radiation");
|
||||
#/
|
||||
|
||||
//needs to be first for create fx
|
||||
maps\mp\mp_radiation_fx::main();
|
||||
|
||||
precachemodel("collision_geo_64x64x256");
|
||||
precachemodel("collision_wall_128x128x10");
|
||||
precachemodel("collision_geo_256x256x10");
|
||||
|
||||
|
||||
maps\mp\_load::main();
|
||||
|
||||
maps\mp\mp_radiation_amb::main();
|
||||
if ( GetDvarInt( #"xblive_wagermatch" ) == 1 )
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_radiation_wager");
|
||||
}
|
||||
else
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_radiation");
|
||||
}
|
||||
|
||||
|
||||
//Increase sample size so as to resolve lighting issue
|
||||
SetDvar("sm_sunSampleSizeNear", ".5" );
|
||||
|
||||
// If the team nationalites change in this file,
|
||||
// you must update the team nationality in the level's csc file as well!
|
||||
maps\mp\gametypes\_teamset_urbanspecops::level_init();
|
||||
|
||||
// Set up the default range of the compass
|
||||
setdvar("compassmaxrange","2100");
|
||||
|
||||
// COLLISION - to prevent players from placing turrets inside a large cylinder brush in the tank room
|
||||
spawncollision("collision_geo_64x64x256","collider",(1221, 41, 236), (0, 0, 0));
|
||||
|
||||
// COLLISION - to prevent players from jumping onto a little ledge of collision
|
||||
spawncollision("collision_wall_128x128x10","collider",(1042, -309, 309), (0, 0, 0));
|
||||
spawncollision("collision_wall_128x128x10","collider",(1080, -309, 309), (0, 0, 0));
|
||||
|
||||
// COLLISION - to prevent players from dropping turrets in the large grey tanks by the warehouse
|
||||
spawncollision("collision_geo_64x64x256","collider",(568, 219, 264), (0, 0, 0));
|
||||
spawncollision("collision_geo_64x64x256","collider",(567, -105, 264), (0, 0, 0));
|
||||
|
||||
// COLLISION - to prevent players dropping off the catwalk onto ledge in warehouse
|
||||
spawncollision("collision_wall_128x128x10","collider",(1157, -345, 186), (0, 270, 0));
|
||||
spawncollision("collision_wall_128x128x10","collider",(1157, -345, 314), (0, 270, 0));
|
||||
spawncollision("collision_wall_128x128x10","collider",(1157, -345, 442), (0, 270, 0));
|
||||
|
||||
//NOTURRET - spawns radius triggers to stop players from placing turrets in the large cylinders in the NE corner of the map
|
||||
addNoTurretTrigger((1440, -1116, 145), 230, 256);
|
||||
addNoTurretTrigger((1446, -1659, 145), 230, 256);
|
||||
|
||||
|
||||
|
||||
// enable new spawning system
|
||||
maps\mp\gametypes\_spawning::level_use_unified_spawning(true);
|
||||
|
||||
flag_init_func();
|
||||
|
||||
level_objects_init();
|
||||
|
||||
}
|
||||
|
||||
flag_init_func()
|
||||
{
|
||||
flag_init("kill_stuck_players");
|
||||
}
|
||||
|
||||
level_objects_init()
|
||||
{
|
||||
level._digger_fx = LoadFX( "maps/mp_maps/fx_mp_sand_digger_radiation" );
|
||||
waittillframeend;
|
||||
level._door_switch_trig1 = getent_and_assert("switch_trigger1");
|
||||
level._door_switch_trig2 = getent_and_assert("switch_trigger2");
|
||||
|
||||
level._door1 = getent_and_assert("big_door1_clip");
|
||||
level._door2 = getent_and_assert("big_door2_clip");
|
||||
|
||||
level.const_fx_exploder_switch_green_light = 2001;
|
||||
level.const_fx_exploder_switch_red_light = 2002;
|
||||
|
||||
//Gets some diggers digging
|
||||
level thread digger_dig_init();
|
||||
|
||||
//Gets diggers in the background moving
|
||||
moving_diggers_init();
|
||||
|
||||
//Sets up the switchs players can flip to open the double doors
|
||||
level thread door_switch_func();
|
||||
|
||||
if( !level.wagerMatch && !isPregame() )
|
||||
{
|
||||
//get my doors opening at the start of the match
|
||||
level thread double_doors_open_at_start();
|
||||
}
|
||||
|
||||
//Get conveyer belt working
|
||||
level thread conveyer_belt_init();
|
||||
}
|
||||
|
||||
turnSwitchPanelRed()
|
||||
{
|
||||
exploder_stop( level.const_fx_exploder_switch_green_light );
|
||||
exploder( level.const_fx_exploder_switch_red_light );
|
||||
}
|
||||
|
||||
turnSwitchPanelGreen()
|
||||
{
|
||||
exploder_stop( level.const_fx_exploder_switch_red_light );
|
||||
exploder( level.const_fx_exploder_switch_green_light );
|
||||
}
|
||||
|
||||
//Sets it up so a player can flip a switch and open large double doors
|
||||
door_switch_func()
|
||||
{
|
||||
//Set up the use trigger switches that activate my double doors
|
||||
level._door_switch_trig1 thread door_switch_setup();
|
||||
level._door_switch_trig2 thread door_switch_setup();
|
||||
|
||||
//Cooldown switches inform the player that the door switch is on cooldown if they try to interact with it
|
||||
cooldown_switches = GetEntArray("off_trigger","targetname");
|
||||
AssertEx( cooldown_switches.size > 0, "Missing off_triggers");
|
||||
|
||||
for( i = 0; i < cooldown_switches.size; i++)
|
||||
{
|
||||
cooldown_switches[i] UseTriggerRequireLookAt();
|
||||
cooldown_switches[i] SetCursorHint( "HINT_NOICON" );
|
||||
cooldown_switches[i] SetHintString( &"MP_HOLD_DOOR_SWITCH_UNAVAILABLE");
|
||||
cooldown_switches[i] trigger_off();
|
||||
}
|
||||
|
||||
turnSwitchPanelRed();
|
||||
|
||||
kill_trig1 = getent_and_assert("edge_death_trig1");
|
||||
kill_trig2 = getent_and_assert("edge_death_trig2");
|
||||
center_death_trig = getent_and_assert("center_death_trig");
|
||||
|
||||
//Set up DVARS for tweaking door opening sequence
|
||||
d1_new_angle = set_dvar_int_if_unset("scr_d1_new_angle", "123");
|
||||
d2_new_angle = set_dvar_int_if_unset("scr_d2_new_angle", "-123");
|
||||
|
||||
door_model1 = getent_and_assert("big_door1");
|
||||
door_model2 = getent_and_assert("big_door2");
|
||||
|
||||
door_model1 LinkTo(level._door1);
|
||||
door_model2 LinkTo(level._door2);
|
||||
|
||||
door_monster_clip = GetEnt("door_monster_clip","targetname");
|
||||
|
||||
//door_monster_clip thread dog_kill();
|
||||
|
||||
//snd_door_status tracks if the door is open or closed
|
||||
snd_door_status = 0;
|
||||
|
||||
light_structs = getstructarray("switch_struct","targetname");
|
||||
AssertEx( light_structs.size > 0, "Missing light structs");
|
||||
|
||||
for( i = 0; i < light_structs.size; i++)
|
||||
{
|
||||
light_structs[i] thread switch_lights(i);
|
||||
}
|
||||
|
||||
tunnel_structs = getstructarray("tunnel_light_spot","targetname");
|
||||
AssertEx(tunnel_structs.size > 0, "Missing light structs");
|
||||
|
||||
for( i = 0; i < light_structs.size; i++)
|
||||
{
|
||||
tunnel_structs[i] thread tunnel_lights(i);
|
||||
}
|
||||
|
||||
while(!level.wagermatch)
|
||||
{
|
||||
//This is a switch in the level on the catwalk
|
||||
waittill_any_ents(level._door_switch_trig1,"trigger",level._door_switch_trig2,"trigger");
|
||||
|
||||
//Disables the switch temporarily
|
||||
level._door_switch_trig1 trigger_off();
|
||||
level._door_switch_trig2 trigger_off();
|
||||
|
||||
for( i = 0; i < cooldown_switches.size; i++)
|
||||
{
|
||||
cooldown_switches[i] trigger_on();
|
||||
}
|
||||
|
||||
//Set up DVARS for tweaking door opening sequence. Acceleration and decelation variation added for realistic offset.
|
||||
door_time = set_dvar_int_if_unset("scr_d1_time", "8");
|
||||
|
||||
//The doors have specific accelleration and deceleration values so as give an organic-looking timing offset.
|
||||
//When the doors are opening, we want Door 2 to accelerate slightly faster so as to avoid clipping.
|
||||
if(snd_door_status == 0)
|
||||
{
|
||||
d1_accel = door_time * .6;
|
||||
d2_accel = door_time * .7;
|
||||
|
||||
d1_decel = door_time * .4;
|
||||
d2_decel = door_time * .3;
|
||||
|
||||
//Monster clip is placed and path nodes are severed to keep dogs from running on the doors
|
||||
door_monster_clip trigger_on();
|
||||
door_monster_clip DisconnectPaths();
|
||||
}
|
||||
//When the doors are closing, we want Door 1 to accelerate slightly faster so as to avoid clipping.
|
||||
else
|
||||
{
|
||||
d1_accel = door_time * .7;
|
||||
d2_accel = door_time * .6;
|
||||
|
||||
d1_decel = door_time * .3;
|
||||
d2_decel = door_time * .4;
|
||||
}
|
||||
|
||||
door_cooldown = set_dvar_int_if_unset("scr_door_cooldown", "20");
|
||||
|
||||
level._door1 RotateRoll(d1_new_angle, door_time, d1_accel, d1_decel);
|
||||
level._door2 RotateRoll(d2_new_angle, door_time, d2_accel, d2_decel);
|
||||
|
||||
thread dropEverythingOnDoorsToGround();
|
||||
level thread destroyEquipment();
|
||||
|
||||
// Play door opening sound
|
||||
level._door1 playloopsound ("evt_hydraulic_loop", .5);
|
||||
level._door1 playsound ("evt_hydraulic_start");
|
||||
level._door1 thread door_snd_alarm ( 5 );
|
||||
|
||||
//This sets it so my doors move in reverse next time they're activated
|
||||
d1_new_angle = d1_new_angle * -1;
|
||||
d2_new_angle = d1_new_angle * -1;
|
||||
|
||||
//Flag marks the period of time i'm checking for any player caught in moving collision
|
||||
flag_set("kill_stuck_players");
|
||||
|
||||
//Give time for doors to move a moderate amount before starts kill trigger
|
||||
wait 4;
|
||||
|
||||
//Only want to kill players if doors are closing
|
||||
if(snd_door_status == 1)
|
||||
{
|
||||
//These are three seperate trigger brushes I want to check for stuck players
|
||||
kill_trig1 thread kill_edge_players_func();
|
||||
kill_trig2 thread kill_edge_players_func();
|
||||
center_death_trig thread kill_edge_players_func();
|
||||
}
|
||||
level._door1 waittill("rotatedone");
|
||||
|
||||
//snd_door_status tracks if the door is currently open or closed for seprate open and close audio
|
||||
if (snd_door_status == 0)
|
||||
{
|
||||
//stops the move loop, plays endind sound, and set current door status
|
||||
level._door1 stoploopsound (1);
|
||||
center_death_trig playsound ("evt_hydraulic_open");
|
||||
snd_door_status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
//stops the move loop, plays endind sound, and set current door status
|
||||
level._door1 stoploopsound (1);
|
||||
center_death_trig playsound ("evt_hydraulic_close");
|
||||
|
||||
//Clip is removed so dogs can path
|
||||
door_monster_clip ConnectPaths();
|
||||
door_monster_clip trigger_off();
|
||||
snd_door_status = 0;
|
||||
}
|
||||
|
||||
flag_clear("kill_stuck_players");
|
||||
|
||||
//Special notify to end my check for players caught on collision
|
||||
level notify ("edge_check");
|
||||
|
||||
wait (door_cooldown);
|
||||
level notify ("no_cooldown");
|
||||
|
||||
for( i = 0; i < cooldown_switches.size; i++)
|
||||
{
|
||||
cooldown_switches[i] trigger_off();
|
||||
}
|
||||
|
||||
level._door_switch_trig1 trigger_on();
|
||||
level._door_switch_trig2 trigger_on();
|
||||
}
|
||||
}
|
||||
door_snd_alarm ( alarmTimes )
|
||||
{
|
||||
|
||||
for (i=0; i < alarmTimes; i++)
|
||||
{
|
||||
wait (.5);
|
||||
|
||||
playsoundatposition("amb_alarm_buzz",(-664,110,436));
|
||||
|
||||
playsoundatposition("amb_alarm_buzz",(-664,-72,436));
|
||||
|
||||
playsoundatposition("amb_alarm_buzz",(-666,-602,436));
|
||||
|
||||
playsoundatposition("amb_alarm_buzz",(-666,660,444));
|
||||
|
||||
wait (1.5);
|
||||
}
|
||||
}
|
||||
//Self is the use triggers that activate the double doors
|
||||
door_switch_setup()
|
||||
{
|
||||
self usetriggerrequirelookat();
|
||||
if ( level.wagerMatch )
|
||||
{
|
||||
self SetHintString(&"MP_HOLD_DOOR_SWITCH_UNAVAILABLE");
|
||||
turnSwitchPanelRed();
|
||||
}
|
||||
else
|
||||
{
|
||||
self SetHintString(&"MP_HOLD_TO_OPERATE_DOORS");
|
||||
turnSwitchPanelGreen();
|
||||
}
|
||||
|
||||
while ( !level.wagerMatch )
|
||||
{
|
||||
// self is the switch. who is the player that triggered switch
|
||||
self waittill("trigger", who);
|
||||
|
||||
//Added "if" check for when the doors are triggered without a player -Leif
|
||||
if(IsDefined( who ))
|
||||
{
|
||||
who playsound ("evt_hydraulic_switch");
|
||||
}
|
||||
|
||||
wait (1);
|
||||
}
|
||||
}
|
||||
|
||||
//Self is a trigger. The triggers are placed in places i'm afraid of players getting caught
|
||||
kill_edge_players_func()
|
||||
{
|
||||
level endon ("edge_check");
|
||||
|
||||
//This only loops while the doors are moving
|
||||
while(1)
|
||||
{
|
||||
self waittill("trigger", player);
|
||||
|
||||
if((player IsTouching(level._door1)) || (player IsTouching(level._door2)))
|
||||
{
|
||||
player DoDamage(player.health * 2, self.origin, player, player, 0, "MOD_SUICIDE" );
|
||||
// TODO: add crushing audio. CDC
|
||||
}
|
||||
else
|
||||
{
|
||||
wait .05;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TO DO: Review this function for multiplayer API improvements.
|
||||
//'Self' is the struct within the panel that operates the double doors
|
||||
switch_lights( element_number )
|
||||
{
|
||||
if ( level.PrematchPeriod > 0 && level.inPrematchPeriod == true )
|
||||
{
|
||||
level waittill("prematch_over");
|
||||
}
|
||||
|
||||
while(1)
|
||||
{
|
||||
effect_ent = Spawn("script_model", self.origin);
|
||||
effect_ent SetModel("tag_origin");
|
||||
|
||||
//This wait is necesary to get the effect to work on the newly created script model.
|
||||
wait .1;
|
||||
|
||||
//Green light signals the switch is not on cooldown
|
||||
turnSwitchPanelGreen();
|
||||
//PlayFXOnTag(level._effect["green_light"], effect_ent,"tag_origin" );
|
||||
|
||||
waittill_any_ents(level._door_switch_trig1,"trigger",level._door_switch_trig2,"trigger");
|
||||
|
||||
//This function is array threaded, so we must prevent FX from playing in the same frame using this loop
|
||||
for (i = 0; i < element_number; i++)
|
||||
{
|
||||
wait .1;
|
||||
}
|
||||
|
||||
effect_ent Delete();
|
||||
|
||||
blinky_effect_ent = Spawn("script_model", self.origin);
|
||||
blinky_effect_ent SetModel("tag_origin");
|
||||
|
||||
//This wait is necesary to get the effect to work on the newly created script model.
|
||||
wait .1;
|
||||
|
||||
//Blink red light signals the double doors are moving
|
||||
turnSwitchPanelRed();
|
||||
//PlayFXOnTag(level._effect["blink_light"], blinky_effect_ent,"tag_origin" );
|
||||
|
||||
//This notify signals that the doors have stopped moving
|
||||
level waittill ("edge_check");
|
||||
|
||||
for (i = 0; i < element_number; i++)
|
||||
{
|
||||
wait .1;
|
||||
}
|
||||
|
||||
blinky_effect_ent Delete();
|
||||
|
||||
final_effect_ent = Spawn("script_model", self.origin);
|
||||
final_effect_ent SetModel("tag_origin");
|
||||
|
||||
//This wait is necesary to get the effect to work on the newly created script model.
|
||||
wait .1;
|
||||
|
||||
//Red light signals the switch cannot be used
|
||||
//PlayFXOnTag(level._effect["red_light"], final_effect_ent,"tag_origin" );
|
||||
|
||||
//This notify signals that the doors have stopped moving
|
||||
level waittill ("no_cooldown");
|
||||
|
||||
for (i = 0; i < element_number; i++)
|
||||
{
|
||||
wait .1;
|
||||
}
|
||||
|
||||
final_effect_ent Delete();
|
||||
}
|
||||
}
|
||||
|
||||
//'Self' is the struct within the light bulbs in the Radiation tunnel. This function manages FX in the tunnel
|
||||
//'Element number' is equal to self's index number in the array that got array threaded.
|
||||
tunnel_lights(element_number)
|
||||
{
|
||||
door_closed = true;
|
||||
|
||||
while(1)
|
||||
{
|
||||
//Must define may variable to avoid SRE
|
||||
effect_ent = undefined;
|
||||
|
||||
//When door is closed, play "solid" tunnel light effect
|
||||
if(door_closed)
|
||||
{
|
||||
effect_ent = Spawn("script_model", self.origin);
|
||||
effect_ent SetModel("tag_origin");
|
||||
|
||||
//Must wait a moment for the script model to finish spawning
|
||||
wait .1;
|
||||
|
||||
PlayFXOnTag(level._effect["green_light"], effect_ent,"tag_origin" );
|
||||
}
|
||||
|
||||
//Wait until a tunnel double door switch is hit
|
||||
waittill_any_ents(level._door_switch_trig1,"trigger",level._door_switch_trig2,"trigger");
|
||||
|
||||
//This loop makes sure effects do not happen in the same frame, as this function has been array threaded to multiple ents.
|
||||
for (i = 0; i < element_number; i++)
|
||||
{
|
||||
wait .1;
|
||||
}
|
||||
|
||||
//'New effect' is the blinking lights that occur while the double doors are moving
|
||||
new_effect_ent = Spawn("script_model", self.origin);
|
||||
new_effect_ent SetModel("tag_origin");
|
||||
|
||||
if(IsDefined(effect_ent))
|
||||
{
|
||||
effect_ent Delete();
|
||||
}
|
||||
|
||||
//Must wait a moment for the script model to finish spawning
|
||||
wait .1;
|
||||
|
||||
PlayFXOnTag(level._effect["blink_light"], new_effect_ent,"tag_origin" );
|
||||
|
||||
level waittill ("edge_check");
|
||||
|
||||
for (i = 0; i < element_number; i++)
|
||||
{
|
||||
wait .1;
|
||||
}
|
||||
|
||||
new_effect_ent Delete();
|
||||
|
||||
if(!door_closed)
|
||||
{
|
||||
door_closed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
door_closed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Open doors at start
|
||||
double_doors_open_at_start()
|
||||
{
|
||||
//Set up the double doors to open at the start of the match
|
||||
if ( level.PrematchPeriod > 0 && level.inPrematchPeriod == true )
|
||||
{
|
||||
level waittill("prematch_over");
|
||||
}
|
||||
|
||||
|
||||
//Slow down my door for other functions to hit waittil's
|
||||
wait .3;
|
||||
|
||||
//Note I didn't use the "useby player[0]" convention due to a hesitance to grab specific players in MP.
|
||||
level._door_switch_trig1 notify ("trigger");
|
||||
}
|
||||
|
||||
//Set up the devgui to have the ability to operate the doors, adjust door cooldown, rotate times, digger behavior, etc.
|
||||
devgui_radiation(cmd)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
wait(0.5);
|
||||
|
||||
devgui_string = GetDvar( #"devgui_notify");
|
||||
|
||||
switch(devgui_string)
|
||||
{
|
||||
case "":
|
||||
break;
|
||||
|
||||
case "operate_doors":
|
||||
level._door_switch_trig1 notify ("trigger");
|
||||
break;
|
||||
|
||||
default:
|
||||
level notify(devgui_string);
|
||||
break;
|
||||
}
|
||||
|
||||
SetDvar("devgui_notify", "");
|
||||
}
|
||||
}
|
||||
|
||||
//*****TO DO: MOVE DIGGER FUNCTIONALITY CLIENT SIDE.*********
|
||||
|
||||
//Sets it up so I can handle multiple diggers doing a digging action
|
||||
digger_dig_init()
|
||||
{
|
||||
diggers = GetEntArray("digger_body","targetname");
|
||||
AssertEx( diggers.size > 0, "Unable to find entity with targetname 'digger_body'" );
|
||||
array_thread(diggers,::digger_dig_think);
|
||||
}
|
||||
|
||||
//Self is the digger's body entity. Function creates a series of movements for the diggers to create a digging behavior
|
||||
digger_dig_think()
|
||||
{
|
||||
body = self;
|
||||
arm = GetEnt(self.target, "targetname");
|
||||
AssertEx(IsDefined(arm), "Unable to find arm entity for a digger at " + self.origin );
|
||||
blade_center = GetEnt(arm.target, "targetname");
|
||||
AssertEx(IsDefined(blade_center), "Unable to find blade entity for a digger at " + self.origin );
|
||||
|
||||
blade_pieces = GetEntArray("digger_blade","targetname");
|
||||
|
||||
for( i = 0; i < blade_pieces.size; i++)
|
||||
{
|
||||
blade_pieces[i] LinkTo(blade_center);
|
||||
}
|
||||
|
||||
blade_center LinkTo( arm );
|
||||
arm LinkTo( body );
|
||||
|
||||
//play idle sound on body
|
||||
body playloopsound ("evt_excavator_idle", .5);
|
||||
|
||||
if(IsDefined(self.script_float))
|
||||
{
|
||||
set_dvar_int_if_unset("scr_dig_delay", self.script_float );
|
||||
}
|
||||
else
|
||||
{
|
||||
//'20' is the default value for the cooldown on the digger's dig action
|
||||
set_dvar_int_if_unset("scr_dig_delay", 20 );
|
||||
}
|
||||
|
||||
while(1)
|
||||
{
|
||||
arm_move_speed = set_dvar_int_if_unset("scr_arm_move_speed", 11);
|
||||
blade_spin_speed = set_dvar_int_if_unset("scr_blade_spin_speed", 80);
|
||||
blade_spin_up_time = set_dvar_int_if_unset("scr_blade_spin_up_time", 3);
|
||||
|
||||
body_turn = RandomIntRange(-15,15);
|
||||
//Must grab the absolute value of the turn value to get proper time fraction, which is the "positive_value_func"
|
||||
body_turn_speed = (positive_value_func(body_turn)) * .3;
|
||||
|
||||
body RotateYaw(body_turn, body_turn_speed, body_turn_speed/4, body_turn_speed/4 );
|
||||
|
||||
// play move loop on arm, and rev one shot on body
|
||||
arm playloopsound ("evt_excavator_move", .5);
|
||||
body playsound ("evt_excavator_rev");
|
||||
|
||||
body waittill ("rotatedone");
|
||||
|
||||
arm Unlink(body);
|
||||
arm RotatePitch(-45, arm_move_speed, arm_move_speed/4, arm_move_speed/4);
|
||||
arm waittill ("rotatedone");
|
||||
|
||||
blade_center UnLink(arm);
|
||||
blade_center RotatePitch(1800, blade_spin_speed, blade_spin_up_time, blade_spin_up_time);
|
||||
smokeAngles = ( 0, arm.angles[1]+180, arm.angles[2] );
|
||||
|
||||
forward = anglesToForward( smokeAngles );
|
||||
|
||||
//playfx ( level.chopper_fx["explode"]["death"], self.origin, forward );
|
||||
PlayFX( level._digger_fx, ( blade_center.origin[0], blade_center.origin[1], blade_center.origin[2]-560), forward );
|
||||
//stop loop on arm
|
||||
//iprintlnbold ("this is the stop I suspect"); //had to comment this out for playtest. -Leif
|
||||
arm stoploopsound (1);
|
||||
|
||||
// play digging loop on blade
|
||||
blade_center playloopsound ("evt_excavator_blade", .5);
|
||||
|
||||
blade_center waittill ("rotatedone");
|
||||
|
||||
// stop diggin loop blade
|
||||
blade_center stoploopsound (.5);
|
||||
|
||||
blade_center LinkTo(arm);
|
||||
|
||||
arm RotatePitch(45, arm_move_speed, arm_move_speed/4, arm_move_speed/4 );
|
||||
|
||||
// play move loop on arm, and rev one shot on body
|
||||
arm playloopsound ("evt_excavator_move", .5);
|
||||
body playsound ("evt_excavator_rev");
|
||||
|
||||
arm waittill ("rotatedone");
|
||||
arm LinkTo( body );
|
||||
|
||||
body RotateYaw((body_turn * -1), body_turn_speed, body_turn_speed/4, body_turn_speed/4);
|
||||
|
||||
body waittill ("rotatedone");
|
||||
arm stoploopsound (.5);
|
||||
|
||||
wait (GetDvarFloat( #"scr_dig_delay" ));
|
||||
}
|
||||
}
|
||||
|
||||
//Sets it up so the script can easily handle multiple moving diggers
|
||||
moving_diggers_init()
|
||||
{
|
||||
diggers = GetEntArray("moving_digger","targetname");
|
||||
//AssertEx( diggers.size > 0, "Unable to find entity with targetname 'moving_digger'" );
|
||||
array_thread(diggers, ::moving_diggers_think);
|
||||
}
|
||||
|
||||
//Sets up diggers that follow structs. Note the script_int K/V pair sets up the move time.
|
||||
moving_diggers_think()
|
||||
{
|
||||
digger_struct = getstruct_and_assert(self.target);
|
||||
|
||||
while(1)
|
||||
{
|
||||
//Each struct has a script_int key value pair that determines the length of time it takes to complete the move
|
||||
self MoveTo(digger_struct.origin, digger_struct.script_int);
|
||||
AssertEx(IsDefined(digger_struct.script_int), "Unable to find digger struct's 'script_int' key value pair for moving digger" );
|
||||
|
||||
self waittill("movedone");
|
||||
|
||||
//Structs target other structs to determine the digger's path.
|
||||
if(IsDefined(digger_struct.target))
|
||||
{
|
||||
digger_struct = GetStruct(digger_struct.target,"targetname");
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Function needed to get the absolute value of an integer and be sure its a positive number
|
||||
positive_value_func(num)
|
||||
{
|
||||
return(max(1, abs(num)));
|
||||
}
|
||||
|
||||
//Starts a thread to alter player's velocity as long as they're in the trigger
|
||||
conveyer_belt_init()
|
||||
{
|
||||
//Need to set dvar to determine force of momentum in trigger
|
||||
set_dvar_int_if_unset( "scr_coveyer_speed", 45 );
|
||||
|
||||
conveyer_trigger = getent_and_assert("coveyer_trig");
|
||||
|
||||
//The trigger targets a script struct. The struct contains angles to determine the force direction.
|
||||
trigger_struct = getstruct_and_assert(conveyer_trigger.target);
|
||||
|
||||
//Find direction that my trigger is pointed toward
|
||||
trigger_angles = AnglesToForward(trigger_struct.angles);
|
||||
|
||||
//Create intensity of conveyer force equal to my script DVar. Store it on my trigger for a seperate function to use.
|
||||
conveyer_trigger._conveyer_vector = vector_scale(trigger_angles,GetDvarInt( #"scr_coveyer_speed"));
|
||||
|
||||
while(1)
|
||||
{
|
||||
conveyer_trigger waittill("trigger", player);
|
||||
if(IsPlayer(player))
|
||||
{
|
||||
conveyer_trigger thread trigger_thread(player, ::player_on_conveyer);
|
||||
}
|
||||
|
||||
wait .05;
|
||||
}
|
||||
}
|
||||
|
||||
//Self is trigger. Function is ran when player jumps into the trigger.
|
||||
player_on_conveyer(player, endon_string)
|
||||
{
|
||||
player endon ("death");
|
||||
player endon ("disconnect");
|
||||
player endon(endon_string);
|
||||
|
||||
while(1)
|
||||
{
|
||||
player_velocity = player GetVelocity();
|
||||
|
||||
//Don't want jumping player to be pulled by conveyer
|
||||
if (player IsOnGround())
|
||||
{
|
||||
//Gives player momentum in the direction of the conveyer equal to a dvar I created earlier along with their own momentum
|
||||
player SetVelocity(player_velocity + self._conveyer_vector);
|
||||
}
|
||||
|
||||
wait .05;
|
||||
}
|
||||
}
|
||||
|
||||
getent_and_assert(ent_name)
|
||||
{
|
||||
thing = GetEnt( ent_name, "targetname");
|
||||
AssertEx(IsDefined(thing), "Unable to find targetname " + ent_name);
|
||||
|
||||
return thing;
|
||||
}
|
||||
|
||||
getstruct_and_assert(struct_name)
|
||||
{
|
||||
thing = getstruct( struct_name, "targetname");
|
||||
AssertEx(IsDefined(thing), "Unable to find struct at " +struct_name);
|
||||
|
||||
return thing;
|
||||
}
|
||||
|
||||
dropEverythingOnDoorsToGround()
|
||||
{
|
||||
level endon("edge_check");
|
||||
|
||||
// keep dropping all to ground to keep the items in physics
|
||||
// if you only do it once or twice they come back to rest to fast
|
||||
// if there is a problem with this solution then we are going to need
|
||||
// to do something for keeping the crates in physics while in contact
|
||||
// with the doors.
|
||||
while(1)
|
||||
{
|
||||
wait(0.1);
|
||||
dropAllToGround( (0,0,128), 181, 100 );
|
||||
}
|
||||
}
|
||||
|
||||
destroyEquipment()
|
||||
{
|
||||
level endon ( "edge_check" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
wait( 2 );
|
||||
|
||||
grenades = GetEntArray( "grenade", "classname" );
|
||||
|
||||
for ( i = 0; i < grenades.size; i++ )
|
||||
{
|
||||
item = grenades[i];
|
||||
|
||||
if ( !IsDefined( item.name ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !IsDefined( item.owner ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !IsWeaponEquipment( item.name ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !item IsTouching( level._door1 ) && !item IsTouching( level._door2 ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
watcher = item.owner getWatcherForWeapon( item.name );
|
||||
|
||||
if ( !IsDefined( watcher ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
watcher thread maps\mp\gametypes\_weaponobjects::waitAndDetonate( item, 0.0, undefined );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getWatcherForWeapon( weapname )
|
||||
{
|
||||
if ( !IsDefined( self ) )
|
||||
{
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if ( !IsPlayer( self ) )
|
||||
{
|
||||
return undefined;
|
||||
}
|
||||
|
||||
for ( i = 0; i < self.weaponObjectWatcherArray.size; i++ )
|
||||
{
|
||||
if ( self.weaponObjectWatcherArray[i].weapon != weapname )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
return ( self.weaponObjectWatcherArray[i] );
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
//spawns triggers to stop players from placing turrets
|
||||
addNoTurretTrigger( position, radius, height )
|
||||
{
|
||||
while( !IsDefined( level.noTurretPlacementTriggers ) )
|
||||
wait( 0.1 );
|
||||
|
||||
trigger = Spawn( "trigger_radius", position, 0, radius, height );
|
||||
|
||||
level.noTurretPlacementTriggers[level.noTurretPlacementTriggers.size] = trigger;
|
||||
}
|
139
mods/mp_patch/maps/mp/mp_russianbase.gsc
Normal file
139
mods/mp_patch/maps/mp/mp_russianbase.gsc
Normal file
@ -0,0 +1,139 @@
|
||||
#include maps\mp\_utility;
|
||||
main()
|
||||
{
|
||||
//needs to be first for create fx
|
||||
maps\mp\mp_russianbase_fx::main();
|
||||
|
||||
precachemodel("collision_geo_32x32x128");
|
||||
precachemodel("collision_wall_256x256x10");
|
||||
|
||||
maps\mp\_load::main();
|
||||
|
||||
maps\mp\mp_russianbase_amb::main();
|
||||
|
||||
if ( GetDvarInt( #"xblive_wagermatch" ) == 1 )
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_russianbase_wager");
|
||||
}
|
||||
else
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_russianbase");
|
||||
}
|
||||
|
||||
// If the team nationalites change in this file,
|
||||
// you must update the team nationality in the level's csc file as well!
|
||||
maps\mp\gametypes\_teamset_winterspecops::level_init();
|
||||
|
||||
// Set up the default range of the compass
|
||||
setdvar("compassmaxrange","2100");
|
||||
|
||||
// enable new spawning system
|
||||
maps\mp\gametypes\_spawning::level_use_unified_spawning(true);
|
||||
|
||||
//fog
|
||||
//setExpFog(200, 6000, 0.7, 0.7, 0.73, 0);
|
||||
|
||||
/#
|
||||
level thread devgui_russianbase();
|
||||
execdevgui( "devgui_mp_russianbase" );
|
||||
#/
|
||||
|
||||
|
||||
// spawn collision for hole in wall between E2 and E3
|
||||
spawncollision("collision_wall_256x256x10","collider",(-1731, 960, 288), (0, 270, 0));
|
||||
|
||||
|
||||
// spawn collision for the new telephone pole
|
||||
spawncollision("collision_geo_32x32x128","collider",(-120, 1828, 63), (0, 0, 0));
|
||||
|
||||
//spawn a new set of windows in front of the missing ones for PS3
|
||||
|
||||
window1 = Spawn("script_model", (-2116, 0, 504) );
|
||||
if ( IsDefined(window1) )
|
||||
{
|
||||
window1.angles = (0,0,0);
|
||||
window1 SetModel("p_rus_window_dark01");
|
||||
}
|
||||
|
||||
window2 = Spawn("script_model", (-1878, 0, 504) );
|
||||
if ( IsDefined(window2) )
|
||||
{
|
||||
window2.angles = (0,0,0);
|
||||
window2 SetModel("p_rus_window_dark01");
|
||||
}
|
||||
|
||||
//spawn a new telephone pole
|
||||
|
||||
pole1 = Spawn("script_model", (-114.081, 1821.35, -10) );
|
||||
if ( IsDefined(pole1) )
|
||||
{
|
||||
pole1.angles = (0, 15.2, 0);
|
||||
pole1 SetModel("p_rus_electricpole");
|
||||
}
|
||||
|
||||
|
||||
|
||||
level thread runTrain();
|
||||
}
|
||||
|
||||
runTrain()
|
||||
{
|
||||
level endon( "game_ended" );
|
||||
precacheModel("t5_veh_train_boxcar");
|
||||
precacheModel("t5_veh_train_fuelcar");
|
||||
precacheModel("t5_veh_train_engine");
|
||||
|
||||
// if you change moveTime of numOfCarts you need to change it in client script also
|
||||
moveTime = 20;
|
||||
numOfCarts = 40;
|
||||
originalRation = ( moveTime / 80 );
|
||||
maxWaitBetweenTrains = getDvarIntDefault( #"scr_maxWaitBetweenTrains", 200 );
|
||||
trainTime = ( moveTime + ( numOfCarts * 4 * originalRation ) );
|
||||
|
||||
|
||||
/#
|
||||
russian_base_train_dev();
|
||||
#/
|
||||
for(;;)
|
||||
{
|
||||
waitBetweenTrains = randomint( maxWaitBetweenTrains );
|
||||
if ( waitBetweenTrains > 0 )
|
||||
wait( waitBetweenTrains );
|
||||
level clientNotify("play_train");
|
||||
wait( trainTime );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/#
|
||||
russian_base_train_dev()
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
level waittill( "run_train" );
|
||||
level clientNotify("play_train");
|
||||
}
|
||||
}
|
||||
|
||||
devgui_russianbase( cmd )
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
wait( 0.5 );
|
||||
|
||||
devgui_string = GetDvar( #"devgui_notify" );
|
||||
|
||||
switch( devgui_string )
|
||||
{
|
||||
case "":
|
||||
break;
|
||||
default:
|
||||
level notify( devgui_string );
|
||||
break;
|
||||
}
|
||||
|
||||
SetDvar( "devgui_notify", "" );
|
||||
}
|
||||
}
|
||||
#/
|
107
mods/mp_patch/maps/mp/mp_silo.gsc
Normal file
107
mods/mp_patch/maps/mp/mp_silo.gsc
Normal file
@ -0,0 +1,107 @@
|
||||
#include maps\mp\_utility;
|
||||
#include common_scripts\utility;
|
||||
|
||||
|
||||
//========================================================
|
||||
// main
|
||||
//========================================================
|
||||
main()
|
||||
{
|
||||
//needs to be first for create fx
|
||||
maps\mp\mp_silo_fx::main();
|
||||
maps\mp\createart\mp_silo_art::main();
|
||||
|
||||
precachemodel("collision_wall_256x256x10");
|
||||
|
||||
maps\mp\_load::main();
|
||||
|
||||
// maps\mp\_compass::setupMiniMap("compass_map_mp_silo");
|
||||
if ( GetDvarInt( #"xblive_wagermatch" ) == 1 )
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_silo_wager");
|
||||
}
|
||||
else
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_silo");
|
||||
}
|
||||
|
||||
/#
|
||||
execdevgui( "devgui_mp_silo" );
|
||||
#/
|
||||
|
||||
maps\mp\mp_silo_amb::main();
|
||||
|
||||
// If the team nationalites change in this file, you must also update the level's csc file,
|
||||
// the level's csv file, and the share/raw/mp/mapsTable.csv
|
||||
maps\mp\gametypes\_teamset_urbanspecops::level_init();
|
||||
|
||||
// Set up the default range of the compass
|
||||
setdvar( "compassmaxrange","2100" );
|
||||
|
||||
// Set up some generic War Flag Names.
|
||||
// Example from COD5: CALLSIGN_SEELOW_A is the name of the 1st flag in Selow whose string is "Cottage"
|
||||
// The string must have MPUI_CALLSIGN_ and _A. Replace Mapname with the name of your map/bsp and in the
|
||||
// actual string enter a keyword that names the location (Roundhouse, Missle Silo, Launchpad, Guard Tower, etc)
|
||||
|
||||
game["strings"]["war_callsign_a"] = &"MPUI_CALLSIGN_MAPNAME_A";
|
||||
game["strings"]["war_callsign_b"] = &"MPUI_CALLSIGN_MAPNAME_B";
|
||||
game["strings"]["war_callsign_c"] = &"MPUI_CALLSIGN_MAPNAME_C";
|
||||
game["strings"]["war_callsign_d"] = &"MPUI_CALLSIGN_MAPNAME_D";
|
||||
game["strings"]["war_callsign_e"] = &"MPUI_CALLSIGN_MAPNAME_E";
|
||||
|
||||
game["strings_menu"]["war_callsign_a"] = "@MPUI_CALLSIGN_MAPNAME_A";
|
||||
game["strings_menu"]["war_callsign_b"] = "@MPUI_CALLSIGN_MAPNAME_B";
|
||||
game["strings_menu"]["war_callsign_c"] = "@MPUI_CALLSIGN_MAPNAME_C";
|
||||
game["strings_menu"]["war_callsign_d"] = "@MPUI_CALLSIGN_MAPNAME_D";
|
||||
game["strings_menu"]["war_callsign_e"] = "@MPUI_CALLSIGN_MAPNAME_E";
|
||||
|
||||
// enable new spawning system
|
||||
maps\mp\gametypes\_spawning::level_use_unified_spawning( true );
|
||||
|
||||
level thread crane_container();
|
||||
|
||||
//spawning collision in wager match so players can't hide in the spawned plates
|
||||
if ( GetDvarInt( #"xblive_wagermatch" ) == 1 || isPregame() )
|
||||
{
|
||||
spawncollision("collision_wall_256x256x10","collider",(1527, 71, 16), (0, 337, 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//========================================================
|
||||
// cargo_container
|
||||
//========================================================
|
||||
crane_container()
|
||||
{
|
||||
crane_container = GetEnt( "crane_container", "targetname" );
|
||||
|
||||
if( !IsDefined( crane_container ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
crane_container thread rotate_crane_container();
|
||||
}
|
||||
|
||||
|
||||
//========================================================
|
||||
// rotate_crane_container
|
||||
//========================================================
|
||||
rotate_crane_container()
|
||||
{
|
||||
rotate_time = 8;
|
||||
rotate_angle = 30;
|
||||
|
||||
self RotateYaw( rotate_angle / 2, rotate_time / 2 );
|
||||
self waittill( "rotatedone" );
|
||||
|
||||
while( true )
|
||||
{
|
||||
rotate_angle = rotate_angle * -1;
|
||||
|
||||
self RotateYaw( rotate_angle, rotate_time, rotate_time / 2, rotate_time / 2 );
|
||||
self waittill( "rotatedone" );
|
||||
}
|
||||
|
||||
}
|
105
mods/mp_patch/maps/mp/mp_villa.gsc
Normal file
105
mods/mp_patch/maps/mp/mp_villa.gsc
Normal file
@ -0,0 +1,105 @@
|
||||
#include maps\mp\_utility;
|
||||
main()
|
||||
{
|
||||
//needs to be first for create fx
|
||||
maps\mp\mp_villa_fx::main();
|
||||
|
||||
precachemodel("collision_geo_64x64x256");
|
||||
precachemodel("collision_geo_32x32x128");
|
||||
precachemodel("collision_geo_32x32x32");
|
||||
|
||||
maps\mp\_load::main();
|
||||
|
||||
maps\mp\mp_villa_amb::main();
|
||||
if ( GetDvarInt( #"xblive_wagermatch" ) == 1 )
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_villa_wager");
|
||||
}
|
||||
else
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_villa");
|
||||
}
|
||||
|
||||
// If the team nationalites change in this file,
|
||||
// you must update the team nationality in the level's csc file as well!
|
||||
maps\mp\gametypes\_teamset_cubans::level_init();
|
||||
|
||||
// Set up the default range of the compass
|
||||
setdvar("compassmaxrange","2100");
|
||||
|
||||
// Set up some generic War Flag Names.
|
||||
// Example from COD5: CALLSIGN_SEELOW_A is the name of the 1st flag in Selow whose string is "Cottage"
|
||||
// The string must have MPUI_CALLSIGN_ and _A. Replace Mapname with the name of your map/bsp and in the
|
||||
// actual string enter a keyword that names the location (Roundhouse, Missle Silo, Launchpad, Guard Tower, etc)
|
||||
|
||||
game["strings"]["war_callsign_a"] = &"MPUI_CALLSIGN_MAPNAME_A";
|
||||
game["strings"]["war_callsign_b"] = &"MPUI_CALLSIGN_MAPNAME_B";
|
||||
game["strings"]["war_callsign_c"] = &"MPUI_CALLSIGN_MAPNAME_C";
|
||||
game["strings"]["war_callsign_d"] = &"MPUI_CALLSIGN_MAPNAME_D";
|
||||
game["strings"]["war_callsign_e"] = &"MPUI_CALLSIGN_MAPNAME_E";
|
||||
|
||||
game["strings_menu"]["war_callsign_a"] = "@MPUI_CALLSIGN_MAPNAME_A";
|
||||
game["strings_menu"]["war_callsign_b"] = "@MPUI_CALLSIGN_MAPNAME_B";
|
||||
game["strings_menu"]["war_callsign_c"] = "@MPUI_CALLSIGN_MAPNAME_C";
|
||||
game["strings_menu"]["war_callsign_d"] = "@MPUI_CALLSIGN_MAPNAME_D";
|
||||
game["strings_menu"]["war_callsign_e"] = "@MPUI_CALLSIGN_MAPNAME_E";
|
||||
|
||||
// collision keeping players from poking their heads into rock
|
||||
spawncollision("collision_geo_64x64x256","collider",(4790, 1863, 388), (0, 30.8, 0));
|
||||
|
||||
// collision keeping players from poking their heads into another rock near the allies spawn
|
||||
spawncollision("collision_geo_32x32x128","collider",(4329, 3735, 144), (0, 0, 0));
|
||||
|
||||
// collision keeping players from poking their heads into another rock near D2.
|
||||
spawncollision("collision_geo_32x32x32","collider",(2512, 3818, 113), (0, 45, 0));
|
||||
|
||||
|
||||
// enable new spawning system
|
||||
maps\mp\gametypes\_spawning::level_use_unified_spawning(true);
|
||||
|
||||
level thread startLightning();
|
||||
}
|
||||
|
||||
|
||||
|
||||
startLightning()
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
self thread trigger_lightning_exploder();
|
||||
wait( 30 + randomfloat(40) );
|
||||
//wait (4);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
trigger_lightning_exploder()
|
||||
{
|
||||
randomExploder = randomint( 4 );
|
||||
//randomExploder = 3;
|
||||
switch( randomExploder )
|
||||
{
|
||||
case 0:
|
||||
exploder(1001);
|
||||
playsoundatposition("amb_thunder_clap",( 259.2, -801, 1197 ));
|
||||
//println ("sound exploder 1");
|
||||
break;
|
||||
case 1:
|
||||
exploder(1002);
|
||||
playsoundatposition("amb_thunder_clap",( 2523, -17012, 1174 ));
|
||||
//println ("sound exploder 2");
|
||||
break;
|
||||
case 2:
|
||||
exploder(1003);
|
||||
playsoundatposition("amb_thunder_clap",(6457, -611, 1145));
|
||||
//println ("sound exploder 3");
|
||||
break;
|
||||
case 3:
|
||||
exploder(1004);
|
||||
playsoundatposition("amb_thunder_clap",(4981, 1335, 890));
|
||||
//println ("sound exploder 4");
|
||||
break;
|
||||
}
|
||||
}
|
88
mods/mp_patch/maps/mp/mp_zoo.gsc
Normal file
88
mods/mp_patch/maps/mp/mp_zoo.gsc
Normal file
@ -0,0 +1,88 @@
|
||||
#include maps\mp\_utility;
|
||||
main()
|
||||
{
|
||||
//needs to be first for create fx
|
||||
maps\mp\mp_zoo_fx::main();
|
||||
|
||||
precachemodel("collision_wall_256x256x10");
|
||||
precachemodel("collision_geo_32x32x128");
|
||||
precachemodel("collision_geo_128x128x10");
|
||||
precachemodel("collision_geo_64x64x64");
|
||||
|
||||
maps\mp\_load::main();
|
||||
|
||||
maps\mp\mp_zoo_amb::main();
|
||||
|
||||
// maps\mp\_compass::setupMiniMap("compass_map_mp_zoo");
|
||||
if ( GetDvarInt( #"xblive_wagermatch" ) == 1 )
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_zoo_wager");
|
||||
}
|
||||
else
|
||||
{
|
||||
maps\mp\_compass::setupMiniMap("compass_map_mp_zoo");
|
||||
}
|
||||
|
||||
|
||||
// If the team nationalites change in this file, you must also update the level's csc file,
|
||||
// the level's csv file, and the share/raw/mp/mapsTable.csv
|
||||
maps\mp\gametypes\_teamset_urbanspecops::level_init();
|
||||
|
||||
// Set up the default range of the compass
|
||||
setdvar("compassmaxrange","2100");
|
||||
|
||||
// Set up some generic War Flag Names.
|
||||
// Example from COD5: CALLSIGN_SEELOW_A is the name of the 1st flag in Selow whose string is "Cottage"
|
||||
// The string must have MPUI_CALLSIGN_ and _A. Replace Mapname with the name of your map/bsp and in the
|
||||
// actual string enter a keyword that names the location (Roundhouse, Missle Silo, Launchpad, Guard Tower, etc)
|
||||
|
||||
game["strings"]["war_callsign_a"] = &"MPUI_CALLSIGN_MAPNAME_A";
|
||||
game["strings"]["war_callsign_b"] = &"MPUI_CALLSIGN_MAPNAME_B";
|
||||
game["strings"]["war_callsign_c"] = &"MPUI_CALLSIGN_MAPNAME_C";
|
||||
game["strings"]["war_callsign_d"] = &"MPUI_CALLSIGN_MAPNAME_D";
|
||||
game["strings"]["war_callsign_e"] = &"MPUI_CALLSIGN_MAPNAME_E";
|
||||
|
||||
game["strings_menu"]["war_callsign_a"] = "@MPUI_CALLSIGN_MAPNAME_A";
|
||||
game["strings_menu"]["war_callsign_b"] = "@MPUI_CALLSIGN_MAPNAME_B";
|
||||
game["strings_menu"]["war_callsign_c"] = "@MPUI_CALLSIGN_MAPNAME_C";
|
||||
game["strings_menu"]["war_callsign_d"] = "@MPUI_CALLSIGN_MAPNAME_D";
|
||||
game["strings_menu"]["war_callsign_e"] = "@MPUI_CALLSIGN_MAPNAME_E";
|
||||
|
||||
// enable new spawning system
|
||||
maps\mp\gametypes\_spawning::level_use_unified_spawning(true);
|
||||
|
||||
//spawn gates to explain rogue physics collision brush
|
||||
|
||||
gate1 = Spawn("script_model", (1040, 1495, 56) );
|
||||
if ( IsDefined(gate1) )
|
||||
{
|
||||
gate1.angles = (0, 270, 0);
|
||||
gate1 SetModel("p_zoo_bend_gate_mid");
|
||||
}
|
||||
gate2 = Spawn("script_model", (1104, 1495, 56) );
|
||||
if ( IsDefined(gate2) )
|
||||
{
|
||||
gate2.angles = (0, 270, 0);
|
||||
gate2 SetModel("p_zoo_bend_gate_mid");
|
||||
}
|
||||
|
||||
// spawn collision for bit of collision above a light in B3
|
||||
spawncollision("collision_wall_256x256x10","collider",(876, 2034, 169), (0, 90, 0));
|
||||
|
||||
// spawn collision to stop players from hiding inside the may-pole.
|
||||
spawncollision("collision_geo_32x32x128","collider",(49, 832, 66), (0, 0, 0));
|
||||
spawncollision("collision_geo_32x32x128","collider",(49, 832, 194), (0, 0, 0));
|
||||
|
||||
// spawn collision to stop players from hiding inside the may-pole base.
|
||||
spawncollision("collision_geo_64x64x64","collider",(47, 833, -16), (0, 0, 0));
|
||||
spawncollision("collision_geo_64x64x64","collider",(47, 833, -16), (0, 315, 0));
|
||||
|
||||
// spawn collision to stop players from standing on collision in aviary.
|
||||
spawncollision("collision_geo_128x128x10","collider",(934, 205, 74), (28.2, 340.6, -38.4));
|
||||
|
||||
if ( GetDvarInt( #"xblive_wagermatch" ) == 1 || isPregame() )
|
||||
{
|
||||
spawncollision("collision_wall_256x256x10","collider",(-5, 821, 72), (0, 297, 0));
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user