mirror of
https://github.com/evennia/evennia.git
synced 2026-03-23 00:06:30 +01:00
Start unit tests for turn based combat
This commit is contained in:
parent
cf8710724f
commit
2165487dfe
1 changed files with 10 additions and 2 deletions
|
|
@ -23,7 +23,7 @@ from collections import defaultdict
|
|||
from evennia.scripts.scripts import DefaultScript
|
||||
from evennia.typeclasses.attributes import AttributeProperty
|
||||
from evennia.utils.utils import make_iter
|
||||
from evennia.utils import evmenu, evtable
|
||||
from evennia.utils import evmenu, evtable, dbserialize
|
||||
from .enums import Ability
|
||||
from . import rules
|
||||
|
||||
|
|
@ -60,6 +60,14 @@ class CombatAction:
|
|||
# send only to the combatant.
|
||||
self.combatant.msg(message)
|
||||
|
||||
def __serialize_dbobjs__(self):
|
||||
self.combathandler = dbserialize.dbserialize(self.combathandler)
|
||||
self.combatant = dbserialize.dbserialize(self.combatant)
|
||||
|
||||
def __deserialize_dbobjs__(self):
|
||||
self.combathandler = dbserialize.dbunserialize(self.combathandler)
|
||||
self.combatant = dbserialize.dbunserialize(self.combatant)
|
||||
|
||||
def get_help(self, *args, **kwargs):
|
||||
return self.help_text
|
||||
|
||||
|
|
@ -380,7 +388,7 @@ class EvAdventureCombatHandler(DefaultScript):
|
|||
def remove_combatant(self, combatant):
|
||||
if combatant in self.combatants:
|
||||
self.combatants.remove(combatant)
|
||||
self.combatant_actions[combatant][action_class].pop(None)
|
||||
self.combatant_actions.pop(combatant, None)
|
||||
|
||||
def get_combat_summary(self, combatant):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue