@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; }
@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; }
@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; } } }