Exemple #1
0
 public LaunchPoint(int i, int j, string n, Mod m, bool originFound, Dimensions.Dimensions dim)
 {
     if (originFound)
     {
         position     = new Vector2(i, j);
         name         = n;
         mod          = m;
         dimension    = dim;
         needPlatform = false;
     }
     else
     {
         Tile below = Framing.GetTileSafely(i, j - 1);
         Tile above = Framing.GetTileSafely(i, j + 1);
         try
         {
             int aboveCheck = above.type == ModContent.GetInstance <LaunchConsole>().Type ? 2 : 0;
             int belowCheck = below.type == ModContent.GetInstance <LaunchConsole>().Type ? 1 : 0;
             int newJ       = j + aboveCheck + belowCheck;
             position     = new Vector2(i, newJ);
             name         = n;
             mod          = m;
             dimension    = dim;
             needPlatform = false;
         }
         catch
         {
             Main.NewText(above.type + " " + below.type + " " + n + " " + m.DisplayName);
         }
     }
 }
        //If origin == destination don't do the space sequence
        //Change spawn, takeoff, teleport, inflight, teleport, landing, changemount, mobilise
        public static SequenceQueue ConstructSpaceSequence(Dimensions.Dimensions origin, Dimensions.Dimensions destination, Player player, Vector2 destLoc, bool addPlatform = false)
        {
            SequenceQueue queue = new SequenceQueue(Sequence.InSpace);

            queue.Append(new ImmobiliseItem());
            queue.Append(new SpawnChangeItem(destLoc, player));
            queue.Append(new ShipTakeOffItem(player));
            if (origin != destination)
            {
                queue.Append(new ChangeDimensionItem(Dimensions.Dimensions.Travel));
                queue.Append(new TeleportItem(spaceLocation, player));
                queue.Append(new ShipTravelItem((origin, destination), player));
                queue.Append(new ChangeDimensionItem(destination));
            }
            if (addPlatform)
            {
                queue.Append(new AddPlatformItem(destLoc / 16f, destination));
            }
            queue.Append(new TeleportItem(destLoc, player));

            queue.Append(new ShipLandItem(player));
            queue.Append(new ChangeMountItem(player));
            queue.Append(new MobiliseItem());
            return(queue);
        }
Exemple #3
0
 public LaunchPoint(Vector2 v, string n, Mod m, Dimensions.Dimensions dim, bool np = false)
 {
     position     = v;
     name         = n;
     mod          = m;
     dimension    = dim;
     needPlatform = np;
 }
Exemple #4
0
 public void SetDefaults(Dimensions.Dimensions og, Dimensions.Dimensions dest)
 {
     origin         = og;
     destination    = dest;
     mode           = 0;
     travCounter    = 0;
     velocity       = 1f;
     originLoc      = new Vector2(Main.screenWidth / 4, 3 * Main.screenHeight / 5);
     destinationLoc = new Vector2(5 * Main.screenWidth / 4, 3 * Main.screenHeight / 5);
     UpdateForbiddenRegions();
 }
Exemple #5
0
        public string AddLaunchPoint(int i, int j, string name, Dimensions.Dimensions dim, bool originFound)
        {
            LaunchPoint l = new LaunchPoint(i, j, name, mod, originFound, dim);

            foreach (LaunchPoint r in launchPoints)
            {
                if (r == l)
                {
                    return(r.name);
                }
            }
            return(l.name);
        }
 public override void EditSpawnPool(IDictionary <int, float> pool, NPCSpawnInfo spawnInfo)
 {
     Dimensions.Dimensions currDim = ModContent.GetInstance <DimensionManager>().currentDimension;
     if (currDim != Dimensions.Dimensions.Overworld)
     {
         pool.Clear();
         pool.Add(0, 0f);
     }
     if (currDim == Dimensions.Dimensions.Jungle)
     {
         SortJungleSpawns(pool, spawnInfo);
     }
     else if (currDim == Dimensions.Dimensions.Asteroid)
     {
         SortAsteroidSpawns(pool, spawnInfo);
     }
     else if (currDim == Dimensions.Dimensions.Ice)
     {
         SortIceSpawns(pool, spawnInfo);
     }
     base.EditSpawnPool(pool, spawnInfo);
 }
 public override void UpdateBiomes()
 {
     Dimensions.Dimensions currDim = ModContent.GetInstance <DimensionManager>().currentDimension;
     if (currDim == Dimensions.Dimensions.Ice)
     {
         if (player.position.Y / 16 > (Main.maxTilesY * 0.38))
         {
             iceCave    = true;
             iceSurface = false;
         }
         else
         {
             iceSurface = true;
             iceCave    = false;
         }
     }
     else
     {
         iceCave    = false;
         iceSurface = false;
     }
     base.UpdateBiomes();
 }
Exemple #8
0
 public ShipTravelItem(Dimensions.Dimensions or, Dimensions.Dimensions dest, Player pl)
 {
     originDest = (or, dest);
     player     = pl;
 }