/** * Randomly distributes available stat points. May reallocate points already spent. * * @throws InvalidStatsException */ private void distributeStats() throws InvalidStatsException { short localStr; short localDex; short localVit; short localInt; short localAgi; short localMen; Attributes attribute; try { if (getNormalLevel() < 300) { localStr = 0; localDex = 0; localVit = 0; localInt = 0; localAgi = 0; localMen = 0; while (statPoints() > 0) { attribute = Attributes.identifyAttribute(JSlime.rng.nextInt(5)); if (attribute == Attributes.STRENGTH && localStr < 100) localStr++; else if (attribute == Attributes.DEXTERITY && localDex < 100) localDex++; else if (attribute == Attributes.VITALITY && localVit < 100) localVit++; else if (attribute == Attributes.INTELLIGENCE && localInt < 100) localInt++; else if (attribute == Attributes.AGILITY && localAgi < 100) localAgi++; else if (attribute == Attributes.MENTALITY && localMen < 100) localMen++; } setNormalStat(Attributes.STRENGTH, localStr); setNormalStat(Attributes.DEXTERITY, localDex); setNormalStat(Attributes.VITALITY, localVit); setNormalStat(Attributes.INTELLIGENCE, localInt); setNormalStat(Attributes.AGILITY, localAgi); setNormalStat(Attributes.MENTALITY, localMen); } else if (getNormalLevel() < 600) { localStr = 100; localDex = 100; localVit = 100; localInt = 100; localAgi = 100; localMen = 100; while (statPoints() < 0) { attribute = Attributes.identifyAttribute(JSlime.rng.nextInt(5)); if (attribute == Attributes.STRENGTH && localStr > 0) localStr++; else if (attribute == Attributes.DEXTERITY && localDex > 0) localDex++; else if (attribute == Attributes.VITALITY && localVit > 0) localVit++; else if (attribute == Attributes.INTELLIGENCE && localInt > 0) localInt++; else if (attribute == Attributes.AGILITY && localAgi > 0) localAgi++; else if (attribute == Attributes.MENTALITY && localMen > 0) localMen++; } setNormalStat(Attributes.STRENGTH, localStr); setNormalStat(Attributes.DEXTERITY, localDex); setNormalStat(Attributes.VITALITY, localVit); setNormalStat(Attributes.INTELLIGENCE, localInt); setNormalStat(Attributes.AGILITY, localAgi); setNormalStat(Attributes.MENTALITY, localMen); } else { setNormalStat(Attributes.STRENGTH, 100); setNormalStat(Attributes.DEXTERITY, 100); setNormalStat(Attributes.VITALITY, 100); setNormalStat(Attributes.INTELLIGENCE, 100); setNormalStat(Attributes.AGILITY, 100); setNormalStat(Attributes.MENTALITY, 100); } statCheck(); } catch (UnknownTypeException e) { System.err.print(e.getMessage()); } } // distributeStats