Search in sources :

Example 1 with FetishLevel

use of com.lilithsthrone.game.character.fetishes.FetishLevel in project liliths-throne-public by Innoxia.

the class TooltipInformationEventListener method handleEvent.

@Override
public void handleEvent(Event event) {
    Main.mainController.setTooltipSize(360, 180);
    Main.mainController.setTooltipContent("");
    if (statusEffect != null) {
        int yIncrease = (statusEffect.getModifiersAsStringList(owner).size() > 4 ? statusEffect.getModifiersAsStringList(owner).size() - 4 : 0) + (owner.hasStatusEffect(statusEffect) ? (owner.getStatusEffectDuration(statusEffect) == -1 ? 0 : 2) : 0);
        Main.mainController.setTooltipSize(360, 284 + (yIncrease * LINE_HEIGHT));
        // Title:
        tooltipSB.setLength(0);
        tooltipSB.append("<body>" + "<div class='title'>" + Util.capitaliseSentence(statusEffect.getName(owner)) + "</div>");
        // Attribute modifiers:
        tooltipSB.append("<div class='subTitle-picture'>");
        if (!statusEffect.getModifiersAsStringList(owner).isEmpty()) {
            int i = 0;
            for (String s : statusEffect.getModifiersAsStringList(owner)) {
                tooltipSB.append((i != 0 ? "</br>" : "") + s);
                i++;
            }
        } else {
            tooltipSB.append("<span style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>No bonuses</span>");
        }
        tooltipSB.append("</div>");
        // Picture:
        tooltipSB.append("<div class='picture'>" + statusEffect.getSVGString(owner) + "</div>" + "<div class='description'>" + statusEffect.getDescription(owner) + "</div>");
        if (owner.hasStatusEffect(statusEffect))
            if (owner.getStatusEffectDuration(statusEffect) != -1) {
                if (statusEffect.isCombatEffect()) {
                    tooltipSB.append("<div class='subTitle'><b>Turns remaining: " + owner.getStatusEffectDuration(statusEffect) + "</b></div>");
                } else {
                    int timerHeight = (int) ((owner.getStatusEffectDuration(statusEffect) / (60 * 6f)) * 100);
                    Colour timerColour = Colour.STATUS_EFFECT_TIME_HIGH;
                    if (timerHeight > 100) {
                        timerHeight = 100;
                        timerColour = Colour.STATUS_EFFECT_TIME_OVERFLOW;
                    } else if (timerHeight < 15) {
                        timerColour = Colour.STATUS_EFFECT_TIME_LOW;
                    } else if (timerHeight < 50) {
                        timerColour = Colour.STATUS_EFFECT_TIME_MEDIUM;
                    }
                    tooltipSB.append("<div class='subTitle'><b>Time remaining: " + "<b style='color:" + timerColour.toWebHexString() + ";'>" + (owner.getStatusEffectDuration(statusEffect) / 60) + ":" + String.format("%02d", (owner.getStatusEffectDuration(statusEffect) % 60)) + "</b>" + "</div>");
                // STATUS_EFFECT_TIME_OVERFLOW
                }
            }
        tooltipSB.append("</body>");
        Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
    } else if (perk != null) {
        // Perks:
        int yIncrease = (perk.getModifiersAsStringList().size() > 4 ? perk.getModifiersAsStringList().size() - 4 : 0);
        Main.mainController.setTooltipSize(360, 324 + (yIncrease * LINE_HEIGHT));
        // Title:
        tooltipSB.setLength(0);
        tooltipSB.append("<div class='title'>" + Util.capitaliseSentence(perk.getName(owner)) + "</div>");
        if (perk.isMajor()) {
            tooltipSB.append("<div class='subTitle' style='color:" + Colour.TRAIT.toWebHexString() + ";'>Trait</div>");
        } else {
            tooltipSB.append("<div class='subTitle' style='color:" + Colour.PERK.toWebHexString() + ";'>Perk</div>");
        }
        // Attribute modifiers:
        tooltipSB.append("<div class='subTitle-picture'>");
        if (!perk.getModifiersAsStringList().isEmpty()) {
            int i = 0;
            for (String s : perk.getModifiersAsStringList()) {
                tooltipSB.append((i != 0 ? "</br>" : "") + s);
                i++;
            }
        } else
            tooltipSB.append("<b style='color:" + Colour.PERK.toWebHexString() + ";'>Perk</b>" + "</br><span style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>None</span>");
        tooltipSB.append("</div>");
        // Picture:
        tooltipSB.append("<div class='picture'>" + perk.getSVGString() + "</div>");
        // Description:
        tooltipSB.append("<div class='description'>" + perk.getDescription(owner) + "</div>");
        Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
    } else if (levelUpPerk != null) {
        // Level Up Perk (same as Perk, but with requirements at top):
        int yIncrease = (levelUpPerk.getModifiersAsStringList().size() > 4 ? levelUpPerk.getModifiersAsStringList().size() - 4 : 0);
        Main.mainController.setTooltipSize(360, 352 + (yIncrease * LINE_HEIGHT));
        // Title:
        tooltipSB.setLength(0);
        tooltipSB.append("<div class='title'>" + Util.capitaliseSentence(levelUpPerk.getName(owner)) + "</div>");
        if (levelUpPerk.isMajor()) {
            tooltipSB.append("<div class='subTitle' style='color:" + Colour.TRAIT.toWebHexString() + ";'>Trait</div>");
        } else {
            tooltipSB.append("<div class='subTitle' style='color:" + Colour.PERK.toWebHexString() + ";'>Perk</div>");
        }
        // Attribute modifiers:
        tooltipSB.append("<div class='subTitle-picture'>");
        if (!levelUpPerk.getModifiersAsStringList().isEmpty()) {
            int i = 0;
            for (String s : levelUpPerk.getModifiersAsStringList()) {
                tooltipSB.append((i != 0 ? "</br>" : "") + s);
                i++;
            }
        } else {
            tooltipSB.append("<b style='color:" + Colour.PERK.toWebHexString() + ";'>Perk</b>" + "</br><span style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>None</span>");
        }
        tooltipSB.append("</div>");
        // Picture:
        tooltipSB.append("<div class='picture'>" + levelUpPerk.getSVGString() + "</div>");
        // Description:
        tooltipSB.append("<div class='description'>" + levelUpPerk.getDescription(Main.game.getPlayer()) + "</div>");
        if (levelUpPerk.isMajor()) {
            if (levelUpPerk.getPerkCategory() == PerkCategory.JOB) {
                tooltipSB.append("<div class='subTitle' style='color:" + Colour.TRAIT.toWebHexString() + ";'>Job-related trait cannot be removed.</div>");
            } else {
                if (!owner.hasPerkInTree(perkRow, levelUpPerk)) {
                    if (!PerkManager.MANAGER.isPerkAvailable(perkRow, levelUpPerk)) {
                        tooltipSB.append("<div class='subTitle' style='color:" + Colour.GENERIC_BAD.toWebHexString() + ";'>Purchasing requires a connecting perk or trait.</div>");
                    } else {
                        tooltipSB.append("<div class='subTitle' style='color:" + Colour.GENERIC_MINOR_GOOD.toWebHexString() + ";'>Click to purchase trait.</div>");
                    }
                } else {
                    if (owner.getTraits().contains(levelUpPerk)) {
                        tooltipSB.append("<div class='subTitle' style='color:" + Colour.GENERIC_MINOR_BAD.toWebHexString() + ";'>Click to unequip trait.</div>");
                    } else {
                        if (owner.getTraits().size() == GameCharacter.MAX_TRAITS) {
                            tooltipSB.append("<div class='subTitle' style='color:" + Colour.GENERIC_BAD.toWebHexString() + ";'>Maximum traits activated.</div>");
                        } else {
                            tooltipSB.append("<div class='subTitle' style='color:" + Colour.TRAIT.toWebHexString() + ";'>Click to equip trait.</div>");
                        }
                    }
                }
            }
        } else {
            if (!owner.hasPerkInTree(perkRow, levelUpPerk)) {
                if (!PerkManager.MANAGER.isPerkAvailable(perkRow, levelUpPerk)) {
                    tooltipSB.append("<div class='subTitle' style='color:" + Colour.GENERIC_BAD.toWebHexString() + ";'>Purchasing requires a connecting perk or trait.</div>");
                } else {
                    tooltipSB.append("<div class='subTitle' style='color:" + Colour.GENERIC_MINOR_GOOD.toWebHexString() + ";'>Click to purchase perk.</div>");
                }
            } else {
                tooltipSB.append("<div class='subTitle' style='color:" + Colour.PERK.toWebHexString() + ";'>You already own this perk!</div>");
            }
        }
        Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
    } else if (desire != null) {
        // Desire:
        Main.mainController.setTooltipSize(360, 264);
        // Title:
        tooltipSB.setLength(0);
        tooltipSB.append("<div class='title'>Set Desire: <b style='color:" + desire.getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(desire.getName()) + "</b></div>");
        // Attribute modifiers:
        tooltipSB.append("<div class='subTitle-picture'>");
        int i = 0;
        for (String s : desire.getModifiersAsStringList()) {
            tooltipSB.append((i != 0 ? "</br>" : "") + s);
            i++;
        }
        tooltipSB.append("</div>");
        // Picture:
        tooltipSB.append("<div class='picture'>" + desire.getSVGImage() + "</div>");
        // Description:
        if (owner.hasFetish(fetish) && desire != FetishDesire.FOUR_LOVE) {
            tooltipSB.append("<div class='description' style='height:53px'>Your desire is [style.boldBad(locked)] to <b style='color:" + FetishDesire.FOUR_LOVE.getColour().toWebHexString() + ";'>" + FetishDesire.FOUR_LOVE.getName() + "</b>," + " due to owning the related fetish (" + fetish.getName(owner) + ").</div>");
            tooltipSB.append("<div class='subTitle' style='text-align:center;'>Cost: [style.boldDisabled(N/A)]</div>");
        } else {
            tooltipSB.append("<div class='description' style='height:53px'>" + fetish.getFetishDesireDescription(owner, desire) + "</div>");
            if (owner.getBaseFetishDesire(fetish) == desire) {
                tooltipSB.append("<div class='subTitle' style='text-align:center;'>Cost: [style.boldDisabled(N/A)]</div>");
            } else {
                tooltipSB.append("<div class='subTitle' style='text-align:center;'>Cost: [style.boldArcane(" + (FetishDesire.getCostToChange() == 0 ? "Free" : "" + FetishDesire.getCostToChange() + " Arcane Essence" + (FetishDesire.getCostToChange() > 1 ? "s" : "")) + ")]</div>");
            }
        }
        Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
    } else if (fetish != null) {
        if (fetishExperience) {
            Main.mainController.setTooltipSize(420, 156);
            tooltipSB.setLength(0);
            tooltipSB.append("<div class='title'>" + Util.capitaliseSentence(fetish.getName(owner)) + " fetish</div>");
            FetishLevel level = FetishLevel.getFetishLevelFromValue(owner.getFetishExperience(fetish));
            tooltipSB.append("<div class='subTitle'>Level " + level.getNumeral() + ": <span style='color:" + level.getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(level.getName()) + "</span>" + " <span style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>|</span> " + owner.getFetishExperience(fetish) + " / " + level.getMaximumExperience() + " xp" + "</div>");
            tooltipSB.append("<div class='description' style='height:53px'>You earn fetish experience by performing related actions in sex. Each level increases the fetish's bonuses (max level is 5).</div>");
            Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
        } else {
            int yIncrease = (fetish.getModifiersAsStringList(owner).size() > 4 ? fetish.getModifiersAsStringList(owner).size() - 4 : 0) + fetish.getFetishesForAutomaticUnlock().size();
            Main.mainController.setTooltipSize(360, (fetish.getFetishesForAutomaticUnlock().isEmpty() ? 350 : 360) + (yIncrease * LINE_HEIGHT));
            // Title:
            tooltipSB.setLength(0);
            tooltipSB.append("<div class='title'>" + Util.capitaliseSentence(fetish.getName(owner)) + " fetish</div>");
            FetishLevel level = FetishLevel.getFetishLevelFromValue(owner.getFetishExperience(fetish));
            tooltipSB.append("<div class='subTitle'>Level " + level.getNumeral() + ": <span style='color:" + level.getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(level.getName()) + "</span>" + " <span style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>|</span> " + owner.getFetishExperience(fetish) + " / " + level.getMaximumExperience() + " xp" + "</div>");
            // Requirements:
            if (!fetish.getFetishesForAutomaticUnlock().isEmpty()) {
                tooltipSB.append("<div class='subTitle'>Requirements");
                for (Fetish f : fetish.getFetishesForAutomaticUnlock()) tooltipSB.append("</br>[style.boldArcane(" + Util.capitaliseSentence(f.getName(Main.game.getPlayer())) + ")]");
                tooltipSB.append("</div>");
            }
            // Attribute modifiers:
            tooltipSB.append("<div class='subTitle-picture'>");
            if (!fetish.getModifiersAsStringList(owner).isEmpty()) {
                int i = 0;
                for (String s : fetish.getModifiersAsStringList(owner)) {
                    tooltipSB.append((i != 0 ? "</br>" : "") + s);
                    i++;
                }
            } else {
                tooltipSB.append("<b style='color:" + Colour.FETISH.toWebHexString() + ";'>Fetish</b>" + "</br><span style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>None</span>");
            }
            tooltipSB.append("</div>");
            // Picture:
            tooltipSB.append("<div class='picture'>" + fetish.getSVGString() + "</div>");
            // Description:
            tooltipSB.append("<div class='description'>" + fetish.getDescription(owner) + "</div>");
            if (fetish.getFetishesForAutomaticUnlock().isEmpty()) {
                if (owner.hasBaseFetish(fetish)) {
                    tooltipSB.append("<div class='subTitle' style='text-align:center;'>Cost: [style.boldDisabled(N/A)]</div>");
                } else {
                    tooltipSB.append("<div class='subTitle' style='text-align:center;'>Cost: [style.boldArcane(" + fetish.getCost() + " Arcane Essences)]</div>");
                }
            }
            Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
        }
    } else if (specialAttack != null) {
        // Special attacks:
        int yIncrease = (specialAttack.getStatusEffects().size() > 2 ? specialAttack.getStatusEffects().size() - 2 : 0);
        Main.mainController.setTooltipSize(360, 324 + (yIncrease * LINE_HEIGHT));
        // Title:
        tooltipSB.setLength(0);
        tooltipSB.append("<div class='title'>" + Util.capitaliseSentence(specialAttack.getName()) + "</div>");
        // Attribute modifiers:
        tooltipSB.append("<div class='subTitle-picture'>" + "<b style='color:" + Colour.SPECIAL_ATTACK.toWebHexString() + ";'>Special Attack</b></br>" + "<b>" + Attack.getMinimumSpecialAttackDamage(owner, null, specialAttack.getDamageType(), specialAttack.getDamage(), specialAttack.getDamageVariance()) + "-" + Attack.getMaximumSpecialAttackDamage(owner, null, specialAttack.getDamageType(), specialAttack.getDamage(), specialAttack.getDamageVariance()) + "</b>" + " <b style='color:" + specialAttack.getDamageType().getMultiplierAttribute().getColour().toWebHexString() + ";'>" + specialAttack.getDamageType().getName() + "</b> damage");
        tooltipSB.append("</br><b style='color:" + Colour.SPECIAL_ATTACK.toWebHexString() + ";'>Applies</b>");
        if (!specialAttack.getStatusEffects().isEmpty()) {
            for (Entry<StatusEffect, Integer> e : specialAttack.getStatusEffects().entrySet()) tooltipSB.append("</br><b style='color:" + e.getKey().getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(e.getKey().getName(owner)) + "</b> for " + e.getValue() + " turn" + (e.getValue() > 1 ? "s" : ""));
        } else
            tooltipSB.append("</br><span style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>No effects</span>");
        tooltipSB.append("</div>");
        // Picture:
        tooltipSB.append("<div class='picture'>" + specialAttack.getSVGString() + "</div>");
        // Description & turns remaining:
        tooltipSB.append("<div class='description'>" + specialAttack.getDescription(owner) + "</div>" + "<div class='subTitle-half'>" + "<b>Cooldown: " + (specialAttack.getCooldown()) + "</b>" + "</div>" + "<div class='subTitle-half'>" + (Main.game.isInCombat() ? (Combat.getCooldown(owner, specialAttack) == 0 ? "[style.boldGood(Off Cooldown)]" : "[style.boldCooldown(On Cooldown:)] " + Combat.getCooldown(owner, specialAttack)) : "[style.boldGood(Off Cooldown)]") + "</div>");
        Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
    } else if (spell != null) {
        // Spells:
        int yIncrease = (spell.getStatusEffects().size() > 2 ? spell.getStatusEffects().size() - 2 : 0);
        Main.mainController.setTooltipSize(360, 324 + (yIncrease * LINE_HEIGHT));
        // Title:
        tooltipSB.setLength(0);
        tooltipSB.append("<div class='title'>" + Util.capitaliseSentence(spell.getName()) + "</div>");
        // Attribute modifiers:
        tooltipSB.append("<div class='subTitle-picture'>" + "<b style='color:" + Colour.GENERIC_ARCANE.toWebHexString() + ";'>Spell</b></br>");
        if (spell.isBeneficial()) {
            tooltipSB.append("<b style='color:" + Colour.GENERIC_GOOD.toWebHexString() + ";'>Beneficial</b> <b style='color:" + spell.getDamageType().getMultiplierAttribute().getColour().toWebHexString() + ";'>" + spell.getDamageType().getName() + "</b> spell");
        } else {
            tooltipSB.append("<b>" + Attack.getMinimumSpellDamage(owner, null, spell.getDamageType(), spell.getDamage(), spell.getDamageVariance()) + "-" + Attack.getMaximumSpellDamage(owner, null, spell.getDamageType(), spell.getDamage(), spell.getDamageVariance()) + "</b>" + " <b style='color:" + spell.getDamageType().getMultiplierAttribute().getColour().toWebHexString() + ";'>" + spell.getDamageType().getName() + "</b> damage");
        }
        tooltipSB.append("</br><b style='color:" + Colour.GENERIC_ARCANE.toWebHexString() + ";'>Applies</b>");
        if (!spell.getStatusEffects().isEmpty()) {
            for (Entry<StatusEffect, Integer> e : spell.getStatusEffects().entrySet()) {
                tooltipSB.append("</br><b style='color:" + e.getKey().getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(e.getKey().getName(owner)) + "</b> for " + e.getValue() + " turn" + (e.getValue() > 1 ? "s" : ""));
            }
        } else {
            tooltipSB.append("</br><span style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>No effects</span>");
        }
        tooltipSB.append("</div>");
        // Picture:
        tooltipSB.append("<div class='picture'>" + spell.getSVGString() + "</div>");
        // Description & turns remaining:
        tooltipSB.append("<div class='description'>" + spell.getDescription(owner, spellLevel) + "</div>" + "<div class='subTitle'>" + "<b style='color:" + Colour.GENERIC_BAD.toWebHexString() + ";'>Costs</b> <b>" + (spell.getModifiedCost(owner)) + "</b>" + " <b style='color:" + Colour.ATTRIBUTE_MANA.toWebHexString() + ";'>aura</b>" + "</div>");
        Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
    } else if (attribute != null) {
        if (attribute == Attribute.MAJOR_PHYSIQUE || attribute == Attribute.MAJOR_ARCANE || attribute == Attribute.MAJOR_CORRUPTION || attribute == Attribute.AROUSAL || attribute == Attribute.LUST) {
            StatusEffect currentAttributeStatusEffect = null;
            int minimumLevelValue = 0, maximumLevelValue = 0;
            if (attribute == Attribute.MAJOR_PHYSIQUE) {
                currentAttributeStatusEffect = PhysiqueLevel.getPhysiqueLevelFromValue(owner.getAttributeValue(Attribute.MAJOR_PHYSIQUE)).getRelatedStatusEffect();
                minimumLevelValue = PhysiqueLevel.getPhysiqueLevelFromValue(owner.getAttributeValue(Attribute.MAJOR_PHYSIQUE)).getMinimumValue();
                maximumLevelValue = PhysiqueLevel.getPhysiqueLevelFromValue(owner.getAttributeValue(Attribute.MAJOR_PHYSIQUE)).getMaximumValue();
            } else if (attribute == Attribute.MAJOR_ARCANE) {
                currentAttributeStatusEffect = IntelligenceLevel.getIntelligenceLevelFromValue(owner.getAttributeValue(Attribute.MAJOR_ARCANE)).getRelatedStatusEffect();
                minimumLevelValue = IntelligenceLevel.getIntelligenceLevelFromValue(owner.getAttributeValue(Attribute.MAJOR_ARCANE)).getMinimumValue();
                maximumLevelValue = IntelligenceLevel.getIntelligenceLevelFromValue(owner.getAttributeValue(Attribute.MAJOR_ARCANE)).getMaximumValue();
            } else if (attribute == Attribute.MAJOR_CORRUPTION) {
                currentAttributeStatusEffect = CorruptionLevel.getCorruptionLevelFromValue(owner.getAttributeValue(Attribute.MAJOR_CORRUPTION)).getRelatedStatusEffect();
                minimumLevelValue = CorruptionLevel.getCorruptionLevelFromValue(owner.getAttributeValue(Attribute.MAJOR_CORRUPTION)).getMinimumValue();
                maximumLevelValue = CorruptionLevel.getCorruptionLevelFromValue(owner.getAttributeValue(Attribute.MAJOR_CORRUPTION)).getMaximumValue();
            } else if (attribute == Attribute.AROUSAL) {
                currentAttributeStatusEffect = ArousalLevel.getArousalLevelFromValue(owner.getAttributeValue(Attribute.AROUSAL)).getRelatedStatusEffect();
                minimumLevelValue = ArousalLevel.getArousalLevelFromValue(owner.getAttributeValue(Attribute.AROUSAL)).getMinimumValue();
                maximumLevelValue = ArousalLevel.getArousalLevelFromValue(owner.getAttributeValue(Attribute.AROUSAL)).getMaximumValue();
            } else if (attribute == Attribute.LUST) {
                currentAttributeStatusEffect = LustLevel.getLustLevelFromValue(owner.getAttributeValue(Attribute.LUST)).getRelatedStatusEffect();
                minimumLevelValue = LustLevel.getLustLevelFromValue(owner.getAttributeValue(Attribute.LUST)).getMinimumValue();
                maximumLevelValue = LustLevel.getLustLevelFromValue(owner.getAttributeValue(Attribute.LUST)).getMaximumValue();
            }
            int yIncrease = (currentAttributeStatusEffect.getModifiersAsStringList(owner).size() > 4 ? currentAttributeStatusEffect.getModifiersAsStringList(owner).size() - 4 : 0) + (owner.hasStatusEffect(currentAttributeStatusEffect) ? (owner.getStatusEffectDuration(currentAttributeStatusEffect) == -1 ? 0 : 2) : 0);
            Main.mainController.setTooltipSize(360, 460 + (yIncrease * LINE_HEIGHT));
            tooltipSB.setLength(0);
            tooltipSB.append("<div class='title' style='color:" + attribute.getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(attribute.getName()) + "</div>" + "<div class='subTitle-third'>" + "<b style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>Core</b></br>" + (owner.getBaseAttributeValue(attribute) > 0 ? "<span style='color: " + Colour.GENERIC_EXCELLENT.getShades()[1] + ";'>" : "<span>") + String.format("%.2f", owner.getBaseAttributeValue(attribute)) + "</span>" + "</div>" + "<div class='subTitle-third'>" + "<b style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>Bonus</b></br>" + ((owner.getBonusAttributeValue(attribute)) > 0 ? "<span style='color: " + Colour.GENERIC_GOOD.getShades()[1] + ";'>" : ((owner.getBonusAttributeValue(attribute)) == 0 ? "<span style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>" : "<span style='color: " + Colour.GENERIC_BAD.getShades()[1] + ";'>")) + String.format("%.2f", owner.getBonusAttributeValue(attribute)) + "</span>" + "</div>" + "<div class='subTitle-third'>" + "<b style='color:" + attribute.getColour().toWebHexString() + ";'>Total</b></br>" + String.format("%.2f", owner.getAttributeValue(attribute)) + "</span>" + "</div>");
            tooltipSB.append("<div class='description-half'>" + attribute.getDescription(owner) + "</div>");
            // Related status effect:
            tooltipSB.append("<div class='title'>" + "<span style='color:" + currentAttributeStatusEffect.getColour().toWebHexString() + ";'>" + currentAttributeStatusEffect.getName(owner) + "</span> (" + minimumLevelValue + "-" + maximumLevelValue + ")" + "</div>");
            // Attribute modifiers:
            tooltipSB.append("<div class='subTitle-picture'>");
            if (!currentAttributeStatusEffect.getModifiersAsStringList(owner).isEmpty()) {
                int i = 0;
                for (String s : currentAttributeStatusEffect.getModifiersAsStringList(owner)) {
                    if (i != 0) {
                        tooltipSB.append("</br>");
                    }
                    tooltipSB.append(s);
                    i++;
                }
            } else {
                tooltipSB.append("<span style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>No bonuses</span>");
            }
            tooltipSB.append("</div>");
            // Picture:
            tooltipSB.append("<div class='picture'>" + currentAttributeStatusEffect.getSVGString(owner) + "</div>");
            // Description & turns remaining:
            tooltipSB.append("<div class='description'>" + currentAttributeStatusEffect.getDescription(owner) + "</div>");
            Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
        } else if (attribute == Attribute.EXPERIENCE) {
            if (owner.isRaceConcealed()) {
                Main.mainController.setTooltipSize(420, 64);
                tooltipSB.setLength(0);
                tooltipSB.append("<div class='title' style='color:" + Colour.RACE_UNKNOWN.toWebHexString() + ";'>" + "Unknown Race!" + "</div>");
            } else {
                Main.mainController.setTooltipSize(420, 508);
                tooltipSB.setLength(0);
                tooltipSB.append("<div class='title' style='color:" + owner.getRace().getColour().toWebHexString() + ";'>" + (owner.getRaceStage().getName() != "" ? "<b style='color:" + owner.getRaceStage().getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(owner.getRaceStage().getName()) + "</b> " : "") + "<b style='color:" + owner.getRace().getColour().toWebHexString() + ";'>" + (owner.isFeminine() ? Util.capitaliseSentence(owner.getSubspecies().getSingularFemaleName()) : Util.capitaliseSentence(owner.getSubspecies().getSingularMaleName())) + "</b>" + "</div>");
                // GREATER:
                tooltipSB.append(getBodyPartDiv("Face", owner.getFaceRace(), owner.getFaceType().getBodyCoveringType(owner)));
                tooltipSB.append(getBodyPartDiv("Body", owner.getSkinRace(), owner.getSkinType().getBodyCoveringType(owner)));
                // LESSER:
                tooltipSB.append(getBodyPartDiv("Arms", owner.getArmRace(), owner.getArmType().getBodyCoveringType(owner)));
                tooltipSB.append(getBodyPartDiv("Legs", owner.getLegRace(), owner.getLegType().getBodyCoveringType(owner)));
                // PARTIAL:
                tooltipSB.append(getBodyPartDiv("Hair", owner.getHairRace(), owner.getHairType().getBodyCoveringType(owner)));
                tooltipSB.append(getBodyPartDiv("Eyes", owner.getEyeRace(), owner.getEyeType().getBodyCoveringType(owner)));
                tooltipSB.append(getBodyPartDiv("Ears", owner.getEarRace(), owner.getEarType().getBodyCoveringType(owner)));
                tooltipSB.append(getBodyPartDiv("Tongue", owner.getTongueRace(), owner.getTongueType().getBodyCoveringType(owner)));
                if (owner.getHornType() != HornType.NONE) {
                    tooltipSB.append(getBodyPartDiv((owner.hasHorns() ? Util.capitaliseSentence(owner.getHornName()) : "Horns"), owner.getHornRace(), owner.getHornType().getBodyCoveringType(owner)));
                } else {
                    tooltipSB.append(getEmptyBodyPartDiv("Horns", "None"));
                }
                if (owner.getAntennaType() != AntennaType.NONE) {
                    tooltipSB.append(getBodyPartDiv("Antennae", owner.getAntennaRace(), owner.getAntennaType().getBodyCoveringType(owner)));
                } else {
                    tooltipSB.append(getEmptyBodyPartDiv("Antennae", "None"));
                }
                if (owner.getWingType() != WingType.NONE) {
                    tooltipSB.append(getBodyPartDiv("Wings", owner.getWingRace(), owner.getWingType().getBodyCoveringType(owner)));
                } else {
                    tooltipSB.append(getEmptyBodyPartDiv("Wings", "None"));
                }
                if (owner.getTailType() != TailType.NONE) {
                    tooltipSB.append(getBodyPartDiv("Tail", owner.getTailRace(), owner.getTailType().getBodyCoveringType(owner)));
                } else {
                    tooltipSB.append(getEmptyBodyPartDiv("Tail", "None"));
                }
                // SEXUAL:
                if (!owner.isPlayer() && !owner.getPlayerKnowsAreas().contains(CoverableArea.VAGINA)) {
                    tooltipSB.append(getEmptyBodyPartDiv("Vagina", "Unknown!"));
                } else {
                    if (owner.getVaginaType() != VaginaType.NONE) {
                        tooltipSB.append(getBodyPartDiv("Vagina", owner.getVaginaRace(), owner.getVaginaType().getBodyCoveringType(owner)));
                    } else {
                        tooltipSB.append(getEmptyBodyPartDiv("Vagina", "None"));
                    }
                }
                if (!owner.isPlayer() && !owner.getPlayerKnowsAreas().contains(CoverableArea.PENIS)) {
                    tooltipSB.append(getEmptyBodyPartDiv("Penis", "Unknown!"));
                } else {
                    if (owner.getPenisType() != PenisType.NONE) {
                        tooltipSB.append(getBodyPartDiv("Penis", owner.getPenisRace(), owner.getPenisType().getBodyCoveringType(owner)));
                    } else {
                        tooltipSB.append(getEmptyBodyPartDiv("Penis", "None"));
                    }
                }
                tooltipSB.append(getBodyPartDiv("Ass", owner.getAssRace(), owner.getAssType().getBodyCoveringType(owner)));
                tooltipSB.append(getBodyPartDiv(owner.hasBreasts() ? "Breasts" : "Chest", owner.getBreastRace(), owner.getBreastType().getBodyCoveringType(owner)));
            }
            Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
        } else {
            Main.mainController.setTooltipSize(360, 234);
            Main.mainController.setTooltipContent(UtilText.parse("<div class='title' style='color:" + attribute.getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(attribute.getName()) + "</div>" + "<div class='subTitle-third'>" + "<b style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>Core</b></br>" + (owner.getBaseAttributeValue(attribute) > 0 ? "<span style='color: " + Colour.GENERIC_EXCELLENT.getShades()[1] + ";'>" : "<span>") + String.format("%.2f", owner.getBaseAttributeValue(attribute)) + "</span>" + "</div>" + "<div class='subTitle-third'>" + "<b style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>Bonus</b></br>" + ((owner.getBonusAttributeValue(attribute)) > 0 ? "<span style='color: " + Colour.GENERIC_GOOD.getShades()[1] + ";'>" : ((owner.getBonusAttributeValue(attribute)) == 0 ? "<span style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>" : "<span style='color: " + Colour.GENERIC_BAD.getShades()[1] + ";'>")) + String.format("%.2f", owner.getBonusAttributeValue(attribute)) + "</span>" + "</div>" + "<div class='subTitle-third'>" + "<b style='color:" + attribute.getColour().toWebHexString() + ";'>Total</b></br>" + String.format("%.2f", owner.getAttributeValue(attribute)) + "</span>" + "</div>" + "<div class='description'>" + attribute.getDescription(owner) + "</div>"));
        }
    } else if (extraAttributes) {
        Main.mainController.setTooltipSize(360, 520);
        tooltipSB.setLength(0);
        tooltipSB.append(UtilText.parse(owner, "<div class='title' style='color:" + Femininity.valueOf(owner.getFemininityValue()).getColour().toWebHexString() + ";'>" + (owner.getName().length() == 0 ? "[npc.Race]" : "[npc.Name]") + "</div>" + "<div class='subTitle' style='margin-bottom:4px;'>Level " + owner.getLevel() + " <span style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>|</span> " + owner.getExperience() + " / " + (10 * owner.getLevel()) + " xp</div>" + extraAttributeBonus(owner, Attribute.CRITICAL_CHANCE) + extraAttributeBonus(owner, Attribute.CRITICAL_DAMAGE) + // Header:
        "<div class='subTitle-third combatValue'>" + "Type" + "</div>" + "<div class='subTitle-third combatValue'>" + "Damage" + "</div>" + "<div class='subTitle-third combatValue'>" + "Resist" + "</div>" + // Values:
        extraAttributeTableRow(owner, "Physical", Attribute.DAMAGE_PHYSICAL, Attribute.RESISTANCE_PHYSICAL) + extraAttributeTableRow(owner, "Fire", Attribute.DAMAGE_FIRE, Attribute.RESISTANCE_FIRE) + extraAttributeTableRow(owner, "Cold", Attribute.DAMAGE_ICE, Attribute.RESISTANCE_ICE) + extraAttributeTableRow(owner, "Poison", Attribute.DAMAGE_POISON, Attribute.RESISTANCE_POISON) + extraAttributeTableRow(owner, "Seduction", Attribute.DAMAGE_LUST, Attribute.RESISTANCE_LUST) + extraAttributeTableRow(owner, "Spell", Attribute.DAMAGE_SPELLS, Attribute.RESISTANCE_SPELLS) + extraAttributeBonus(owner, Attribute.FERTILITY) + extraAttributeBonus(owner, Attribute.VIRILITY) + extraAttributeBonus(owner, Attribute.SPELL_COST_MODIFIER)));
        Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
    } else if (weather) {
        Main.mainController.setTooltipSize(360, 100);
        tooltipSB.setLength(0);
        tooltipSB.append("<div class='title'>" + "<b style='color:" + Main.game.getCurrentWeather().getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(Main.game.getCurrentWeather().getName()) + "</b>" + "</div>" + "<div class='title'>" + "<b>" + ((Main.game.getWeatherTimeRemaining() / 60) + 1) + " hour" + (((Main.game.getWeatherTimeRemaining() / 60) + 1) > 1 ? "s" : "") + " remaining" + "</b>" + "</div>");
        Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
    } else if (protection) {
        Main.mainController.setTooltipSize(360, 100);
        tooltipSB.setLength(0);
        tooltipSB.append("<div class='title'>Protection</div>" + "<div class='subTitle'>" + (owner.isWearingCondom() ? "<span style='color:" + Colour.GENERIC_GOOD.toWebHexString() + ";'>Wearing Condom</span>" : "<span style='color:" + Colour.GENERIC_BAD.toWebHexString() + ";'>No Condom</span>") + "</div>");
        Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
    } else if (tattoo) {
        Main.mainController.setTooltipSize(360, 100);
        tooltipSB.setLength(0);
        tooltipSB.append("<div class='title'>Tattoos</div>" + "<div class='subTitle'>" + "TODO" + "</div>");
        Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
    } else if (copyInformation) {
        Main.mainController.setTooltipSize(360, 170);
        tooltipSB.setLength(0);
        tooltipSB.append("<div class='subTitle'>" + (Main.game.getCurrentDialogueNode().getLabel() == "" || Main.game.getCurrentDialogueNode().getLabel() == null ? "-" : Main.game.getCurrentDialogueNode().getLabel()) + "</div>" + "<div class='description'>" + "Click to copy the currently displayed dialogue to your clipboard.</br></br>" + "This scene was written by <b style='color:" + Colour.ANDROGYNOUS.toWebHexString() + ";'>" + Main.game.getCurrentDialogueNode().getAuthor() + "</b></div>");
        Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
    } else {
        // Standard information:
        if (description == null || description.isEmpty()) {
            Main.mainController.setTooltipSize(360, 64);
            Main.mainController.setTooltipContent(UtilText.parse("<div class='title'>" + title + "</div>"));
        } else {
            Main.mainController.setTooltipSize(360, 175);
            Main.mainController.setTooltipContent(UtilText.parse("<div class='title'>" + title + "</div>" + "<div class='description'>" + description + "</div>"));
        }
    }
    (new Thread(new TooltipUpdateThread())).start();
}
Also used : Fetish(com.lilithsthrone.game.character.fetishes.Fetish) Entry(java.util.Map.Entry) StatusEffect(com.lilithsthrone.game.character.effects.StatusEffect) FetishLevel(com.lilithsthrone.game.character.fetishes.FetishLevel) TooltipUpdateThread(com.lilithsthrone.controller.TooltipUpdateThread) Colour(com.lilithsthrone.utils.Colour) TooltipUpdateThread(com.lilithsthrone.controller.TooltipUpdateThread)

Example 2 with FetishLevel

use of com.lilithsthrone.game.character.fetishes.FetishLevel in project liliths-throne-public by Innoxia.

the class PhoneDialogue method getIndividualFetishEntry.

private static String getIndividualFetishEntry(Fetish fetish) {
    FetishLevel level = FetishLevel.getFetishLevelFromValue(Main.game.getPlayer().getFetishExperience(fetish));
    float experiencePercentage = ((Main.game.getPlayer().getFetishExperience(fetish)) / (float) (level.getMaximumExperience())) * 100;
    return "<div class='container-half-width' style='margin:0 8px;'>" + "<div class='container-full-width' style='text-align:center; font-weight:bold; margin:0 8px; width: calc(78% - 16px);'>" + (Main.game.getPlayer().hasFetish(fetish) ? "[style.colourPink(" + Util.capitaliseSentence(fetish.getName(Main.game.getPlayer())) + " " + level.getNumeral() + ")]" : Util.capitaliseSentence(fetish.getName(Main.game.getPlayer())) + " " + level.getNumeral()) + // Spacer
    "<div class='container-full-width' style='margin:2px 0; padding:0; width:100%;'></div>" + getFetishDesireEntry(fetish, FetishDesire.ZERO_HATE) + getFetishDesireEntry(fetish, FetishDesire.ONE_DISLIKE) + getFetishDesireEntry(fetish, FetishDesire.TWO_NEUTRAL) + getFetishDesireEntry(fetish, FetishDesire.THREE_LIKE) + getFetishDesireEntry(fetish, FetishDesire.FOUR_LOVE) + "</div>" + "<div class='container-full-width' style='margin:0 8px; width: calc(22% - 16px);'>" + "<div id='fetishUnlock" + fetish + "' class='fetish-icon full" + (Main.game.getPlayer().hasFetish(fetish) ? " owned' style='border:2px solid " + Colour.FETISH.toWebHexString() + ";'>" : (fetish.isAvailable(Main.game.getPlayer()) ? " unlocked' style='border:2px solid " + Colour.TEXT_GREY.toWebHexString() + ";" + "'>" : " locked' style='border:2px solid " + Colour.TEXT_GREY.toWebHexString() + ";'>")) + "<div class='fetish-icon-content'>" + fetish.getSVGString() + "</div>" + "<div style='width:40%;height:40%;position:absolute;top:0;right:0;'>" + level.getSVGImageOverlay() + "</div>" + (// Overlay to create disabled effect:
    Main.game.getPlayer().hasFetish(fetish) ? "" : (fetish.isAvailable(Main.game.getPlayer()) ? "<div style='position:absolute; left:0; top:0; margin:0; padding:0; width:100%; height:100%; background-color:#000; opacity:0.5; border-radius:5px;'></div>" : "<div style='position:absolute; left:0; top:0; margin:0; padding:0; width:100%; height:100%; background-color:#000; opacity:0.7; border-radius:5px;'></div>")) + "</div>" + "</div>" + "<div class='container-full-width' style='margin:0; padding:0; width:100%;'>" + "<div class='container-full-width' style='text-align:center; font-weight:bold; margin:0 8px; width: calc(78% - 16px);'>" + "<div class='container-full-width' style='margin:4px 0; padding:2px; width:100%; background:#222;'>" + "<div class='container-full-width' style='margin:0; padding:2px; width:" + experiencePercentage + "%; background:" + level.getColour().toWebHexString() + ";'></div>" + "</div>" + "</div>" + "<div class='container-full-width' style='text-align:center; margin:0 8px; width: calc(22% - 16px);'>" + "<span style='color:" + level.getColour().toWebHexString() + ";'>" + Main.game.getPlayer().getFetishExperience(fetish) + " xp</span>" + "</div>" + // + "<div class='overlay no-pointer' id='"+fetish+"_EXPERIENCE'></div>"
    "</div>" + "</div>";
}
Also used : FetishLevel(com.lilithsthrone.game.character.fetishes.FetishLevel)

Aggregations

FetishLevel (com.lilithsthrone.game.character.fetishes.FetishLevel)2 TooltipUpdateThread (com.lilithsthrone.controller.TooltipUpdateThread)1 StatusEffect (com.lilithsthrone.game.character.effects.StatusEffect)1 Fetish (com.lilithsthrone.game.character.fetishes.Fetish)1 Colour (com.lilithsthrone.utils.Colour)1 Entry (java.util.Map.Entry)1