コード例 #1
0
  /**
   * All modifiers of stones will be removed
   *
   * @param itemStones
   * @param cgs
   */
  public static void removeStoneStats(
      Set<? extends ManaStone> itemStones, CreatureGameStats<?> cgs) {
    if (itemStones == null || itemStones.size() == 0) return;

    for (ManaStone stone : itemStones) {
      List<StatFunction> modifiers = stone.getModifiers();
      if (modifiers != null) {
        cgs.endEffect(stone);
      }
    }
  }
コード例 #2
0
  /**
   * Used when socketing of equipped item
   *
   * @param item
   * @param stone
   * @param cgs
   */
  public static void addStoneStats(Item item, ManaStone stone, CreatureGameStats<?> cgs) {
    List<StatFunction> modifiers = stone.getModifiers();
    if (modifiers == null) {
      return;
    }

    cgs.addEffect(stone, modifiers);
  }