예제 #1
0
 @Override
 public void setAllValues(int def) {
   if ((def > Short.MAX_VALUE) || (def < Short.MIN_VALUE))
     Log.errOut("Value out of range", new CMException("Value out of range: " + def + " for all"));
   for (final int i : CharStats.CODES.ALLCODES()) stats[i] = (short) def;
   unwearableBitmap = 0;
 }
예제 #2
0
 @Override
 public int getCode(String abilityName) {
   final String[] DESCS = CODES.DESCS();
   for (final int i : CharStats.CODES.ALLCODES()) {
     if (DESCS[i].startsWith(abilityName)) return i;
   }
   return -1;
 }
예제 #3
0
  @Override
  public String getStat(String abilityName) {
    final int dex = CMParms.indexOfIgnoreCase(getStatCodes(), abilityName);
    if (dex >= 0) return Integer.toString(getStat(dex));

    final String[] DESCS = CODES.DESCS();
    for (final int i : CharStats.CODES.ALLCODES()) {
      if (DESCS[i].startsWith(abilityName)) return Integer.toString(getStat(i));
    }
    return null;
  }
예제 #4
0
 @Override
 public void setStat(String code, String val) {
   final int dex = CMParms.indexOfIgnoreCase(getStatCodes(), code);
   if (dex >= 0) setStat(dex, CMath.s_parseIntExpression(val));
   else
     for (final int i : CharStats.CODES.ALLCODES()) {
       if (CODES.DESC(i).startsWith(code)) {
         setStat(dex, CMath.s_parseIntExpression(val));
         return;
       }
     }
 }