Search in sources :

Example 11 with AbstractItem

use of com.lilithsthrone.game.inventory.item.AbstractItem in project liliths-throne-public by Innoxia.

the class EnchantmentDialogue method inventoryView.

private static String inventoryView() {
    inventorySB.setLength(0);
    ItemEffect effect = new ItemEffect(ingredient.getEnchantmentEffect(), primaryMod, secondaryMod, potency, limit);
    // Primary mods:
    inventorySB.append("<div class='container-half-width' style='padding-bottom:0;'>");
    for (TFModifier tfMod : ingredient.getEnchantmentEffect().getPrimaryModifiers()) {
        inventorySB.append("<div class='modifier-icon " + tfMod.getRarity().getName() + "' style='width:11.5%;'>" + "<div class='modifier-icon-content'>" + tfMod.getSVGString() + "</div>" + "<div class='overlay' id='MOD_PRIMARY_" + tfMod.hashCode() + "'></div>" + "</div>");
    }
    for (int i = 32; i > ingredient.getEnchantmentEffect().getPrimaryModifiers().size(); i--) {
        inventorySB.append("<div class='modifier-icon empty' style='width:11.5%;'></div>");
    }
    inventorySB.append("<div class='container-full-width'>" + "<div class='container-half-width' style='width:78%; margin:0 1%; text-align:center; line-height:100vh;'>" + "<h5 style='margin:0; padding:0;'>Primary Modifier</h5>" + "</div>" + "<div class='container-half-width' style='width:18%; margin:0 1%;'>");
    if (primaryMod != null) {
        inventorySB.append("<div class='modifier-icon " + primaryMod.getRarity().getName() + "' style='width:100%; margin:0;'>" + "<div class='modifier-icon-content'>" + primaryMod.getSVGString() + "</div>" + "<div class='overlay' id='MOD_PRIMARY_ENCHANTING'></div>" + "</div>");
    } else {
        inventorySB.append("<div class='modifier-icon empty' style='width:30%; margin:0 1%;'>" + "<div class='overlay' style='cursor:default;' id='MOD_PRIMARY_ENCHANTING'></div>" + "</div>");
    }
    inventorySB.append("</div></div>");
    inventorySB.append("</div>");
    // Secondary mods:
    inventorySB.append("<div class='container-half-width' style='padding-bottom:0;'>");
    for (TFModifier tfMod : ingredient.getEnchantmentEffect().getSecondaryModifiers(primaryMod)) {
        inventorySB.append("<div class='modifier-icon " + tfMod.getRarity().getName() + "' style='width:11.5%;'>" + "<div class='modifier-icon-content'>" + tfMod.getSVGString() + "</div>" + "<div class='overlay' id='MOD_SECONDARY_" + tfMod.hashCode() + "'></div>" + "</div>");
    }
    for (int i = 32; i > ingredient.getEnchantmentEffect().getSecondaryModifiers(primaryMod).size(); i--) {
        inventorySB.append("<div class='modifier-icon empty' style='width:11.5%;'></div>");
    }
    inventorySB.append("<div class='container-full-width'>" + "<div class='container-half-width' style='width:18%; margin:0 1%;'>");
    if (secondaryMod != null) {
        inventorySB.append("<div class='modifier-icon " + secondaryMod.getRarity().getName() + "' style='width:100%; margin:0;'>" + "<div class='modifier-icon-content'>" + secondaryMod.getSVGString() + "</div>" + "<div class='overlay' id='MOD_SECONDARY_ENCHANTING'></div>" + "</div>");
    } else {
        inventorySB.append("<div class='modifier-icon empty' style='width:30%; margin:0 1%;'>" + "<div class='overlay' style='cursor:default;' id='MOD_SECONDARY_ENCHANTING'></div>" + "</div>");
    }
    inventorySB.append("</div>" + "<div class='container-half-width' style='width:78%; margin:0 1%; text-align:center; line-height:100vh;'>" + "<h5 style='margin:0; padding:0;'>Secondary Modifier</h5>" + "</div>" + "</div>");
    inventorySB.append("</div>");
    // Potency:
    inventorySB.append("<div class='container-full-width' style='text-align:center; padding:8px 0; margin-top:0;'>");
    for (TFPotency potency : TFPotency.values()) {
        inventorySB.append("<div class='normal-button" + (ingredient.getEnchantmentEffect().getPotencyModifiers(primaryMod, secondaryMod).contains(potency) ? "" : " disabled") + (EnchantmentDialogue.potency == potency ? " selected" : "") + "' id='POTENCY_" + potency + "'" + " style='" + (EnchantmentDialogue.potency == potency ? "color:" + potency.getColour().toWebHexString() + ";" : "") + " margin:0 1%; width:14%;'>" + potency.getName() + "</div>");
    }
    inventorySB.append("</div>");
    // Limits:
    int ingredientLimit = ingredient.getEnchantmentEffect().getLimits(primaryMod, secondaryMod);
    if (ingredientLimit != 0) {
        inventorySB.append("<div class='container-full-width' style='text-align:center; padding:8px 0; margin-top:0;'>" + "<div style='float:left; width:14.6%; margin:0 1%; padding:0;'>" + "<div class='normal-button" + (limit == 0 ? " disabled" : "") + "' id='LIMIT_MINIMUM' style='width:100%;'>Limit Min.</div>" + "</div>" + "<div style='float:left; width:14.6%; margin:0 1%; padding:0;'>" + "<div class='normal-button" + (limit == 0 ? " disabled" : "") + "' id='LIMIT_DECREASE_LARGE' style='width:100%;'>Limit--</div>" + "</div>" + "<div style='float:left; width:14.6%; margin:0 1%; padding:0;'>" + "<div class='normal-button" + (limit == 0 ? " disabled" : "") + "' id='LIMIT_DECREASE' style='width:100%;'>Limit-</div>" + "</div>" + "<div style='float:left; width:14.6%; margin:0 1%; padding:0;'>" + "<div class='normal-button" + (limit == ingredientLimit ? " disabled" : "") + "' id='LIMIT_INCREASE' style='width:100%;'>Limit+</div>" + "</div>" + "<div style='float:left; width:14.6%; margin:0 1%; padding:0;'>" + "<div class='normal-button" + (limit == ingredientLimit ? " disabled" : "") + "' id='LIMIT_INCREASE_LARGE' style='width:100%;'>Limit++</div>" + "</div>" + "<div style='float:left; width:14.6%; margin:0 1%; padding:0;'>" + "<div class='normal-button" + (limit == ingredientLimit ? " disabled" : "") + "' id='LIMIT_MAXIMUM' style='width:100%;'>Limit Max.</div>" + "</div>" + "</div>");
    }
    // Effect:
    inventorySB.append("<div class='container-full-width' style='text-align:center; padding:8px 0; margin-top:0;'>");
    inventorySB.append("<div class='container-half-width' style='width:28%; margin:0 1%;'>" + "<b style='color:" + ingredient.getRelatedEssence().getColour().toWebHexString() + ";'>Effect to be added:</b>" + "</div>");
    inventorySB.append("<div class='container-half-width' style='width:48%; margin:0 1%;'>");
    int i = 0;
    if (effect.getEffectsDescription(Main.game.getPlayer(), Main.game.getPlayer()) != null) {
        if (i > 0) {
            inventorySB.append("</br>");
        }
        for (String s : effect.getEffectsDescription(Main.game.getPlayer(), Main.game.getPlayer())) {
            inventorySB.append("<b>" + Util.capitaliseSentence(s) + "</b>");
        }
        i++;
    } else {
        inventorySB.append("<b>-</b>");
    }
    inventorySB.append("</div>");
    inventorySB.append("<div class='container-half-width' style='width:18%; margin:0 1%;'>");
    if (effects.size() >= ingredient.getEnchantmentLimit() || ingredient.getEnchantmentEffect().getEffectsDescription(primaryMod, secondaryMod, potency, limit, Main.game.getPlayer(), Main.game.getPlayer()) == null || ingredient.getEnchantmentEffect().getEffectsDescription(primaryMod, secondaryMod, potency, limit, Main.game.getPlayer(), Main.game.getPlayer()).isEmpty()) {
        inventorySB.append("<div class='normal-button disabled' style='width:100%; margin:auto 0;'>" + "<b>Add</b> | " + UtilText.formatAsEssencesUncoloured(effect.getCost(), "b", false) + "<div class='overlay no-pointer' id='ENCHANT_ADD_BUTTON_DISABLED'></div>" + "</div>");
    } else {
        inventorySB.append("<div class='normal-button' style='width:100%; margin:auto 0;'>" + "<b style='color:" + Colour.GENERIC_GOOD.toWebHexString() + ";'>Add</b> | " + UtilText.formatAsEssences(effect.getCost(), "b", false) + "<div class='overlay' id='ENCHANT_ADD_BUTTON'></div>" + "</div>");
    }
    inventorySB.append("</div>");
    inventorySB.append("</div>");
    // Item crafting:
    inventorySB.append("<div class='container-full-width' style='text-align:center; padding:8px 0; margin-top:0;'>");
    int count = 1;
    if (ingredient instanceof AbstractItem) {
        count = Main.game.getPlayer().getItemCount((AbstractItem) ingredient);
    } else if (ingredient instanceof AbstractClothing) {
        count = Main.game.getPlayer().getClothingCount((AbstractClothing) ingredient);
    } else if (ingredient instanceof AbstractWeapon) {
        count = Main.game.getPlayer().getWeaponCount((AbstractWeapon) ingredient);
    }
    inventorySB.append("<div class='container-half-width' style='width:18%; margin:0 1%; text-align:center;'>");
    inventorySB.append("<b>Input</b>" + "<div class='enchanting-ingredient " + ingredient.getRarity().getName() + "'>" + "<div class='enchanting-ingredient-content'>" + ingredient.getSVGString() + "</div>" + "<div class='overlay' id='INGREDIENT_ENCHANTING'></div>" + "<div class='enchanting-ingredient-count'><b>x" + count + "</b></div>" + "</div>");
    inventorySB.append("</div>");
    // Effects:
    inventorySB.append("<div class='container-half-width' style='width:58%; margin:0 1%;'>");
    inventorySB.append("<b>Effects (</b>" + (effects.size() >= ingredient.getEnchantmentLimit() ? "<b style='color:" + Colour.GENERIC_BAD.toWebHexString() + ";'>" : "<b>") + "" + effects.size() + "/" + ingredient.getEnchantmentLimit() + "</b><b>)</b></br>" + "<b>" + Util.capitaliseSentence(EnchantingUtils.getPotionName(ingredient, effects)) + "</b> | Cost: " + UtilText.formatAsEssences(EnchantingUtils.getCost(ingredient, effects), "b", false));
    if (effects.isEmpty()) {
        inventorySB.append("</br><span style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>No effects added</span>");
    } else {
        i = 0;
        for (ItemEffect ie : effects) {
            for (String s : ie.getEffectsDescription(Main.game.getPlayer(), Main.game.getPlayer())) {
                inventorySB.append("<div class='container-full-width' style='background:" + RenderingEngine.getEntryBackgroundColour(i % 2 == 0) + "; width:98%; margin:0 1%; padding:2px;'>" + Util.capitaliseSentence(s) + (ingredient.getEffects().size() > i && ingredient.getEffects().get(i).equals(ie) ? "<div class='normal-button' style='width:64px; height:22px; line-height:22px; font-size:16px; margin:0; padding:0 0 0 4px; float:right; text-align:left;'>" + "<b style='color:" + Colour.GENERIC_BAD.toWebHexString() + ";'>X</b> " + UtilText.formatAsEssences(ie.getCost(), "b", false) + "<div class='overlay' id='DELETE_EFFECT_" + i + "'></div></div>" : "<div class='normal-button' id='DELETE_EFFECT_" + i + "'" + " style='width:22px; height:22px; line-height:22px; font-size:16px; margin:0; padding:0; float:right; color:" + Colour.GENERIC_BAD.toWebHexString() + ";'><b>X</b></div>") + "</div>");
                i++;
            }
        }
    }
    inventorySB.append("</div>");
    inventorySB.append("<div class='container-half-width' style='width:18%; margin:0 1%; text-align:center;'>");
    inventorySB.append("<b>Output</b>" + "<div class='enchanting-ingredient " + ingredient.getEnchantmentItemType(effects).getRarity().getName() + "'>" + "<div class='enchanting-ingredient-content'>" + EnchantingUtils.getSVGString(ingredient, effects) + "</div>" + "<div class='overlay' id='OUTPUT_ENCHANTING'></div>" + "</div>");
    inventorySB.append("</div>");
    inventorySB.append("</div>");
    return inventorySB.toString();
}
Also used : TFModifier(com.lilithsthrone.game.inventory.enchanting.TFModifier) TFPotency(com.lilithsthrone.game.inventory.enchanting.TFPotency) AbstractClothing(com.lilithsthrone.game.inventory.clothing.AbstractClothing) ItemEffect(com.lilithsthrone.game.inventory.item.ItemEffect) AbstractItem(com.lilithsthrone.game.inventory.item.AbstractItem) AbstractWeapon(com.lilithsthrone.game.inventory.weapon.AbstractWeapon)

Example 12 with AbstractItem

use of com.lilithsthrone.game.inventory.item.AbstractItem in project liliths-throne-public by Innoxia.

the class InventoryDialogue method sellItems.

private static void sellItems(GameCharacter from, GameCharacter to, AbstractItem item, int count, int itemPrice) {
    if (!to.isPlayer() || !to.isInventoryFull() || to.hasItem(item)) {
        if (buyback && to.isPlayer()) {
            Main.game.getPlayer().incrementMoney(-itemPrice);
            from.incrementMoney(itemPrice);
            Main.game.getPlayer().addItem(item, false, true);
            Main.game.getPlayer().getBuybackStack().remove(buyBackIndex);
        } else {
            List<AbstractItem> items = from.getAllItemsInInventory().stream().filter(item::equals).collect(Collectors.toList());
            for (int i = 0; i < count; i++) {
                if (from.isPlayer()) {
                    Main.game.getPlayer().getBuybackStack().push(new ShopTransaction(item, itemPrice));
                } else {
                    to.addItem(items.get(i), false);
                }
                from.incrementMoney(itemPrice);
                to.incrementMoney(-itemPrice);
                from.removeItem(items.get(i));
            }
        }
        if (to.isPlayer()) {
            ((NPC) from).handleSellingEffects(item, count, itemPrice);
        }
    }
    resetPostAction();
}
Also used : NPC(com.lilithsthrone.game.character.npc.NPC) ShopTransaction(com.lilithsthrone.game.inventory.ShopTransaction) AbstractItem(com.lilithsthrone.game.inventory.item.AbstractItem)

Example 13 with AbstractItem

use of com.lilithsthrone.game.inventory.item.AbstractItem in project liliths-throne-public by Innoxia.

the class Vicky method dailyReset.

@Override
public void dailyReset() {
    clearNonEquippedInventory();
    for (int i = 0; i < 2; i++) {
        this.addWeapon(AbstractWeaponType.generateWeapon(WeaponType.OFFHAND_CHAOS_RARE), false);
        this.addWeapon(AbstractWeaponType.generateWeapon(WeaponType.MELEE_CHAOS_RARE), false);
    }
    this.addWeapon(AbstractWeaponType.generateWeapon(WeaponType.OFFHAND_CHAOS_EPIC), false);
    this.addWeapon(AbstractWeaponType.generateWeapon(WeaponType.MELEE_CHAOS_EPIC), false);
    AbstractItem ingredient = AbstractItemType.generateItem(availableIngredients[Util.random.nextInt(availableIngredients.length)]);
    TFModifier primaryMod = TFModifier.getTFRacialBodyPartsList().get(Util.random.nextInt(TFModifier.getTFRacialBodyPartsList().size()));
    for (int i = 0; i < 6; i++) {
        if (ingredient.getEnchantmentEffect().getEffectsDescription(primaryMod, TFModifier.NONE, TFPotency.MINOR_BOOST, 0, Main.game.getPlayer(), Main.game.getPlayer()) != null) {
            this.addItem(EnchantingUtils.craftItem(ingredient, Util.newArrayListOfValues(new ListValue<>(new ItemEffect(ingredient.getEnchantmentEffect(), primaryMod, TFModifier.NONE, TFPotency.MINOR_BOOST, 0)))), false);
        }
        ingredient = AbstractItemType.generateItem(availableIngredients[Util.random.nextInt(availableIngredients.length)]);
        primaryMod = TFModifier.getTFRacialBodyPartsList().get(Util.random.nextInt(TFModifier.getTFRacialBodyPartsList().size()));
    }
    if (Main.game.getPlayer().hasQuest(QuestLine.SIDE_ENCHANTMENT_DISCOVERY)) {
        for (AbstractItemType itemType : ItemType.essences) {
            for (int i = 0; i < 20 + Util.random.nextInt(11); i++) {
                this.addItem(AbstractItemType.generateItem(itemType), false);
            }
        }
    }
}
Also used : TFModifier(com.lilithsthrone.game.inventory.enchanting.TFModifier) AbstractItemType(com.lilithsthrone.game.inventory.item.AbstractItemType) ItemEffect(com.lilithsthrone.game.inventory.item.ItemEffect) AbstractItem(com.lilithsthrone.game.inventory.item.AbstractItem)

Example 14 with AbstractItem

use of com.lilithsthrone.game.inventory.item.AbstractItem in project liliths-throne-public by Innoxia.

the class Cell method resetInventory.

public void resetInventory(List<Rarity> rarityOfItemsToSave) {
    if (rarityOfItemsToSave != null && !rarityOfItemsToSave.isEmpty()) {
        List<AbstractItem> itemsToSave = new ArrayList<>();
        for (AbstractItem item : this.inventory.getItemsInInventory()) {
            if (rarityOfItemsToSave.contains(item.getRarity())) {
                itemsToSave.add(item);
            }
        }
        List<AbstractWeapon> weaponsToSave = new ArrayList<>();
        for (AbstractWeapon weapon : this.inventory.getWeaponsInInventory()) {
            if (rarityOfItemsToSave.contains(weapon.getRarity())) {
                weaponsToSave.add(weapon);
            }
        }
        List<AbstractClothing> clothingToSave = new ArrayList<>();
        for (AbstractClothing clothing : this.inventory.getClothingInInventory()) {
            if (rarityOfItemsToSave.contains(clothing.getRarity())) {
                clothingToSave.add(clothing);
            }
        }
        this.inventory = new CharacterInventory(0, 48);
        for (AbstractItem item : itemsToSave) {
            this.inventory.addItem(item);
        }
        for (AbstractWeapon weapon : weaponsToSave) {
            this.inventory.addWeapon(weapon);
        }
        for (AbstractClothing clothing : clothingToSave) {
            this.inventory.addClothing(clothing);
        }
    } else {
        this.inventory = new CharacterInventory(0, 48);
    }
}
Also used : ArrayList(java.util.ArrayList) AbstractClothing(com.lilithsthrone.game.inventory.clothing.AbstractClothing) AbstractItem(com.lilithsthrone.game.inventory.item.AbstractItem) CharacterInventory(com.lilithsthrone.game.inventory.CharacterInventory) AbstractWeapon(com.lilithsthrone.game.inventory.weapon.AbstractWeapon)

Example 15 with AbstractItem

use of com.lilithsthrone.game.inventory.item.AbstractItem 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)

Aggregations

AbstractItem (com.lilithsthrone.game.inventory.item.AbstractItem)16 ItemEffect (com.lilithsthrone.game.inventory.item.ItemEffect)9 AbstractClothing (com.lilithsthrone.game.inventory.clothing.AbstractClothing)8 AbstractWeapon (com.lilithsthrone.game.inventory.weapon.AbstractWeapon)7 ArrayList (java.util.ArrayList)6 AbstractItemType (com.lilithsthrone.game.inventory.item.AbstractItemType)5 Colour (com.lilithsthrone.utils.Colour)4 NPC (com.lilithsthrone.game.character.npc.NPC)3 AbstractClothingType (com.lilithsthrone.game.inventory.clothing.AbstractClothingType)3 InventorySelectedItemEventListener (com.lilithsthrone.controller.eventListeners.InventorySelectedItemEventListener)2 InventoryTooltipEventListener (com.lilithsthrone.controller.eventListeners.InventoryTooltipEventListener)2 TooltipInformationEventListener (com.lilithsthrone.controller.eventListeners.TooltipInformationEventListener)2 GameCharacter (com.lilithsthrone.game.character.GameCharacter)2 Attribute (com.lilithsthrone.game.character.attributes.Attribute)2 Perk (com.lilithsthrone.game.character.effects.Perk)2 StatusEffect (com.lilithsthrone.game.character.effects.StatusEffect)2 Fetish (com.lilithsthrone.game.character.fetishes.Fetish)2 TestNPC (com.lilithsthrone.game.character.npc.dominion.TestNPC)2 SpecialAttack (com.lilithsthrone.game.combat.SpecialAttack)2 Spell (com.lilithsthrone.game.combat.Spell)2