Return to repo list

heart-of-gold

Tactical RPG written in python, using pygame.
Return to HMagellan.com

commit 71f7f900a6c3fc30cf6435465d4a38db84da8aa0
parent 54093995d1cf6ba9cb2dca2027b5542154a2415a
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Sun, 22 Nov 2020 21:44:35 -0600

altered atk formula and added push button

Diffstat:
Mdata/img/action_buttons_1.png | 0
Mdata/json/sheets.json | 2+-
Msrc/piece.py | 7+++++--
Msrc/turn.py | 6+++---
4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/data/img/action_buttons_1.png b/data/img/action_buttons_1.png Binary files differ. diff --git a/data/json/sheets.json b/data/json/sheets.json @@ -107,7 +107,7 @@ "action_buttons_1" : { "filename" : "action_buttons_1.png", "dimensions" : [198, 48], - "total_sprites" : 12 + "total_sprites" : 14 }, "team_indicator_small_1" : { "filename" : "team_indicator_small_1.png", diff --git a/src/piece.py b/src/piece.py @@ -53,7 +53,10 @@ class PieceManager(manager.Manager): # from definition. for p in definition: # NOTE: This is one of those screwy things you don't often run into, but the copy module is - # needed here because of the pointer nature of python vals + # needed here because of the pointer nature of python vals. Normally a shallow copy (e.g. slices, + # comprehensions, etc.) is enough, but in this case, with a dict composed of two other dicts, + # a deep copy must be made because we are trying to operate on mutable compound values once they + # are passed to the piece objects. work = copy.deepcopy(definition[p]) n_sheet = self.bus.fetch("sheet_manager", "sheets")[work["sheet"]] n_anim = self.bus.fetch("sheet_manager", "animations")[work["sheet"]][work["animation"]] @@ -441,7 +444,7 @@ class Piece(entity.Entity): # Tell the other guy to be damaged prim = self.active_stats[WEAPON_TYPE_SOURCES[ITEMBASE[self.equipment["weapon"]]["type"]]] bon = WEAPON_TYPE_SOURCES[ITEMBASE[self.equipment["weapon"]]["type"]] - raw_dam = max(round((prim * 1.8) + random.randint(-(self.active_stats["LUK"] // 2), self.active_stats["LUK"])), 0) + raw_dam = max(round((prim * 1.6) + random.randint(-(self.active_stats["LUK"] // 2), self.active_stats["LUK"]) // 2), 0) if bon != None and raw_dam > 0: raw_dam += round((self.active_stats[bon] + random.randint(0, self.active_stats["LUK"] // 2)) * 0.2) elif raw_dam < 0: diff --git a/src/turn.py b/src/turn.py @@ -59,7 +59,7 @@ class TurnManager(manager.Manager): self.turn_projection = [] self.former_candidates = [] self.current_turn = 1 - for b in range(0, 6): + for b in range(0, 7): nab = ActionButton(sheets["action_buttons_1"], (0, b), None, False, self) nab.set_position(((SCREEN_WIDTH // 8), (SCREEN_HEIGHT // 10) + (((SCREEN_HEIGHT // 14) - 4)) * b)) self.action_buttons.append(nab) @@ -213,7 +213,7 @@ class TurnManager(manager.Manager): self.bus.perform_display_attack_range_of_piece(self.current_active_piece) self.camera.snap_to_position(self.current_active_piece.rect.center) self.game.control_mode = CTRL_MODES.Turn_Select_Attack - elif self.action_buttons[5].rect.collidepoint(pos) and self.action_buttons[5].clickable: + elif self.action_buttons[6].rect.collidepoint(pos) and self.action_buttons[6].clickable: self.shift_turns() def kill_piece(self, piece): @@ -268,7 +268,7 @@ class TurnManager(manager.Manager): if self.action_buttons[0].clickable: self.action_buttons[0].toggle_activation() elif self.game.control_mode == CTRL_MODES.Turn_Watch_Attack: - for k in range(1, 5): + for k in range(1, 6): if self.action_buttons[k].clickable: self.action_buttons[k].toggle_activation() elif self.game.control_mode == CTRL_MODES.Turn_Display_Stats: