diff --git a/CTFGame.cs b/CTFGame.cs index 0fe7ffe..86f5fcd 100644 --- a/CTFGame.cs +++ b/CTFGame.cs @@ -87,6 +87,8 @@ function CTFGame::initGameVars(%game) %game.stalemateTimeMS = 60000; %game.stalemateFreqMS = 15000; %game.stalemateDurationMS = 6000; + + // --------------------------------------------------- // z0dd - ZOD, 9/29/02. Removed T2 demo code from here @@ -550,21 +552,21 @@ function CTFGame::flagCap(%game, %player) %game.AIflagCap(%player, %flag); //if this cap didn't end the game, play the announcer... - if ($missionRunning) - { - if (%game.getTeamName(%client.team) $= 'Inferno') - messageAll("", '~wfx/misc/flag_capture.wav'); - else if (%game.getTeamName(%client.team) $= 'Storm') - messageAll("", '~wfx/misc/flag_capture.wav'); - else if (%game.getTeamName(%client.team) $= 'Phoenix') - messageAll("", '~wfx/misc/flag_capture.wav'); - else if (%game.getTeamName(%client.team) $= 'Blood Eagle') - messageAll("", '~wfx/misc/flag_capture.wav'); - else if (%game.getTeamName(%client.team) $= 'Diamond Sword') - messageAll("", '~wfx/misc/flag_capture.wav'); - else if (%game.getTeamName(%client.team) $= 'Starwolf') - messageAll("", '~wfx/misc/flag_capture.wav'); - } + //if ($missionRunning) + //{ + //if (%game.getTeamName(%client.team) $= 'Inferno') + //messageAll("", '~wvoice/announcer/ann.infscores.wav'); + //else if (%game.getTeamName(%client.team) $= 'Storm') + //messageAll("", '~wvoice/announcer/ann.stoscores.wav'); + //else if (%game.getTeamName(%client.team) $= 'Phoenix') + //messageAll("", '~wvoice/announcer/ann.pxscore.wav'); + //else if (%game.getTeamName(%client.team) $= 'Blood Eagle') + //messageAll("", '~wvoice/announcer/ann.bescore.wav'); + //else if (%game.getTeamName(%client.team) $= 'Diamond Sword') + //messageAll("", '~wvoice/announcer/ann.dsscore.wav'); + //else if (%game.getTeamName(%client.team) $= 'Starwolf') + //messageAll("", '~wvoice/announcer/ann.swscore.wav'); + //} } function CTFGame::flagReturnFade(%game, %flag) @@ -673,6 +675,7 @@ function CTFGame::hideStalemateTargets(%game) function CTFGame::beginStalemate(%game) { %game.stalemate = true; + $stalemate = true; %game.showStalemateTargets(); // z0dd - ZOD, 5/27/03. Added anti-turtling, return flags after x minutes @@ -686,6 +689,7 @@ function CTFGame::beginStalemate(%game) function CTFGame::endStalemate(%game) { %game.stalemate = false; + $stalemate = false; %game.hideStalemateTargets(); cancel(%game.stalemateSchedule); } @@ -753,9 +757,9 @@ function CTFGame::flagReset(%game, %flag) function CTFGame::timeLimitReached(%game) { - logEcho("game over (timelimit)"); - %game.gameOver(); - cycleMissions(); + logEcho("game over (timelimit)"); + %game.gameOver(); + cycleMissions(); } function CTFGame::scoreLimitReached(%game) @@ -838,6 +842,9 @@ function CTFGame::gameOver(%game) } for(%j = 1; %j <= %game.numTeams; %j++) $TeamScore[%j] = 0; + + ResetNotify::MissionEnd( %game, %client ); + } function CTFGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc) @@ -1627,6 +1634,7 @@ function CTFGame::dropFlag(%game, %player) else %game.boundaryLoseFlag(%player); } + } function CTFGame::applyConcussion(%game, %player) diff --git a/SCtF/DeleteObjects.cs b/SCtF/DeleteObjects.cs index 4a94f20..f6f7a8e 100644 --- a/SCtF/DeleteObjects.cs +++ b/SCtF/DeleteObjects.cs @@ -78,7 +78,7 @@ function deleteObjectsFromGroupByType(%group, %type) function deleteNonSCtFObjectsFromMap() { - deleteObjectsFromGroupByType(MissionGroup, "PhysicalZone"); + //deleteObjectsFromGroupByType(MissionGroup, "PhysicalZone"); deleteObjectsFromGroupByType(MissionGroup, "Turret"); deleteObjectsFromGroupByType(MissionGroup, "StaticShape"); //deleteObjectsFromGroupByType(MissionGroup, "ForceFieldBare"); @@ -86,5 +86,5 @@ function deleteNonSCtFObjectsFromMap() deleteObjectsFromGroupByType(MissionGroup, "WheeledVehicle"); deleteObjectsFromGroupByType(MissionGroup, "HoverVehicle"); deleteObjectsFromGroupByType(MissionGroup, "Waypoint"); - + //deleteObjectsFromGroupByType(MissionGroup, "Item"); } diff --git a/SCtFGame.cs b/SCtFGame.cs index 842a478..4ad432c 100644 --- a/SCtFGame.cs +++ b/SCtFGame.cs @@ -104,8 +104,6 @@ function SCtFGame::initGameVars(%game) %game.stalemateTimeMS = 60000; %game.stalemateFreqMS = 15000; %game.stalemateDurationMS = 6000; - - %game.NotPure = false; } package SCtFGame @@ -643,7 +641,7 @@ function SCtFGame::playerDroppedFlag(%game, %player) $flagStatus[%flag.team] = ""; %player.unMountImage($FlagSlot); - %flag.hide(false); //Does the throwItem function handle this? + %flag.hide(false); //Does the throwItem function handle this? %teamName = %game.getTeamName(%flag.team); messageTeamExcept(%client, 'MsgCTFFlagDropped', '\c2Teammate %1 dropped the %2 flag. (Held: %4)~wfx/misc/flag_drop.wav', %client.name, %teamName, %flag.team, %held); // z0dd - ZOD, 8/15/02. How long flag was held @@ -688,21 +686,21 @@ function SCtFGame::flagCap(%game, %player) %game.AIflagCap(%player, %flag); //if this cap didn't end the game, play the announcer... - if ($missionRunning) - { - if (%game.getTeamName(%client.team) $= 'Inferno') - messageAll("", '~wfx/misc/flag_capture.wav'); - else if (%game.getTeamName(%client.team) $= 'Storm') - messageAll("", '~wfx/misc/flag_capture.wav'); - else if (%game.getTeamName(%client.team) $= 'Phoenix') - messageAll("", '~wfx/misc/flag_capture.wav'); - else if (%game.getTeamName(%client.team) $= 'Blood Eagle') - messageAll("", '~wfx/misc/flag_capture.wav'); - else if (%game.getTeamName(%client.team) $= 'Diamond Sword') - messageAll("", '~wfx/misc/flag_capture.wav'); - else if (%game.getTeamName(%client.team) $= 'Starwolf') - messageAll("", '~wfx/misc/flag_capture.wav'); - } + //if ($missionRunning) + //{ + //if (%game.getTeamName(%client.team) $= 'Inferno') + //messageAll("", '~wvoice/announcer/ann.infscores.wav'); + //else if (%game.getTeamName(%client.team) $= 'Storm') + //messageAll("", '~wvoice/announcer/ann.stoscores.wav'); + //else if (%game.getTeamName(%client.team) $= 'Phoenix') + //messageAll("", '~wvoice/announcer/ann.pxscore.wav'); + //else if (%game.getTeamName(%client.team) $= 'Blood Eagle') + //messageAll("", '~wvoice/announcer/ann.bescore.wav'); + //else if (%game.getTeamName(%client.team) $= 'Diamond Sword') + //messageAll("", '~wvoice/announcer/ann.dsscore.wav'); + //else if (%game.getTeamName(%client.team) $= 'Starwolf') + //messageAll("", '~wvoice/announcer/ann.swscore.wav'); + //} } function SCtFGame::flagReturnFade(%game, %flag) @@ -1650,7 +1648,7 @@ function SCtFGame::boundaryLoseFlag(%game, %player) } function SCtFGame::dropFlag(%game, %player) -{ +{ if(%player.holdingFlag > 0) { if (!%player.client.outOfBounds) diff --git a/autoexec/VoteOverTime.cs b/autoexec/VoteOverTime.cs new file mode 100644 index 0000000..422bd97 --- /dev/null +++ b/autoexec/VoteOverTime.cs @@ -0,0 +1,94 @@ +//Changes were also made in the Evo Admin.ovl and DefaultGame.ovl +//DefaultGame::voteChangeMission, DefaultGame::voteChangeTimeLimit, serverCmdStartNewVote + +package VoteOverTime { + +//CTF +function CTFGame::timeLimitReached(%game) +{ + if( !$VoteInProgress && !$TimeLimitChanged ) { + logEcho("game over (timelimit)"); + %game.gameOver(); + cycleMissions(); + + $VoteInProgress = false; + $TimeLimitChanged = false; + $VoteInProgressMessege = false; + $VoteSoundInProgress = false; + } + else if( $missionRunning && $VoteInProgress && !$TimeLimitChanged ) { + schedule(1000, 0, "CTFRestarttimeLimitReached", %game); + + if( !$VoteInProgressMessege ) { + messageAll('', '\c2Vote Overtime Initiated.', %display); + $VoteInProgressMessege = true; + } + } +} + +function CTFRestarttimeLimitReached(%game) +{ + CTFGame::timeLimitReached(%game); +} + +//LakRabbit +function LakRabbitGame::timeLimitReached(%game) +{ + if( !$VoteInProgress && !$TimeLimitChanged ) { + logEcho("game over (timelimit)"); + %game.gameOver(); + cycleMissions(); + + $VoteInProgress = false; + $TimeLimitChanged = false; + $VoteInProgressMessege = false; + $VoteSoundInProgress = false; + } + else if( $missionRunning && $VoteInProgress && !$TimeLimitChanged ) { + schedule(1000, 0, "LakRabbitRestarttimeLimitReached", %game); + + if( !$VoteInProgressMessege ) { + messageAll('', '\c2Vote Overtime Initiated.', %display); + $VoteInProgressMessege = true; + } + } +} + +function LakRabbitRestarttimeLimitReached(%game) +{ + LakRabbitGame::timeLimitReached(%game); +} + +//SCtF +function SCtFGame::timeLimitReached(%game) +{ + if( !$VoteInProgress && !$TimeLimitChanged ) { + logEcho("game over (timelimit)"); + %game.gameOver(); + cycleMissions(); + + $VoteInProgress = false; + $TimeLimitChanged = false; + $VoteInProgressMessege = false; + $VoteSoundInProgress = false; + } + else if( $missionRunning && $VoteInProgress && !$TimeLimitChanged ) { + schedule(1000, 0, "SCtFRestarttimeLimitReached", %game); + + if( !$VoteInProgressMessege ) { + messageAll('', '\c2Vote Overtime Initiated.', %display); + $VoteInProgressMessege = true; + } + } +} + +function SCtFRestarttimeLimitReached(%game) +{ + SCtFGame::timeLimitReached(%game); +} + +}; + +// Prevent package from being activated if it is already +if (!isActivePackage(VoteOverTime)) + activatePackage(VoteOverTime); \ No newline at end of file diff --git a/autoexec/VoteSound.cs b/autoexec/VoteSound.cs new file mode 100644 index 0000000..f707d41 --- /dev/null +++ b/autoexec/VoteSound.cs @@ -0,0 +1,13 @@ +//Make a sound every so seconds to make sure everyone votes + +function VoteSound( %game ) { + + if($VoteSoundInProgress) { + messageAll('', '\c1Vote in Progress: \c0Press Insert for Yes or Delete for No.~wgui/objective_notification.wav', %display); + //$VoteSoundSchedule = schedule(12000, "VoteSound", %game); + schedule(12000, 0, "VoteSound", %game); + } + else + return; + +} diff --git a/inventory.cs b/inventory.cs index b542342..922961f 100644 --- a/inventory.cs +++ b/inventory.cs @@ -477,7 +477,10 @@ function ShapeBase::throwObject(%this,%obj) //we need to up the %vec so that you can still throw them... if (%obj.getDataBlock().getName() $= "Flag") { - %vec = vectorScale(%vec, (%srcCorpse ? 40 : 75)); // z0dd - ZOD, 4/14/02. Throw flag force. Value was 40 + if ($CurrentMissionType $= "sctf") + %vec = vectorScale(%vec, (%srcCorpse ? 50 : 95)); // Added so SCtF gets more force for Flag passes + else + %vec = vectorScale(%vec, (%srcCorpse ? 40 : 75)); // z0dd - ZOD, 4/14/02. Throw flag force. Value was 40 // ------------------------------------------------------------ // z0dd - ZOD, 9/27/02. Delay on grabbing flag after tossing it %this.flagTossWait = true; diff --git a/prefs/evo_mapRotation.cs b/prefs/evo_mapRotation.cs index fa29be5..e85f545 100644 --- a/prefs/evo_mapRotation.cs +++ b/prefs/evo_mapRotation.cs @@ -68,6 +68,7 @@ addRotationMap("Discord", CTF, 1, 1); addRotationMap("NatureMagic", CTF, 1, 1); addRotationMap("TenebrousCTF", CTF, 1, 1); addRotationMap("Pariah", CTF, 1, 1); +addRotationMap("Prizmatic", CTF, 1, 1); addRotationMap("TWL_WilderZone", CTF, 1, 1); addRotationMap("Mirage", CTF, 1, 1); addRotationMap("S5_Mimicry", CTF, 1, 1); @@ -294,13 +295,11 @@ addRotationMap("Tombstone", Duel, 1, 1); addRotationMap("BastardForgeLT", sctf, 1, 1); addRotationMap("FirestormLT", sctf, 1, 1); -addRotationMap("DangerousCrossing_nef", sctf, 1, 1); +addRotationMap("DangerousCrossingLT", sctf, 1, 1); addRotationMap("SmallCrossingLT", sctf, 1, 1); addRotationMap("DireLT", sctf, 1, 1); addRotationMap("RoundTheMountainLT", sctf, 1, 1); addRotationMap("CirclesEdgeLT", sctf, 1, 1); -addRotationMap("HighOctane", sctf, 1, 1); -addRotationMap("JadeValley", sctf, 1, 1); addRotationMap("TenebrousCTF", sctf, 1, 1); addRotationMap("TheFray", sctf, 1, 1); addRotationMap("SignalLT", sctf, 1, 1); @@ -308,13 +307,13 @@ addRotationMap("StarFallLT", sctf, 1, 1); addRotationMap("S5_DamnationLT", sctf, 1, 1); addRotationMap("S5_Icedance", sctf, 1, 1); addRotationMap("S5_Mordacity", sctf, 1, 1); -addRotationMap("S5_Silenus", sctf, 1, 1); +addRotationMap("S5_SilenusLT", sctf, 1, 1); addRotationMap("TWL2_CanyonCrusadeDeluxeLT", sctf, 1, 1); addRotationMap("TWL2_FrozenHopeLT", sctf, 1, 1); +addRotationMap("TWL2_JaggedClawLT", sctf, 1, 1); addRotationMap("TWL2_HildebrandLT", sctf, 1, 1); addRotationMap("TWL2_SkylightLT", sctf, 1, 1); addRotationMap("TWL_BeachBlitzLT", sctf, 1, 1); -addRotationMap("TWL_DangerousCrossing", sctf, 1, 1); addRotationMap("TWL_FeignLT", sctf, 1, 1); addRotationMap("TWL_RollercoasterLT", sctf, 1, 1); addRotationMap("TWL_StonehengeLT", sctf, 1, 1); @@ -322,17 +321,20 @@ addRotationMap("TWL_WilderZoneLT", sctf, 1, 1); addRotationMap("oasisintensity", sctf, 1, 1); addRotationMap("berlard", sctf, 1, 1); addRotationMap("SurrealLT", sctf, 1, 1); +addRotationMap("RaindanceLT", sctf, 1, 1); addRotationMap("Coppersky", sctf, 1, 1); addRotationMap("DuelersDelight", sctf, 1, 1); addRotationMap("SuperHappyBouncyFunTime", sctf, 1, 0); -addRotationMap("SmallTimeCTF", sctf, 1, 1); -addRotationMap("Pariah", sctf, 1, 1); +addRotationMap("SmallTimeLT", sctf, 1, 1); +addRotationMap("PariahLT", sctf, 1, 1); addRotationMap("SmallMelee", sctf, 1, 1); addRotationMap("ArenaDome", sctf, 1, 1); addRotationMap("Bulwark", sctf, 1, 1); addRotationMap("Discord", sctf, 1, 1); addRotationMap("TitForTat", sctf, 1, 1); addRotationMap("CloseCombatLT", sctf, 1, 1); +addRotationMap("PrizmaticLT", sctf, 1, 1); +addRotationMap("JadeValley", sctf, 1, 1); addRotationMap("BeggarsRunLT", sctf, 0, 0); addRotationMap("Damnation", sctf, 0, 0); addRotationMap("DustToDust", sctf, 0, 0); @@ -353,7 +355,7 @@ addRotationMap("Snowcone", sctf, 0, 0); addRotationMap("S5_Centaur", sctf, 0, 0); addRotationMap("S5_Drache", sctf, 0, 0); addRotationMap("S5_HawkingHeat", sctf, 0, 0); -addRotationMap("S5_Massive", sctf, 0, 0); +addRotationMap("S5_MassiveLT", sctf, 1, 1); addRotationMap("S5_Mimicry", sctf, 0, 0); addRotationMap("S5_Misadventure", sctf, 0, 0); addRotationMap("S5_Reynard", sctf, 0, 0); @@ -369,7 +371,6 @@ addRotationMap("TWL2_Drifts", sctf, 0, 0); addRotationMap("TWL2_Drorck", sctf, 0, 0); addRotationMap("TWL2_FrozenGlory", sctf, 0, 0); addRotationMap("TWL2_IceDagger", sctf, 0, 0); -addRotationMap("TWL2_JaggedClaw", sctf, 0, 0); addRotationMap("TWL2_MidnightMayhemDeluxe", sctf, 0, 0); addRotationMap("TWL2_MuddySwamp", sctf, 0, 0); addRotationMap("TWL2_Norty", sctf, 0, 0); @@ -380,6 +381,7 @@ addRotationMap("TWL_BaNsHee", sctf, 0, 0); addRotationMap("TWL_Boss", sctf, 0, 0); addRotationMap("TWL_Cinereous", sctf, 0, 0); addRotationMap("TWL_Crossfire", sctf, 0, 0); +addRotationMap("TWL_DangerousCrossing", sctf, 0, 0); addRotationMap("TWL_NoShelter", sctf, 0, 0); addRotationMap("TWL_OsIris", sctf, 0, 0); addRotationMap("TWL_Clusterfuct", sctf, 0, 0); @@ -402,6 +404,7 @@ addRotationMap("ShortFall", sctf, 0, 0); addRotationMap("Fallout", sctf, 0, 0); addRotationMap("SoylentGreen", sctf, 0, 0); addRotationMap("Island", sctf, 0, 0); +addRotationMap("HighOctane", sctf, 0, 0); @@ -409,7 +412,7 @@ addRotationMap("Island", sctf, 0, 0); // * Siege Maps * // ************************ -addRotationMap("Isleofman", siege, 1, 1); -addRotationMap("Trident", siege, 1, 1); -addRotationMap("Alcatraz", siege, 1, 1); +addRotationMap("Isleofman", Siege, 1, 1); +addRotationMap("Trident", Siege, 1, 1); +addRotationMap("Alcatraz", Siege, 1, 1); diff --git a/prefs/serverPrefs.cs b/prefs/serverPrefs.cs index c430043..6fbbe01 100644 --- a/prefs/serverPrefs.cs +++ b/prefs/serverPrefs.cs @@ -62,10 +62,10 @@ $Host::EvoAdminCRCCheck = 0; $Host::EvoAdminLogging = 1; $Host::EvoAdminMaxPlayers = 20; $Host::EvoAdminMinPlayers = 20; -$Host::EvoAdminPassVote = 1; +$Host::EvoAdminPassVote = 0; $Host::EvoAdminReset = 0; $Host::EvoAdminServerPW = 0; -$Host::EvoAdminStopVotes = 1; +$Host::EvoAdminStopVotes = 0; $Host::EvoAdminWhois = 0; $Host::EvoAllowAdminVoteGameType = 1; $Host::EvoAllowPlayerVoteChangeMission = 1; @@ -1291,5 +1291,5 @@ $Host::TournamentMode = "0"; $Host::useCustomSkins = 1; $Host::VotePassPercent = "60"; $Host::VoteSpread = 20; -$Host::VoteTime = "30"; +$Host::VoteTime = "45"; $Host::warmupTime = "20"; diff --git a/station.cs b/station.cs new file mode 100644 index 0000000..2473c99 --- /dev/null +++ b/station.cs @@ -0,0 +1,1165 @@ +//****************************************************************************** +//* Station - Data Blocks * +//****************************************************************************** +datablock EffectProfile(StationInventoryActivateEffect) +{ + effectname = "powered/inv_pad_on"; + minDistance = 5.0; + maxDistance = 7.5; +}; + +datablock EffectProfile(StationVehicleActivateEffect) +{ + effectname = "powered/vehicle_screen_on2"; + minDistance = 3.0; + maxDistance = 5.0; +}; + +datablock EffectProfile(StationVehicleDeactivateEffect) +{ + effectname = "powered/vehicle_screen_off"; + minDistance = 3.0; + maxDistance = 5.0; +}; + +//datablock EffectProfile(MobileBaseInventoryActivateEffect) +//{ +// effectname = "misc/diagnostic_on"; +// minDistance = 3.0; +//}; + +datablock EffectProfile(StationAccessDeniedEffect) +{ + effectname = "powered/station_denied"; + minDistance = 3.0; + maxDistance = 5.0; +}; + +datablock AudioProfile(StationInventoryActivateSound) +{ + filename = "fx/powered/inv_pad_on.wav"; + description = AudioClose3d; + preload = true; + effect = StationInventoryActivateEffect; +}; + +datablock AudioProfile(MobileBaseInventoryActivateSound) +{ + filename = "fx/vehicles/mpb_inv_station.wav"; + description = AudioClose3d; + preload = true; + effect = StationInventoryActivateEffect; +}; + +datablock AudioProfile(DepInvActivateSound) +{ + filename = "fx/powered/dep_inv_station.wav"; + description = AudioClose3d; + preload = true; + effect = StationInventoryActivateEffect; +}; + +datablock AudioProfile(StationVehicleActivateSound) +{ + filename = "fx/powered/vehicle_screen_on2.wav"; + description = AudioClosest3d; + preload = true; + effect = StationVehicleActivateEffect; +}; + +datablock AudioProfile(StationVehicleDeactivateSound) +{ + filename = "fx/powered/vehicle_screen_off.wav"; + description = AudioClose3d; + preload = true; + effect = StationVehicleDeactivateEffect; +}; + +datablock AudioProfile(StationAccessDeniedSound) +{ + filename = "fx/powered/station_denied.wav"; + description = AudioClosest3d; + preload = true; + effect = StationAccessDeniedEffect; +}; + +datablock AudioProfile(StationVehicleHumSound) +{ + filename = "fx/powered/station_hum.wav"; + description = CloseLooping3d; + preload = true; +}; + +datablock AudioProfile(StationInventoryHumSound) +{ + filename = "fx/powered/station_hum.wav"; + description = CloseLooping3d; + preload = true; +}; + +datablock StationFXPersonalData( PersonalInvFX ) +{ + delay = 0; + fadeDelay = 0.5; + lifetime = 1.2; + height = 2.5; + numArcSegments = 10.0; + numDegrees = 180.0; + trailFadeTime = 0.5; + leftRadius = 1.85; + rightRadius = 1.85; + leftNodeName = "FX1"; + rightNodeName = "FX2"; + texture[0] = "special/stationLight"; +}; + + +datablock DebrisData( StationDebris ) +{ + explodeOnMaxBounce = false; + elasticity = 0.40; + friction = 0.5; + lifetime = 17.0; + lifetimeVariance = 0.0; + minSpinSpeed = 60; + maxSpinSpeed = 600; + numBounces = 10; + bounceVariance = 0; + staticOnMaxBounce = true; + useRadiusMass = true; + baseRadius = 0.4; + velocity = 9.0; + velocityVariance = 4.5; +}; + +datablock StaticShapeData(StationInventory) : StaticShapeDamageProfile +{ + className = Station; + catagory = "Stations"; + shapeFile = "station_inv_human.dts"; + maxDamage = 1.00; + destroyedLevel = 1.00; + disabledLevel = 0.70; + explosion = ShapeExplosion; + expDmgRadius = 8.0; + expDamage = 0.4; + expImpulse = 1500.0; + // don't allow this object to be damaged in non-team-based + // mission types (DM, Rabbit, Bounty, Hunters) + noIndividualDamage = true; + dynamicType = $TypeMasks::StationObjectType; + isShielded = true; + energyPerDamagePoint = 75; + maxEnergy = 50; + rechargeRate = 0.35; + doesRepair = true; + humSound = StationInventoryHumSound; + cmdCategory = "Support"; + cmdIcon = CMDStationIcon; + cmdMiniIconName = "commander/MiniIcons/com_inventory_grey"; + targetNameTag = 'Inventory'; + targetTypeTag = 'Station'; + debrisShapeName = "debris_generic.dts"; + debris = StationDebris; +}; + +datablock StaticShapeData(StationAmmo) : StaticShapeDamageProfile +{ + className = Station; + catagory = "Stations"; +// shapeFile = "station_ammo.dts"; + shapeFile = "station_inv_human.dts"; + maxDamage = 1.00; + destroyedLevel = 1.00; + disabledLevel = 0.70; + explosion = ShapeExplosion; + expDmgRadius = 8.0; + expDamage = 0.4; + expImpulse = 1500.0; + // don't allow this object to be damaged in non-team-based + // mission types (DM, Rabbit, Bounty, Hunters) + noIndividualDamage = true; + dynamicType = $TypeMasks::StationObjectType; + isShielded = true; + energyPerDamagePoint = 75; + maxEnergy = 50; + rechargeRate = 0.35; + doesRepair = true; + humSound = StationInventoryHumSound; + cmdCategory = "Support"; + cmdIcon = CMDStationIcon; + cmdMiniIconName = "commander/MiniIcons/com_inventory_grey"; + targetNameTag = 'Ammo'; + targetTypeTag = 'Station'; + debrisShapeName = "debris_generic.dts"; + debris = StationDebris; +}; + +datablock StaticShapeData(StationVehicle) : StaticShapeDamageProfile +{ + className = Station; + catagory = "Stations"; + shapeFile = "vehicle_pad_station.dts"; + maxDamage = 1.20; + destroyedLevel = 1.20; + disabledLevel = 0.84; + explosion = ShapeExplosion; + expDmgRadius = 10.0; + expDamage = 0.4; + expImpulse = 1500.0; + dynamicType = $TypeMasks::StationObjectType; + isShielded = true; + energyPerDamagePoint = 33; + maxEnergy = 250; + rechargeRate = 0.31; + humSound = StationVehicleHumSound; + // don't let these be damaged in Siege missions + noDamageInSiege = true; + cmdCategory = "Support"; + cmdIcon = CMDVehicleStationIcon; + cmdMiniIconName = "commander/MiniIcons/com_vehicle_pad_inventory"; + targetTypeTag = 'Vehicle Station'; + debrisShapeName = "debris_generic.dts"; + debris = StationDebris; +}; + +datablock StaticShapeData(StationVehiclePad) +{ + className = Station; + catagory = "Stations"; + shapeFile = "vehicle_pad.dts"; + isInvincible = true; + dynamicType = $TypeMasks::StaticObjectType; + rechargeRate = 0.05; + targetTypeTag = 'Vehicle Pad'; // z0dd - ZOD, 4/20/02. Bug fix, need this var. +}; + +//datablock StaticShapeData(StationAmmo) +//{ +// className = Station; +// catagory = "Stations"; +// shapeFile = "station_ammo.dts"; +// maxDamage = 1.0; +// disabledLevel = 0.6; +// destroyedLevel = 0.8; +// icon = "CMDStationIcon"; +// dynamicType = $TypeMasks::StationObjectType; +//}; + +datablock StaticShapeData(MobileInvStation) +{ + className = Station; + catagory = "Stations"; + shapeFile = "station_inv_mpb.dts"; + icon = "CMDStationIcon"; + // don't allow this object to be damaged in non-team-based + // mission types (DM, Rabbit, Bounty, Hunters) + noIndividualDamage = true; + + dynamicType = $TypeMasks::StationObjectType; + rechargeRate = 0.256; + doesRepair = true; +}; + + +//****************************************************************************** +//* Station - Functions * +//****************************************************************************** + +//////////////////////////////////////////////////////////////////////////////// +/// -Inventory- //////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +/// -Inventory- //////////////////////////////////////////////////////////////// +//Function -- onAdd (%this, %obj) +// %this = Object data block +// %obj = Object being added +//Decription -- Called when the object is added to the mission +//////////////////////////////////////////////////////////////////////////////// +function StationInventory::onAdd(%this, %obj) +{ + Parent::onAdd(%this, %obj); + %obj.setRechargeRate(%obj.getDatablock().rechargeRate); + %trigger = new Trigger() + { + dataBlock = stationTrigger; + polyhedron = "-0.75 0.75 0.1 1.5 0.0 0.0 0.0 -1.5 0.0 0.0 0.0 2.3"; + }; + MissionCleanup.add(%trigger); + %trigger.setTransform(%obj.getTransform()); + %trigger.station = %obj; + %trigger.mainObj = %obj; + %trigger.disableObj = %obj; + %obj.trigger = %trigger; +} + +/// -Inventory- //////////////////////////////////////////////////////////////// +//Function -- stationReady(%data, %obj) +// %data = Station Data Block +// %obj = Station Object +//Decription -- Called when station has been triggered and animation is +// completed +//////////////////////////////////////////////////////////////////////////////// +function StationInventory::stationReady(%data, %obj) +{ + //Display the Inventory Station GUI here + %obj.notReady = 1; + %obj.inUse = "Down"; + %obj.schedule(500,"playThread",$ActivateThread,"activate1"); + %player = %obj.triggeredBy; + %energy = %player.getEnergyLevel(); + %max = %player.getDatablock().maxEnergy; // z0dd - ZOD, 4/20/02. Inv energy bug fix + %player.setCloaked(true); + %player.schedule(500, "setCloaked", false); + if (!%player.client.isAIControlled()) + buyFavorites(%player.client); + + %player.setEnergyLevel(mFloor(%player.getDatablock().maxEnergy * %energy / %max)); // z0dd - ZOD, 4/20/02. Inv energy bug fix + %data.schedule( 500, "beginPersonalInvEffect", %obj ); +} + +function StationInventory::beginPersonalInvEffect( %data, %obj ) +{ + if (!%obj.isDisabled()) + { + %fx = new StationFXPersonal() + { + dataBlock = PersonalInvFX; + stationObject = %obj; + }; + } +} + +/// -Inventory- //////////////////////////////////////////////////////////////// +//Function -- stationFinished(%data, %obj) +// %data = Station Data Block +// %obj = Station Object +//Decription -- Called when player has left the station +//////////////////////////////////////////////////////////////////////////////// +function StationInventory::stationFinished(%data, %obj) +{ + //Hide the Inventory Station GUI +} + +/// -Inventory- //////////////////////////////////////////////////////////////// +//Function -- getSound(%data, %forward) +// %data = Station Data Block +// %forward = direction the animation is playing +//Decription -- This sound will be played at the same time as the activate +// animation. +//////////////////////////////////////////////////////////////////////////////// +function StationInventory::getSound(%data, %forward) +{ + if(%forward) + return "StationInventoryActivateSound"; + else + return false; +} + +/// -Inventory- //////////////////////////////////////////////////////////////// +//Function -- setPlayerPosition(%data, %obj, %trigger, %colObj) +// %data = Station Data Block +// %obj = Station Object +// %trigger = Stations trigger +// %colObj = Object that is at the station +//Decription -- Called when player enters the trigger. Used to set the player +// in the center of the station. +//////////////////////////////////////////////////////////////////////////////// +function StationInventory::setPlayersPosition(%data, %obj, %trigger, %colObj) +{ + %vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0"; + if((VectorLen(%vel) < 36) && (%obj.triggeredBy != %colObj)) // z0dd - ZOD, 12/09/02. global contact vel. Was 22. + { + %pos = %trigger.position; + %colObj.setvelocity("0 0 0"); + %rot = getWords(%colObj.getTransform(),3, 6); + %colObj.setTransform(getWord(%pos,0) @ " " @ getWord(%pos,1) @ " " @ getWord(%pos,2) + 0.8 @ " " @ %rot);//center player on object + %colObj.setMoveState(true); + %colObj.schedule(1600,"setMoveState", false); + %colObj.setvelocity("0 0 0"); + return true; + } + return false; +} + + +/////////////////////////////////////////////////////////////////////////////// +/// -Ammo- //////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +function StationAmmo::onAdd(%this, %obj) +{ + Parent::onAdd(%this, %obj); + %obj.setRechargeRate(%obj.getDatablock().rechargeRate); + %trigger = new Trigger() + { + dataBlock = stationTrigger; + polyhedron = "-0.75 0.75 0.1 1.5 0.0 0.0 0.0 -1.5 0.0 0.0 0.0 2.3"; + }; + MissionCleanup.add(%trigger); + %trigger.setTransform(%obj.getTransform()); + + %trigger.station = %obj; + %trigger.mainObj = %obj; + %trigger.disableObj = %obj; + %obj.trigger = %trigger; +} + +//------------------------------------------------------------------------------- +function StationAmmo::stationReady(%data, %obj) +{ + //error("StationAmmo::stationReady"); + %obj.notReady = 1; + %obj.inUse = "Down"; + %obj.setThreadDir($ActivateThread, true); + %obj.schedule(100, "playThread", $ActivateThread, "activate1"); + %player = %obj.triggeredBy; + %energy = %player.getEnergyLevel(); + //%player.setCloaked(true); + //%player.schedule(500, "setCloaked", false); + if (!%player.client.isAIControlled()) + getAmmoStationLovin(%player.client); + //%data.schedule( 500, "beginPersonalInvEffect", %obj ); +} + +//------------------------------------------------------------------------------- +function StationAmmo::onEndSequence(%data, %obj, %thread) +{ + if(%thread == $ActivateThread) + { + %obj.setThreadDir($ActivateThread, false); + %obj.playThread( $ActivateThread, "activate1"); + if(%obj.inUse $= "Up") + { + %data.stationReady(%obj); + %player = %obj.triggeredBy; + if(%data.doesRepair && !%player.stationRepairing && %player.getDamageLevel() != 0) { + %oldRate = %player.getRepairRate(); + %player.setRepairRate(%oldRate + 0.00625); + %player.stationRepairing = 1; + } + } + } + //Parent::onEndSequence(%data, %obj, %thread); +} + +//------------------------------------------------------------------------------- +function StationAmmo::stationFinished(%data, %obj) +{ + //Hide the Inventory Station GUI +} + +//------------------------------------------------------------------------------- +function StationAmmo::getSound(%data, %forward) +{ + if(%forward) + return "StationInventoryActivateSound"; + else + return false; +} + +//------------------------------------------------------------------------------- +function StationAmmo::setPlayersPosition(%data, %obj, %trigger, %colObj) +{ + %vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0"; + if((VectorLen(%vel) < 36) && (%obj.triggeredBy != %colObj)) // z0dd - ZOD, 12/09/02. global contact vel. Was 22. + { + %pos = %trigger.position; + %colObj.setvelocity("0 0 0"); + %rot = getWords(%colObj.getTransform(),3, 6); + %colObj.setTransform(getWord(%pos,0) @ " " @ getWord(%pos,1) @ " " @ getWord(%pos,2) + 0.8 @ " " @ %rot);//center player on object + %colObj.setMoveState(true); + %colObj.schedule(1600,"setMoveState", false); + %colObj.setvelocity("0 0 0"); + return true; + } + return false; +} + +//////////////////////////////////////////////////////////////////////////////// +/// -Vehicle- ////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +/// -Vehicle- ////////////////////////////////////////////////////////////////// +//Function -- onAdd (%this, %obj) +// %this = Object data block +// %obj = Object being added +//Decription -- Called when the object is added to the mission +//////////////////////////////////////////////////////////////////////////////// + +// z0dd - ZOD, 4/20/02. Not required, automatic parent call +//function StationVehicle::onAdd(%this, %obj) +//{ +// Parent::onAdd(%this, %obj); +//} + +function StationVehicle::createTrigger(%this, %obj) +{ + // z0dd - ZOD, 4/20/02. This function used to be named "StationVehicle::onAdd" + // and was changed as part of the power bug fix. + %trigger = new Trigger() + { + dataBlock = stationTrigger; + polyhedron = "-0.75 0.75 0.0 1.5 0.0 0.0 0.0 -1.5 0.0 0.0 0.0 2.0"; + }; + MissionCleanup.add(%trigger); + %trigger.setTransform(%obj.getTransform()); + %trigger.station = %obj; + %obj.trigger = %trigger; +} + +/// -Vehicle- ////////////////////////////////////////////////////////////////// +//Function -- stationReady(%data, %obj) +// %data = Station Data Block +// %obj = Station Object +//Decription -- Called when station has been triggered and animation is +// completed +//////////////////////////////////////////////////////////////////////////////// +function StationVehicle::stationReady(%data, %obj) +{ + // Make sure none of the other popup huds are active: + // ------------------------------------------------------------------------------------ + // z0dd - ZOD, 6/20/03. done elsewhere as a result of popping up veh station hud sooner + //messageClient( %obj.triggeredBy.client, 'CloseHud', "", 'scoreScreen' ); + //messageClient( %obj.triggeredBy.client, 'CloseHud', "", 'inventoryScreen' ); + + //Display the Vehicle Station GUI + //commandToClient(%obj.triggeredBy.client, 'StationVehicleShowHud'); + // ------------------------------------------------------------------------------------ +} + +/// -Vehicle- ////////////////////////////////////////////////////////////////// +//Function -- stationFinished(%data, %obj) +// %data = Station Data Block +// %obj = Station Object +//Decription -- Called when player has left the station +//////////////////////////////////////////////////////////////////////////////// +function StationVehicle::stationFinished(%data, %obj) +{ + //Hide the Vehicle Station GUI + if(!%obj.triggeredBy.isMounted()) + commandToClient(%obj.triggeredBy.client, 'StationVehicleHideHud'); + else + commandToClient(%obj.triggeredBy.client, 'StationVehicleHideJustHud'); +} + +/// -Vehicle- ////////////////////////////////////////////////////////////////// +//Function -- getSound(%data, %forward) +// %data = Station Data Block +// %forward = direction the animation is playing +//Decription -- This sound will be played at the same time as the activate +// animation. +//////////////////////////////////////////////////////////////////////////////// +function StationVehicle::getSound(%data, %forward) +{ + if(%forward) + return "StationVehicleActivateSound"; + else + return "StationVehicleDeactivateSound"; +} + +/// -Vehicle- ////////////////////////////////////////////////////////////////// +//Function -- setPlayerPosition(%data, %obj, %trigger, %colObj) +// %data = Station Data Block +// %obj = Station Object +// %trigger = Stations trigger +// %colObj = Object that is at the station +//Decription -- Called when player enters the trigger. Used to set the player +// in the center of the station. +//////////////////////////////////////////////////////////////////////////////// +function StationVehicle::setPlayersPosition(%data, %obj, %trigger, %colObj) +{ + %vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0"; + if((VectorLen(%vel) < 36) && (%obj.triggeredBy != %colObj)) // z0dd - ZOD, 12/09/02. global contact vel. Was 22. + { + %posXY = getWords(%trigger.getTransform(),0 ,1); + %posZ = getWord(%trigger.getTransform(), 2); + %rotZ = getWord(%obj.getTransform(), 5); + %angle = getWord(%obj.getTransform(), 6); + %angle += 3.141592654; + if(%angle > 6.283185308) + %angle = %angle - 6.283185308; + %colObj.setvelocity("0 0 0"); + %colObj.setTransform(%posXY @ " " @ %posZ + 0.2 @ " " @ "0 0 " @ %rotZ @ " " @ %angle );//center player on object + return true; + } + return false; +} + +function StationVehiclePad::onAdd(%this, %obj) +{ + Parent::onAdd(%this, %obj); + + %obj.ready = true; + %obj.setRechargeRate(%obj.getDatablock().rechargeRate); + + //------------------------------------------------------------------------- + // z0dd - ZOD - Founder(founder@mechina.com), 4/20/02. + // Total rewrite, schedule the vehicle station creation. + // Don't create the station if the pad is hidden by the current mission type. + //error("CURRENT MISSION TYPE: " @ $CurrentMissionType @ ", ALLOWED TYPE: " @ %obj.missionTypesList); + if($CurrentMissionType $= %obj.missionTypesList || %obj.missionTypesList $="") + %this.schedule(0, "createStationVehicle", %obj); + //------------------------------------------------------------------------- +} + +function StationVehiclePad::createStationVehicle(%data, %obj) +{ + // z0dd - ZOD - Founder(founder@mechina.com), 4/20/02 + // This code used to be called from StationVehiclePad::onAdd + // This was changed so we can add the station to the mission group + // so it gets powered properly and auto cleaned up at mission end + + // Get the v-pads mission group so we can place the station in it. + %group = %obj.getGroup(); + + // Set the default transform based on the vehicle pads slot + %xform = %obj.getSlotTransform(0); + %position = getWords(%xform, 0, 2); + %rotation = getWords(%xform, 3, 5); + %angle = (getWord(%xform, 6) * 180) / 3.14159; + + // Place these parameter's in the v-pad datablock located in mis file. + // If the mapper doesn't move the station, use the default location. + if(%obj.stationPos $= "" || %obj.stationRot $= "") + { + %pos = %position; + %rot = %rotation @ " " @ %angle; + } + else + { + %pos = %obj.stationPos; + %rot = %obj.stationRot; + } + + %sv = new StaticShape() { + scale = "1 1 1"; + dataBlock = "StationVehicle"; + lockCount = "0"; + homingCount = "0"; + team = %obj.team; + position = %pos; + rotation = %rot; + }; + + // Add the station to the v-pads mission group for cleanup and power. + %group.add(%sv); + %sv.setPersistent(false); // set the station to not save. + + // Apparently called to early on mission load done, call it now. + %sv.getDataBlock().gainPower(%sv); + + // Create the trigger + %sv.getDataBlock().createTrigger(%sv); + %sv.pad = %obj; + %obj.station = %sv; + %sv.trigger.mainObj = %obj; + %sv.trigger.disableObj = %sv; + + // Set the sensor group. + if(%sv.getTarget() != -1) + setTargetSensorGroup(%sv.getTarget(), %obj.team); + + //Remove unwanted vehicles + if(%obj.scoutVehicle !$= "Removed") + %sv.vehicle[scoutvehicle] = true; + if(%obj.assaultVehicle !$= "Removed") + %sv.vehicle[assaultVehicle] = true; + if(%obj.mobileBaseVehicle !$= "Removed") + { + %sv.vehicle[mobileBasevehicle] = true; + // z0dd - ZOD, 4/20/02. Enable MPB Teleporter. + %sv.getDataBlock().createTeleporter(%sv, %group); + } + if(%obj.scoutFlyer !$= "Removed") + %sv.vehicle[scoutFlyer] = true; + if(%obj.bomberFlyer !$= "Removed") + %sv.vehicle[bomberFlyer] = true; + if(%obj.hapcFlyer !$= "Removed") + %sv.vehicle[hapcFlyer] = true; +} + +function StationVehiclePad::onEndSequence(%data, %obj, %thread) +{ + if(%thread == $ActivateThread) + { + %obj.ready = true; + %obj.stopThread($ActivateThread); + } + Parent::onEndSequence(%data, %obj, %thread); +} + +//////////////////////////////////////////////////////////////////////////////// +/// -Mobile Base Inventory- //////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +/// -Mobile Base- ////////////////////////////////////////////////////////////// +//Function -- onAdd (%this, %obj) +// %this = Object data block +// %obj = Object being added +//Decription -- Called when the object is added to the mission +//////////////////////////////////////////////////////////////////////////////// +function MobileInvStation::onAdd(%this, %obj) +{ +} + +function MobileInvStation::createTrigger(%this, %obj) +{ + Parent::onAdd(%this, %obj); + + %obj.setRechargeRate(%obj.getDatablock().rechargeRate); + %trigger = new Trigger() + { + dataBlock = stationTrigger; + polyhedron = "-0.75 0.75 0.1 1.5 0.0 0.0 0.0 -1.5 0.0 0.0 0.0 2.3"; + }; + MissionCleanup.add(%trigger); + %trigger.setTransform(%obj.vehicle.getSlotTransform(2)); + + %trigger.station = %obj; + %trigger.mainObj = %obj; + %trigger.disableObj = %obj; + + %obj.trigger = %trigger; +// createTarget(%obj, 'Inventory Station', "", "", 'Station', 0, 0); +} + +/// -Mobile Base- ////////////////////////////////////////////////////////////// +//Function -- stationReady(%data, %obj) +// %data = Station Data Block +// %obj = Station Object +//Decription -- Called when station has been triggered and animation is +// completed +//////////////////////////////////////////////////////////////////////////////// +function MobileInvStation::stationReady(%data, %obj) +{ + //Display the Inventory Station GUI here + %obj.notReady = 1; + %obj.inUse = "Down"; + %obj.schedule(200,"playThread",$ActivateThread,"activate1"); + %obj.getObjectMount().playThread($ActivateThread,"Activate"); + %player = %obj.triggeredBy; + %energy = %player.getEnergyLevel(); + %player.setCloaked(true); + %player.schedule(900, "setCloaked", false); + if (!%player.client.isAIControlled()) + buyFavorites(%player.client); + + %player.setEnergyLevel(%energy); +} + +/// -Mobile Base- ////////////////////////////////////////////////////////////// +//Function -- stationFinished(%data, %obj) +// %data = Station Data Block +// %obj = Station Object +//Decription -- Called when player has left the station +//////////////////////////////////////////////////////////////////////////////// +function MobileInvStation::stationFinished(%data, %obj) +{ + //Hide the Inventory Station GUI +} + +/// -Mobile Base- ////////////////////////////////////////////////////////////// +//Function -- getSound(%data, %forward) +// %data = Station Data Block +// %forward = direction the animation is playing +//Decription -- This sound will be played at the same time as the activate +// animation. +//////////////////////////////////////////////////////////////////////////////// +function MobileInvStation::getSound(%data, %forward) +{ + if(%forward) + return "MobileBaseInventoryActivateSound"; + else + return false; +} + +/// -Mobile Base- ////////////////////////////////////////////////////////////// +//Function -- setPlayerPosition(%data, %obj, %trigger, %colObj) +// %data = Station Data Block +// %obj = Station Object +// %trigger = Stations trigger +// %colObj = Object that is at the station +//Decription -- Called when player enters the trigger. Used to set the player +// in the center of the station. +//////////////////////////////////////////////////////////////////////////////// +function MobileInvStation::setPlayersPosition(%data, %obj, %trigger, %colObj) +{ + %vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0"; + if((VectorLen(%vel) < 36) && (%obj.triggeredBy != %colObj)) // z0dd - ZOD, 12/09/02. global contact vel. Was 22. + { + %pos = %trigger.position; + %colObj.setvelocity("0 0 0"); + %rot = getWords(%colObj.getTransform(),3, 6); +// %colObj.setTransform(getWord(%pos,0) @ " " @ getWord(%pos,1) - 0.75 @ " " @ getWord(%pos,2)+0.7 @ " " @ %rot);//center player on object + %colObj.setTransform(getWord(%pos,0) @ " " @ getWord(%pos,1) @ " " @ getWord(%pos,2)+0.8 @ " " @ %rot);//center player on object + %colObj.setMoveState(true); + %colObj.schedule(1600,"setMoveState", false); + %colObj.setvelocity("0 0 0"); + return true; + } + return false; +} + +function MobileInvStation::onDamage() +{ +} + +function MobileInvStation::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType) +{ + //If vehicle station is hit then apply damage to the vehicle + %targetObject.getObjectMount().damage(%sourceObject, %position, %amount, %damageType); +} + +//////////////////////////////////////////////////////////////////////////////// +/// -Station Trigger- ////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +////-Station Trigger-/////////////////////////////////////////////////////////// +//Function -- onEnterTrigger (%data, %obj, %colObj) +// %data = Trigger Data Block +// %obj = Trigger Object +// %colObj = Object that collided with the trigger +//Decription -- Called when trigger has been triggered +//////////////////////////////////////////////////////////////////////////////// +function stationTrigger::onEnterTrigger(%data, %obj, %colObj) +{ + //make sure it's a player object, and that that object is still alive + if(%colObj.getDataBlock().className !$= "Armor" || %colObj.getState() $= "Dead") + return; + + // z0dd - ZOD, 7/13/02 Part of hack to keep people from mounting + // vehicles in disallowed armors. + if(%obj.station.getDataBlock().getName() !$= "StationVehicle") + %colObj.client.inInv = true; + + %colObj.inStation = true; + commandToClient(%colObj.client,'setStationKeys', true); + if(Game.stationOnEnterTrigger(%data, %obj, %colObj)) + { + //verify station.team is team associated and isn't on player's team + if((%obj.mainObj.team != %colObj.client.team) && (%obj.mainObj.team != 0)) + { + //%obj.station.playAudio(2, StationAccessDeniedSound); + messageClient(%colObj.client, 'msgStationDenied', '\c2Access Denied -- Wrong team.~wfx/powered/station_denied.wav'); + } + else if(%obj.disableObj.isDisabled()) + { + if ($CurrentMissionType $= "sctf") + DummyFunctionJustNeedsToBeSomethingHere::Station(); //Added so in SCtF, when stations are deleted, the trigger still doesnt messege the client. + else + messageClient(%colObj.client, 'msgStationDisabled', '\c2Station is disabled.'); + } + else if(!%obj.mainObj.isPowered()) + { + messageClient(%colObj.client, 'msgStationNoPower', '\c2Station is not powered.'); + } + else if(%obj.station.notDeployed) + { + messageClient(%colObj.client, 'msgStationNotDeployed', '\c2Station is not deployed.'); + } + else if(%obj.station.triggeredBy $= "") + { + if(%obj.station.getDataBlock().setPlayersPosition(%obj.station, %obj, %colObj)) + { + messageClient(%colObj.client, 'CloseHud', "", 'inventoryScreen'); + commandToClient(%colObj.client, 'TogglePlayHuds', true); + %obj.station.triggeredBy = %colObj; + %obj.station.getDataBlock().stationTriggered(%obj.station, 1); + %colObj.station = %obj.station; + %colObj.lastWeapon = ( %colObj.getMountedImage($WeaponSlot) == 0 ) ? "" : %colObj.getMountedImage($WeaponSlot).item; + %colObj.unmountImage($WeaponSlot); + } + } + } +} + +////-Station Trigger-/////////////////////////////////////////////////////////// +//Function -- onLeaveTrigger (%data, %obj, %colObj) +// %data = Trigger Data Block +// %obj = Trigger Object +// %colObj = Object that collided with the trigger +//Decription -- Called when trigger has been untriggered +//////////////////////////////////////////////////////////////////////////////// +function stationTrigger::onLeaveTrigger(%data, %obj, %colObj) +{ + if(%colObj.getDataBlock().className !$= "Armor") + return; + + // z0dd - ZOD, 7/13/02 Part of hack to keep people from mounting + // vehicles in disallowed armors. + %colObj.client.inInv = false; + + %colObj.inStation = false; + commandToClient(%colObj.client,'setStationKeys', false); + if(%obj.station) + { + if(%obj.station.triggeredBy == %colObj) + { + %obj.station.getDataBlock().stationFinished(%obj.station); + %obj.station.getDataBlock().endRepairing(%obj.station); + %obj.station.triggeredBy = ""; + %obj.station.getDataBlock().stationTriggered(%obj.station, 0); + + if(!%colObj.teleporting) + %colObj.station = ""; + + if(%colObj.getMountedImage($WeaponSlot) == 0 && !%colObj.teleporting) + { + if(%colObj.inv[%colObj.lastWeapon]) + %colObj.use(%colObj.lastWeapon); + else + %colObj.selectWeaponSlot( 0 ); + } + } + } +} + +////-Station Trigger-/////////////////////////////////////////////////////////// +//Function -- stationTriggered(%data, %obj, %isTriggered) +// %data = Station Data Block +// %obj = Station Object +// %isTriggered = 1 if triggered; 0 if status changed to +// untriggered +//Decription -- Called when a "station trigger" has been triggered or +// untriggered +//////////////////////////////////////////////////////////////////////////////// +function Station::stationTriggered(%data, %obj, %isTriggered) +{ + if(%isTriggered) + { + // ---------------------------------------------------------------------------- + // z0dd - ZOD, 6/20/03. Pop up veh station hud when player steps on veh pad + if(%obj.getDataBlock().getName() $= StationVehicle) + { + messageClient( %obj.triggeredBy.client, 'CloseHud', "", 'scoreScreen' ); + messageClient( %obj.triggeredBy.client, 'CloseHud', "", 'inventoryScreen' ); + commandToClient(%obj.triggeredBy.client, 'StationVehicleShowHud'); + } + // ---------------------------------------------------------------------------- + + %obj.setThreadDir($ActivateThread, TRUE); + %obj.playThread($ActivateThread,"activate"); + %obj.playAudio($ActivateSound, %data.getSound(true)); + %obj.inUse = "Up"; + } + else + { + if(%obj.getDataBlock().getName() !$= StationVehicle) + { + %obj.stopThread($ActivateThread); + if(%obj.getObjectMount()) + %obj.getObjectMount().stopThread($ActivateThread); + %obj.inUse = "Down"; + } + else + { + %obj.setThreadDir($ActivateThread, FALSE); + %obj.playThread($ActivateThread,"activate"); + %obj.playAudio($ActivateSound, %data.getSound(false)); + %obj.inUse = "Down"; + } + } +} + +////-Station-/////////////////////////////////////////////////////////////////// +//Function -- onEndSequence(%data, %obj, %thread) +// %data = Station Data Block +// %obj = Station Object +// %thread = Thread number that the animation is associated +// with / running on. +//Decription -- Called when an animation sequence is finished playing +//////////////////////////////////////////////////////////////////////////////// +function Station::onEndSequence(%data, %obj, %thread) +{ + if(%thread == $ActivateThread) + { + if(%obj.inUse $= "Up") + { + %data.stationReady(%obj); + %player = %obj.triggeredBy; + if(%data.doesRepair && !%player.stationRepairing && %player.getDamageLevel() != 0) { + %oldRate = %player.getRepairRate(); + %player.setRepairRate(%oldRate + 0.00625); + %player.stationRepairing = 1; + } + } + else + { + if(%obj.getDataBlock().getName() !$= MobileInvStation) + { + %obj.stopThread($ActivateThread); + %obj.inUse = "Down"; + } + } + } + Parent::onEndSequence(%data, %obj, %thread); +} + +////-Station-/////////////////////////////////////////////////////////////////// +//Function -- onCollision(%data, %obj, %colObj) +// %data = Station Data Block +// %obj = Station Object +// %colObj = Object that collided with the station +//Decription -- Called when an object collides with a station +//////////////////////////////////////////////////////////////////////////////// +function Station::onCollision(%data, %obj, %colObj) +{ + // Currently Not Needed +} + +////-Station-/////////////////////////////////////////////////////////////////// +//Function -- endRepairing(%data, %obj) +// %data = Station Data Block +// %obj = Station Object +//Decription -- Called to stop repairing the object +//////////////////////////////////////////////////////////////////////////////// +function Station::endRepairing(%data, %obj) +{ + if(%obj.triggeredBy.stationRepairing) + { + %oldRate = %obj.triggeredBy.getRepairRate(); + %obj.triggeredBy.setRepairRate(%oldRate - 0.00625); + %obj.triggeredBy.stationRepairing = 0; + } +} + +////-Station Trigger-/////////////////////////////////////////////////////////// +//Function -- onTickTrigger(%data, %obj) +// %data = Trigger Data Block +// %obj = Trigger Object +//Decription -- Called every tick if triggered +//////////////////////////////////////////////////////////////////////////////// +function stationTrigger::onTickTrigger(%data, %obj) +{ +} + +//****************************************************************************** +//* Station General - Functions * +//****************************************************************************** + +//function Station::onGainPowerEnabled(%data, %obj) + +function Station::onLosePowerDisabled(%data, %obj) +{ + Parent::onLosePowerDisabled(%data, %obj); + + // check to see if a player was using this station + %occupied = %obj.triggeredBy; + if(%occupied > 0) + { + if(%data.doesRepair) + %data.endRepairing(%obj); + // if it's a deployed station, stop "flashing panels" thread + if(%data.getName() $= DeployedStationInventory) + %obj.stopThread($ActivateThread); + // reset some attributes + %occupied.setCloaked(false); + %occupied.station = ""; + %occupied.inStation = false; + %obj.triggeredBy = ""; + // restore "toggle inventory hud" key + commandToClient(%occupied.client,'setStationKeys', false); + // re-mount last weapon or weapon slot 0 + if(%occupied.getMountedImage($WeaponSlot) == 0) + { + if(%occupied.inv[%occupied.lastWeapon]) + %occupied.use(%occupied.lastWeapon); + else + %occupied.selectWeaponSlot( 0 ); + } + } +} + +// z0dd - ZOD, 4/20/02 +// Pull these functions, they are unneeded because we changed the way +// Vehicle stations are added to the game, they are now treated the +// same as any other mapper added object. +//function StationVehiclePad::gainPower(%data, %obj) +//{ +// %obj.station.setSelfPowered(); + // z0dd - ZOD, 4/20/02 Repower the MPB Teleporter +// if(isObject(%obj.station.teleporter)) +// %obj.station.teleporter.setSelfPowered(); +// Parent::gainPower(%data, %obj); +//} + +//function StationVehiclePad::losePower(%data, %obj) +//{ +// %obj.station.clearSelfPowered(); + // z0dd - ZOD, 4/20/02 Kill the telepoters power too +// if(isObject(%obj.station.teleporter)) +// %obj.station.teleporter.clearSelfPowered(); +// Parent::losePower(%data, %obj); +//} + +//--------------------------------------------------------------------------- +// DeployedStationInventory: +//--------------------------------------------------------------------------- + +function DeployedStationInventory::stationReady(%data, %obj) +{ + %obj.notReady = 1; + %player = %obj.triggeredBy; + %obj.playThread($ActivateThread,"activate1"); + // function below found in inventoryHud.cs + if (!%player.client.isAIControlled()) + buyDeployableFavorites(%player.client); +} + +function DeployedStationInventory::stationFinished(%data, %obj) +{ +} + +function DeployedStationInventory::setPlayersPosition(%data, %obj, %trigger, %colObj) +{ + %vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0"; + if((VectorLen(%vel) < 36) && (%obj.triggeredBy != %colObj)) // z0dd - ZOD, 12/09/02. global contact vel. Was 22. + { + // ------------------------------------------------- + // z0dd - ZOD, 4/14/02. No view change at remote inv + %colObj.setvelocity("0 0 0"); + %colObj.setMoveState(true); + %colObj.schedule(400,"setMoveState", false); // z0dd - ZOD, 4/27/02. Equip at remote inv in 1/4 base time. Was 1600 + return true; + // ------------------------------------------------- + } + return false; +} + +function DeployedStationInventory::onDestroyed(%data, %obj, %prevState) +{ + // when a station is destroyed, we don't need its trigger any more + %obj.trigger.delete(); + // decrement team deployed count for this item + $TeamDeployedCount[%obj.team, InventoryDeployable]--; + + // z0dd - ZOD, 6/01/03. Delete the beacon too + if(isObject(%obj.beacon)) + %obj.beacon.schedule(500, delete); + + %obj.schedule(700, "delete"); + Parent::onDestroyed(%data, %obj, %prevState); +} + +/// -Deployable Inventory- ////////////////////////////////////////////////////////////// +//Function -- getSound(%data, %forward) +// %data = Station Data Block +// %forward = direction the animation is playing +//Decription -- This sound will be played at the same time as the activate +// animation. +//////////////////////////////////////////////////////////////////////////////// +function DeployedStationInventory::getSound(%data, %forward) +{ + if(%forward) + return "DepInvActivateSound"; + else + return false; +} + +//////////////////////////////////////////////////////////////////////////////// +/// z0dd - ZOD: Execute the MPB Teleporter code - ////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + +exec("scripts/mpbTeleporter.cs");