mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Fix some stuff
This commit is contained in:
parent
a3b47cfc73
commit
50e66c5ae1
5 changed files with 9 additions and 10 deletions
|
@ -4,4 +4,3 @@ from .commands import available_commands
|
|||
from .tables import available_tables
|
||||
|
||||
__all__ = ["commands", "tables", "available_commands", "available_tables"]
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ from .dndactive import DndactiveCommand
|
|||
from .dndinfo import DndinfoCommand
|
||||
from .dndnew import DndnewCommand
|
||||
from .dndedit import DndeditCommand
|
||||
from .dndroll import DndrollCommand
|
||||
|
||||
# Enter the commands of your Pack here!
|
||||
available_commands = [
|
||||
|
@ -14,6 +15,7 @@ available_commands = [
|
|||
DndinfoCommand,
|
||||
DndnewCommand,
|
||||
DndeditCommand,
|
||||
DndrollCommand,
|
||||
]
|
||||
|
||||
# Don't change this, it should automatically generate __all__
|
||||
|
|
|
@ -39,9 +39,10 @@ class DndnewCommand(Command):
|
|||
column_names = [column.name for column in columns if (not column.primary_key and
|
||||
not column.foreign_keys and
|
||||
column.name != "name")]
|
||||
message = "ℹ️ [b]Character sheet format:[/b]"
|
||||
message = "ℹ️ Character Sheet syntax:\n[p]\nName\n"
|
||||
for column_name in column_names:
|
||||
message += f"{column_name} _\n"
|
||||
message += "[/p]"
|
||||
return message
|
||||
|
||||
async def run(self, args: CommandArgs, data: CommandData) -> None:
|
||||
|
|
|
@ -91,11 +91,11 @@ class DndrollCommand(Command):
|
|||
|
||||
advantage = False
|
||||
disadvantage = False
|
||||
modifier = 0
|
||||
extra_modifier = 0
|
||||
|
||||
if third:
|
||||
try:
|
||||
modifier = int(second)
|
||||
extra_modifier = int(third)
|
||||
except ValueError:
|
||||
raise InvalidInputError("Invalid modifier value (third parameter).")
|
||||
if second.startswith("a") or second.startswith("v"):
|
||||
|
@ -107,7 +107,7 @@ class DndrollCommand(Command):
|
|||
|
||||
elif second:
|
||||
try:
|
||||
modifier = int(second)
|
||||
extra_modifier = int(second)
|
||||
except ValueError:
|
||||
if second.startswith("a") or second.startswith("v"):
|
||||
advantage = True
|
||||
|
@ -124,7 +124,8 @@ class DndrollCommand(Command):
|
|||
else:
|
||||
raise CommandError("Invalid skill name (first parameter).")
|
||||
|
||||
modifier = char.__getattribute__(skill_name)
|
||||
skill_modifier = char.__getattribute__(skill_name)
|
||||
modifier = skill_modifier + extra_modifier
|
||||
modifier_str = plusformat(modifier, empty_if_zero=True)
|
||||
|
||||
if advantage:
|
||||
|
|
|
@ -187,10 +187,6 @@ class DndCharacter:
|
|||
def survival_proficiency(self):
|
||||
return Column(Enum(DndProficiencyType), nullable=False, default=DndProficiencyType.NONE)
|
||||
|
||||
@declared_attr
|
||||
def sanity_proficiency(self):
|
||||
return Column(Enum(DndProficiencyType), nullable=False, default=DndProficiencyType.NONE)
|
||||
|
||||
@property
|
||||
def strength_save(self):
|
||||
return self.strength + self.proficiency_bonus * self.strength_save_proficiency.value
|
||||
|
|
Loading…
Reference in a new issue