Trying to develop a simple clothing extension.
The code so far is below.
[code]Version 1/151110 of Sensible Clothing by Emma Krantz begins here.
“Adds basic types of clothing, and enforces sensible, intuitive rules about not wearing two pairs of pants (and the like).”
“Much of the code is based off Skyrim Clothing by Rafael D’Airen.”
Clothing is a kind of thing. Clothing is wearable. The specification of clothing is “Represents something that a player can wear.”
A top is a kind of clothing.
Socks are kind of clothing.
A dress is a kind of clothing.
A swimsuit is a kind of clothing.
Bottoms are a kind of clothing.
A hat is a kind of clothing.
Shoes are a kind of clothing.
Before wearing a thing:
if the player is wearing a top:
say “You are already wearing a top.”
Undressing is an action applying to nothing.
Understand “undress” as undressing.
Carry out undressing:
repeat with C running through all clothing:
if player is wearing C:
say " [C]";
say “You strip down to your underwear.”;
Sensible Clothing ends here.[/code]
If the player is wearing a top, and then tries to put on another one, I would expect the statement “You are already wearing a top” to be printed. This isn’t what happens; nothing additional is written. The condition does trigger if I change “if the player is wearing a top” to “if the player is wearing clothing”, but this is obviously not what I want.
A quick example use case for any intrepid testers: http://pastebin.com/XtMEdYhN
Any ideas why this might be happening? My software dev nose smells a bug, but I am very new to Inform and could be missing something obvious. Am I misunderstanding how kinds work?