Skip to content

Commit

Permalink
Make Fighter no longer inherit from base component.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julioevm committed Aug 30, 2024
1 parent 5ad81a6 commit acb23a5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions components/fighter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

from typing import TYPE_CHECKING
from actions import EnergyAction

import color
from components.base_component import BaseComponent
from render_order import RenderOrder
from utils import triangular_dist

if TYPE_CHECKING:
from actions import Action
from entity import Actor
from engine import Engine
from game_map import GameMap


class Fighter(BaseComponent):
class Fighter():
"""Actor component that holds the relevant information to handle combat."""

parent: Actor
Expand Down Expand Up @@ -54,6 +54,14 @@ def hp(self, value: int) -> None:
if self._hp == 0:
self.die()

@property
def gamemap(self) -> GameMap:
return self.parent.gamemap

@property
def engine(self) -> Engine:
return self.gamemap.engine

@property
def defense(self) -> int:
return self.base_defense + self.defense_bonus + self.defense_boost
Expand Down

0 comments on commit acb23a5

Please sign in to comment.