Changeset 67
- Timestamp:
- 12/20/10 00:08:10 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pycgibattler/trunk/index.cgi
r66 r67 53 53 DATA_DIR = os.path.expanduser(CONFIG.get('data', 'basedir')) 54 54 55 CHARA_NAMES = [x.strip() for x in open(os.path.expanduser(56 CONFIG.get('character', 'name_list_file'))).xreadlines()]57 SKILL_NAMES = [x.strip() for x in open(os.path.expanduser(58 CONFIG.get('character', 'skill_list_file'))).xreadlines()]59 SKILL_TYPES = [60 #pycodebattler.skill.HealType,61 #pycodebattler.skill.ResurrectionType,62 pycodebattler.skill.SingleAttackType,63 pycodebattler.skill.RangeAttackType,64 pycodebattler.skill.MultiAttackType,65 pycodebattler.skill.SuicideAttackType,66 ]67 68 55 def __init__(self, id_): 69 56 if not self.VALID_ID.match(id_): … … 134 121 @classmethod 135 122 def make_warrior(klass, code): 123 chara_names = [x.strip() for x in open(os.path.expanduser( 124 CONFIG.get('character', 'name_list_file'))).xreadlines()] 125 skill_names = [x.strip() for x in open(os.path.expanduser( 126 CONFIG.get('character', 'skill_list_file'))).xreadlines()] 127 skill_types = [ 128 #pycodebattler.skill.HealType, 129 #pycodebattler.skill.ResurrectionType, 130 pycodebattler.skill.SingleAttackType, 131 pycodebattler.skill.RangeAttackType, 132 pycodebattler.skill.MultiAttackType, 133 pycodebattler.skill.SuicideAttackType, 134 ] 135 136 136 lc = ListChooser(code) 137 name = lc.choose( klass.CHARA_NAMES)137 name = lc.choose(chara_names) 138 138 skills = [] 139 139 140 140 for i in range(lc.choose(range(1, 4))): 141 141 lc.lslide(i) 142 skname = lc.choose( klass.SKILL_NAMES)143 sktype = lc.choose( klass.SKILL_TYPES)142 skname = lc.choose(skill_names) 143 sktype = lc.choose(skill_types) 144 144 sklevel = lc.choose(range(1, 4)) 145 145 skpoint = lc.choose(range(sklevel * 4, sklevel * 7))
Note: See TracChangeset
for help on using the changeset viewer.