This forum seems pretty dead, but just in case it isn’t, I was wondering if I could have some help with something.
I have a complex clothing system, each garment has a value for what layer of clothing it is, and where on the body it is being worn.
For example, if the player tries to wear something that was classed as both legwear and clothing, while already wearing a garment that has values of legwear and clothing, the attempt is stopped and they are told “You are already wearing a garment like this!”
Here is what I have so far:
[spoiler][code]Armortype is a kind of value. The armortypes are jewelry, clothing, covering, undergarment, and armor.
Wornlocation is a kind of value. The wornlocations are headwear, facewear, neckwear, chestwear, backwear, torsowear, waistwear, pelviswear, legwear, anklewear, footwear, armwear, wristwear, and handwear.
A garment is a kind of thing. A garment always has an armortype. A garment always has a wornlocation. Garments are wearable. The description of a garment is “It’s [wornlocation] [armortype].”
Bling is a kind of garment with armortype jewelry.
A basic shirt is a garment with armortype clothing and wornlocation torsowear.
basic pants are a garment with armortype clothing and wornlocation legwear.
basic shoes are a garment with armortype clothing and wornlocation footwear.
A green shirt is a garment with armortype clothing and wornlocation torsowear.
Before wearing a garment (called Y) when the player is wearing a garment:
repeat with item worn by the player:
if item armortype matches Y armortype and item wornlocation matches Y wornlocation:
stop the action and break.[/code][/spoiler]
I’m very new to inform 7, and I have no idea how to go about this. The things I’ve tried all cause compile errors, so I’m not sure how to reword my before statement to work right. I would rather not create separate rules for every combination of armortype and wornlocation. If anyone has tips, suggestions, or solutions, I would love to hear it!
(Bonus points if the conflicting clothing items are swapped instead of the wear command being canceled. Super duper bonus points if it asks if you want to swap clothes or cancel.)