Fix bug when rooms try to give coins
This commit is contained in:
parent
13991e0a03
commit
218a21a7a2
1 changed files with 22 additions and 2 deletions
|
|
@ -506,6 +506,24 @@ class Listener:
|
|||
o.move_to(d, quiet=True)
|
||||
return
|
||||
|
||||
# Private message only a single character can hear:
|
||||
m = match(r"gmm +(.*?) *= *(.*)", cmd)
|
||||
if m:
|
||||
obj = search_object(m.group(1)).first()
|
||||
msg = m.group(2)
|
||||
if obj and msg:
|
||||
obj.msg(msg)
|
||||
return
|
||||
|
||||
# Character announce_action message:
|
||||
m = match(r"gma +(.*?) *= *(.*)", cmd)
|
||||
if m:
|
||||
obj = search_object(m.group(1)).first()
|
||||
msg = m.group(2)
|
||||
if obj and msg:
|
||||
obj.announce_action(msg)
|
||||
return
|
||||
|
||||
m = match(r"tag_all +(.*) *", cmd)
|
||||
if m:
|
||||
tag = m.group(1)
|
||||
|
|
@ -532,14 +550,16 @@ class Listener:
|
|||
m = match(r"coin_all ([0-9]+)", cmd)
|
||||
if m:
|
||||
for c in self.characters_here(puppets=True):
|
||||
c.adjust_coins(m.group(1))
|
||||
coins = int(m.group(1))
|
||||
logger.info(f"Giving {c.key} {coins} coins.")
|
||||
c.adjust_coins(coins)
|
||||
return
|
||||
|
||||
m = match(r"coin ([0-9]+) *?( to|=)? *([^:]+)", cmd)
|
||||
if m:
|
||||
c = self.search(m.group(3))
|
||||
if c:
|
||||
c.adjust_coins(m.group(1))
|
||||
c.adjust_coins(int(m.group(1)))
|
||||
return
|
||||
|
||||
if self.is_typeclass("typeclasses.characters.Character"):
|
||||
|
|
|
|||
Loading…
Reference in a new issue