use of com.lilithsthrone.game.inventory.clothing.AbstractClothingType 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.clothing.AbstractClothingType 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.clothing.AbstractClothingType in project liliths-throne-public by Innoxia.
the class Nyan method dailyReset.
@Override
public void dailyReset() {
clearNonEquippedInventory();
Main.game.getDialogueFlags().resetNyanActions();
// Changing old versions of Nyan:
if (this.getClothingInSlot(InventorySlot.LEG) != null && this.getClothingInSlot(InventorySlot.LEG).getClothingType().getId() == ClothingType.LEG_PENCIL_SKIRT.getId()) {
this.unequipClothingIntoVoid(this.getClothingInSlot(InventorySlot.LEG), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.LEG_SKIRT, Colour.CLOTHING_BLACK, false), true, this);
}
commonFemaleClothing.clear();
commonFemaleUnderwear.clear();
commonFemaleOtherLingerie.clear();
commonFemaleAccessories.clear();
commonMaleClothing.clear();
commonMaleLingerie.clear();
commonMaleAccessories.clear();
commonAndrogynousClothing.clear();
commonAndrogynousLingerie.clear();
commonAndrogynousAccessories.clear();
specials.clear();
boolean enchantedGear = Main.game.getPlayer().isQuestCompleted(QuestLine.SIDE_NYAN_HELP);
// Female:
for (AbstractClothingType ct : ClothingType.getCommonFemaleClothing()) {
commonFemaleClothing.add(AbstractClothingType.generateClothing(ct, false));
}
if (enchantedGear) {
for (int i = 0; i < 3; i++) {
commonFemaleClothing.add(AbstractClothingType.generateClothingWithEnchantment(ClothingType.getCommonFemaleClothing().get(Util.random.nextInt(ClothingType.getCommonFemaleClothing().size()))));
}
commonFemaleClothing.add(generateRareClothing(ClothingType.getCommonFemaleClothing().get(Util.random.nextInt(ClothingType.getCommonFemaleClothing().size()))));
}
for (AbstractClothingType ct : ClothingType.getCommonFemaleLingerie()) {
if (ct.getSlot() == InventorySlot.GROIN) {
commonFemaleUnderwear.add(AbstractClothingType.generateClothing(ct, false));
} else {
commonFemaleOtherLingerie.add(AbstractClothingType.generateClothing(ct, false));
}
}
if (enchantedGear) {
for (int i = 0; i < 3; i++) {
commonFemaleUnderwear.add(AbstractClothingType.generateClothingWithEnchantment(commonFemaleUnderwear.get(Util.random.nextInt(commonFemaleUnderwear.size())).getClothingType()));
commonFemaleOtherLingerie.add(AbstractClothingType.generateClothingWithEnchantment(commonFemaleOtherLingerie.get(Util.random.nextInt(commonFemaleOtherLingerie.size())).getClothingType()));
}
commonFemaleUnderwear.add(generateRareClothing(commonFemaleUnderwear.get(Util.random.nextInt(commonFemaleUnderwear.size())).getClothingType()));
commonFemaleOtherLingerie.add(generateRareClothing(commonFemaleOtherLingerie.get(Util.random.nextInt(commonFemaleOtherLingerie.size())).getClothingType()));
}
for (AbstractClothingType ct : ClothingType.getCommonFemaleAccessories()) {
commonFemaleAccessories.add(AbstractClothingType.generateClothing(ct, false));
}
if (enchantedGear) {
for (int i = 0; i < 3; i++) {
commonFemaleAccessories.add(AbstractClothingType.generateClothingWithEnchantment(ClothingType.getCommonFemaleAccessories().get(Util.random.nextInt(ClothingType.getCommonFemaleAccessories().size()))));
}
commonFemaleAccessories.add(generateRareClothing(ClothingType.getCommonFemaleAccessories().get(Util.random.nextInt(ClothingType.getCommonFemaleAccessories().size()))));
}
// Male:
for (AbstractClothingType ct : ClothingType.getCommonMaleClothing()) {
commonMaleClothing.add(AbstractClothingType.generateClothing(ct, false));
}
if (enchantedGear) {
for (int i = 0; i < 3; i++) {
commonMaleClothing.add(AbstractClothingType.generateClothingWithEnchantment(ClothingType.getCommonMaleClothing().get(Util.random.nextInt(ClothingType.getCommonMaleClothing().size()))));
}
commonMaleClothing.add(generateRareClothing(ClothingType.getCommonMaleClothing().get(Util.random.nextInt(ClothingType.getCommonMaleClothing().size()))));
}
for (AbstractClothingType ct : ClothingType.getCommonMaleLingerie()) {
commonMaleLingerie.add(AbstractClothingType.generateClothing(ct, false));
}
if (enchantedGear) {
for (int i = 0; i < 3; i++) {
commonMaleLingerie.add(AbstractClothingType.generateClothingWithEnchantment(ClothingType.getCommonMaleLingerie().get(Util.random.nextInt(ClothingType.getCommonMaleLingerie().size()))));
}
commonMaleLingerie.add(generateRareClothing(ClothingType.getCommonMaleLingerie().get(Util.random.nextInt(ClothingType.getCommonMaleLingerie().size()))));
}
for (AbstractClothingType ct : ClothingType.getCommonMaleAccessories()) {
commonMaleAccessories.add(AbstractClothingType.generateClothing(ct, false));
}
if (enchantedGear) {
for (int i = 0; i < 3; i++) {
commonMaleAccessories.add(AbstractClothingType.generateClothingWithEnchantment(ClothingType.getCommonMaleAccessories().get(Util.random.nextInt(ClothingType.getCommonMaleAccessories().size()))));
}
commonMaleAccessories.add(generateRareClothing(ClothingType.getCommonMaleAccessories().get(Util.random.nextInt(ClothingType.getCommonMaleAccessories().size()))));
}
// Androgynous:
for (AbstractClothingType ct : ClothingType.getCommonAndrogynousClothing()) {
commonAndrogynousClothing.add(AbstractClothingType.generateClothing(ct, false));
}
if (enchantedGear) {
for (int i = 0; i < 3; i++) {
commonAndrogynousClothing.add(AbstractClothingType.generateClothingWithEnchantment(ClothingType.getCommonAndrogynousClothing().get(Util.random.nextInt(ClothingType.getCommonAndrogynousClothing().size()))));
}
commonAndrogynousClothing.add(generateRareClothing(ClothingType.getCommonAndrogynousClothing().get(Util.random.nextInt(ClothingType.getCommonAndrogynousClothing().size()))));
}
for (AbstractClothingType ct : ClothingType.getCommonAndrogynousLingerie()) {
commonAndrogynousLingerie.add(AbstractClothingType.generateClothing(ct, false));
}
if (enchantedGear) {
for (int i = 0; i < 3; i++) {
commonAndrogynousLingerie.add(AbstractClothingType.generateClothingWithEnchantment(ClothingType.getCommonAndrogynousLingerie().get(Util.random.nextInt(ClothingType.getCommonAndrogynousLingerie().size()))));
}
commonAndrogynousLingerie.add(generateRareClothing(ClothingType.getCommonAndrogynousLingerie().get(Util.random.nextInt(ClothingType.getCommonAndrogynousLingerie().size()))));
}
for (AbstractClothingType ct : ClothingType.getCommonAndrogynousAccessories()) {
commonAndrogynousAccessories.add(AbstractClothingType.generateClothing(ct, false));
}
if (enchantedGear) {
for (int i = 0; i < 3; i++) {
commonAndrogynousAccessories.add(AbstractClothingType.generateClothingWithEnchantment(ClothingType.getCommonAndrogynousAccessories().get(Util.random.nextInt(ClothingType.getCommonAndrogynousAccessories().size()))));
}
commonAndrogynousAccessories.add(generateRareClothing(ClothingType.getCommonAndrogynousAccessories().get(Util.random.nextInt(ClothingType.getCommonAndrogynousAccessories().size()))));
}
// Specials:
if (enchantedGear) {
specials.add(AbstractClothingType.generateClothing(ClothingType.SOCK_RAINBOW_STOCKINGS));
specials.add(AbstractClothingType.generateClothing(ClothingType.HAND_RAINBOW_FINGERLESS_GLOVES));
specials.add(AbstractClothingType.generateClothing(ClothingType.MILK_MAID_KERCHIEF));
specials.add(AbstractClothingType.generateClothing(ClothingType.MILK_MAID_HEADBAND));
specials.add(AbstractClothingType.generateClothing(ClothingType.MILK_MAID_TORSO_DRESS));
specials.add(AbstractClothingType.generateClothing(ClothingType.MAID_DRESS));
specials.add(AbstractClothingType.generateClothing(ClothingType.MAID_HEADPIECE));
specials.add(AbstractClothingType.generateClothing(ClothingType.MAID_HEELS));
specials.add(AbstractClothingType.generateClothing(ClothingType.MAID_SLEEVES));
specials.add(AbstractClothingType.generateClothing(ClothingType.MAID_STOCKINGS));
specials.add(AbstractClothingType.generateClothing(ClothingType.CATTLE_PIERCING_NOSE_BOVINE_RING));
specials.add(AbstractClothingType.generateClothing(ClothingType.CATTLE_NECK_COWBELL_COLLAR));
specials.add(AbstractClothingType.generateClothing(ClothingType.CATTLE_PIERCING_EAR_TAGS));
specials.add(AbstractClothingType.generateClothing(ClothingType.MEGA_MILK));
specials.add(AbstractClothingType.generateClothing(ClothingType.NECK_BREEDER_COLLAR));
specials.add(AbstractClothingType.generateClothing(ClothingType.SCIENTIST_TORSO_OVER_LAB_COAT));
}
for (AbstractClothing c : commonFemaleClothing) {
c.setEnchantmentKnown(true);
}
for (AbstractClothing c : commonFemaleUnderwear) {
c.setEnchantmentKnown(true);
}
for (AbstractClothing c : commonFemaleOtherLingerie) {
c.setEnchantmentKnown(true);
}
for (AbstractClothing c : commonFemaleAccessories) {
c.setEnchantmentKnown(true);
}
for (AbstractClothing c : commonMaleClothing) {
c.setEnchantmentKnown(true);
}
for (AbstractClothing c : commonMaleLingerie) {
c.setEnchantmentKnown(true);
}
for (AbstractClothing c : commonMaleAccessories) {
c.setEnchantmentKnown(true);
}
for (AbstractClothing c : commonAndrogynousClothing) {
c.setEnchantmentKnown(true);
}
for (AbstractClothing c : commonAndrogynousLingerie) {
c.setEnchantmentKnown(true);
}
for (AbstractClothing c : commonAndrogynousAccessories) {
c.setEnchantmentKnown(true);
}
}
use of com.lilithsthrone.game.inventory.clothing.AbstractClothingType in project liliths-throne-public by Innoxia.
the class CharacterUtils method equipClothing.
public static void equipClothing(GameCharacter character, boolean replaceUnsuitableClothing, boolean onlyAddCoreClothing) {
Colour primaryColour = Colour.allClothingColours.get(Util.random.nextInt(Colour.allClothingColours.size())), secondaryColour = Colour.allClothingColours.get(Util.random.nextInt(Colour.allClothingColours.size())), lingerieColour = Colour.lingerieColours.get(Util.random.nextInt(Colour.lingerieColours.size()));
List<InventorySlot> inventorySlotsInPriorityOrder = new ArrayList<>();
// Torso needs to be randomly decided first, to give girls a chance to wear a dress.
inventorySlotsInPriorityOrder.add(InventorySlot.TORSO_UNDER);
for (InventorySlot slot : InventorySlot.values()) {
if (slot != InventorySlot.TORSO_UNDER) {
inventorySlotsInPriorityOrder.add(slot);
}
}
if ((character.isFeminine() && !character.hasFetish(Fetish.FETISH_CROSS_DRESSER)) || (!character.isFeminine() && character.hasFetish(Fetish.FETISH_CROSS_DRESSER))) {
for (InventorySlot slot : inventorySlotsInPriorityOrder) {
if (replaceUnsuitableClothing) {
if (character.getClothingInSlot(slot) != null) {
if (character.getClothingInSlot(slot).getClothingType().getFemininityRestriction() == Femininity.MASCULINE) {
character.unequipClothingIntoVoid(character.getClothingInSlot(slot), true, character);
}
}
}
if (!slot.isCoreClothing() && onlyAddCoreClothing) {
// Don't add clothing if not core
} else {
if ((slot.isCoreClothing() || Math.random() > 0.75f || slot.isJewellery()) && !character.isSlotIncompatible(slot) && character.getClothingInSlot(slot) == null) {
if (!ClothingType.getCommonClothingMapFemaleIncludingAndrogynous().get(slot).isEmpty() && (slot.slotBlockedByRace(character) != character.getRace())) {
List<AbstractClothingType> clothingToUse = ClothingType.getCommonClothingMapFemaleIncludingAndrogynous().get(slot);
if (character.getHistory() == History.PROSTITUTE) {
clothingToUse = suitableFeminineClothing.get(History.PROSTITUTE);
}
AbstractClothingType ct = getClothingTypeForSlot(character, slot, clothingToUse);
clothingToUse.remove(ClothingType.PENIS_CONDOM);
if (ct != null) {
character.equipClothingFromNowhere(AbstractClothingType.generateClothing(ct, (slot == InventorySlot.GROIN || slot == InventorySlot.CHEST || slot == InventorySlot.SOCK ? ct.getAvailablePrimaryColours().contains(lingerieColour) ? lingerieColour : ct.getAvailablePrimaryColours().get(Util.random.nextInt(ct.getAvailablePrimaryColours().size())) : (slot.isCoreClothing() ? ct.getAvailablePrimaryColours().contains(primaryColour) ? primaryColour : ct.getAvailablePrimaryColours().get(Util.random.nextInt(ct.getAvailablePrimaryColours().size())) : ct.getAvailablePrimaryColours().contains(secondaryColour) ? secondaryColour : ct.getAvailablePrimaryColours().get(Util.random.nextInt(ct.getAvailablePrimaryColours().size())))), false), true, character);
}
}
}
}
}
} else {
for (InventorySlot slot : inventorySlotsInPriorityOrder) {
if (replaceUnsuitableClothing) {
if (character.getClothingInSlot(slot) != null) {
if (character.getClothingInSlot(slot).getClothingType().getFemininityRestriction() == Femininity.FEMININE) {
character.unequipClothingIntoVoid(character.getClothingInSlot(slot), true, character);
}
}
}
if (!slot.isCoreClothing() && onlyAddCoreClothing) {
// Don't add clothing if not core
} else {
if ((slot.isCoreClothing() || Math.random() > 0.75f || slot.isJewellery()) && !character.isSlotIncompatible(slot) && character.getClothingInSlot(slot) == null) {
if (!ClothingType.getCommonClothingMapMaleIncludingAndrogynous().get(slot).isEmpty() && (slot.slotBlockedByRace(character) != character.getRace())) {
List<AbstractClothingType> clothingToUse = ClothingType.getCommonClothingMapMaleIncludingAndrogynous().get(slot);
clothingToUse.remove(ClothingType.PENIS_CONDOM);
AbstractClothingType ct = getClothingTypeForSlot(character, slot, clothingToUse);
if (ct != null) {
character.equipClothingFromNowhere(AbstractClothingType.generateClothing(ct, (slot == InventorySlot.GROIN || slot == InventorySlot.CHEST || slot == InventorySlot.SOCK ? ct.getAvailablePrimaryColours().contains(lingerieColour) ? lingerieColour : ct.getAvailablePrimaryColours().get(Util.random.nextInt(ct.getAvailablePrimaryColours().size())) : (slot.isCoreClothing() ? ct.getAvailablePrimaryColours().contains(primaryColour) ? primaryColour : ct.getAvailablePrimaryColours().get(Util.random.nextInt(ct.getAvailablePrimaryColours().size())) : ct.getAvailablePrimaryColours().contains(secondaryColour) ? secondaryColour : ct.getAvailablePrimaryColours().get(Util.random.nextInt(ct.getAvailablePrimaryColours().size())))), false), true, character);
}
}
}
}
}
}
}
use of com.lilithsthrone.game.inventory.clothing.AbstractClothingType in project liliths-throne-public by Innoxia.
the class CharacterUtils method getClothingTypeForSlot.
private static AbstractClothingType getClothingTypeForSlot(GameCharacter character, InventorySlot slot, List<AbstractClothingType> clothingOptions) {
List<AbstractClothingType> availableClothing = new ArrayList<>();
boolean canEquip = true;
for (AbstractClothingType ct : clothingOptions) {
if (ct.getSlot() != slot) {
continue;
}
canEquip = true;
if (slot == InventorySlot.CHEST && !character.hasBreasts()) {
canEquip = false;
} else if (character.hasFetish(Fetish.FETISH_EXHIBITIONIST)) {
for (BlockedParts bp : ct.getBlockedPartsList()) {
boolean leavesAnusExposed = character.isCoverableAreaExposed(CoverableArea.ANUS) && !bp.blockedBodyParts.contains(CoverableArea.ANUS);
boolean leavesNipplesExposed = character.isCoverableAreaExposed(CoverableArea.NIPPLES) && !bp.blockedBodyParts.contains(CoverableArea.NIPPLES);
boolean leavesPenisExposed = !character.hasPenis() || (character.isCoverableAreaExposed(CoverableArea.PENIS) && !bp.blockedBodyParts.contains(CoverableArea.PENIS));
boolean leavesVaginaExposed = !character.hasVagina() || (character.isCoverableAreaExposed(CoverableArea.VAGINA) && !bp.blockedBodyParts.contains(CoverableArea.VAGINA));
// TODO
if (!leavesNipplesExposed || (!leavesAnusExposed || !leavesPenisExposed && !leavesVaginaExposed)) {
canEquip = false;
}
}
} else {
for (InventorySlot is : ct.getIncompatibleSlots()) {
if (character.getClothingInSlot(is) != null) {
canEquip = false;
}
}
}
if (canEquip) {
availableClothing.add(ct);
}
}
if (availableClothing.isEmpty()) {
return null;
} else {
return availableClothing.get(Util.random.nextInt(availableClothing.size()));
}
}
Aggregations