use of com.lilithsthrone.game.inventory.clothing.AbstractClothing in project liliths-throne-public by Innoxia.
the class CharacterInventory method getInventorySlotsConcealed.
public List<InventorySlot> getInventorySlotsConcealed() {
Set<InventorySlot> concealed = new HashSet<>();
Set<InventorySlot> revealed = new HashSet<>();
for (AbstractClothing c : getClothingCurrentlyEquipped()) {
for (BlockedParts bp : c.getClothingType().getBlockedPartsList()) {
if (!c.getDisplacedList().contains(bp.displacementType)) {
concealed.addAll(bp.concealedSlots);
} else {
revealed.addAll(bp.concealedSlots);
}
}
}
concealed.removeAll(revealed);
List<InventorySlot> concealedFinal = new ArrayList<>();
concealedFinal.addAll(concealed);
return concealedFinal;
}
use of com.lilithsthrone.game.inventory.clothing.AbstractClothing in project liliths-throne-public by Innoxia.
the class CharacterInventory method isAbleToBeReplaced.
public boolean isAbleToBeReplaced(AbstractClothing clothing, DisplacementType dt, boolean replaceIfAble, boolean automaticClothingManagement, GameCharacter characterClothingOwner, GameCharacter characterRemovingClothing) {
if (dt == DisplacementType.REMOVE_OR_EQUIP)
throw new IllegalArgumentException("Can't replace DisplacementType.REMOVE_OR_EQUIP!");
if (automaticClothingManagement)
clothingToRemove.clear();
boolean displacementTypeFound = false;
// Check for access needed: TODO check this works
for (BlockedParts bp : clothing.getClothingType().getBlockedPartsList()) {
// Keep iterating through until until we find the displacementType:
if (bp.displacementType == dt) {
displacementTypeFound = true;
if (bp.clothingAccessRequired == null) {
// This clothing doesn't need any access in order to
break;
// be displaced in this manner, so just carry on.
} else {
// This clothing has access requirements in order to be displaced. Check each piece of equipped clothing to see if it's blocking the access required:
for (AbstractClothing equippedClothing : clothingCurrentlyEquipped) {
for (BlockedParts bpEquipped : equippedClothing.getClothingType().getBlockedPartsList()) {
for (ClothingAccess caBlocked : bpEquipped.clothingAccessBlocked) {
if (bp.clothingAccessRequired.contains(caBlocked) && !equippedClothing.getDisplacedList().contains(bpEquipped.displacementType) && !isDisplacementAvailableFromElsewhere(equippedClothing, caBlocked)) {
if (bpEquipped.displacementType != DisplacementType.REMOVE_OR_EQUIP && !clothingToRemove.containsKey(equippedClothing)) {
// Can be displaced:
if (!equippedClothing.getDisplacedList().contains(bpEquipped.displacementType)) {
// Not already displaced:
if (automaticClothingManagement)
clothingToRemove.put(equippedClothing, bpEquipped.displacementType);
else {
unableToReplaceText = new StringBuilder(Util.capitaliseSentence(clothing.getClothingType().getDeterminer()) + " " + clothing.getName() + " can't be replaced because " + equippedClothing.getClothingType().getDeterminer() + " " + equippedClothing.getName() + " " + (equippedClothing.getClothingType().isPlural() ? "are" : "is") + " in the way.");
blockingClothing = equippedClothing;
return false;
}
}
} else {
if (// Can be removed:
isAbleToUnequip(equippedClothing, false, automaticClothingManagement, characterClothingOwner, characterRemovingClothing, true))
clothingToRemove.put(equippedClothing, DisplacementType.REMOVE_OR_EQUIP);
else {
unableToReplaceText = new StringBuilder(Util.capitaliseSentence(clothing.getClothingType().getDeterminer()) + " " + clothing.getName() + " can't be replaced because " + equippedClothing.getClothingType().getDeterminer() + " " + equippedClothing.getName() + " " + (equippedClothing.getClothingType().isPlural() ? "are" : "is") + " in the way.");
blockingClothing = equippedClothing;
return false;
}
}
}
}
}
}
}
}
}
// The supplied clothing cannot be displaced in this manner!
if (!displacementTypeFound) {
throw new IllegalArgumentException("The supplied clothing cannot be replaced in this manner!");
}
if (replaceIfAble) {
if (!clothing.getDisplacedList().contains(dt)) {
unableToReplaceText = new StringBuilder(Util.capitaliseSentence(clothing.getClothingType().getDeterminer()) + " " + clothing.getName() + " is already replaced!");
return false;
}
clothing.getDisplacedList().remove(dt);
List<AbstractClothing> tempClothingList = new ArrayList<>();
tempClothingList.addAll(clothingToRemove.keySet());
tempClothingList.sort(new ClothingZLayerComparator());
unableToReplaceText = new StringBuilder();
// Description of each clothing item that is removed/displaced:
for (AbstractClothing c : tempClothingList) unableToReplaceText.append((unableToReplaceText.length() == 0 ? "" : "</br>") + (clothingToRemove.get(c) == DisplacementType.REMOVE_OR_EQUIP ? (// (Main.game.isInSex()?Sex.isSubResisting():false))
c == clothing ? // (Main.game.isInSex()?Sex.isSubResisting():false))
c.onUnequipApplyEffects(characterClothingOwner, characterRemovingClothing, false) : // (Main.game.isInSex()?Sex.isSubResisting():false)))
c.onUnequipText(characterClothingOwner, characterRemovingClothing, false)) : // (Main.game.isInSex()?Sex.isSubResisting():false))));
c.getClothingType().displaceText(characterClothingOwner, characterRemovingClothing, clothingToRemove.get(c), false)));
unableToReplaceText.append(// (Main.game.isInSex()?Sex.isSubResisting():false))
(unableToReplaceText.length() == 0 ? "" : "</br><span style='color:" + Colour.GENERIC_GOOD.toWebHexString() + ";'>") + clothing.getClothingType().replaceText(characterClothingOwner, characterRemovingClothing, dt, false) + "</span>");
List<AbstractClothing> replaceClothingList = new ArrayList<>();
replaceClothingList.addAll(clothingToRemove.keySet());
replaceClothingList.sort(new ReverseClothingZLayerComparator());
if (!replaceClothingList.isEmpty()) {
unableToReplaceText.append("</br>You replace " + (characterClothingOwner.isPlayer() ? "your" : characterClothingOwner.getName() + "'s") + " " + Util.clothesToStringList(replaceClothingList) + ".");
}
return true;
}
unableToReplaceText = new StringBuilder(Util.capitaliseSentence(clothing.getClothingType().getDeterminer()) + " " + clothing.getName() + " is able to be replaced.");
return true;
}
use of com.lilithsthrone.game.inventory.clothing.AbstractClothing in project liliths-throne-public by Innoxia.
the class CharacterInventory method saveAsXML.
@Override
public Element saveAsXML(Element parentElement, Document doc) {
Element characterInventory = doc.createElement("characterInventory");
parentElement.appendChild(characterInventory);
CharacterUtils.createXMLElementWithValue(doc, characterInventory, "maxInventorySpace", String.valueOf(this.getMaximumInventorySpace()));
CharacterUtils.createXMLElementWithValue(doc, characterInventory, "money", String.valueOf(this.getMoney()));
CharacterUtils.createXMLElementWithValue(doc, characterInventory, "essences", String.valueOf(this.getEssenceCount(TFEssence.ARCANE)));
if (this.getMainWeapon() != null) {
Element mainWeapon = doc.createElement("mainWeapon");
characterInventory.appendChild(mainWeapon);
this.getMainWeapon().saveAsXML(mainWeapon, doc);
}
if (this.getOffhandWeapon() != null) {
Element offhandWeapon = doc.createElement("offhandWeapon");
characterInventory.appendChild(offhandWeapon);
this.getOffhandWeapon().saveAsXML(offhandWeapon, doc);
}
Element clothingEquipped = doc.createElement("clothingEquipped");
characterInventory.appendChild(clothingEquipped);
for (AbstractClothing clothing : this.getClothingCurrentlyEquipped()) {
clothing.saveAsXML(clothingEquipped, doc);
}
Element itemsInInventory = doc.createElement("itemsInInventory");
characterInventory.appendChild(itemsInInventory);
for (Entry<AbstractItem, Integer> item : this.getMapOfDuplicateItems().entrySet()) {
Element e = item.getKey().saveAsXML(itemsInInventory, doc);
CharacterUtils.addAttribute(doc, e, "count", String.valueOf(item.getValue()));
}
Element clothingInInventory = doc.createElement("clothingInInventory");
characterInventory.appendChild(clothingInInventory);
for (Entry<AbstractClothing, Integer> clothing : this.getMapOfDuplicateClothing().entrySet()) {
Element e = clothing.getKey().saveAsXML(clothingInInventory, doc);
CharacterUtils.addAttribute(doc, e, "count", String.valueOf(clothing.getValue()));
}
Element weaponsInInventory = doc.createElement("weaponsInInventory");
characterInventory.appendChild(weaponsInInventory);
for (Entry<AbstractWeapon, Integer> weapon : this.getMapOfDuplicateWeapons().entrySet()) {
Element e = weapon.getKey().saveAsXML(weaponsInInventory, doc);
CharacterUtils.addAttribute(doc, e, "count", String.valueOf(weapon.getValue()));
}
return characterInventory;
}
use of com.lilithsthrone.game.inventory.clothing.AbstractClothing in project liliths-throne-public by Innoxia.
the class CharacterInventory method isAbleToBeDisplaced.
/**
* If pass in DisplacementType.REMOVE_OR_EQUIP, returns isAbleToUnequip().
*/
public boolean isAbleToBeDisplaced(AbstractClothing clothing, DisplacementType dt, boolean displaceIfAble, boolean automaticClothingManagement, GameCharacter characterClothingOwner, GameCharacter characterRemovingClothing, boolean continuingIsAbleToEquip) {
if (dt == DisplacementType.REMOVE_OR_EQUIP) {
return isAbleToUnequip(clothing, displaceIfAble, automaticClothingManagement, characterClothingOwner, characterRemovingClothing, continuingIsAbleToEquip);
}
if (!continuingIsAbleToEquip) {
clothingToRemove.clear();
equipTextSB.setLength(0);
}
boolean displacementTypeFound = false;
// Check for access needed: TODO check this works
for (BlockedParts bp : clothing.getClothingType().getBlockedPartsList()) {
// Keep iterating through until until we find the displacementType:
if (bp.displacementType == dt) {
displacementTypeFound = true;
if (bp.clothingAccessRequired == null) {
// This clothing doesn't need any access in order to be displaced in this manner, so just carry on.
break;
} else {
// This clothing has access requirements in order to be displaced. Check each piece of equipped clothing to see if it's blocking the access required:
for (AbstractClothing equippedClothing : clothingCurrentlyEquipped) {
if (equippedClothing != clothing)
for (BlockedParts bpEquipped : equippedClothing.getClothingType().getBlockedPartsList()) {
for (ClothingAccess caBlocked : bpEquipped.clothingAccessBlocked) {
if (bp.clothingAccessRequired.contains(caBlocked) && !equippedClothing.getDisplacedList().contains(bpEquipped.displacementType) && !isDisplacementAvailableFromElsewhere(equippedClothing, caBlocked)) {
if (bpEquipped.displacementType != DisplacementType.REMOVE_OR_EQUIP && !clothingToRemove.containsKey(equippedClothing)) {
// Can be displaced:
if (!equippedClothing.getDisplacedList().contains(bpEquipped.displacementType)) {
// Not already displaced:
if (automaticClothingManagement)
clothingToRemove.put(equippedClothing, bpEquipped.displacementType);
else {
unableToDisplaceText = new StringBuilder(Util.capitaliseSentence(clothing.getClothingType().getDeterminer()) + " " + clothing.getName() + " can't be displaced because " + equippedClothing.getClothingType().getDeterminer() + " " + equippedClothing.getName() + " " + (equippedClothing.getClothingType().isPlural() ? "are" : "is") + " in the way.");
blockingClothing = equippedClothing;
return false;
}
}
} else {
if (// Can be removed:
isAbleToUnequip(equippedClothing, false, automaticClothingManagement, characterClothingOwner, characterRemovingClothing, true))
clothingToRemove.put(equippedClothing, DisplacementType.REMOVE_OR_EQUIP);
else {
unableToDisplaceText = new StringBuilder(Util.capitaliseSentence(clothing.getClothingType().getDeterminer()) + " " + clothing.getName() + " can't be displaced because " + equippedClothing.getClothingType().getDeterminer() + " " + equippedClothing.getName() + " " + (equippedClothing.getClothingType().isPlural() ? "are" : "is") + " in the way.");
blockingClothing = equippedClothing;
return false;
}
}
}
}
}
}
}
}
}
// The supplied clothing cannot be displaced in this manner!
if (!displacementTypeFound) {
throw new IllegalArgumentException("The supplied clothing cannot be displaced in this manner!");
}
if (displaceIfAble) {
if (clothing.getDisplacedList().contains(dt)) {
unableToDisplaceText = new StringBuilder(Util.capitaliseSentence(clothing.getClothingType().getDeterminer()) + " " + clothing.getName() + " is already displaced!");
return false;
}
clothing.getDisplacedList().add(dt);
List<AbstractClothing> tempClothingList = new ArrayList<>();
tempClothingList.addAll(clothingToRemove.keySet());
tempClothingList.sort(new ClothingZLayerComparator());
unableToDisplaceText = new StringBuilder();
// Description of each clothing item that is removed/displaced:
for (AbstractClothing c : tempClothingList) {
unableToDisplaceText.append((unableToDisplaceText.length() == 0 ? "" : "</br>") + (// (Main.game.isInSex()?Sex.isSubResisting():false))
clothingToRemove.get(c) == DisplacementType.REMOVE_OR_EQUIP ? // (Main.game.isInSex()?Sex.isSubResisting():false))
c.onUnequipText(characterClothingOwner, characterRemovingClothing, false) : // (Main.game.isInSex()?Sex.isSubResisting():false))));
c.getClothingType().displaceText(characterClothingOwner, characterRemovingClothing, clothingToRemove.get(c), false)));
}
unableToDisplaceText.append(// (Main.game.isInSex()?Sex.isSubResisting():false))
(unableToDisplaceText.length() == 0 ? "" : "</br><span style='color:" + Colour.GENERIC_ARCANE.toWebHexString() + ";'>") + clothing.getClothingType().displaceText(characterClothingOwner, characterRemovingClothing, dt, false) + "</span>");
List<AbstractClothing> replaceClothingList = new ArrayList<>();
replaceClothingList.addAll(clothingToRemove.keySet());
replaceClothingList.remove(clothing);
replaceClothingList.sort(new ReverseClothingZLayerComparator());
if (!replaceClothingList.isEmpty()) {
unableToDisplaceText.append("</br>You replace " + (characterClothingOwner.isPlayer() ? "your" : characterClothingOwner.getName() + "'s") + " " + Util.clothesToStringList(replaceClothingList) + ".");
}
return true;
}
unableToDisplaceText = new StringBuilder(Util.capitaliseSentence(clothing.getClothingType().getDeterminer()) + " " + clothing.getName() + " is able to be displaced.");
return true;
}
use of com.lilithsthrone.game.inventory.clothing.AbstractClothing in project liliths-throne-public by Innoxia.
the class Brax method equipClothing.
@Override
public void equipClothing(boolean replaceUnsuitableClothing, boolean onlyAddCoreClothing) {
deleteAllEquippedClothing();
if (Main.game.getDialogueFlags().values.contains(DialogueFlagValue.braxBeaten)) {
AbstractClothing collar = AbstractClothingType.generateClothing(ClothingType.NECK_SLAVE_COLLAR, false);
collar.setSealed(true);
collar.setColour(Colour.CLOTHING_SILVER);
this.equipClothingFromNowhere(collar, true, this);
}
if (isFeminine()) {
if (hasFetish(Fetish.FETISH_BIMBO)) {
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.GROIN_CROTCHLESS_PANTIES, Colour.CLOTHING_PINK, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.NIPPLE_TAPE_CROSSES, Colour.CLOTHING_PINK, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.TORSO_FISHNET_TOP, Colour.CLOTHING_WHITE, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.LEG_MICRO_SKIRT_PLEATED, Colour.CLOTHING_PINK, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.SOCK_FISHNET_STOCKINGS, Colour.CLOTHING_WHITE, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.FOOT_STILETTO_HEELS, Colour.CLOTHING_BLACK, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.HAND_FISHNET_GLOVES, Colour.CLOTHING_WHITE, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.FINGER_RING, Colour.CLOTHING_GOLD, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.WRIST_BANGLE, Colour.CLOTHING_GOLD, false), true, this);
this.setPiercedEar(true);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.PIERCING_EAR_BASIC_RING, Colour.CLOTHING_GOLD, false), true, this);
this.setPiercedNose(true);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.PIERCING_NOSE_BASIC_RING, Colour.CLOTHING_GOLD, false), true, this);
this.setPiercedNavel(true);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.PIERCING_NAVEL_GEM, Colour.CLOTHING_GOLD, false), true, this);
} else {
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.GROIN_THONG, Colour.CLOTHING_WHITE, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.CHEST_PLUNGE_BRA, Colour.CLOTHING_WHITE, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.ENFORCER_SHORTS, Colour.CLOTHING_PINK_LIGHT, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.ENFORCER_SHIRT, Colour.CLOTHING_PINK_LIGHT, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.SOCK_KNEEHIGH_SOCKS, Colour.CLOTHING_WHITE, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.FOOT_HEELS, Colour.CLOTHING_BLACK, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.WRIST_WOMENS_WATCH, Colour.CLOTHING_PINK_LIGHT, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.FINGER_RING, Colour.CLOTHING_SILVER, false), true, this);
}
} else {
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.GROIN_BOXERS, Colour.CLOTHING_BLACK, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.SOCK_SOCKS, Colour.CLOTHING_BLACK, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.FOOT_TRAINERS, Colour.CLOTHING_BLACK, false), true, this);
if (Main.game.getDialogueFlags().values.contains(DialogueFlagValue.braxBeaten)) {
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.ENFORCER_SHORTS, Colour.CLOTHING_BLUE, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.ENFORCER_SHIRT, Colour.CLOTHING_BLUE, false), true, this);
} else {
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.ENFORCER_SHORTS, Colour.CLOTHING_BLACK, false), true, this);
this.equipClothingFromNowhere(AbstractClothingType.generateClothing(ClothingType.ENFORCER_SHIRT, Colour.CLOTHING_BLACK, false), true, this);
}
}
}
Aggregations