Improved install instruction for tb_magic
This commit is contained in:
parent
bdd5d7f6ca
commit
efd6774e02
1 changed files with 27 additions and 21 deletions
|
|
@ -44,6 +44,12 @@ instead of the default:
|
||||||
|
|
||||||
class Character(TBMagicCharacter):
|
class Character(TBMagicCharacter):
|
||||||
|
|
||||||
|
Note: If your character already existed you need to also make sure
|
||||||
|
to re-run the creation hooks on it to set the needed Attributes.
|
||||||
|
Use `update self` to try on yourself or use py to call `at_object_creation()`
|
||||||
|
on all existing Characters.
|
||||||
|
|
||||||
|
|
||||||
Next, import this module into your default_cmdsets.py module:
|
Next, import this module into your default_cmdsets.py module:
|
||||||
|
|
||||||
from evennia.contrib.turnbattle import tb_magic
|
from evennia.contrib.turnbattle import tb_magic
|
||||||
|
|
@ -199,10 +205,10 @@ def apply_damage(defender, damage):
|
||||||
def at_defeat(defeated):
|
def at_defeat(defeated):
|
||||||
"""
|
"""
|
||||||
Announces the defeat of a fighter in combat.
|
Announces the defeat of a fighter in combat.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
defeated (obj): Fighter that's been defeated.
|
defeated (obj): Fighter that's been defeated.
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
All this does is announce a defeat message by default, but if you
|
All this does is announce a defeat message by default, but if you
|
||||||
want anything else to happen to defeated fighters (like putting them
|
want anything else to happen to defeated fighters (like putting them
|
||||||
|
|
@ -332,7 +338,7 @@ class TBMagicCharacter(DefaultCharacter):
|
||||||
"""
|
"""
|
||||||
Called once, when this object is first created. This is the
|
Called once, when this object is first created. This is the
|
||||||
normal hook to overload for most object types.
|
normal hook to overload for most object types.
|
||||||
|
|
||||||
Adds attributes for a character's current and maximum HP.
|
Adds attributes for a character's current and maximum HP.
|
||||||
We're just going to set this value at '100' by default.
|
We're just going to set this value at '100' by default.
|
||||||
|
|
||||||
|
|
@ -731,26 +737,26 @@ class CmdDisengage(Command):
|
||||||
class CmdLearnSpell(Command):
|
class CmdLearnSpell(Command):
|
||||||
"""
|
"""
|
||||||
Learn a magic spell.
|
Learn a magic spell.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
learnspell <spell name>
|
learnspell <spell name>
|
||||||
|
|
||||||
Adds a spell by name to your list of spells known.
|
Adds a spell by name to your list of spells known.
|
||||||
|
|
||||||
The following spells are provided as examples:
|
The following spells are provided as examples:
|
||||||
|
|
||||||
|wmagic missile|n (3 MP): Fires three missiles that never miss. Can target
|
|wmagic missile|n (3 MP): Fires three missiles that never miss. Can target
|
||||||
up to three different enemies.
|
up to three different enemies.
|
||||||
|
|
||||||
|wflame shot|n (3 MP): Shoots a high-damage jet of flame at one target.
|
|wflame shot|n (3 MP): Shoots a high-damage jet of flame at one target.
|
||||||
|
|
||||||
|wcure wounds|n (5 MP): Heals damage on one target.
|
|wcure wounds|n (5 MP): Heals damage on one target.
|
||||||
|
|
||||||
|wmass cure wounds|n (10 MP): Like 'cure wounds', but can heal up to 5
|
|wmass cure wounds|n (10 MP): Like 'cure wounds', but can heal up to 5
|
||||||
targets at once.
|
targets at once.
|
||||||
|
|
||||||
|wfull heal|n (12 MP): Heals one target back to full HP.
|
|wfull heal|n (12 MP): Heals one target back to full HP.
|
||||||
|
|
||||||
|wcactus conjuration|n (2 MP): Creates a cactus.
|
|wcactus conjuration|n (2 MP): Creates a cactus.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
@ -803,10 +809,10 @@ class CmdCast(MuxCommand):
|
||||||
"""
|
"""
|
||||||
Cast a magic spell that you know, provided you have the MP
|
Cast a magic spell that you know, provided you have the MP
|
||||||
to spend on its casting.
|
to spend on its casting.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
cast <spellname> [= <target1>, <target2>, etc...]
|
cast <spellname> [= <target1>, <target2>, etc...]
|
||||||
|
|
||||||
Some spells can be cast on multiple targets, some can be cast
|
Some spells can be cast on multiple targets, some can be cast
|
||||||
on only yourself, and some don't need a target specified at all.
|
on only yourself, and some don't need a target specified at all.
|
||||||
Typing 'cast' by itself will give you a list of spells you know.
|
Typing 'cast' by itself will give you a list of spells you know.
|
||||||
|
|
@ -818,7 +824,7 @@ class CmdCast(MuxCommand):
|
||||||
def func(self):
|
def func(self):
|
||||||
"""
|
"""
|
||||||
This performs the actual command.
|
This performs the actual command.
|
||||||
|
|
||||||
Note: This is a quite long command, since it has to cope with all
|
Note: This is a quite long command, since it has to cope with all
|
||||||
the different circumstances in which you may or may not be able
|
the different circumstances in which you may or may not be able
|
||||||
to cast a spell. None of the spell's effects are handled by the
|
to cast a spell. None of the spell's effects are handled by the
|
||||||
|
|
@ -1123,7 +1129,7 @@ in the docstring for each function.
|
||||||
def spell_healing(caster, spell_name, targets, cost, **kwargs):
|
def spell_healing(caster, spell_name, targets, cost, **kwargs):
|
||||||
"""
|
"""
|
||||||
Spell that restores HP to a target or targets.
|
Spell that restores HP to a target or targets.
|
||||||
|
|
||||||
kwargs:
|
kwargs:
|
||||||
healing_range (tuple): Minimum and maximum amount healed to
|
healing_range (tuple): Minimum and maximum amount healed to
|
||||||
each target. (20, 40) by default.
|
each target. (20, 40) by default.
|
||||||
|
|
@ -1156,7 +1162,7 @@ def spell_healing(caster, spell_name, targets, cost, **kwargs):
|
||||||
def spell_attack(caster, spell_name, targets, cost, **kwargs):
|
def spell_attack(caster, spell_name, targets, cost, **kwargs):
|
||||||
"""
|
"""
|
||||||
Spell that deals damage in combat. Similar to resolve_attack.
|
Spell that deals damage in combat. Similar to resolve_attack.
|
||||||
|
|
||||||
kwargs:
|
kwargs:
|
||||||
attack_name (tuple): Single and plural describing the sort of
|
attack_name (tuple): Single and plural describing the sort of
|
||||||
attack or projectile that strikes each enemy.
|
attack or projectile that strikes each enemy.
|
||||||
|
|
@ -1250,12 +1256,12 @@ def spell_attack(caster, spell_name, targets, cost, **kwargs):
|
||||||
def spell_conjure(caster, spell_name, targets, cost, **kwargs):
|
def spell_conjure(caster, spell_name, targets, cost, **kwargs):
|
||||||
"""
|
"""
|
||||||
Spell that creates an object.
|
Spell that creates an object.
|
||||||
|
|
||||||
kwargs:
|
kwargs:
|
||||||
obj_key (str): Key of the created object.
|
obj_key (str): Key of the created object.
|
||||||
obj_desc (str): Desc of the created object.
|
obj_desc (str): Desc of the created object.
|
||||||
obj_typeclass (str): Typeclass path of the object.
|
obj_typeclass (str): Typeclass path of the object.
|
||||||
|
|
||||||
If you want to make more use of this particular spell funciton,
|
If you want to make more use of this particular spell funciton,
|
||||||
you may want to modify it to use the spawner (in evennia.utils.spawner)
|
you may want to modify it to use the spawner (in evennia.utils.spawner)
|
||||||
instead of creating objects directly.
|
instead of creating objects directly.
|
||||||
|
|
@ -1300,7 +1306,7 @@ parameters, some of which are required and others which are optional.
|
||||||
|
|
||||||
Required values for spells:
|
Required values for spells:
|
||||||
|
|
||||||
cost (int): MP cost of casting the spell
|
cost (int): MP cost of casting the spell
|
||||||
target (str): Valid targets for the spell. Can be any of:
|
target (str): Valid targets for the spell. Can be any of:
|
||||||
"none" - No target needed
|
"none" - No target needed
|
||||||
"self" - Self only
|
"self" - Self only
|
||||||
|
|
@ -1312,9 +1318,9 @@ Required values for spells:
|
||||||
spellfunc (callable): Function that performs the action of the spell.
|
spellfunc (callable): Function that performs the action of the spell.
|
||||||
Must take the following arguments: caster (obj), spell_name (str),
|
Must take the following arguments: caster (obj), spell_name (str),
|
||||||
targets (list), and cost (int), as well as **kwargs.
|
targets (list), and cost (int), as well as **kwargs.
|
||||||
|
|
||||||
Optional values for spells:
|
Optional values for spells:
|
||||||
|
|
||||||
combat_spell (bool): If the spell can be cast in combat. True by default.
|
combat_spell (bool): If the spell can be cast in combat. True by default.
|
||||||
noncombat_spell (bool): If the spell can be cast out of combat. True by default.
|
noncombat_spell (bool): If the spell can be cast out of combat. True by default.
|
||||||
max_targets (int): Maximum number of objects that can be targeted by the spell.
|
max_targets (int): Maximum number of objects that can be targeted by the spell.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue