public override void hurt(Level level, int x, int y, Mob source, int dmg, int attackDir) { int count = random.nextInt(2) + 1; for (int i = 0; i < count; i++) { level.add(new ItemEntity(new ResourceItem(Resource.flower), x * 16 + random.nextInt(10) + 3, y * 16 + random.nextInt(10) + 3)); } level.setTile(x, y, Tile.grass, 0); }
public override void hurt(Level level, int x, int y, Mob source, int dmg, int attackDir) { int damage = level.getData(x, y) + dmg; level.add(new SmashParticle(x * 16 + 8, y * 16 + 8)); level.add(new TextParticle("" + dmg, x * 16 + 8, y * 16 + 8, ColorHelper.get(-1, 500, 500, 500))); if (damage >= 10) { int count = random.nextInt(2) + 1; for (int i = 0; i < count; i++) { level.add(new ItemEntity(new ResourceItem(Resource.cactusFlower), x * 16 + random.nextInt(10) + 3, y * 16 + random.nextInt(10) + 3)); } level.setTile(x, y, Tile.sand, 0); } else { level.setData(x, y, damage); } }
public virtual void hurt(Mob mob, int dmg, int attackDir) { }
public virtual bool isBlockableBy(Mob mob) { return true; }
public override bool isBlockableBy(Mob mob) { return false; }
public override void hurt(Level level, int x, int y, Mob source, int dmg, int attackDir) { hurt(level, x, y, 0); }
public virtual void hurt(Level level, int x, int y, Mob source, int dmg, int attackDir) { }
public override bool isBlockableBy(Mob mob) { return(false); }
public override void hurt(Level level, int x, int y, Mob source, int dmg, int attackDir) { level.setTile(x, y, onType, 0); }
public override void hurt(Mob mob, int damage, int attackDir) { doHurt(damage, attackDir); }