def execute(self, args, config): sender = config['sender'] target = config['target'] success = True if random.randint(0, 99) > 24 else False if success: senderBuf = 'You send {target} sprawling with a powerful bash!\n\r'.format(target=target.getName(sender)) targetBuf = '{sender} sends you sprawling with a powerful bash!\n\r'.format(sender=sender.getName(target)) roomBuf = '{0} sends {1} sprawling with a powerful bash!\n\r' damage = random.randint(10, 20) buf = combat.doDamage(sender, damage, 'bash', target) senderBuf += buf['sender'].format(target=target.getName(sender)) targetBuf += buf['target'].format(name=sender.getName(target)) roomBuf += buf['room'] else: senderBuf = 'You fall flat on your face.' targetBuf = '{sender} falls flat on their face.'.format(sender=sender.getName(target)) roomBuf = '{0} falls flat on their face.' sender.setLag(6) sender.sendToClient(senderBuf) target.sendToClient(targetBuf) sender.game.sendCondition((lambda a: a.room == sender.room and a is not sender and a is not target), roomBuf, [sender, target])
def execute(self, args, config): sender = config['sender'] target = config['target'] damage = sender.level + random.randint(1, 10) buf = combat.doDamage(sender, damage, 'kick', target) sender.sendToClient(buf['sender'].format(target=target.getName(sender))) sender.game.sendCondition( (lambda a: a.room == sender.room and a is not sender and a is not target), buf['room'], [sender, target]) target.sendToClient(buf['target'].format(name=sender.getName(target))) sender.setLag(3)