1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144 |
- #include "pch.h"
- #include "Mission3.h"
- #include "Training.h"
- #include "GoalList.h"
- #include "Predicate.h"
- #include "TrueCondition.h"
- #include "FalseCondition.h"
- #include "AndCondition.h"
- #include "OrCondition.h"
- #include "NotCondition.h"
- #include "PeriodicCondition.h"
- #include "ElapsedTimeCondition.h"
- #include "ObjectMovingTowardsCondition.h"
- #include "ObjectWithinRadiusCondition.h"
- #include "ObjectPointingAtCondition.h"
- #include "ConditionalAction.h"
- #include "ConditionList.h"
- #include "ActionList.h"
- #include "MessageAction.h"
- #include "PlaySoundAction.h"
- #include "SetCommandAction.h"
- #include "NoAction.h"
- #include "NTimesCondition.h"
- #include "EndMissionAction.h"
- #include "ResetAction.h"
- #include "ResetShipAction.h"
- #include "SoundFinishedCondition.h"
- #include "SetDisplayModeAction.h"
- #include "TurnShipAboutCondition.h"
- #include "GetRadarLODCondition.h"
- #include "SetRadarLODAction.h"
- #include "GetControlActiveCondition.h"
- #include "GetStateBitsCondition.h"
- #include "GetShipIsStoppedCondition.h"
- #include "GetShipIsDestroyedCondition.h"
- #include "SetControlConstraintsAction.h"
- #include "SetControlsAction.h"
- #include "GetAutopilotCondition.h"
- #include "SetAutopilotAction.h"
- #include "SetSignatureAction.h"
- #include "GetTargetCondition.h"
- #include "CommandAcknowledgedCondition.h"
- #include "GetCommandCondition.h"
- #include "ReleaseConsumerAction.h"
- #include "CreateProbeAction.h"
- #include "CreateWaypointAction.h"
- #include "SetHUDOverlayAction.h"
- #include "GetKeyCondition.h"
- #include "ProxyCondition.h"
- #include "TurnToAction.h"
- #include "ToggleWeaponAction.h"
- #include "SwapWeaponAction.h"
- #include "DoDamageAction.h"
- #include "CurrentTarget.h"
- #include "PlayerShipTarget.h"
- #include "RepairRearmAction.h"
- #include "ShowPaneAction.h"
- namespace Training
- {
-
-
-
- Mission3::~Mission3 (void)
- {
- }
-
- int Mission3::GetMissionID (void)
- {
- return c_TM_3_Basic_Weaponry;
- }
-
- SectorID Mission3::GetStartSectorID (void)
- {
- return 1010;
- }
-
- bool Mission3::RecordKeyPress (TrekKey key)
- {
- switch (key)
- {
- case TK_TargetCenter:
- if (trekClient.flyingF())
- {
- IshipIGC* pShip = trekClient.GetShip ();
- const Orientation* pOrientation = &(pShip->GetOrientation());
- ImodelIGC* pTarget = FindTarget ( pShip,
- c_ttFront | c_ttShip | c_ttEnemy,
- pShip->GetCommandTarget (c_cmdCurrent),
- NULL, NULL, pOrientation);
- GetWindow ()->SetTarget(pTarget, c_cidNone);
- }
- return false;
- case TK_SwapWeapon1:
- case TK_SwapWeapon2:
- case TK_SwapWeapon3:
- case TK_SwapWeapon4:
- case TK_SwapTurret1:
- case TK_SwapTurret2:
- case TK_SwapTurret3:
- case TK_SwapTurret4:
- case TK_SwapMissile:
- case TK_SwapChaff:
- case TK_SwapShield:
- case TK_SwapCloak:
- case TK_SwapAfterburner:
- case TK_SwapMine:
- case TK_NextCargo:
- case TK_ToggleWeapon1:
- case TK_ToggleWeapon2:
- case TK_ToggleWeapon3:
- case TK_ToggleWeapon4:
- case TK_DropCargo:
- case TK_Reload:
- case TK_ToggleGroupFire:
- case TK_PrevWeapon:
- case TK_NextWeapon:
- case TK_PrevPart:
- case TK_NextPart:
- case TK_MountPart:
- case TK_ReplacePart:
- case TK_UnmountPart:
- case TK_DropPart:
- {
-
- TrekWindow* pWindow = GetWindow ();
- if (pWindow->GetOverlayFlags () bit_and ofInventory)
- return true;
- return false;
- }
- }
- return TrainingMission::RecordKeyPress (key);
- }
-
- bool Mission3::ShipLanded (void)
- {
- Terminate ();
- return false;
- }
-
- void Mission3::CreateUniverse (void)
- {
- LoadUniverse ("training_1", 414, 1010);
-
- ImissionIGC* pCore = trekClient.GetCore();
- Time now = pCore->GetLastUpdate();
- IshipIGC* pShip = trekClient.GetShip();
- ImodelIGC* pStation = pCore->GetModel (OT_station, 1010);
-
- IpartIGC* pPart = pShip->GetMountedPart (ET_Weapon, 0);
- if (pPart)
- pPart->Terminate ();
-
- AddPartToShip (92, 0, 0);
-
- pPart = pShip->GetMountedPart (ET_Magazine, 0);
- if (pPart)
- pPart->Terminate ();
-
- trekClient.SetSelectedWeapon (0);
- trekClient.fGroupFire = false;
-
- IsideIGC* pSide = pShip->GetSide ();
- GlobalAttributeSet gas = pSide->GetGlobalAttributeSet ();
- gas.SetAttribute (c_gaMaxEnergy, 0.25f);
- pSide->SetGlobalAttributeSet (gas);
-
- IshipIGC* pCommander = pCore->GetShip (m_commanderID);
- pCommander->SetStation (static_cast<IstationIGC*> (pStation));
- pCommander->SetCommand (c_cmdAccepted, NULL, c_cidDoNothing);
- pCommander->SetCommand (c_cmdCurrent, NULL, c_cidDoNothing);
- pCommander->SetAutopilot (false);
-
-
- Vector direction (1.0f, 0.0f, 0.0f);
- for (int i = 0; i < TM_NUMBER_OF_DERELICTS; i++)
- {
- float fRadius = 200.0f + (static_cast<float> (i) * 25.0f);
- Vector newPosition = direction * fRadius;
- HullID hullID;
- switch (randomInt (0, 2))
- {
- case 0:
- hullID = 800;
- break;
- case 1:
- case 2:
- hullID = 801;
- break;
- }
- char name[32];
- sprintf (name, "Derelict %02d", i + 1);
- m_derelict_hulls[i] = pCore->GenerateNewShipID ();
- IshipIGC* pShip = CreateDrone (name, m_derelict_hulls[i], hullID, 1, c_ptPlayer);
- pShip->SetAutopilot (false);
- pShip->SetPosition (newPosition);
-
- pShip->SetOrientation (Orientation (pShip->GetOrientation ().GetForward (), direction * -1.0f));
- pShip->SetCluster (pCore->GetCluster(1010));
- direction = Vector::RandomDirection ();
- }
- }
-
- Condition* Mission3::CreateMission (void)
- {
-
- GoalList* pGoalList = new GoalList;
- Goal* pGoal = new Goal (pGoalList);
-
- ImodelIGC* pShip = static_cast<ImodelIGC*> (trekClient.GetShip ());
- TurnToAction* pTurnToAction = new TurnToAction (pShip, OT_station, 1010);
- ObjectWithinRadiusCondition* pObjectWithinRadiusCondition = new ObjectWithinRadiusCondition (pShip, OT_station, 1010, 7500.0f);
- ObjectWithinRadiusCondition* pObjectWithinRadiusCondition2 = new ObjectWithinRadiusCondition (pShip, OT_station, 1010, 7000.0f);
- ConditionalAction* pConditionalAction = new ConditionalAction (new NotCondition (pObjectWithinRadiusCondition), pTurnToAction);
- ConditionalAction* pConditionalAction2 = new ConditionalAction (new AndCondition (new NotCondition (pObjectWithinRadiusCondition2), new ProxyCondition (pObjectWithinRadiusCondition)), new SetControlsAction);
- pGoal->AddConstraintCondition (pConditionalAction);
- pGoal->AddConstraintCondition (pConditionalAction2);
-
- pGoalList->AddGoal (CreateGoal01 ());
- pGoalList->AddGoal (CreateGoal02 ());
- pGoalList->AddGoal (CreateGoal03 ());
- pGoalList->AddGoal (CreateGoal04 ());
- pGoalList->AddGoal (CreateGoal05 ());
- pGoalList->AddGoal (CreateGoal06 ());
- pGoalList->AddGoal (CreateGoal07 ());
- pGoalList->AddGoal (CreateGoal08 ());
- pGoalList->AddGoal (CreateGoal09 ());
- pGoalList->AddGoal (CreateGoal10 ());
- pGoalList->AddGoal (CreateGoal11 ());
- pGoalList->AddGoal (CreateGoal12 ());
- pGoalList->AddGoal (CreateGoal13 ());
-
- return pGoal;
- }
-
- Condition* Mission3::CreateGotTargetCondition (void)
- {
-
- Condition* pTargetCondition[TM_NUMBER_OF_DERELICTS];
- for (int i = 0; i < TM_NUMBER_OF_DERELICTS; i++)
- pTargetCondition[i] = new GetTargetCondition (trekClient.GetShip(), OT_ship, m_derelict_hulls[i]);
-
- Condition* pTmpCondition = pTargetCondition[0];
- for (i = 1; i < TM_NUMBER_OF_DERELICTS; i++)
- pTmpCondition = new OrCondition (pTmpCondition, pTargetCondition[i]);
-
- return pTmpCondition;
- }
-
- Goal* Mission3::CreateGoal01 (void)
- {
- GoalList* pGoalList = new GoalList;
-
- {
- Goal* pGoal = CreatePlaySoundGoal (salCommenceScanSound);
- SetControlConstraintsAction* pSetControlConstraintsAction = new SetControlConstraintsAction;
- pSetControlConstraintsAction->DisableInputAction (0xffffffff ^ selectedWeaponMaskIGC);
- pSetControlConstraintsAction->ScaleInputControl (c_axisYaw, 0.0f);
- pSetControlConstraintsAction->ScaleInputControl (c_axisPitch, 0.0f);
- pSetControlConstraintsAction->ScaleInputControl (c_axisRoll, 0.0f);
- pSetControlConstraintsAction->ScaleInputControl (c_axisThrottle, 0.0f);
- pGoal->AddStartAction (pSetControlConstraintsAction);
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (2.0f)));
-
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_01Sound));
-
- {
- Goal* pGoal = new Goal (new ElapsedTimeCondition (1.0f));
- pGoal->AddStartAction (new SetDisplayModeAction (TrekWindow::cmCockpit));
- pGoalList->AddGoal (pGoal);
- }
-
-
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_02Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_03Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
- return new Goal (pGoalList);
- }
-
- Goal* Mission3::CreateGoal02 (void)
- {
- GoalList* pGoalList = new GoalList;
-
-
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_04Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
-
-
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_05Sound);
- pGoal->AddStartAction (new SetHUDOverlayAction (ShieldTrainingOverlay));
- pGoalList->AddGoal (pGoal);
- }
-
- {
- Goal* pGoal = new Goal (new ElapsedTimeCondition (1.0f));
- pGoal->AddConstraintCondition (new ConditionalAction (new TrueCondition, new DoDamageAction (false)));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_06Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (4.0f)));
-
-
-
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_07Sound);
- pGoal->AddStartAction (new SetHUDOverlayAction (HullTrainingOverlay));
- pGoalList->AddGoal (pGoal);
- }
-
- {
- Goal* pGoal = new Goal (new ElapsedTimeCondition (1.0f));
- pGoal->AddConstraintCondition (new ConditionalAction (new TrueCondition, new DoDamageAction (true)));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (1.5f)));
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_08Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_09Sound);
- pGoal->AddStartAction (new SetHUDOverlayAction (NoTrainingOverlay));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
- return new Goal (pGoalList);
- }
-
- Goal* Mission3::CreateGoal03 (void)
- {
- GoalList* pGoalList = new GoalList;
-
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_10Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_11Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
-
- {
- Goal *pGoal = new Goal (CreateGotTargetCondition ());
- pGoal->AddStartAction (new MessageAction ("Press the C key to target the derelict hull nearest the center of your display."));
- pGoal->AddStartAction (new PlaySoundAction (tm_3_11rSound));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_11Sound));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_12Sound);
- SetControlConstraintsAction* pSetControlConstraintsAction = new SetControlConstraintsAction;
- pSetControlConstraintsAction->ScaleInputControl (c_axisYaw, 1.0f);
- pSetControlConstraintsAction->ScaleInputControl (c_axisPitch, 1.0f);
- pSetControlConstraintsAction->ScaleInputControl (c_axisRoll, 1.0f);
- pGoal->AddStartAction (pSetControlConstraintsAction);
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
-
- {
- Goal* pGoal = new Goal (new GetKeyCondition (TK_FireWeapon));
- pGoal->AddStartAction (new MessageAction ("Press the SPACEBAR when you are ready to proceed."));
- pGoal->AddStartAction (new PlaySoundAction (tm_3_12rSound));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_12rSound));
- pGoalList->AddGoal (pGoal);
- }
-
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
- return new Goal (pGoalList);
- }
-
- Goal* Mission3::CreateGoal04 (void)
- {
- GoalList* pGoalList = new GoalList;
-
-
-
-
-
-
-
-
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_13Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
-
-
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_14Sound);
- pGoal->AddStartAction (new SetHUDOverlayAction (TargetTrainingOverlay));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- {
- Goal* pGoal = new Goal (new GetKeyCondition (TK_FireWeapon));
- pGoal->AddStartAction (new MessageAction ("Press the SPACEBAR when you are ready to proceed."));
- pGoal->AddStartAction (new PlaySoundAction (tm_3_15Sound));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_15Sound));
- pGoalList->AddGoal (pGoal);
- }
-
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
- return new Goal (pGoalList);
- }
-
- Goal* Mission3::CreateGoal05 (void)
- {
- GoalList* pGoalList = new GoalList;
-
-
-
-
-
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_16Sound);
- pGoal->AddStartAction (new SetHUDOverlayAction (ReticuleTrainingOverlay));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
- {
- ObjectPointingAtCondition* pObjectPointingAtCondition = new ObjectPointingAtCondition (static_cast<ImodelIGC*> (trekClient.GetShip ()), new CurrentTarget (new PlayerShipTarget));
- Goal* pGoal = new Goal (pObjectPointingAtCondition);
- pObjectPointingAtCondition->SetMinimumAngle (1.0f);
- TurnToAction* pTurnToAction = new TurnToAction (trekClient.GetShip (), new CurrentTarget (new PlayerShipTarget));
- ConditionalAction* pConditionalAction = new ConditionalAction (new TrueCondition, pTurnToAction);
- pGoal->AddConstraintCondition (pConditionalAction);
- pGoalList->AddGoal (pGoal);
- }
-
- {
- Goal* pGoal = new Goal (new ElapsedTimeCondition (0.5f));
- SetControlsAction* pSetControlsAction = new SetControlsAction;
- pSetControlsAction->SetInputControl (c_axisYaw, -0.5f);
- pGoal->AddStartAction (pSetControlsAction);
- pGoalList->AddGoal (pGoal);
- }
-
- {
- ObjectPointingAtCondition* pObjectPointingAtCondition = new ObjectPointingAtCondition (static_cast<ImodelIGC*> (trekClient.GetShip ()), new CurrentTarget (new PlayerShipTarget));
- Goal* pGoal = new Goal (pObjectPointingAtCondition);
- pObjectPointingAtCondition->SetMinimumAngle (1.0f);
- TurnToAction* pTurnToAction = new TurnToAction (trekClient.GetShip (), new CurrentTarget (new PlayerShipTarget));
- ConditionalAction* pConditionalAction = new ConditionalAction (new TrueCondition, pTurnToAction);
- pGoal->AddConstraintCondition (pConditionalAction);
- pGoalList->AddGoal (pGoal);
- }
-
- {
- Goal* pGoal = new Goal (new ElapsedTimeCondition (0.5f));
- SetControlsAction* pSetControlsAction = new SetControlsAction;
- pGoal->AddStartAction (pSetControlsAction);
- pGoalList->AddGoal (pGoal);
- }
-
-
-
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_17Sound);
- pGoal->AddStartAction (new SetHUDOverlayAction (NoTrainingOverlay));
- pGoalList->AddGoal (pGoal);
- }
-
- {
- Goal* pGoal = new Goal (new ElapsedTimeCondition (0.5f));
- SetControlConstraintsAction* pSetControlConstraintsAction = new SetControlConstraintsAction;
- pSetControlConstraintsAction->EnableInputAction (weaponsMaskIGC);
- pGoal->AddStartAction (pSetControlConstraintsAction);
- pGoalList->AddGoal (pGoal);
- }
-
- {
- Goal* pGoal = new Goal (new GetStateBitsCondition (trekClient.GetShip(), weaponsMaskIGC));
- if (GetWindow ()->GetInputEngine ()->GetJoystickCount () > 0)
- {
-
-
-
- pGoal->AddStartAction (new PlaySoundAction (tm_3_18Sound));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_18Sound));
- pGoal->AddStartAction (new MessageAction ("Fire the main weapon by pressing the trigger button on your joystick."));
- }
- else
- {
-
-
- pGoal->AddStartAction (new PlaySoundAction (tm_3_19Sound));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_19Sound));
- pGoal->AddStartAction (new MessageAction ("Fire the main weapon by pressing the SPACEBAR."));
- }
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_20Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
- return new Goal (pGoalList);
- }
-
- Goal* Mission3::CreateGoal06 (void)
- {
- GoalList* pGoalList = new GoalList;
-
-
-
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_21Sound);
- pGoal->AddStartAction (new SetHUDOverlayAction (EnergyTrainingOverlay));
-
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_22Sound);
-
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_23Sound);
- pGoal->AddStartAction (new SetHUDOverlayAction (TargetTrainingOverlay));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- {
- Goal* pGoal = new Goal (new GetShipIsDestroyedCondition (new CurrentTarget (new PlayerShipTarget, true)));
- pGoal->AddStartAction (new MessageAction ("Destroy current target."));
- pGoal->AddStartAction (new PlaySoundAction (tm_3_23rSound));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_23rSound));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_24Sound);
- pGoal->AddStartAction (new SetHUDOverlayAction (NoTrainingOverlay));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
- return new Goal (pGoalList);
- }
-
- Goal* Mission3::CreateGoal07 (void)
- {
- GoalList* pGoalList = new GoalList;
-
-
-
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_25Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
-
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_26Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- {
- Goal* pGoal = new Goal (new GetKeyCondition (TK_TargetEnemy));
- pGoal->AddStartAction (new MessageAction ("Target an enemy using the E key."));
- pGoal->AddStartAction (new PlaySoundAction (tm_3_27Sound));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_27Sound));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
-
-
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_28Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- {
- ObjectPointingAtCondition* pObjectPointingAtCondition = new ObjectPointingAtCondition (static_cast<ImodelIGC*> (trekClient.GetShip ()), new CurrentTarget (new PlayerShipTarget));
- Goal* pGoal = new Goal (pObjectPointingAtCondition);
- pGoal->AddStartAction (new PlaySoundAction (tm_3_29Sound));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_29Sound));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_30Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
- return new Goal (pGoalList);
- }
-
- Goal* Mission3::CreateGoal08 (void)
- {
- GoalList* pGoalList = new GoalList;
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_31Sound);
- pGoal->AddStartAction (new ToggleWeaponAction (1));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- {
- Goal* pGoal = new Goal (new GetStateBitsCondition (trekClient.GetShip(), weaponsMaskIGC));
- if (GetWindow ()->GetInputEngine ()->GetJoystickCount () > 0)
- pGoal->AddStartAction (new MessageAction ("Fire the main weapon by pressing the trigger button on your joystick."));
- else
- pGoal->AddStartAction (new MessageAction ("Fire the main weapon by pressing the SPACEBAR."));
- pGoal->AddStartAction (new PlaySoundAction (tm_3_31rSound));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_31rSound));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_32Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_33Sound);
- pGoal->AddStartAction (new SetHUDOverlayAction (AmmoTrainingOverlay));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- {
- Goal* pGoal = new Goal (new GetShipIsDestroyedCondition (new CurrentTarget (new PlayerShipTarget, true)));
- pGoal->AddStartAction (new MessageAction ("Destroy current target."));
- pGoal->AddStartAction (new PlaySoundAction (tm_3_34Sound));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_34Sound));
- pGoal->AddStartAction (new SetHUDOverlayAction (NoTrainingOverlay));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- {
- ObjectPointingAtCondition* pObjectPointingAtCondition = new ObjectPointingAtCondition (static_cast<ImodelIGC*> (trekClient.GetShip ()), new CurrentTarget (new PlayerShipTarget));
- Goal* pGoal = new Goal (pObjectPointingAtCondition);
- pGoal->AddStartAction (new PlaySoundAction (tm_3_35Sound));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_35Sound));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
- return new Goal (pGoalList);
- }
-
- Goal* Mission3::CreateGoal09 (void)
- {
- GoalList* pGoalList = new GoalList;
-
-
-
-
-
-
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_36Sound);
- pGoal->AddStartAction (new SwapWeaponAction (ET_Magazine, 0));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
- {
- Goal* pGoal = new Goal (new GetStateBitsCondition (trekClient.GetShip(), missileFireIGC));
- if (GetWindow ()->GetInputEngine ()->GetJoystickCount () > 0)
- {
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_37Sound));
- pGoal->AddStartAction (new MessageAction ("Fire missiles by pressing the #2 button on your joystick."));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_37Sound));
- }
- else
- {
-
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_38Sound));
- pGoal->AddStartAction (new MessageAction ("Fire missiles by pressing CTRL+SPACEBAR."));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_38Sound));
- }
- SetControlConstraintsAction* pSetControlConstraintsAction = new SetControlConstraintsAction;
- pSetControlConstraintsAction->EnableInputAction (missileFireIGC);
- pGoal->AddStartAction (pSetControlConstraintsAction);
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_39Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- {
- Goal* pGoal = new Goal (new GetShipIsDestroyedCondition (new CurrentTarget (new PlayerShipTarget, true)));
- pGoal->AddStartAction (new MessageAction ("Destroy current target."));
- pGoal->AddStartAction (new PlaySoundAction (tm_3_23rSound));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_23rSound));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_40Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
- return new Goal (pGoalList);
- }
-
- Goal* Mission3::CreateGoal10 (void)
- {
- GoalList* pGoalList = new GoalList;
-
-
-
-
-
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_41Sound);
- pGoal->AddStartAction (new ShowPaneAction (ofInventory));
- pGoal->AddStartAction (new SetHUDOverlayAction (InventoryTrainingOverlay));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_42Sound);
- pGoal->AddStartAction (new SetHUDOverlayAction (NoTrainingOverlay));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- {
- Goal* pGoal = new Goal (new GetKeyCondition (TK_CommandFinishTM));
- pGoal->AddStartAction (new MessageAction ("Press the END key when you are comfortable with the Inventory Display."));
- pGoal->AddStartAction (new PlaySoundAction (tm_3_42rSound));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_42rSound));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_43Sound);
- pGoal->AddStartAction (new SetHUDOverlayAction (KillBonusTrainingOverlay));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
-
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_44Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
- return new Goal (pGoalList);
- }
-
- Goal* Mission3::CreateGoal11 (void)
- {
- GoalList* pGoalList = new GoalList;
-
-
-
-
-
-
- {
- Goal* pGoal = CreatePlaySoundGoal (tm_3_45Sound);
- SetControlConstraintsAction* pSetControlConstraintsAction = new SetControlConstraintsAction;
- pSetControlConstraintsAction->EnableInputAction (0xffffffff);
- pSetControlConstraintsAction->ScaleInputControl (c_axisThrottle, 1.0f);
- pGoal->AddStartAction (new SetHUDOverlayAction (NoTrainingOverlay));
- pGoal->AddStartAction (pSetControlConstraintsAction);
- pGoal->AddStartAction (new ToggleWeaponAction (1));
- pGoal->AddStartAction (new RepairRearmAction);
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- {
- Goal* pGoal = new Goal (new GetKeyCondition (TK_CommandFinishTM));
- pGoal->AddStartAction (new MessageAction ("Press the END key when you are ready to go home."));
- pGoal->AddStartAction (new PlaySoundAction (tm_3_46Sound));
- pGoal->AddConstraintCondition (CreateTooLongCondition (120.0f, tm_3_46Sound));
- pGoalList->AddGoal (pGoal);
- }
-
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
- return new Goal (pGoalList);
- }
-
- Goal* Mission3::CreateGoal12 (void)
- {
- GoalList* pGoalList = new GoalList;
-
-
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_47Sound));
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
-
-
- {
- Goal* pGoal = new Goal (new GetTargetCondition (trekClient.GetShip(), OT_station, 1010));
- pGoal->AddStartAction (new MessageAction ("Press the B key to target the outpost."));
- pGoal->AddStartAction (new PlaySoundAction (tm_3_48Sound));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_48Sound));
- pGoalList->AddGoal (pGoal);
- }
-
- pGoalList->AddGoal (new Goal (new ElapsedTimeCondition (0.5f)));
- return new Goal (pGoalList);
- }
-
- Goal* Mission3::CreateGoal13 (void)
- {
- GoalList* pGoalList = new GoalList;
-
-
-
-
-
- pGoalList->AddGoal (CreatePlaySoundGoal (tm_3_49Sound));
-
-
- {
- Goal* pGoal = new Goal (new FalseCondition);
- pGoal->AddStartAction (new MessageAction ("Land in a green hangar to complete the mission."));
- pGoal->AddConstraintCondition (CreateTooLongCondition (30.0f, tm_3_49rSound));
- pGoalList->AddGoal (pGoal);
- }
- return new Goal (pGoalList);
- }
-
- }
|