Resolve merge conflicts

This commit is contained in:
Griatch 2020-07-18 15:56:47 +02:00
commit 862d2a5d06
9 changed files with 228 additions and 121 deletions

View file

@ -125,14 +125,14 @@ CURLY_COLOR_ANSI_EXTRA_MAP = [
(r"{c", _ANSI_HILITE + _ANSI_CYAN),
(r"{w", _ANSI_HILITE + _ANSI_WHITE), # pure white
(r"{x", _ANSI_HILITE + _ANSI_BLACK), # dark grey
(r"{R", _ANSI_HILITE + _ANSI_RED),
(r"{G", _ANSI_HILITE + _ANSI_GREEN),
(r"{Y", _ANSI_HILITE + _ANSI_YELLOW),
(r"{B", _ANSI_HILITE + _ANSI_BLUE),
(r"{M", _ANSI_HILITE + _ANSI_MAGENTA),
(r"{C", _ANSI_HILITE + _ANSI_CYAN),
(r"{W", _ANSI_HILITE + _ANSI_WHITE), # light grey
(r"{X", _ANSI_HILITE + _ANSI_BLACK), # pure black
(r"{R", _ANSI_UNHILITE + _ANSI_RED),
(r"{G", _ANSI_UNHILITE + _ANSI_GREEN),
(r"{Y", _ANSI_UNHILITE + _ANSI_YELLOW),
(r"{B", _ANSI_UNHILITE + _ANSI_BLUE),
(r"{M", _ANSI_UNHILITE + _ANSI_MAGENTA),
(r"{C", _ANSI_UNHILITE + _ANSI_CYAN),
(r"{W", _ANSI_UNHILITE + _ANSI_WHITE), # light grey
(r"{X", _ANSI_UNHILITE + _ANSI_BLACK), # pure black
# hilight-able colors
(r"{h", _ANSI_HILITE),
(r"{H", _ANSI_UNHILITE),

View file

@ -78,7 +78,7 @@ And change your game's character typeclass to inherit from TBRangeCharacter
instead of the default:
class Character(TBRangeCharacter):
Do the same thing in your game's objects.py module for TBRangeObject:
from evennia.contrib.turnbattle.tb_range import TBRangeObject
@ -246,10 +246,10 @@ def apply_damage(defender, damage):
def at_defeat(defeated):
"""
Announces the defeat of a fighter in combat.
Args:
defeated (obj): Fighter that's been defeated.
Notes:
All this does is announce a defeat message by default, but if you
want anything else to happen to defeated fighters (like putting them
@ -300,11 +300,11 @@ def resolve_attack(attacker, defender, attack_type, attack_value=None, defense_v
def get_range(obj1, obj2):
"""
Gets the combat range between two objects.
Args:
obj1 (obj): First object
obj2 (obj): Second object
Returns:
range (int or None): Distance between two objects or None if not applicable
"""
@ -324,7 +324,7 @@ def get_range(obj1, obj2):
def distance_inc(mover, target):
"""
Function that increases distance in range field between mover and target.
Args:
mover (obj): The object moving
target (obj): The object to be moved away from
@ -340,11 +340,11 @@ def distance_inc(mover, target):
def approach(mover, target):
"""
Manages a character's whole approach, including changes in ranges to other characters.
Args:
mover (obj): The object moving
target (obj): The object to be moved toward
Notes:
The mover will also automatically move toward any objects that are closer to the
target than the mover is. The mover will also move away from anything they started
@ -354,7 +354,7 @@ def approach(mover, target):
def distance_dec(mover, target):
"""
Helper function that decreases distance in range field between mover and target.
Args:
mover (obj): The object moving
target (obj): The object to be moved toward
@ -388,11 +388,11 @@ def approach(mover, target):
def withdraw(mover, target):
"""
Manages a character's whole withdrawal, including changes in ranges to other characters.
Args:
mover (obj): The object moving
target (obj): The object to be moved away from
Notes:
The mover will also automatically move away from objects that are close to the target
of their withdrawl. The mover will never inadvertently move toward anything else while
@ -540,7 +540,8 @@ class TBRangeTurnHandler(DefaultScript):
room as its object.
Fights persist until only one participant is left with any HP or all
remaining participants choose to end the combat with the 'disengage' command.
remaining participants choose to end the combat with the 'disengage'
command.
"""
def at_script_creation(self):
@ -615,7 +616,7 @@ class TBRangeTurnHandler(DefaultScript):
def init_range(self, to_init):
"""
Initializes range values for an object at the start of a fight.
Args:
to_init (object): Object to initialize range field for.
"""
@ -638,14 +639,13 @@ class TBRangeTurnHandler(DefaultScript):
def join_rangefield(self, to_init, anchor_obj=None, add_distance=0):
"""
Adds a new object to the range field of a fight in progress.
Args:
to_init (object): Object to initialize range field for.
Keyword args:
anchor_obj (object): Object to copy range values from, or None for a random object.
add_distance (int): Distance to put between to_init object and anchor object.
"""
# Get a list of room's contents without to_init object.
contents = self.obj.contents