use of com.lilithsthrone.controller.TooltipUpdateThread in project liliths-throne-public by Innoxia.
the class InventoryTooltipEventListener method handleEvent.
@Override
public void handleEvent(Event event) {
if (item != null || (coreItem instanceof AbstractItem)) {
if (coreItem != null) {
item = (AbstractItem) coreItem;
}
int yIncrease = 0;
if (InventoryDialogue.getInventoryNPC() != null && InventoryDialogue.getNPCInventoryInteraction() == InventoryInteraction.TRADING) {
yIncrease += 2;
}
if (!item.getEffects().isEmpty()) {
yIncrease += 1;
for (ItemEffect ie : item.getEffects()) {
yIncrease += ie.getEffectsDescription(Main.game.getPlayer(), Main.game.getPlayer()).size();
}
}
Main.mainController.setTooltipSize(360, 256 + (LINE_HEIGHT * yIncrease));
tooltipSB.setLength(0);
tooltipSB.append("<div class='title'>" + Util.capitaliseSentence(item.getDisplayName(true)) + "</div>");
if (!item.getEffects().isEmpty()) {
tooltipSB.append("<div class='subTitle'>");
int ieCount = 0;
for (ItemEffect ie : item.getEffects()) {
if (ieCount > 0)
tooltipSB.append("</br>");
ieCount++;
for (int i = 0; i < ie.getEffectsDescription(Main.game.getPlayer(), Main.game.getPlayer()).size(); i++) {
if (i != 0)
tooltipSB.append("</br>");
tooltipSB.append(ie.getEffectsDescription(Main.game.getPlayer(), Main.game.getPlayer()).get(i));
}
}
tooltipSB.append("</div>");
}
tooltipSB.append("<div class='subTitle-half'>" + (item.isConsumedOnUse() ? "<span style='color:" + Colour.GENERIC_BAD.toWebHexString() + ";'>Consumed on use</span>" : "<span style='color:" + Colour.GENERIC_GOOD.toWebHexString() + ";'>Infinite uses</span>") + "</div>" + "<div class='subTitle-half'>" + (item.isAbleToBeUsedInCombat() ? (item.isAbleToBeUsedInSex() ? "<span style='color:" + Colour.GENERIC_COMBAT.toWebHexString() + ";'>Combat</span> & <span style='color:" + Colour.GENERIC_SEX.toWebHexString() + ";'>Sex</span> use" : "<span style='color:" + Colour.GENERIC_COMBAT.toWebHexString() + ";'>Combat</span> use") : (item.isAbleToBeUsedInSex() ? "<span style='color:" + Colour.GENERIC_SEX.toWebHexString() + ";'>Sex</span> use" : "Standard use")) + "</div>" + "<div class='description' style='height:104px'>" + UtilText.parse(item.getDescription()) + "</div>" + "<div class='subTitle'>" + UtilText.formatAsMoney(item.getValue()) + "</div>");
if (InventoryDialogue.getInventoryNPC() != null && InventoryDialogue.getNPCInventoryInteraction() == InventoryInteraction.TRADING) {
if (owner.isPlayer()) {
if (InventoryDialogue.getInventoryNPC().willBuy(item))
tooltipSB.append("<div class='subTitle'>" + InventoryDialogue.getInventoryNPC().getName("The") + " offers " + UtilText.formatAsMoney(item.getPrice(InventoryDialogue.getInventoryNPC().getBuyModifier())) + "</div>");
else
tooltipSB.append("<div class='subTitle'>" + "<span style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>" + InventoryDialogue.getInventoryNPC().getName("The") + " will not buy this</span>" + "</div>");
} else {
if (InventoryDialogue.isBuyback()) {
tooltipSB.append("<div class='subTitle'>" + InventoryDialogue.getInventoryNPC().getName("The") + " wants " + UtilText.formatAsMoney(getBuybackPriceFor(item)) + "</div>");
} else {
tooltipSB.append("<div class='subTitle'>" + InventoryDialogue.getInventoryNPC().getName("The") + " wants " + UtilText.formatAsMoney(item.getPrice(InventoryDialogue.getInventoryNPC().getSellModifier())) + "</div>");
}
}
}
Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
} else if (weapon != null || (coreItem instanceof AbstractWeapon)) {
if (coreItem != null)
weapon = (AbstractWeapon) coreItem;
weaponTooltip(weapon);
} else if (clothing != null || (coreItem instanceof AbstractClothing)) {
if (coreItem != null)
clothing = (AbstractClothing) coreItem;
clothingTooltip(clothing);
} else if (dyeClothing != null) {
Main.mainController.setTooltipSize(360, 446);
tooltipSB.setLength(0);
if (colour != null) {
tooltipSB.append("<div class='title' style='color:" + dyeClothing.getRarity().getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(dyeClothing.getName()) + "</div>" + "<div class='subTitle'>" + Util.capitaliseSentence(colour.getName()) + "</div>" + "<div class='picture full' style='position:relative;'>" + dyeClothing.getClothingType().getSVGImage(colour, InventoryDialogue.dyePreviewSecondary, InventoryDialogue.dyePreviewTertiary) + "</div>");
} else if (secondaryColour != null) {
tooltipSB.append("<div class='title' style='color:" + dyeClothing.getRarity().getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(dyeClothing.getName()) + "</div>" + "<div class='subTitle'>" + Util.capitaliseSentence(secondaryColour.getName()) + "</div>" + "<div class='picture full' style='position:relative;'>" + dyeClothing.getClothingType().getSVGImage(InventoryDialogue.dyePreviewPrimary, secondaryColour, InventoryDialogue.dyePreviewTertiary) + "</div>");
} else if (tertiaryColour != null) {
tooltipSB.append("<div class='title' style='color:" + dyeClothing.getRarity().getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(dyeClothing.getName()) + "</div>" + "<div class='subTitle'>" + Util.capitaliseSentence(tertiaryColour.getName()) + "</div>" + "<div class='picture full' style='position:relative;'>" + dyeClothing.getClothingType().getSVGImage(InventoryDialogue.dyePreviewPrimary, InventoryDialogue.dyePreviewSecondary, tertiaryColour) + "</div>");
}
Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
} else if (genericItem != null) {
Main.mainController.setTooltipSize(360, 60);
Main.mainController.setTooltipContent(UtilText.parse("<div class='title'>" + Util.capitaliseSentence(genericItem.getName(false)) + "</div>"));
} else if (genericClothing != null) {
Main.mainController.setTooltipSize(360, 446);
tooltipSB.setLength(0);
tooltipSB.append("<div class='title' style='color:" + genericClothing.getRarity().getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(genericClothing.getName()) + "</div>" + "<div class='subTitle'>" + Util.capitaliseSentence(colour.getName()) + "</div>" + "<div class='picture full' style='position:relative;'>" + genericClothing.getSVGImage(colour, genericClothing.getAvailableSecondaryColours().isEmpty() ? null : genericClothing.getAvailableSecondaryColours().get(0), genericClothing.getAvailableTertiaryColours().isEmpty() ? null : genericClothing.getAvailableTertiaryColours().get(0)) + "</div>");
Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
} else if (genericWeapon != null) {
Main.mainController.setTooltipSize(360, 446);
tooltipSB.setLength(0);
tooltipSB.append("<div class='title' style='color:" + genericWeapon.getRarity().getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(genericWeapon.getName()) + "</div>" + "<div class='subTitle'>" + Util.capitaliseSentence(dt.getName()) + "</div>" + "<div class='picture full'>" + genericWeapon.getSVGStringMap().get(dt) + "</div>");
Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
} else if (invSlot != null) {
if (invSlot == InventorySlot.WEAPON_MAIN) {
if (equippedToCharacter != null) {
if (equippedToCharacter.getMainWeapon() == null) {
Main.mainController.setTooltipSize(360, 60);
Main.mainController.setTooltipContent("<div class='title'>Primary Weapon</div>");
} else {
weaponTooltip(equippedToCharacter.getMainWeapon());
}
} else {
Main.mainController.setTooltipSize(360, 60);
Main.mainController.setTooltipContent("<div class='title'>Primary Weapon</div>");
}
} else if (invSlot == InventorySlot.WEAPON_OFFHAND) {
if (equippedToCharacter != null) {
if (equippedToCharacter.getOffhandWeapon() == null) {
Main.mainController.setTooltipSize(360, 60);
Main.mainController.setTooltipContent("<div class='title'>Secondary Weapon</div>");
} else {
weaponTooltip(equippedToCharacter.getOffhandWeapon());
}
} else {
Main.mainController.setTooltipSize(360, 60);
Main.mainController.setTooltipContent("<div class='title'>Secondary Weapon</div>");
}
} else {
if (equippedToCharacter != null) {
if (equippedToCharacter.getClothingInSlot(invSlot) == null) {
List<String> clothingBlockingThisSlot = new ArrayList<>();
for (AbstractClothing c : equippedToCharacter.getClothingCurrentlyEquipped()) {
if (c.getClothingType().getIncompatibleSlots().contains(invSlot)) {
clothingBlockingThisSlot.add(c.getName());
}
}
if (!clothingBlockingThisSlot.isEmpty()) {
setBlockedTooltipContent("This slot is currently <b style='color:" + Colour.SEALED.toWebHexString() + ";'>blocked</b> by your " + Util.stringsToStringList(clothingBlockingThisSlot, false) + ".");
} else if (invSlot.slotBlockedByRace(equippedToCharacter) != null) {
setBlockedTooltipContent(invSlot.getCannotBeWornDescription(equippedToCharacter));
} else {
boolean piercingBlocked = false;
switch(invSlot) {
case PIERCING_VAGINA:
if (equippedToCharacter.getVaginaType() == VaginaType.NONE) {
setBlockedTooltipContent(getTooltipText(equippedToCharacter, "You don't have a vagina.", (equippedToCharacter.getPlayerKnowsAreas().contains(CoverableArea.VAGINA) ? "[npc.Name] doesn't have a vagina." : "You don't know if [npc.name] has a vagina.")));
piercingBlocked = true;
} else if (!equippedToCharacter.isPiercedVagina()) {
setBlockedTooltipContent(getTooltipText(equippedToCharacter, "Your vagina has not been pierced.", (equippedToCharacter.getPlayerKnowsAreas().contains(CoverableArea.VAGINA) ? "[npc.Name]'s vagina has not been pierced." : "You don't know if [npc.name] has a vagina.")));
piercingBlocked = true;
}
break;
case PIERCING_EAR:
if (!equippedToCharacter.isPiercedEar()) {
setBlockedTooltipContent(getTooltipText(equippedToCharacter, "Your ears have not been pierced.", "[npc.Name]'s ears have not been pierced."));
piercingBlocked = true;
}
break;
case PIERCING_LIP:
if (!equippedToCharacter.isPiercedLip()) {
setBlockedTooltipContent(getTooltipText(equippedToCharacter, "Your lips have not been pierced.", "[npc.Name]'s lips have not been pierced."));
piercingBlocked = true;
}
break;
case PIERCING_NIPPLE:
if (!equippedToCharacter.isPiercedNipple()) {
setBlockedTooltipContent(getTooltipText(equippedToCharacter, "Your nipples have not been pierced.", (equippedToCharacter.getPlayerKnowsAreas().contains(CoverableArea.NIPPLES) ? "[npc.Name]'s nipples have not been pierced." : "You don't know if [npc.name]'s nipples have been pierced.")));
piercingBlocked = true;
}
break;
case PIERCING_NOSE:
if (!equippedToCharacter.isPiercedNose()) {
setBlockedTooltipContent(getTooltipText(equippedToCharacter, "Your nose has not been pierced.", "[npc.Name]'s nose has not been pierced."));
piercingBlocked = true;
}
break;
case PIERCING_PENIS:
if (equippedToCharacter.getPenisType() == PenisType.NONE) {
setBlockedTooltipContent(getTooltipText(equippedToCharacter, "You don't have a penis.", (equippedToCharacter.getPlayerKnowsAreas().contains(CoverableArea.PENIS) ? "[npc.Name] doesn't have a penis." : "You don't know if [npc.name] has a penis.")));
piercingBlocked = true;
} else if (!equippedToCharacter.isPiercedPenis()) {
setBlockedTooltipContent(getTooltipText(equippedToCharacter, "Your penis has not been pierced.", (equippedToCharacter.getPlayerKnowsAreas().contains(CoverableArea.PENIS) ? "[npc.Name]'s penis has not been pierced." : "You don't know if [npc.name] has a penis.")));
piercingBlocked = true;
}
break;
case PIERCING_STOMACH:
if (!equippedToCharacter.isPiercedNavel()) {
setBlockedTooltipContent(getTooltipText(equippedToCharacter, "Your navel has not been pierced.", "[npc.Name]'s navel has not been pierced."));
piercingBlocked = true;
}
break;
case PIERCING_TONGUE:
if (!equippedToCharacter.isPiercedTongue()) {
setBlockedTooltipContent(getTooltipText(equippedToCharacter, "Your tongue has not been pierced.", "[npc.Name]'s tongue has not been pierced."));
piercingBlocked = true;
}
break;
default:
break;
}
if (!piercingBlocked) {
Main.mainController.setTooltipSize(360, 60);
Main.mainController.setTooltipContent(UtilText.parse("<div class='title'>" + Util.capitaliseSentence(invSlot.getName()) + "</div>"));
}
}
} else {
clothingTooltip(equippedToCharacter.getClothingInSlot(invSlot));
}
} else {
Main.mainController.setTooltipSize(360, 60);
Main.mainController.setTooltipContent(UtilText.parse("<div class='title'>" + Util.capitaliseSentence(invSlot.getName()) + "</div>"));
}
}
} else if (enchantmentModifier != null) {
Main.mainController.setTooltipSize(360, 152);
Main.mainController.setTooltipContent(UtilText.parse("<div class='title' style='color:" + enchantmentModifier.getRarity().getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(enchantmentModifier.getName()) + "</div>" + "<div class='description' style='height:48px'>" + UtilText.parse(enchantmentModifier.getDescription()) + "</div>" + "<div class='subTitle'>" + "<b style='color:" + EnchantmentDialogue.ingredient.getRelatedEssence().getColour().toWebHexString() + ";'>+" + enchantmentModifier.getValue() + " " + EnchantmentDialogue.ingredient.getRelatedEssence().getName() + "</b> essence cost" + "</div>"));
} else if (potency != null) {
Main.mainController.setTooltipSize(360, 60);
Main.mainController.setTooltipContent(UtilText.parse("<div class='title'>Set potency to <b style='color:" + potency.getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(potency.getName()) + "</b></div>"));
} else if (essence != null) {
Main.mainController.setTooltipSize(360, 60);
Main.mainController.setTooltipContent(UtilText.parse("<div class='title'><b style='color:" + essence.getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(essence.getName()) + "</b> essence</div>"));
} else {
return;
}
(new Thread(new TooltipUpdateThread())).start();
// Main.mainController.getTooltip().show(Main.primaryStage);
}
use of com.lilithsthrone.controller.TooltipUpdateThread 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();
}
use of com.lilithsthrone.controller.TooltipUpdateThread in project liliths-throne-public by Innoxia.
the class TooltipResponseDescriptionEventListener method handleEvent.
@Override
public void handleEvent(Event event) {
Main.mainController.setTooltipContent("");
if (nextPage) {
if (Main.game.isHasNextResponsePage()) {
Main.mainController.setTooltipSize(360, 60);
double xPosition = ((MouseEvent) event).getScreenX() + 16 - 180;
if (xPosition + 360 > Main.primaryStage.getX() + Main.primaryStage.getWidth() - 16)
xPosition = Main.primaryStage.getX() + Main.primaryStage.getWidth() - 360 - 16;
double yPosition = Main.primaryStage.getY() + Main.primaryStage.getHeight() - (34 * (MainController.RESPONSE_COUNT / 5) + 4) - Main.mainController.getTooltip().getHeight() - (Main.mainScene.getWindow().getHeight() - Main.mainScene.getHeight() - Main.mainScene.getY());
Main.mainController.getTooltip().setAnchorX(xPosition);
Main.mainController.getTooltip().setAnchorY(yPosition);
Main.mainController.setTooltipContent("<div class='title'>Next Page</div>");
Main.mainController.getTooltip().setAnchorX(xPosition);
Main.mainController.getTooltip().setAnchorY(yPosition);
(new Thread(new TooltipUpdateThread(xPosition, yPosition))).start();
}
} else if (previousPage) {
if (Main.game.getResponsePage() != 0) {
Main.mainController.setTooltipSize(360, 60);
double xPosition = ((MouseEvent) event).getScreenX() + 16 - 180;
if (xPosition + 360 > Main.primaryStage.getX() + Main.primaryStage.getWidth() - 16)
xPosition = Main.primaryStage.getX() + Main.primaryStage.getWidth() - 360 - 16;
double yPosition = Main.primaryStage.getY() + Main.primaryStage.getHeight() - (34 * (MainController.RESPONSE_COUNT / 5) + 4) - Main.mainController.getTooltip().getHeight() - (Main.mainScene.getWindow().getHeight() - Main.mainScene.getHeight() - Main.mainScene.getY());
Main.mainController.getTooltip().setAnchorX(xPosition);
Main.mainController.getTooltip().setAnchorY(yPosition);
Main.mainController.setTooltipContent("<div class='title'>Previous Page</div>");
Main.mainController.getTooltip().setAnchorX(xPosition);
Main.mainController.getTooltip().setAnchorY(yPosition);
(new Thread(new TooltipUpdateThread(xPosition, yPosition))).start();
}
} else {
Response response = null;
if (Main.game.getCurrentDialogueNode() != null) {
if (Main.game.getResponsePage() == 0) {
response = Main.game.getCurrentDialogueNode().getResponse(Main.game.getResponseTab(), index);
} else {
if (index != 0) {
response = Main.game.getCurrentDialogueNode().getResponse(Main.game.getResponseTab(), Main.game.getResponsePage() * MainController.RESPONSE_COUNT + index - 1);
} else {
response = Main.game.getCurrentDialogueNode().getResponse(Main.game.getResponseTab(), Main.game.getResponsePage() * MainController.RESPONSE_COUNT + MainController.RESPONSE_COUNT - 1);
}
}
}
if (response != null) {
tooltipSB.setLength(0);
int boxHeight = 130;
if (!response.hasRequirements()) {
if (response.isSexHighlight()) {
tooltipSB.append("<div class='title'><span style='color:" + Colour.GENERIC_SEX.toWebHexString() + ";'>Sex</span></div>");
boxHeight += 44;
} else if (response.isCombatHighlight()) {
tooltipSB.append("<div class='title'><span style='color:" + Colour.GENERIC_COMBAT.toWebHexString() + ";'>Combat</span></div>");
boxHeight += 44;
}
tooltipSB.append("<div class='description'>" + response.getTooltipText() + "</div>");
} else {
if (response.isAvailable()) {
if (response.isSexHighlight())
tooltipSB.append("<div class='title'><span style='color:" + Colour.GENERIC_SEX.toWebHexString() + ";'>Sex</span> (<span style='color:" + Colour.GENERIC_GOOD.toWebHexString() + ";'>Available</span>)</div>");
else if (response.isCombatHighlight())
tooltipSB.append("<div class='title'><span style='color:" + Colour.GENERIC_COMBAT.toWebHexString() + ";'>Combat</span> (<span style='color:" + Colour.GENERIC_GOOD.toWebHexString() + ";'>Available</span>)</div>");
else
tooltipSB.append("<div class='title'><span style='color:" + Colour.GENERIC_GOOD.toWebHexString() + ";'>Available</span></div>");
boxHeight += 44;
if (response.getSexPace() != null) {
tooltipSB.append("<div class='subTitle'><span style='color:" + Colour.GENERIC_SEX.toWebHexString() + ";'>Sex Pace:</span>" + " <span style='color:" + response.getSexPace().getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(response.getSexPace().getName()) + "</span></div>");
boxHeight += 44;
}
tooltipSB.append("<div class='description'>" + response.getTooltipText() + "</div>");
} else if (response.isAbleToBypass()) {
if (response.isSexHighlight())
tooltipSB.append("<div class='title'><span style='color:" + Colour.GENERIC_SEX.toWebHexString() + ";'>Sex</span> (<span style='color:" + Colour.GENERIC_ARCANE.toWebHexString() + ";'>Corruptive</span>)</div>");
else if (response.isCombatHighlight())
tooltipSB.append("<div class='title'><span style='color:" + Colour.GENERIC_COMBAT.toWebHexString() + ";'>Combat</span> (<span style='color:" + Colour.GENERIC_ARCANE.toWebHexString() + ";'>Corruptive</span>)</div>");
else
tooltipSB.append("<div class='title'><span style='color:" + Colour.GENERIC_ARCANE.toWebHexString() + ";'>Corruptive</span></div>");
boxHeight += 44;
if (response.getSexPace() != null) {
tooltipSB.append("<div class='subTitle'><span style='color:" + Colour.GENERIC_SEX.toWebHexString() + ";'>Sex Pace:</span>" + " <span style='color:" + response.getSexPace().getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(response.getSexPace().getName()) + "</span></div>");
boxHeight += 44;
}
tooltipSB.append("<div class='description'>" + response.getTooltipText() + "</div>");
} else {
if (response.isSexHighlight())
tooltipSB.append("<div class='title'><span style='color:" + Colour.GENERIC_SEX.toWebHexString() + ";'>Sex</span> (<span style='color:" + Colour.GENERIC_BAD.toWebHexString() + ";'>Unavailable</span>)</div>");
else if (response.isCombatHighlight())
tooltipSB.append("<div class='title'><span style='color:" + Colour.GENERIC_COMBAT.toWebHexString() + ";'>Combat</span> (<span style='color:" + Colour.GENERIC_BAD.toWebHexString() + ";'>Unavailable</span>)</div>");
else
tooltipSB.append("<div class='title'><span style='color:" + Colour.GENERIC_BAD.toWebHexString() + ";'>Unavailable</span></div>");
boxHeight += 44;
if (response.getSexPace() != null) {
tooltipSB.append("<div class='subTitle'><span style='color:" + Colour.GENERIC_SEX.toWebHexString() + ";'>Sex Pace:</span>" + " <span style='color:" + response.getSexPace().getColour().toWebHexString() + ";'>" + Util.capitaliseSentence(response.getSexPace().getName()) + "</span></div>");
boxHeight += 44;
}
tooltipSB.append("<div class='description'><span style='color:" + Colour.TEXT_GREY.toWebHexString() + ";'>" + response.getTooltipText() + "</span></div>");
}
tooltipSB.append("<div class='description' style='height:" + ((response.lineHeight() + 2) * 18) + "; text-align:center;'>" + "<b>Availability:</b>" + response.getTooltipBlockingList() + response.getTooltipRequiredList() + "</div>");
tooltipSB.append("<div class='description-small'>" + response.getTooltipCorruptionBypassText() + "</div>");
boxHeight += 54;
boxHeight += 24 + ((response.lineHeight() + 1) * 18);
}
Main.mainController.setTooltipSize(360, boxHeight);
double xPosition = ((MouseEvent) event).getScreenX() + 16 - 180;
if (xPosition + 360 > Main.primaryStage.getX() + Main.primaryStage.getWidth() - 16)
xPosition = Main.primaryStage.getX() + Main.primaryStage.getWidth() - 360 - 16;
double yPosition = Main.primaryStage.getY() + Main.primaryStage.getHeight() - (34 * (MainController.RESPONSE_COUNT / 5) + 4) - boxHeight - (Main.mainScene.getWindow().getHeight() - Main.mainScene.getHeight() - Main.mainScene.getY());
Main.mainController.getTooltip().setAnchorX(xPosition);
Main.mainController.getTooltip().setAnchorY(yPosition);
(new Thread(new TooltipUpdateThread(xPosition, yPosition))).start();
Main.mainController.setTooltipContent(UtilText.parse(tooltipSB.toString()));
}
}
}
use of com.lilithsthrone.controller.TooltipUpdateThread in project liliths-throne-public by Innoxia.
the class CopyInfoEventListener method handleEvent.
@Override
public void handleEvent(Event event) {
Main.mainController.setTooltipSize(360, 170);
Main.mainController.setTooltipContent("<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>");
(new Thread(new TooltipUpdateThread())).start();
}
Aggregations