def _from_affliction_extension( self, asset_manager: "AssetManager", payload: AbilityVariantEffectPayload ) -> set[AbilityVariantEffectUnit]: return self._direct_buff_unit( Status(self.variant.id_a).to_buff_param_extension(), asset_manager, payload)
def _from_infliction_prob_up( self, asset_manager: "AssetManager", payload: AbilityVariantEffectPayload ) -> set[AbilityVariantEffectUnit]: inflict_param = Status(self.variant.id_a).to_buff_param_inflict() return self._direct_buff_unit(inflict_param, asset_manager, payload)
def parse_raw(data: dict[str, Union[str, float, int]]) -> "HitAttrEntry": punisher_states = { data["_KillerState1"], data["_KillerState2"], data["_KillerState3"] } - {0} punisher_states = {Status(state) for state in punisher_states} - {Status.UNKNOWN} # As of 2020/12/12, if `data["_HitConditionType"]` is a non-zero value, it can only be either `1` or `2`. # For hit condition = 1, it's only used by Laranoa S2 (`106502012`) to indicate the teammate count. # For hit condition = 2, it's only used by Summer Cleo S2 (`106504012`), Nadine S1 (`105501021`), # and Chelle S1 (`106505031`). return HitAttrEntry( id=data["_Id"], hit_exec_type=HitExecType(data["_HitExecType"]), target_group=HitTarget(data["_TargetGroup"]), damage_modifier=data["_DamageAdjustment"], damage_modifier_counter=data["_DamageCounterCoef"], rate_boost_normal=data["_ToOdDmgRate"], rate_boost_od=data["_ToBreakDmgRate"], is_damage_self=bool(data["_IsDamageMyself"]), hp_fix_rate=data["_SetCurrentHpRate"], hp_consumption_rate=data["_ConsumeHpRate"], punisher_states=punisher_states, punisher_rate=data["_KillerStateDamageRate"], punisher_rate_combo=ComboBoostValueExtension( data["_KillerStateDamageRateCurveDependsOnHitCount"]), rate_boost_on_crisis=data["_CrisisLimitRate"], rate_boost_by_buff=data["_DamageUpRateByBuffCount"], buff_boost_data_id=data["_DamageUpDataByBuffCount"], action_condition_id=data["_ActionCondition1"], sp_recov_ratio=data["_RecoverySpRatio"], sp_recov_skill_idx_1=data["_RecoverySpSkillIndex"], sp_recov_skill_idx_2=data["_RecoverySpSkillIndex2"], dummy_hit_count=bool(data["_IsAddCombo"]), has_hit_condition=data["_HitConditionType"] != 0, hit_condition_lower_bound=data["_HitConditionP1"], hit_condition_upper_bound=data["_HitConditionP2"], on_hit_sp_regen=data["_AdditionRecoverySp"], on_hit_utp_regen=data["_AdditionRecoveryUtp"], )
def export(self): """Export the parsed assets.""" # Enums self._export_enums( { "afflictions": cond_afflictions, "elements": cond_elements }, "conditions") self._export_enums_ex() self._export_enums({"weapon": Weapon.get_all_translatable_members()}, "weaponType") self._export_enums( {"elemental": Element.get_all_translatable_members()}, "elements") self._export_enums( {"unit": BuffValueUnit.get_all_translatable_members()}, "buffParam") self._export_enums({"status": Status.get_all_translatable_members()}, "status") self._export_enums( {"cancel": SkillCancelAction.get_all_translatable_members()}, "skill") self._export_enums_condition("allCondition") # Skill self._export_atk_skill() self._export_skill_identifiers("identifiers") # Abilties self._export_ex_abilities() # Info self._export_unit_info() self._export_normal_attack() # Story self._export_story() # Misc self._export_elem_bonus()
def parse_raw(data: dict[str, Union[str, int]]) -> "ActionConditionEntry": duration_count_max = (data["_MaxDurationNum"] if data["_IsAddDurationNum"] else 1 if data["_DurationNum"] else 0) regen_sp_pct = (-data["_SlipDamageRatio"] * 100 / data["_SlipDamageIntervalSec"] if data["_UniqueRegeneSp01"] or data["_AutoRegeneS1"] else 0) return ActionConditionEntry( id=data["_Id"], afflict_status=Status(data["_Type"]), overwrite_group_id=data["_OverwriteGroupId"], overwrite_identical_owner=data["_OverwriteIdenticalOwner"], max_instance_count=data["_MaxDuplicatedCount"], duration_sec=data["_DurationSec"], duration_count=data["_DurationNum"], duration_count_max=duration_count_max, probability_pct=data["_Rate"], efficacy_type=EfficacyType(data["_EfficacyType"]), slip_interval_sec=data["_SlipDamageIntervalSec"], slip_damage_mod=data["_SlipDamagePower"], slip_damage_hp_rate=data["_SlipDamageRatio"], regen_rp=data["_RegenePower"], regen_sp_pct=regen_sp_pct, buff_atk=data["_RateAttack"], buff_def=data["_RateDefense"], buff_def_b=data["_RateDefenseB"], buff_crt_rate=data["_RateCritical"], buff_crt_damage=data["_EnhancedCritical"], buff_skill_damage=data["_RateSkill"], buff_fs_damage=data["_RateBurst"], buff_atk_spd=data["_RateAttackSpeed"], buff_sp_rate=data["_RateRecoverySp"], buff_fs_spd=data["_RateChargeSpeed"], shield_dmg=data["_RateDamageShield"], shield_hp=data["_RateSacrificeShield"], damage_reduction=data["_RateDamageCut"], resistance_flame=data["_RateFire"], resistance_water=data["_RateWater"], resistance_wind=data["_RateWind"], resistance_light=data["_RateLight"], resistance_shadow=data["_RateDark"], resistance_poison=data["_RatePoison"], resistance_burn=data["_RateBurn"], resistance_freeze=data["_RateFreeze"], resistance_paralyze=data["_RateParalysis"], resistance_blind=data["_RateDarkness"], resistance_stun=data["_RateSwoon"], resistance_curse=data["_RateCurse"], resistance_bog=data["_RateSlowMove"], resistance_sleep=data["_RateSleep"], resistance_frostbite=data["_RateFrostbite"], resistance_flashburn=data["_RateFlashheat"], resistance_stormlash=data["_RateCrashWind"], resistance_shadowblight=data["_RateDarkAbs"], resistance_scorchrend=data["_RateDestroyFire"], enhance_fs_action_id=data["_EnhancedBurstAttack"], enhance_skill_1_id=data["_EnhancedSkill1"], enhance_skill_2_id=data["_EnhancedSkill2"], energize_lv=data["_Tension"], inspire_lv=data["_Inspiration"], hp_drain_rate=data["_RateHpDrain"], elemental_target=ElementFlag(data["_TargetElemental"]), level_up_id=data["_LevelUpId"], level_down_id=data["_LevelDownId"])
def test_export_status_enums(asset_manager: AssetManager): export_enum(asset_manager, "status", Status.get_all_translatable_members())
def _cond_hit_by_affliction(self) -> Condition: try: return ConditionCategories.trigger_hit_by_affliction.convert_reversed( Status(self.val_1)) except EnumConversionError as ex: raise self._condition_unconvertible(ex)
def _cond_inflicted_target(self) -> Condition: return ConditionCategories.target_status_infliction.convert_reversed( Status(self.val_1))