use of com.lilithsthrone.game.inventory.item.ItemEffect in project liliths-throne-public by Innoxia.
the class EnchantingUtils method getImportedSVGString.
public static String getImportedSVGString(AbstractCoreItem item, Colour importedColour, List<ItemEffect> effects) {
if (((AbstractItem) item).getItemType().getId().equals(ItemType.ORIENTATION_HYPNO_WATCH.getId())) {
if (effects.isEmpty() || effects.get(0).getPrimaryModifier() == TFModifier.REMOVAL) {
return SVGImages.SVG_IMAGE_PROVIDER.getHypnoWatchBase();
}
if (effects.get(0).getPrimaryModifier() == TFModifier.ORIENTATION_GYNEPHILIC) {
return SVGImages.SVG_IMAGE_PROVIDER.getHypnoWatchGynephilic();
} else if (effects.get(0).getPrimaryModifier() == TFModifier.ORIENTATION_AMBIPHILIC) {
return SVGImages.SVG_IMAGE_PROVIDER.getHypnoWatchAmbiphilic();
} else {
return SVGImages.SVG_IMAGE_PROVIDER.getHypnoWatchAndrophilic();
}
}
StringBuilder SVGImageSB = new StringBuilder();
String importedColourString = SVGImages.SVG_IMAGE_PROVIDER.getRefinedBackgroundMap().get(importedColour);
if (importedColourString == null || importedColourString.isEmpty() || importedColourString.equals("null")) {
importedColourString = SVGImages.SVG_IMAGE_PROVIDER.getRefinedBackgroundMap().get(effects.get(0).getItemEffectType().getColour());
}
SVGImageSB.append("<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;'>" + importedColourString + "</div>");
String s = item.getSVGString();
Colour colour = Colour.CLOTHING_BLUE_LIGHT;
for (ItemEffect ie : effects) {
if (ie.getPrimaryModifier() != null && ie.getPrimaryModifier() != TFModifier.NONE) {
colour = ie.getPrimaryModifier().getColour();
break;
}
}
s = s.replaceAll("#ff2a2a", colour.getShades()[0]);
s = s.replaceAll("#ff5555", colour.getShades()[1]);
s = s.replaceAll("#ff8080", colour.getShades()[2]);
s = s.replaceAll("#ffaaaa", colour.getShades()[3]);
s = s.replaceAll("#ffd5d5", colour.getShades()[4]);
SVGImageSB.append("<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;'>" + s + "</div>");
for (ItemEffect ie : effects) {
if (ie.getSecondaryModifier() != null && ie.getSecondaryModifier() != TFModifier.NONE) {
SVGImageSB.append("<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;'>" + SVGImages.SVG_IMAGE_PROVIDER.getRefinedSwirlsMap().get(ie.getSecondaryModifier().getColour()) + "</div>");
break;
}
}
return SVGImageSB.toString();
}
use of com.lilithsthrone.game.inventory.item.ItemEffect in project liliths-throne-public by Innoxia.
the class EnchantingUtils method getCost.
public static int getCost(AbstractCoreItem ingredient, List<ItemEffect> effects) {
int cost = 0;
Map<ItemEffect, Integer> effectCount = new HashMap<>();
for (ItemEffect ie : effects) {
effectCount.putIfAbsent(ie, 0);
effectCount.put(ie, effectCount.get(ie) + 1);
}
for (ItemEffect ie : ingredient.getEffects()) {
if (effects.contains(ie)) {
effectCount.put(ie, effectCount.get(ie) - 1);
} else {
effectCount.putIfAbsent(ie, 0);
effectCount.put(ie, effectCount.get(ie) + 1);
}
}
for (Entry<ItemEffect, Integer> entry : effectCount.entrySet()) {
cost += entry.getKey().getCost() * Math.abs(entry.getValue());
}
if (Main.game.getPlayer().hasFetish(Fetish.FETISH_TRANSFORMATION_GIVING) && ingredient instanceof AbstractItem) {
cost /= 2;
}
if (Main.game.getPlayer().hasTrait(Perk.CLOTHING_ENCHANTER, true) && ingredient instanceof AbstractClothing) {
cost /= 2;
}
return cost;
}
use of com.lilithsthrone.game.inventory.item.ItemEffect in project liliths-throne-public by Innoxia.
the class EnchantingUtils method craftClothing.
public static AbstractClothing craftClothing(AbstractCoreItem ingredient, List<ItemEffect> effects) {
AbstractClothing craftedClothing = null;
List<ItemEffect> effectsToBeAdded = new ArrayList<>();
effectsToBeAdded.addAll(effects);
craftedClothing = AbstractClothingType.generateClothing((AbstractClothingType) ingredient.getEnchantmentItemType(effects), ingredient.getColour(), ((AbstractClothing) ingredient).getSecondaryColour(), ((AbstractClothing) ingredient).getTertiaryColour(), effectsToBeAdded);
craftedClothing.setEnchantmentKnown(true);
return craftedClothing;
}
use of com.lilithsthrone.game.inventory.item.ItemEffect in project liliths-throne-public by Innoxia.
the class EnchantingUtils method getSVGString.
public static String getSVGString(AbstractCoreItem ingredient, List<ItemEffect> effects) {
if (ingredient.getEnchantmentItemType(effects) instanceof AbstractClothingType) {
return ingredient.getSVGString();
}
if (((AbstractItem) ingredient).getItemType().getId().equals(ItemType.ORIENTATION_HYPNO_WATCH.getId())) {
if (effects.isEmpty() || effects.get(0).getPrimaryModifier() == TFModifier.REMOVAL) {
return SVGImages.SVG_IMAGE_PROVIDER.getHypnoWatchBase();
}
if (effects.get(0).getPrimaryModifier() == TFModifier.ORIENTATION_GYNEPHILIC) {
return SVGImages.SVG_IMAGE_PROVIDER.getHypnoWatchGynephilic();
} else if (effects.get(0).getPrimaryModifier() == TFModifier.ORIENTATION_AMBIPHILIC) {
return SVGImages.SVG_IMAGE_PROVIDER.getHypnoWatchAmbiphilic();
} else {
return SVGImages.SVG_IMAGE_PROVIDER.getHypnoWatchAndrophilic();
}
}
StringBuilder SVGImageSB = new StringBuilder();
SVGImageSB.append("<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;'>" + SVGImages.SVG_IMAGE_PROVIDER.getRefinedBackgroundMap().get(ingredient.getEnchantmentEffect().getColour()) + "</div>");
String s = ((AbstractItemType) ingredient.getEnchantmentItemType(effects)).getSVGString();
Colour colour = Colour.CLOTHING_BLUE_LIGHT;
for (ItemEffect ie : effects) {
if (ie.getPrimaryModifier() != null && ie.getPrimaryModifier() != TFModifier.NONE) {
colour = ie.getPrimaryModifier().getColour();
break;
}
}
s = s.replaceAll("#ff2a2a", colour.getShades()[0]);
s = s.replaceAll("#ff5555", colour.getShades()[1]);
s = s.replaceAll("#ff8080", colour.getShades()[2]);
s = s.replaceAll("#ffaaaa", colour.getShades()[3]);
s = s.replaceAll("#ffd5d5", colour.getShades()[4]);
SVGImageSB.append("<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;'>" + s + "</div>");
for (ItemEffect ie : effects) {
if (ie.getSecondaryModifier() != null && ie.getSecondaryModifier() != TFModifier.NONE) {
SVGImageSB.append("<div style='width:100%;height:100%;position:absolute;left:0;bottom:0;'>" + SVGImages.SVG_IMAGE_PROVIDER.getRefinedSwirlsMap().get(ie.getSecondaryModifier().getColour()) + "</div>");
break;
}
}
return SVGImageSB.toString();
}
use of com.lilithsthrone.game.inventory.item.ItemEffect in project liliths-throne-public by Innoxia.
the class GameCharacter method applyUnequipClothingEffects.
private void applyUnequipClothingEffects(AbstractClothing clothing) {
incrementBonusAttribute(Attribute.RESISTANCE_PHYSICAL, -clothing.getClothingType().getPhysicalResistance());
for (Entry<Attribute, Integer> e : clothing.getAttributeModifiers().entrySet()) {
incrementBonusAttribute(e.getKey(), -e.getValue());
}
for (ItemEffect ie : clothing.getEffects()) {
if (ie.getSecondaryModifier() != null && ie.getSecondaryModifier().getFetish() != null) {
Fetish associatedFetish = ie.getSecondaryModifier().getFetish();
switch(ie.getPotency()) {
case MINOR_BOOST:
clothingFetishDesireModifiersMap.put(associatedFetish, clothingFetishDesireModifiersMap.get(associatedFetish) - 1);
break;
case BOOST:
clothingFetishDesireModifiersMap.put(associatedFetish, clothingFetishDesireModifiersMap.get(associatedFetish) - 2);
break;
case MAJOR_BOOST:
fetishesFromClothing.remove(associatedFetish);
applyFetishLossEffects(associatedFetish);
break;
case MINOR_DRAIN:
clothingFetishDesireModifiersMap.put(associatedFetish, clothingFetishDesireModifiersMap.get(associatedFetish) + 1);
break;
case DRAIN:
clothingFetishDesireModifiersMap.put(associatedFetish, clothingFetishDesireModifiersMap.get(associatedFetish) + 2);
break;
case MAJOR_DRAIN:
clothingFetishDesireModifiersMap.putIfAbsent(associatedFetish, 0);
clothingFetishDesireModifiersMap.put(associatedFetish, clothingFetishDesireModifiersMap.get(associatedFetish) + 999);
break;
}
}
}
}
Aggregations