1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00
royalnet/rpgpack/commands/dnddamage.py

19 lines
498 B
Python
Raw Normal View History

2020-03-04 18:29:33 +00:00
from typing import *
from ..tables import DndBattleUnit
from .abstract import DndBattleTargetCommand
2020-03-04 18:29:33 +00:00
class DnddamageCommand(DndBattleTargetCommand):
2020-03-04 18:29:33 +00:00
name: str = "dnddamage"
description: str = "Damage a target in the currently active battle."
2020-03-04 18:29:33 +00:00
syntax: str = "{target} {damage}"
2020-03-04 18:29:33 +00:00
aliases = ["damage", "ddamage", "dd"]
2020-03-04 18:29:33 +00:00
async def _change(self, unit: DndBattleUnit, args: List[str]):
2020-03-04 18:29:33 +00:00
health = unit.health
health.change(-int(args[0]))
2020-03-04 18:29:33 +00:00
unit.health = health