mirror of
https://github.com/evennia/evennia.git
synced 2026-03-20 23:06:31 +01:00
Fix nudge lid randomness, fix order of emits.
This commit is contained in:
parent
7d8edf0235
commit
09cc31dafc
1 changed files with 8 additions and 2 deletions
|
|
@ -36,14 +36,20 @@ class CmdNudge(Command):
|
|||
nudge the lid.
|
||||
"""
|
||||
rand = random.random()
|
||||
open_ok = False
|
||||
|
||||
if rand < 0.5:
|
||||
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."
|
||||
else:
|
||||
string = "You manage to get a nail under the lid. It pops open."
|
||||
self.obj.open_lid()
|
||||
open_ok = True
|
||||
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):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue