UNPKG

megaten

Version:

An unofficial collection of data from the Shin Megami Tensei and Persona games.

453 lines (452 loc) 20.3 kB
import type { AilBoostSkillData, AilDefensiveSkillData, AilmentSkillData, AttackSkillData, AutoBuffSkillData, BarrierBreakSkillData, BarrierSkillData, BoostSkillData, BreakSkillData, ChargeSkillData, CritBoostSkillData, CritSkillData, DefensiveSkillData, EndureSkillData, EvasionSkillData, InstaKillBoostSkillData, MasterSkillData, MiscSkillData, NaviSkillData, PersonaCounterSkillData, PostBattleSkillData, RecoverySkillData, RegenSkillData, SMTCounterSkillData, SetSkillData, SiphonSkillData, SkillData, SpringSkillData, SummonSkillData, SupportSkillData, SusceptibilitySkillData, TauntSkillData, WallSkillData } from './dataTypes.js'; import type { AilBoostCriteria, AilDefensiveAilment, AilResistance, Ailment, AilmentName, AilmentRange, AllyRange, AnyAffinity, AttackCost, AttackFlag, AttackPower, AutoBuffRange, Barrier, BarrierRange, BoostAffinity, BoostStack, BreakAffinity, Buff, Charge, CritBoostCriteria, CritRange, DamagingAffinity, Debuff, DefensiveAffinity, EndureCriteria, EnemyRange, EvasionAffinity, EvasionBoostCriteria, HPMP, LightDark, MasterStat, NumberOrPercent, OneOrAllAilments, PostBattleStat, RecoveryAmount, RecoveryFlag, RecoveryRange, RegenCriteria, RegenStat, Resistance, SMTCounterAffinity, SMTCounterPower, Series, SetAffinity, SingleOrDoubleBuff, SiphonCriteria, SkillType, SupportAutoEffect, SupportFlag, SupportRange, SusceptibilityRange, WallAffinity } from './types.js'; export declare abstract class Skill implements SkillData { /** The skill's name (adjusted for consistency with SMT5) */ name: string; /** The skill's alternative names */ aliases: string[]; /** The skill's normalized name used for matching queries */ devName: string; /** Whether the skill is unique to any specific demon(s), or null if the demon cannot be fused */ unique: boolean | null; /** The skill's affinity (adjusted for consistency with SMT5) */ affinity: AnyAffinity; /** The skill's type */ type: SkillType; /** The skill's description (adjusted for consistency with SMT5) */ abstract description: string; constructor(data: AnySkillData); /** Returns a string in "(Name): (Description)" format */ toString(): string; /** An array of every Skill instance */ static array: readonly AnySkill[]; /** A map of every Skill instance, keyed by their devName properties */ static map: Map<string, AnySkill>; /** * * Gets a Skill instance by its name. * @example * ```ts * const skill1 = Skill.get('Agi', true); // Type: AnySkill * console.log(skill1); // AttackSkill { ... } * * const skill2 = Skill.get('Fire Blast'); // Type: AnySkill | null * console.log(skill2); // null * * const skill3 = Skill.get('Kafrizz', true); // Type: AnySkill; Throws a MegatenError * ``` * * @param name - The skill's name * @param error - Whether to throw an exception instead of returning null if no skill is found; defaults to false */ static get(name: string, error: true): AnySkill; static get(name: string, error?: boolean): AnySkill | null; } /** A skill that boosts the chance of inflicting ailments */ export declare class AilBoostSkill extends Skill implements AilBoostSkillData { affinity: 'Passive'; type: 'AILBOOST'; description: string; /** The ailment that the skill increases the chance of inflicting */ ailment: OneOrAllAilments; /** The additional chance of inflicting the ailment */ amount: number; /** The conditions that the skill triggers under, or null if always in effect */ criteria: AilBoostCriteria | null; constructor(data: AilBoostSkillData); } /** A skill that decreases the chance of afflicting the user with an ailment */ export declare class AilDefensiveSkill extends Skill implements AilDefensiveSkillData { affinity: 'Passive'; type: 'AILDEFENSIVE'; description: string; /** The ailment resisted by this skill */ ailment: AilDefensiveAilment; /** The level of resistance to the ailment */ resistance: AilResistance; constructor(data: AilDefensiveSkillData); } /** A skill that inflicts an ailment */ export declare class AilmentSkill extends Skill implements AilmentSkillData { affinity: 'Ailment'; type: 'AILMENT'; description: string; /** The ailments that the skill inflicts */ ailments: AilmentName[]; /** The chance of inflicting the ailments (adjusted for consistency with SMT5) */ chance: number; /** The skill's MP cost */ cost: number; /** Debuffs that the skill applies */ debuffs: Debuff[]; /** * The skill's special or notable features * * @deprecated Use AilmentSkill#debuffs instead. */ flags: Debuff[]; /** The range that the skill targets */ range: AilmentRange; constructor(data: AilmentSkillData); } /** A skill that deals damage, potentially having other effects */ export declare class AttackSkill extends Skill implements AttackSkillData { affinity: DamagingAffinity; type: 'ATTACK'; description: string; /** The skill's accuracy */ accuracy: number; /** The names and chances of ailments that the skill inflicts */ ailments: Ailment[]; /** The skill cost's type and amount */ cost: AttackCost; /** The skill's special or notable features */ flags: AttackFlag[]; /** The maximum times that the skill can land */ max: number; /** The minimum times that the skill can land, excluding misses */ min: number; /** The numerical and displayed amount of damage that the skill deals */ power: AttackPower; /** The range that the skill targets */ range: EnemyRange; /** The game series that the skill data originates from */ series: Series; constructor(data: AttackSkillData); } /** A skill that automatically casts a buff at the start of battle */ export declare class AutoBuffSkill extends Skill implements AutoBuffSkillData { affinity: 'Passive'; type: 'AUTOBUFF'; description: string; /** The buff automatically applied by the skill */ buff: Buff; /** The range that the skill targets */ range: AutoBuffRange; constructor(data: AutoBuffSkillData); } /** A skill that forms a barrier */ export declare class BarrierSkill extends Skill implements BarrierSkillData { affinity: 'Support'; type: 'BARRIER'; description: string; /** The barriers that the skill forms */ barriers: Barrier[]; /** The skill's MP cost */ cost: number; /** The range that the skill targets */ range: BarrierRange; constructor(data: BarrierSkillData); } /** A skill that removes a barrier */ export declare class BarrierBreakSkill extends Skill implements BarrierBreakSkillData { affinity: 'Support'; type: 'BARRIERBREAK'; description: string; /** The barrier that the skill removes */ barrier: Barrier; /** The skill's MP cost */ cost: number; constructor(data: BarrierBreakSkillData); } /** A skill that boosts the damage/recovery amount of skills with a specific affinity */ export declare class BoostSkill extends Skill implements BoostSkillData { affinity: 'Passive'; type: 'BOOST'; description: string; /** The amount that the element's damage is boosted by */ amount: number; /** The affinity of the skills that the skill boosts */ element: BoostAffinity; /** Whether the skill stacks additively or multiplicatively */ stacks: BoostStack; constructor(data: BoostSkillData); } /** A skill that negates resistance to an affinity */ export declare class BreakSkill extends Skill implements BreakSkillData { affinity: 'Support'; type: 'BREAK'; description: string; /** The skill's MP cost */ cost: number; /** The affinity whose resistance is negated by the skill */ element: BreakAffinity; constructor(data: BreakSkillData); } /** A skill that casts a charge */ export declare class ChargeSkill extends Skill implements ChargeSkillData { affinity: 'Support'; type: 'CHARGE'; description: string; /** The charge that the skill casts */ charge: Charge; /** The skill's MP cost */ cost: number; /** The range that the skill targets */ range: AllyRange; constructor(data: ChargeSkillData); } /** A skill that is cast to increase the chance of landing critical hits */ export declare class CritSkill extends Skill implements CritSkillData { affinity: 'Support'; type: 'CRIT'; description: string; /** The skill's MP cost */ cost: number; /** The range that the skill targets */ range: CritRange; constructor(data: CritSkillData); } /** A skill that passively increases the chance of landing critical hits */ export declare class CritBoostSkill extends Skill implements CritBoostSkillData { affinity: 'Passive'; type: 'CRITBOOST'; description: string; /** The additional chance of landing a critical hit */ amount: number; /** The conditions that the skill triggers under, or null if always in effect */ criteria: CritBoostCriteria | null; constructor(data: CritBoostSkillData); } /** A skill that increases resistance to damage from a specific affinity */ export declare class DefensiveSkill extends Skill implements DefensiveSkillData { affinity: 'Passive'; type: 'DEFENSIVE'; description: string; /** The affinity that the skill increases resistance from */ element: DefensiveAffinity; /** The skill user's new resistance to the element */ newResistance: Resistance; constructor(data: DefensiveSkillData); } /** A skill that saves the user from a lethal attack */ export declare class EndureSkill extends Skill implements EndureSkillData { affinity: 'Passive'; type: 'ENDURE'; description: string; /** The priority that the skill triggers compared to other EndureSkill instances (a higher priority will trigger earlier in battle), or the chance that the skill triggers */ amount: number; /** The conditions that the skill triggers under, or null if always in effect */ criteria: EndureCriteria | null; constructor(data: EndureSkillData); } /** A skill that increases evasion from skills with specific affinities */ export declare class EvasionSkill extends Skill implements EvasionSkillData { affinity: 'Passive'; type: 'EVASION'; description: string; /** The amount that the skill increases the chance of evading the elements by, or 0 if unknown */ amount: number; /** The conditions that the skill triggers under, or null if always in effect */ criteria: EvasionBoostCriteria | null; /** The affinity that the skill increases evasion from */ element: EvasionAffinity; constructor(data: EvasionSkillData); } /** A skill that increases the chance of landing an instakill */ export declare class InstaKillBoostSkill extends Skill implements InstaKillBoostSkillData { affinity: 'Passive'; type: 'INSTAKILLBOOST'; description: string; /** The affinity of the instakill skill that the skill boosts (adjusted for consistency with SMT5) */ element: LightDark; constructor(data: InstaKillBoostSkillData); } /** A skill that decreases the cost of skills */ export declare class MasterSkill extends Skill implements MasterSkillData { affinity: 'Passive'; type: 'MASTER'; description: string; /** The amount of the stat that skills' costs are reduced by */ amount: number; /** The stat cost that the skill lowers */ stat: MasterStat; constructor(data: MasterSkillData); } /** A skill with miscellaneous (likely unique) effects */ export declare class MiscSkill extends Skill implements MiscSkillData { affinity: AnyAffinity; type: 'MISC'; description: string; /** The skill's MP cost, or null if the skill has a Passive affinity */ cost: number | null; constructor(data: MiscSkillData); } /** A skill learned by a navigator in the Persona serise */ export declare class NaviSkill extends Skill implements NaviSkillData { unique: null; affinity: 'Passive'; type: 'NAVI'; description: string; constructor(data: NaviSkillData); } /** A skill that may reflect physical damage */ export declare class PersonaCounterSkill extends Skill implements PersonaCounterSkillData { affinity: 'Passive'; type: 'PERSONACOUNTER'; description: string; /** The chance of countering attacks */ chance: number; constructor(data: PersonaCounterSkillData); } /** A skill that restores a stat when a battle ends */ export declare class PostBattleSkill extends Skill implements PostBattleSkillData { affinity: 'Passive'; type: 'POSTBATTLE'; description: string; /** The amount of the stat that the skill increases */ amount: number; /** Whether the skill triggers for nonparticipating party members */ inactive: boolean; /** The stat that the skill increases */ stat: PostBattleStat; constructor(data: PostBattleSkillData); } /** A skill that recovers HP, ailments, and/or casts buffs */ export declare class RecoverySkill extends Skill implements RecoverySkillData { affinity: 'Recovery'; type: 'RECOVERY'; description: string; /** The ailments that the skill recovers from */ ailments: AilmentName[] | 'All'; /** The displayed amount that the skill heals, or null if it does not heal */ amount: RecoveryAmount | null; /** The buffs that the skill casts */ buffs: SingleOrDoubleBuff[]; /** The skill's MP cost */ cost: number; /** Special flags for the skill */ flags: RecoveryFlag[]; /** The range that the skill targets */ range: RecoveryRange; constructor(data: RecoverySkillData); } /** A skill that regenerates a stat each turn */ export declare class RegenSkill extends Skill implements RegenSkillData { affinity: 'Passive'; type: 'REGEN'; description: string; /** The amount of the stat that the skill recovers */ amount: NumberOrPercent; /** The conditions that the skill triggers under, or null if always in effect */ criteria: RegenCriteria | null; /** The stat that the skill recovers */ stat: RegenStat; constructor(data: RegenSkillData); } /** A skill that sets an enemy's HP to a specific amount */ export declare class SetSkill extends Skill implements SetSkillData { affinity: SetAffinity; type: 'SET'; description: string; /** The amount of the enemy's current HP that it will be set to */ amount: NumberOrPercent; /** The skill's MP cost, or null if enemy-exclusive */ cost: number | null; constructor(data: SetSkillData); } /** A skill that restores MP under certain criteria */ export declare class SiphonSkill extends Skill implements SiphonSkillData { affinity: 'Passive'; type: 'SIPHON'; description: string; /** The amount of MP that the skill recovers */ amount: number; /** The conditions that the skill triggers under, or null if always in effect */ criteria: SiphonCriteria; constructor(data: SiphonSkillData); } /** A skill that automatically triggers when hit by a physical attack */ export declare class SMTCounterSkill extends Skill implements SMTCounterSkillData { affinity: 'Passive'; type: 'SMTCOUNTER'; description: string; /** Whether the skill lowers the attack of the attacker */ attackDown: boolean; /** The chance for the skill to take effect */ chance: number; /** The affinity of the attack dealt from the counter */ element: SMTCounterAffinity; /** The numerical and displayed amount of damage that the skill deals */ power: SMTCounterPower; /** Whether the skill inflicts Shroud on the attacker */ shroud: boolean; constructor(data: SMTCounterSkillData); } /** A skill that increases the user's maximum HP or MP */ export declare class SpringSkill extends Skill implements SpringSkillData { affinity: 'Passive'; type: 'SPRING'; description: string; /** The amount that the stat is increased by */ amount: NumberOrPercent; /** The stat that the skill increases */ stat: HPMP; constructor(data: SpringSkillData); } /** A skill that summons one or more demons as allies */ export declare class SummonSkill extends Skill implements SummonSkillData { unique: null; affinity: 'Misc'; type: 'SUMMON'; description: string; /** The summoned demon's name, or null if unknown */ demon: string | null; constructor(data: SummonSkillData); } /** A skill that casts buffs, debuffs, or negates those on either allies or enemies */ export declare class SupportSkill extends Skill implements SupportSkillData { affinity: 'Support'; type: 'SUPPORT'; description: string; /** The barriers or charges automatically cast by having the skill */ auto: SupportAutoEffect[]; /** The buffs cast by the skill */ buffs: SingleOrDoubleBuff[]; /** The skill's MP cost */ cost: number; /** The debuffs cast by the skill */ debuffs: Buff[]; /** The skill's special or notable features */ flags: SupportFlag[]; /** Whether the skill negates its buffs or debuffs from enemies or allies, respectively */ negate: boolean; /** The range that the skill targets */ range: SupportRange; constructor(data: SupportSkillData); } /** A skill that increases the target's susceptibility to ailments */ export declare class SusceptibilitySkill extends Skill implements SusceptibilitySkillData { affinity: 'Almighty'; type: 'SUSCEPTIBILITY'; description: string; /** The skill's MP cost */ cost: number; /** The range that the skill targets */ range: SusceptibilityRange; constructor(data: SusceptibilitySkillData); } /** A skill that increases the chance of enemies targeting the user */ export declare class TauntSkill extends Skill implements TauntSkillData { affinity: 'Support'; type: 'TAUNT'; description: string; /** The buff cast by the skill, or null if none */ buff: SingleOrDoubleBuff | null; /** The skill's MP cost */ cost: number; constructor(data: TauntSkillData); } /** A skill that temporarily increases an ally's resistance to damage from skills with a specific affinity */ export declare class WallSkill extends Skill implements WallSkillData { affinity: 'Support'; type: 'WALL'; description: string; /** The skill's MP cost */ cost: number; /** The affinity that the skill temporarily increases resistance from */ element: WallAffinity; constructor(data: WallSkillData); } export type AnySkillData = AilBoostSkillData | AilDefensiveSkillData | AilmentSkillData | AttackSkillData | AutoBuffSkillData | BarrierSkillData | BarrierBreakSkillData | BoostSkillData | BreakSkillData | ChargeSkillData | CritSkillData | CritBoostSkillData | DefensiveSkillData | EndureSkillData | EvasionSkillData | InstaKillBoostSkillData | MasterSkillData | MiscSkillData | NaviSkillData | PersonaCounterSkillData | PostBattleSkillData | RecoverySkillData | RegenSkillData | SetSkillData | SiphonSkillData | SMTCounterSkillData | SpringSkillData | SummonSkillData | SupportSkillData | SusceptibilitySkillData | TauntSkillData | WallSkillData; export type AnySkill = AilBoostSkill | AilDefensiveSkill | AilmentSkill | AttackSkill | AutoBuffSkill | BarrierSkill | BarrierBreakSkill | BoostSkill | BreakSkill | ChargeSkill | CritSkill | CritBoostSkill | DefensiveSkill | EndureSkill | EvasionSkill | SetSkill | InstaKillBoostSkill | MasterSkill | MiscSkill | NaviSkill | PersonaCounterSkill | PostBattleSkill | RecoverySkill | RegenSkill | SetSkill | SiphonSkill | SMTCounterSkill | SpringSkill | SummonSkill | SupportSkill | SusceptibilitySkill | TauntSkill | WallSkill;