mirror of
https://github.com/evennia/evennia.git
synced 2026-03-29 03:57:17 +02:00
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()
|
||||
# Tick down condition durations
|
||||
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_selfonly" : True,
|
||||
"item_kwargs" : {"conditions":[("Damage Down", 3), ("Accuracy Down", 3), ("Defense Down", 3)]}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue