Search in sources :

Example 16 with Colour

use of com.lilithsthrone.utils.Colour 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);
}
Also used : StartingSkinTone(com.lilithsthrone.game.character.body.valueEnums.StartingSkinTone) ArrayList(java.util.ArrayList) BodyCoveringType(com.lilithsthrone.game.character.body.types.BodyCoveringType) CoveringPattern(com.lilithsthrone.game.character.body.valueEnums.CoveringPattern) Colour(com.lilithsthrone.utils.Colour)

Aggregations

Colour (com.lilithsthrone.utils.Colour)16 AbstractItem (com.lilithsthrone.game.inventory.item.AbstractItem)5 ItemEffect (com.lilithsthrone.game.inventory.item.ItemEffect)5 AbstractClothingType (com.lilithsthrone.game.inventory.clothing.AbstractClothingType)4 AbstractItemType (com.lilithsthrone.game.inventory.item.AbstractItemType)4 Attribute (com.lilithsthrone.game.character.attributes.Attribute)3 StatusEffect (com.lilithsthrone.game.character.effects.StatusEffect)3 Fetish (com.lilithsthrone.game.character.fetishes.Fetish)3 Gender (com.lilithsthrone.game.character.gender.Gender)3 GenderPreference (com.lilithsthrone.game.character.gender.GenderPreference)3 TFModifier (com.lilithsthrone.game.inventory.enchanting.TFModifier)3 TFPotency (com.lilithsthrone.game.inventory.enchanting.TFPotency)3 ArrayList (java.util.ArrayList)3 Entry (java.util.Map.Entry)3 EnchantmentEventListener (com.lilithsthrone.controller.eventListeners.EnchantmentEventListener)2 InventorySelectedItemEventListener (com.lilithsthrone.controller.eventListeners.InventorySelectedItemEventListener)2 InventoryTooltipEventListener (com.lilithsthrone.controller.eventListeners.InventoryTooltipEventListener)2 SetContentEventListener (com.lilithsthrone.controller.eventListeners.SetContentEventListener)2 TooltipHideEventListener (com.lilithsthrone.controller.eventListeners.TooltipHideEventListener)2 TooltipInformationEventListener (com.lilithsthrone.controller.eventListeners.TooltipInformationEventListener)2