Implementing a mirror? [TADS 3]

How would I implement a mirror in TADS 3? An object that when I >x mirror I see myself?

>x mirror
You look the same as usual.

But also, which is the main reason I want to ask this question, is that I think I want to give a more detailed description of the PC if a mirror is in the room.

>x myself
You look at yourself in the mirror. You look the same as usual. You’re wearing the same clothes from yesterday, a white t-shirt and blue jeans.

Where, in the above example I added a flair plus the list of clothes worn. The list of clothes may or may not be good if we’re differentiating between a hand mirror from a full length mirror, but that can always be customized. A hand mirror might instead comment on the need for a haircut.

Where do I begin with these kinds of customizations?

I may not be thinking everything through here, but couldn’t you simply put whatever text you wish in the desc property of your mirror object? You could make desc a method to display a dynamic description based on the current status of the PC. You could call the same method as “x me”, with any additional info you want to add tacked on. You’d probably want to include dobjFor(LookIn) asDobjFor(Examine), unless you wanted to separate them out, and use LookIn for what you see, and leave Examine to merely describe the mirror object… let me know if I’m not getting at what you’re looking for…

If it’s what you’re wanting, you could also override me.dobjFor(Examine) to check first and see if the PC is holding or can see a mirror, and use the mirror version if so, otherwise the inherited response…

Maybe I was over thinking this. This is a start for the mirror object itself.

+ Fixture 'mirror' 'mirror' 
    desc() { 
        "The entire wall is covered with a mirror. ";

It’s a bit boring, as right now I don’t know how to mix mirror descriptions without having separate sentences. I would like to have “In the mirror you see {yourself}” as a single sentence, but right now I don’t know how to do that, except maybe as a separate mirrorDesc property for the PC.

As for hooking >x myself I don’t yet know how to find things in scope. I’m fairly certain there is a library tool I can look into, for that; though.

1 Like

I think you pretty much have it, with the mirrorDesc on PC object.

(mirror obj) 
   desc  =  "The entire wall is covered with a mirror. In it you can see a reflection of yourself, and <<me.mirrorDesc>>"

me: Person
   mirrorDesc { if(everything's normal) "you\'re looking pretty good. ";
       else if(hair.dirty) "you can see that somehow you\'ve gotten spray paint in your hair, etc.";  }
1 Like

Good debate and answer; a mirror can be traumatic for a newborn vampire, for example.

Best regards from Italy,
dott. Piergiorgio.