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)
|
o.move_to(d, quiet=True)
|
||||||
return
|
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)
|
m = match(r"tag_all +(.*) *", cmd)
|
||||||
if m:
|
if m:
|
||||||
tag = m.group(1)
|
tag = m.group(1)
|
||||||
|
|
@ -532,14 +550,16 @@ class Listener:
|
||||||
m = match(r"coin_all ([0-9]+)", cmd)
|
m = match(r"coin_all ([0-9]+)", cmd)
|
||||||
if m:
|
if m:
|
||||||
for c in self.characters_here(puppets=True):
|
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
|
return
|
||||||
|
|
||||||
m = match(r"coin ([0-9]+) *?( to|=)? *([^:]+)", cmd)
|
m = match(r"coin ([0-9]+) *?( to|=)? *([^:]+)", cmd)
|
||||||
if m:
|
if m:
|
||||||
c = self.search(m.group(3))
|
c = self.search(m.group(3))
|
||||||
if c:
|
if c:
|
||||||
c.adjust_coins(m.group(1))
|
c.adjust_coins(int(m.group(1)))
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.is_typeclass("typeclasses.characters.Character"):
|
if self.is_typeclass("typeclasses.characters.Character"):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue