use of com.lilithsthrone.game.character.body.valueEnums.StartingSkinTone in project liliths-throne-public by Innoxia.
the class Body method applyStartingCoveringValues.
private void applyStartingCoveringValues() {
// Everything is based on human skin value:
StartingSkinTone tone = StartingSkinTone.values()[Util.random.nextInt(StartingSkinTone.values().length)];
List<Colour> suitableColours = tone.getAssociatedColours();
List<Colour> colourApplicationList = new ArrayList<>();
for (BodyCoveringType s : BodyCoveringType.values()) {
// makeup
if (s == BodyCoveringType.MAKEUP_BLUSHER || s == BodyCoveringType.MAKEUP_EYE_LINER || s == BodyCoveringType.MAKEUP_EYE_SHADOW || s == BodyCoveringType.MAKEUP_LIPSTICK || s == BodyCoveringType.MAKEUP_NAIL_POLISH_FEET || s == BodyCoveringType.MAKEUP_NAIL_POLISH_HANDS) {
coverings.put(s, new Covering(s, CoveringPattern.NONE, Colour.COVERING_NONE, false, Colour.COVERING_NONE, false));
continue;
}
colourApplicationList.clear();
colourApplicationList.addAll(s.getNaturalColoursPrimary());
colourApplicationList.retainAll(suitableColours);
if (colourApplicationList.isEmpty()) {
colourApplicationList.addAll(s.getNaturalColoursPrimary());
}
Colour primary = colourApplicationList.get(Util.random.nextInt(colourApplicationList.size()));
Colour secondary = primary;
if (!s.getNaturalColoursSecondary().isEmpty()) {
colourApplicationList.clear();
colourApplicationList.addAll(s.getNaturalColoursSecondary());
colourApplicationList.retainAll(suitableColours);
if (colourApplicationList.isEmpty()) {
colourApplicationList.addAll(s.getNaturalColoursSecondary());
}
secondary = colourApplicationList.get(Util.random.nextInt(colourApplicationList.size()));
}
List<CoveringPattern> availablePatterns = new ArrayList<>(s.getNaturalPatterns());
if (availablePatterns.size() > 1) {
// Do not start with freckles.
availablePatterns.remove(CoveringPattern.FRECKLED);
}
coverings.put(s, new Covering(s, availablePatterns.get(Util.random.nextInt(availablePatterns.size())), primary, false, secondary, false));
}
updateCoverings(true, true, true, true);
}
Aggregations