X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=plomrogue%2Fcommands.py;h=49312eeff129006a7755bee3ed4645088eaacf5e;hb=3e0f898a8bc308e6b7d06573a90c197eff8d82f3;hp=24e991c8f89e4c2b2605f9c29aef4d170fd36dd1;hpb=feb0ffb7c7523ddee0cbd685cbc9c2e768a56cbd;p=plomrogue2 diff --git a/plomrogue/commands.py b/plomrogue/commands.py index 24e991c..49312ee 100644 --- a/plomrogue/commands.py +++ b/plomrogue/commands.py @@ -28,10 +28,24 @@ def cmd_TERRAIN(game, character, description, blocks_sound, blocks_movement) cmd_TERRAIN.argtypes = 'char string bool bool bool' +def cmd_TERRAIN_TAG(game, character, tag): + if not character in game.terrains: + raise GameError('terrain does not exist: %s' % character) + game.terrains[character].tags.add(tag) +cmd_TERRAIN_TAG.argtypes = 'char string' + def cmd_ALL(game, msg, connection_id): speaker = game.get_player(connection_id) if not speaker: raise GameError('need to be logged in for this') + if speaker.drunk > 0: + import random + drunken_msg = '' + for c in msg: + if random.random() > 0.85: + c = random.choice(['l', 'll', 'n', 'nhg', 'w', 'wl', 'bw']) + drunken_msg += c + msg = drunken_msg speaker.sound(speaker.name, msg) cmd_ALL.argtypes = 'string'