Add proper header to components contrib

This commit is contained in:
Griatch 2023-04-29 08:00:32 +02:00
parent 2cbb0ae1fc
commit bc92bad15a

View file

@ -1,6 +1,8 @@
# Components
_Contrib by ChrisLR 2021_
Contrib by ChrisLR, 2021
Expand typeclasses using a components/composition approach.
## The Components Contrib
@ -134,7 +136,7 @@ from evennia.contrib.base_systems import components
# This is the Component class
class Health(components.Component):
name = "health"
# Stores the current and max values as Attributes on the host, defaulting to 100
current = components.DBField(default=100)
max = components.DBField(default=100)
@ -185,7 +187,7 @@ class Attack(Command):
# Attempt to retrieve the component, None is obtained if it does not exist.
if target.components.health:
valid_target = target
if not valid_target:
caller.msg("You can't attack that!")
return True