11from __future__ import annotations
22
3- from typing import TYPE_CHECKING
3+ from typing import TYPE_CHECKING , Type
44
55from components .base_component import BaseComponent
66from entity import Actor
77from equipment_types import EquipmentType
8- from status_effect import Poisoned , Bleeding
8+ from status_effect import Poisoned , Bleeding , Spored
99
1010if TYPE_CHECKING :
1111 from entity import Item
1212 from entity import Actor
13+ from status_effect import StatusEffect
1314
1415
1516
@@ -22,12 +23,14 @@ def __init__(
2223 power_bonus : int = 0 ,
2324 defense_bonus : int = 0 ,
2425 dodge_bonus : int = 0 ,
26+ extra_immunities : list [Type [StatusEffect ]] = [],
2527 ):
2628 self .equipment_type = equipment_type
2729
2830 self .power_bonus = power_bonus
2931 self .defense_bonus = defense_bonus
3032 self .dodge_bonus = dodge_bonus
33+ self .extra_immunities = extra_immunities
3134
3235
3336 def on_equip (self , parent : Actor ) -> None :
@@ -90,6 +93,14 @@ def on_attack(self, target: Actor):
9093 # Add the poisoned status effect to the target.
9194 target .fighter .apply_status_effect (Poisoned (duration = 8 , value = 2 ))
9295
96+ class SilverKinfe (Equippable ):
97+ def __init__ (self ) -> None :
98+ super ().__init__ (equipment_type = EquipmentType .WEAPON , power_bonus = 7 )
99+
100+ def on_attack (self , target : Actor ):
101+ # Add the bleeding status effect to the target.
102+ target .fighter .apply_status_effect (Bleeding (duration = 6 , value = 2 ))
103+
93104class ScrapChestPlate (Equippable ):
94105 def __init__ (self ) -> None :
95106 super ().__init__ (equipment_type = EquipmentType .ARMOR , defense_bonus = 1 )
@@ -118,14 +129,22 @@ def __init__(self) -> None:
118129
119130 def on_hit (self , target : Actor , damage : int ):
120131 # Add the bleeding status effect to the target.
121- target .fighter .apply_status_effect (Bleeding (duration = 6 , value = damage // 2 ))
122- # make the target take 4 damage
123- target .fighter .take_damage (4 )
132+ target .fighter .apply_status_effect (Bleeding (duration = 6 , value = 2 + ( damage // 2 ) ))
133+ # make the target take damage
134+ target .fighter .take_damage (4 + ( damage // 2 ) )
124135
125136class AcidMetalChestPlate (Equippable ):
126137 def __init__ (self ) -> None :
127138 super ().__init__ (equipment_type = EquipmentType .ARMOR , defense_bonus = 5 )
128139
129140 def on_hit (self , target : Actor , damage : int ):
130141 # Add the poisoned status effect to the target.
131- target .fighter .apply_status_effect (Poisoned (duration = 6 , value = 2 ))
142+ target .fighter .apply_status_effect (Poisoned (duration = 6 , value = 2 ))
143+
144+ class HazmatSuit (Equippable ):
145+ def __init__ (self ) -> None :
146+ super ().__init__ (equipment_type = EquipmentType .ARMOR , defense_bonus = 3 , extra_immunities = [Poisoned , Spored ])
147+
148+ class LeadHazmatSuit (Equippable ):
149+ def __init__ (self ) -> None :
150+ super ().__init__ (equipment_type = EquipmentType .ARMOR , defense_bonus = 5 , extra_immunities = [Poisoned , Spored ])
0 commit comments