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