Anonymous avatar Anonymous committed 0cfeff5 Merge

merge from bach.

Comments (0)

Files changed (5)

 0cb91702e697064067af4cca4dd3e2a00508a535 v0.2
+2c4e2b230e055ec75ce68e8d9a95f2f1f29c7ed9 v0.3
+textrpg 0.3 (2008-07-07)
+
+- FIX: Answering Yes in battle screen didn't work. 
 - Now experience is spent incrementally.
 - Added check_skill(name_of_skill).
 

File contents unchanged.

       url='http://1w6.org/programme',
       packages = find_packages('.'), 
       #py_modules=['babtools_gentoo'],
-      scripts=["ministory.py", "textrpg.py"]
+      scripts=["ministory.py", "textrpg.py", "tutorial.py"]
      )
     - 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()
+
 Design:
     - revert: story() is a function, but should be heavily overloaded, so it gets 
 used for any kind of interacion with the setting. -> story(background="...", 
   MA 02110-1301 USA
 
 """ 
-__version__   = '0.2' 
+__version__   = '0.3' 
 __author__    = 'Arne Babenhauserheide' 
 # __date__      = '7th March 2007' 
 __url__       = 'http://rpg-1d6.sf.net' 
 from textrpg_1d6.char import Char as ews_char
 
 def _(text):
-    '''String function to allow localizing later on)'''
+    '''String function to allow localizing later on. '''
     return str(text)
 
 class Story(object): 
     
     @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 ['yes', 'y', '']: 
         diag("You attack " + other.name + ".")
         won, injuries_self, injuries_other = select_battle_style(me, other, attacker=True)
     else:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.