Tweaked attack and defense balances, attack and defense strength based purely on equipment rather than level.
Justin Armstrong justinmeister@gmail.com
Tue, 03 Jun 2014 15:38:56 -0700
6 files changed,
26 insertions(+),
25 deletions(-)
M
data/components/person.py
→
data/components/person.py
@@ -5,10 +5,10 @@ import pygame as pg
from .. import setup, observer from .. import constants as c - #Python 2/3 compatibility. if sys.version_info[0] == 2: range = xrange + class Person(pg.sprite.Sprite): """Base class for all world characters@@ -599,12 +599,9 @@ """
Calculate hit strength based on attack stats. """ weapon = self.game_data['player inventory']['equipped weapon'] - if not weapon: - weapon_power = 0 - else: - weapon_power = self.game_data['player inventory'][weapon]['power'] - max_strength = weapon_power + (self.level * 5) - min_strength = max_strength // 4 + weapon_power = self.game_data['player inventory'][weapon]['power'] + max_strength = weapon_power + min_strength = max_strength - 7 return random.randint(min_strength, max_strength)
M
data/shopgui.py
→
data/shopgui.py
@@ -330,7 +330,7 @@ if item_type in player_armor:
equipped_armor.append(item_type) if item_type in player_weapons: player_items['equipped weapon'] = item_type - if item_type in player_items: + if item_type in player_items and item_type not in magic_list: player_items[item_type]['quantity'] += quantity elif quantity > 0: player_items[item_type] = item_to_add
M
data/states/battle.py
→
data/states/battle.py
@@ -80,9 +80,9 @@ def make_enemy_level_dict(self):
new_dict = {c.OVERWORLD: 1, c.DUNGEON: 2, c.DUNGEON2: 2, - c.DUNGEON3: 3, + c.DUNGEON3: 2, c.DUNGEON4: 2, - c.DUNGEON5: 5} + c.DUNGEON5: 4} return new_dict@@ -100,7 +100,7 @@ """
experience_total = 0 for enemy in self.enemy_list: - experience_total += (random.randint(5,10)*enemy.level) + experience_total += (random.randint(5,10)) return experience_total@@ -157,7 +157,10 @@ enemy.rect.topleft = pos_list[i]
enemy.image = pg.transform.scale2x(enemy.image) enemy.index = i enemy.level = self.make_enemy_level_dict()[self.previous] - enemy.health = enemy.level * 7 + if enemy.name == 'evilwizard': + enemy.health = 100 + else: + enemy.health = enemy.level * 4 enemy_list = [enemy for enemy in enemy_group]
M
data/states/shop.py
→
data/states/shop.py
@@ -230,13 +230,13 @@
item2 = {'type': 'Long Sword', 'price': 150, 'quantity': 1, - 'power': 10, + 'power': 11, 'dialogue': longsword_dialogue} item1 = {'type': 'Rapier', 'price': 50, 'quantity': 1, - 'power': 5, + 'power': 9, 'dialogue': rapier_dialogue} return [item1, item2]@@ -265,13 +265,13 @@
item = {'type': 'Chain Mail', 'price': 50, 'quantity': 1, - 'power': 1, + 'power': 2, 'dialogue': chainmail_dialogue} item2 = {'type': 'Wooden Shield', 'price': 75, 'quantity': 1, - 'power': 1, + 'power': 3, 'dialogue': shield_dialogue} return [item, item2]
M
data/tools.py
→
data/tools.py
@@ -188,7 +188,7 @@ def create_game_data_dict():
"""Create a dictionary of persistant values the player carries between states""" - player_items = {'GOLD': dict([('quantity',200), + player_items = {'GOLD': dict([('quantity',100), ('value',0)]), 'Healing Potion': dict([('quantity',2), ('value',15)]),@@ -196,7 +196,7 @@ 'Ether Potion': dict([('quantity',1),
('value', 15)]), 'Rapier': dict([('quantity', 1), ('value', 50), - ('power', 5)]), + ('power', 9)]), 'equipped weapon': 'Rapier', 'equipped armor': []}