コード例 #1
0
  public long getWinExperience(PlayerFighter fighter, int winTeamLevel, int loseTeamLevel) {
    if (Config.RATE_DEFIANCE.getValue() <= 0) return 0;

    double fact = loseTeamLevel / winTeamLevel;
    fact *= Config.RATE_DEFIANCE.getValue();
    fact *= (10 / fighter.getLevel()) + 1;
    fact *=
        (double)
            (((double) fighter.getPlayer().getTotalStats().get(Stats.Element.SAGESSE) / 100)
                + (double) 1);

    Pair<Experience, Experience> xps = ExperienceHandler.instance().getLevel(fighter.getLevel());
    long inter = xps.getSecond().player - xps.getFirst().player;

    long ret = (long) (Utils.randLong((long) (0.01 * inter), (long) (0.1 * inter)) * fact);

    if (ret < 0) ret = 0;

    return ret;
  }
コード例 #2
0
  @Override
  public FightButtin makeButtin(
      DefianceFight fight,
      PlayerFighter fighter,
      FightTeam winners,
      Collection<FightTeam> loosers) {
    int loosersLevel = 0;

    for (FightTeam team : loosers) loosersLevel += team.getTeamLevel();

    if (fighter.getTeam() == winners)
      return new FightButtin(
          0,
          getWinExperience(fighter, winners.getTeamLevel(), loosersLevel),
          new HashSet<Pair<Integer, Integer>>());

    return FightButtin.emptyButtin();
  }