Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''
- [Success: 20 Roll: 82] You bash Bobby with your stave!
- Current time is 1564880769.9589822 and last command was 1564880769.662847
- You need to wait 0 more seconds.
- Current time is 1564880770.290676 and last command was 1564880769.662847
- You need to wait 0 more seconds.
- Current time is 1564880770.6375005 and last command was 1564880769.662847
- You need to wait 0 more seconds.
- Current time is 1564880771.0355637 and last command was 1564880769.662847
- You need to wait 1 more seconds.
- Current time is 1564880771.3988423 and last command was 1564880769.662847
- You need to wait 1 more seconds.
- Current time is 1564880771.7818737 and last command was 1564880769.662847
- You need to wait 2 more seconds.
- Current time is 1564880772.1136808 and last command was 1564880769.662847
- You need to wait 2 more seconds.
- Current time is 1564880772.4885728 and last command was 1564880769.662847
- You need to wait 2 more seconds.
- Current time is 1564880772.8268886 and last command was 1564880769.662847
- [Success: 48 Roll: 85] You bash Bobby with your stave!
- '''
- class CmdStaveBash(BaseCommand):
- '''
- Use your staff to bash an enemy.
- Usage:
- bash <target>
- '''
- key = 'bash'
- help_category = 'combat'
- def func(self):
- if not self.args:
- self.caller.msg('Usage: bash <target>')
- return
- attacker = self.caller
- target = self.caller.search(self.args)
- if not target:
- self.caller.msg('That target does not exist.')
- return
- now = time.time()
- lastcast = self.caller.db.stave_bash
- self.caller.msg(f'Current time is {now} and last command was {lastcast}')
- if lastcast and now - lastcast < 3:
- message = f"You need to wait {int(now - lastcast)} more seconds."
- self.caller.msg(message)
- return
- roll = random.randint(1, 100)
- success = random.randint(5, 95)
- if roll > success:
- self.caller.msg(f'[Success: {success} Roll: {roll}] You bash {target} with your stave!')
- else:
- self.caller.msg(f'[Success: {success} Roll: {roll}] You miss {target} with your stave!')
- self.caller.db.stave_bash = now
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement