mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Add proper header to components contrib
This commit is contained in:
parent
2cbb0ae1fc
commit
bc92bad15a
1 changed files with 5 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue