当前位置: 首页>>代码示例>>Java>>正文


Java Terrain.EMPTY_DECO属性代码示例

本文整理汇总了Java中com.watabou.pixeldungeon.levels.Terrain.EMPTY_DECO属性的典型用法代码示例。如果您正苦于以下问题:Java Terrain.EMPTY_DECO属性的具体用法?Java Terrain.EMPTY_DECO怎么用?Java Terrain.EMPTY_DECO使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.watabou.pixeldungeon.levels.Terrain的用法示例。


在下文中一共展示了Terrain.EMPTY_DECO属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: attackProc

@Override
public int attackProc(@NonNull Char enemy, int damage) {

	int cell = enemy.getPos();

	if (Random.Int(2) == 0) {
		int c = Dungeon.level.map[cell];
		if (c == Terrain.EMPTY || c == Terrain.EMBERS
				|| c == Terrain.EMPTY_DECO || c == Terrain.GRASS
				|| c == Terrain.HIGH_GRASS) {
			
			GameScene.add(Blob.seed(cell, Math.max(exp,10) * 15, Regrowth.class));
		}
	}
	return damage;
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:16,代码来源:EarthElemental.java

示例2: evolve

@Override
protected void evolve() {
	super.evolve();
	
	if (volume > 0) {
		
		boolean mapUpdated = false;
		
		for (int i=0; i < LENGTH; i++) {
			if (off[i] > 0) {
				int c = Dungeon.level.map[i];
				int c1 = c;
				if (c == Terrain.EMPTY || c == Terrain.EMBERS || c == Terrain.EMPTY_DECO) {
					c1 = cur[i] > 9 ? Terrain.HIGH_GRASS : Terrain.GRASS;
				} else if (c == Terrain.GRASS && cur[i] > 9) {
					c1 = Terrain.HIGH_GRASS ;
				}
				
				if (c1 != c) {
					Level.set( i, Terrain.HIGH_GRASS );
					mapUpdated = true;
					
					GameScene.updateMap( i );
					if (Dungeon.visible[i]) {
						GameScene.discoverTile( i, c );
					}
				}
				
				Char ch = Actor.findChar( i );
				if (ch != null) {
					Buff.prolong( ch, Roots.class, TICK );
				}
			}
		}
		
		if (mapUpdated) {
			Dungeon.observe();
		}
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:40,代码来源:Regrowth.java

示例3: evolve

@Override
protected void evolve() {
	super.evolve();
	
	if (volume > 0) {
		
		boolean mapUpdated = false;
		
		for (int i=0; i < LENGTH; i++) {
			if (off[i] > 0) {
				int c = Dungeon.level.map[i];
				if (c == Terrain.EMPTY || c == Terrain.EMBERS || c == Terrain.EMPTY_DECO) {
					
					Level.set( i, cur[i] > 9 ? Terrain.HIGH_GRASS : Terrain.GRASS );
					mapUpdated = true;
					
				} else if (c == Terrain.GRASS && cur[i] > 9) {
					
					Level.set( i, Terrain.HIGH_GRASS );
					mapUpdated = true;
					
				}
				
				Char ch = Actor.findChar( i );
				if (ch != null) {
					Buff.prolong( ch, Roots.class, TICK );
				}
			}
		}
		
		if (mapUpdated) {
			GameScene.updateMap();
			Dungeon.observe();
		}
	}
}
 
开发者ID:skynet67,项目名称:pixel-dungeon-rebirth,代码行数:36,代码来源:Regrowth.java

示例4: decorate

@Override
protected void decorate() {

	for (int i=0; i < getWidth(); i++) {
		if (map[i] == Terrain.WALL &&
				map[i + getWidth()] == Terrain.WATER &&
				Random.Int( 4 ) == 0) {

			map[i] = Terrain.WALL_DECO;
		}
	}

	for (int i=getWidth(); i < getLength() - getWidth(); i++) {
		if (map[i] == Terrain.WALL &&
				map[i - getWidth()] == Terrain.WALL &&
				map[i + getWidth()] == Terrain.WATER &&
				Random.Int( 2 ) == 0) {

			map[i] = Terrain.WALL_DECO;
		}
	}

	for (int i=getWidth() + 1; i < getLength() - getWidth() - 1; i++) {
		if (map[i] == Terrain.EMPTY) {

			int count =
					(map[i + 1] == Terrain.WALL ? 1 : 0) +
							(map[i - 1] == Terrain.WALL ? 1 : 0) +
							(map[i + getWidth()] == Terrain.WALL ? 1 : 0) +
							(map[i - getWidth()] == Terrain.WALL ? 1 : 0);

			if (Random.Int( 16 ) < count * count) {
				map[i] = Terrain.EMPTY_DECO;
			}
		}
	}
	placeEntranceSign();
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:38,代码来源:GutsLevel.java

示例5: decorate

@Override
protected void decorate() {	
	
	for (int i=0; i < getLength(); i++) {
		if (map[i] == Terrain.EMPTY && Random.Int( 10 ) == 0) { 
			map[i] = Terrain.EMPTY_DECO;
		} else if (map[i] == Terrain.WALL && Random.Int( 8 ) == 0) { 
			map[i] = Terrain.WALL_DECO;
		}
	}
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:11,代码来源:IceCavesBossLevel.java

示例6: decorate

@Override
protected void decorate() {
	for (int i=0; i < getLength(); i++) {
		if (map[i] == Terrain.EMPTY && Random.Int( 10 ) == 0) { 
			map[i] = Terrain.EMPTY_DECO;
		}
	}
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:8,代码来源:FakeLastLevel.java

示例7: tileDesc

@Override
public String tileDesc(int tile) {
	switch (tile) {
		case Terrain.EMPTY_DECO:
			return Game.getVar(R.string.Prison_TileDescDeco);
		case Terrain.BOOKSHELF:
			return Game.getVar(R.string.Halls_TileDescBookshelf);
		default:
			return super.tileDesc( tile );
	}
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:11,代码来源:NecroLevel.java

示例8: evolve

@Override
protected void evolve() {
	super.evolve();
	
	if (volume > 0) {
		
		boolean mapUpdated = false;
		
		for (int i=0; i < getLength(); i++) {
			if (off[i] > 0) {
				int c = Dungeon.level.map[i];
				if (c == Terrain.EMPTY || c == Terrain.EMBERS || c == Terrain.EMPTY_DECO) {
					
					Dungeon.level.set( i, cur[i] > 9 ? Terrain.HIGH_GRASS : Terrain.GRASS );
					mapUpdated = true;
					
				} else if (c == Terrain.GRASS && cur[i] > 9) {
					
					Dungeon.level.set( i, Terrain.HIGH_GRASS );
					mapUpdated = true;
					
				}
				
				Char ch = Actor.findChar( i );
				if (ch != null) {
					Buff.prolong( ch, Roots.class, TICK );
				}
			}
		}
		
		if (mapUpdated) {
			GameScene.updateMap();
			Dungeon.observe();
		}
	}
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:36,代码来源:Regrowth.java

示例9: decorate

@Override
protected void decorate() {

	for (int i=getWidth() + 1; i < getLength() - getWidth() - 1; i++) {
		if (map[i] == Terrain.EMPTY) {

			float c = 0.05f;
			if (map[i + 1] == Terrain.WALL && map[i + getWidth()] == Terrain.WALL) {
				c += 0.2f;
			}
			if (map[i - 1] == Terrain.WALL && map[i + getWidth()] == Terrain.WALL) {
				c += 0.2f;
			}
			if (map[i + 1] == Terrain.WALL && map[i - getWidth()] == Terrain.WALL) {
				c += 0.2f;
			}
			if (map[i - 1] == Terrain.WALL && map[i - getWidth()] == Terrain.WALL) {
				c += 0.2f;
			}

			if (Random.Float() < c) {
				map[i] = Terrain.EMPTY_DECO;
			}
		}
	}

	for (int i=0; i < getWidth(); i++) {
		if (map[i] == Terrain.WALL &&
				(map[i + getWidth()] == Terrain.EMPTY || map[i + getWidth()] == Terrain.EMPTY_SP) &&
				Random.Int( 6 ) == 0) {

			map[i] = Terrain.WALL_DECO;
		}
	}

	for (int i=getWidth(); i < getLength() - getWidth(); i++) {
		if (map[i] == Terrain.WALL &&
				map[i - getWidth()] == Terrain.WALL &&
				(map[i + getWidth()] == Terrain.EMPTY || map[i + getWidth()] == Terrain.EMPTY_SP) &&
				Random.Int( 3 ) == 0) {

			map[i] = Terrain.WALL_DECO;
		}
	}
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:45,代码来源:NecroLevel.java


注:本文中的com.watabou.pixeldungeon.levels.Terrain.EMPTY_DECO属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。