Ejemplo n.º 1
0
 static Tile()
 {
     grass = new GrassTile(TileID.GRASS);
     rock = new RockTile(TileID.ROCK);
     water = new WaterTile(TileID.WATER);
     flower = new FlowerTile(TileID.FLOWER);
     tree = new TreeTile(TileID.TREE);
     dirt = new DirtTile(TileID.DIRT);
     sand = new SandTile(TileID.SAND);
     cactus = new CactusTile(TileID.CACTUS);
     hole = new HoleTile(TileID.HOLE);
     treeSapling = new SaplingTile(TileID.TREE_SAPLING, grass, tree);
     cactusSapling = new SaplingTile(TileID.CACTUS_SAPLING, sand, cactus);
     farmland = new FarmTile(TileID.FARMLAND);
     wheat = new WheatTile(TileID.WHEAT);
     lava = new LavaTile(TileID.LAVA);
     stairsDown = new StairsTile(TileID.STAIRS_DOWN, false);
     stairsUp = new StairsTile(TileID.STAIRS_UP, true);
     infiniteFall = new InfiniteFallTile(TileID.INFINITE_FALL);
     cloud = new CloudTile(TileID.CLOUD);
     hardRock = new HardRockTile(TileID.HARDROCK);
     ironOre = new OreTile(TileID.IRON_ORE, Resource.ironOre);
     goldOre = new OreTile(TileID.GOLD_ORE, Resource.goldOre);
     gemOre = new OreTile(TileID.GEM_ORE, Resource.gem);
     cloudCactus = new CloudCactusTile(TileID.CLOUD_CACTUS);
 }
Ejemplo n.º 2
0
 public override bool interactOn(Tile tile, Level level, int xt, int yt, Player player, int attackDir)
 {
     if (player.health < player.maxHealth && player.payStamina(staminaCost))
     {
         player.heal(heal);
         return true;
     }
     return false;
 }
Ejemplo n.º 3
0
 public override bool interactOn(Tile tile, Level level, int xt, int yt, Player player, int attackDir)
 {
     if (resource.interactOn(tile, level, xt, yt, player, attackDir))
     {
         count--;
         return true;
     }
     return false;
 }
Ejemplo n.º 4
0
 public override bool interactOn(Tile tile, Level level, int xt, int yt, Player player, int attackDir)
 {
     if (sourceTiles.Contains((TileID)tile.id))
     {
         var tt = Tile.tiles[(byte)targetTile];
         level.setTile(xt, yt, tt, 0);
         return true;
     }
     return false;
 }
Ejemplo n.º 5
0
 public SaplingTile(TileID id, Tile onType, Tile growsTo)
     : base(id)
 {
     this.onType = onType;
     this.growsTo = growsTo;
     connectsToSand = onType.connectsToSand;
     connectsToGrass = onType.connectsToGrass;
     connectsToWater = onType.connectsToWater;
     connectsToLava = onType.connectsToLava;
 }
Ejemplo n.º 6
0
 public override bool interactOn(Tile tile, Level level, int xt, int yt, Player player, int attackDir)
 {
     if (tile.mayPass(level, xt, yt, furniture))
     {
         furniture.x = xt * 16 + 8;
         furniture.y = yt * 16 + 8;
         level.add(furniture);
         placed = true;
         return true;
     }
     return false;
 }
Ejemplo n.º 7
0
 public virtual void hurt(Tile tile, int x, int y, int dmg)
 {
 }
Ejemplo n.º 8
0
 public virtual bool interactOn(Tile tile, Level level, int xt, int yt, Player player, int attackDir)
 {
     return false;
 }
Ejemplo n.º 9
0
 public override void hurt(Tile tile, int x, int y, int damage)
 {
     int attackDir = dir ^ 1;
     doHurt(damage, attackDir);
 }