Search in sources :

Example 11 with Colour

use of com.lilithsthrone.utils.Colour in project liliths-throne-public by Innoxia.

the class CharacterCreation method equipPiercings.

private static void equipPiercings() {
    Colour colour1 = Main.game.getPlayer().isFeminine() ? Colour.CLOTHING_GOLD : Colour.CLOTHING_BLACK_STEEL;
    Colour colour2 = Main.game.getPlayer().isFeminine() ? Colour.CLOTHING_ROSE_GOLD : Colour.CLOTHING_SILVER;
    for (InventorySlot slot : InventorySlot.getPiercingSlots()) {
        if (Main.game.getPlayer().getClothingInSlot(slot) != null) {
            Main.game.getPlayer().unequipClothingIntoVoid(Main.game.getPlayer().getClothingInSlot(slot), true, Main.game.getPlayer());
        }
    }
    // Ear piercings:
    if (Main.game.getPlayer().isPiercedEar()) {
        Main.game.getPlayer().equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.PIERCING_EAR_BASIC_RING, colour1, false), true, Main.game.getPlayer());
    } else if (Main.game.getPlayer().getClothingInSlot(InventorySlot.PIERCING_EAR) != null) {
        Main.game.getPlayer().unequipClothingIntoVoid(Main.game.getPlayer().getClothingInSlot(InventorySlot.PIERCING_EAR), true, Main.game.getPlayer());
    }
    // Lip piercings:
    if (Main.game.getPlayer().isPiercedLip()) {
        Main.game.getPlayer().equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.PIERCING_LIP_RINGS, colour1, false), true, Main.game.getPlayer());
    } else if (Main.game.getPlayer().getClothingInSlot(InventorySlot.PIERCING_LIP) != null) {
        Main.game.getPlayer().unequipClothingIntoVoid(Main.game.getPlayer().getClothingInSlot(InventorySlot.PIERCING_LIP), true, Main.game.getPlayer());
    }
    // Navel piercings:
    if (Main.game.getPlayer().isPiercedNavel() && Main.game.getPlayer().isFeminine()) {
        Main.game.getPlayer().equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.PIERCING_NAVEL_GEM, colour2, false), true, Main.game.getPlayer());
    } else if (Main.game.getPlayer().getClothingInSlot(InventorySlot.PIERCING_STOMACH) != null) {
        Main.game.getPlayer().unequipClothingIntoVoid(Main.game.getPlayer().getClothingInSlot(InventorySlot.PIERCING_STOMACH), true, Main.game.getPlayer());
    }
    // Nipples piercings:
    if (Main.game.getPlayer().isPiercedNipple()) {
        Main.game.getPlayer().equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.PIERCING_NIPPLE_BARS, colour2, false), true, Main.game.getPlayer());
    } else if (Main.game.getPlayer().getClothingInSlot(InventorySlot.PIERCING_NIPPLE) != null) {
        Main.game.getPlayer().unequipClothingIntoVoid(Main.game.getPlayer().getClothingInSlot(InventorySlot.PIERCING_NIPPLE), true, Main.game.getPlayer());
    }
    // Nose piercings:
    if (Main.game.getPlayer().isPiercedNose()) {
        Main.game.getPlayer().equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.PIERCING_NOSE_BASIC_RING, colour1, false), true, Main.game.getPlayer());
    } else if (Main.game.getPlayer().getClothingInSlot(InventorySlot.PIERCING_NOSE) != null) {
        Main.game.getPlayer().unequipClothingIntoVoid(Main.game.getPlayer().getClothingInSlot(InventorySlot.PIERCING_NOSE), true, Main.game.getPlayer());
    }
    // Penis piercings:
    if (Main.game.getPlayer().hasPenis() && Main.game.getPlayer().isPiercedPenis()) {
        Main.game.getPlayer().equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.PIERCING_PENIS_RING, colour2, false), true, Main.game.getPlayer());
    } else if (Main.game.getPlayer().getClothingInSlot(InventorySlot.PIERCING_PENIS) != null) {
        Main.game.getPlayer().unequipClothingIntoVoid(Main.game.getPlayer().getClothingInSlot(InventorySlot.PIERCING_PENIS), true, Main.game.getPlayer());
    }
    // Tongue piercings:
    if (Main.game.getPlayer().isPiercedTongue()) {
        Main.game.getPlayer().equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.PIERCING_TONGUE_BAR, colour1, false), true, Main.game.getPlayer());
    } else if (Main.game.getPlayer().getClothingInSlot(InventorySlot.PIERCING_TONGUE) != null) {
        Main.game.getPlayer().unequipClothingIntoVoid(Main.game.getPlayer().getClothingInSlot(InventorySlot.PIERCING_TONGUE), true, Main.game.getPlayer());
    }
    // Vagina piercings:
    if (Main.game.getPlayer().hasVagina() && Main.game.getPlayer().isPiercedVagina()) {
        Main.game.getPlayer().equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.PIERCING_VAGINA_BARBELL_RING, colour2, false), true, Main.game.getPlayer());
    } else if (Main.game.getPlayer().getClothingInSlot(InventorySlot.PIERCING_VAGINA) != null) {
        Main.game.getPlayer().unequipClothingIntoVoid(Main.game.getPlayer().getClothingInSlot(InventorySlot.PIERCING_VAGINA), true, Main.game.getPlayer());
    }
}
Also used : InventorySlot(com.lilithsthrone.game.inventory.InventorySlot) Colour(com.lilithsthrone.utils.Colour)

Example 12 with Colour

use of com.lilithsthrone.utils.Colour in project liliths-throne-public by Innoxia.

the class CharacterModificationUtils method getKatesDivCoveringsNew.

public static String getKatesDivCoveringsNew(boolean withCost, BodyCoveringType coveringType, String title, String description, boolean withSecondary, boolean withGlow, boolean withDyeAndExtraPatterns) {
    boolean disabledButton = !coveringsToBeApplied.containsKey(coveringType) || coveringsToBeApplied.get(coveringType).equals(BodyChanging.getTarget().getCovering(coveringType));
    contentSB = new StringBuilder("<div class='container-full-width' style='text-align:center;'>" + "<div class='container-quarter-width'>" + "<p>" + "<b>" + Util.capitaliseSentence(title) + "</b>" + "</p>" + "<p>" + "Currently:</br><i>" + BodyChanging.getTarget().getCovering(coveringType).getFullDescription(BodyChanging.getTarget(), true) + "</i>" + "</p>" + (disabledButton ? "<div class='normal-button disabled' style='width:90%; margin:2% auto; padding:0; text-align:center; bottom:0;'>" + "<span style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>Apply Changes" + (withCost ? "</br>(" + UtilText.formatAsMoneyUncoloured(SuccubisSecrets.getBodyCoveringTypeCost(coveringType), "b") + ")" : "") + "</span>" + "</div>" : "<div class='normal-button' style='width:90%; margin:2% auto; padding:0; text-align:center; bottom:0;' id='APPLY_COVERING_" + coveringType + "'>" + "Apply Changes" + (withCost ? "</br>(" + (Main.game.getPlayer().getMoney() >= SuccubisSecrets.getBodyCoveringTypeCost(coveringType) ? UtilText.formatAsMoney(SuccubisSecrets.getBodyCoveringTypeCost(coveringType), "b") : UtilText.formatAsMoney(SuccubisSecrets.getBodyCoveringTypeCost(coveringType), "b", Colour.GENERIC_BAD)) + ")" : "") + "</div>") + "</div>" + "<div class='container-quarter-width'>" + "Pattern:</br>");
    Covering activeCovering = !coveringsToBeApplied.containsKey(coveringType) ? BodyChanging.getTarget().getCovering(coveringType) : coveringsToBeApplied.get(coveringType);
    List<CoveringPattern> availablePatterns = withDyeAndExtraPatterns ? coveringType.getAllPatterns() : coveringType.getNaturalPatterns();
    for (CoveringPattern pattern : availablePatterns) {
        if (activeCovering.getPattern() == pattern) {
            contentSB.append("<div class='cosmetics-button active'>" + "<b style='color:" + Colour.GENERIC_GOOD.toWebHexString() + ";'>" + Util.capitaliseSentence(pattern.getName()) + "</b>" + "</div>");
        } else {
            contentSB.append("<div id='" + coveringType + "_PATTERN_" + pattern + "' class='cosmetics-button'>" + (Main.game.getPlayer().getMoney() >= SuccubisSecrets.getBodyCoveringTypeCost(coveringType) || !withCost ? "<span style='color:" + Colour.TRANSFORMATION_GENERIC.getShades()[0] + ";'>" + Util.capitaliseSentence(pattern.getName()) + "</span>" : "[style.colourDisabled(" + Util.capitaliseSentence(pattern.getName()) + ")]") + "</div>");
        }
    }
    contentSB.append("</div>");
    contentSB.append("<div class='container-half-width''>");
    contentSB.append("<div class='container-half-width'>" + "Primary Colour:</br>");
    List<Colour> availablePrimaryColours = withDyeAndExtraPatterns ? coveringType.getAllPrimaryColours() : coveringType.getNaturalColoursPrimary();
    for (Colour c : availablePrimaryColours) {
        contentSB.append("<div class='normal-button" + (activeCovering.getPrimaryColour() == c ? " selected" : "") + "' id='" + coveringType + "_PRIMARY_" + c + "'" + " style='width:auto; margin-right:4px;" + (activeCovering.getPrimaryColour() == c ? " background-color:" + Colour.BASE_GREEN.getShades()[4] + ";" : "") + "'>" + "<div class='phone-item-colour' style='background-color:" + c.toWebHexString() + ";" + (c == Colour.COVERING_NONE ? " color:" + Colour.BASE_RED.toWebHexString() + ";'>X" : "'>") + "</div>" + "</div>");
    }
    contentSB.append("</br>");
    if (activeCovering.getPrimaryColour() == Colour.COVERING_NONE || !withGlow) {
        // Disable glow:
        contentSB.append("<div class='normal-button disabled' style='width:50%; margin:2% auto; padding:0; text-align:center;'>" + "[style.colourDisabled(Glow)]" + "</div>");
    } else {
        if (activeCovering.isPrimaryGlowing()) {
            contentSB.append("<div class='normal-button active' id='" + coveringType + "_PRIMARY_GLOW_OFF' style='width:50%; margin:2% auto; padding:0; text-align:center;'>" + "[style.boldArcane(Glow)]" + "</div>");
        } else {
            contentSB.append("<div id='" + coveringType + "_PRIMARY_GLOW_ON' class='normal-button' style='width:50%; margin:2% auto; padding:0; text-align:center;'>" + (Main.game.getPlayer().getMoney() >= SuccubisSecrets.getBodyCoveringTypeCost(coveringType) || !withCost ? "<span style='color:" + Colour.GENERIC_ARCANE.getShades()[0] + ";'>Glow</span>" : "[style.colourDisabled(Glowing)]") + "</div>");
        }
    }
    contentSB.append("<p>" + "<b style='color:" + activeCovering.getPrimaryColour().toWebHexString() + ";" + (activeCovering.isPrimaryGlowing() ? "text-shadow: 0px 0px 4px " + activeCovering.getPrimaryColour().getShades()[4] + ";" : "") + "'>" + Util.capitaliseSentence(activeCovering.getPrimaryColour().getName()) + "</b>" + "</p>");
    contentSB.append("</div>" + "<div class='container-half-width'>" + "Secondary Colour:</br>");
    List<Colour> availableSecondaryColours = withDyeAndExtraPatterns ? coveringType.getAllSecondaryColours() : coveringType.getNaturalColoursSecondary();
    for (Colour c : availableSecondaryColours) {
        if (activeCovering.getPattern() == CoveringPattern.NONE || activeCovering.getPattern() == CoveringPattern.EYE_IRISES || activeCovering.getPattern() == CoveringPattern.EYE_PUPILS || !withSecondary) {
            contentSB.append("<div class='normal-button disabled' style='width:auto; margin-right:4px;'>" + "<div class='phone-item-colour' style='background-color:" + c.getShades()[0] + ";'></div>" + "</div>");
        } else {
            contentSB.append("<div class='normal-button" + (activeCovering.getSecondaryColour() == c ? " selected" : "") + "' id='" + coveringType + "_SECONDARY_" + c + "'" + " style='width:auto; margin-right:4px;" + (activeCovering.getSecondaryColour() == c ? " background-color:" + Colour.BASE_GREEN.getShades()[4] + ";" : "") + "'>" + "<div class='phone-item-colour' style='background-color:" + c.toWebHexString() + ";" + (c == Colour.COVERING_NONE ? " color:" + Colour.BASE_RED.toWebHexString() + ";'>X" : "'>") + "</div>" + "</div>");
        }
    }
    contentSB.append("</br>");
    if (activeCovering.getSecondaryColour() == Colour.COVERING_NONE || !withGlow || activeCovering.getPattern() == CoveringPattern.NONE || !withSecondary) {
        // Disable glow:
        contentSB.append("<div class='normal-button disabled' style='width:50%; margin:2% auto; padding:0; text-align:center;'>" + "[style.colourDisabled(Glow)]" + "</div>");
    } else {
        if (activeCovering.isSecondaryGlowing()) {
            contentSB.append("<div class='normal-button active' id='" + coveringType + "_SECONDARY_GLOW_OFF' style='width:50%; margin:2% auto; padding:0; text-align:center;'>" + "[style.boldArcane(Glow)]" + "</div>");
        } else {
            contentSB.append("<div id='" + coveringType + "_SECONDARY_GLOW_ON' class='normal-button' style='width:50%; margin:2% auto; padding:0; text-align:center;'>" + (Main.game.getPlayer().getMoney() >= SuccubisSecrets.getBodyCoveringTypeCost(coveringType) || !withCost ? "<span style='color:" + Colour.GENERIC_ARCANE.getShades()[0] + ";'>Glow</span>" : "[style.colourDisabled(Glowing)]") + "</div>");
        }
    }
    if (activeCovering.getPattern() == CoveringPattern.NONE || activeCovering.getPattern() == CoveringPattern.EYE_IRISES || activeCovering.getPattern() == CoveringPattern.EYE_PUPILS || !withSecondary) {
        contentSB.append("<p>" + "[style.boldDisabled(Disabled)]" + "</p>");
    } else {
        contentSB.append("<p>" + "<b style='color:" + activeCovering.getSecondaryColour().toWebHexString() + ";" + (activeCovering.isSecondaryGlowing() ? "text-shadow: 0px 0px 4px " + activeCovering.getSecondaryColour().getShades()[4] + ";" : "") + "'>" + Util.capitaliseSentence(activeCovering.getSecondaryColour().getName()) + "</b>" + "</p>");
    }
    contentSB.append("</div>");
    if (activeCovering.getType().getNaturalModifiers().size() + activeCovering.getType().getExtraModifiers().size() > 1) {
        contentSB.append("<div class='container-full-width'>");
        for (CoveringModifier mod : activeCovering.getType().getNaturalModifiers()) {
            if (activeCovering.getModifier() == mod) {
                contentSB.append("<div class='cosmetics-button active'>" + "<b style='color:" + Colour.GENERIC_GOOD.toWebHexString() + ";'>" + Util.capitaliseSentence(mod.getName()) + "</b>" + "</div>");
            } else {
                contentSB.append("<div id='" + coveringType + "_MODIFIER_" + mod + "' class='cosmetics-button'>" + (Main.game.getPlayer().getMoney() >= SuccubisSecrets.getBodyCoveringTypeCost(coveringType) || !withCost ? "<span style='color:" + Colour.TRANSFORMATION_GENERIC.getShades()[0] + ";'>" + Util.capitaliseSentence(mod.getName()) + "</span>" : "[style.colourDisabled(" + Util.capitaliseSentence(mod.getName()) + ")]") + "</div>");
            }
        }
        for (CoveringModifier mod : activeCovering.getType().getExtraModifiers()) {
            if (activeCovering.getModifier() == mod) {
                contentSB.append("<div class='cosmetics-button active'>" + "<b style='color:" + Colour.GENERIC_GOOD.toWebHexString() + ";'>" + Util.capitaliseSentence(mod.getName()) + "</b>" + "</div>");
            } else {
                contentSB.append("<div id='" + coveringType + "_MODIFIER_" + mod + "' class='cosmetics-button'>" + (Main.game.getPlayer().getMoney() >= SuccubisSecrets.getBodyCoveringTypeCost(coveringType) || !withCost ? "<span style='color:" + Colour.TRANSFORMATION_GENERIC.getShades()[0] + ";'>" + Util.capitaliseSentence(mod.getName()) + "</span>" : "[style.colourDisabled(" + Util.capitaliseSentence(mod.getName()) + ")]") + "</div>");
            }
        }
        contentSB.append("</div>");
    }
    contentSB.append("</div>");
    contentSB.append("</div>");
    return contentSB.toString();
}
Also used : CoveringModifier(com.lilithsthrone.game.character.body.valueEnums.CoveringModifier) Covering(com.lilithsthrone.game.character.body.Covering) CoveringPattern(com.lilithsthrone.game.character.body.valueEnums.CoveringPattern) Colour(com.lilithsthrone.utils.Colour)

Example 13 with Colour

use of com.lilithsthrone.utils.Colour in project liliths-throne-public by Innoxia.

the class AbstractClothingType method getSVGImage.

private String getSVGImage(GameCharacter character, Colour colour, Colour colourSecondary, Colour colourTertiary, boolean equippedVariant) {
    if (!allAvailablePrimaryColours.contains(colour)) {
        return "";
    }
    if (this.equals(ClothingType.HIPS_CONDOMS)) {
        if (getAllAvailablePrimaryColours().contains(colour)) {
            try {
                InputStream is = this.getClass().getResourceAsStream("/com/lilithsthrone/res/clothing/belt_used_condoms_base_back.svg");
                String s = "<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;padding:0;margin:0'>" + Util.inputStreamToString(is) + "</div>";
                is.close();
                s = Util.colourReplacement(this.getId(), colour, colourSecondary, colourTertiary, s);
                if (!equippedVariant) {
                    is = this.getClass().getResourceAsStream("/com/lilithsthrone/res/clothing/belt_used_condoms_base_front.svg");
                    s += "<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;padding:0;margin:0'>" + Util.inputStreamToString(is) + "</div>";
                    s = Util.colourReplacement(this.getId(), colour, colourSecondary, colourTertiary, s);
                    is.close();
                    addSVGStringEquippedMapping(colour, colourSecondary, colourTertiary, s);
                    return s;
                } else {
                    List<Colour> condomColours = new ArrayList<>();
                    // Draw all backs:
                    for (AbstractItem item : character.getAllItemsInInventory()) {
                        if (item.getItemType().equals(ItemType.CONDOM_USED)) {
                            if (condomColours.size() < 8) {
                                condomColours.add(item.getColour());
                                is = this.getClass().getResourceAsStream("/com/lilithsthrone/res/clothing/belt_used_condoms_" + condomColours.size() + "_back.svg");
                                s += "<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;padding:0;margin:0'>" + Util.inputStreamToString(is) + "</div>";
                                s = Util.colourReplacement(this.getId(), item.getColour(), null, null, s);
                                is.close();
                            }
                        }
                    }
                    is.close();
                    is = this.getClass().getResourceAsStream("/com/lilithsthrone/res/clothing/belt_used_condoms_base_front.svg");
                    s += "<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;padding:0;margin:0'>" + Util.inputStreamToString(is) + "</div>";
                    s = Util.colourReplacement(this.getId(), colour, colourSecondary, colourTertiary, s);
                    is.close();
                    int i = 1;
                    for (Colour c : condomColours) {
                        is = this.getClass().getResourceAsStream("/com/lilithsthrone/res/clothing/belt_used_condoms_" + i + "_front.svg");
                        s += "<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;padding:0;margin:0'>" + Util.inputStreamToString(is) + "</div>";
                        s = Util.colourReplacement(this.getId(), c, null, null, s);
                        is.close();
                        i++;
                    }
                    return s;
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    } else {
        if (equippedVariant && pathNameEquipped != null) {
            String stringFromMap = getSVGStringFromEquippedMap(colour, colourSecondary, colourTertiary);
            if (stringFromMap != null && !this.equals(ClothingType.WRIST_WOMENS_WATCH) && !this.equals(ClothingType.WRIST_MENS_WATCH)) {
                return stringFromMap;
            } else {
                if (getAllAvailablePrimaryColours().contains(colour)) {
                    try {
                        InputStream is = this.getClass().getResourceAsStream("/com/lilithsthrone/res/clothing/" + pathNameEquipped + ".svg");
                        String s = Util.inputStreamToString(is);
                        s = Util.colourReplacement(this.getId(), colour, colourSecondary, colourTertiary, s);
                        // Add minute and hour hands to women's and men's watches:
                        s += (this.equals(ClothingType.WRIST_WOMENS_WATCH) ? "<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;-webkit-transform: rotate(" + ((Main.game.getMinutesPassed() % (60 * 24)) / 2f) + "deg);'>" + SVGImages.SVG_IMAGE_PROVIDER.getWomensWatchHourHand() + "</div>" + "<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;-webkit-transform: rotate(" + (Main.game.getMinutesPassed() % (60)) * 6 + "deg);'>" + SVGImages.SVG_IMAGE_PROVIDER.getWomensWatchMinuteHand() + "</div>" : "") + (this.equals(ClothingType.WRIST_MENS_WATCH) ? "<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;-webkit-transform: rotate(" + ((Main.game.getMinutesPassed() % (60 * 24)) / 2f) + "deg);'>" + SVGImages.SVG_IMAGE_PROVIDER.getMensWatchHourHand() + "</div>" + "<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;-webkit-transform: rotate(" + (Main.game.getMinutesPassed() % (60)) * 6 + "deg);'>" + SVGImages.SVG_IMAGE_PROVIDER.getMensWatchMinuteHand() + "</div>" : "");
                        addSVGStringEquippedMapping(colour, colourSecondary, colourTertiary, s);
                        is.close();
                        return s;
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
        } else {
            String stringFromMap = getSVGStringFromMap(colour, colourSecondary, colourTertiary);
            if (stringFromMap != null && !this.equals(ClothingType.WRIST_WOMENS_WATCH) && !this.equals(ClothingType.WRIST_MENS_WATCH)) {
                return stringFromMap;
            } else {
                if (getAllAvailablePrimaryColours().contains(colour)) {
                    try {
                        InputStream is = this.getClass().getResourceAsStream("/com/lilithsthrone/res/clothing/" + pathName + ".svg");
                        String s = Util.inputStreamToString(is);
                        s = Util.colourReplacement(this.getId(), colour, colourSecondary, colourTertiary, s);
                        // Add minute and hour hands to women's and men's watches:
                        s += (this.equals(ClothingType.WRIST_WOMENS_WATCH) ? "<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;-webkit-transform: rotate(" + ((Main.game.getMinutesPassed() % (60 * 24)) / 2f) + "deg);'>" + SVGImages.SVG_IMAGE_PROVIDER.getWomensWatchHourHand() + "</div>" + "<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;-webkit-transform: rotate(" + (Main.game.getMinutesPassed() % (60)) * 6 + "deg);'>" + SVGImages.SVG_IMAGE_PROVIDER.getWomensWatchMinuteHand() + "</div>" : "") + (this.equals(ClothingType.WRIST_MENS_WATCH) ? "<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;-webkit-transform: rotate(" + ((Main.game.getMinutesPassed() % (60 * 24)) / 2f) + "deg);'>" + SVGImages.SVG_IMAGE_PROVIDER.getMensWatchHourHand() + "</div>" + "<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;-webkit-transform: rotate(" + (Main.game.getMinutesPassed() % (60)) * 6 + "deg);'>" + SVGImages.SVG_IMAGE_PROVIDER.getMensWatchMinuteHand() + "</div>" : "");
                        addSVGStringMapping(colour, colourSecondary, colourTertiary, s);
                        is.close();
                        return s;
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
    }
    return "";
}
Also used : InputStream(java.io.InputStream) ArrayList(java.util.ArrayList) AbstractItem(com.lilithsthrone.game.inventory.item.AbstractItem) IOException(java.io.IOException) Colour(com.lilithsthrone.utils.Colour)

Example 14 with Colour

use of com.lilithsthrone.utils.Colour in project liliths-throne-public by Innoxia.

the class CharacterUtils method equipClothing.

public static void equipClothing(GameCharacter character, boolean replaceUnsuitableClothing, boolean onlyAddCoreClothing) {
    Colour primaryColour = Colour.allClothingColours.get(Util.random.nextInt(Colour.allClothingColours.size())), secondaryColour = Colour.allClothingColours.get(Util.random.nextInt(Colour.allClothingColours.size())), lingerieColour = Colour.lingerieColours.get(Util.random.nextInt(Colour.lingerieColours.size()));
    List<InventorySlot> inventorySlotsInPriorityOrder = new ArrayList<>();
    // Torso needs to be randomly decided first, to give girls a chance to wear a dress.
    inventorySlotsInPriorityOrder.add(InventorySlot.TORSO_UNDER);
    for (InventorySlot slot : InventorySlot.values()) {
        if (slot != InventorySlot.TORSO_UNDER) {
            inventorySlotsInPriorityOrder.add(slot);
        }
    }
    if ((character.isFeminine() && !character.hasFetish(Fetish.FETISH_CROSS_DRESSER)) || (!character.isFeminine() && character.hasFetish(Fetish.FETISH_CROSS_DRESSER))) {
        for (InventorySlot slot : inventorySlotsInPriorityOrder) {
            if (replaceUnsuitableClothing) {
                if (character.getClothingInSlot(slot) != null) {
                    if (character.getClothingInSlot(slot).getClothingType().getFemininityRestriction() == Femininity.MASCULINE) {
                        character.unequipClothingIntoVoid(character.getClothingInSlot(slot), true, character);
                    }
                }
            }
            if (!slot.isCoreClothing() && onlyAddCoreClothing) {
            // Don't add clothing if not core
            } else {
                if ((slot.isCoreClothing() || Math.random() > 0.75f || slot.isJewellery()) && !character.isSlotIncompatible(slot) && character.getClothingInSlot(slot) == null) {
                    if (!ClothingType.getCommonClothingMapFemaleIncludingAndrogynous().get(slot).isEmpty() && (slot.slotBlockedByRace(character) != character.getRace())) {
                        List<AbstractClothingType> clothingToUse = ClothingType.getCommonClothingMapFemaleIncludingAndrogynous().get(slot);
                        if (character.getHistory() == History.PROSTITUTE) {
                            clothingToUse = suitableFeminineClothing.get(History.PROSTITUTE);
                        }
                        AbstractClothingType ct = getClothingTypeForSlot(character, slot, clothingToUse);
                        clothingToUse.remove(ClothingType.PENIS_CONDOM);
                        if (ct != null) {
                            character.equipClothingFromNowhere(AbstractClothingType.generateClothing(ct, (slot == InventorySlot.GROIN || slot == InventorySlot.CHEST || slot == InventorySlot.SOCK ? ct.getAvailablePrimaryColours().contains(lingerieColour) ? lingerieColour : ct.getAvailablePrimaryColours().get(Util.random.nextInt(ct.getAvailablePrimaryColours().size())) : (slot.isCoreClothing() ? ct.getAvailablePrimaryColours().contains(primaryColour) ? primaryColour : ct.getAvailablePrimaryColours().get(Util.random.nextInt(ct.getAvailablePrimaryColours().size())) : ct.getAvailablePrimaryColours().contains(secondaryColour) ? secondaryColour : ct.getAvailablePrimaryColours().get(Util.random.nextInt(ct.getAvailablePrimaryColours().size())))), false), true, character);
                        }
                    }
                }
            }
        }
    } else {
        for (InventorySlot slot : inventorySlotsInPriorityOrder) {
            if (replaceUnsuitableClothing) {
                if (character.getClothingInSlot(slot) != null) {
                    if (character.getClothingInSlot(slot).getClothingType().getFemininityRestriction() == Femininity.FEMININE) {
                        character.unequipClothingIntoVoid(character.getClothingInSlot(slot), true, character);
                    }
                }
            }
            if (!slot.isCoreClothing() && onlyAddCoreClothing) {
            // Don't add clothing if not core
            } else {
                if ((slot.isCoreClothing() || Math.random() > 0.75f || slot.isJewellery()) && !character.isSlotIncompatible(slot) && character.getClothingInSlot(slot) == null) {
                    if (!ClothingType.getCommonClothingMapMaleIncludingAndrogynous().get(slot).isEmpty() && (slot.slotBlockedByRace(character) != character.getRace())) {
                        List<AbstractClothingType> clothingToUse = ClothingType.getCommonClothingMapMaleIncludingAndrogynous().get(slot);
                        clothingToUse.remove(ClothingType.PENIS_CONDOM);
                        AbstractClothingType ct = getClothingTypeForSlot(character, slot, clothingToUse);
                        if (ct != null) {
                            character.equipClothingFromNowhere(AbstractClothingType.generateClothing(ct, (slot == InventorySlot.GROIN || slot == InventorySlot.CHEST || slot == InventorySlot.SOCK ? ct.getAvailablePrimaryColours().contains(lingerieColour) ? lingerieColour : ct.getAvailablePrimaryColours().get(Util.random.nextInt(ct.getAvailablePrimaryColours().size())) : (slot.isCoreClothing() ? ct.getAvailablePrimaryColours().contains(primaryColour) ? primaryColour : ct.getAvailablePrimaryColours().get(Util.random.nextInt(ct.getAvailablePrimaryColours().size())) : ct.getAvailablePrimaryColours().contains(secondaryColour) ? secondaryColour : ct.getAvailablePrimaryColours().get(Util.random.nextInt(ct.getAvailablePrimaryColours().size())))), false), true, character);
                        }
                    }
                }
            }
        }
    }
}
Also used : AbstractClothingType(com.lilithsthrone.game.inventory.clothing.AbstractClothingType) InventorySlot(com.lilithsthrone.game.inventory.InventorySlot) ArrayList(java.util.ArrayList) Colour(com.lilithsthrone.utils.Colour)

Example 15 with Colour

use of com.lilithsthrone.utils.Colour in project liliths-throne-public by Innoxia.

the class CharacterUtils method applyMakeup.

public static void applyMakeup(GameCharacter character, boolean overideExistingMakeup) {
    if ((character.isFeminine() && !character.hasFetish(Fetish.FETISH_CROSS_DRESSER)) || (!character.isFeminine() && character.hasFetish(Fetish.FETISH_CROSS_DRESSER))) {
        List<Colour> colours = Util.newArrayListOfValues(new ListValue<>(Colour.COVERING_NONE), new ListValue<>(Colour.COVERING_CLEAR), new ListValue<>(Colour.COVERING_RED), new ListValue<>(Colour.COVERING_PINK), new ListValue<>(Colour.COVERING_BLUE));
        if (character.getHistory() == History.PROSTITUTE) {
            colours.remove(Colour.COVERING_NONE);
            colours.remove(Colour.COVERING_CLEAR);
        }
        Colour colourForCoordination = colours.get(Util.random.nextInt(colours.size()));
        Colour colourForNails = colours.get(Util.random.nextInt(colours.size()));
        character.setLipstick(new Covering(BodyCoveringType.MAKEUP_LIPSTICK, colourForCoordination));
        character.setEyeLiner(new Covering(BodyCoveringType.MAKEUP_EYE_LINER, Colour.COVERING_BLACK));
        character.setEyeShadow(new Covering(BodyCoveringType.MAKEUP_EYE_SHADOW, colourForCoordination));
        character.setBlusher(new Covering(BodyCoveringType.MAKEUP_BLUSHER, colourForCoordination));
        character.setHandNailPolish(new Covering(BodyCoveringType.MAKEUP_NAIL_POLISH_HANDS, colourForNails));
        character.setFootNailPolish(new Covering(BodyCoveringType.MAKEUP_NAIL_POLISH_FEET, colourForNails));
    } else {
    // Masculine characters
    }
}
Also used : Covering(com.lilithsthrone.game.character.body.Covering) 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