Abstract FieldAbilities Ctor.
The Phaser.Game object.
The GoldenSun object.
The ability key_name.
The action that the char will assume when casting this ability.
Whether this ability need a target or not.
Optional colorize_map: booleanWhether this ability will tint the map when casting.
Optional target_max_range: number | ((target) => number)If this ability need a target, the max distance range from the caster to find a target. This can also be a function that receives a target candidate, this function must return a range.
Optional field_color: numberA custom color to tint the map.
Optional field_intensity: numberA custom intensity of a color when tinting the map.
Optional works_on_disabled_target: booleanOnly for IO targets. If true, this field ability also works for disabled targets.
Optional target_found_extra_check: ((target) => boolean)A function that receives a target. This called before casting. Execute some custom extra checks. If this funuction returns true, the char will cast this abiliy.
Optional ask_before_cast: booleanIf true, it opens an YesNo menu asking if the char really wants to cast this ability.
Optional target_is_npc: booleanIf true, the target is a NPC instead of an IO.
Optional map_colors_sequence: booleanIf true, the map will be tinted sequentially with random colors.
Optional is_custom_psynergy: booleanSet this to true, if it's a custom psynergy.
Private ability_Private action_Private ask_Private ask_Private bootstrap_Protected cast_The direction that the controllable char is casting thie psynergy.
Private cast_Protected casterThe main char that it casting the psynergy.
Private colorize_Protected controllable_The controllable char that's casting this psynergy.
Protected dataThe GoldenSun object.
Private extra_Private field_Private field_Private field_Protected gameThe Phaser.Game object.
Private map_Private need_Private previous_Optional target?: booleanProtected reset_Resets the map to default colors.
Protected stop_If called, the casting aura is destroyed.
Optional reset_casting_psy_flag: booleanOptional reset_map_tint: booleanPrivate target_Private target_Private target_Protected target_The target object of this psynergy. Might not be necessary depending on the psynergy.
Private works_Static Private Readonly DEFAULT_Casts this psynergy.
the controllable char that's casting this psynergy.
the main char key name that's casting this psyerngy.
Protected close_Generic funcion that can be overriden. When calling this, the psynergy effect should be finished.
for the psynergy to finish.
stops the char current animation.
Optional finish_callback: (() => void)the callback method to be called on psynergy end finish.
Private get_Sets the psynergy cast direction, For diagonals, picks the next clockwise non-diagonal.
Current direction
Non-diagonal cast direction
Private init_Private no_Protected return_Private search_Protected set_Protected set_Protected set_Adds an extra check for this psynergy to be casted. The given function is tested on this psynergy cast initialization. If the given function call returns false, this psynergy won't be casted.
the method to be tested.
Private set_Private set_Abstract updateStatic colorize_Colorizes the map for psynergy casting.
the Phaser.Game object.
the current map.
Optional options: { some options.
Optional after_after the map gets colorized callback.
Optional after_after colorize filter destruction callback.
Optional color?: numberthe color to colorize the map. In the RGB spectre, values between 0 and 1. Default is random.
Optional intensity?: numberthe colorize intensity.
Optional map_if true, it will keep changing colorization color over time.
returns a function that if called, it will return the map colors to normal.
Static init_Initializes a casting aura around the caster.
the Phase.Game object.
the GoldenSun object.
the caster controllable char.
Optional after_init: (() => void)after the aura is initialized callback.
Optional after_destroy: ((reset_casting_psy_flag) => void)after the aura is completely destroyed callback.
Optional before_destroy: ((reset_map_tint) => void)on aura destruction init callback.
returns a function that when called, will stop the casting aura.
Optional reset_casting_psy_flag: booleanOptional reset_map_tint: boolean
Defines and manages the usage of field psynergy. Classes that inherit this one, are expected to at least:
This class already do initial checks, search for target, init casting aura and colorize the map automatically.