Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Races #49

Merged
merged 14 commits into from
Nov 29, 2015
2 changes: 2 additions & 0 deletions commands/chartraits.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def func(self):
'V': tr.ENC.max,
'W': tr.MV.mod,
'X': tr.MV.actual,
'Y': self.caller.db.race,
'Z': self.caller.db.focus,
}
bold = lambda v: "{{w{}{{n".format(v)
form.map({k: bold(v) for k, v in fields.iteritems()})
Expand Down
38 changes: 19 additions & 19 deletions commands/templates/charsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@


FORM = """
-=-=-=-=-=-=-=-=-=-=-=-=-=-={C[ {rCharacter Info {C]{n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-|
-=-=-=-=-=-=-=-=-=-=-=-=-=-=|C[ |rCharacter Info |C]|n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-|
|
{YName{n: xxxxxxxxxxxxxAxxxxxxxxxxxxxx {YXP{n: xxCxx / xxxxDxxxx {YLevel{n: xEx |
{YArchetype{n: xxxxxxxxxxxBxxxxxxxxxxx |
|YName|n: xxxxxxxxxxxxxAxxxxxxxxxxxxxx |YXP|n: xxCxx / xxxxDxxxx |YLevel|n: xEx |
|YArchetype|n: xxxxxxxxxxxBxxxxxxxxxxx |
+-------------------------------------|
ooooooooooooooooooooooooooooooooooo | {YPrimary Traits {CStrength{n : xFx |
ooooooooooooooooo1ooooooooooooooooo | ~~~~~~~~~~~~~~ {CPerception{n : xGx |
ooooooooooooooooooooooooooooooooooo | {CIntelligence{n: xHx |
| {CDexterity{n : xIx |
{YDescription{n | {CCharisma{n : xJx |
~~~~~~~~~~~ | {CVitality{n : xKx |
ooooooooooooooooo2ooooooooooooooooo | {CMagic{n : xLx |
ooooooooooooooooooooooooooooooooooo |-------------------------------------|
| {YSave Rolls {CFortitude{n : xMx |
{YEncumbrance{n | ~~~~~~~~~~ {CReflex{n : xNx |
~~~~~~~~~~~ | {CWill{n : xOx |
{CCarry Weight{n: xUxx / xVxx |-------------------------------------|
{CEncumbrance Penalty{n: xWxx | {YCombat Stats {CMelee{n : xPx |
{CMovement Points{n: xXxx | ~~~~~~~~~~~~ {CRanged{n : xQx |
| {CPower Point Unarmed{n : xRx |
| {CBonus{{n: xTx {CDefense{n : xSx |
ooooooooooooooooooooooooooooooooooo | |YPrimary Traits |CStrength|n : xFx |
ooooooooooooooooo1ooooooooooooooooo | ~~~~~~~~~~~~~~ |CPerception|n : xGx |
ooooooooooooooooooooooooooooooooooo | |CIntelligence|n: xHx |
| |CDexterity|n : xIx |
|YRace|n: xxxxxxxxxxxYxxxxxx | |CCharisma|n : xJx |
|YFocus|n: xxxxxxxxxxxZxxxxxx | |CVitality|n : xKx |
|YDescription|n | |CMagic|n : xLx |
~~~~~~~~~~~ | ----------------------------------- |
ooooooooooooooooo2ooooooooooooooooo | |YSave Rolls |CFortitude|n : xMx |
ooooooooooooooooooooooooooooooooooo | ~~~~~~~~~~ |CReflex|n : xNx |
| |CWill|n : xOx |
|YEncumbrance|n | ----------------------------------- |
~~~~~~~~~~~ | |YCombat Stats |CMelee|n : xPx |
|CCarry Weight|n: xUxx / xVxx | ~~~~~~~~~~~~ |CRanged|n : xQx |
|CEncumbrance Penalty|n: xWxx | |CPower Point Unarmed|n : xRx |
|CMovement Points|n: xXxx | |CBonus|n: xTx |CDefense|n : xSx |
+-------------------------------------|
"""

Expand Down
24 changes: 12 additions & 12 deletions commands/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ def test_sheet(self):
" ~~~~~~~~+~~~~~~~~+~~~~~~~~+~~~~~~~~ ~~~~~~~~~~~~~~ Perception : 2 \n"
" 9 / 9 9 / 9 0 / 0 0 / 0 Intelligence: 1 \n"
" Dexterity : 5 \n"
" Description Charisma : 4 \n"
" ~~~~~~~~~~~ Vitality : 9 \n"
" None Magic : 0 \n"
+ (39 * " ") + "\n"
" Save Rolls Fortitude : 9 \n"
" Encumbrance ~~~~~~~~~~ Reflex : 5 \n"
" ~~~~~~~~~~~ Will : 1 \n"
" Carry Weight: 0 / 180 \n"
" Encumbrance Penalty: 0 Combat Stats Melee : 9 \n"
" Movement Points: 5 ~~~~~~~~~~~~ Ranged : 2 \n"
" Power Point Unarmed : 5 \n"
" Bonus: +2 Defense : 5")
" Race: None Charisma : 4 \n"
" Focus: None Vitality : 9 \n"
" Description Magic : 0 \n"
" ~~~~~~~~~~~ \n"
" None Save Rolls Fortitude : 9 \n"
" ~~~~~~~~~~ Reflex : 5 \n"
" Will : 1 \n"
" Encumbrance \n"
" ~~~~~~~~~~~ Combat Stats Melee : 9 \n"
" Carry Weight: 0 / 180 ~~~~~~~~~~~~ Ranged : 2 \n"
" Encumbrance Penalty: 0 Power Point Unarmed : 5 \n"
" Movement Points: 5 Bonus: +2 Defense : 5")
self.call(CmdSheet(), "", sheet_output)

def test_traits(self):
Expand Down
19 changes: 2 additions & 17 deletions typeclasses/characters.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
from evennia.utils import lazy_property

from objects import Object
from world import races
from world import rulebook
from world.equip import EquipHandler
from world.traits import TraitFactory

Expand Down Expand Up @@ -122,7 +120,9 @@ def at_post_unpuppet(self, player, session=None):
self.location = None

def at_object_creation(self):

self.db.race = None
self.db.focus = None
self.db.archetype = None
self.db.traits = {} # trait data
self.db.slots = [] # equipment slots
Expand Down Expand Up @@ -153,18 +153,3 @@ def equip(self):
"""
slots = self.db.slots or []
return EquipHandler(self, slots=slots)

def become_race(self, race):
"""
This method applies a race to the character.

Args:
race (str): Class path for the race

Returns:
bool: True if successful, False if otherwise
"""

# set the race
self.db.race = races.load_race(race)
self.db.slots = self.db.race.slots
Loading