Random in certain rooms

In my game I want the player to be able to do a certain action in, well, lets say all the outdoor rooms, and have a random chance, let’s say 50%, of finding a fairly common object that’s not important to the game per se, that I’ll give a random name to.

From a previous discussion about monsters I have an idea how to do the part with the actual object, but I am trying to decide how to approach the random whether they can look in x room or not. I also want to prevent the player from getting such an object more than once in the same room, so there’s not like an infinite number of objects, etc.

Ideas?

I think you already defined a searching-the-room action, yes? If so, here’s a quick and dirty version:

[code]A room can be searched or unsearched. A room is usually unsearched.

Instead of searching in the Outdoors:
if the location is unsearched and a random chance of 1 in 2 succeeds begin;
say “You find [if there is a searched room]another[otherwise]an[end if] iridescent purple wotsit.”;
now the location is searched;
otherwise;
say “Your search turns up nothing in particular.”;
end if;

[/code]

Oh thanks. Sometimes I get an idea and I just need a nudge in the right direction.