Fix nudge lid randomness, fix order of emits.

This commit is contained in:
Ari Mudev 2010-09-04 15:35:38 +00:00
parent 7d8edf0235
commit 09cc31dafc

View file

@ -36,15 +36,21 @@ class CmdNudge(Command):
nudge the lid. nudge the lid.
""" """
rand = random.random() rand = random.random()
open_ok = False
if rand < 0.5: if rand < 0.5:
string = "You nudge at the lid. It seems stuck." string = "You nudge at the lid. It seems stuck."
elif 0.5 <= 0.5 < 0.7: elif 0.5 <= rand < 0.7:
string = "You move the lid back and forth. It won't budge." string = "You move the lid back and forth. It won't budge."
else: else:
string = "You manage to get a nail under the lid. It pops open." string = "You manage to get a nail under the lid. It pops open."
self.obj.open_lid() open_ok = True
self.caller.msg(string) self.caller.msg(string)
if open_ok:
"""open_lid() does its own emits, so defer it until we speak"""
self.obj.open_lid()
class CmdPush(Command): class CmdPush(Command):
""" """
Push the red button Push the red button