Exemplo n.º 1
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;
 }
Exemplo n.º 2
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;
  }
Exemplo n.º 3
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;
       }
     }
 }