import Signal from "@rbxts/sleitnick-signal"; import { Flags } from "./flags"; import { type Moveset } from "./moveset"; import { type AnySkill, type SkillData, type UnknownSkill } from "./skill"; import { type AnyStatus, type StatusData, type UnknownStatus } from "./statusEffect"; import { type AbstractConstructor, type Constructor } from "./utility"; export interface CharacterData { instance: Instance; statusEffects: Map; skills: Map; moveset: string | undefined; defaultProps: AffectableHumanoidProps; } export interface DamageContainer { Damage: number; Source: UnknownStatus | UnknownSkill | undefined; } export type AffectableHumanoidProps = Pick; export declare class Character { private static readonly _internal_currentCharMap; static readonly CharacterCreated: Signal<[Character: Character]>; static readonly CharacterDestroyed: Signal<[Character: Character]>; readonly Instance: Instance; readonly Humanoid: Humanoid; readonly Player?: Player; private readonly _internal_janitor; readonly SkillAdded: Signal<[Status: UnknownSkill]>; readonly SkillRemoved: Signal<[Status: UnknownSkill]>; readonly StatusEffectAdded: Signal<[Status: UnknownStatus]>; readonly StatusEffectRemoved: Signal<[Status: UnknownStatus]>; readonly SkillStarted: Signal<[Status: UnknownSkill]>; readonly SkillEnded: Signal<[Status: UnknownSkill]>; readonly StatusEffectStarted: Signal<[Status: UnknownStatus]>; readonly StatusEffectEnded: Signal<[Status: UnknownStatus]>; /** * Fires only on client if the character belongs to a player */ readonly HumanoidPropertiesUpdated: Signal<[NewProperties: AffectableHumanoidProps]>; /** * Container's source will always be nil on client */ readonly DamageTaken: Signal<[Container: DamageContainer]>; /** * Enemy will always be nil on client */ readonly DamageDealt: Signal<[Enemy: Character | undefined, Container: DamageContainer]>; readonly Destroyed: Signal<[]>; readonly MovesetChanged: Signal<[NewMoveset: string | undefined, OldMoveset: string | undefined]>; DisableSkills: boolean; private readonly _internal_statusEffects; private readonly _internal_skills; private _internal_defaultProps; private _internal_currentlyAppliedProps; private _internal_id; private _internal_moveset?; private _internal_destroyed; constructor(Instance: Instance); /** * Destroys the object and performs necessary cleanup tasks. * You usually suppost to fire this manually when your humanoid dies. */ Destroy(): void; /** @hidden */ Destroy(flag: (typeof Flags)["CanDestroyLocallyClient"]): void; IsDestroyed(): boolean; /** * @returns The damage that was actually taken. */ TakeDamage(Container: DamageContainer): { Damage: number; Source: UnknownStatus | UnknownSkill | undefined; }; /** Predicts the estimated damage in health after the status effect appliement */ PredictDamage(Container: DamageContainer): { Damage: number; Source: UnknownStatus | UnknownSkill | undefined; }; SetDefaultProps(Props: Partial): void; /** * This function returns the default humanoid properties of the character. */ GetDefaultProps(): AffectableHumanoidProps; /** * Returns the map of all characters to their instances. */ static GetCharacterMap(this: void): ReadonlyMap; static GetLocalCharacter(this: void): Character | undefined; /** * Retrieves the character associated with the given instance. */ static GetCharacterFromInstance(this: void, Instance: Instance): Character | undefined; /** * Retrieves all status effects. */ GetAllStatusEffects(): UnknownStatus[]; /** * Retrieves all active status effects. */ GetAllActiveStatusEffects(): UnknownStatus[]; /** * Retrieves all status effects of a given type. */ GetAllStatusEffectsOfType(Constructor: Constructor): T[]; /** * Retrieves all active status effects of a specific type. */ GetAllActiveStatusEffectsOfType(Constructor: Constructor): T[]; /** * Checks if character has any active status effects of the specified type. */ HasStatusEffects(Constructor: Constructor): boolean; HasStatusEffects(Constructors: Constructor[]): boolean; /** * Retrieves the skills stored in the skills object and returns them as an array. */ GetSkills(): UnknownSkill[]; /** * Retrieves all active skills. */ GetAllActiveSkills(): UnknownSkill[]; /** * Retrieves a skill from the skills map based on a given name. */ GetSkillFromString(Name: string): UnknownSkill | undefined; /** * Retrieves a skill instance from the skills map based on the provided constructor. */ GetSkillFromConstructor(Constructor: Constructor): T | undefined; GetSkillsDerivedFrom(Constructor: Constructor | AbstractConstructor): T[]; /** * Apply a moveset to the character. */ ApplyMoveset(Moveset: string): void; ApplyMoveset(Moveset: Moveset): void; /** * Returns the current moveset name. */ GetMovesetName(): string | undefined; /** * Returns the current moveset. */ GetMoveset(): Moveset | undefined; /** * Gets the skills that belong to a provided moveset. * Default - Currently applied moveset */ GetMovesetSkills(Moveset?: Moveset | undefined): UnknownSkill[]; /** * Clears the moveset and destroys all skills. */ ClearMoveset(): void; private _internal_setMovesetServer; private _internal_cleanupMovesetSkills; /** * Apply the skills from a given Moveset. * Does not set the moveset and just applies the skills. */ ApplySkillsFromMoveset(Moveset: Moveset): void; private _internal_statusObserver; private _internal_skillObserver; private _internal_setupReplication_Client; private _internal_updateHumanoidProps; private _internal_calculateAppliedProps; GetAppliedProps(): AffectableHumanoidProps; }