Exemple #1
0
  public static void paint(Level level, Room room) {

    fill(level, room, Terrain.WALL);
    fill(level, room, 1, Terrain.EMPTY);

    Point c = room.center();
    int cx = c.x;
    int cy = c.y;

    Room.Door entrance = room.entrance();

    entrance.set(Room.Door.Type.LOCKED);
    level.addItemToSpawn(new IronKey());

    if (entrance.x == room.left) {
      set(level, new Point(room.right - 1, room.top + 1), Terrain.STATUE);
      set(level, new Point(room.right - 1, room.bottom - 1), Terrain.STATUE);
      cx = room.right - 2;
    } else if (entrance.x == room.right) {
      set(level, new Point(room.left + 1, room.top + 1), Terrain.STATUE);
      set(level, new Point(room.left + 1, room.bottom - 1), Terrain.STATUE);
      cx = room.left + 2;
    } else if (entrance.y == room.top) {
      set(level, new Point(room.left + 1, room.bottom - 1), Terrain.STATUE);
      set(level, new Point(room.right - 1, room.bottom - 1), Terrain.STATUE);
      cy = room.bottom - 2;
    } else if (entrance.y == room.bottom) {
      set(level, new Point(room.left + 1, room.top + 1), Terrain.STATUE);
      set(level, new Point(room.right - 1, room.top + 1), Terrain.STATUE);
      cy = room.top + 2;
    }

    level.drop(prize(level), cx + cy * Level.WIDTH).type = Type.TOMB;
  }
Exemple #2
0
  @Override
  public int proc(Armor armor, Char attacker, Char defender, int damage) {

    int level = Math.max(0, armor.level);

    if (Level.adjacent(attacker.pos, defender.pos) && Random.Int(level + 6) >= 5) {

      Buff.prolong(attacker, Frost.class, Frost.duration(attacker) * Random.Float(1f, 1.5f));
      CellEmitter.get(attacker.pos).start(SnowParticle.FACTORY, 0.2f, 6);

      Buff.affect(defender, Burning.class).reignite(defender);
      defender.sprite.emitter().burst(FlameParticle.FACTORY, 5);
    }

    return damage;
  }