示例#1
0
 public ArrayList<SpellEffect> getCritEffects() {
   ArrayList<SpellEffect> effets = new ArrayList<SpellEffect>();
   for (SpellEffect SE : Effects) {
     try {
       boolean boost = true;
       for (int i : Constants.NO_BOOST_CC_IDS) if (i == SE.getEffectID()) boost = false;
       String[] infos = SE.getArgs().split(";");
       if (!boost) {
         effets.add(SE);
         continue;
       }
       int min = Integer.parseInt(infos[0], 16) + (boost ? template.getBonusCC() : 0);
       int max = Integer.parseInt(infos[1], 16) + (boost ? template.getBonusCC() : 0);
       String jet = "1d" + (max - min + 1) + "+" + (min - 1);
       // exCode: String newArgs =
       // Integer.toHexString(min)+";"+Integer.toHexString(max)+";-1;-1;0;"+jet;
       // osef du minMax, vu qu'on se sert du jet pour calculer les dégats
       String newArgs = "0;0;0;-1;0;" + jet;
       effets.add(new SpellEffect(SE.getEffectID(), newArgs, 0, -1));
     } catch (Exception e) {
       continue;
     }
     ;
   }
   return effets;
 }
示例#2
0
  public String parseStatsStringSansUserObvi() {
    if (getTemplate().getType() == 83) // Si c'est une pierre d'âme vide
    return getTemplate().getStrTemplate();

    StringBuilder stats = new StringBuilder();
    boolean isFirst = true;
    for (SpellEffect SE : Effects) {
      if (!isFirst) stats.append(",");

      String[] infos = SE.getArgs().split(";");
      try {
        stats
            .append(Integer.toHexString(SE.getEffectID()))
            .append("#")
            .append(infos[0])
            .append("#")
            .append(infos[1])
            .append("#0#")
            .append(infos[5]);
      } catch (Exception e) {
        e.printStackTrace();
        continue;
      }
      ;

      isFirst = false;
    }

    for (Entry<Integer, Integer> entry : Stats.getMap().entrySet()) {
      if (!isFirst) stats.append(",");
      String jet = "0d0+" + entry.getValue();
      stats
          .append(Integer.toHexString(entry.getKey()))
          .append("#")
          .append(Integer.toHexString(entry.getValue()));
      stats.append("#0#0#").append(jet);
      isFirst = false;
    }

    for (Entry<Integer, String> entry : txtStats.entrySet()) {
      if (!isFirst) stats.append(",");

      if (entry.getKey() == Constants.CAPTURE_MONSTRE) {
        stats.append(Integer.toHexString(entry.getKey())).append("#0#0#").append(entry.getValue());
      } else {
        stats
            .append(Integer.toHexString(entry.getKey()))
            .append("#0#0#0#")
            .append(entry.getValue());
      }
      isFirst = false;
    }
    return stats.toString();
  }
示例#3
0
  public String parseFMEchecStatsString(Objet obj, double poid) {
    StringBuilder stats = new StringBuilder();
    boolean isFirst = true;
    for (SpellEffect SE : obj.Effects) {
      if (!isFirst) stats.append(",");

      String[] infos = SE.getArgs().split(";");
      try {
        stats
            .append(Integer.toHexString(SE.getEffectID()))
            .append("#")
            .append(infos[0])
            .append("#")
            .append(infos[1])
            .append("#0#")
            .append(infos[5]);
      } catch (Exception e) {
        e.printStackTrace();
        continue;
      }
      ;

      isFirst = false;
    }

    for (Entry<Integer, Integer> entry : obj.Stats.getMap().entrySet()) {
      // En cas d'echec les stats négatives Chance,Agi,Intel,Force,Portee,Vita augmentes
      int newstats = 0;

      if (entry.getKey() == 152
          || entry.getKey() == 154
          || entry.getKey() == 155
          || entry.getKey() == 157
          || entry.getKey() == 116
          || entry.getKey() == 153) {
        float a = (float) ((entry.getValue() * poid) / 100);
        if (a < 1) a = 1;
        float chute = (float) (entry.getValue() + a);
        newstats = (int) Math.floor(chute);
        // On limite la chute du négatif a sont maximum
        if (newstats
            > Metier.getBaseMaxJet(
                obj.getTemplate().getID(), Integer.toHexString(entry.getKey()))) {
          newstats =
              Metier.getBaseMaxJet(obj.getTemplate().getID(), Integer.toHexString(entry.getKey()));
        }
      } else {
        if (entry.getKey() == 127 || entry.getKey() == 101)
          continue; // PM, pas de négatif ainsi que PA

        float chute = (float) (entry.getValue() - ((entry.getValue() * poid) / 100));
        newstats = (int) Math.floor(chute);
      }
      if (newstats < 1) continue;
      String jet = "0d0+" + newstats;
      if (!isFirst) stats.append(",");
      stats
          .append(Integer.toHexString(entry.getKey()))
          .append("#")
          .append(Integer.toHexString(newstats))
          .append("#0#0#")
          .append(jet);
      isFirst = false;
    }

    for (Entry<Integer, String> entry : obj.txtStats.entrySet()) {
      if (!isFirst) stats.append(",");
      stats.append(Integer.toHexString(entry.getKey())).append("#0#0#0#").append(entry.getValue());
      isFirst = false;
    }
    return stats.toString();
  }
示例#4
0
  /* *********FM SYSTEM********* */
  public String parseFMStatsString(String statsstr, Objet obj, int add, boolean negatif) {
    StringBuilder stats = new StringBuilder();
    boolean isFirst = true;
    for (SpellEffect SE : obj.Effects) {
      if (!isFirst) stats.append(",");

      String[] infos = SE.getArgs().split(";");
      try {
        stats
            .append(Integer.toHexString(SE.getEffectID()))
            .append("#")
            .append(infos[0])
            .append("#")
            .append(infos[1])
            .append("#0#")
            .append(infos[5]);
      } catch (Exception e) {
        e.printStackTrace();
        continue;
      }
      ;

      isFirst = false;
    }

    for (Entry<Integer, Integer> entry : obj.Stats.getMap().entrySet()) {
      if (!isFirst) stats.append(",");
      if (Integer.toHexString(entry.getKey()).compareTo(statsstr) == 0) {
        int newstats = 0;
        if (negatif) {
          newstats = entry.getValue() - add;
          if (newstats < 1) continue;
        } else {
          newstats = entry.getValue() + add;
        }
        String jet = "0d0+" + newstats;
        stats
            .append(Integer.toHexString(entry.getKey()))
            .append("#")
            .append(Integer.toHexString(entry.getValue()))
            .append(add)
            .append("#0#0#")
            .append(jet);
      } else {
        String jet = "0d0+" + entry.getValue();
        stats
            .append(Integer.toHexString(entry.getKey()))
            .append("#")
            .append(Integer.toHexString(entry.getValue()))
            .append("#0#0#")
            .append(jet);
      }
      isFirst = false;
    }

    for (Entry<Integer, String> entry : obj.txtStats.entrySet()) {
      if (!isFirst) stats.append(",");
      stats.append(Integer.toHexString(entry.getKey())).append("#0#0#0#").append(entry.getValue());
      isFirst = false;
    }

    return stats.toString();
  }