Cure spell can be used from menu now (also used Vim for the first time to make a commit-worthy change, yay me)
Justin Armstrong justinmeister@gmail.com
Fri, 23 May 2014 22:33:08 -0700
9 files changed,
85 insertions(+),
13 deletions(-)
M
The_Stolen_Crown.py
→
The_Stolen_Crown.py
@@ -3,7 +3,7 @@ __author__ = 'justinarmstrong'
"""This is a fantasy RPG game about a warrior whose quest is to recover a magic crown""" - + import sys import pygame as pg from data import setup
M
data/battlegui.py
→
data/battlegui.py
@@ -39,7 +39,7 @@ c.SELECT_MAGIC: 'Select a magic spell.',
c.SELECT_ITEM: 'Select an item.', c.SELECT_ENEMY: 'Select an enemy.', c.ENEMY_ATTACK: 'Enemy attacks player!', - c.PLAYER_ATTACK: 'Player attacks enemy.', + c.PLAYER_ATTACK: 'Player attacks enemy! ', c.RUN_AWAY: 'RUN AWAY!!!', c.ENEMY_DAMAGED: self.enemy_damaged(), c.ENEMY_DEAD: 'Enemy killed.',@@ -49,7 +49,8 @@ c.DRINK_ETHER_POTION: 'Magic Points Increased.',
c.FIRE_SPELL: 'FIRE BLAST!', c.BATTLE_WON: 'Battle won!', c.SHOW_EXPERIENCE: self.show_experience(), - c.LEVEL_UP: self.level_up()} + c.LEVEL_UP: self.level_up(), + c.TWO_ACTIONS: 'Two actions per turn mode is now available.'} return state_dict
M
data/constants.py
→
data/constants.py
@@ -65,6 +65,7 @@ FLEE = 'flee'
FADE_DEATH = 'fade death' SHOW_EXPERIENCE = 'show experience' LEVEL_UP = 'level up' +TWO_ACTIONS = 'two actions' #EVENTS
M
data/states/battle.py
→
data/states/battle.py
@@ -45,6 +45,7 @@ self.player_action_dict = self.make_player_action_dict()
self.player_level = self.game_data['player stats']['Level'] self.enemies_to_attack = [] self.action_selected = False + self.just_leveled_up = False def make_player_action_dict(self): """@@ -263,6 +264,13 @@ self.enter_show_experience_state()
elif self.state == c.LEVEL_UP: if (self.current_time - self.timer) > 2200: + if self.game_data['player stats']['Level'] == 3: + self.enter_two_actions_per_turn_state() + else: + self.end_battle() + + elif self.state == c.TWO_ACTIONS: + if (self.current_time - self.timer) > 3000: self.end_battle() elif self.state == c.SHOW_EXPERIENCE:@@ -276,6 +284,7 @@ player_stats['magic points']['maximum'] += int(player_stats['magic points']['maximum']*.20)
new_experience = int((player_stats['Level'] * 100) * .75) player_stats['experience to next level'] = new_experience self.enter_level_up_state() + self.just_leveled_up = True else: self.end_battle()@@ -500,7 +509,7 @@ def enter_player_attack_state(self):
""" Transition battle into the Player attack state. """ - self.state = c.PLAYER_ATTACK + self.state = self.info_box.state = c.PLAYER_ATTACK enemy_to_attack = self.enemies_to_attack.pop(0) if enemy_to_attack in self.enemy_list: self.player.enter_attack_state(enemy_to_attack)@@ -640,6 +649,10 @@ Transition battle into the LEVEL UP state.
""" self.state = self.info_box.state = c.LEVEL_UP self.info_box.reset_level_up_message() + self.set_timer_to_current_time() + + def enter_two_actions_per_turn_state(self): + self.state = self.info_box.state = c.TWO_ACTIONS self.set_timer_to_current_time() def execute_player_actions(self):
M
data/states/levels.py
→
data/states/levels.py
@@ -247,7 +247,7 @@ 'Henceforth, I name thee Grand Protector of this Town!',
'Go forth and be recognized.', 'You are the greatest warrior this world has ever known.'] thank_you_dialogue = ['Thank you for retrieving my crown.', - 'My kingdom is forever in you debt.'] + 'My kingdom is forever in your debt.'] if self.game_data['crown quest'] and not self.game_data['delivered crown']: sprite.dialogue = retrieved_crown_dialogue
M
data/states/shop.py
→
data/states/shop.py
@@ -277,11 +277,13 @@
item = {'type': 'Healing Potion', 'price': 15, 'quantity': 1, + 'power': None, 'dialogue': healing_dialogue} item2 = {'type': 'Ether Potion', 'price': 15, 'quantity': 1, + 'power': None, 'dialogue': ether_dialogue} return [item, item2]
M
data/tools.py
→
data/tools.py
@@ -192,7 +192,7 @@ player_magic = {'current': 100,
'maximum': 100} player_stats = {'health': player_health, - 'Level': 1, + 'Level': 2, 'experience to next level': 20, 'magic points': player_magic, 'attack points': 10,