-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
232 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from .fatui_pyro_agent import FatuiPyroAgent, PaidinFull | ||
|
||
|
||
PyroCharactors = FatuiPyroAgent | FatuiPyroAgent | ||
# SummonsOfPyroCharactors = | ||
PyroCharactorTalents = PaidinFull | PaidinFull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
from typing import Any, List, Literal | ||
|
||
from ...event import CreateObjectEventArguments, GameStartEventArguments | ||
from ...action import Actions, ChangeObjectUsageAction, CreateObjectAction | ||
from ...struct import Cost | ||
|
||
from ...consts import ( | ||
DamageElementalType, DieColor, ElementType, FactionType, | ||
ObjectPositionType, WeaponType | ||
) | ||
from ..charactor_base import ( | ||
ElementalBurstBase, ElementalSkillBase, | ||
PhysicalNormalAttackBase, PassiveSkillBase, CharactorBase, SkillTalent | ||
) | ||
|
||
|
||
# Skills | ||
|
||
|
||
class Prowl(ElementalSkillBase): | ||
name: Literal['Prowl'] = 'Prowl' | ||
desc: str = '''Deals 1 Pyro DMG. This character gains Stealth.''' | ||
damage: int = 1 | ||
damage_type: DamageElementalType = DamageElementalType.PYRO | ||
cost: Cost = Cost( | ||
elemental_dice_color = DieColor.PYRO, | ||
elemental_dice_number = 3 | ||
) | ||
|
||
def get_actions(self, match: Any) -> List[Actions]: | ||
""" | ||
Attack and create object | ||
""" | ||
return super().get_actions(match) + [ | ||
CreateObjectAction( | ||
object_name = 'Stealth', | ||
object_position = self.position.set_area( | ||
ObjectPositionType.CHARACTOR_STATUS), | ||
object_arguments = {} | ||
) | ||
] | ||
|
||
|
||
class StealthMaster(PassiveSkillBase): | ||
name: Literal['Stealth Master'] = 'Stealth Master' | ||
desc: str = ( | ||
'(Passive) When the battle begins, this character gains Stealth.' | ||
) | ||
|
||
def event_handler_GAME_START( | ||
self, event: GameStartEventArguments, match: Any | ||
) -> List[CreateObjectAction]: | ||
""" | ||
When game begin, gain stealth | ||
""" | ||
return [ | ||
CreateObjectAction( | ||
object_name = 'Stealth', | ||
object_position = self.position.set_area( | ||
ObjectPositionType.CHARACTOR_STATUS), | ||
object_arguments = {} | ||
) | ||
] | ||
|
||
|
||
# Talents | ||
|
||
|
||
class PaidinFull(SkillTalent): | ||
name: Literal['Paid in Full'] | ||
desc: str = ( | ||
'Combat Action: When your active character is Fatui Pyro Agent, ' | ||
'equip this card. After Fatui Pyro Agent equips this card, ' | ||
'immediately use Prowl once. When your Fatui Pyro Agent, who has ' | ||
'this card equipped, creates a Stealth, it will have the following ' | ||
'effect: Starting Usage(s) +1, the Physical DMG the character deals ' | ||
'will be converted to Pyro DMG.' | ||
) | ||
version: Literal['3.3'] = '3.3' | ||
charactor_name: Literal['Fatui Pyro Agent'] = 'Fatui Pyro Agent' | ||
cost: Cost = Cost( | ||
elemental_dice_color = DieColor.PYRO, | ||
elemental_dice_number = 3 | ||
) | ||
skill: Prowl = Prowl() | ||
|
||
def event_handler_CREATE_OBJECT( | ||
self, event: CreateObjectEventArguments, match: Any | ||
) -> List[ChangeObjectUsageAction]: | ||
""" | ||
When create object, check if it is stealth | ||
""" | ||
if self.position.area != ObjectPositionType.CHARACTOR: | ||
# not equipped, do nothing | ||
return [] | ||
if not self.position.check_position_valid( | ||
event.action.object_position, match, player_idx_same = True, | ||
charactor_idx_same = True, | ||
target_area = ObjectPositionType.CHARACTOR_STATUS | ||
): | ||
# not self create charactor status, do nothing | ||
return [] | ||
if event.action.object_name != 'Stealth': | ||
# not stealth, do nothing | ||
return [] | ||
charactor = match.player_tables[ | ||
self.position.player_idx].charactors[self.position.charactor_idx] | ||
status = charactor.status[event.create_idx] | ||
assert status.name == 'Stealth' | ||
# add 1 usage | ||
return [ChangeObjectUsageAction( | ||
object_position = status.position, | ||
change_type = 'DELTA', | ||
change_usage = 1 | ||
)] | ||
|
||
# charactor base | ||
|
||
|
||
class FatuiPyroAgent(CharactorBase): | ||
name: Literal['Fatui Pyro Agent'] | ||
version: Literal['3.3'] = '3.3' | ||
desc: str = '''"Blade of Settlement" Agent''' | ||
element: ElementType = ElementType.PYRO | ||
max_hp: int = 10 | ||
max_charge: int = 2 | ||
skills: List[ | ||
PhysicalNormalAttackBase | Prowl | ElementalBurstBase | StealthMaster | ||
] = [] | ||
faction: List[FactionType] = [ | ||
FactionType.FATUI | ||
] | ||
weapon_type: WeaponType = WeaponType.OTHER | ||
talent: PaidinFull | None = None | ||
|
||
def _init_skills(self) -> None: | ||
self.skills = [ | ||
PhysicalNormalAttackBase( | ||
name = 'Thrust', | ||
cost = PhysicalNormalAttackBase.get_cost(self.element), | ||
), | ||
Prowl(), | ||
ElementalBurstBase( | ||
name = 'Blade Ablaze', | ||
damage = 5, | ||
damage_type = DamageElementalType.PYRO, | ||
cost = ElementalBurstBase.get_cost(self.element, 3, 2), | ||
), | ||
StealthMaster() | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
from typing import Any, Literal | ||
|
||
from ...consts import DamageElementalType | ||
|
||
from ...modifiable_values import DamageElementEnhanceValue, DamageIncreaseValue | ||
from .base import DefendCharactorStatus | ||
|
||
|
||
class Stealth(DefendCharactorStatus): | ||
name: Literal['Stealth'] = 'Stealth' | ||
desc: str = ( | ||
'The character to which this is attached takes -1 DMG and ' | ||
'deals +1 DMG. Usage(s): 2' | ||
) | ||
version: Literal['3.3'] = '3.3' | ||
usage: int = 2 | ||
max_usage: int = 2 | ||
min_damage_to_trigger: int = 1 | ||
max_in_one_time: int = 1 | ||
|
||
def value_modifier_DAMAGE_ELEMENT_ENHANCE( | ||
self, value: DamageElementEnhanceValue, match: Any, | ||
mode: Literal['TEST', 'REAL'] | ||
) -> DamageElementEnhanceValue: | ||
""" | ||
When self use skill, and has talent, change physical to pyro | ||
""" | ||
assert mode == 'REAL' | ||
if not value.is_corresponding_charactor_use_damage_skill( | ||
self.position, match, None | ||
): | ||
# not corresponding charactor use skill, do nothing | ||
return value | ||
if self.usage <= 0: # pragma: no cover | ||
# no usage, do nothing | ||
return value | ||
charactor = match.player_tables[ | ||
self.position.player_idx].charactors[self.position.charactor_idx] | ||
if charactor.talent is None: | ||
# no talent, do nothing | ||
return value | ||
# change physical to pyro | ||
if value.damage_elemental_type == DamageElementalType.PHYSICAL: | ||
value.damage_elemental_type = DamageElementalType.PYRO | ||
return value | ||
|
||
def value_modifier_DAMAGE_INCREASE( | ||
self, value: DamageIncreaseValue, match: Any, | ||
mode: Literal['TEST', 'REAL'] | ||
) -> DamageIncreaseValue: | ||
""" | ||
When self use skill, increase damage by 1 | ||
""" | ||
assert mode == 'REAL' | ||
if not value.is_corresponding_charactor_use_damage_skill( | ||
self.position, match, None | ||
): | ||
# not corresponding charactor use damage skill, do nothing | ||
return value | ||
if self.usage <= 0: # pragma: no cover | ||
# no usage, do nothing | ||
return value | ||
# increase damage by 1 | ||
value.damage += 1 | ||
self.usage -= 1 | ||
return value | ||
|
||
|
||
PyroCharactorStatus = Stealth | Stealth |