Beispiel #1
0
                public new void Enter(IemStateManager.StateManager sm)
                {
                    TargetPracticeStateManager gsm = (TargetPracticeStateManager)sm;

                    List <ReactiveTarget> targets = IemUtils.FindComponentsNearToLocation <ReactiveTarget>(gsm.location, 50);

                    foreach (var target in targets)
                    {
                        target.SetFlag(BaseEntity.Flags.On, false);
                    }

                    gsm.eg.EndGame();

                    double totalTime = 0;

                    foreach (TPGameLevel level in gsm.eg.gamelevels)
                    {
                        totalTime += level.LevelTime();
                    }

                    IemUI.CreateGameBanner(gsm.eg.player, "Game is complete! - your time was "
                                           + IemUtils.GetTimeFromSeconds(totalTime) + " seconds");


                    IemUI.Confirm(gsm.eg.player, "Game completed!\nreturn to the map",
                                  "Back",
                                  gsm.eg.backToTheMap);
                }
Beispiel #2
0
                public new void Enter(IemStateManager.StateManager sm)
                {
                    TargetPracticeStateManager gsm = (TargetPracticeStateManager)sm;

                    gsm.partition = new IemObjectPlacement.CopyPastePlacement(
                        "tp_v1_" + gsm.eg.difficultyLevel, gsm.location);

                    ResearchTable researchtable = IemUtils.FindComponentNearestToLocation <ResearchTable>(
                        gsm.location, 50);
                    Vector3 playerstart = researchtable.transform.position;

                    researchtable.Kill(BaseNetworkable.DestroyMode.None);
                    RepairBench repairbench = IemUtils.FindComponentNearestToLocation <RepairBench>(
                        gsm.location, 50);
                    Vector3 playerlook = repairbench.transform.position;

                    repairbench.Kill(BaseNetworkable.DestroyMode.None);

                    me.Puts("player start location is " + playerstart);
                    me.Puts("player look location is " + playerlook);
                    me.Puts("swutcged " + IemUtils.SwitchTypesToTarget <BaseOven>(gsm.location));

                    gsm.eg.player.inventory.Strip();

                    EntitiesTakingDamage += gsm.eg.PlayerImmortal;

                    IemUtils.MovePlayerToTeamLocation(gsm.eg.player,
                                                      playerstart);

                    Vector3    relativePos = playerstart - playerlook;
                    Quaternion rotation    = Quaternion.LookRotation(relativePos);

                    gsm.eg.player.transform.rotation = rotation;

                    IemUtils.SetMetabolismValues(gsm.eg.player);
                    IemUtils.ClearInventory(gsm.eg.player);

                    IemUI.CreateGameBanner(gsm.eg.player, "GAME LOBBY");

                    IemUtils.PlaySound(gsm.eg.player);

                    gsm.eg.returnZone = new IemUtils.ReturnZone(playerstart, gsm.eg.player);

                    IemUI.Confirm(gsm.eg.player, $"Weclome to target practice\n" +
                                  $"Knock down the targets to proceed to the next level.\n" +
                                  $"each level timer will start when you fire the first shot", "Start Shootin'",
                                  gsm.proceedAction);

                    gsm.eg.targets = IemUtils.FindComponentsNearToLocation <ReactiveTarget>(gsm.location, 50);
                    me.Puts("targets count is " + gsm.eg.targets.Count());
                }