Пример #1
0
 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);
 }
Пример #2
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);
     }
 }
Пример #3
0
 public virtual void hurt(Mob mob, int dmg, int attackDir)
 {
 }
Пример #4
0
 public virtual bool isBlockableBy(Mob mob)
 {
     return true;
 }
Пример #5
0
 public override bool isBlockableBy(Mob mob)
 {
     return false;
 }
Пример #6
0
 public override void hurt(Level level, int x, int y, Mob source, int dmg, int attackDir)
 {
     hurt(level, x, y, 0);
 }
Пример #7
0
 public virtual void hurt(Level level, int x, int y, Mob source, int dmg, int attackDir)
 {
 }
Пример #8
0
 public override bool isBlockableBy(Mob mob)
 {
     return(false);
 }
Пример #9
0
 public override void hurt(Level level, int x, int y, Mob source, int dmg, int attackDir)
 {
     level.setTile(x, y, onType, 0);
 }
Пример #10
0
 public override void hurt(Mob mob, int damage, int attackDir)
 {
     doHurt(damage, attackDir);
 }