コード例 #1
0
    public void PlantHerb(DPoint tileLocation, HerbStyle style, HerbGrowthState state = HerbGrowthState.Mature) {
      ITile tile = TerrariaUtils.Tiles[tileLocation];
      tile.active(true);
      switch (state) {
        case HerbGrowthState.Growing:
          tile.type = TileID.ImmatureHerbs;
          break;
        case HerbGrowthState.Mature:
          tile.type = TileID.MatureHerbs;
          break;
        case HerbGrowthState.Blooming:
          tile.type = TileID.BloomingHerbs;
          break;
        default:
          throw new ArgumentException("state");
      }

      tile.frameX = Convert.ToInt16((int)style * TerrariaUtils.DefaultTextureTileSize);
      TSPlayer.All.SendTileSquare(tileLocation.X, tileLocation.Y, 3);
    }
コード例 #2
0
        public void PlantHerb(DPoint tileLocation, HerbStyle style, HerbGrowthState state = HerbGrowthState.Mature)
        {
            Tile tile = TerrariaUtils.Tiles[tileLocation];
              tile.active(true);
              switch (state) {
            case HerbGrowthState.Growing:
              tile.type = (int)BlockType.HerbGrowing;
              break;
            case HerbGrowthState.Mature:
              tile.type = (int)BlockType.HerbMature;
              break;
            case HerbGrowthState.Blooming:
              tile.type = (int)BlockType.HerbBlooming;
              break;
            default:
              throw new ArgumentException("state");
              }

              tile.frameX = Convert.ToInt16((int)style * TerrariaUtils.DefaultTextureTileSize);
              TSPlayer.All.SendTileSquare(tileLocation.X, tileLocation.Y, 3);
        }