- Lazy loading modules, to be able to print stuff at once without having to print before the imports.
- Add getting experience for groups and show the chars together (only one experience header instead of one per char).
+Basic design principles for the scripting language:
+ - The action is character centered wherever possible and useful.
+ -> char.say(text) instead of dialog(char, text)
+ - Anything which affects only one character or any interaction between only a few characters which is initiated by one of them gets called from the character via char.action().
+ -> char.compete_skill(char2, skill_name) instead of competition_skill(char1, char2, skill_name)
+ - Anything which affects the whole scene, or a whole group of not necessarily interacting characters gets called as basic function via action() or as class in its own right via class.action().
+ -> save([char1, char2]) instead of char1.save() char2.save()
+ - The seperate class way should only be chosen, if the class can feel like a character in its own right and needs seperate states which may or may not be persistent over subsequent runs.
+ -> For example AI.choose_the_way(players_answer) or music.action()
+ - Data should be stored inside the chars wherever possible. If a script gets started with the same character again, the situation should resemble the previous one as much as possible, except where dictated otherwise by the story.
+ -> char.save() instead of 'on quit' store_char_data(char) + 'on start' load_char_data(char)
+ - Actions should be written as verb_noun or simply verb.
+ -> char.say() and char.compete_skill() instead of char.text() and char.skill_compete()
- revert: story() is a function, but should be heavily overloaded, so it gets
used for any kind of interacion with the setting. -> story(background="...",
__author__ = 'Arne Babenhauserheide'
# __date__ = '7th March 2007'
__url__ = 'http://rpg-1d6.sf.net'
from textrpg_1d6.char import Char as ews_char
- '''String function to allow localizing later on
+ '''String function to allow localizing later on'''
@return: The result of the battle (won or lost, wounds)."""
- if ask('Do you want to attack ' + other.name + '? (Yes, no) ').lower() in ['
Yes', 'y', '']:
+ if ask('Do you want to attack ' + other.name + '? (Yes, no) ').lower() in ['es', 'y', '']:
diag("You attack " + other.name + ".")
won, injuries_self, injuries_other = select_battle_style(me, other, attacker=True)