Add tickerhandler-free character class for tests
This commit is contained in:
parent
1420c8773e
commit
f738427ff3
1 changed files with 12 additions and 2 deletions
|
|
@ -592,7 +592,17 @@ class TBItemsCharacter(DefaultCharacter):
|
||||||
self.apply_turn_conditions()
|
self.apply_turn_conditions()
|
||||||
# Tick down condition durations
|
# Tick down condition durations
|
||||||
condition_tickdown(self, self)
|
condition_tickdown(self, self)
|
||||||
|
|
||||||
|
class TBItemsCharacterTest(TBItemsCharacter):
|
||||||
|
"""
|
||||||
|
Just like the TBItemsCharacter, but doesn't subscribe to the TickerHandler.
|
||||||
|
This makes it easier to run unit tests on.
|
||||||
|
"""
|
||||||
|
def at_object_creation(self):
|
||||||
|
self.db.max_hp = 100 # Set maximum HP to 100
|
||||||
|
self.db.hp = self.db.max_hp # Set current HP to maximum
|
||||||
|
self.db.conditions = {} # Set empty dict for conditions
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
|
|
@ -1384,4 +1394,4 @@ AMULET_OF_WEAKNESS = {
|
||||||
"item_func" : "add_condition",
|
"item_func" : "add_condition",
|
||||||
"item_selfonly" : True,
|
"item_selfonly" : True,
|
||||||
"item_kwargs" : {"conditions":[("Damage Down", 3), ("Accuracy Down", 3), ("Defense Down", 3)]}
|
"item_kwargs" : {"conditions":[("Damage Down", 3), ("Accuracy Down", 3), ("Defense Down", 3)]}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue