sword-demon-balgo/js/plugins/ARPG_Core.js
2024-04-11 14:40:15 -05:00

10561 lines
327 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*!/*:
@target MZ
@plugindesc ARPG_Core v1.1.0
@author unagi ootoro
@help
【Summary】
This plug-in provides the ability to convert an RPG Maker MZ system into an ARPG.
■ Features
This plug-in provides the functions necessary for action RPGs, such as player and enemy status management, hit detection settings, and attack processing settings.
All damaging objects (sword slashes, bullets, etc.) are realized by dynamically setting events.
This makes the plug-in highly customizable.
Common events can also be used to create processing when a character takes damage.
For example, in the sample game, when a character takes damage, the character is knocked back in the direction of the damage.
This is achieved by executing a plug-in command for blowing up the character from the common event.
This functionality can be used to implement a combo-like system where, for example, a character is only blown away if he is hit by a series of attacks.
In addition, since this plug-in is built on top of the dot movement plug-in, any character movement can be controlled in dot units, making it possible to create very action-oriented games.
For example, by calculating the angle between the enemy character and the player and sending bullets in that direction, it is possible to create an attack that pursues the player.
■ Required Plug-ins
The following plug-ins are required to install this plug-in.
Dot Move System (DotMoveSystem.js)
DotMoveSystem.js is used to control characters in dot units.
Dot Movement System Function Extension (DotMoveSystem_FunctionEx.js)
This plug-in adds various extended functions to the main body of the dot movement system.
Self Variable (SelfVariable.js)
This plug-in provides self-variables, extended self-switches, and common event variables/switches.
The ARPG core may automatically set various in-game flags as self-variables to events (e.g., ID of the user who used a skill), so this is used for this purpose.
Please install this plug-in, including these dependent plug-ins, in the following order.
・DotMoveSystem.js
・DotMoveSystem_FunctionEx.js
・SelfVariable.js
・ARPG_Core.js
【 Details of Functions】
[General]
■ Starting and stopping ARPG mode
If set to ON in the "ARPG mode switching" plug-in command, ARPG mode is started.
When set to OFF, ARPG mode is terminated.
Once in ARPG mode, you can fight with enemies in the field.
Whether the current ARPG mode is ON or not can be checked by the switch set in the plug-in parameter "ARPG Mode Switch".
The current ARPG mode can be checked by the switch set in the plugin parameter "ARPG Mode Switch".
Note 1: If the player moves to another map, ARPG mode will automatically switch to OFF.
Note 2: Changing the ARPG mode switch has no effect.
ARPG mode must be switched by this command.
Note 3: Saving is not possible during ARPG combat.
[Copy Events/Dynamic Events]
■ Copying Events
The following description in the Note field of an event will copy the specified event from the list of dynamic event copy source maps specified in the plugin parameters.
The specified event is copied from the list of dynamic event copy source maps.
<cp: Copy source event name or event ID>.
It is also possible to limit the copy source map by describing as follows
<cp: copy source map ID, copy source event name or event ID>.
Note: All the IDs of the source map are plugin parameters.
The ID of the map to be copied must be set in the "Copy Event Common Settings/List of Dynamic Event Generator Map IDs.
■ Dynamic Event Generation
Events can be generated dynamically by executing the "Dynamic Event Generation" plug-in command.
The event from which the dynamic event is copied must be placed on the map registered in the plugin parameter "List of map IDs from which dynamic events are generated".
■ Deleting Dynamic Events
Generated dynamic events can be completely deleted by executing the event command "Temporarily delete event".
[Actor related]
■ About the Guard
While pressing the A key during ARPG combat, the player guards.
f a player is attacked from the opposite direction of the player's direction while on guard,
the damage is halved if the player is on guard.
Also, if the attacker guards just before guarding, it is a just guard and completely neutralizes the damage.
See "Angle of Attack for Skill Objects" for the direction of attack used to determine guard success.
If you do not use the guard function, set the plug-in parameter
"Key Common Settings/Actor Guard Key"to Set the key name to "Unassigned".
Also, if you use the Guard function but do not use Just Guard,
set 0 to the number of frames for Just Guard.
[Enemy-related]
■ About Enemy Character Settings
In the event of an enemy character, by executing the "Setup Enemy" plug-in command through parallel processing or automatic execution, the event in which it is executed will be called "Setup Enemy".
By executing the plugin command "Setup Enemy" in an event of an enemy character, the event in which it is executed is treated as an enemy character.
The "Enemy setting" is used as an enemy character.
Please be sure to execute "Setup Enemy" when the ARPG mode is ON.
"Collision Attack Skill ID", "Enemy Kill Common Event ID", and "Enemy Damage Common Event ID"
can be set as arguments when setting enemy characters, but if 0 is specified for these values,
the plug-in parameter "Enemy The value of the parameter with the same name in "Common Settings" is applied.
■ Displaying HP of Enemy Characters
The HP gauge can be set in the "Setup Enemy" plug-in command to display the HP of the enemy character.
When "Normal" is selected, the HP gauge is displayed directly on the enemy character.
When "Boss" is selected, a large HP gauge is displayed at the top of the screen.
[Skill Related]
■ Creating Skills
If you put <action: common event name or ID> in the memo field of a skill, the corresponding common event will be invoked when you execute that skill.
This common event is called an "action common event.
Within an Action Common Event, by executing the "Activate Skill" plug-in command, the skill is activated and MP or TP is consumed.
In this state, skill objects are generated by executing the "Create Skill Object" command.
Skill objects are objects that, when hit by a battler, cause damage, recover HP, etc.
It is an event that can give the battler the effect of a skill.
Consider a skill object as a bullet fired by a player or an enemy character in a shooting game.
The skill object collides with the battler.
When a skill object collides with a battler, the effect set by the skill is applied to the colliding battler.
The default hit detection of a skill object is the size of the event that made it a skill object.
However, you can customize the hit judgment freely by following the procedure in " ■ Setting the Hit Judgment below.
If "Activate Skill" is not executed, MP/TP will not be consumed. Use this to your advantage.
If a skill activation condition is not met (for example, if there is an enemy character nearby) when the common event of a skill action is executed, the skill will not be executed.
If the common event of the skill action is executed and the skill activation condition is not met (e.g., an enemy character is nearby), the skill is not executed.
Note: It is not possible to create a skill object without activating a skill. If you do, an error message will be displayed.
■ Common Event Variables Available in Action Common Events
The common event variable for storing the user event ID will automatically contain the event ID of the character who is the user who executed the action common event.
The event ID is automatically stored in the common event variable when the character is an event.
By combining these two variables, it is possible to specify the character who used the skill in the character specification argument of various plug-in commands.
These variables must be common event variables.
■ Self variables available in events generated as skill objects
In events generated by the "Create Skill Object" plug-in command
The self-variables "skill object user type stored self-variable" and "skill object user event ID stored self-variable" can be used.
The self-variable that stores the skill object user type stores the type of the character that is the user who executed the skill object generation.
These variables must be self-event variables.
■ Cancel using skill when receive damage
If the plugin command "Damage Skill Cancel Enable/Disable Toggle" is set to Enable,
the skill will be canceled when damage is taken, forcing the skill common event to end.
Also, if you specify a chanting common event ID in the "Activate Skill" plugin command
The common event will be executed until the skill is activated,
during which time skill cancellation by damage will be enabled.
The same can be achieved with the "Damage Skill Cancel Enable/Disable Toggle" command.
However, it is simpler to use this method when skill chanting is the objective.
※ The maximum HP damage ratio for skill cancellation can be changed by setting the
"Skill Cancel Damage Rate" in the "Battler ARPG Parameter Settings" plugin command.
The maximum HP damage ratio for skill cancellation can be changed by setting the
"Skill Cancel Damage Rate" in the "Battler ARPG Parameter Settings" plugin command.
If not set, the skill will be canceled if it takes even one damage.
■ Attack Angle of Skill Objects
By executing the "Specify Attack Angle" plug-in command for a skill object
The attack angle can be set for a skill object by executing the "Specify Attack Angle" plug-in command for the skill object.
The angle of attack set here is used to determine whether the skill object is facing the user when guarding.
The value set here can be obtained by reading the common event variable "Common variable for storing damage angle" in the common event that is executed when damage is received.
This can be combined with the "Blow away character" plugin command to blow away the character in the direction of the damage.
■ Applying Skill Effects
After activating a skill, execute the plug-in command "Apply Skill Effects".
The effect of the relevant skill can be applied to the user.
Only the damage of the skill will be applied.
In addition, when the plugin command "Test apply skill effect" is executed, the user will not be able to see the effect of the skill before it can be applied.
This function allows you to check in advance whether the skill effect can be applied.
By using this function, it is possible, for example, to disable recovery items when HP is full.
For example, if the HP is full, the recovery item cannot be used.
■ Displaying Skill Names When Skills are Activated
A popup window will appear when a skill is activated by entering the following information in the notes field of the skill.
In this case, the text set in the "Message" field of the skill will be displayed.
<showSkillNam>e
■ Setting invincibility time when taking damage
The invincibility time when damaged by a skill can be set by populating the following in the Note field of the skill.
<noDamageFrame: invincibility time>
Example: To set the invincibility time to 60 frames
<noDamageFrame: 60>
If this setting is omitted, the invincibility time is 30 frames.
■ Setting a time limit after using a skill
You can set a time limit after using a skill by populating the following information in the Note field of the skill.
The following is a list of the time to prohibit attacks after a skill is used.
<noAttackFrame: Attack delay>
Example: To set the no-attack time to 120 frames
<noAttackFrame: 120>
If this setting is omitted, the no-attack time is set to 60 frames.
[Field Objects]
■ Field Objects
Field object is an object that is neither a player nor an enemy, but can be set to be hit by a player or an enemy. It can be grass that can be destroyed by a sword, a switch that turns ON when hit by an arrow, etc.
The hit detection of field objects can be set to "Custom".
Only "Custom Judgment" can be set for the hit judgment of field objects.
For details on custom judgments, please refer to "Setting the Judgment of Hit".
[related to collision detection]
■ collision detection settings
The "collision detection settings" plug-in command can be used to configure the hit detection settings.
The following types of collision detection are available
Attack detection: If this detection comes in contact with a "damage detection", damage will be inflicted to the user who set the damage detection.
Damage detection: If this detection contacts the "attack detection," the attacker is damaged.
Custom detection: This is a user-definable collision detection. The collision detection set here can be checked with the "collision detection check" plugin command.
Collision detection can be set for the following characters
If collision detection is set for other characters, an error will occur.
Player (all collision detection can be set)
Enemy (all collision detection can be set)
Field object (only custom detection can be set)
Skill object (only attack detection/custom detection can be set)
Player collision detection can be set using the "Player collision detection setting" plug-in parameter.
■ Collision detection check by plug-in commands
Damage processing according to the attack detection and damage detection is automatically performed by the plug-in.
However, the "collision detection check" plug-in command allows you to check for collision detection at any time.
The "collision detection check" plug-in command allows collision detection to be checked at any desired timing.
■ Collision detection visibility
If the switch which you specified for the plugin parameter "HitBoxSetting/switch ID for hit box visibility" is ON, the hit box will be visible.
[Other]
Setting up states to be resolved over time
In ARPGs, there may be many situations where you want to resolve states over time.
We have prepared a function for this purpose.
By populating the following in the state Note field, the state can be resolved at the specified number of frames elapsed.
The state can be resolved when the specified number of frames have elapsed.
<duration: number of frames>
For example, to resolve the state after 10 seconds, set as follows (1 second = 60 frames)
<duration: 60>
This setting alone will not update the number of frames remaining when states are stacked.
If you want to update the number of remaining frames by stacking states, you need to include the following information in the Note field.
<overWriteDuration: number of frames>
■ Skill settings for each weapon
It is possible to switch skills during a normal attack depending on the type of weapon.
The specified skill is executed by making the following entry in the Note field of the weapon.
<skill: skill name>
If you set up a two-fisted weapon, the skill will be executed twice.
■ Firing a transparent object
You can fire a transparent object to check whether the enemy is in front of you or not.
For example, it can be used to check if there is an enemy in front of you.
The collision target of the transparent object is the same as an event whose priority is set to Same as characters.
*Note
If there is already a character at the position where the transparent object is created, the transparent object will pass through the character and collide with the character.
the transparent object will pass through the character.
■ Target Selection Function
The "Target Selection" plug-in command allows the player or enemy to be selected by the cursor in the game.
This makes it possible, for example, to fire bullets at a selected enemy character.
If the weight is turned on, time can be stopped while the selection is being made, and if it is turned off, the selection can be made in real time.
When "Cancelable" is turned on, the target selection can be canceled when the cancel button is pressed during the target selection.
In this case, the result stored in the selection result storage switch is turned OFF.
■ CheckInTheScreen event
By executing the "CheckInTheScreen" plug-in parameter
The plugin parameter "CheckInTheScreen" can be used to determine if the specified character is on the screen.
[Appendix]
When you specify a character for plugin parameters/plugin commands, you can input a variable value;
■ Chracter type variable value
Player: 1
Follower: 2
Event: 3
Vehicle: 4
■ Follower index variable value
First: 1
Second: 2
Etc.
■ Vehicle variable value
Boat: 1
Ship: 2
Airship: 3
@command ChangeARPGMode
@text Toggle ARPG mode
@desc Enables/disables ARPG mode.
@arg ARPGMode
@text ARPG Mode
@type boolean
@default true
@desc Specify the ARPG mode to switch to.
@command MakeDynamicEvent
@text Create a dynamic object
@desc Generate a dynamic object.
@arg SrcMapId
@type number
@text Source map ID
@default 1
@desc Specify source map ID.
@arg SrcEventIdOrName
@type string
@text Source event ID or event name
@default 0
@desc Source event ID or event name
@arg X
@type number
@text X coordinate
@default 0
@desc Specify X coordinate to generate event.
@arg XByVariable
@type variable
@text X-coordinate (variable specification)
@default 0
@desc Specify the X coordinate to generate event by variable. If you set the X value directly, specify 0 for this parameter.
@arg Y
@type number
@text Y coordinate
@default 0
@desc Specify the Y coordinate to generate event.
@arg YByVariable
@type variable
@text Y-coordinate (specify variable)
@default 0
@desc Specify the Y coordinate to generate event by variable. If you set Y value directly, specify 0 for this parameter.
@arg MadeDynamicEventId
@text Variable for storing made dynamic event ID
@type variable
@default 0
@desc Specify the variable ID to store the generated dynamic event ID.
@command GetCharacterFloatPosition
@text Get character float position
@desc Get character float position.
@arg CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specifies the target character.
@arg LeftUpOrCenter
@text Upper Left or Center
@type select
@option Upper Left
@value leftup
@option Center
@value center
@default leftup
@desc Specify which to get, the character's upper left or center of the coordinate.
@arg StoreFloatXVariableId
@text Variable ID for storing decimal X coordinate
@type variable
@default 0
@desc Specify the variable ID to store the acquired decimal X coordinate.
@arg StoreFloatYVariableId
@text Variable ID to store decimal Y coordinate
@type variable
@default 0
@desc Specify variable ID to store acquired decimal Y coordinate.
@command CalcDeg
@text Obtain angle between characters
@desc Obtains the angle of the target character as seen from the main character.
@arg SubjectCharacterSpecification
@text Subject character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specify the main character.
@arg TargetCharacterSpecification
@text Target character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specify the target character.
@arg StoreDegreeVariableId
@text Angle storage variable ID
@type variable
@default 0
@desc Specify the variable ID to store the acquired angle.
@command CalcFar
@text Get distance between characters
@desc Obtains the distance between the main character and the target character.
@arg SubjectCharacterSpecification
@text Subject character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specifies the main character.
@arg TargetCharacterSpecification
@text Target character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specify the target character.
@arg StoreFarVariableId
@text Distance store variable ID
@type variable
@default 0
@desc Specify the variable ID to store the acquired distance.
@command CheckInTheScreen
@text Check if the character is in the screen
@desc Checks if the character is in the screen.
@arg CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specify the target character.
@arg XMargin
@text X-axis margin
@type number
@decimals 2
@default 2
@desc Specifies the off-screen margin width for the X-axis. The unit is the number of squares.
@arg YMargin
@text Y-axis margin
@type number
@decimals 2
@default 2
@desc Specifies the off-screen margin width for the X-axis. The unit is the number of squares.
@arg StoreResultSwitchId
@text Result store switch ID
@type switch
@default 1
@desc Specify the switch ID to set ON if the character is in the screen and OFF otherwise.
@command CheckMoved
@text Check if character is moved
@desc Checks if the character has moved within the frame.
@arg CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specify the target character.
@arg StoreResultSwitchId
@text Result store switch ID
@type switch
@default 1
@desc Specify the switch ID to set ON if moved, OFF otherwise.
@command TransparentObjectCast
@text Fires transparent object
@desc Fire a transparent object and check if it hits the object.
@arg TransparentObjectPosition
@type struct<TransparentObjectPosition>
@text Position specification
@desc Specify the position at which the transparent object is created.
@arg Degree
@text angle
@type number
@decimals 2
@default 0
@desc Specifies the launch angle of the transparent object.
@arg DegreeByVariable
@text angle (specify variable)
@type variable
@default 0
@desc Specify the launch angle of transparent object by variable.
@arg Far
@text distance
@type number
@decimals 2
@default 0
@desc Specifies the distance of the transparent object to be fired. 0 means infinite.
@arg FarByVariable
@text distance (variable specification)
@type variable
@default 0
@desc Specify the launch distance of the transparent object by variable.
@arg Width
@text width
@type number
@decimals 2
@default 1
@desc Specifies the width of the transparent object.
@arg Height
@text Height
@type number
@decimals 2
@default 1
@desc Specifies the height of the transparent object.
@arg CollisionResultSwitchId
@text Switch ID for storing collision results
@type switch
@default 1
@desc Specify the switch ID to set ON in case of collision and OFF otherwise.
@arg CollidedXVariableId
@text Collided X coordinate storage variable ID
@type variable
@default 0
@desc Specify the variable ID that stores the X coordinate of the point where the collision occurred.
@arg CollidedYVariableId
@text Variable ID for storing collided X-coordinates
@type variable
@default 0
@desc Specify the variable ID that stores the X coordinate of the point where the collision occurred.
@command SetupEnemy
@text Setup Enemy
@desc Setup the enemy for event.
@arg CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specify the target character.
@arg EnemyId
@text Enemy ID
@type enemy
@default 1
@desc Specify the enemy ID.
@arg CollideAttackSkillId
@text Collision Attack Skill ID
@type skill
@default 0
@desc
Specify the skill ID for damage calculation when the enemy collides with the actor.
@arg DamageCommonEventId
@text Enemy damage common event ID
@type common_event
@default 0
@desc
Specifies the common event to be executed when the enemy is damaged.
@arg DefeatEnemyCommonEventId
@text Defeat Enemy Common Event ID
@type common_event
@default 0
@desc
Specify the common event ID to be executed when an enemy is defeated.
@arg HpGauge
@text HP gauge
@type select
@option none
@value none
@option normal
@value normal
@option boss
@value boss
@default normal
@desc Sets the display of the HP gauge.
@command ChangeHpGaugeVisible
@text toggles the enemy HP gauge visibility
@desc Toggles the display/non-display of the HP gauge of the enemy.
@arg CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specify the target character.
@arg ShowOrHide
@text show/hide
@type boolean
@on Show
@off hide
@default true
@desc Select to show or hide.
@command SetupFieldObject
@text Setup FieldObject
@desc Setup field object for event.
@command UseSkill
@text Use Skill
@desc Use Skill
@arg SkillId
@type skill
@text Skill ID
@default 1
@desc Specify the ID of the skill to be used. If a name or variable is specified, it takes precedence.
@arg SkillByName
@type string
@text Skill (specify name)
@desc Specify the name of the skill to be used. If you do not use naming, leave it blank.
@arg SkillIdByVariable
@type variable
@text Skill ID (variable specification)
@default 0
@desc Specify the ID of the skill to be used by variable. If you do not use variable specification, set it to 0.
@command UseItem
@text UseItem
@desc Use item.
@arg ItemId
@type item
@text Item ID
@default 1
@desc Specify the ID of the item to be used. If a name or variable is specified, it takes precedence.
@arg ItemByName
@type string
@text Item (specify name)
@desc Specify the name of the item to be used. If you do not use the name specification, leave it blank.
@arg ItemIdByVariable
@type variable
@text Item ID (specify variable)
@default 0
@desc Specify the ID of the item to be used by variable. If you do not use variable specification, set it to 0.
@command SkillActivation
@text Skill Activation
@desc Activate a skill. This command must be invoked in the action common event of the skill.
@arg ChantCommonEventId
@type common_event
@text Chant Common Event ID
@default 0
@desc Specify the ID of the common event to perform the chanting process.
@command ChangeSkillCancelWhenDamageEnableOrDisable
@text Damage Skill Cancel Enable/Disable change
@desc Enables/disables skill cancellation due to damage. This command must be invoked within the skill's action common event.
@arg EnableOrDisable
@text Enable/Disable
@type boolean
@on Enable
@off Disable
@default true
@desc
Select enable or disable.
@command TestApplySkillEffect
@text Test apply skill effect
@desc Tests if a skill effect can be applied to the user and sets the result to a switch.
@arg IsSkillSpecification
@text IsSkillSpecification
@type boolean
@default false
@desc If ON is specified, the target skill is specified. If not specified, the activated skill is applied.
@arg SkillSpecification
@text SkillSpecification
@type struct<SkillSpecification>
@default {"SkillOrItem":"skill","SkillId":"1","SkillByName":"","SkillIdByVariable":"0","ItemId":"1","ItemByName":"","ItemIdByVariable":"0"}
@desc Specify the skill to be used when "On" is selected.
@arg StoreResultSwitchId
@text Result store switch ID
@type switch
@default 1
@desc Specify the switch ID to set ON if available, otherwise OFF.
@command ApplySkillEffect
@text apply skill effect
@desc Apply the skill effect to the user. This command must always be invoked after "Activate Skill" in the skill's action common event.
@arg IsSkillSpecification
@text IsSkillSpecification
@type boolean
@default false
@desc If ON is specified, the target skill is specified. If not specified, the activated skill is applied.
@arg SkillSpecification
@text Skill specification
@type struct<SkillSpecification>
@default {"SkillOrItem":"skill","SkillId":"1","SkillByName":"","SkillIdByVariable":"0","ItemId":"1","ItemByName":"","ItemIdByVariable":"0"}
@desc Specify the skills to be covered when "On" is set to "SkillIdByVariable" or "On" is set to "SkillIdByVariable".
@command MakeSkillObject
@text Create Skill Object
@desc Generate a skill object.
@arg SrcMapId
@type number
@text Source map ID
@default 1
@desc Specify the source map ID.
@arg SrcEventIdOrName
@text Source event ID or event name
@type string
@default 0
@desc Specify the source event ID or event name.
@arg SkillObjectPosition
@type struct<SkillObjectPosition>
@text Position specification
@desc Specify the position at which the skill object is generated.
@arg IsSkillSpecification
@text IsSkillSpecification
@type boolean
@default false
@desc If ON is specified, the target skill is specified. If not specified, the activated skill is applied.
@arg SkillSpecification
@text Skill specification
@type struct<SkillSpecification>
@default {"SkillOrItem":"skill","SkillId":"1","SkillByName":"","SkillIdByVariable":"0","ItemId":"1","ItemByName":"","ItemIdByVariable":"0"}
@desc Specify the skills to be covered when "On" is set to "SkillIdByVariable" or "On" is set to "SkillIdByVariable".
@arg MadeDynamicEventId
@text Variable for storing made dynamic event ID
@type variable
@default 0
@desc Specify the variable ID to store the generated dynamic event ID.
@command SetAttackDegree
@text Specify attack angle
@desc Specify the attack angle of the skill object.
@arg CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specifies the target character.
@arg AttackDegree
@type number
@text Attack angle
@default 0
@desc Set the attack angle.
@arg AttackDegreeByVariable
@type variable
@text Attack angle (specified by variable)
@default 0
@desc Set the attack angle by variable.
@command SetHitBox
@text SetHitBox
@desc Set the hitbox setting. If the hitbox is set again for the same type, the existing setting is overwritten.
@arg CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specify the target character.
@arg HitBoxType
@text HitBoxType
@type select
@option attack
@value attack
@option damage
@value damage
@option custom
@value custom
@default attack
@desc Set the hitbox type.
@arg CustomHitBoxTag
@text custom hit box tag
@type string
@desc Specify tag for custom hitbox type.
@arg HitBoxList
@type struct<Box>[]
@text HitBoxList
@default []
@desc Set the hit box.
@command ChangeHitBoxEnableOrDisable
@text Change hitbox enable/disable
@desc Enables or disables the hitbox.
@arg CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specify the target character.
@arg HitBoxType
@text HitBoxType
@type select
@option attack
@value attack
@option damage
@value damage
@option custom
@value custom
@default attack
@desc Set the hitbox type.
@arg CustomHitBoxTag
@text custom hit box tag
@type string
@desc Specifies the tag for a custom hitbox type.
@arg Enabled
@text Enabled
@type boolean
@desc If set to true, enable the hitbox.
@command HitCheck
@text Hit check
@desc Perform hit check by hitbox.
@arg SubjectCharacterSpecification
@text Subject character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specifies the main character.
@arg SubjectHitBoxType
@text subject hit box type
@type select
@option attack
@value attack
@option damage
@value damage
@option custom
@value custom
@default attack
@desc Set the hitbox type.
@arg SubjectCustomHitBoxTag
@text subject custom hit box tag
@type string
@desc Sets the custom hitbox tag.
@arg IsTargetSpecification
@text IsTargetSpecification
@type boolean
@default false
@desc Specify the event to be targeted if ON is specified.
@arg TargetCharacterSpecification
@text Target character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specifies the target character when "Target" is ON.
@arg TargetHitBoxType
@text Target hit box type
@type select
@option attack
@value attack
@option damage
@value damage
@option custom
@value custom
@default attack
@desc Set the hitbox type.
@arg TargetCustomHitBoxTag
@text Target custom hit box tag
@type string
@desc Set custom hitbox tag.
@arg StoreResultSwitchId
@text Result store switch ID
@type switch
@default 1
@desc Specify the switch ID to set ON if there was a hit and OFF otherwise.
@command GetBattlerStatus
@text GetBattlerStatus
@desc Get the status of the specified battler.
@arg CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specifies the target character.
@arg StatusType
@type select
@option mhp
@option mmp
@option hp
@option mp
@option tp
@option atk
@option mat
@option mdf
@option agi
@option luk
@option hit
@option eva
@option cri
@option cev
@option mev
@option mrf
@option cnt
@option hrg
@option mrg
@option trg
@option tgr
@option grd
@option rec
@option pha
@option mcr
@option tcr
@option pdr
@option mdr
@option fdr
@option exr
@text status type
@default mhp
@desc Specifies the status type.
@arg DestVariableId
@type variable
@text Destination Variable
@default 1
@desc Specify the destination variable for the acquired status value.
@command SetBattlerStatus
@text SetBattlerStatus
@desc Set the status of the specified battler.
@arg CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specify the target character.
@arg StatusType
@type select
@option hp
@option mp
@option tp
@text StatusType
@default mhp
@desc Specifies the status type.
@arg Value
@type number
@text Value
@default 0
@desc Specifies the status value to be set.
@arg ValueByVariable
@type variable
@text value (specify variable)
@default 0
@desc Specify the variable ID in which the status value to be set is stored.
@command GetBattlerARPGParameter
@text GetBattlerARPGParameter
@desc Get the ARPG-specific parameters for the specified battler.
@arg CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specifies the target character.
@arg ARPGParameterType
@type select
@option skill cancel damage rate
@value skillCancelDamageRate
@option Just guard frame
@value justGuardFrame
@text ARPGParameterType
@default skillCancelDamageRate
@desc Specify ARPG parameter type.
@arg DestVariableId
@type variable
@text Destination Variable
@default 1
@desc Specify destination variable for acquired status value.
@command SetBattlerARPGParameter
@text SetBattlerARPGParameter
@desc Set the ARPG only parameter of the specified battler.
@arg CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specify the target character.
@arg ARPGParameterType
@type select
@option skill cancel damage rate
@value skillCancelDamageRate
@option Just guard frame
@value justGuardFrame
@text ARPGParameterType
@default skillCancelDamageRate
@desc Specify ARPG parameter type.
@arg Value
@type number
@text Value
@default 0
@decimals 2
@desc Specifies the status value to be set.
@arg ValueByVariable
@type variable
@text value (specify variable)
@default 0
@desc Specify the variable ID where the status value to be set is stored.
@command GetBattlerARPGFlag
@text Get battler ARPG flag
@desc Get the ARPG only flag of the specified battler.
@arg CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc Specify the target character.
@arg ARPGFlagType
@type select
@option No damage flag
@value noDamageFlag
@option No attack flag
@value noAttackFlag
@text ARPG flag type
@default noDamageFlag
@desc Specify the ARPG flag type.
@arg DestSwitchId
@type switch
@text Destination switch
@default 1
@desc Specifies the switch to which the retrieved flag values are to be stored.
@command SetBattlerARPGFlag
@text Set battler ARPG flag
@desc Sets the ARPG-only flag for the specified battler.
@arg CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc Specify the target character.
@arg ARPGFlagType
@type select
@option No damage flag
@value noDamageFlag
@option No attack flag
@value noAttackFlag
@text ARPG flag type
@default noDamageFlag
@desc Specify the ARPG flag type.
@arg Value
@type boolean
@text Value
@default true
@desc Specify the flag value to be set.
@arg ValueBySwitch
@type switch
@text Value(by switch)
@default 0
@desc Specifies the switch ID where the flag value to be set is stored.
@command SetCheckMapValid
@text Toggle map valid range check valid/invalid
@desc Toggle enable/disable of map valid range check.
@arg CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc
Specify the target character.
@arg EnableOrDisable
@text enable/disable
@type boolean
@on Enable
@off Disable
@default true
@desc
Select enable or disable.
@command CharacterBlowAway
@text Character Blow Away
@desc Blow away a character in the specified direction.
@arg CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specify the target character.
@arg Degree
@text angle
@type number
@default 0
@desc Specifies the angle at which the character will be blown away.
@arg DegreeByVariable
@text angle (specify variable)
@type variable
@default 0
@desc Specify the angle to blow off by variable.
@arg InitialVelocity
@text InitialVelocity
@type number
@decimals 2
@default 0.5
@desc Specify the initial velocity to blow off.
@arg InitialVelocityByVariable
@text Initial velocity (specify variable)
@type variable
@default 0
@desc Specify initial velocity to blow off by variable.
@arg Duration
@text Duration
@type number
@decimals 2
@default 10
@desc Specifies the interval between blasts.
@arg DurationByVariable
@text interval (variable specification)
@type variable
@default 0
@desc Specify the interval between blasts by variable.
@command TargetSelect
@text TargetSelect
@desc Target selection.
@arg SelectResultSwitchId
@text Switch ID to store selection result
@type switch
@default 0
@desc
Specify the switch ID that is set to ON if the target is successfully selected.
@arg SelectedTargetCharacterKindVariableId
@text Variable ID for selected target character type
@type variable
@default 0
@desc
Specify a variable ID which stores the character type of the selected target.
@arg SelectedTargetEventIdVariableId
@text Variable ID for selected target event ID
@type variable
@default 0
@desc
Specify a variable ID which stores the event ID of the target.
@arg Wait
@text wait
@type boolean
@default true
@desc
If set to ON, scene will be stopped while target is selected.
@arg Cancelable
@text Cancelable
@type boolean
@default true
@desc
If set to ON, enables cancellation of target selection.
@command SearchNearBattler
@text Search for nearby battlers
@desc Search for the nearest battler from the target.
@arg Target
@text Target
@type select
@option all battlers
@value all
@option enemy character
@value opponent
@option friend
@value friend
@default all
@desc Specify the target.
@arg SubjectCharacterSpecification
@text Subject character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specifies the main character.
@arg StoreResultSwitchId
@text StoreResultSwitchId
@type switch
@default 1
@desc Specify the switch ID to set ON if an enemy character is found and OFF otherwise.
@arg StoreCharacterKindVariableId
@text Variable ID for storing character type
@type variable
@default 0
@desc Specify the variable ID to store the character type of the found battler.
@arg StoreEventIdVariableId
@text Variable ID to store event ID
@type variable
@default 0
@desc Specify the variable ID to store the event ID if the found battler is an event.
@command SetPlayerGuardMode
@text Player guard mode setting
@desc Sets the player's guard mode.
@arg GuardMode
@text Guard nide
@type boolean
@default true
@desc
Specifies guard mode ON or OFF.
@command ShowMessagePopup
@text Show message popup
@desc Show message popup
@arg Text
@text text
@type string
@desc
Specify the text to display in the popup.
@arg Time
@text time
@type number
@default 60
@desc
Specify the display time of the popup.
@param CopyEventSetting
@text Copy event common setting
@type struct<CopyEventSetting>
@default {"CopyEventTag":"cp","DynamicEventSrcMapIds":"[]"}
@desc
Copy event common setting.
@param BattlerSetting
@text Battler common setting
@type struct<BattlerSetting>
@default {"DamageDegCommonVariableId":"0","UserKindCommonVariableId":"0","UserEventIdCommonVariableId":"0","DamageKindCommonVariableId":"0","DamageTypeCommonVariableId":"0","DamageValueCommonVariableId":"0"}
@desc
Common setting for battler.
@param ActorSetting
@text Actor common setting
@type struct<ActorSetting>
@default {"NormalAttackSkillId":"0","DamageCommonEventId":"0","NormalGuardCommonEventId":"0","JustGuardCommonEventId":"0","StartGuardCommonEventId":"0","EndGuardCommonEventId":"0","JustGuardFrame":"10","ActorHitBox":"{\"AttackHitBoxList\":\"[]\",\"DamageHitBoxList\":\"[]\"}","GameOverCommonEventId":"0","LevelUpCommonEventId":"0"}
@desc
Common setting of Actor.
@param EnemySetting
@text Enemy common setting
@type struct<EnemySetting>
@default {"CollideAttackSkillId":"0","DamageCommonEventId":"0","DefeatEnemyCommonEventId":"0"}
@desc
Enemy common setting.
@param SkillObjectSetting
@text Skill object common setting
@type struct<SkillObjectSetting>
@default {"SkillObjectUserKindSelfVariableId":"0","SkillObjectUserEventIdSelfVariableId":"0","CollisionDetectExSelfSwitchId":"0"}
@desc
Configure common settings for skill objects.
@param HitBoxSetting
@text Hit box common setting
@type struct<HitBoxSetting>
@default {"VisibleHitAreaSwitchId":"0","AttackHitBoxColor":"#ff0000aa","DamageHitBoxColor":"#0000ffaa","CustomHitBoxDefaultColor":"#00ff00aa","CustomHitBoxColorList":"[]"}
@desc
Perform common setting of hitbox.
@param EnemyHpGaugeSetting
@text Enemy HP Gauge Setting
@type struct<EnemyHpGaugeSetting>
@default {"NormalEnemyHpGaugeColor1":"#00aa00","NormalEnemyHpGaugeColor2":"#22ff22","BossEnemyHpGaugeLabel":"BOSS","BossEnemyHpGaugeColor1":"#00aa00","BossEnemyHpGaugeColor2":"#22ff22"}
@desc
Enemy HP gauge setting.
@param KeySetting
@text Key setting
@type struct<KeySetting>
@default {"ActorNormalAttack":"{\"KeyName\":\"ok\",\"KeySymbol\":\"\",\"KeyCode\":\"0\",\"ButtonIndex\":\"-1\"}","ActorGuard":"{\"KeyName\":\"other\",\"KeySymbol\":\"A\",\"KeyCode\":\"65\",\"ButtonIndex\":\"6\"}","VisibleHitBox":"{\"KeyName\":\"other\",\"KeySymbol\":\"F6\",\"KeyCode\":\"117\",\"ButtonIndex\":\"-1\"}"}
@desc
Configure various settings for key input.
@param EnableARPGSwitchId
@text ARPG enable switch ID
@type switch
@default 0
@desc
Specify the switch ID to enable ARPG.
@param UseDamagePopup
@text Use damage popup
@type boolean
@default true
@desc
If true is set, the damage value will be displayed when the damage caused by the attack occurs.
@param UseImageDamage
@text Use Damage Image
@type boolean
@default false
@desc
If set to true, the image in system/Damage.png will be used for damage display.
@param UseImageTargetSelectCursor
@text Use target select cursor image
@type boolean
@default false
@desc
If set to true, use image as target select cursor.
@param TargetSelectCursorImageFileName
@text Target select cursor image file name
@type file
@dir img
@desc
Specify the target selection cursor image file name.
@param ErrorMessageLanguage
@text Error message language
@type select
@option english
@value en
@option Japanese
@value ja
@default en
@desc
Specifies the display language of error messages.
*/
/*!/*~struct~CopyEventSetting:
@param CopyEventTag
@text CopyEventTag
@type string
@default cp
@desc
Specify the tag name to determine the event to be copied.
@param DynamicEventSrcMapIds
@text List of map IDs from which dynamic events are generated
@type number[]
@default []
@desc
Set the list of map IDs from which dynamic events are generated.
*/
/*!/*~struct~BattlerSetting:
@param DamageDegCommonVariableId
@text Common variable for storing damage angle
@type variable
@default 0
@desc
Specify a common variable to store the angle of damage.
@param UserKindCommonVariableId
@text Common event variable to store user type
@type variable
@default 0
@desc
Specify a variable to store the user type (1: player, 3: event) when an action common event is executed by the battler.
@param UserEventIdCommonVariableId
@text Common event variable to store user event ID
@type variable
@default 0
@desc
Specify a variable to store the event ID when an action common event is executed in battler.
@param DamageKindCommonVariableId
@text Damage Kind Common Variable ID
@type variable
@default 0
@desc
Specify the common variable to which the damage type is set when damage is received.
@param DamageTypeCommonVariableId
@text Damage type common variable ID
@type variable
@default 0
@desc
Specify the common variable to which the damage type is set when damage is taken.
@param DamageValueCommonVariableId
@text DamageValueCommonVariableID
@type variable
@default 0
@desc
Specifies the common variable to which the damage value is set when damage is received.
*/
/*!/*~struct~ActorSetting:
@param NormalAttackSkillId
@text Normal attack skill ID
@type skill
@default 0
@desc
Specify the skill ID for normal attacks.
@param DamageCommonEventId
@text Actor damage common event ID
@type common_event
@default 0
@desc
Specifies the common event to be executed when an actor is damaged.
@param NormalGuardCommonEventId
@text actor normal guard common event ID
@type common_event
@default 0
@desc
Specify the common event to be executed when the actor is normally guarded.
@param JustGuardCommonEventId
@text Actor JustGuard Common Event ID
@type common_event
@default 0
@desc
Specify the common event to be executed when the actor just guards.
@param StartGuardCommonEventId
@text Actor guard start common event ID
@type common_event
@default 0
@desc
Specifies the common event to be executed when the actor starts guarding.
@param EndGuardCommonEventId
@text Actor Guard End Common Event ID
@type common_event
@default 0
@desc
Specify the common event to be executed when the actor finishes guarding.
@param JustGuardFrame
@text JustGuardFrame
@type number
@default 10
@desc
Specify the number of just-guarded frames allowed.
@param ActorHitBox
@text Actor Hit Box
@type struct<ActorHitBox>
@default {"AttackHitBoxList":"[]","DamageHitBoxList":"[]"}
@desc Specify the actor hit box setting.
@param GameOverCommonEventId
@text GameOver Common Event ID
@type common_event
@default 0
@desc
Specify the common event ID to be executed when the game is over. 0 specifies that the game is moved to the game over scene.
@param LevelUpCommonEventId
@text LevelUpCommonEventID
@type common_event
@default 0
@desc
Specify the common event to be executed when the level is raised.
*/
/*!/*~struct~EnemySetting:
@param CollideAttackSkillId
@text Collision Attack Skill ID
@type skill
@default 0
@desc
Specify the skill ID for damage calculation when the enemy collides with the actor.
@param DamageCommonEventId
@text Enemy Damage Common Event ID
@type common_event
@default 0
@desc
Specify the common event to be executed when the enemy is damaged.
@param DefeatEnemyCommonEventId
@text Enemy Defeat Common Event ID
@type common_event
@default 0
@desc
Specify the common event ID to be executed when an enemy is defeated.
*/
/*!/*~struct~SkillObjectSetting:
@param SkillObjectUserKindSelfVariableId
@text SkillObjectUserKindSelfVariable
@type variable
@default 0
@desc
Specify the self-variable to store the type of the user who created the skill object.
@param SkillObjectUserEventIdSelfVariableId
@text Self variable to store skill object user event ID
@type variable
@default 0
@desc
Specify the self variable to store the event ID when the type of the user who generated the skill object is an event.
@param CollisionDetectExSelfSwitchId
@text Ex-self switch ID for collision detect
@type switch
@default 0
@desc
Specify an ex-self switch ID which will turn ON when the skill object collides the target.
*/
/*!/*~struct~HitBoxSetting:
@param VisibleHitAreaSwitchId
@text switch ID for hit box visibility
@type switch
@default 0
@desc
Specify the switch ID to switch whether the hit box is visible or not.
@param AttackHitBoxColor
@text Attack Hit Box Color
@type string
@default #ff0000aa
@desc
Specify the color of the attack judgment when the hit box is made visible.
@param DamageHitBoxColor
@text Damage Hit Box Color
@type string
@default #0000ffaa
@desc
Specify the color of the damage judgment when the hit box is made visible.
@param CustomHitBoxDefaultColor
@text Custom Hit Box Default Color
@type string
@default #00ff00aa
@desc
Specifies the default color of the custom hitbox when the hitbox is made visible.
@param CustomHitBoxColorList
@text custom hit box color list
@type string<CustomHitBoxColor>
@default []
@desc
Specify the custom hit box color list for hit box visualization.
*/
/*!/*~struct~EnemyHpGaugeSetting:
@param NormalEnemyHpGaugeColor1
@text Normal Enemy HP Gauge Color 1
@type string
@default #00aa00
@desc Set Normal Enemy HP gauge color 1.
@param NormalEnemyHpGaugeColor2
@text Normal Enemy HP gauge color 2
@type string
@default #22ff22
@desc Set Normal Enemy HP gauge color 1.
@param BossEnemyHpGaugeLabel
@text Boss Enemy HP Gauge Label
@type string
@default BOSS
@desc Sets the text to be displayed next to the Boss Enemy HP gauge.
@param BossEnemyHpGaugeColor1
@text Boss Enemy HP Gauge Color1
@type string
@default #00aa00
@desc Set the color of boss enemy HP gauge 1.
@param BossEnemyHpGaugeColor2
@text Boss Enemy HP Gauge Color 2
@type string
@default #22ff22
@desc Set Boss Enemy HP gauge color 1.
*/
/*!/*~struct~KeySetting:
@param ActorNormalAttack
@text Actor normal attack key
@type struct<Key>
@default {"KeyName": "ok", "KeySymbol":"", "KeyCode": "0", "ButtonIndex":"-1"}
@desc
Specify the key for the actor's normal attack.
@param ActorGuard
@text Actor guard key
@type struct<Key>
@default {"KeyName": "other", "KeySymbol": "A", "KeyCode": "65", "ButtonIndex": "6"}
@desc
Specify the key for the actor to guard.
@param VisibleHitBox
@text Hitbox visualization toggle key
@type struct<Key>
@default {"KeyName":"other","KeySymbol":"F6","KeyCode":"117","ButtonIndex":"-1"}
@desc
Specifies the key that toggles the hitbox visualization on/off.
*/
/*!/*~struct~Key:
@param KeyName
@text KeyName
@type select
@option decision
@value ok
@option cancel
@value escape
@option shift
@value shift
@option down
@value down
@option left
@value left
@option right
@value right
@option up
@value up
@option page up
@value pageup
@option page down
@value pagedown
@option other
@value other
@option unassigned
@value unassigned
@default ok
@desc
Specify the key.
@param KeySymbol
@text key symbol
@type string
@desc
Specify the key symbol when the key is selected as other. Leave blank if not used.
@param KeyCode
@text key code
@type number
@min -1
@default -1
@desc
Specify the key code when the key is selected as other. Specify -1 if keyboard is not used.
@param ButtonIndex
@text ButtonIndex
@type number
@min -1
@default -1
@desc
Specify the index of the button when the key is selected as other. Specify -1 if gamepad is not used.
*/
/*!/*~struct~Box:
@param X
@text X coordinate
@type number
@min -9999
@decimals 2
@default 0
@desc
Specify X coordinate.
@param Y
@text Y coordinate
@type number
@min -9999
@decimals 2
@default 0
@desc
Specify Y coordinate.
@param Width
@text width
@type number
@min 0
@decimals 2
@default 1
@desc
Specify the width.
@param Height
@text height
@type number
@min 0
@decimals 2
@default 1
@desc
Specify the height.
*/
/*!/*~struct~CustomHitBoxColor:
@param CustomHitBoxTag
@text custom hit box tag
@type string
@desc Specify the tag for the custom hit box.
@param Color
@text Color
@type string
@default #00ff00aa
@desc
Specifies the color of the custom hitbox when the hitbox is made visible.
*/
/*!/*~struct~SkillObjectPosition:
@param Specification
@text Position specification
@type select
@option current coordinate
@value current
@option forward coordinate
@value forward
@option character coordinates
@value character
@option custom coordinates
@value custom
@default current
@desc
Select the position specification method.
@param CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specifies the target character when the character coordinates are selected by position specification.
@param CustomPosition
@text custom coordinates
@type struct<Position>
@desc
Specify the generated coordinates when custom coordinates are selected for position specification.
*/
/*!/*~struct~TransparentObjectPosition:
@param Specification
@text Position specification
@type select
@option character coordinate
@value character
@option custom coordinates
@value custom
@default current
@desc
Select the position specification method.
@param CharacterSpecification
@text Character specification
@type struct<CharacterSpecification>
@default {"CharacterKind": "thisEvent", "EventIdOrName": "1", "EventIdByVariable": "0", "FollowerIndex": "1", "VehicleKind": "boat"}
@desc Specifies the target character when the character coordinates are selected by position specification.
@param CustomPosition
@text custom coordinates
@type struct<Position>
@desc
Specify the generated coordinates when custom coordinates are selected by position specification.
*/
/*!/*~struct~Position:
@param X
@type number
@text X coordinate
@default 0
@desc Specify X coordinate to generate event.
@param XByVariable
@type variable
@text X-coordinate (specify variable)
@default 0
@desc Specify the X coordinate to generate event by variable. If you set the value directly, specify 0 for this parameter.
@param Y
@type number
@text Y coordinate
@default 0
@desc Specify Y coordinate to generate event.
@param YByVariable
@type variable
@text Y-coordinate (specify variable)
@default 0
@desc Specify the Y coordinate to generate event by variable. If a direct value is set, specify 0 for this parameter.
*/
/*!/*~struct~ActorHitBox:
@param AttackHitBoxList
@type struct<Box>[]
@text Attack judgment hit box list
@default []
@desc Set the attack judgment hit box.
@param DamageHitBoxList
@type struct<Box>[]
@text Damage judgment hit box list
@default []
@desc Set the damage judgment hit box.
*/
/*!/*~struct~SE:
@param FileName
@text SE file name
@type file
@dir audio/se
@desc
Specify the SE file name to be played.
@param Volume
@text SE volume
@type number
@default 90
@desc
Specify the volume of SE to be played.
@param Pitch
@text SE pitch
@type number
@default 100
@desc
Specify the pitch of the SE to be played.
@param Pan
@text SE phase
@type number
@default 0
@desc
Specify the pan of SE to be played.
*/
/*!/*~struct~CharacterSpecification:
@param CharacterKind
@text Character Kind
@type select
@option thisEvent
@value thisEvent
@option player
@value player
@option follower
@value follower
@option event
@option event
@option vehicle
@value vehicle
@default thisEvent
@desc
Specify the character type.
@param CharacterKindByVariable
@text Character type (variable specification)
@type variable
@default 0
@desc
Specify character type by variable.
@param EventIdOrName
@text event ID or event name
@type string
@default 1
@desc
Specify the event ID or event name when an event is specified for the character type.
@param EventIdByVariable
@text event ID (variable specification)
@type variable
@default 0
@desc
Specify the event ID as a variable when an event is specified for the character type.
@param FollowerIndex
@text follower index
@type number
@min 1
@default 1
@desc
Specify the order of target followers when follower is specified as the character type.
@param FollowerIndexByVariable
@text follower index (specify variable)
@type variable
@default 0
@desc
Specify the order of target followers by variable when follower is specified for character type.
@param VehicleKind
@text Vehicle type
@type select
@option small boat
@value boat
@option large ship
@value ship
@option airship
@value airship
@default boat
@desc
Specifies the target vehicle when a vehicle is specified for the character type.
@param VehicleKindByVariable
@text Vehicle type (specify variable)
@type variable
@default 0
@desc
Specify the target vehicle by variable when a vehicle is specified for the character type.
*/
/*!/*~struct~SkillSpecification:
@param SkillOrItem
@text skill or item
@type select
@option skill
@value skill
@option item
@value item
@default skill
@desc Select whether to specify a skill or an item.
@param SkillId
@type skill
@text Skill ID
@default 1
@desc Specify the ID of the skill to be used. If a name or variable is specified, it takes precedence.
@param SkillByName
@type string
@text Skill (specify name)
@desc Specify the name of the skill to be used. If you do not use the name specification, leave it blank.
@param SkillIdByVariable
@type variable
@text Skill ID (specify variable)
@default 0
@desc Specify the ID of the skill to be used by variable. If you do not use variable specification, set it to 0.
@param ItemId
@type item
@text Item ID
@default 1
@desc Specifies the ID of the item to be used. If a name or variable is specified, it takes precedence.
@param ItemByName
@type string
@text Item (specify name)
@desc Specify the name of the item to be used. Leave blank if you do not use naming.
@param ItemIdByVariable
@type variable
@text Item ID (variable specification)
@default 0
@desc Specify the ID of the item to be used by variable. If you do not use variable specification, set it to 0.
*/
/*!/*:ja
@target MZ
@plugindesc ARPGコア v1.1.0
@author うなぎおおとろ
@help
【概要】
本プラグインはツクールMZのシステムをARPGに変換する機能を提供します。
■ 特徴
本プラグインはアクションRPGに必要なプレイヤーやエネミーのステータス管理、
当たり判定の設定、攻撃処理の設定といった機能を提供します。
ダメージを与えるオブジェクト(剣による斬撃や弾の発射など)は全てイベントを動的に設定することで
実現します。このため、非常にカスタマイズ性の高いプラグインになっています。
また、ダメージを受けた場合の処理などもコモンイベントによって作成することが可能です。
例えば、サンプルゲームではダメージを受けた場合、キャラクターがダメージを受けた方向にノックバックしますが、
これはコモンイベントからキャラクター吹き飛ばし用のプラグインコマンドを実行することで実現しています。
この機能を活用すれば、例えば連続して攻撃を当てた場合のみ吹き飛ばすといったコンボ的なシステムを導入することも可能です。
また、本プラグインではドット移動プラグインの上に構築していますので、あらゆるキャラクターの移動を
ドット単位で制御でき、非常にアクション性の高いゲームを作ることが可能です。
例えば敵キャラとプレイヤーの角度を計算し、その方向に向けて弾を飛ばすことで、
プレイヤーを追撃する攻撃なども実現できます。
■ 依存プラグイン
本プラグインの導入に当たっては以下のプラグインを必須とします。
・ドット移動システム(DotMoveSystem.js)
キャラクターをドット単位で制御するために使用します。
・ドット移動機能拡張プラグイン(DotMoveSystem_FunctionEx.js)
ドット移動システム本体に様々な拡張機能を追加するプラグインです。
・セルフ変数プラグイン(SelfVariable.js)
セルフ変数や拡張セルフスイッチ、コモンイベント変数/スイッチを提供するプラグインです。
ARPGコアでは様々なゲーム中でのフラグを自動的にセルフ変数として
イベントに設定することがありますので(スキルを使用したユーザーのIDなど)、
そのために使用します。
これらの依存プラグインを含めた本プラグインの導入順については以下のように導入してください。
・DotMoveSystem.js
・DotMoveSystem_FunctionEx.js
・SelfVariable.js
・ARPG_Core.js
【機能詳細】
[全般]
■ ARPGモードの開始と終了
プラグインコマンドの「ARPGモード切り替え」でONを設定するとARPGモードを開始します。
OFFにした場合はARPGモードを終了します。
ARPGモードになるとフィールドでの敵との戦闘が可能になります。
現在のARPGモードがONであるかはプラグインパラメータ「ARPGモードスイッチ」で
設定したスイッチによって確認することができます。
※注意1: マップを移動した場合、ARPGモードは自動的にOFFに切り替わります。
※注意2: ARPGモードスイッチを変更しても効果はありません。ARPGモードの切り替えは
必ずこのコマンドによって行う必要があります。
※注意3: ARPG戦闘中はセーブを行うことができません。
[コピーイベント/動的イベント関連]
■ イベントのコピー
イベントのメモ欄に以下のように記述すると、プラグインパラメータで指定した
動的イベントコピー元マップの一覧から指定したイベントをコピーします。
<cp: コピー元イベント名前またはイベントID>
また、以下のように記述することでコピー元のマップを限定することも可能です。
<cp: コピー元マップID,コピー元イベント名前またはイベントID>
※注意: コピー元となるマップのIDについては全てプラグインパラメータ
「コピーイベント共通設定/動的イベント生成元マップID一覧」に設定する必要があります。
■ 動的イベントの生成
プラグインコマンド「動的イベント生成」を実行することで動的にイベントを生成することができます。
動的イベントのコピー元となるイベントはプラグインパラメータ「動的イベント生成元マップID一覧」に
登録されたマップに配置する必要があります。
■ 動的イベントの削除
生成した動的イベントはイベントコマンド「イベントの一時消去」を
実行することで完全に消去されます。
[アクター関連]
■ ガードについて
ARPG戦闘中にAキーを押している間、プレイヤーはガードを行います。
ガード中にプレイヤーの向きと反対方向から攻撃を受けた場合、ガード中であればダメージを半減します。
また、攻撃をガードする直前でガードした場合はジャストガードとなり、ダメージを完全に無力化します。
ガード成功判定に使用する攻撃の方向については「スキルオブジェクトの攻撃角度」を参照してください。
ガード機能を使用しない場合、プラグインパラメータ「キー共通設定/アクターガードキー」の
キー名を「未割り当て」に設定してください。
また、ガード機能は使用するがジャストガードを使用しない場合、
ジャストガードのフレーム数に0を設定してください。
[エネミー関連]
■ 敵キャラの設定について
敵キャラのイベント内において、並列処理、または自動実行によって
プラグインコマンド「エネミー設定」を実行することで、それを実行したイベントは
敵キャラとして扱われます。
なお、「エネミー設定」は必ずARPGモードがONの場合に実行してください。
敵キャラ設定時に引数で「衝突攻撃スキルID」「敵撃破コモンイベントID」
「エネミーダメージコモンイベントID」を設定することができますが、
これらの値に0を指定した場合、プラグインパラメータ「エネミー共通設定」
にある同一名のパラメータの値が適用されます。
■ 敵キャラのHP表示
プラグインコマンド「エネミー設定」で「HPゲージ」を設定することで、敵キャラのHPを表示することが可能です。
"ノーマル"を設定した場合、敵キャラに直接HPゲージを表示します。
"ボス"を設定した場合、画面上部に大きなHPゲージを表示します。
[スキル関連]
■ スキルの作成
スキルのメモ欄に<action: コモンイベント名またはID>と記載すると、
そのスキルを実行したときに該当のコモンイベントが呼び出されます。
このコモンイベントのことを「アクションコモンイベント」といいます。
アクションコモンイベント内では、プラグインコマンド「スキル発動」を実行することで、
スキルを発動し、MPあるいはTPの消費が行われます。
この状態で、「スキルオブジェクト生成」を行うことで、スキルオブジェクトが生成されます。
スキルオブジェクトとは、バトラーに当たるとダメージを与えたりHPを回復させたりなど
スキルの効果をバトラーに与えることができるイベントのことです。
シューティングゲームでプレイヤーや敵キャラが発射した弾がスキルオブジェクトと考えると
イメージがつきやすいかと思います。
スキルオブジェクトがバトラーに衝突した場合、スキルで設定した効果が衝突したバトラーに適用されます。
なお、スキルオブジェクトの当たり判定についてはデフォルトではスキルオブジェクトとした
イベントのサイズがそのまま当たり判定となりますが、以下の「■ 当たり判定の設定」
の手順によって自由に当たり判定をカスタマイズすることが可能です。
「スキル発動」を実行しなかった場合、MP/TPの消費は行われません。これを利用して
スキルアクションのコモンイベント実行時にスキル発動条件が成立(例えば近くに敵キャラがいるか等)しなかった場合は
スキルを実行しないといったようなことも実現可能です。
※注意: スキル発動を行わずにスキルオブジェクト生成を行うことはできません。行った場合はエラーが表示されます。
■ アクションコモンイベント内で使用可能なコモンイベント変数
スキル使用時に実行されるコモンイベントでは「ユーザー種別格納コモンイベント変数」と
「ユーザーイベントID格納コモンイベント変数」を使用することができます。
ユーザー種別格納コモンイベント変数にはアクションコモンイベントを実行したユーザーとなる
キャラクターの種別が自動的に格納されます。
ユーザーイベントID格納コモンイベント変数にはアクションコモンイベントを実行したユーザーとなる
キャラクターがイベントだった場合にイベントIDが自動的に格納されます。
この2つを組み合わせることで各種プラグインコマンドのキャラクター指定引数にて
スキルを使用したキャラクターを指定することができるようになります。
※ これらの変数は必ずコモンイベント変数としてください。
■ スキルオブジェクトとして生成したイベント内で使用可能なセルフ変数
プラグインコマンド「スキルオブジェクト生成」によって生成されたイベントでは
セルフ変数「スキルオブジェクトユーザー種別格納セルフ変数」と
「スキルオブジェクトユーザーイベントID格納セルフ変数」を使用することができます。
スキルオブジェクトユーザー種別格納セルフ変数にはスキルオブジェクト生成を実行した
ユーザーとなるキャラクターの種別が格納されます。
スキルオブジェクトユーザーイベントID格納セルフ変数にはスキルオブジェクト生成を実行した
ユーザーとなるキャラクターがイベントだった場合にイベントIDが格納されます。
※ これらの変数は必ずセルフイベント変数としてください。
■ ダメージを受けた時に使用中のスキルをキャンセルする
プラグインコマンド「ダメージスキルキャンセル有効/無効切り替え」を有効に設定すると、
ダメージを受けた時にスキルがキャンセルされ、スキルコモンイベントを強制終了します。
また、プラグインコマンド「スキル発動」で詠唱コモンイベントIDを指定すると、
スキル発動までそのコモンイベントを実行し、その間はダメージによるスキルキャンセルが有効になります。
「ダメージスキルキャンセル有効/無効切り替え」でも同様のことは実現できますが、
スキル詠唱が目的の場合はこちらを利用した方がシンプルです。
※スキルキャンセルとする最大HPダメージ比率はプラグインコマンド「バトラーARPGパラメータ設定」で
「スキルキャンセルダメージレート」を設定することによって変更可能です。
設定しなかった場合は1ダメージでも受けるとスキルキャンセルとなります。
■ スキルオブジェクトの攻撃角度
スキルオブジェクトに対してプラグインコマンド「攻撃角度指定」を実行することで
スキルオブジェクトに攻撃角度を設定することが可能です。
ここで設定した攻撃角度はガード時にスキルオブジェクトの方を向いているかの
判定を行う用途に使用されます。
また、ここで設定された値はダメージを受けた時に実行されたコモンイベント内で
コモンイベント変数「ダメージ角度格納コモン変数」を読みだすことで取得することが可能です。
これをプラグインコマンド「キャラクター吹き飛ばし」と組み合わせることで
ダメージを受けた方向にキャラクターを吹き飛ばすといったことが実現可能です。
■ スキル効果の適用
スキル発動後、プラグインコマンド「スキル効果適用」を実行すると、
該当のスキルの効果を使用者に適用することができます。
※ スキルのダメージのみが適用されます。使用効果は適用されません。
また、プラグインコマンド「スキル効果適用テスト」を実行した場合、
スキル効果の適用が可能であるかを事前にチェックすることができます。
この機能を使うことで例えばHP満タンの場合は回復アイテムは
使用できないといったことが実現可能です。
■ スキル発動時のスキル名表示
スキルのメモ欄に以下のように記載することでスキル発動時に
ポップアップウィンドウを表示することができます。
この場合、スキルの"メッセージ"で設定したテキストが表示されます。
<showSkillName>
■ ダメージを受けた時の無敵時間の設定
スキルのメモ欄に以下のように記載することでスキルによる
ダメージを受けた時の無敵時間を設定することができます。
<noDamageFrame: 無敵時間>
例: 無敵時間を60フレームに設定する場合
<noDamageFrame: 60>
※ この設定を省略した場合、無敵時間は30フレームになります。
■ スキル使用後の攻撃禁止時間の設定
スキルのメモ欄に以下のように記載することでスキル使用後の
攻撃禁止時間を設定することができます。
<noAttackFrame: 攻撃禁止時間>
例: 攻撃禁止時間を120フレームに設定する場合
<noAttackFrame: 120>
※ この設定を省略した場合、攻撃禁止時間は60フレームになります。
[フィールドオブジェクト関連]
■ フィールドオブジェクト
フィールドオブジェクトとはプレイヤーでもエネミーでもないが当たり判定が設定可能な
オブジェクトのことを指します。剣で破壊可能な草や、矢が当たるとONになるスイッチなどを
想定しています。
フィールドオブジェクトの当たり判定は「カスタム判定」のみ設定することができます。
カスタム判定の詳細については「■ 当たり判定の設定」を参照してください。
[当たり判定関連]
■ 当たり判定の設定
プラグインコマンド「当たり判定設定」で当たり判定の設定を行うことができます。
当たり判定は以下の種類があります。
攻撃判定: この判定が「ダメージ判定」と接触した場合、ダメージ判定の設定者にダメージを与えます。
ダメージ判定: この判定が「攻撃判定」と接触した場合、攻撃判定の設定者からダメージを受けます。
カスタム判定: ユーザーが独自に定義可能な当たり判定です。ここで設定した当たり判定は
プラグインコマンド「当たり判定チェック」でチェックすることができます。
当たり判定は以下のキャラクターに対して設定することが可能です。
それ以外のキャラクターに対して当たり判定を設定するとエラーになります。
・プレイヤー(全ての当たり判定が設定可能)
・エネミー(全ての当たり判定が設定可能)
・フィールドオブジェクト(カスタム判定のみ設定可能)
・スキルオブジェクト(攻撃判定/カスタム判定のみ設定可能)
※ プレイヤーの当たり判定はプラグインパラメータ「プレイヤー当たり判定設定」で行えます。
■ プラグインコマンドによる当たり判定チェック
攻撃判定とダメージ判定に応じたダメージ処理はプラグイン側で自動的に行われますが、
プラグインコマンド「当たり判定チェック」によって
好きなタイミングで当たり判定のチェックを行うことが可能です。
■ 当たり判定の可視化
プラグインパラメータ「ヒットボックス共通設定/ヒットボックス可視化切り替え」で指定した
スイッチをONにすると、ヒットボックスが可視化されます。
[その他]
■ 時間経過で解消されるステートの設定
ARPGでは時間経過でステートを解消したい場面も多くあるかと思いますので、
そのための機能を用意しています。
ステートのメモ欄で以下の記載をすることで指定したフレーム数が経過したタイミングで
ステートを解消することができるようになります。
<duration: フレーム数>
例えば10秒後にステートを解消する場合は以下のように設定します。(1秒=60フレーム)
<duration: 60>
この設定だけではステートの重ね掛けを行った場合でも残りフレーム数は更新されません。
ステートの重ね掛けで残りフレーム数を更新する場合、以下の内容をメモ欄に記載する必要があります。
<overWriteDuration>
■ 武器ごとのスキル設定
武器の種類に応じて通常攻撃時のスキルを切り替えることが可能です。
武器のメモ欄に以下の記載をすることで指定したスキルを実行します。
<skill: スキル名>
※ 二刀流を設定した場合、2回分スキルを実行します。
■ 透明オブジェクト発射
透明なオブジェクトを発射し、当たり判定チェックを行うことができます。
例えば前方に敵がいるかをチェックするなどの用途で使用することが可能です。
透明オブジェクトの衝突対象については「プライオリティが通常キャラと同じに設定されたイベント」
と同じになります。
※注意
透明オブジェクトを生成した位置にすでにキャラクターがいた場合、
透明オブジェクトはそのキャラクターをすり抜け対象にします。
■ ターゲット選択機能
プラグインコマンド「ターゲット選択」を実行することで
ゲーム上でカーソルによるプレイヤーまたはエネミーの選択が可能です。
これによって例えば選択した敵キャラに向けて弾を発射するといったことが
可能になります。
また、ウェイトをONにした場合は選択中は時間を停止することができ、
OFFにした場合はリアルタイムで選択することができます。
キャンセル可能をONにするとターゲット選択中にキャンセルボタンを押した場合、
ターゲット選択をキャンセルすることが可能です。
この場合、選択結果格納スイッチに格納される結果はOFFになります。
■ イベントの画面内判定
プラグインパラメータ「キャラクター画面内判定」を実行することで
指定したキャラクターが画面内にいるかを判定することができます。
【補足情報】
各種プラグインパラメータやプラグインコマンドで「キャラクター指定」を
行う場合、変数でキャラクターを指定することが可能です。
その場合、各種変数の値の意味については以下の通りとなります。
■ キャラクター種別の変数の値
プレイヤー: 1
フォロワー: 2
イベント: 3
乗り物: 4
■ フォロワーインデックスの変数の値
一人目: 1
二人目: 2
(以下略)
■ 乗り物の変数の値
小型船: 1
大型船: 2
飛行船: 3
@command ChangeARPGMode
@text ARPGモード切り替え
@desc ARPGモードの有効/無効を切り替えます。
@arg ARPGMode
@text ARPGモード
@type boolean
@default true
@desc 切り替え先のARPGモードを指定します。
@command MakeDynamicEvent
@text 動的オブジェクト生成
@desc 動的オブジェクトを生成します。
@arg SrcMapId
@type number
@text 生成元マップID
@default 1
@desc 生成元マップIDを指定します。
@arg SrcEventIdOrName
@type string
@text 生成元イベントID or イベント名
@default 0
@desc 生成元イベントIDまたはイベント名を指定します。
@arg X
@type number
@text X座標
@default 0
@desc イベントを生成するX座標を指定します。
@arg XByVariable
@type variable
@text X座標(変数指定)
@default 0
@desc イベントを生成するX座標を変数で指定します。直接X値を設定した場合は本パラメータは0を指定してください。
@arg Y
@type number
@text Y座標
@default 0
@desc イベントを生成するY座標を指定します。
@arg YByVariable
@type variable
@text Y座標(変数指定)
@default 0
@desc イベントを生成するY座標を変数で指定します。直接Y値を設定した場合は本パラメータは0を指定してください。
@arg MadeDynamicEventId
@text 生成動的イベントID格納変数
@type variable
@default 0
@desc
生成した動的イベントのIDを格納する変数IDを指定します。
@command GetCharacterFloatPosition
@text キャラクター小数座標取得
@desc キャラクターの小数座標を取得します。
@arg CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg LeftUpOrCenter
@text 左上 or 中心
@type select
@option 左上
@value leftup
@option 中心
@value center
@default leftup
@desc キャラクターの左上座標または中心座標のどちらを取得するかを選択します。
@arg StoreFloatXVariableId
@text 小数X座標格納変数ID
@type variable
@default 0
@desc 取得した小数X座標を格納する変数IDを指定します。
@arg StoreFloatYVariableId
@text 小数Y座標格納変数ID
@type variable
@default 0
@desc 取得した小数Y座標を格納する変数IDを指定します。
@command CalcDeg
@text キャラクター間角度取得
@desc 主体キャラクターから見た対象キャラクターの角度を取得します。
@arg SubjectCharacterSpecification
@text 主体キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 主体となるキャラクターを指定します。
@arg TargetCharacterSpecification
@text 対象キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg StoreDegreeVariableId
@text 角度格納変数ID
@type variable
@default 0
@desc 取得した角度を格納する変数IDを指定します。
@command CalcFar
@text キャラクター間距離取得
@desc 主体キャラクターと対象キャラクターとの距離を取得します。
@arg SubjectCharacterSpecification
@text 主体キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 主体となるキャラクターを指定します。
@arg TargetCharacterSpecification
@text 対象キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg StoreFarVariableId
@text 距離格納変数ID
@type variable
@default 0
@desc 取得した距離を格納する変数IDを指定します。
@command CheckInTheScreen
@text キャラクター画面内判定
@desc キャラクターが画面内にいるかを判定します。
@arg CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg XMargin
@text X軸マージン
@type number
@decimals 2
@default 2
@desc X軸の画面外マージン幅を指定します。単位はマス数です。
@arg YMargin
@text Y軸マージン
@type number
@decimals 2
@default 2
@desc Y軸の画面外マージン幅を指定します。単位はマス数です。
@arg StoreResultSwitchId
@text 結果格納スイッチID
@type switch
@default 1
@desc 画面内にいる場合にONを、そうでない場合にOFFを設定するスイッチIDを指定します。
@command CheckMoved
@text キャラクター移動有無チェック
@desc キャラクターがそのフレーム内に移動したかをチェックします。
@arg CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg StoreResultSwitchId
@text 結果格納スイッチID
@type switch
@default 1
@desc 移動した場合にONを、そうでない場合にOFFを設定するスイッチIDを指定します。
@command TransparentObjectCast
@text 透明オブジェクト発射
@desc 透明オブジェクトを発射し、オブジェクトに衝突するかをチェックします。
@arg TransparentObjectPosition
@type struct<TransparentObjectPosition>
@text 位置指定
@desc 透明オブジェクトの生成位置を指定します。
@arg Degree
@text 角度
@type number
@decimals 2
@default 0
@desc 透明オブジェクトの発射角度を指定します。
@arg DegreeByVariable
@text 角度(変数指定)
@type variable
@default 0
@desc 透明オブジェクトの発射角度を変数で指定します。
@arg Far
@text 距離
@type number
@decimals 2
@default 0
@desc 透明オブジェクトの発射距離を指定します。0を指定すると無限になります。
@arg FarByVariable
@text 距離(変数指定)
@type variable
@default 0
@desc 透明オブジェクトの発射距離を変数で指定します。
@arg Width
@text 横幅
@type number
@decimals 2
@default 1
@desc 透明オブジェクトの横幅を指定します。
@arg Height
@text 縦幅
@type number
@decimals 2
@default 1
@desc 透明オブジェクトの縦幅を指定します。
@arg CollisionResultSwitchId
@text 衝突結果格納スイッチID
@type switch
@default 1
@desc 衝突した場合にONを、そうでない場合にOFFを設定するスイッチIDを指定します。
@arg CollidedXVariableId
@text 衝突X座標格納変数ID
@type variable
@default 0
@desc 衝突が発生した地点のX座標を格納する変数IDを指定します。
@arg CollidedYVariableId
@text 衝突X座標格納変数ID
@type variable
@default 0
@desc 衝突が発生した地点のX座標を格納する変数IDを指定します。
@command SetupEnemy
@text エネミー設定
@desc イベントのエネミー設定を行います。
@arg CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg EnemyId
@text エネミーID
@type enemy
@default 1
@desc エネミーIDを指定します。
@arg CollideAttackSkillId
@text 衝突攻撃スキルID
@type skill
@default 0
@desc
エネミーがアクターに衝突したときにダメージ計算を行うスキルIDを指定します。
@arg DamageCommonEventId
@text エネミーダメージコモンイベントID
@type common_event
@default 0
@desc
エネミーがダメージを受けたときに実行するコモンイベントを指定します。
@arg DefeatEnemyCommonEventId
@text 敵撃破コモンイベントID
@type common_event
@default 0
@desc
敵撃破時に実行するコモンイベントIDを指定します。
@arg HpGauge
@text HPゲージ
@type select
@option なし
@value none
@option ノーマル
@value normal
@option ボス
@value boss
@default normal
@desc HPゲージの表示を設定します。
@command ChangeHpGaugeVisible
@text エネミーHPゲージ表示切り替え
@desc エネミーのHPゲージ表示/非表示を切り替えます。
@arg CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg ShowOrHide
@text 表示/非表示
@type boolean
@on 表示
@off 非表示
@default true
@desc 表示または非表示を選択します。
@command SetupFieldObject
@text フィールドオブジェクト設定
@desc イベントのフィールドオブジェクト設定を行います。
@command UseSkill
@text スキル使用
@desc スキルを使用します。
@arg SkillId
@type skill
@text スキルID
@default 1
@desc 使用するスキルのIDを指定します。名前指定または変数指定を行った場合、そちらが優先されます。
@arg SkillByName
@type string
@text スキル(名前指定)
@desc 使用するスキルの名前を指定します。名前指定を使用しない場合は空欄にしてください。
@arg SkillIdByVariable
@type variable
@text スキルID(変数指定)
@default 0
@desc 使用するスキルのIDを変数で指定します。変数指定を使用しない場合は0にしてください。
@command UseItem
@text アイテム使用
@desc アイテムを使用します。
@arg ItemId
@type item
@text アイテムID
@default 1
@desc 使用するアイテムのIDを指定します。名前指定または変数指定を行った場合、そちらが優先されます。
@arg ItemByName
@type string
@text アイテム(名前指定)
@desc 使用するアイテムの名前を指定します。名前指定を使用しない場合は空欄にしてください。
@arg ItemIdByVariable
@type variable
@text アイテムID(変数指定)
@default 0
@desc 使用するアイテムのIDを変数で指定します。変数指定を使用しない場合は0にしてください。
@command SkillActivation
@text スキル発動
@desc スキルを発動します。本コマンドは必ずスキルのアクションコモンイベント内で呼び出してください。
@arg ChantCommonEventId
@type common_event
@text 詠唱コモンイベントID
@default 0
@desc 詠唱処理を実行するコモンイベントのIDを指定します。
@command ChangeSkillCancelWhenDamageEnableOrDisable
@text ダメージスキルキャンセル有効/無効切り替え
@desc ダメージによるスキルキャンセル有効/無効を切り替えます。本コマンドは必ずスキルのアクションコモンイベント内で呼び出してください。
@arg EnableOrDisable
@text 有効/無効
@type boolean
@on 有効
@off 無効
@default true
@desc
有効または無効を選択します。
@command TestApplySkillEffect
@text スキル効果適用テスト
@desc 使用者にスキル効果が適用可能であるかをテストし、結果をスイッチに設定します。
@arg IsSkillSpecification
@text スキル指定有無
@type boolean
@default false
@desc ONを指定すると対象となるスキルを指定します。指定しなかった場合、発動したスキルが適用されます。
@arg SkillSpecification
@text スキル指定
@type struct<SkillSpecification>
@default {"SkillOrItem":"skill","SkillId":"1","SkillByName":"","SkillIdByVariable":"0","ItemId":"1","ItemByName":"","ItemIdByVariable":"0"}
@desc スキル指定有無をOnにした場合に対象となるスキルを指定します。
@arg StoreResultSwitchId
@text 結果格納スイッチID
@type switch
@default 1
@desc 使用可能な場合にONを、そうでない場合にOFFを設定するスイッチIDを指定します。
@command ApplySkillEffect
@text スキル効果適用
@desc 使用者にスキル効果を適用します。本コマンドは必ずスキルのアクションコモンイベント内で「スキル発動」の後に呼び出してください。
@arg IsSkillSpecification
@text スキル指定有無
@type boolean
@default false
@desc ONを指定すると対象となるスキルを指定します。指定しなかった場合、発動したスキルが適用されます。
@arg SkillSpecification
@text スキル指定
@type struct<SkillSpecification>
@default {"SkillOrItem":"skill","SkillId":"1","SkillByName":"","SkillIdByVariable":"0","ItemId":"1","ItemByName":"","ItemIdByVariable":"0"}
@desc スキル指定有無をOnにした場合に対象となるスキルを指定します。
@command MakeSkillObject
@text スキルオブジェクト生成
@desc スキルオブジェクトを生成します。
@arg SrcMapId
@type number
@text 生成元マップID
@default 1
@desc 生成元マップIDを指定します。
@arg SrcEventIdOrName
@text 生成元イベントID or イベント名
@type string
@default 0
@desc 生成元イベントIDまたはイベント名を指定します。
@arg SkillObjectPosition
@type struct<SkillObjectPosition>
@text 位置指定
@desc スキルオブジェクトの生成位置を指定します。
@arg IsSkillSpecification
@text スキル指定有無
@type boolean
@default false
@desc ONを指定すると対象となるスキルを指定します。指定しなかった場合、発動したスキルが適用されます。
@arg SkillSpecification
@text スキル指定
@type struct<SkillSpecification>
@default {"SkillOrItem":"skill","SkillId":"1","SkillByName":"","SkillIdByVariable":"0","ItemId":"1","ItemByName":"","ItemIdByVariable":"0"}
@desc スキル指定有無をOnにした場合に対象となるスキルを指定します。
@arg MadeDynamicEventId
@text 生成動的イベントID格納変数
@type variable
@default 0
@desc
生成した動的イベントのIDを格納する変数IDを指定します。
@command SetAttackDegree
@text 攻撃角度指定
@desc スキルオブジェクトの攻撃角度を指定します。
@arg CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg AttackDegree
@type number
@text 攻撃角度
@default 0
@desc 攻撃角度を設定します。
@arg AttackDegreeByVariable
@type variable
@text 攻撃角度(変数指定)
@default 0
@desc 攻撃角度を変数で設定します。
@command SetHitBox
@text ヒットボックス設定
@desc ヒットボックスの設定を行います。同じタイプに対して再度ヒットボックス設定を行った場合、既存の設定を上書きします。
@arg CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg HitBoxType
@text ヒットボックスタイプ
@type select
@option 攻撃
@value attack
@option ダメージ
@value damage
@option カスタム
@value custom
@default attack
@desc ヒットボックスタイプを設定します。
@arg CustomHitBoxTag
@text カスタムヒットボックスタグ
@type string
@desc ヒットボックスタイプをカスタムにした場合のタグを指定します。
@arg HitBoxList
@type struct<Box>[]
@text ヒットボックスリスト
@default []
@desc ヒットボックスを設定します。
@command ChangeHitBoxEnableOrDisable
@text ヒットボックス有効/無効切り替え
@desc ヒットボックスの有効/無効切り替えを行います。
@arg CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg HitBoxType
@text ヒットボックスタイプ
@type select
@option 攻撃
@value attack
@option ダメージ
@value damage
@option カスタム
@value custom
@default attack
@desc ヒットボックスタイプを設定します。
@arg CustomHitBoxTag
@text カスタムヒットボックスタグ
@type string
@desc ヒットボックスタイプをカスタムにした場合のタグを指定します。
@arg Enabled
@text 有効化
@type boolean
@desc trueを設定するとヒットボックスを有効化します。
@command HitCheck
@text 当たり判定チェック
@desc ヒットボックスによる当たり判定チェックを行います。
@arg SubjectCharacterSpecification
@text 主体キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 主体となるキャラクターを指定します。
@arg SubjectHitBoxType
@text 主体ヒットボックスタイプ
@type select
@option 攻撃
@value attack
@option ダメージ
@value damage
@option カスタム
@value custom
@default attack
@desc ヒットボックスタイプを設定します。
@arg SubjectCustomHitBoxTag
@text 主体カスタムヒットボックタグ
@type string
@desc カスタムヒットボックタグを設定します。
@arg IsTargetSpecification
@text 対象指定有無
@type boolean
@default false
@desc ONを指定すると対象となるイベントを指定します。
@arg TargetCharacterSpecification
@text 対象キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象指定有無がONの場合に対象となるキャラクターを指定します。
@arg TargetHitBoxType
@text 対象ヒットボックスタイプ
@type select
@option 攻撃
@value attack
@option ダメージ
@value damage
@option カスタム
@value custom
@default attack
@desc ヒットボックスタイプを設定します。
@arg TargetCustomHitBoxTag
@text 対象カスタムヒットボックタグ
@type string
@desc カスタムヒットボックタグを設定します。
@arg StoreResultSwitchId
@text 結果格納スイッチID
@type switch
@default 1
@desc ヒットしていた場合にONを、そうでない場合にOFFを設定するスイッチIDを指定します。
@command GetBattlerStatus
@text バトラーステータス取得
@desc 指定したバトラーのステータスを取得します。
@arg CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg StatusType
@type select
@option mhp
@option mmp
@option hp
@option mp
@option tp
@option atk
@option mat
@option mdf
@option agi
@option luk
@option hit
@option eva
@option cri
@option cev
@option mev
@option mrf
@option cnt
@option hrg
@option mrg
@option trg
@option tgr
@option grd
@option rec
@option pha
@option mcr
@option tcr
@option pdr
@option mdr
@option fdr
@option exr
@text ステータスタイプ
@default mhp
@desc ステータスタイプを指定します。
@arg DestVariableId
@type variable
@text 格納先変数
@default 1
@desc 取得したステータス値の格納先変数を指定します。
@command SetBattlerStatus
@text バトラーステータス設定
@desc 指定したバトラーのステータスを設定します。
@arg CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg StatusType
@type select
@option hp
@option mp
@option tp
@text ステータスタイプ
@default mhp
@desc ステータスタイプを指定します。
@arg Value
@type number
@text 値
@default 0
@desc 設定するステータス値を指定します。
@arg ValueByVariable
@type variable
@text 値(変数指定)
@default 0
@desc 設定するステータス値が格納された変数IDを指定します。
@command GetBattlerARPGParameter
@text バトラーARPGパラメータ取得
@desc 指定したバトラーのARPG専用パラメータを取得します。
@arg CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg ARPGParameterType
@type select
@option スキルキャンセルダメージレート
@value skillCancelDamageRate
@option ジャストガードフレーム
@value justGuardFrame
@text ARPGパラメータタイプ
@default skillCancelDamageRate
@desc ARPGパラメータタイプを指定します。
@arg DestVariableId
@type variable
@text 格納先変数
@default 1
@desc 取得したステータス値の格納先変数を指定します。
@command SetBattlerARPGParameter
@text バトラーARPGパラメータ設定
@desc 指定したバトラーのARPG専用パラメータを設定します。
@arg CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg ARPGParameterType
@type select
@option スキルキャンセルダメージレート
@value skillCancelDamageRate
@option ジャストガードフレーム
@value justGuardFrame
@text ARPGパラメータタイプ
@default skillCancelDamageRate
@desc ARPGパラメータタイプを指定します。
@arg Value
@type number
@text 値
@default 0
@decimals 2
@desc 設定するステータス値を指定します。
@arg ValueByVariable
@type variable
@text 値(変数指定)
@default 0
@desc 設定するステータス値が格納された変数IDを指定します。
@command GetBattlerARPGFlag
@text バトラーARPGフラグ取得
@desc 指定したバトラーのARPG専用フラグを取得します。
@arg CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg ARPGFlagType
@type select
@option ノーダメージフラグ
@value noDamageFlag
@option 攻撃禁止フラグ
@value noAttackFlag
@text ARPGフラグタイプ
@default noDamageFlag
@desc ARPGフラグタイプを指定します。
@arg DestSwitchId
@type switch
@text 格納先スイッチ
@default 1
@desc 取得したフラグ値の格納先スイッチを指定します。
@command SetBattlerARPGFlag
@text バトラーARPGフラグ設定
@desc 指定したバトラーのARPG専用フラグを設定します。
@arg CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg ARPGFlagType
@type select
@option ノーダメージフラグ
@value noDamageFlag
@option 攻撃禁止フラグ
@value noAttackFlag
@text ARPGフラグタイプ
@default noDamageFlag
@desc ARPGフラグタイプを指定します。
@arg Value
@type boolean
@text 値
@default true
@desc 設定するフラグ値を指定します。
@arg ValueBySwitch
@type switch
@text 値(スイッチ指定)
@default 0
@desc 設定するフラグ値が格納されたスイッチIDを指定します。
@command SetCheckMapValid
@text マップ有効範囲チェック有効/無効切り替え
@desc マップの有効範囲チェックの有効/無効の切り替えを行います。
@arg CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc
対象となるキャラクターを指定します。
@arg EnableOrDisable
@text 有効/無効
@type boolean
@on 有効
@off 無効
@default true
@desc
有効または無効を選択します。
@command CharacterBlowAway
@text キャラクター吹き飛ばし
@desc キャラクターを指定方向に吹き飛ばします。
@arg CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 対象となるキャラクターを指定します。
@arg Degree
@text 角度
@type number
@default 0
@desc 吹き飛ばす角度を指定します。
@arg DegreeByVariable
@text 角度(変数指定)
@type variable
@default 0
@desc 吹き飛ばす角度を変数で指定します。
@arg InitialVelocity
@text 初速度
@type number
@decimals 2
@default 0.5
@desc 吹き飛ばす初速度を指定します。
@arg InitialVelocityByVariable
@text 初速度(変数指定)
@type variable
@default 0
@desc 吹き飛ばす初速度を変数で指定します。
@arg Duration
@text 間隔
@type number
@decimals 2
@default 10
@desc 吹き飛ばす間隔を指定します。
@arg DurationByVariable
@text 間隔(変数指定)
@type variable
@default 0
@desc 吹き飛ばす間隔を変数で指定します。
@command TargetSelect
@text ターゲット選択
@desc ターゲット選択を行います。
@arg SelectResultSwitchId
@text 選択結果格納スイッチID
@type switch
@default 0
@desc
ターゲットの選択に成功した場合ONが設定されるスイッチIDを指定します。
@arg SelectedTargetCharacterKindVariableId
@text 選択ターゲットキャラクター種別格納変数ID
@type variable
@default 0
@desc
選択したターゲットのキャラクター種別を格納する変数IDを指定します。
@arg SelectedTargetEventIdVariableId
@text 選択ターゲットイベントID格納変数ID
@type variable
@default 0
@desc
選択したターゲットのイベントIDを格納する変数IDを指定します。
@arg Wait
@text ウェイト
@type boolean
@default true
@desc
ONを設定した場合、ターゲット選択中はシーンを停止します。
@arg Cancelable
@text キャンセル可能
@type boolean
@default true
@desc
ONを設定した場合、ターゲット選択のキャンセルを有効にします。
@command SearchNearBattler
@text 近隣バトラー検索
@desc 対象者から最も近いバトラーを検索します。
@arg Target
@text ターゲット
@type select
@option 全バトラー
@value all
@option 敵キャラ
@value opponent
@option 味方キャラ
@value friend
@default all
@desc ターゲットを指定します。
@arg SubjectCharacterSpecification
@text 主体キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 主体となるキャラクターを指定します。
@arg StoreResultSwitchId
@text 結果格納スイッチID
@type switch
@default 1
@desc 敵キャラが見つかった場合にONを、そうでない場合にOFFを設定するスイッチIDを指定します。
@arg StoreCharacterKindVariableId
@text キャラクター種別格納変数ID
@type variable
@default 0
@desc 見つかったバトラーのキャラクター種別を格納する変数IDを指定します。
@arg StoreEventIdVariableId
@text イベントID格納変数ID
@type variable
@default 0
@desc 見つかったバトラーがイベントの場合にイベントIDを格納する変数IDを指定します。
@command SetPlayerGuardMode
@text プレイヤーガードモード設定
@desc プレイヤーのガードモードを設定します。
@arg GuardMode
@text ガードモード
@type boolean
@default true
@desc
ガードモードONまたはOFFを指定します。
@command ShowMessagePopup
@text メッセージポップアップ表示
@desc メッセージポップアップを表示します。
@arg Text
@text テキスト
@type string
@desc
ポップアップ表示を行うテキストを指定します。
@arg Time
@text 時間
@type number
@default 60
@desc
ポップアップの表示時間を指定します。
@param CopyEventSetting
@text コピーイベント共通設定
@type struct<CopyEventSetting>
@default {"CopyEventTag":"cp","DynamicEventSrcMapIds":"[]"}
@desc
コピーイベントの共通設定を行います。
@param BattlerSetting
@text バトラー共通設定
@type struct<BattlerSetting>
@default {"DamageDegCommonVariableId":"0","UserKindCommonVariableId":"0","UserEventIdCommonVariableId":"0","DamageKindCommonVariableId":"0","DamageTypeCommonVariableId":"0","DamageValueCommonVariableId":"0"}
@desc
バトラーの共通設定を行います。
@param ActorSetting
@text アクター共通設定
@type struct<ActorSetting>
@default {"NormalAttackSkillId":"0","DamageCommonEventId":"0","NormalGuardCommonEventId":"0","JustGuardCommonEventId":"0","StartGuardCommonEventId":"0","EndGuardCommonEventId":"0","JustGuardFrame":"10","ActorHitBox":"{\"AttackHitBoxList\":\"[]\",\"DamageHitBoxList\":\"[]\"}","GameOverCommonEventId":"0","LevelUpCommonEventId":"0"}
@desc
アクターの共通設定を行います。
@param EnemySetting
@text エネミー共通設定
@type struct<EnemySetting>
@default {"CollideAttackSkillId":"0","DamageCommonEventId":"0","DefeatEnemyCommonEventId":"0"}
@desc
エネミーの共通設定を行います。
@param SkillObjectSetting
@text スキルオブジェクト共通設定
@type struct<SkillObjectSetting>
@default {"SkillObjectUserKindSelfVariableId":"0","SkillObjectUserEventIdSelfVariableId":"0","CollisionDetectExSelfSwitchId":"0"}
@desc
スキルオブジェクトの共通設定を行います。
@param HitBoxSetting
@text ヒットボックス共通設定
@type struct<HitBoxSetting>
@default {"VisibleHitAreaSwitchId":"0","AttackHitBoxColor":"#ff0000aa","DamageHitBoxColor":"#0000ffaa","CustomHitBoxDefaultColor":"#00ff00aa","CustomHitBoxColorList":"[]"}
@desc
ヒットボックスの共通設定を行います。
@param EnemyHpGaugeSetting
@text エネミーHPゲージ設定
@type struct<EnemyHpGaugeSetting>
@default {"NormalEnemyHpGaugeColor1":"#00aa00","NormalEnemyHpGaugeColor2":"#22ff22","BossEnemyHpGaugeLabel":"BOSS","BossEnemyHpGaugeColor1":"#00aa00","BossEnemyHpGaugeColor2":"#22ff22"}
@desc
エネミーのHPゲージ設定を行います。
@param KeySetting
@text キー入力設定
@type struct<KeySetting>
@default @default {"ActorNormalAttack":"{\"KeyName\":\"ok\",\"KeySymbol\":\"\",\"KeyCode\":\"0\",\"ButtonIndex\":\"-1\"}","ActorGuard":"{\"KeyName\":\"other\",\"KeySymbol\":\"A\",\"KeyCode\":\"65\",\"ButtonIndex\":\"6\"}","VisibleHitBox":"{\"KeyName\":\"other\",\"KeySymbol\":\"F6\",\"KeyCode\":\"117\",\"ButtonIndex\":\"-1\"}"}
@desc
キー入力の各種設定を行います。
@param EnableARPGSwitchId
@text ARPG有効化スイッチID
@type switch
@default 0
@desc
ARPGを有効化するスイッチIDを指定します。
@param UseDamagePopup
@text ダメージポップアップ使用
@type boolean
@default true
@desc
trueを設定すると攻撃によるダメージ発生時にダメージ値を表示します。
@param UseImageDamage
@text ダメージ画像使用
@type boolean
@default false
@desc
trueを設定するとsystem/Damage.pngの画像をダメージ表示に使用します。
@param UseImageTargetSelectCursor
@text ターゲット選択カーソル画像使用
@type boolean
@default false
@desc
trueを設定すると画像をターゲット選択カーソルに使用します。
@param TargetSelectCursorImageFileName
@text ターゲット選択カーソル画像ファイル名
@type file
@dir img
@desc
ターゲット選択カーソルの画像ファイル名を指定します。
@param ErrorMessageLanguage
@text エラーメッセージ言語
@type select
@option 英語
@value en
@option 日本語
@value ja
@default ja
@desc
エラーメッセージの表示言語を指定します。
*/
/*!/*~struct~CopyEventSetting:ja
@param CopyEventTag
@text コピーイベントタグ
@type string
@default cp
@desc
コピーするイベントを判定するためのタグ名を指定します。
@param DynamicEventSrcMapIds
@text 動的イベント生成元マップID一覧
@type number[]
@default []
@desc
動的イベント生成元のマップIDの一覧を設定します。
*/
/*!/*~struct~BattlerSetting:ja
@param DamageDegCommonVariableId
@text ダメージ角度格納コモン変数
@type variable
@default 0
@desc
ダメージを受けた時の角度を格納するコモン変数を指定します。
@param UserKindCommonVariableId
@text ユーザー種別格納コモンイベント変数
@type variable
@default 0
@desc
バトラーでアクションコモンイベントを実行したときにユーザー種別(1: プレイヤー, 3: イベント)を格納する変数を指定します。
@param UserEventIdCommonVariableId
@text ユーザーイベントID格納コモンイベント変数
@type variable
@default 0
@desc
バトラーでアクションコモンイベントを実行したときにイベントIDを格納する変数を指定します。
@param DamageKindCommonVariableId
@text ダメージ種別コモン変数ID
@type variable
@default 0
@desc
ダメージを受けた時にダメージ種別が設定されるコモン変数を指定します。
@param DamageTypeCommonVariableId
@text ダメージタイプコモン変数ID
@type variable
@default 0
@desc
ダメージを受けた時にダメージタイプが設定されるコモン変数を指定します。
@param DamageValueCommonVariableId
@text ダメージ値コモン変数ID
@type variable
@default 0
@desc
ダメージを受けた時にダメージ値が設定されるコモン変数を指定します。
*/
/*!/*~struct~ActorSetting:ja
@param NormalAttackSkillId
@text 通常攻撃スキルID
@type skill
@default 0
@desc
通常攻撃時のスキルIDを指定します。
@param DamageCommonEventId
@text アクターダメージコモンイベントID
@type common_event
@default 0
@desc
アクターがダメージを受けたときに実行するコモンイベントを指定します。
@param NormalGuardCommonEventId
@text アクター通常ガードコモンイベントID
@type common_event
@default 0
@desc
アクターが通常ガードしたときに実行するコモンイベントを指定します。
@param JustGuardCommonEventId
@text アクタージャストガードコモンイベントID
@type common_event
@default 0
@desc
アクターがジャストガードしたときに実行するコモンイベントを指定します。
@param StartGuardCommonEventId
@text アクターガード開始コモンイベントID
@type common_event
@default 0
@desc
アクターがガードを開始したときに実行するコモンイベントを指定します。
@param EndGuardCommonEventId
@text アクターガード終了コモンイベントID
@type common_event
@default 0
@desc
アクターがガードを終了したときに実行するコモンイベントを指定します。
@param JustGuardFrame
@text ジャストガードフレーム
@type number
@min 0
@default 10
@desc
ジャストガードの許容フレーム数を指定します。ジャストガードを使用しない場合は0を指定してください。
@param ActorHitBox
@text アクターヒットボックス
@type struct<ActorHitBox>
@default {"AttackHitBoxList":"[]","DamageHitBoxList":"[]"}
@desc アクターのヒットボックス設定を行います。
@param GameOverCommonEventId
@text ゲームオーバーコモンイベントID
@type common_event
@default 0
@desc
ゲームオーバー時に実行するコモンイベントIDを指定します。0を指定した場合はゲームオーバーシーンに移動します。
@param LevelUpCommonEventId
@text レベルアップコモンイベントID
@type common_event
@default 0
@desc
レベルアップしたときに実行するコモンイベントを指定します。
*/
/*!/*~struct~EnemySetting:ja
@param CollideAttackSkillId
@text 衝突攻撃スキルID
@type skill
@default 0
@desc
エネミーがアクターに衝突したときにダメージ計算を行うスキルIDを指定します。
@param DamageCommonEventId
@text エネミーダメージコモンイベントID
@type common_event
@default 0
@desc
エネミーがダメージを受けたときに実行するコモンイベントを指定します。
@param DefeatEnemyCommonEventId
@text 敵撃破コモンイベントID
@type common_event
@default 0
@desc
敵撃破時に実行するコモンイベントIDを指定します。
*/
/*!/*~struct~SkillObjectSetting:ja
@param SkillObjectUserKindSelfVariableId
@text スキルオブジェクトユーザー種別格納セルフ変数
@type variable
@default 0
@desc
スキルオブジェクトを生成したユーザーの種別を格納するセルフ変数を指定します。
@param SkillObjectUserEventIdSelfVariableId
@text スキルオブジェクトユーザーイベントID格納セルフ変数
@type variable
@default 0
@desc
スキルオブジェクトを生成したユーザーの種別がイベントの場合にイベントIDを格納するセルフ変数を指定します。
@param CollisionDetectExSelfSwitchId
@text 衝突検出フラグ格納拡張セルフスイッチ
@type switch
@default 0
@desc
スキルオブジェクトがターゲットに衝突したときにONを格納する拡張セルフスイッチを指定します。
*/
/*!/*~struct~HitBoxSetting:ja
@param VisibleHitAreaSwitchId
@text ヒットボックス可視化切り替えスイッチID
@type switch
@default 0
@desc
ヒットボックス可視化の有無を切り替えるスイッチIDを指定します。
@param AttackHitBoxColor
@text 攻撃判定ヒットボックスカラー
@type string
@default #ff0000aa
@desc
ヒットボックス可視化時の攻撃判定のカラーを指定します。
@param DamageHitBoxColor
@text ダメージ判定ヒットボックスカラー
@type string
@default #0000ffaa
@desc
ヒットボックス可視化時のダメージ判定のカラーを指定します。
@param CustomHitBoxDefaultColor
@text カスタムヒットボックスデフォルトカラー
@type string
@default #00ff00aa
@desc
ヒットボックス可視化時のカスタムヒットボックスのデフォルトカラーを指定します。
@param CustomHitBoxColorList
@text カスタムヒットボックスカラー一覧
@type string<CustomHitBoxColor>
@default []
@desc
ヒットボックス可視化時のカスタムヒットボックスのカラー一覧を指定します。
*/
/*!/*~struct~EnemyHpGaugeSetting:ja
@param NormalEnemyHpGaugeColor1
@text ーマルエネミーHPゲージ色1
@type string
@default #00aa00
@desc ーマルエネミーのHPゲージの色1を設定します。
@param NormalEnemyHpGaugeColor2
@text ーマルエネミーHPゲージ色2
@type string
@default #22ff22
@desc ーマルエネミーのHPゲージの色1を設定します。
@param BossEnemyHpGaugeLabel
@text ボスエネミーHPゲージラベル
@type string
@default BOSS
@desc ボスエネミーのHPゲージの横に表示するテキストを設定します。
@param BossEnemyHpGaugeColor1
@text ボスエネミーHPゲージ色1
@type string
@default #00aa00
@desc ボスエネミーのHPゲージの色1を設定します。
@param BossEnemyHpGaugeColor2
@text ボスエネミーHPゲージ色2
@type string
@default #22ff22
@desc ボスエネミーのHPゲージの色1を設定します。
*/
/*!/*~struct~KeySetting:ja
@param ActorNormalAttack
@text アクター通常攻撃キー
@type struct<Key>
@default {"KeyName":"ok","KeySymbol":"","KeyCode":"0","ButtonIndex":"-1"}
@desc
アクターが通常攻撃を行う時のキーを指定します。
@param ActorGuard
@text アクターガードキー
@type struct<Key>
@default {"KeyName":"other","KeySymbol":"A","KeyCode":"65","ButtonIndex":"6"}
@desc
アクターがガードを行う時のキーを指定します。
@param VisibleHitBox
@text ヒットボックス可視化切り替えキー
@type struct<Key>
@default {"KeyName":"other","KeySymbol":"F6","KeyCode":"117","ButtonIndex":"-1"}
@desc
ヒットボックス可視化有無の切り替えを行うキーを指定します。
*/
/*!/*~struct~Key:ja
@param KeyName
@text キー名
@type select
@option 決定
@value ok
@option キャンセル
@value escape
@option シフト
@value shift
@option 下
@value down
@option 左
@value left
@option 右
@value right
@option 上
@value up
@option ページアップ
@value pageup
@option ページダウン
@value pagedown
@option その他
@value other
@option 未割り当て
@value unassigned
@default ok
@desc
キーを指定します。
@param KeySymbol
@text キーシンボル
@type string
@desc
キーをその他に選択した場合のキーシンボルを指定します。使用しない場合は空欄にしてください。
@param KeyCode
@text キーコード
@type number
@min -1
@default -1
@desc
キーをその他に選択した場合のキーコードを指定します。キーボードを使用しない場合は-1を指定してください。
@param ButtonIndex
@text ボタンインデックス
@type number
@min -1
@default -1
@desc
キーをその他に選択した場合のボタンのインデックスを指定します。ゲームパッドを使用しない場合は-1を指定してください。
*/
/*!/*~struct~Box:ja
@param X
@text X座標
@type number
@min -9999
@decimals 2
@default 0
@desc
X座標を指定します。
@param Y
@text Y座標
@type number
@min -9999
@decimals 2
@default 0
@desc
Y座標を指定します。
@param Width
@text 横幅
@type number
@min 0
@decimals 2
@default 1
@desc
横幅を指定します。
@param Height
@text 縦幅
@type number
@min 0
@decimals 2
@default 1
@desc
縦幅を指定します。
*/
/*!/*~struct~CustomHitBoxColor:ja
@param CustomHitBoxTag
@text カスタムヒットボックスタグ
@type string
@desc カスタムヒットボックスのタグを指定します。
@param Color
@text カラー
@type string
@default #00ff00aa
@desc
ヒットボックス可視化時のカスタムヒットボックスのカラーを指定します。
*/
/*!/*~struct~SkillObjectPosition:ja
@param Specification
@text 位置指定
@type select
@option 現在座標
@value current
@option 前方座標
@value forward
@option キャラクター座標
@value character
@option カスタム座標
@value custom
@default current
@desc
位置指定方法を選択します。
@param CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 位置指定でキャラクター座標を選択した場合の対象となるキャラクターを指定します。
@param CustomPosition
@text カスタム座標
@type struct<Position>
@desc
位置指定でカスタム座標を選択した場合の生成座標を指定します。
*/
/*!/*~struct~TransparentObjectPosition:ja
@param Specification
@text 位置指定
@type select
@option キャラクター座標
@value character
@option カスタム座標
@value custom
@default current
@desc
位置指定方法を選択します。
@param CharacterSpecification
@text キャラクター指定
@type struct<CharacterSpecification>
@default {"CharacterKind":"thisEvent","EventIdOrName":"1","EventIdByVariable":"0","FollowerIndex":"1","VehicleKind":"boat"}
@desc 位置指定でキャラクター座標を選択した場合の対象となるキャラクターを指定します。
@param CustomPosition
@text カスタム座標
@type struct<Position>
@desc
位置指定でカスタム座標を選択した場合の生成座標を指定します。
*/
/*!/*~struct~Position:ja
@param X
@type number
@text X座標
@default 0
@desc イベントを生成するX座標を指定します。
@param XByVariable
@type variable
@text X座標(変数指定)
@default 0
@desc イベントを生成するX座標を変数で指定します。直接値を設定した場合は本パラメータは0を指定してください。
@param Y
@type number
@text Y座標
@default 0
@desc イベントを生成するY座標を指定します。
@param YByVariable
@type variable
@text Y座標(変数指定)
@default 0
@desc イベントを生成するY座標を変数で指定します。直接値を設定した場合は本パラメータは0を指定してください。
*/
/*!/*~struct~ActorHitBox:ja
@param AttackHitBoxList
@type struct<Box>[]
@text 攻撃判定ヒットボックスリスト
@default []
@desc 攻撃判定ヒットボックスを設定します。
@param DamageHitBoxList
@type struct<Box>[]
@text ダメージ判定ヒットボックスリスト
@default []
@desc ダメージ判定ヒットボックスを設定します。
*/
/*!/*~struct~SE:ja
@param FileName
@text SEファイル名
@type file
@dir audio/se
@desc
再生するSEのファイル名を指定します。
@param Volume
@text SE音量
@type number
@default 90
@desc
再生するSEのvolumeを指定します。
@param Pitch
@text SEピッチ
@type number
@default 100
@desc
再生するSEのpitchを指定します。
@param Pan
@text SE位相
@type number
@default 0
@desc
再生するSEのpanを指定します。
*/
/*!/*~struct~CharacterSpecification:ja
@param CharacterKind
@text キャラクター種別
@type select
@option このイベント
@value thisEvent
@option プレイヤー
@value player
@option フォロワー
@value follower
@option イベント
@value event
@option 乗り物
@value vehicle
@default thisEvent
@desc
キャラクター種別を指定します。
@param CharacterKindByVariable
@text キャラクター種別(変数指定)
@type variable
@default 0
@desc
キャラクター種別を変数で指定します。
@param EventIdOrName
@text イベントID or イベント名
@type string
@default 1
@desc
キャラクター種別にイベントを指定した場合に対象となるイベントIDまたはイベント名を指定します。
@param EventIdByVariable
@text イベントID(変数指定)
@type variable
@default 0
@desc
キャラクター種別にイベントを指定した場合に対象となるイベントIDを変数で指定します。
@param FollowerIndex
@text フォロワーインデックス
@type number
@min 1
@default 1
@desc
キャラクター種別にフォロワーを指定した場合に対象となるフォロワーの順番を指定します。
@param FollowerIndexByVariable
@text フォロワーインデックス(変数指定)
@type variable
@default 0
@desc
キャラクター種別にフォロワーを指定した場合に対象となるフォロワーの順番を変数で指定します。
@param VehicleKind
@text 乗り物種別
@type select
@option 小型船
@value boat
@option 大型船
@value ship
@option 飛行船
@value airship
@default boat
@desc
キャラクター種別に乗り物を指定した場合に対象となる乗り物を指定します。
@param VehicleKindByVariable
@text 乗り物種別(変数指定)
@type variable
@default 0
@desc
キャラクター種別に乗り物を指定した場合に対象となる乗り物を変数で指定します。
*/
/*!/*~struct~SkillSpecification:ja
@param SkillOrItem
@text スキル or アイテム
@type select
@option スキル
@value skill
@option アイテム
@value item
@default skill
@desc スキルまたはアイテムのどちらを指定するかを選択します。
@param SkillId
@type skill
@text スキルID
@default 1
@desc 使用するスキルのIDを指定します。名前指定または変数指定を行った場合、そちらが優先されます。
@param SkillByName
@type string
@text スキル(名前指定)
@desc 使用するスキルの名前を指定します。名前指定を使用しない場合は空欄にしてください。
@param SkillIdByVariable
@type variable
@text スキルID(変数指定)
@default 0
@desc 使用するスキルのIDを変数で指定します。変数指定を使用しない場合は0にしてください。
@param ItemId
@type item
@text アイテムID
@default 1
@desc 使用するアイテムのIDを指定します。名前指定または変数指定を行った場合、そちらが優先されます。
@param ItemByName
@type string
@text アイテム(名前指定)
@desc 使用するアイテムの名前を指定します。名前指定を使用しない場合は空欄にしてください。
@param ItemIdByVariable
@type variable
@text アイテムID(変数指定)
@default 0
@desc 使用するアイテムのIDを変数で指定します。変数指定を使用しない場合は0にしてください。
*/
var __tmp__require = require;
var simpleExported;
if (typeof simpleExported === "undefined") {
simpleExported = {};
}
function simpleImport(path) {
const pathArray = path.split("/");
let module = simpleExported;
for (const key of pathArray) {
module = module[key];
}
return module;
}
function simpleExport(path, obj) {
const pathArray = path.split("/");
let module = simpleExported;
for (const key of pathArray.slice(0, pathArray.length - 1)) {
if (module[key] == null) {
module[key] = {};
}
module = module[key];
}
module[pathArray[pathArray.length - 1]] = obj;
}
var require = (path) => {
return simpleImport(path);
};
("use strict");
(() => {
var __require = /* @__PURE__ */ ((x) =>
typeof require !== "undefined"
? require
: typeof Proxy !== "undefined"
? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b],
})
: x)(function (x) {
if (typeof require !== "undefined") return require.apply(this, arguments);
throw new Error('Dynamic require of "' + x + '" is not supported');
});
// ts/ARPG_Core/ExportDotMoveSystem.ts
simpleExport("DotMoveSystem", DotMoveSystem);
// ts/ARPG_Core/ARPG_Config.ts
var import_DotMoveSystem = __require("DotMoveSystem");
// ts/CommonLibrary/Degree.ts
var _Degree = class {
get value() {
return this._value;
}
static fromDirection(direction) {
switch (direction) {
case 8:
return _Degree.UP;
case 9:
return _Degree.UP_RIGHT;
case 6:
return _Degree.RIGHT;
case 3:
return _Degree.RIGHT_DOWN;
case 2:
return _Degree.DOWN;
case 1:
return _Degree.DOWN_LEFT;
case 4:
return _Degree.LEFT;
case 7:
return _Degree.LEFT_UP;
default:
throw new Error(`${direction} is not found`);
}
}
static fromRad(rad) {
return new _Degree((rad * 180) / Math.PI + 90);
}
constructor(...args) {
this.initialize(...args);
}
initialize(value) {
value %= 360;
if (value < 0) value = 360 + value;
this._value = value;
}
toRad() {
return ((this._value - 90) * Math.PI) / 180;
}
toDirection8() {
const t = Math.round(this._value / 45);
if (t === 0 || t === 8) {
return 8;
} else if (t === 1) {
return 9;
} else if (t === 2) {
return 6;
} else if (t === 3) {
return 3;
} else if (t === 4) {
return 2;
} else if (t === 5) {
return 1;
} else if (t === 6) {
return 4;
} else if (t === 7) {
return 7;
} else {
throw new Error(`${this._value} is not found`);
}
}
toDirection4(lastDirection) {
const t = Math.round(this._value / 45);
if (t === 0 || t === 8) {
return 8;
} else if (t === 1) {
if (lastDirection === 8) return 8;
return 6;
} else if (t === 2) {
return 6;
} else if (t === 3) {
if (lastDirection === 6) return 6;
return 2;
} else if (t === 4) {
return 2;
} else if (t === 5) {
if (lastDirection === 2) return 2;
return 4;
} else if (t === 6) {
return 4;
} else if (t === 7) {
if (lastDirection === 4) return 4;
return 8;
} else {
throw new Error(`${this._value} is not found`);
}
}
isInRange(min, max) {
const minVal = typeof min === "number" ? min : min.value;
const maxVal = typeof max === "number" ? max : max.value;
if (minVal <= maxVal) {
return minVal <= this.value && this.value <= maxVal;
} else {
if (minVal <= this.value && this.value < 360) return true;
if (this.value <= maxVal) return true;
return false;
}
}
add(degree) {
if (typeof degree === "number") {
return new _Degree(this.value + degree);
} else {
return new _Degree(this.value + degree.value);
}
}
sub(degree) {
if (typeof degree === "number") {
return new _Degree(this.value - degree);
} else {
return new _Degree(this.value - degree.value);
}
}
};
var Degree = _Degree;
Degree.UP = new _Degree(0);
Degree.UP_RIGHT = new _Degree(45);
Degree.RIGHT = new _Degree(90);
Degree.RIGHT_DOWN = new _Degree(135);
Degree.DOWN = new _Degree(180);
Degree.DOWN_LEFT = new _Degree(225);
Degree.LEFT = new _Degree(270);
Degree.LEFT_UP = new _Degree(315);
// ts/CommonLibrary/PluginParamsParser.ts
var PluginParamsParser = class {
static parse(params, typeData = {}, predictEnable = true) {
return new PluginParamsParser(predictEnable).parse(params, typeData);
}
constructor(predictEnable = true) {
this._predictEnable = predictEnable;
}
parse(params, typeData = {}) {
const result = {};
for (const name in params) {
const expandedParam = this.expandParam(params[name]);
result[name] = this.convertParam(expandedParam, typeData[name]);
}
return result;
}
expandParam(strParam, loopCount = 0) {
if (++loopCount > 255) throw new Error("endless loop error");
if (strParam.match(/^\s*\[.*\]\s*$/)) {
const aryParam = JSON.parse(strParam);
return aryParam.map((data) => this.expandParam(data), loopCount + 1);
} else if (strParam.match(/^\s*\{.*\}\s*$/)) {
const result = {};
const objParam = JSON.parse(strParam);
for (const name in objParam) {
result[name] = this.expandParam(objParam[name], loopCount + 1);
}
return result;
}
return strParam;
}
convertParam(param, type, loopCount = 0) {
if (++loopCount > 255) throw new Error("endless loop error");
if (typeof param === "string") {
return this.cast(param, type);
} else if (typeof param === "object" && param instanceof Array) {
if (
!(
param == null ||
(typeof param === "object" && param instanceof Array)
)
) {
throw new Error(`Invalid array type: ${type}`);
}
return param.map((data, i) => {
const dataType = type == null ? void 0 : type[i];
return this.convertParam(data, dataType, loopCount + 1);
});
} else if (typeof param === "object") {
if (!(param == null || typeof param === "object")) {
throw new Error(`Invalid object type: ${type}`);
}
const result = {};
for (const name in param) {
const dataType = type == null ? void 0 : type[name];
result[name] = this.convertParam(
param[name],
dataType,
loopCount + 1
);
}
return result;
} else {
throw new Error(`Invalid param: ${param}`);
}
}
cast(param, type) {
if (param == null || param === "") return void 0;
if (type == null) type = "any";
switch (type) {
case "any":
if (!this._predictEnable) throw new Error("Predict mode is disable");
return this.cast(param, this.predict(param));
case "string":
return param;
case "number":
if (param.match(/^\-?\d+\.\d+$/)) return parseFloat(param);
return parseInt(param);
case "boolean":
return param === "true";
default:
throw new Error(`Unknow type: ${type}`);
}
}
predict(param) {
if (param.match(/^\-?\d+$/) || param.match(/^\-?\d+\.\d+$/)) {
return "number";
} else if (param === "true" || param === "false") {
return "boolean";
} else {
return "string";
}
}
};
// ts/ARPG_Core/ARPG_Utils.ts
var ARPG_Utils = class {
static searchNearBattler(subjectCharacter, target) {
if (!subjectCharacter.isBattler())
throw new Error(`Subject character is not battler.`);
const actorCharacters = this.allAliveActorCharacters();
const enemyCharacters = this.allAliveEnemyCharacters();
if (target === "opponent") {
if (subjectCharacter.battler().isActor()) {
return this.searchNearCharacter(subjectCharacter, enemyCharacters);
} else {
return this.searchNearCharacter(subjectCharacter, actorCharacters);
}
} else if (target === "friend") {
if (subjectCharacter.battler().isActor()) {
return this.searchNearCharacter(subjectCharacter, actorCharacters);
} else {
return this.searchNearCharacter(subjectCharacter, enemyCharacters);
}
} else {
return this.searchNearCharacter(
subjectCharacter,
actorCharacters.concat(enemyCharacters)
);
}
}
static searchNearCharacter(subjectCharacter, targetCharacters) {
let minFar;
let minFarCharacter;
for (const targetCharacter of targetCharacters) {
if (targetCharacter == subjectCharacter) continue;
const far = subjectCharacter.calcFar(targetCharacter);
if (minFar == null || far <= minFar) {
minFar = far;
minFarCharacter = targetCharacter;
}
}
if (minFar == null) minFar = 0;
return { character: minFarCharacter, far: minFar };
}
static countEnemies() {
const enemyCharacters = $gameMap.events().filter((event) => {
return event.battler().isEnemy() && event.battler().isAlive();
});
return enemyCharacters.length;
}
static isFront(subject, target, range) {
const deg = subject
.centerPositionPoint()
.calcDeg(target.centerPositionPoint());
const dirDeg = Degree.fromDirection(subject.direction());
const minDeg = dirDeg.value - range / 2;
const maxDeg = dirDeg.value + range / 2;
return new Degree(deg.value).isInRange(minDeg, maxDeg);
}
static hasActionItem(item) {
if (item == null) return false;
return !!item.meta.action;
}
static allBattlerCharacters() {
const allCharacters = [...$gameMap.allCharacters()];
return allCharacters.filter((character) => {
if (!(character instanceof Game_Character)) return false;
if (!character.isBattler()) return false;
return true;
});
}
static allAliveBattlerCharacters() {
return this.allBattlerCharacters().filter((character) => {
if (character.battler().isDead()) return false;
return true;
});
}
static allActorCharacters() {
return this.allBattlerCharacters().filter((character) => {
if (!character.battler().isActor()) return false;
return true;
});
}
static allAliveActorCharacters() {
return this.allAliveBattlerCharacters().filter((character) => {
if (!character.battler().isActor()) return false;
return true;
});
}
static allEnemyCharacters() {
return this.allBattlerCharacters().filter((character) => {
if (!character.battler().isEnemy()) return false;
return true;
});
}
static allAliveEnemyCharacters() {
return this.allAliveBattlerCharacters().filter((character) => {
if (!character.battler().isEnemy()) return false;
return true;
});
}
static searchSkillId(skillName) {
const foundSkill = $dataSkills.find((skill) => {
if (!skill) return false;
return skill.name === skillName;
});
if (foundSkill) return foundSkill.id;
return void 0;
}
static characterKindValue(character) {
if (character instanceof Game_Player) {
return 1;
} else if (character instanceof Game_Follower) {
return 2;
} else if (character instanceof Game_Event) {
return 3;
} else if (character instanceof Game_Vehicle) {
return 4;
}
throw new Error(`Character has not kind value.`);
}
static registerKey(name, key) {
switch (key.KeyName) {
case "ok":
case "escape":
case "shift":
case "down":
case "left":
case "right":
case "up":
case "pageup":
case "pagedown":
this._keyTable[name] = key.KeyName;
break;
case "other":
if (key.KeySymbol != null && key.KeySymbol !== "") {
this._keyTable[name] = key.KeySymbol;
if (key.KeyCode >= 0) {
Input.keyMapper[key.KeyCode] = key.KeySymbol;
}
if (key.ButtonIndex >= 0) {
Input.gamepadMapper[key.ButtonIndex] = key.KeySymbol;
}
}
break;
}
}
static getKeySymbol(name) {
return this._keyTable[name];
}
};
ARPG_Utils._keyTable = {};
// ts/ARPG_Core/ErrorManager.ts
var ErrorManager = class {
static skillActivationUnusedSkillError() {
let message;
if (ARPG_CorePluginParams.ErrorMessageLanguage === "ja") {
message = `\u30B9\u30AD\u30EB\u672A\u4F7F\u7528\u306E\u72B6\u614B\u3067\u30B9\u30AD\u30EB\u767A\u52D5\u3092\u884C\u3046\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002`;
} else {
message = `You cannot activate the skill while the skill is unused.`;
}
return new Error(message);
}
static applySkillEffectUnusedSkillError() {
let message;
if (ARPG_CorePluginParams.ErrorMessageLanguage === "ja") {
message = `\u30B9\u30AD\u30EB\u672A\u4F7F\u7528\u306E\u72B6\u614B\u3067\u30B9\u30AD\u30EB\u52B9\u679C\u9069\u7528\u3092\u884C\u3046\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002`;
} else {
message = `The skill effect cannot be applied while the skill is not used.`;
}
return new Error(message);
}
static applySkillEffectUnActivate() {
let message;
if (ARPG_CorePluginParams.ErrorMessageLanguage === "ja") {
message = `\u30B9\u30AD\u30EB\u3092\u767A\u52D5\u3057\u3066\u3044\u306A\u3044\u72B6\u614B\u3067\u30B9\u30AD\u30EB\u52B9\u679C\u9069\u7528\u3092\u884C\u3046\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002`;
} else {
message = `Skill effects cannot be applied while the skill is not activated.`;
}
return new Error(message);
}
static testApplySkillEffectUnusedSkillError() {
let message;
if (ARPG_CorePluginParams.ErrorMessageLanguage === "ja") {
message = `\u30B9\u30AD\u30EB\u672A\u4F7F\u7528\u306E\u72B6\u614B\u3067\u30B9\u30AD\u30EB\u52B9\u679C\u9069\u7528\u30C6\u30B9\u30C8\u3092\u884C\u3046\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002`;
} else {
message = `Skill effect application test cannot be performed while skill is not used.`;
}
return new Error(message);
}
static makeSkillObjectUnActivate() {
let message;
if (ARPG_CorePluginParams.ErrorMessageLanguage === "ja") {
message = `\u30B9\u30AD\u30EB\u306E\u767A\u52D5\u3092\u884C\u308F\u305A\u306B\u30B9\u30AD\u30EB\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u751F\u6210\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002`;
} else {
message = `A skill object cannot be created without activating the skill.`;
}
return new Error(message);
}
static makeSkillObjectNotBattlerOrSkillObject() {
let message;
if (ARPG_CorePluginParams.ErrorMessageLanguage === "ja") {
message = `\u30D0\u30C8\u30E9\u30FC\u307E\u305F\u306F\u30B9\u30AD\u30EB\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u306A\u3044\u30A4\u30D9\u30F3\u30C8\u306F\u30B9\u30AD\u30EB\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u751F\u6210\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002`;
} else {
message = `Events that are not battlers or skill objects cannot generate skill objects.`;
}
return new Error(message);
}
};
// ts/ARPG_Core/HitBox.ts
var HitBox = class extends Game_Character {
constructor(...args) {
super(...args);
}
get owner() {
return this._owner;
}
get hitArea() {
return this._hitArea;
}
set hitArea(_hitArea) {
this._hitArea = _hitArea;
}
get enabled() {
return this._enabled;
}
set enabled(value) {
this._enabled = value;
}
get hitBoxColor() {
return this._hitBoxColor;
}
get type() {
return this._type;
}
get customTag() {
return this._customTag;
}
initialize(...args) {
super.initialize();
const [type, owner, hitArea, hitBoxColor, customTag] = args;
this._owner = owner;
this._hitArea = hitArea;
this._enabled = true;
this._hitBoxColor = hitBoxColor;
this._type = type;
this._customTag = customTag;
this.updatePosition();
}
update() {
super.update();
this.updatePosition();
}
updatePosition() {
const ownerPos = this._owner.positionPoint();
this.setPositionPoint(
new DotMoveSystem.DotMovePoint(
ownerPos.x + this._hitArea.x,
ownerPos.y + this._hitArea.y
)
);
}
width() {
return this._hitArea.width;
}
height() {
return this._hitArea.height;
}
checkHitCharactersByHitBox(type, customTag = "") {
if (!this.enabled) return [];
const hitCharacters = /* @__PURE__ */ new Set();
const results = this.checkHitCharacters(HitBox);
for (const result of results) {
const targetHitBox = result.targetObject;
if (this.owner === targetHitBox.owner) continue;
if (!targetHitBox.enabled) continue;
if (targetHitBox.type !== type) continue;
if (
targetHitBox.type === "custom" &&
targetHitBox.customTag !== customTag
)
continue;
hitCharacters.add(targetHitBox.owner);
}
return hitCharacters;
}
getHitBoxSprite() {
if (!(SceneManager._scene instanceof Scene_Map)) return void 0;
const spriteset = SceneManager._scene._spriteset;
return spriteset.findTargetHitBoxSprite(this);
}
screenX() {
const tw = $gameMap.tileWidth();
return Math.floor(this.scrolledX() * tw);
}
screenY() {
const th = $gameMap.tileHeight();
return Math.floor(this.scrolledY() * th);
}
screenZ() {
return 255;
}
};
// ts/CommonLibrary/ComponentRunner.ts
var ComponentRunner = class {
constructor(character) {
this._components = /* @__PURE__ */ new Set();
this._end = false;
this._character = character;
}
prepareUpdate() {
for (const component of this._components) {
component.prepareUpdateComponent();
}
}
update() {
if (this._end) return;
const components = [...this._components];
for (const component of components) {
component.updateComponent();
if (component.isTerminated()) {
this.removeComponent(component);
}
}
}
addComponent(component) {
this._components.add(component);
component.setCharacter(this._character);
}
removeComponent(component) {
this._components.delete(component);
}
hasComponent(component) {
if (component == null) return false;
return this._components.has(component);
}
hasComponentByClass(componentClass) {
return !![...this._components].find((c) => c instanceof componentClass);
}
end() {
for (const component of this._components) {
component.end(true);
}
}
isEnd() {
return this._end;
}
};
// ts/CommonLibrary/Component.ts
var Component = class {
constructor() {
this._end = false;
this._terminated = false;
this._started = false;
this._stopped = false;
this._calledSuperMethodNames = [];
}
setCharacter(character) {
this._character = character;
this._componentRunner = new ComponentRunner(character);
this._stopped = false;
this.setup();
}
isStarted() {
return this._started;
}
isStopped() {
if (this._end) return true;
return this._stopped;
}
isBusy() {
return !this.isStopped();
}
stop() {
this._stopped = true;
}
resume() {
this._stopped = false;
}
isEnd() {
return this._end;
}
isTerminated() {
return this._terminated;
}
end(fastTerminate = false) {
this._end = true;
if (fastTerminate) {
this.updateComponent();
}
}
prepareUpdateComponent() {
if (this._end) return;
if (this._stopped) return;
if (this._started) {
this._componentRunner.prepareUpdate();
this._calledSuperMethodNames = [];
this.prepareUpdate();
this.checkSuperMethodCalled("prepareUpdate");
}
}
updateComponent() {
if (!this._end && !this._stopped) {
this._componentRunner.update();
if (this._started) {
this._calledSuperMethodNames = [];
this.update();
this.checkSuperMethodCalled("update");
} else {
this._started = true;
this._calledSuperMethodNames = [];
this.start();
this.checkSuperMethodCalled("start");
}
}
if (this._end && !this._terminated) {
this._terminated = true;
this._calledSuperMethodNames = [];
this.terminate();
this.checkSuperMethodCalled("terminate");
this._componentRunner.end();
}
}
addComponent(component) {
this._componentRunner.addComponent(component);
}
removeComponent(component) {
this._componentRunner.removeComponent(component);
}
hasComponent(component) {
return this._componentRunner.hasComponent(component);
}
hasComponentByClass(componentClass) {
return this._componentRunner.hasComponentByClass(componentClass);
}
setup() {
this._calledSuperMethodNames.push("setup");
}
start() {
this._calledSuperMethodNames.push("start");
}
prepareUpdate() {
this._calledSuperMethodNames.push("prepareUpdate");
}
update() {
this._calledSuperMethodNames.push("update");
}
terminate() {
this._calledSuperMethodNames.push("terminate");
}
checkSuperMethodCalled(methodName) {
if (!this._calledSuperMethodNames.includes(methodName)) {
throw new Error(
`${this.constructor.name}: super.${methodName}() is not called.`
);
}
}
};
// ts/ARPG_Core/HitChecker.ts
var HitChecker = class extends Component {
constructor(type, customTag) {
super();
this._hitBoxs = [];
this._type = type;
this._customTag = customTag;
}
get hitBoxs() {
return this._hitBoxs;
}
get type() {
return this._type;
}
get customTag() {
return this._customTag;
}
update() {
super.update();
for (const hitBox of this._hitBoxs) {
hitBox.update();
}
}
addHitBox(hitBox) {
if (this.type !== hitBox.type) {
throw new Error(
`mismatch: hitChecker.type=${this.type}, hitBox.type=${hitBox.type}`
);
}
if (this.type === "custom" && this.customTag !== hitBox.customTag) {
throw new Error(
`mismatch: hitChecker.customTag=${this.customTag}, hitBox.customTag=${hitBox.customTag}`
);
}
this._hitBoxs.push(hitBox);
}
clearHitBoxs() {
this._hitBoxs = [];
}
checkHit(hitBoxType, customTag = "") {
const hitCharacters = /* @__PURE__ */ new Set();
for (const hitBox of this._hitBoxs) {
for (const character of hitBox.checkHitCharactersByHitBox(
hitBoxType,
customTag
)) {
hitCharacters.add(character);
}
}
return hitCharacters;
}
checkHitByOtherHitChecker(otherHitChecker) {
for (const subjectHitBox of this._hitBoxs) {
if (!subjectHitBox.enabled) continue;
for (const result of subjectHitBox.checkHitCharacters(HitBox)) {
for (const targetHitBox of otherHitChecker.hitBoxs) {
if (result.targetObject === targetHitBox) return true;
}
}
}
return false;
}
allHitBoxToEnable() {
for (const hitBox of this._hitBoxs) {
hitBox.enabled = true;
}
}
allHitBoxToDisable() {
for (const hitBox of this._hitBoxs) {
hitBox.enabled = false;
}
}
};
// ts/ARPG_Core/ARPG_Config.ts
var ARPG_CorePluginName = document.currentScript
? decodeURIComponent(document.currentScript.src.match(/^.*\/(.+)\.js$/)[1])
: "ARPG_Core";
var ARPG_CorePluginParams = PluginParamsParser.parse(
PluginManager.parameters(ARPG_CorePluginName)
);
if (ARPG_CorePluginParams.KeySetting.ActorNormalAttack != null) {
ARPG_Utils.registerKey(
"ActorNormalAttack",
ARPG_CorePluginParams.KeySetting.ActorNormalAttack
);
}
if (ARPG_CorePluginParams.KeySetting.ActorGuard != null) {
ARPG_Utils.registerKey(
"ActorGuard",
ARPG_CorePluginParams.KeySetting.ActorGuard
);
}
if (ARPG_CorePluginParams.KeySetting.VisibleHitBox != null) {
ARPG_Utils.registerKey(
"VisibleHitBox",
ARPG_CorePluginParams.KeySetting.VisibleHitBox
);
}
PluginManager.registerCommand(
ARPG_CorePluginName,
"ChangeARPGMode",
function (args) {
const params = PluginParamsParser.parse(args);
const arpgMode = !!params.ARPGMode;
if (arpgMode) {
$gameMap.startARPGMode();
} else {
$gameMap.endARPGMode();
}
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"MakeDynamicEvent",
function (args) {
const typeDefine = {
SrcMapId: "number",
SrcEventIdOrName: "string",
X: "number",
XByVariable: "number",
Y: "number",
YByVariable: "number",
MadeDynamicEventId: "number",
};
const params = PluginParamsParser.parse(args, typeDefine);
const x =
params.XByVariable > 0
? $gameVariables.value(params.XByVariable)
: params.X;
const y =
params.YByVariable > 0
? $gameVariables.value(params.YByVariable)
: params.Y;
const event = $gameMap.makeDynamicEvent(
params.SrcMapId,
params.SrcEventIdOrName,
x,
y
);
if (params.MadeDynamicEventId > 0) {
$gameVariables.setValue(params.MadeDynamicEventId, event.eventId());
}
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"GetCharacterFloatPosition",
function (args) {
const params = PluginParamsParser.parse(args);
const character = this.findCharacterBySpecification(
params.CharacterSpecification
);
let pos;
if (params.LeftUpOrCenter === "center") {
pos = character.centerPositionPoint();
} else {
pos = character.positionPoint();
}
$gameVariables.setValue(params.StoreFloatXVariableId, pos.x);
$gameVariables.setValue(params.StoreFloatYVariableId, pos.y);
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"CalcDeg",
function (args) {
const params = PluginParamsParser.parse(args);
const subject = this.findCharacterBySpecification(
params.SubjectCharacterSpecification
);
const target = this.findCharacterBySpecification(
params.TargetCharacterSpecification
);
$gameVariables.setValue(
params.StoreDegreeVariableId,
subject.calcDeg(target)
);
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"CalcFar",
function (args) {
const params = PluginParamsParser.parse(args);
const subject = this.findCharacterBySpecification(
params.SubjectCharacterSpecification
);
const target = this.findCharacterBySpecification(
params.TargetCharacterSpecification
);
$gameVariables.setValue(
params.StoreFarVariableId,
subject.calcFar(target)
);
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"CheckInTheScreen",
function (args) {
const params = PluginParamsParser.parse(args);
const character = this.findCharacterBySpecification(
params.CharacterSpecification
);
const xMargin = params.XMargin ?? 2;
const yMargin = params.YMargin ?? 2;
$gameSwitches.setValue(
params.StoreResultSwitchId,
character.isInTheScreen(xMargin, yMargin)
);
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"CheckMoved",
function (args) {
const params = PluginParamsParser.parse(args);
const character = this.findCharacterBySpecification(
params.CharacterSpecification
);
$gameSwitches.setValue(params.StoreResultSwitchId, character.isMoved());
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"SetupEnemy",
function (args) {
const params = PluginParamsParser.parse(args);
const event = this.event();
if (!event) return;
let collideAttackSkillId;
if (
params.CollideAttackSkillId != null &&
params.CollideAttackSkillId > 0
) {
collideAttackSkillId = params.CollideAttackSkillId;
} else if (
ARPG_CorePluginParams.EnemySetting.CollideAttackSkillId != null &&
ARPG_CorePluginParams.EnemySetting.CollideAttackSkillId > 0
) {
collideAttackSkillId =
ARPG_CorePluginParams.EnemySetting.CollideAttackSkillId;
}
event.setupEnemy(params.EnemyId, {
collideAttackSkillId,
damageCommonEventId: params.DamageCommonEventId,
defeatEnemyCommonEventId: params.DefeatEnemyCommonEventId,
});
if (params.HpGauge === "normal") {
event
.battler()
.setupHpGauge(
ARPG_CorePluginParams.EnemyHpGaugeSetting.NormalEnemyHpGaugeColor1,
ARPG_CorePluginParams.EnemyHpGaugeSetting.NormalEnemyHpGaugeColor2
);
} else if (params.HpGauge === "boss") {
$gameTemp.arpgGlobalTempData().bossHpGaugeTargetEnemy = event.battler();
}
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"ChangeHpGaugeVisible",
function (args) {
const params = PluginParamsParser.parse(args);
const character = this.findCharacterBySpecification(
params.CharacterSpecification
);
if (!(character && character instanceof Game_Event)) return;
character.battler().setHpGaugeVisible(!!params.ShowOrHide);
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"SetupFieldObject",
function () {
const event = this.event();
if (!event) return;
event.setupFieldObject();
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"UseSkill",
function (args) {
const params = PluginParamsParser.parse(args);
const user = this.arpgCharacter();
let idOrName;
if (params.SkillIdByVariable > 0) {
idOrName = $gameVariables.value(params.SkillIdByVariable);
} else if (params.SkillByName && params.SkillByName !== "") {
idOrName = params.SkillByName;
} else {
idOrName = params.SkillId;
}
user.battler().useSkill("skill", idOrName);
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"UseItem",
function (args) {
const params = PluginParamsParser.parse(args);
const user = this.arpgCharacter();
let idOrName;
if (params.ItemIdByVariable > 0) {
idOrName = $gameVariables.value(params.ItemIdByVariable);
} else if (params.ItemByName && params.ItemByName !== "") {
idOrName = params.ItemByName;
} else {
idOrName = params.ItemId;
}
user.battler().useSkill("item", idOrName);
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"SkillActivation",
function (args) {
const params = PluginParamsParser.parse(args, {
ChantCommonEventId: "number",
});
this.arpgCharacter().battler().skillActivation(params.ChantCommonEventId);
this._needChantWait = true;
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"ChangeSkillCancelWhenDamageEnableOrDisable",
function (args) {
const params = PluginParamsParser.parse(args);
this.arpgCharacter()
.battler()
.setSkillCancelWhenDamageEnable(!!params.EnableOrDisable);
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"ApplySkillEffect",
function (args) {
const params = PluginParamsParser.parse(args);
let skill;
if (params.IsSkillSpecification) {
skill = this.findArpgSkillBySpecification(params.SkillSpecification);
}
this.arpgCharacter().battler().applySkillEffect(skill);
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"TestApplySkillEffect",
function (args) {
const params = PluginParamsParser.parse(args);
let skill;
if (params.IsSkillSpecification) {
skill = this.findArpgSkillBySpecification(params.SkillSpecification);
}
const result = this.arpgCharacter().battler().testApplySkillEffect(skill);
$gameSwitches.setValue(params.StoreResultSwitchId, result);
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"MakeSkillObject",
function (args) {
const params = PluginParamsParser.parse(args);
const user = this.arpgCharacter();
if (!(user.isBattler() || user.isSkillObject())) {
throw ErrorManager.makeSkillObjectNotBattlerOrSkillObject();
}
let event;
let skill;
if (params.IsSkillSpecification) {
skill = this.findArpgSkillBySpecification(params.SkillSpecification);
}
if (user.isBattler()) {
event = user
.battler()
.makeSkillObject(params.SrcMapId, params.SrcEventIdOrName, skill);
} else {
event = user
.skillObject()
.makeSkillObject(params.SrcMapId, params.SrcEventIdOrName, skill);
}
let x = 0;
let y = 0;
const userPos = user.centerPositionPoint();
switch (params.SkillObjectPosition.Specification) {
case "current":
x = userPos.x - event.width() / 2;
y = userPos.y - event.height() / 2;
break;
case "forward":
const userForwardPos =
import_DotMoveSystem.DotMoveUtils.nextPointWithDirection(
userPos,
user.direction()
);
x = userForwardPos.x - event.width() / 2;
y = userForwardPos.y - event.height() / 2;
break;
case "character":
const target = this.findCharacterBySpecification(
params.SkillObjectPosition.CharacterSpecification
);
const targetPos = target.centerPositionPoint();
x = targetPos.x - event.width() / 2;
y = targetPos.y - event.height() / 2;
break;
case "custom":
const xByVariable =
params.SkillObjectPosition.CustomPosition.XByVariable;
const yByVariable =
params.SkillObjectPosition.CustomPosition.YByVariable;
x =
xByVariable > 0
? $gameVariables.value(xByVariable)
: params.SkillObjectPosition.CustomPosition.X;
y =
yByVariable > 0
? $gameVariables.value(yByVariable)
: params.SkillObjectPosition.CustomPosition.Y;
break;
}
event.setPosition(x, y);
if (params.MadeDynamicEventId > 0) {
$gameVariables.setValue(params.MadeDynamicEventId, event.eventId());
}
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"SetAttackDegree",
function (args) {
const params = PluginParamsParser.parse(args);
const character = this.findCharacterBySpecification(
params.CharacterSpecification
);
const skillObject = character.skillObject();
const attackDeg =
params.AttackDegreeByVariable > 0
? $gameVariables.value(params.AttackDegreeByVariable)
: params.AttackDegree;
skillObject.setAttackDeg(new Degree(attackDeg));
}
);
function findHitChecker(character, hitBoxType, customHitBoxTag) {
let hitChecker;
if (hitBoxType === "attack") {
if (character.isBattler()) {
const battler = character.battler();
hitChecker = battler.attackHitChecker;
} else if (character.isSkillObject()) {
const skillObject = character.skillObject();
hitChecker = skillObject.attackHitChecker;
}
if (!hitChecker) {
throw new Error(`Event is not ARPG_Battler or ARPG_SkillObject`);
}
} else if (hitBoxType === "damage") {
if (character.isBattler()) {
const battler = character.battler();
hitChecker = battler.damageHitChecker;
}
if (!hitChecker) {
throw new Error(`Event is not ARPG_Battler`);
}
} else if (hitBoxType === "custom") {
let customHitChecker;
if (character.isBattler()) {
customHitChecker = character
.battler()
.customHitCheckers.get(customHitBoxTag);
if (!customHitChecker) {
customHitChecker = new HitChecker("custom", customHitBoxTag);
character
.battler()
.customHitCheckers.set(customHitBoxTag, customHitChecker);
character.battler().addComponent(customHitChecker);
}
} else if (character.isSkillObject()) {
customHitChecker = character
.skillObject()
.customHitCheckers.get(customHitBoxTag);
if (!customHitChecker) {
customHitChecker = new HitChecker("custom", customHitBoxTag);
character
.skillObject()
.customHitCheckers.set(customHitBoxTag, customHitChecker);
character.skillObject().addComponent(customHitChecker);
}
} else if (character.isFieldObject()) {
customHitChecker = character
.fieldObject()
.customHitCheckers.get(customHitBoxTag);
if (!customHitChecker) {
customHitChecker = new HitChecker("custom", customHitBoxTag);
character
.fieldObject()
.customHitCheckers.set(customHitBoxTag, customHitChecker);
character.fieldObject().addComponent(customHitChecker);
}
}
if (!customHitChecker) {
throw new Error(
`Event is not ARPG_Battler or ARPG_SkillObject or ARPG_FieldObject`
);
}
hitChecker = customHitChecker;
}
return hitChecker;
}
PluginManager.registerCommand(
ARPG_CorePluginName,
"SetHitBox",
function (args) {
const params = PluginParamsParser.parse(args);
const character = this.findCharacterBySpecification(
params.CharacterSpecification
);
if (!character) return;
const hitChecker = findHitChecker(
character,
params.HitBoxType,
params.CustomHitBoxTag
);
hitChecker.clearHitBoxs();
for (const hitBoxParam of params.HitBoxList) {
const rect = new Rectangle(
hitBoxParam.X,
hitBoxParam.Y,
hitBoxParam.Width,
hitBoxParam.Height
);
if (params.HitBoxType === "attack") {
const hitBox = new HitBox(
"attack",
character,
rect,
ARPG_CorePluginParams.HitBoxSetting.AttackHitBoxColor
);
hitChecker.addHitBox(hitBox);
} else if (params.HitBoxType === "damage") {
const hitBox = new HitBox(
"damage",
character,
rect,
ARPG_CorePluginParams.HitBoxSetting.DamageHitBoxColor
);
hitChecker.addHitBox(hitBox);
} else if (params.HitBoxType === "custom") {
let color;
const info =
ARPG_CorePluginParams.HitBoxSetting.CustomHitBoxColorList.find(
(info2) => info2.CustomHitBoxTag === params.CustomHitBoxTag
);
if (info) {
color = info.Color;
} else {
color =
ARPG_CorePluginParams.HitBoxSetting.CustomHitBoxDefaultColor;
}
const hitBox = new HitBox(
"custom",
character,
rect,
color,
params.CustomHitBoxTag
);
hitChecker.addHitBox(hitBox);
}
}
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"ChangeHitBoxEnableOrDisable",
function (args) {
const params = PluginParamsParser.parse(args);
const character = this.findCharacterBySpecification(
params.CharacterSpecification
);
if (!character) return;
const hitChecker = findHitChecker(
character,
params.HitBoxType,
params.CustomHitBoxTag
);
if (params.Enabled) {
hitChecker.allHitBoxToEnable();
} else {
hitChecker.allHitBoxToDisable();
}
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"HitCheck",
function (args) {
const params = PluginParamsParser.parse(args);
const subjectCharacter = this.findCharacterBySpecification(
params.SubjectCharacterSpecification
);
if (!subjectCharacter) return;
const subjectHitChecker = findHitChecker(
subjectCharacter,
params.SubjectHitBoxType,
params.SubjectCustomHitBoxTag
);
if (params.IsTargetSpecification) {
const targetCharacter = this.findCharacterBySpecification(
params.TargetCharacterSpecification
);
const targetHitChecker = findHitChecker(
targetCharacter,
params.TargetHitBoxType,
params.TargetCustomHitBoxTag
);
const result =
subjectHitChecker.checkHitByOtherHitChecker(targetHitChecker);
$gameSwitches.setValue(params.StoreResultSwitchId, result);
} else {
const results = subjectHitChecker.checkHit(
params.TargetHitBoxType,
params.TargetCustomHitBoxTag
);
$gameSwitches.setValue(params.StoreResultSwitchId, results.size > 0);
}
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"GetBattlerStatus",
function (args) {
const params = PluginParamsParser.parse(args);
const character = this.findCharacterBySpecification(
params.CharacterSpecification
);
if (!character.isBattler())
throw new Error(
`battler is not found. (EventId=${params.CharacterSpecification})`
);
const battler = character.battler();
const value = battler[params.StatusType];
if (value == null) {
throw new Error(
`StatusType is invalid. (StatusType=${params.StatusType})`
);
}
$gameVariables.setValue(params.DestVariableId, value);
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"SetBattlerStatus",
function (args) {
const params = PluginParamsParser.parse(args);
const character = this.findCharacterBySpecification(
params.CharacterSpecification
);
if (!character.isBattler())
throw new Error(
`battler is not found. (EventId=${params.CharacterSpecification})`
);
const battler = character.battler();
const value =
params.ValueByVariable > 0
? $gameVariables.value(params.ValueByVariable)
: params.Value;
switch (params.StatusType) {
case "hp":
battler.hp = value;
break;
case "mp":
battler.mp = value;
break;
case "tp":
battler.tp = value;
break;
default:
throw new Error(
`StatusType is invalid. (StatusType=${params.StatusType})`
);
}
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"GetBattlerARPGParameter",
function (args) {
const params = PluginParamsParser.parse(args);
const character = this.findCharacterBySpecification(
params.CharacterSpecification
);
if (!character.isBattler())
throw new Error(
`battler is not found. (EventId=${params.CharacterSpecification})`
);
const battler = character.battler();
let value;
switch (params.ARPGParameterType) {
case "skillCancelDamageRate":
value = battler.arpgParameters().skillCancelDamageRate;
break;
case "justGuardFrame":
const justGuardFrame = battler.arpgParameters().justGuardFrame;
value = justGuardFrame == null ? 0 : justGuardFrame;
break;
default:
throw new Error(
`ARPGParameterType is invalid. (ARPGParameterType=${params.ARPGParameterType})`
);
}
$gameVariables.setValue(params.DestVariableId, value);
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"SetBattlerARPGParameter",
function (args) {
const params = PluginParamsParser.parse(args);
const character = this.findCharacterBySpecification(
params.CharacterSpecification
);
if (!character.isBattler())
throw new Error(
`battler is not found. (EventId=${params.CharacterSpecification})`
);
const battler = character.battler();
const value =
params.ValueByVariable > 0
? $gameVariables.value(params.ValueByVariable)
: params.Value;
switch (params.ARPGParameterType) {
case "skillCancelDamageRate":
battler.arpgParameters().skillCancelDamageRate = value;
break;
case "justGuardFrame":
battler.arpgParameters().justGuardFrame = value;
break;
default:
throw new Error(
`ARPGParameterType is invalid. (ARPGParameterType=${params.ARPGParameterType})`
);
}
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"GetBattlerARPGFlag",
function (args) {
const params = PluginParamsParser.parse(args);
const character = this.findCharacterBySpecification(
params.CharacterSpecification
);
if (!character.isBattler())
throw new Error(
`battler is not found. (EventId=${params.CharacterSpecification})`
);
const battler = character.battler();
let value;
switch (params.ARPGFlagType) {
case "noDamageFlag":
value = battler.arpgParameters().noDamageFlag;
break;
case "noAttackFlag":
value = battler.arpgParameters().noAttackFlag;
break;
default:
throw new Error(
`ARPGFlagType is invalid. (ARPGFlagType=${params.ARPGFlagType})`
);
}
$gameSwitches.setValue(params.DestSwitchId, value);
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"SetBattlerARPGFlag",
function (args) {
const params = PluginParamsParser.parse(args);
const character = this.findCharacterBySpecification(
params.CharacterSpecification
);
if (!character.isBattler())
throw new Error(
`battler is not found. (EventId=${params.CharacterSpecification})`
);
const battler = character.battler();
const value =
params.ValueBySwitch > 0
? $gameSwitches.value(params.ValueBySwitch)
: params.Value;
switch (params.ARPGFlagType) {
case "noDamageFlag":
battler.arpgParameters().noDamageFlag = value;
break;
case "noAttackFlag":
battler.arpgParameters().noAttackFlag = value;
break;
default:
throw new Error(
`ARPGFlagType is invalid. (ARPGFlagType=${params.ARPGFlagType})`
);
}
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"CharacterBlowAway",
function (args) {
const params = PluginParamsParser.parse(args);
const character = this.findCharacterBySpecification(
params.CharacterSpecification
);
const deg = new Degree(
params.DegreeByVariable > 0
? $gameVariables.value(params.DegreeByVariable)
: params.Degree
);
const initialVelocity =
params.InitialVelocityByVariable > 0
? $gameVariables.value(params.InitialVelocityByVariable)
: params.InitialVelocity;
const duration =
params.DurationByVariable > 0
? $gameVariables.value(params.DurationByVariable)
: params.Duration;
character.startKnockback(deg, initialVelocity, duration);
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"TargetSelect",
function (args) {
const typeDefine = {
SelectResultSwitchId: "number",
SelectedTargetCharacterKindVariableId: "number",
SelectedTargetEventIdVariableId: "number",
Wait: "boolean",
Cancelable: "boolean",
};
const params = PluginParamsParser.parse(args, typeDefine);
if ($gameTemp.arpgGlobalTempData().selectResultSwitchId > 0) {
$gameSwitches.setValue(params.SelectResultSwitchId, false);
}
$gameTemp.arpgGlobalTempData().selectResultSwitchId =
params.SelectResultSwitchId;
$gameTemp.arpgGlobalTempData().selectedTargetCharacterKindVariableId =
params.SelectedTargetCharacterKindVariableId;
$gameTemp.arpgGlobalTempData().selectedTargetEventIdVariableId =
params.SelectedTargetEventIdVariableId;
$gameMap.startTargetSelect({
wait: params.Wait,
cancelable: params.Cancelable,
});
this._needTargetSelectWait = true;
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"SearchNearBattler",
function (args) {
const params = PluginParamsParser.parse(args);
const character = this.findCharacterBySpecification(
params.SubjectCharacterSpecification
);
let found = false;
if (character.isBattler()) {
const { character: foundCharacter } = ARPG_Utils.searchNearBattler(
character,
params.Target
);
if (foundCharacter) {
found = true;
$gameVariables.setValue(
params.StoreCharacterKindVariableId,
ARPG_Utils.characterKindValue(foundCharacter)
);
if (foundCharacter instanceof Game_Event) {
$gameVariables.setValue(
params.StoreEventIdVariableId,
foundCharacter.eventId()
);
}
}
}
$gameSwitches.setValue(params.StoreResultSwitchId, found);
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"SetPlayerGuardMode",
function (args) {
const params = PluginParamsParser.parse(args);
if ($gamePlayer.isBattler()) {
if (params.GuardMode) {
$gamePlayer.battler().startGuard("SetPlayerGuardMode");
} else {
$gamePlayer.battler().endGuard("SetPlayerGuardMode");
}
}
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"ShowMessagePopup",
function (args) {
const params = PluginParamsParser.parse(args);
const w = 640;
const h = 64;
const x = Graphics.boxWidth / 2 - w / 2;
const y = 0;
const rect = new Rectangle(x, y, w, h);
$gameMap.showCommonMessageWindow(params.Text, rect, {
time: params.Time,
});
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"TransparentObjectCast",
function (args) {
const params = PluginParamsParser.parse(args);
const width = params.Width;
const height = params.Height;
let x = 0;
let y = 0;
switch (params.TransparentObjectPosition.Specification) {
case "character":
const target = this.findCharacterBySpecification(
params.TransparentObjectPosition.CharacterSpecification
);
const targetPos = target.centerPositionPoint();
x = targetPos.x - width / 2;
y = targetPos.y - height / 2;
break;
case "custom":
const xByVariable =
params.TransparentObjectPosition.CustomPosition.XByVariable;
const yByVariable =
params.TransparentObjectPosition.CustomPosition.YByVariable;
x =
xByVariable > 0
? $gameVariables.value(xByVariable)
: params.TransparentObjectPosition.CustomPosition.X;
y =
yByVariable > 0
? $gameVariables.value(yByVariable)
: params.TransparentObjectPosition.CustomPosition.Y;
break;
}
const deg = new Degree(
params.DegreeByVariable > 0
? $gameVariables.value(params.DegreeByVariable)
: params.Degree
);
const far =
params.FarByVariable > 0
? $gameVariables.value(params.FarByVariable)
: params.Far;
const collidedPos = $gameMap.transparentObjectCastTo(
new import_DotMoveSystem.DotMovePoint(x, y),
deg,
far,
{ width, height }
);
$gameSwitches.setValue(params.CollisionResultSwitchId, !!collidedPos);
if (collidedPos) {
if (params.CollidedXVariableId > 0)
$gameVariables.setValue(params.CollidedXVariableId, collidedPos.x);
if (params.CollidedYVariableId > 0)
$gameVariables.setValue(params.CollidedYVariableId, collidedPos.y);
}
}
);
PluginManager.registerCommand(
ARPG_CorePluginName,
"SetCheckMapValid",
function (args) {
const params = PluginParamsParser.parse(args);
const character = this.findCharacterBySpecification(
params.CharacterSpecification
);
if (!character) return;
if (params.EnableOrDisable == true) {
character.setNoCheckMapValid(false);
} else {
character.setNoCheckMapValid(true);
}
}
);
// ts/CommonLibrary/mixin.ts
function mixin(dest, src) {
for (const name of Object.getOwnPropertyNames(src.prototype)) {
if (name === "constructor") continue;
const value =
Object.getOwnPropertyDescriptor(src.prototype, name) ||
/* @__PURE__ */ Object.create(null);
Object.defineProperty(dest.prototype, name, value);
}
}
// ts/ARPG_Core/ARPG_DynamicEvent/Game_Event.ts
var _Game_Event_Mixin = class extends Game_Event {
initMembers() {
_Game_Event_Mixin._initMembers.call(this);
this._isDynamicEvent = false;
this._srcMapId = 0;
this._srcEventId = 0;
this._copied = false;
}
// @ts-ignore // TODO: 暫定
initialize(mapId, eventId, opt = {}) {
Game_Character.prototype.initialize.call(this);
this._mapId = mapId;
this._eventId = eventId;
if (opt.isDynamicEvent) {
if (opt.srcMapId == null)
throw new Error(`opt.srcMapId is not defined.`);
if (opt.srcEventId == null)
throw new Error(`opt.srcEventId is not defined.`);
this._isDynamicEvent = true;
this.setupCopyEvent(opt.srcMapId, opt.srcEventId);
}
this.locate(this.event().x, this.event().y);
this.refresh();
this.initCopyEventProcess();
if (this.event().meta.PushableEvent) {
this._pushableEvent = true;
} else {
const values = this.getAnnotationValues(0);
if (values.PushableEvent) {
this._pushableEvent = true;
}
}
}
isDynamicEvent() {
return this._isDynamicEvent;
}
isErased() {
return this._erased;
}
setupCopyEvent(srcMapId, srcEventId) {
if (!this._copied) {
globalActiveEvent = this;
this._copied = true;
this._srcMapId = srcMapId;
this._srcEventId = srcEventId;
const newPageIndex = this._erased ? -1 : this.findProperPageIndex();
this._pageIndex = newPageIndex;
this.setupPage();
globalActiveEvent = void 0;
}
}
event() {
if (this._copied) {
const mapData = $gameTemp.mapDataCache(this._srcMapId);
return mapData.events[this._srcEventId];
} else {
return _Game_Event_Mixin._event.call(this);
}
}
initCopyEventProcess() {
const tag =
this.event().meta[ARPG_CorePluginParams.CopyEventSetting.CopyEventTag];
if (!tag) return;
let md;
let mapIds;
let srcEventIdOrName;
if ((md = tag.match(/\s*(.+)\,(.+)/))) {
mapIds = [parseInt(md[1])];
srcEventIdOrName = md[2];
} else if ((md = tag.match(/\s*(.+)/))) {
mapIds = ARPG_CorePluginParams.CopyEventSetting.DynamicEventSrcMapIds;
srcEventIdOrName = md[1];
} else {
return;
}
for (const mapId of mapIds) {
const mapData = $gameTemp.mapDataCache(mapId);
for (const eventData of mapData.events) {
if (!eventData) continue;
let eventMatched = false;
if (srcEventIdOrName.match(/^\d+$/)) {
if (eventData.id === parseInt(srcEventIdOrName))
eventMatched = true;
} else {
if (eventData.name === srcEventIdOrName) eventMatched = true;
}
if (eventMatched) {
this.setupCopyEvent(mapId, eventData.id);
return;
}
}
}
}
};
var Game_Event_Mixin = _Game_Event_Mixin;
Game_Event_Mixin._initialize = Game_Event.prototype.initialize;
Game_Event_Mixin._initMembers = Game_Event.prototype.initMembers;
Game_Event_Mixin._event = Game_Event.prototype.event;
Game_Event_Mixin._refresh = Game_Event.prototype.refresh;
mixin(Game_Event, Game_Event_Mixin);
// ts/ARPG_Core/ARPG_DynamicEvent/Game_Map.ts
var _Game_Map_Mixin = class extends Game_Map {
initialize() {
_Game_Map_Mixin._initialize.call(this);
this._makeEventId = 0;
}
setup(mapId) {
_Game_Map_Mixin._setup.call(this, mapId);
this._makeEventId = 0;
}
update(sceneActive) {
_Game_Map_Mixin._update.call(this, sceneActive);
for (const event of this.events()) {
if (event.isDynamicEvent() && event.isErased()) {
this.eraseDynamicEvent(event.eventId());
}
}
}
makeDynamicEvent(srcMapId, srcEventIdOrName, x = 0, y = 0) {
let srcEventId;
if (typeof srcEventIdOrName === "number") {
srcEventId = srcEventIdOrName;
} else if (srcEventIdOrName.match(/^\d+$/)) {
srcEventId = parseInt(srcEventIdOrName);
} else {
srcEventId = this.nameToId(srcMapId, srcEventIdOrName);
}
if (this._makeEventId === 0) {
this._makeEventId = this.maxEventId();
}
this._makeEventId++;
const opt = { isDynamicEvent: true, srcMapId, srcEventId };
const event = new Game_Event($gameMap.mapId(), this._makeEventId, opt);
this._events[event.eventId()] = event;
event.setPosition(x, y);
return event;
}
eraseEvent(eventId) {
_Game_Map_Mixin._eraseEvent.call(this, eventId);
const event = $gameMap.event(eventId);
if (event.isDynamicEvent()) {
this.eraseDynamicEvent(eventId);
}
}
eraseDynamicEvent(eventId) {
this._events[eventId] = void 0;
delete this._events[eventId];
$gameSelfSwitches.clearSelfSwitches(this._mapId, eventId);
$gameVariables.clearSelfVariables(this._mapId, eventId);
$gameSwitches.clearExSelfSwitches(this._mapId, eventId);
}
maxEventId() {
let maxEventId = 0;
for (const event of $gameMap.events()) {
if (event.eventId() > maxEventId) {
maxEventId = event.eventId();
}
}
return maxEventId;
}
nameToId(srcMapId, srcEventName) {
const mapData = $gameTemp.mapDataCache(srcMapId);
for (const eventData of mapData.events) {
if (!eventData) continue;
if (eventData.name === srcEventName) {
return eventData.id;
}
}
throw new Error(`Event name(${srcEventName}) is not found.`);
}
};
var Game_Map_Mixin = _Game_Map_Mixin;
Game_Map_Mixin._initialize = Game_Map.prototype.initialize;
Game_Map_Mixin._setup = Game_Map.prototype.setup;
Game_Map_Mixin._update = Game_Map.prototype.update;
Game_Map_Mixin._eraseEvent = Game_Map.prototype.eraseEvent;
mixin(Game_Map, Game_Map_Mixin);
// ts/ARPG_Core/ARPG_DynamicEvent/Game_Temp.ts
var _Game_Temp_Mixin = class extends Game_Temp {
initialize() {
_Game_Temp_Mixin._initialize.call(this);
this._mapDataCaches = /* @__PURE__ */ new Map();
}
// mapIdが0の場合は初回に設定されたマップデータキャッシュを返す。
mapDataCache(mapId) {
if (mapId === 0) {
if (this._firstMapDataCacheMapId == null) {
throw new Error(`_firstMapDataCacheMapId is undefined.`);
}
return this._mapDataCaches.get(this._firstMapDataCacheMapId);
}
return this._mapDataCaches.get(mapId);
}
setMapDataCache(mapId, mapData) {
if (this._firstMapDataCacheMapId == null) {
this._firstMapDataCacheMapId = mapId;
}
this._mapDataCaches.set(mapId, mapData);
}
};
var Game_Temp_Mixin = _Game_Temp_Mixin;
Game_Temp_Mixin._initialize = Game_Temp.prototype.initialize;
mixin(Game_Temp, Game_Temp_Mixin);
// ts/CommonLibrary/HttpResponse.ts
var HttpResponse = class {
constructor(result, xhr) {
this._result = result;
this._xhr = xhr;
}
result() {
return this._result;
}
status() {
return this._xhr.status;
}
response() {
return this._xhr.response;
}
};
// ts/CommonLibrary/HttpRequest.ts
var HttpRequest = class {
static get(path, opt = {}) {
const req = new HttpRequest(path, "GET", opt);
return req.send();
}
static post(path, params, opt = {}) {
const req = new HttpRequest(path, "POST", opt);
return req.send(params);
}
constructor(path, method, opt = {}) {
this._path = path;
this._method = method;
this._mimeType = opt.mimeType == null ? void 0 : opt.mimeType;
}
send(params = null) {
const xhr = new XMLHttpRequest();
xhr.open(this._method, this._path);
if (this._mimeType) xhr.overrideMimeType(this._mimeType);
let json;
if (params) json = JSON.stringify(params);
const promise = new Promise((resolve, reject) => {
xhr.addEventListener("load", (e) => {
resolve(new HttpResponse("load", xhr));
});
xhr.addEventListener("error", (e) => {
reject(new HttpResponse("error", xhr));
});
});
xhr.send(json);
return promise;
}
};
// ts/CommonLibrary/MapLoader.ts
var MapLoader = class {
constructor(mapId) {
this._mapId = mapId;
this.loadMap();
}
mapId() {
return this._mapId;
}
isLoaded() {
return !!this._mapData;
}
mapData() {
return this._mapData;
}
loadMap() {
const fileName = "Map%1.json".format(this._mapId.padZero(3));
this.loadData(fileName);
}
async loadData(fileName) {
const res = await HttpRequest.get(`data/${fileName}`, {
mimeType: "application/json",
});
if (res.result() === "error") {
throw new Error(`Unknow file: ${fileName}`);
} else if (res.status() === 200) {
this._mapData = JSON.parse(res.response());
} else {
throw new Error(`Load failed: ${fileName}`);
}
}
};
// ts/ARPG_Core/ARPG_DynamicEvent/Scene_Map.ts
var _Scene_Map_Mixin = class extends Scene_Map {
initialize() {
_Scene_Map_Mixin._initialize.call(this);
this._mapLoaders = [];
}
create() {
_Scene_Map_Mixin._create.call(this);
this.preMapLoad();
}
isReady() {
for (const mapLoader of this._mapLoaders) {
if (!mapLoader.isLoaded()) return false;
}
return _Scene_Map_Mixin._isReady.call(this);
}
onMapLoaded() {
for (const mapLoader of this._mapLoaders) {
const mapData = mapLoader.mapData();
$gameTemp.setMapDataCache(mapLoader.mapId(), mapData);
DataManager.extractMetadata(mapData);
DataManager.extractArrayMetadata(mapData.events);
}
_Scene_Map_Mixin._onMapLoaded.call(this);
}
preMapLoad() {
for (const mapId of ARPG_CorePluginParams.CopyEventSetting
.DynamicEventSrcMapIds) {
const mapData = $gameTemp.mapDataCache(mapId);
if (!mapData) {
const mapLoader = new MapLoader(mapId);
this._mapLoaders.push(mapLoader);
}
}
}
};
var Scene_Map_Mixin = _Scene_Map_Mixin;
Scene_Map_Mixin._initialize = Scene_Map.prototype.initialize;
Scene_Map_Mixin._create = Scene_Map.prototype.create;
Scene_Map_Mixin._isReady = Scene_Map.prototype.isReady;
Scene_Map_Mixin._onMapLoaded = Scene_Map.prototype.onMapLoaded;
mixin(Scene_Map, Scene_Map_Mixin);
// ts/ARPG_Core/ARPG_DynamicEvent/Spriteset_Map.ts
var _Spriteset_Map_Mixin = class extends Spriteset_Map {
update() {
_Spriteset_Map_Mixin._update.call(this);
this.updateCreateCharacterSprites();
}
updateCreateCharacterSprites() {
const mapEvents = /* @__PURE__ */ new Set([...$gameMap.events()]);
const hasSpriteEvents = /* @__PURE__ */ new Set();
for (const sprite of this._characterSprites) {
const character = sprite.character();
if (character instanceof Game_Event) {
hasSpriteEvents.add(character);
}
}
for (const event of mapEvents) {
if (!hasSpriteEvents.has(event)) this.createCharacterSprite(event);
}
for (const event of hasSpriteEvents) {
if (!mapEvents.has(event)) this.deleteCharacterSprite(event);
}
}
createCharacterSprite(character) {
const sprite = new Sprite_Character(character);
this._characterSprites.push(sprite);
this._tilemap.addChild(sprite);
}
deleteCharacterSprite(character) {
const sprite = this.findTargetSprite(character);
if (!sprite) return;
if (character.isAnimationPlaying()) return;
this._characterSprites = this._characterSprites.filter(
(characterSprite) => characterSprite !== sprite
);
this._tilemap.removeChild(sprite);
}
};
var Spriteset_Map_Mixin = _Spriteset_Map_Mixin;
Spriteset_Map_Mixin._update = Spriteset_Map.prototype.update;
mixin(Spriteset_Map, Spriteset_Map_Mixin);
// ts/ARPG_Core/ARPG_DynamicEvent/Sprite_Character.ts
var Sprite_Character_Mixin = class extends Sprite_Character {
character() {
return this._character;
}
};
mixin(Sprite_Character, Sprite_Character_Mixin);
// ts/ARPG_Core/ARPG_DynamicEvent/Game_SelfSwitches.ts
var Game_SelfSwitches_Mixin = class extends Game_SelfSwitches {
clearSelfSwitches(mapId, eventId, switchName) {
for (const key in this._data) {
const keyParams = key.split(",");
const keyMapId = parseInt(keyParams[0]);
const keyEventId = parseInt(keyParams[1]);
const keySwitchName = keyParams[2];
if (
keyMapId === mapId &&
(eventId == null || keyEventId === eventId) &&
(switchName == null || keySwitchName === switchName)
) {
delete this._data[key];
}
}
}
};
mixin(Game_SelfSwitches, Game_SelfSwitches_Mixin);
// ts/ARPG_Core/ARPG_DamagePopup/Sprite_FieldDamage.ts
var Sprite_FieldDamage = class extends Sprite_Damage {
initialize() {
super.initialize();
if (ARPG_CorePluginParams.UseImageDamage) {
this._damageBitmap = ImageManager.loadSystem("Damage");
}
}
digitWidth() {
return this._damageBitmap ? this._damageBitmap.width / 10 : 0;
}
digitHeight() {
return this._damageBitmap ? this._damageBitmap.height / 5 : 0;
}
setActionResult(actionResult) {
this._actionResult = actionResult;
}
setup(target) {
const result = this._actionResult;
if (!result) throw new Error(`actionResult is undefined.`);
this._actionResult = void 0;
if (result.missed || result.evaded) {
this._colorType = 0;
this.createMiss();
} else if (result.hpAffected) {
this._colorType = result.hpDamage >= 0 ? 0 : 1;
this.createDigits(result.hpDamage);
} else if (target.isAlive() && result.mpDamage !== 0) {
this._colorType = result.mpDamage >= 0 ? 2 : 3;
this.createDigits(result.mpDamage);
}
if (result.critical) {
this.setupCriticalEffect();
}
}
createMiss() {
if (ARPG_CorePluginParams.UseImageDamage) {
const w = this.digitWidth();
const h = this.digitHeight();
const sprite = this.createChildImageSprite();
sprite.setFrame(0, 4 * h, 4 * w, h);
sprite.dy = 0;
} else {
super.createMiss();
}
}
createDigits(value) {
if (ARPG_CorePluginParams.UseImageDamage) {
const baseRow = 0;
const string = Math.abs(value).toString();
const row = baseRow + (value < 0 ? 1 : 0);
const w = this.digitWidth();
const h = this.digitHeight();
for (let i = 0; i < string.length; i++) {
const sprite = this.createChildImageSprite();
const n = Number(string[i]);
sprite.setFrame(n * w, row * h, w, h);
sprite.x = (i - (string.length - 1) / 2) * w;
sprite.dy = -i;
}
} else {
super.createDigits(value);
}
}
createChildImageSprite() {
const sprite = new Sprite();
sprite.bitmap = this._damageBitmap;
sprite.anchor.x = 0.5;
sprite.anchor.y = 1;
sprite.y = -40;
sprite.ry = sprite.y;
this.addChild(sprite);
return sprite;
}
destroy(options) {
if (ARPG_CorePluginParams.UseImageDamage) {
Sprite.prototype.destroy.call(this, options);
} else {
super.destroy(options);
}
}
};
Sprite_FieldDamage._initialize = Sprite_Damage.prototype.initialize;
Sprite_FieldDamage._createMiss = Sprite_Damage.prototype.createMiss;
Sprite_FieldDamage._createDigits = Sprite_Damage.prototype.createDigits;
Sprite_FieldDamage._destroy = Sprite_Damage.prototype.destroy;
// ts/ARPG_Core/ARPG_DamagePopup/Sprite_Character.ts
var _Sprite_Character_Mixin = class extends Sprite_Character {
initMembers() {
_Sprite_Character_Mixin._initMembers.call(this);
this._damages = [];
}
update() {
_Sprite_Character_Mixin._update.call(this);
const character = this._character;
if (character.isBattler()) {
this.setBattler(character.battler().battler());
} else {
this.setBattler(void 0);
}
this.updateDamagePopup();
}
setBattler(battler) {
this._battler = battler;
}
updateDamagePopup() {
if (!this._battler) return;
this.setupDamagePopup();
if (this._damages.length > 0) {
for (const damage of this._damages) {
damage.update();
}
if (!this._damages[0].isPlaying()) {
this.destroyDamageSprite(this._damages[0]);
}
}
}
setupDamagePopup() {
const actionResult = $gameTemp.checkRequestedFieldDamagePopup(
this._character
);
if (actionResult) {
this.createDamageSprite(actionResult);
}
}
createDamageSprite(actionResult) {
const last = this._damages[this._damages.length - 1];
const sprite = new Sprite_FieldDamage();
if (last) {
sprite.x = last.x + 8;
sprite.y = last.y - 16;
} else {
sprite.x = this.x + this.damageOffsetX();
sprite.y = this.y + this.damageOffsetY();
}
sprite.setActionResult(actionResult);
sprite.setup(this._battler);
this._damages.push(sprite);
this.parent.addChild(sprite);
}
destroyDamageSprite(sprite) {
this.parent.removeChild(sprite);
this._damages.remove(sprite);
sprite.destroy();
}
damageOffsetX() {
return 0;
}
damageOffsetY() {
return 0;
}
};
var Sprite_Character_Mixin2 = _Sprite_Character_Mixin;
Sprite_Character_Mixin2._initMembers = Sprite_Character.prototype.initMembers;
Sprite_Character_Mixin2._update = Sprite_Character.prototype.update;
mixin(Sprite_Character, Sprite_Character_Mixin2);
// ts/ARPG_Core/ARPG_DamagePopup/Scene_Map.ts
var _Scene_Map_isReady = Scene_Map.prototype.isReady;
Scene_Map.prototype.isReady = function () {
let ready = true;
const result = _Scene_Map_isReady.call(this);
if (!result) ready = false;
if (ARPG_CorePluginParams.UseImageDamage) {
const damageBitmap = ImageManager.loadSystem("Damage");
if (!damageBitmap.isReady()) ready = false;
}
return ready;
};
// ts/ARPG_Core/ARPG_State/Main.ts
var _Game_Battler_Mixin = class extends Game_Battler {
clearStates() {
_Game_Battler_Mixin._clearStates.call(this);
this._statesDuration = [];
}
addState(stateId) {
_Game_Battler_Mixin._addState.call(this, stateId);
const state = $dataStates[stateId];
if (state.meta.duration) {
let update = false;
if (
!(
this._statesDuration[stateId] != null &&
this._statesDuration[stateId] > 0
)
) {
update = true;
} else if (state.meta.overWriteDuration) {
update = true;
}
if (update) {
const duration = parseInt(state.meta.duration);
this._statesDuration[stateId] = duration;
}
}
}
eraseState(stateId) {
_Game_Battler_Mixin._eraseState.call(this, stateId);
delete this._statesDuration[stateId];
}
updateStatesDuration() {
if ($gameMap.isEventRunning()) return;
for (const stateId of this._states) {
if (this._statesDuration[stateId] == null) continue;
if (this._statesDuration[stateId] > 0) {
this._statesDuration[stateId]--;
if (this._statesDuration[stateId] <= 0) {
this.eraseState(stateId);
}
}
}
}
};
var Game_Battler_Mixin = _Game_Battler_Mixin;
Game_Battler_Mixin._clearStates = Game_Battler.prototype.clearStates;
Game_Battler_Mixin._addState = Game_Battler.prototype.addState;
Game_Battler_Mixin._eraseState = Game_Battler.prototype.eraseState;
mixin(Game_Battler, Game_Battler_Mixin);
// ts/ARPG_Core/ARPG_TargetSelect/Main.ts
var TargetSelecter = class extends Component {
constructor(selectTargetType, opt = {}) {
super();
this._onlyNearTheScreen = opt.onlyNearTheScreen ?? true;
this._selectTargetType = selectTargetType;
}
start() {
super.start();
let target;
if (this._selectTargetType === "actor") {
({ character: target } = ARPG_Utils.searchNearBattler(
$gamePlayer,
"friend"
));
} else {
({ character: target } = ARPG_Utils.searchNearBattler(
$gamePlayer,
"opponent"
));
}
if (target && target.isInTheScreen(0, 0)) {
$gameTemp.arpgGlobalTempData().selectingTarget = target;
} else {
$gameMap.endTargetSelect();
}
}
update() {
super.update();
if (Input.isTriggered("left")) {
this.prevSelect();
} else if (Input.isTriggered("right")) {
this.nextSelect();
} else if (Input.isTriggered("ok")) {
this.doSelect();
}
}
touchCharacter(character) {
const allCharacters = this.allCharactersByTargetType();
for (const chr of allCharacters) {
if (chr === character) {
if (character === $gameTemp.arpgGlobalTempData().selectingTarget) {
this.doSelect();
} else {
this.doChangeSelectingTarget(character);
}
return;
}
}
}
nextSelect() {
const character = this.searchNextCharacter();
if (character) {
this.doChangeSelectingTarget(character);
}
}
prevSelect() {
const character = this.searchPrevCharacter();
if (character) {
this.doChangeSelectingTarget(character);
}
}
doChangeSelectingTarget(targetCharacter) {
SoundManager.playCursor();
$gameTemp.arpgGlobalTempData().selectingTarget = targetCharacter;
}
doSelect() {
SoundManager.playOk();
const arpgGlobalTempData = $gameTemp.arpgGlobalTempData();
const target = arpgGlobalTempData.selectingTarget;
if (target) {
if (arpgGlobalTempData.selectedTargetCharacterKindVariableId > 0) {
$gameVariables.setValue(
arpgGlobalTempData.selectedTargetCharacterKindVariableId,
ARPG_Utils.characterKindValue(target)
);
}
if (
target instanceof Game_Event &&
arpgGlobalTempData.selectedTargetEventIdVariableId > 0
) {
$gameVariables.setValue(
arpgGlobalTempData.selectedTargetEventIdVariableId,
target.eventId()
);
}
if (arpgGlobalTempData.selectResultSwitchId > 0) {
$gameSwitches.setValue(arpgGlobalTempData.selectResultSwitchId, true);
}
}
$gameMap.endTargetSelect();
}
searchNextCharacter() {
const allCharacters = this.allCharactersByTargetType();
if (allCharacters.length <= 1) return void 0;
const index = allCharacters.indexOf(
$gameTemp.arpgGlobalTempData().selectingTarget
);
if (index >= 0) {
if (index < allCharacters.length - 1) {
return allCharacters[index + 1];
} else {
return allCharacters[0];
}
}
return void 0;
}
searchPrevCharacter() {
const allCharacters = this.allCharactersByTargetType();
if (allCharacters.length <= 1) return void 0;
const index = allCharacters.indexOf(
$gameTemp.arpgGlobalTempData().selectingTarget
);
if (index >= 0) {
if (index > 0) {
return allCharacters[index - 1];
} else {
return allCharacters[allCharacters.length - 1];
}
}
return void 0;
}
allCharactersByTargetType() {
let characters;
if (this._selectTargetType === "actor") {
characters = ARPG_Utils.allAliveActorCharacters();
} else {
characters = ARPG_Utils.allAliveEnemyCharacters();
}
if (this._onlyNearTheScreen) {
characters = characters.filter((character) =>
character.isInTheScreen(0, 0)
);
}
return characters;
}
};
var TriangleDrawer = class {
constructor(bitmap) {
this._bitmap = bitmap;
}
drawTriangle(x1, y1, x2, y2, x3, y3, strokeColor, fillColor) {
const ctx = this._bitmap.context;
ctx.beginPath();
ctx.moveTo(x1, y1);
ctx.lineTo(x2, y2);
ctx.lineTo(x3, y3);
ctx.closePath();
ctx.strokeStyle = strokeColor;
ctx.lineWidth = 2;
ctx.stroke();
ctx.fillStyle = fillColor;
ctx.fill();
}
};
var SpriteMover = class {
constructor(sprite, moveSpeed) {
this._moveSpeed = moveSpeed;
this._sprite = sprite;
this._targetX = 0;
this._targetY = 0;
this._moving = false;
}
get moveSpeed() {
return this._moveSpeed;
}
set moveSpeed(_moveSpeed) {
this._moveSpeed = _moveSpeed;
}
update() {
if (this._moving) this.updateMove();
}
updateMove() {
const sprite = this._sprite;
const oy = this._targetY - sprite.y;
const ox = this._targetX - sprite.x;
const rad = Math.atan2(oy, ox);
const disX = this._moveSpeed * Math.cos(rad);
const disY = this._moveSpeed * Math.sin(rad);
sprite.x += disX;
sprite.y += disY;
if (
(disX < 0 && sprite.x + disX < this._targetX) ||
(disX > 0 && sprite.x + disX > this._targetX)
)
sprite.x = this._targetX;
if (
(disY < 0 && sprite.y + disY < this._targetY) ||
(disY > 0 && sprite.y + disY > this._targetY)
)
sprite.y = this._targetY;
if (sprite.x === this._targetX && sprite.y === this._targetY)
this._moving = false;
}
isMoving() {
return this._moving;
}
isBusy() {
return this.isMoving();
}
startMove(targetPoint) {
this._targetX = targetPoint.x;
this._targetY = targetPoint.y;
this._moving = true;
}
changeTarget(targetPoint) {
this._targetX = targetPoint.x;
this._targetY = targetPoint.y;
}
fastMove(targetPoint) {
this._sprite.x = targetPoint.x;
this._sprite.y = targetPoint.y;
this._moving = false;
}
forceEndMove() {
this._sprite.x = this._targetX;
this._sprite.y = this._targetY;
this._moving = false;
}
};
var _Sprite_CursorArrow = class extends Sprite {
initialize() {
super.initialize();
this.createBitmap();
this._nowAnimation = true;
this._animationTime = 0;
this._animationSign = 1;
this.anchor.x = 0.5;
this.anchor.y = 1;
}
update() {
super.update();
if (this._nowAnimation) this.updateAnimation();
}
updateAnimation() {
if (this._animationTime >= 0) {
this.y = this._animationTime / 4;
} else {
this.y = -this._animationTime / 4;
}
this._animationTime += this._animationSign;
if (this._animationTime >= _Sprite_CursorArrow.MAX_ANIMATION_TIME) {
this._animationSign = -1;
} else if (
this._animationTime <= -_Sprite_CursorArrow.MAX_ANIMATION_TIME
) {
this._animationSign = 1;
}
}
createBitmap() {
if (ARPG_CorePluginParams.UseImageTargetSelectCursor) {
this.bitmap = ImageManager.loadBitmap(
"img/",
ARPG_CorePluginParams.TargetSelectCursorImageFileName
);
} else {
this.bitmap = new Bitmap(32, 24);
const w = 32;
const h = 24;
const x1 = 0;
const y1 = 0;
const x2 = x1 + w;
const y2 = 0;
const x3 = (x1 + w) / 2;
const y3 = h;
this.drawTriangle(x1, y1, x2, y2, x3, y3, "#000000", "#ffffff");
}
}
drawTriangle(x1, y1, x2, y2, x3, y3, strokeColor, fillColor) {
new TriangleDrawer(this.bitmap).drawTriangle(
x1,
y1,
x2,
y2,
x3,
y3,
strokeColor,
fillColor
);
}
};
var Sprite_CursorArrow = _Sprite_CursorArrow;
Sprite_CursorArrow.MAX_ANIMATION_TIME = 30;
var Sprite_TargetSelect = class extends Sprite {
initialize() {
super.initialize();
this.hide();
this.anchor.x = 0.5;
this.anchor.y = 1;
const cusrorArrow = new Sprite_CursorArrow();
this.addChild(cusrorArrow);
this._mover = new SpriteMover(this, 30);
}
update() {
super.update();
this._mover.update();
let needShow = false;
const target = $gameTemp.arpgGlobalTempData().selectingTarget;
if (target) {
const targetSprite = target.getSprite();
if (targetSprite) {
needShow = true;
if (this._lastTarget === target) {
if (!this._mover.isMoving()) {
this.x = targetSprite.x;
this.y = targetSprite.y - targetSprite.height;
}
} else {
let fast = this._lastTarget == null;
this.moveToTarget(targetSprite, fast);
this._lastTarget = target;
}
}
}
if (needShow) {
this.show();
} else {
this.hide();
this._lastTarget = void 0;
}
}
moveToTarget(target, fast = false) {
const targetPos = new Point(target.x, target.y - target.height);
if (fast) {
this._mover.fastMove(targetPos);
} else {
this._mover.startMove(targetPos);
}
}
};
var _Spriteset_Map_Mixin2 = class extends Spriteset_Map {
createLowerLayer() {
_Spriteset_Map_Mixin2._createLowerLayer.call(this);
this.createTargetSelectSprite();
}
createTargetSelectSprite() {
this._targetSelectSprite = new Sprite_TargetSelect();
this._tilemap.addChild(this._targetSelectSprite);
}
};
var Spriteset_Map_Mixin2 = _Spriteset_Map_Mixin2;
Spriteset_Map_Mixin2._createLowerLayer =
Spriteset_Map.prototype.createLowerLayer;
mixin(Spriteset_Map, Spriteset_Map_Mixin2);
var _Game_Map_Mixin2 = class extends Game_Map {
initialize() {
_Game_Map_Mixin2._initialize.call(this);
this._targetSelecting = false;
this._targetSelectCancelable = false;
}
startTargetSelect(opt = {}) {
const wait = opt.wait ?? false;
const cancelable = opt.cancelable ?? false;
this._targetSelecting = true;
this._targetSelectCancelable = cancelable;
$gamePlayer.onStartTargetSelect();
this._targetSelecter = new TargetSelecter("enemy", {
onlyNearTheScreen: opt.onlyNearTheScreen,
});
$gameTemp
.arpgGlobalTempData()
.controlCharacter.addComponent(this._targetSelecter);
if (wait) {
this.stop();
}
}
isTargetSelecting() {
return this._targetSelecting;
}
isTargetSelectCancelable() {
return this._targetSelectCancelable;
}
endTargetSelect() {
if (this._targetSelecting) {
this._targetSelecting = false;
$gamePlayer.onEndTargetSelect();
$gameTemp.arpgGlobalTempData().selectingTarget = void 0;
this._targetSelecter?.end();
this._targetSelecter = void 0;
}
this.resume();
}
touchCharacter(character) {
if (!this.isTargetSelecting()) return;
if (!this._targetSelecter) return;
this._targetSelecter.touchCharacter(character);
}
};
var Game_Map_Mixin2 = _Game_Map_Mixin2;
Game_Map_Mixin2._initialize = Game_Map.prototype.initialize;
Game_Map_Mixin2._update = Game_Map.prototype.update;
mixin(Game_Map, Game_Map_Mixin2);
var _Scene_Map_Mixin2 = class extends Scene_Map {
update() {
_Scene_Map_Mixin2._update.call(this);
this.updateTargetSelect();
}
isMenuEnabled() {
const result = _Scene_Map_Mixin2._isMenuEnabled.call(this);
if (!result) return false;
if ($gameMap.isTargetSelecting()) return false;
return true;
}
updateTargetSelect() {
if (this.isMenuCalled() && $gameMap.isTargetSelectCancelable()) {
$gameMap.endTargetSelect();
}
}
onMapTouch() {
if ($gameMap.isTargetSelecting()) return;
_Scene_Map_Mixin2._onMapTouch.call(this);
}
};
var Scene_Map_Mixin2 = _Scene_Map_Mixin2;
Scene_Map_Mixin2._update = Scene_Map.prototype.update;
Scene_Map_Mixin2._updateCallMenu = Scene_Map.prototype.updateCallMenu;
Scene_Map_Mixin2._isMenuEnabled = Scene_Map.prototype.isMenuEnabled;
Scene_Map_Mixin2._onMapTouch = Scene_Map.prototype.onMapTouch;
mixin(Scene_Map, Scene_Map_Mixin2);
var Game_Character_Mixin = class extends Game_Character {
onPress() {}
onClick() {
$gameMap.touchCharacter(this);
}
};
mixin(Game_Character, Game_Character_Mixin);
var _Sprite_Character_Mixin2 = class extends Sprite_Character {
initMembers() {
_Sprite_Character_Mixin2._initMembers.call(this);
this._pressed = false;
}
update() {
_Sprite_Character_Mixin2._update.call(this);
this.processTouch();
}
character() {
return this._character;
}
processTouch() {
if (this.isClickEnabled()) {
if (this.isBeingTouched()) {
if (TouchInput.isTriggered()) {
this._pressed = true;
this.onPress();
}
} else {
this._pressed = false;
}
if (this._pressed && TouchInput.isReleased()) {
this._pressed = false;
this.onClick();
}
} else {
this._pressed = false;
}
}
isPressed() {
return this._pressed;
}
isClickEnabled() {
return this.worldVisible;
}
isBeingTouched() {
const touchPos = new Point(TouchInput.x, TouchInput.y);
const localPos = this.worldTransform.applyInverse(touchPos);
return this.hitTest(localPos.x, localPos.y);
}
hitTest(x, y) {
const width = this.spriteWidth();
const height = this.spriteHeight();
const rect = new Rectangle(
-this.anchor.x * width,
-this.anchor.y * height,
width,
height
);
return rect.contains(x, y);
}
spriteWidth() {
if (this._bushDepth > 0 && this._upperBody && this._lowerBody) {
return this._upperBody.width;
} else {
return this.width;
}
}
spriteHeight() {
if (this._bushDepth > 0 && this._upperBody && this._lowerBody) {
return this._upperBody.height + this._lowerBody.height;
} else {
return this.width;
}
}
onPress() {
this._character.onPress();
}
onClick() {
this._character.onClick();
}
};
var Sprite_Character_Mixin3 = _Sprite_Character_Mixin2;
Sprite_Character_Mixin3._initMembers = Sprite_Character.prototype.initMembers;
Sprite_Character_Mixin3._update = Sprite_Character.prototype.update;
mixin(Sprite_Character, Sprite_Character_Mixin3);
// ts/CommonLibrary/TimerComponent.ts
var TimerComponent = class extends Component {
constructor(timeoutCallback) {
super();
this._time = 0;
this._timeoutFlag = false;
this._timeoutCallback = timeoutCallback;
}
update() {
super.update();
if (this._time > 0) {
this._time--;
if (this._time === 0) {
this.timeoutProcess();
}
}
}
startTimer(time) {
this.resume();
if (time > 0) {
this._time = time;
this._timeoutFlag = false;
} else {
this.forceTimeout();
}
}
checkTimeout() {
if (this._timeoutFlag) {
this._timeoutFlag = false;
this.stop();
return true;
}
return false;
}
isBusy() {
if (this.isStopped()) return false;
if (this._time === 0) return false;
return true;
}
forceTimeout() {
this._time = 0;
this.timeoutProcess();
}
cancel() {
this._time = 0;
this._timeoutFlag = false;
}
timeoutProcess() {
this._timeoutFlag = true;
if (this._timeoutCallback) this._timeoutCallback();
}
};
// ts/ARPG_Core/Window_CommonMessage.ts
var Window_CommonMessage = class extends Window_Base {
constructor() {
super(...arguments);
this._text = "";
}
get text() {
return this._text;
}
set text(_text) {
this._text = _text;
this.refresh();
}
refresh() {
this.drawText(this.text, 0, 0, this.width - this.padding * 2, "center");
}
};
// ts/ARPG_Core/MessageWindowController.ts
var _MessageWindowController = class extends Component {
constructor() {
super(...arguments);
this._windowDatas = [];
this._showWindowTimer = new TimerComponent(
this.showWindowTimerTimeout.bind(this)
);
this._setupCompleted = false;
this._afterFirst = false;
this._manualWait = false;
this._showWindowGuardTimer = new TimerComponent(
this.showWindowGuardTimerTimeout.bind(this)
);
}
start() {
super.start();
this.addComponent(this._showWindowTimer);
this.addComponent(this._showWindowGuardTimer);
}
showWindow(text, rect, opt = {}) {
if (!this._setupCompleted)
throw new Error("MessageWindowController is not setup completed.");
const time =
opt.time ?? _MessageWindowController.DEFAULT_SHOW_WINDOW_TIME;
const type = opt.type ?? "common";
let window2;
if (type === "common") {
window2 = new Window_CommonMessage(rect);
} else {
throw new Error(`${type} is invalid type.`);
}
window2.text = text;
window2.y = this.calcWindowYPos(this._windowDatas.length);
this._windowDatas.push(new WindowData(text, rect, window2, type, time));
if (!this.isManualWaiting() && !this._showWindowTimer.isBusy()) {
this._showWindowTimer.startTimer(time);
}
this._showWindowGuardTimer.startTimer(
_MessageWindowController.SHOW_WINDOW_GUARD_TIME
);
this._createWindowCallback(window2);
}
startManualWait() {
if (this._showWindowTimer.isBusy()) {
this._manualWait = true;
this._showWindowTimer.stop();
}
}
endManualWait() {
this._manualWait = false;
this._showWindowTimer.resume();
}
isManualWaiting() {
return this._manualWait;
}
clearAllWindows() {
for (const winData of this._windowDatas) {
this._deleteWindowCallback(winData.window);
}
this._windowDatas = [];
}
sceneStart(createWindowCallback, deleteWindowCallback) {
this._createWindowCallback = createWindowCallback;
this._deleteWindowCallback = deleteWindowCallback;
this._setupCompleted = true;
if (this._afterFirst) {
this._windowDatas.forEach((winData, i) => {
let window2;
if (winData.type === "common") {
window2 = new Window_CommonMessage(winData.rect);
} else {
throw new Error(`${winData.type} is invalid type.`);
}
window2.text = winData.text;
window2.y = this.calcWindowYPos(i);
winData.window = window2;
this._createWindowCallback(window2);
});
} else {
this._afterFirst = true;
}
}
sceneTerminate() {
this._setupCompleted = false;
for (const winData of this._windowDatas) {
this._deleteWindowCallback(winData.window);
winData.window = void 0;
}
}
calcWindowYPos(index) {
return index * 64 + 8;
}
showWindowTimerTimeout() {
const windowData = this._windowDatas.splice(0, 1)[0];
if (this._windowDatas.length > 0) {
this._showWindowTimer.startTimer(windowData.time);
} else {
this._showWindowGuardTimer.cancel();
}
this._windowDatas.forEach((winData, i) => {
if (winData.window) {
winData.window.y = this.calcWindowYPos(i);
}
});
this._deleteWindowCallback(windowData.window);
}
// NOTE: 何かしらの要因でウィンドウが破棄されなかった場合、永久的にウィンドウが残り続けるため、
// SHOW_WINDOW_GUARD_TIMEが経過した場合強制的に全ウィンドウをクリアする。
showWindowGuardTimerTimeout() {
this.clearAllWindows();
this._manualWait = false;
this._showWindowTimer.cancel();
}
};
var MessageWindowController = _MessageWindowController;
MessageWindowController.DEFAULT_SHOW_WINDOW_TIME = 60;
MessageWindowController.SHOW_WINDOW_GUARD_TIME = 6e3;
var WindowData = class {
constructor(text, rect, window2, type, time) {
this.text = text;
this.rect = rect;
this.window = window2;
this.type = type;
this.time = time;
}
};
// ts/ARPG_Core/ARPG_GlobalTempData.ts
var ARPG_GlobalTempData = class {
constructor() {
this.selectResultSwitchId = 0;
this.selectedTargetCharacterKindVariableId = 0;
this.selectedTargetEventIdVariableId = 0;
this.controlCharacter = new Game_Character();
this.skillNameWindowController = new MessageWindowController();
this.controlCharacter.addComponent(this.skillNameWindowController);
this.controlCharacter.addComponent(new VisibleHitBoxProcess());
}
};
var VisibleHitBoxProcess = class extends Component {
update() {
super.update();
if (!$gameTemp.isPlaytest()) return;
const keysym = ARPG_Utils.getKeySymbol("VisibleHitBox");
if (keysym && Input.isTriggered(keysym)) {
const visibleHitBoxSwitchValue = $gameSwitches.value(
ARPG_CorePluginParams.HitBoxSetting.VisibleHitAreaSwitchId
);
$gameSwitches.setValue(
ARPG_CorePluginParams.HitBoxSetting.VisibleHitAreaSwitchId,
!visibleHitBoxSwitchValue
);
}
}
};
// ts/ARPG_Core/Game_Temp.ts
var _Game_Temp_Mixin2 = class extends Game_Temp {
initialize() {
_Game_Temp_Mixin2._initialize.call(this);
this._arpgCharacterTempDatas = /* @__PURE__ */ new Map();
this._fieldDamagePopupRequest = /* @__PURE__ */ new Map();
}
arpgGlobalTempData() {
if (!this._arpgGlobalTempData) {
this._arpgGlobalTempData = new ARPG_GlobalTempData();
}
return this._arpgGlobalTempData;
}
arpgCharacterTempData(character) {
let tempData = this._arpgCharacterTempDatas.get(character);
if (tempData) return tempData;
tempData = character.createArpgTempData();
this._arpgCharacterTempDatas.set(character, tempData);
return tempData;
}
clearUnusedArpgCharacterTempDatas() {
const allCharacters = $gameMap.allCharacters();
for (const character of this._arpgCharacterTempDatas.keys()) {
if (!allCharacters.has(character)) {
this._arpgCharacterTempDatas.delete(character);
}
}
}
requestFieldDamagePopup(character, result) {
this._fieldDamagePopupRequest.set(character, result);
}
checkRequestedFieldDamagePopup(character) {
const result = this._fieldDamagePopupRequest.get(character);
this._fieldDamagePopupRequest.delete(character);
return result;
}
};
var Game_Temp_Mixin2 = _Game_Temp_Mixin2;
Game_Temp_Mixin2._initialize = Game_Temp.prototype.initialize;
mixin(Game_Temp, Game_Temp_Mixin2);
// ts/ARPG_Core/ARPG_Skill.ts
var _ARPG_Skill = class {
constructor(skillOrItem, idOrName) {
this._actionName = "";
this._actionCommonEventId = 0;
this._skillOrItem = skillOrItem;
if (typeof idOrName === "number") {
this._id = idOrName;
} else {
if (skillOrItem === "item") {
this._id = this.findItemIdByName(idOrName);
} else {
this._id = this.findSkillIdByName(idOrName);
}
}
if (skillOrItem === "skill") {
this._data = $dataSkills[this._id];
} else if (skillOrItem === "item") {
this._data = $dataItems[this._id];
} else {
throw new Error(
`ARPG_Skill error (skillOrItem=${skillOrItem}, id=${this._id})`
);
}
if (this._data.meta.params) {
try {
this._params = JSON.parse(`{${this._data.meta.params}}`);
} catch (e) {
throw new Error(
`Skill parameter (${this._data.meta.params}) is invalid.`
);
}
} else {
this._params = {};
}
if (this._data.meta.noAttackFrame != null) {
const strNoAttackFrame = this._data.meta.noAttackFrame.replace(
/\s/,
""
);
this._noAttackFrame = parseInt(strNoAttackFrame);
} else {
this._noAttackFrame = _ARPG_Skill.DEFAULT_NO_ATTACK_FRAME;
}
if (this._data.meta.noDamageFrame != null) {
const strNoDamageFrame = this._data.meta.noDamageFrame.replace(
/\s/,
""
);
this._noDamageFrame = parseInt(strNoDamageFrame);
} else {
this._noDamageFrame = _ARPG_Skill.DEFAULT_NO_DAMAGE_FRANE;
}
if (this._data.meta.action) {
const actionName = this._data.meta.action.replace(/\s/, "");
if (actionName != null) {
this._actionName = actionName;
if (actionName.match(/^\d+$/)) {
this._actionCommonEventId = parseInt(actionName);
} else {
const commonEventId = this.searchCommonEventId(actionName);
if (commonEventId) this._actionCommonEventId = commonEventId;
}
}
}
if (this._data.meta.showSkillName) {
this._showSkillName = true;
} else {
this._showSkillName = false;
}
}
get skillOrItem() {
return this._skillOrItem;
}
get id() {
return this._id;
}
findSkillIdByName(name) {
for (const skillData of $dataSkills) {
if (!skillData) continue;
if (skillData.name === name) {
return skillData.id;
}
}
throw new Error(`${name} is not fount in all skills.`);
}
findItemIdByName(name) {
for (const itemData of $dataItems) {
if (!itemData) continue;
if (itemData.name === name) {
return itemData.id;
}
}
throw new Error(`${name} is not fount in all items.`);
}
isSkill() {
return this._skillOrItem === "skill";
}
isItem() {
return this._skillOrItem === "item";
}
params() {
return this._params;
}
noAttackFrame() {
return this._noAttackFrame;
}
noDamageFrame() {
return this._noDamageFrame;
}
actionName() {
return this._actionName;
}
actionCommonEventId() {
return this._actionCommonEventId;
}
data() {
return this._data;
}
checkItemScope(list) {
return list.includes(this._data.scope);
}
isForOpponent() {
return this.checkItemScope([1, 2, 3, 4, 5, 6, 14]);
}
isForFriend() {
return this.checkItemScope([7, 8, 9, 10, 11, 12, 13, 14]);
}
isForEveryone() {
return this.checkItemScope([14]);
}
isForAliveFriend() {
return this.checkItemScope([7, 8, 11, 14]);
}
isForDeadFriend() {
return this.checkItemScope([9, 10]);
}
isForUser() {
return this.checkItemScope([11]);
}
isShowSkillName() {
return this._showSkillName;
}
searchCommonEventId(commonEventName) {
const foundCommonEvent = $dataCommonEvents.find((commonEvent) => {
if (!commonEvent) return false;
return commonEvent.name === commonEventName;
});
if (foundCommonEvent) return foundCommonEvent.id;
return void 0;
}
};
var ARPG_Skill = _ARPG_Skill;
ARPG_Skill.DEFAULT_NO_ATTACK_FRAME = 60;
ARPG_Skill.DEFAULT_NO_DAMAGE_FRANE = 30;
// ts/ARPG_Core/ARPG_EffectResult.ts
var DamageKind = {
NONE: 0,
HP_DAMAGE: 1,
MP_DAMAGE: 2,
TP_DAMAGE: 3,
};
var DamageType = {
NORMAL: 1,
MISSED: 2,
EVADED: 3,
CRITICAL: 4,
};
var ARPG_EffectResult = class {
constructor(actionResult, damageDeg, guardResult) {
this._actionResult = this.copyActionResult(actionResult);
this._damageDeg = damageDeg;
if (guardResult == null) {
this._guardResult = "NO_GUARD";
} else {
this._guardResult = guardResult;
}
}
actionResult() {
return this._actionResult;
}
damageKind() {
if (this._actionResult.hpAffected) {
return DamageKind.HP_DAMAGE;
} else {
if (this._actionResult.mpDamage > 0) {
return DamageKind.MP_DAMAGE;
} else if (this._actionResult.tpDamage > 0) {
return DamageKind.TP_DAMAGE;
}
}
return DamageKind.NONE;
}
damageType() {
if (this._actionResult.missed) {
return DamageType.MISSED;
} else if (this._actionResult.evaded) {
return DamageType.EVADED;
} else if (this._actionResult.critical) {
return DamageType.CRITICAL;
} else {
return DamageType.NORMAL;
}
}
hpDamageValue() {
return this._actionResult.hpDamage;
}
mpDamageValue() {
return this._actionResult.mpDamage;
}
tpDamageValue() {
return this._actionResult.tpDamage;
}
damageDeg() {
return this._damageDeg;
}
damageDir4() {
if (this._damageDeg == null) return void 0;
return this._damageDeg.toDirection4(0);
}
guardResult() {
return this._guardResult;
}
copyActionResult(actionResult) {
const copyActionResult = new Game_ActionResult();
copyActionResult.used = actionResult.used;
copyActionResult.missed = actionResult.missed;
copyActionResult.evaded = actionResult.evaded;
copyActionResult.physical = actionResult.physical;
copyActionResult.drain = actionResult.drain;
copyActionResult.critical = actionResult.critical;
copyActionResult.success = actionResult.success;
copyActionResult.hpAffected = actionResult.hpAffected;
copyActionResult.hpDamage = actionResult.hpDamage;
copyActionResult.mpDamage = actionResult.mpDamage;
copyActionResult.tpDamage = actionResult.tpDamage;
copyActionResult.addedStates = actionResult.addedStates;
copyActionResult.removedStates = actionResult.removedStates;
copyActionResult.addedBuffs = actionResult.addedBuffs;
copyActionResult.addedDebuffs = actionResult.addedDebuffs;
copyActionResult.removedBuffs = actionResult.removedBuffs;
return copyActionResult;
}
};
// ts/ARPG_Core/ARPG_Effect.ts
var formulaFuncTbl = /* @__PURE__ */ new Map();
var ARPG_Effect = class {
constructor(subject, target, skill, deg) {
this._subject = subject;
this._target = target;
this._skill = skill;
this._damageDeg = deg;
}
applyToTarget() {
const action = new Game_ARPGAction(this._subject.battler());
action.setItemObject(this._skill.data());
action.setGuardResult(this._guardResult);
action.apply(this._target.battler());
const result = new ARPG_EffectResult(
this._target.battler().result(),
this._damageDeg,
this._guardResult
);
if (
ARPG_CorePluginParams.UseDamagePopup == null ||
ARPG_CorePluginParams.UseDamagePopup
) {
$gameTemp.requestFieldDamagePopup(
this._target.character(),
result.actionResult()
);
}
this._target.refresh();
return result;
}
testApplyToTarget() {
const action = new Game_ARPGAction(this._subject.battler());
action.setItemObject(this._skill.data());
action.setGuardResult(this._guardResult);
return action.testApply(this._target.battler());
}
damageDir4() {
if (this._damageDeg == null) return void 0;
return this._damageDeg.toDirection4(0);
}
damageDeg() {
return this._damageDeg;
}
setDamageDeg(damageDeg) {
this._damageDeg = damageDeg;
}
noDamageFrame() {
return this._skill.noDamageFrame();
}
setGuardResult(guardResult) {
this._guardResult = guardResult;
if (guardResult != "NO_GUARD") {
this.setDamageDeg(void 0);
}
}
};
var Game_ARPGAction = class extends Game_Action {
setSubject(subject) {
this._subject = subject;
}
subject() {
return this._subject;
}
// ジャストガードの場合、ダメージ関連のリザルトを設定しない。
apply(target) {
super.apply(target);
if (this._guardResult === "JUST_GUARD") {
target.result().hpAffected = false;
target.result().missed = false;
target.result().evaded = false;
}
}
evalDamageFormula(target) {
try {
const item = this.item();
const a = this.subject();
const b = target;
const v = $gameVariables._data;
const sign = [3, 4].includes(item.damage.type) ? -1 : 1;
const formula = item.damage.formula;
let func = formulaFuncTbl.get(formula);
if (!func) {
func = new Function("a", "b", "v", `return (${formula});`);
formulaFuncTbl.set(formula, func);
}
const value = Math.max(func(a, b, v), 0) * sign;
return isNaN(value) ? 0 : value;
} catch (e) {
return 0;
}
}
applyGuard(damage, target) {
if (this._guardResult === "JUST_GUARD") {
return 0;
} else if (this._guardResult === "NORMAL_GUARD") {
return damage / 2;
}
return damage;
}
setGuardResult(guardResult) {
this._guardResult = guardResult;
}
// ARPGモードの場合に対応
testApply(target) {
return (
this.testLifeAndDeath(target) &&
((this.isHpRecover() && target.hp < target.mhp) ||
(this.isMpRecover() && target.mp < target.mmp) ||
this.hasItemAnyValidEffects(target) ||
this.evalDamageFormula(target) !== 0)
);
}
applyCritical(damage) {
return damage * 2;
}
};
// ts/CommonLibrary/Processor.ts
var Processor = class extends Component {
update() {
super.update();
if (!this._generator) this._generator = this.process();
const res = this._generator.next();
if (res.done) {
this._generator = void 0;
this.end();
}
}
*waitProcess(waitTime, exitCheckFunc = null) {
while (waitTime > 0) {
if (exitCheckFunc) {
if (exitCheckFunc()) break;
}
waitTime--;
yield;
}
}
*waitAnimation(limit) {
let remain = limit;
while (true) {
if (remain) {
remain--;
if (remain <= 0) break;
}
if (!this._character.isAnimationPlaying()) break;
yield;
}
}
*waitComponent(component) {
while (!component.isStopped()) yield;
}
};
// ts/CommonLibrary/CommonEventComponent.ts
var CommonEventComponent = class extends Component {
constructor(commonEventId) {
super();
this._interpreter = new Game_Interpreter();
this._commonEventId = commonEventId;
}
interpreter() {
return this._interpreter;
}
start() {
super.start();
const commonEventData = $dataCommonEvents[this._commonEventId];
if (!commonEventData) {
this.end();
return;
}
if (this._character instanceof Game_Event) {
this._interpreter.setup(
commonEventData.list,
this._character.eventId()
);
} else {
this._interpreter.setup(commonEventData.list);
}
}
update() {
super.update();
if (this._interpreter.isRunning()) {
this._interpreter.update();
} else {
if (!$gameMessage.isBusy()) {
this.end();
}
}
}
terminate() {
super.terminate();
this._interpreter.clear();
}
};
// ts/ARPG_Core/BattlerCommonEventComponent.ts
var BattlerCommonEventComponent = class extends CommonEventComponent {
constructor(commonEventId, lock = false) {
super(commonEventId);
this._lock = lock;
}
start() {
super.start();
if (this._character instanceof Game_Event) {
const parallelInterpreter = this._character.interpreter();
if (parallelInterpreter) {
if (this._lock) parallelInterpreter.lock("common_event");
}
this._interpreter.setCommonVariableValue(
ARPG_CorePluginParams.BattlerSetting.UserKindCommonVariableId,
3
);
this._interpreter.setCommonVariableValue(
ARPG_CorePluginParams.BattlerSetting.UserEventIdCommonVariableId,
this._character.eventId()
);
} else if (this._character instanceof Game_Player) {
this._interpreter.setCommonVariableValue(
ARPG_CorePluginParams.BattlerSetting.UserKindCommonVariableId,
1
);
}
}
terminate() {
super.terminate();
if (this._character instanceof Game_Event) {
const parallelInterpreter = this._character.interpreter();
if (parallelInterpreter) {
if (this._lock) parallelInterpreter.unlock("common_event");
}
}
}
};
// ts/ARPG_Core/BattlerRecvDamageCommonEventComponent.ts
var BattlerRecvDamageCommonEventComponent = class extends BattlerCommonEventComponent {
constructor(commonEventId, damageEffectResult) {
super(commonEventId, true);
this._damageEffectResult = damageEffectResult;
}
start() {
super.start();
const damageDir4 = this._damageEffectResult.damageDir4();
let dir;
if (damageDir4) {
dir = damageDir4;
} else {
dir = this._character.reverseDir(this._character.direction());
}
if (ARPG_CorePluginParams.BattlerSetting.DamageDegCommonVariableId > 0) {
this._interpreter.setCommonVariableValue(
ARPG_CorePluginParams.BattlerSetting.DamageDegCommonVariableId,
Degree.fromDirection(dir).value
);
}
const damageKind = this._damageEffectResult.damageKind();
if (ARPG_CorePluginParams.BattlerSetting.DamageKindCommonVariableId > 0) {
this._interpreter.setCommonVariableValue(
ARPG_CorePluginParams.BattlerSetting.DamageKindCommonVariableId,
damageKind
);
}
if (ARPG_CorePluginParams.BattlerSetting.DamageTypeCommonVariableId > 0) {
this._interpreter.setCommonVariableValue(
ARPG_CorePluginParams.BattlerSetting.DamageTypeCommonVariableId,
this._damageEffectResult.damageType()
);
}
if (
ARPG_CorePluginParams.BattlerSetting.DamageValueCommonVariableId > 0
) {
switch (damageKind) {
case DamageKind.HP_DAMAGE:
this._interpreter.setCommonVariableValue(
ARPG_CorePluginParams.BattlerSetting.DamageValueCommonVariableId,
this._damageEffectResult.hpDamageValue()
);
break;
case DamageKind.MP_DAMAGE:
this._interpreter.setCommonVariableValue(
ARPG_CorePluginParams.BattlerSetting.DamageValueCommonVariableId,
this._damageEffectResult.mpDamageValue()
);
break;
case DamageKind.TP_DAMAGE:
this._interpreter.setCommonVariableValue(
ARPG_CorePluginParams.BattlerSetting.DamageValueCommonVariableId,
this._damageEffectResult.tpDamageValue()
);
break;
}
}
}
};
// ts/ARPG_Core/ARPG_CustomManager.ts
var ARPG_CustomManager = class {
static addAction(actionName, actionFunc) {
this._actionTable.set(actionName, actionFunc);
}
static getAction(actionName) {
return this._actionTable.get(actionName);
}
static actionComponent(user, skill) {
if (skill.actionName() !== "") {
const action = this.getAction(skill.actionName());
if (action) return action(user, skill);
}
if (skill.actionCommonEventId() > 0) {
return new ActionCommonEventComponent(skill.actionCommonEventId());
}
return void 0;
}
static actorGuardStart(actor) {
if (ARPG_CorePluginParams.ActorSetting.StartGuardCommonEventId > 0) {
return new BattlerCommonEventComponent(
ARPG_CorePluginParams.ActorSetting.StartGuardCommonEventId,
true
);
}
return void 0;
}
static actorGuardEnd(actor) {
if (ARPG_CorePluginParams.ActorSetting.EndGuardCommonEventId > 0) {
return new BattlerCommonEventComponent(
ARPG_CorePluginParams.ActorSetting.EndGuardCommonEventId,
true
);
}
return void 0;
}
static actorRecvDamageComponent(actor, result, guardResult) {
if (guardResult === "NORMAL_GUARD") {
return new BattlerRecvDamageCommonEventComponent(
ARPG_CorePluginParams.ActorSetting.NormalGuardCommonEventId,
result
);
} else if (guardResult === "JUST_GUARD") {
return new BattlerRecvDamageCommonEventComponent(
ARPG_CorePluginParams.ActorSetting.JustGuardCommonEventId,
result
);
} else {
return new BattlerRecvDamageCommonEventComponent(
ARPG_CorePluginParams.ActorSetting.DamageCommonEventId,
result
);
}
}
static enemyRecvDamageComponent(enemy, result) {
return new BattlerRecvDamageCommonEventComponent(
enemy.damageCommonEventId(),
result
);
}
static enemyDefeatComponent(enemy, result) {
return new EnemyDefeatCommonEventComponent(
enemy.defeatEnemyCommonEventId(),
result
);
}
static gameoverComponent() {
if (ARPG_CorePluginParams.ActorSetting.GameOverCommonEventId > 0) {
return new CommonEventComponent(
ARPG_CorePluginParams.ActorSetting.GameOverCommonEventId
);
}
return void 0;
}
static chantComponent(battler, chantCommonEventId) {
if (chantCommonEventId > 0) {
return new CommonEventComponent(chantCommonEventId);
}
return void 0;
}
static levelUpComponent(actor) {
if (ARPG_CorePluginParams.ActorSetting.LevelUpCommonEventId > 0) {
return new CommonEventComponent(
ARPG_CorePluginParams.ActorSetting.LevelUpCommonEventId
);
}
return void 0;
}
};
ARPG_CustomManager._actionTable = /* @__PURE__ */ new Map();
var ActionCommonEventComponent = class extends CommonEventComponent {
start() {
super.start();
if (this._character instanceof Game_Event) {
this._interpreter.setCommonVariableValue(
ARPG_CorePluginParams.BattlerSetting.UserKindCommonVariableId,
3
);
this._interpreter.setCommonVariableValue(
ARPG_CorePluginParams.BattlerSetting.UserEventIdCommonVariableId,
this._character.eventId()
);
} else if (this._character instanceof Game_Player) {
this._interpreter.setCommonVariableValue(
ARPG_CorePluginParams.BattlerSetting.UserKindCommonVariableId,
1
);
}
}
};
var EnemyDefeatCommonEventComponent = class extends BattlerCommonEventComponent {
constructor(commonEventId, result) {
super(commonEventId, true);
this._result = result;
}
start() {
super.start();
const damageDir4 = this._result.damageDir4();
let dir;
if (damageDir4) {
dir = damageDir4;
} else {
dir = this._character.reverseDir(this._character.direction());
}
if (ARPG_CorePluginParams.BattlerSetting.DamageDegCommonVariableId > 0) {
this.interpreter().setCommonVariableValue(
ARPG_CorePluginParams.BattlerSetting.DamageDegCommonVariableId,
Degree.fromDirection(dir).value
);
}
}
};
// ts/CommonLibrary/ChainComponent.ts
var ChainComponent = class extends Component {
constructor(components) {
super();
this._componentIndex = 0;
this._components = components;
}
start() {
super.start();
this.updateChain();
}
update() {
super.update();
this.updateChain();
}
updateChain() {
while (this._componentIndex < this._components.length) {
const component = this._components[this._componentIndex];
if (component == null) {
this._componentIndex++;
continue;
}
if (component instanceof Component) {
if (this._running) {
if (component.isBusy()) {
break;
} else {
this._running = false;
this._componentIndex++;
}
} else {
this._running = true;
this.addComponent(component);
break;
}
} else {
component();
this._componentIndex++;
}
}
if (this._componentIndex >= this._components.length) {
this.end();
}
}
};
// ts/ARPG_Core/ARPG_Battler.ts
var ARPG_Battler = class extends Component {
constructor() {
super(...arguments);
this._noDamageTimer = new TimerComponent();
this._noAttackTimer = new TimerComponent();
this._damageHitChecker = new HitChecker("damage");
this._attackHitChecker = new HitChecker("attack");
this._customHitCheckers = /* @__PURE__ */ new Map();
this._isConsumeCost = true;
this._totalDamageWhenUsingSkill = 0;
this._skillCancelWhenDamageEnable = false;
this._guardReasons = /* @__PURE__ */ new Set();
this._justGuardTimer = new TimerComponent();
this._skillActivating = false;
this._requestUseSkillQueue = [];
}
get damageHitChecker() {
return this._damageHitChecker;
}
get attackHitChecker() {
return this._attackHitChecker;
}
get customHitCheckers() {
return this._customHitCheckers;
}
get hp() {
return this.battler().hp;
}
set hp(value) {
this.battler().setHp(value);
this.refresh();
}
get mp() {
return this.battler().mp;
}
set mp(value) {
this.battler().setMp(value);
this.refresh();
}
get tp() {
return this.battler().tp;
}
set tp(value) {
this.battler().setTp(value);
this.refresh();
}
get mhp() {
return this.battler().mhp;
}
get mmp() {
return this.battler().mmp;
}
get def() {
return this.battler().def;
}
get atk() {
return this.battler().atk;
}
get mat() {
return this.battler().mat;
}
get mdf() {
return this.battler().mdf;
}
get agi() {
return this.battler().agi;
}
get luk() {
return this.battler().luk;
}
get hit() {
return this.battler().hit;
}
get eva() {
return this.battler().eva;
}
get cri() {
return this.battler().cri;
}
get cev() {
return this.battler().cev;
}
get mev() {
return this.battler().mev;
}
get mrf() {
return this.battler().mrf;
}
get cnt() {
return this.battler().cnt;
}
get hrg() {
return this.battler().hrg;
}
get mrg() {
return this.battler().mrg;
}
get trg() {
return this.battler().trg;
}
get tgr() {
return this.battler().tgr;
}
get grd() {
return this.battler().grd;
}
get rec() {
return this.battler().rec;
}
get pha() {
return this.battler().pha;
}
get mcr() {
return this.battler().mcr;
}
get tcr() {
return this.battler().tcr;
}
get pdr() {
return this.battler().pdr;
}
get mdr() {
return this.battler().mdr;
}
get fdr() {
return this.battler().fdr;
}
get exr() {
return this.battler().exr;
}
start() {
super.start();
this.addComponent(this._damageHitChecker);
this.addComponent(this._attackHitChecker);
this.addComponent(this._noDamageTimer);
this.addComponent(this._noAttackTimer);
this.addComponent(this._justGuardTimer);
this.refresh();
}
// NOTE: ステータスが変化した際にコールされる。
refresh() {
this.refreshHitChecker();
}
refreshHitChecker() {
if (this.isAlive()) {
this._damageHitChecker.allHitBoxToEnable();
this._attackHitChecker.allHitBoxToEnable();
} else {
this._damageHitChecker.allHitBoxToDisable();
this._attackHitChecker.allHitBoxToDisable();
}
}
update() {
super.update();
this.updateRecvDamage();
if (this._chantComponent) {
if (this._chantComponent.isTerminated()) {
this._chantComponent = void 0;
}
}
if (this.canUsableSkill() && this._requestUseSkillQueue.length > 0) {
const req = this._requestUseSkillQueue.shift();
const skill = new ARPG_Skill(req.skillOrItem, req.idOrName);
this.useSkillInternal(skill, { isConsumeCost: req.isConsumeCost });
}
}
character() {
return this._character;
}
isActor() {
return false;
}
isEnemy() {
return false;
}
isDead() {
if (this.battler().isDead()) return true;
return false;
}
isAlive() {
return !this.isDead();
}
isGuarding() {
return this._guardReasons.size > 0;
}
startGuard(reason) {
const lastGuarding = this.isGuarding();
this._guardReasons.add(reason);
if (!lastGuarding) this.onGuardStart();
}
endGuard(reason) {
this._guardReasons.delete(reason);
if (!this.isGuarding()) this.onGuardEnd();
}
onGuardStart() {
let justGuardFrame = this.arpgParameters().justGuardFrame;
if (justGuardFrame == null) {
justGuardFrame = ARPG_CorePluginParams.ActorSetting.JustGuardFrame;
}
if (justGuardFrame > 0) {
this._justGuardTimer.startTimer(justGuardFrame);
}
}
onGuardEnd() {
this._justGuardTimer.stop();
}
checkSuccessGuard(damageEffect) {
let successGuard = false;
if (this.isGuarding()) {
const damageDir4 = damageEffect.damageDir4();
if (damageDir4 == null) {
successGuard = true;
} else {
if (
this._character.direction() ===
this._character.reverseDir(damageDir4)
) {
successGuard = true;
}
}
}
if (successGuard) {
if (this._justGuardTimer.isBusy()) {
return "JUST_GUARD";
} else {
return "NORMAL_GUARD";
}
}
return "NO_GUARD";
}
startNoDamage(frame) {
if (!this._noDamageTimer.isBusy()) this._noDamageTimer.startTimer(frame);
}
isNoDamage() {
if (this.arpgParameters().noDamageFlag) return true;
if (this._noDamageTimer.isBusy()) return true;
return false;
}
startNoAttack(frame) {
this._noAttackTimer.startTimer(frame);
}
isNoAttack() {
if (this.arpgParameters().noAttackFlag) return true;
if (this._noAttackTimer.isBusy()) return true;
return false;
}
gainHp(value) {
this.battler().gainHp(value);
this.refresh();
}
gainSilentTp(value) {
this.battler().gainSilentTp(value);
this.refresh();
}
canPaySkillCost(skill) {
return this.battler().canPaySkillCost(skill.data());
}
paySkillCost(skill) {
this.battler().paySkillCost(skill.data());
}
setCollideAttackSkillId(skillId) {
this._collideAttackSkillId = skillId;
}
collideAttackSkillId() {
if (this._collideAttackSkillId == null) return 2;
return this._collideAttackSkillId;
}
recvDamage(damageEffect) {
const guardResult = this.checkSuccessGuard(damageEffect);
damageEffect.setGuardResult(guardResult);
const result = damageEffect.applyToTarget();
this.skillCancelWhenRecvDamage(result);
if (this.isAlive()) {
this.startNoDamage(damageEffect.noDamageFrame());
}
const recvDamageComponent = this.makeRecvDamageComponent(result);
this.addComponent(
new ChainComponent([
this.onBeginRecvDamage.bind(this),
recvDamageComponent,
this.onEndRecvDamage.bind(this),
])
);
}
onBeginRecvDamage() {
if (this._character instanceof Game_Event) {
const interpreter = this._character.interpreter();
if (interpreter) interpreter.lock("recvDamage");
this._character.stopSelfMovement("recvDamage");
} else if (this._character instanceof Game_Player) {
this._character.stopMoveByInput("recvDamage");
}
this._behaviorComponent?.stop();
}
onEndRecvDamage() {
if (this._character instanceof Game_Event) {
const interpreter = this._character.interpreter();
if (interpreter) interpreter.unlock("recvDamage");
this._character.resumeSelfMovement("recvDamage");
} else if (this._character instanceof Game_Player) {
this._character.resumeMoveByInput("recvDamage");
}
if (this._behaviorComponent) {
if (this.isDead()) {
this._behaviorComponent.end();
this._behaviorComponent = void 0;
} else {
this._behaviorComponent.resume();
}
}
}
canUsableSkill() {
if (this.isNoAttack()) return false;
if (this._useSkillProcessor && !this._useSkillProcessor.isTerminated())
return false;
return true;
}
useSkill(skillOrItem, idOrName, opt = {}) {
const queing = opt.queuing ?? false;
const isConsumeCost = opt.isConsumeCost ?? true;
if (!this.canUsableSkill()) {
if (queing) {
this._requestUseSkillQueue.push({
skillOrItem,
idOrName,
isConsumeCost,
});
}
return;
}
const skill = new ARPG_Skill(skillOrItem, idOrName);
this.useSkillInternal(skill, { isConsumeCost });
}
useSkillInternal(skill, opt = {}) {
this._isConsumeCost = opt.isConsumeCost ?? true;
this._useSkillProcessor = new ARPG_UseSkillProcessor(this, skill);
this.addComponent(this._useSkillProcessor);
this._totalDamageWhenUsingSkill = 0;
}
consumeCost(skill) {
if (!this._isConsumeCost) return;
if (skill.isSkill()) {
this._character.battler().paySkillCost(skill);
} else if (skill.isItem()) {
if (this.isActor()) {
$gameParty.gainItem(skill.data(), -1);
}
}
}
checkConsumeCost(skill) {
if (!this._isConsumeCost) return true;
if (skill.isSkill()) {
if (!this.canPaySkillCost(skill)) return false;
} else if (skill.isItem()) {
if (this.isActor()) {
if (!$gameParty.hasItem(skill.data())) return false;
}
}
return true;
}
skillActivation(chantCommonEventId = 0) {
if (!this.usingSkill) {
throw ErrorManager.skillActivationUnusedSkillError();
}
this._skillActivating = true;
this._character.cancelAcceleration();
if (this.usingSkill.isShowSkillName()) {
$gameMap.arpgBattleManager().showSkillNameWindow(this, this.usingSkill);
}
this.consumeCost(this.usingSkill);
this.requestRefreshShortcutWindowHook();
this.startNoAttack(this.usingSkill.noAttackFrame());
if (this._character instanceof Game_Event) {
this._character.stopSelfMovement("skill");
this._character.interpreter()?.lock("skill");
} else if (this._character instanceof Game_Player) {
this._character.stopMoveByInput("skill");
}
const chantComponent = ARPG_CustomManager.chantComponent(
this,
chantCommonEventId
);
if (chantComponent) {
this._chantComponent = chantComponent;
this.addComponent(this._chantComponent);
}
}
setSkillCancelWhenDamageEnable(enabled) {
this._skillCancelWhenDamageEnable = enabled;
}
isDamageSkillCancelEnabled() {
if (this._chantComponent) return true;
return this._skillCancelWhenDamageEnable;
}
requestRefreshShortcutWindowHook() {}
applySkillEffect(skill) {
if (!this.usingSkill) {
throw ErrorManager.applySkillEffectUnusedSkillError();
}
if (!this.skillActivation) {
throw ErrorManager.applySkillEffectUnActivate();
}
if (skill == null) {
skill = this.usingSkill;
}
const effect = new ARPG_Effect(this, this, skill, void 0);
effect.applyToTarget();
}
testApplySkillEffect(skill) {
if (!this.usingSkill) {
throw ErrorManager.testApplySkillEffectUnusedSkillError();
}
if (skill == null) {
skill = this.usingSkill;
}
const effect = new ARPG_Effect(this, this, skill, void 0);
return effect.testApplyToTarget();
}
isSkillActivating() {
return this._skillActivating;
}
endSkillActivation() {
if (this._skillActivating && this.usingSkill.isShowSkillName()) {
$gameMap.arpgBattleManager().endShowSkillNameWindow();
}
this._skillActivating = false;
if (this._requestUseSkillQueue.length === 0) {
if (this._character instanceof Game_Event) {
this._character.interpreter()?.unlock("skill");
this._character.resumeSelfMovement("skill");
} else if (this._character instanceof Game_Player) {
this._character.resumeMoveByInput("skill");
}
}
}
makeSkillObject(srcMapId, srcEventIdOrName, skill, x = 0, y = 0) {
if (!this.isSkillActivating()) {
throw ErrorManager.makeSkillObjectUnActivate();
}
const event = $gameMap.makeDynamicEvent(srcMapId, srcEventIdOrName, x, y);
if (skill == null) {
skill = this.usingSkill;
}
event.setupSkillObject(skill.skillOrItem, skill.id, this);
const userCharacter = this._character;
let userEventId;
if (userCharacter instanceof Game_Event) {
userEventId = userCharacter.eventId();
} else {
userEventId = 0;
}
const userKind = ARPG_Utils.characterKindValue(userCharacter);
if (
ARPG_CorePluginParams.SkillObjectSetting
.SkillObjectUserKindSelfVariableId > 0
) {
event.setSelfVariableValue(
ARPG_CorePluginParams.SkillObjectSetting
.SkillObjectUserKindSelfVariableId,
userKind
);
}
if (
ARPG_CorePluginParams.SkillObjectSetting
.SkillObjectUserEventIdSelfVariableId > 0
) {
event.setSelfVariableValue(
ARPG_CorePluginParams.SkillObjectSetting
.SkillObjectUserEventIdSelfVariableId,
userEventId
);
}
return event;
}
behaviorComponent() {
return this._behaviorComponent;
}
setBehaviorComponent(component) {
if (this._behaviorComponent) this._behaviorComponent.end();
this._behaviorComponent = component;
if (component) this.addComponent(component);
}
updateRecvDamage() {
if (this.isDead()) return;
if (this._character instanceof Game_Event) {
if (this._character.isErased()) return;
}
const hitCharacters = this._damageHitChecker.checkHit("attack");
for (const character of hitCharacters) {
if (character.isSkillObject()) {
this.recvDamageProcessBySkillObjectCharacter(character);
} else if (character.isBattler()) {
this.recvDamageProcessByBattlerCharacter(character);
}
}
}
applyCollideDamageEffectToTarget(target, arpgSkill) {
if (target.isNoDamage()) return;
const effect = new ARPG_Effect(
this,
target,
arpgSkill,
Degree.fromDirection(this.character().direction())
);
target.recvDamage(effect);
}
isChanting() {
return !!this._chantComponent;
}
recvDamageProcessBySkillObjectCharacter(character) {
if (character instanceof Game_Event) {
if (character.isErased()) return;
}
if (character.isSkillObject()) {
const skillObject = character.skillObject();
if (!this.checkTargetBattler(skillObject.user(), skillObject.skill()))
return;
skillObject.applyDamageEffectToBattler(this, skillObject.skill());
}
}
recvDamageProcessByBattlerCharacter(character) {
if (character.battler().isDead()) return;
if (character instanceof Game_Event) {
if (character.isErased()) return;
}
if (!this.checkOpponent(character.battler())) return;
const skillId = character.battler().collideAttackSkillId();
if (skillId > 0) {
const arpgSkill = new ARPG_Skill("skill", skillId);
character.battler().applyCollideDamageEffectToTarget(this, arpgSkill);
}
}
skillCancelWhenRecvDamage(result) {
if (!this.isDamageSkillCancelEnabled()) return;
if (this.isDead()) {
this.doSkillCancel();
} else {
this._totalDamageWhenUsingSkill += result.hpDamageValue();
const rate = this._totalDamageWhenUsingSkill / this.mhp;
if (rate >= this.arpgParameters().skillCancelDamageRate) {
this.doSkillCancel();
}
}
}
doSkillCancel() {
if (this._chantComponent) {
this._chantComponent.end();
this._chantComponent = void 0;
}
this.endSkillActivation();
if (this._useSkillProcessor) this._useSkillProcessor.damageCancel();
}
checkTargetBattler(user, arpgSkill) {
if (this.isActor()) {
return this.checkTargetActor(user, arpgSkill);
} else if (this.isEnemy()) {
return this.checkTargetEnemy(user, arpgSkill);
}
return false;
}
checkTargetEnemy(user, arpgSkill) {
if (arpgSkill.isForEveryone()) {
return true;
} else if (user.isActor() && arpgSkill.isForOpponent()) {
return true;
} else if (user.isEnemy() && arpgSkill.isForFriend()) {
return true;
}
return false;
}
checkTargetActor(user, arpgSkill) {
if (arpgSkill.isForEveryone()) {
return true;
} else if (user.isEnemy() && arpgSkill.isForOpponent()) {
return true;
} else if (user.isActor() && arpgSkill.isForFriend()) {
return true;
}
return false;
}
};
var ARPG_UseSkillProcessor = class extends Processor {
constructor(battler, skill) {
super();
this._damageCanceled = false;
this._battler = battler;
this._skill = skill;
}
start() {
super.start();
this._battler.usingSkill = this._skill;
}
*process() {
if (!this._battler.checkConsumeCost(this._skill)) return;
const actionComponent = ARPG_CustomManager.actionComponent(
this._battler,
this._skill
);
if (actionComponent) {
this.addComponent(actionComponent);
yield* this.waitComponent(actionComponent);
}
}
damageCancel() {
this.end();
this._damageCanceled = true;
}
terminate() {
super.terminate();
if (this._battler.isActor()) {
if (!this._damageCanceled && !this._battler.isSkillActivating()) {
SoundManager.playBuzzer();
}
}
this._battler.endSkillActivation();
this._battler.usingSkill = void 0;
}
};
// ts/ARPG_Core/ARPG_Actor.ts
var ARPG_Actor = class extends ARPG_Battler {
constructor(actorId) {
super();
this._actorId = actorId;
}
battler() {
return $gameActors.actor(this._actorId);
}
actor() {
return this.battler();
}
name() {
return this.actor().name();
}
arpgParameters() {
return this.actor().arpgParameters();
}
isActor() {
return true;
}
checkOpponent(battler) {
return battler.isEnemy();
}
makeRecvDamageComponent(result) {
const recvDamageComponent = ARPG_CustomManager.actorRecvDamageComponent(
this,
result,
result.guardResult()
);
let damageComponent;
if (this.isAlive()) {
damageComponent = recvDamageComponent;
} else {
damageComponent = new ChainComponent([
recvDamageComponent,
() => {
$gameMap.arpgBattleManager()?.gameover();
},
]);
}
return damageComponent;
}
weaponActionSkillIds() {
const weapons = this.actor().weapons();
return weapons.map((weapon) => {
if (weapon.meta.skill) {
let skillId;
const strSkill = weapon.meta.skill.replace(/\s/, "");
if (strSkill.match(/^\d+$/)) {
skillId = parseInt(strSkill);
} else {
skillId = ARPG_Utils.searchSkillId(strSkill);
}
if (skillId && skillId > 0) return skillId;
}
return this.normalAttackSkillId();
});
}
normalAttackSkillId() {
if (ARPG_CorePluginParams.ActorSetting.NormalAttackSkillId == null)
return 1;
return ARPG_CorePluginParams.ActorSetting.NormalAttackSkillId;
}
onGuardStart() {
super.onGuardStart();
const component = ARPG_CustomManager.actorGuardStart(this);
if (component) this.addComponent(component);
}
onGuardEnd() {
super.onGuardEnd();
const component = ARPG_CustomManager.actorGuardEnd(this);
if (component) this.addComponent(component);
}
};
// ts/ARPG_Core/ARPG_CharacterTempData.ts
var ARPG_CharacterTempData = class {
constructor() {
this.lastARPGMode = false;
}
};
// ts/ARPG_Core/KnockbackProcessor.ts
var KnockbackProcessor = class extends Processor {
constructor(deg, initialVelocity, duration) {
super();
this._deg = deg;
this._initialVelocity = initialVelocity;
this._duration = duration;
}
start() {
super.start();
if (this._character instanceof Game_Event) {
const interpreter = this._character.interpreter();
if (interpreter) {
interpreter.lock("knockback");
this._character.stopSelfMovement("knockback");
}
} else if (this._character instanceof Game_Player) {
this._character.stopMoveByInput("knockback");
}
this._character.cancelMove();
if (this._character._moveRoute) {
this._character.processRouteEnd();
}
}
*process() {
const tmpMoveSpeed = this._character.moveSpeed();
const tmpDpf = this._character._dpf;
const tmpMaxAcceleration = this._character._maxAcceleration;
const tmpAccelerationPlus = this._character._accelerationPlus;
const tmpIntertia = this._character._inertia;
const tmpDirFixed = this._character.isDirectionFixed();
this._character.setDirectionFix(true);
this._character.setDpf(0.1);
this._character.setAcc(0, 0);
for (let i = 0; i < this._duration; i++) {
const dpf =
this._initialVelocity - i * (this._initialVelocity / this._duration);
this._character.setDpf(dpf);
this._character.dotMoveByDeg(this._deg.value);
yield;
}
this._character.setDirectionFix(tmpDirFixed);
this._character.setMoveSpeed(tmpMoveSpeed);
this._character.setDpf(tmpDpf);
this._character.setAcc(tmpMaxAcceleration, tmpAccelerationPlus);
this._character.setInertia(tmpIntertia);
}
terminate() {
super.terminate();
if (this._character instanceof Game_Event) {
this._character.interpreter()?.unlock("knockback");
this._character.resumeSelfMovement("knockback");
} else if (this._character instanceof Game_Player) {
this._character.resumeMoveByInput("knockback");
}
}
};
// ts/ARPG_Core/Game_Character.ts
var _Game_Character_Mixin = class extends Game_Character {
update() {
if ($gameMap.isEnabledARPGMode()) {
if (!this.arpgTempData().lastARPGMode) {
this.arpgTempData().lastARPGMode = true;
this.startARPGProcess();
}
} else {
if (this.arpgTempData().lastARPGMode) {
this.arpgTempData().lastARPGMode = false;
this.endARPGProcess();
}
}
this.arpgTempData().componentRunner?.prepareUpdate();
_Game_Character_Mixin._update.call(this);
this.arpgTempData().componentRunner?.update();
}
isInTheScreen(xMargin, yMargin) {
const gw = Graphics.width;
const gh = Graphics.height;
const tw = $gameMap.tileWidth();
const th = $gameMap.tileHeight();
const px = this.scrolledX() * tw + tw / 2 - gw / 2;
const py = this.scrolledY() * th + th / 2 - gh / 2;
const dw = gw / 2 + xMargin * tw;
const dh = gh / 2 + yMargin * th;
return px >= -dw && px <= dw && py >= -dh && py <= dh;
}
addDisableMoveReason(reason) {
if (this._disableMoveReason == null) {
this._disableMoveReason = [reason];
} else {
this._disableMoveReason = [
...new Set(this._disableMoveReason.concat([reason])),
];
}
}
removeDisableMoveReason(reason) {
if (this._disableMoveReason != null)
this._disableMoveReason = this._disableMoveReason.filter(
(r) => r !== reason
);
}
isDisableMove() {
if (this._disableMoveReason == null) return false;
return this._disableMoveReason.length > 0;
}
setDirection(d) {
if (!this.isDisableMove()) {
_Game_Character_Mixin._setDirection.call(this, d);
}
}
moveCancel() {
this.mover().cancelMove();
this.processRouteEnd();
}
isNoCheckMapValid() {
if (this._noCheckMapValid == null) return false;
return this._noCheckMapValid;
}
setNoCheckMapValid(noCheckMapValid) {
this._noCheckMapValid = noCheckMapValid;
}
createArpgTempData() {
const tempData = new ARPG_CharacterTempData();
return tempData;
}
arpgTempData() {
return $gameTemp.arpgCharacterTempData(this);
}
startARPGProcess() {}
endARPGProcess() {
if (this.arpgTempData().battler) {
this.arpgTempData().battler?.end();
this.arpgTempData().battler = void 0;
}
if (this.arpgTempData().skillObject) {
this.arpgTempData().skillObject?.end();
this.arpgTempData().skillObject = void 0;
}
}
battler() {
const battler = this.arpgTempData().battler;
if (!battler) throw new Error("_battler is undefined.");
return battler;
}
isBattler() {
return !!this.arpgTempData().battler;
}
isSkillObject() {
return !!this.arpgTempData().skillObject;
}
isFieldObject() {
return !!this.arpgTempData().fieldObject;
}
skillObject() {
const skillObject = this.arpgTempData().skillObject;
if (!skillObject) throw new Error("skillObject is undefined.");
return skillObject;
}
fieldObject() {
const fieldObject = this.arpgTempData().fieldObject;
if (!fieldObject) throw new Error("fieldObject is undefined.");
return fieldObject;
}
isNeedCharacterHpGauge() {
if (!this.isBattler()) return false;
if (this.battler().isEnemy()) {
const enemy = this.battler();
if (enemy.isNeedCharacterHpGauge()) return true;
}
return false;
}
isCharacterHpGaugeVisibled() {
if (!this.isBattler()) return false;
if (this.battler().isEnemy()) {
const enemy = this.battler();
if (enemy.isCharacterHpGaugeVisibled()) return true;
}
return false;
}
hpGaugeColor1() {
if (!this.isBattler()) return void 0;
if (this.battler().isEnemy()) {
const enemy = this.battler();
return enemy.hpGaugeColor1();
}
return void 0;
}
hpGaugeColor2() {
if (!this.isBattler()) return void 0;
if (this.battler().isEnemy()) {
const enemy = this.battler();
return enemy.hpGaugeColor2();
}
return void 0;
}
setupActor(actorId) {
this.arpgTempData().battler?.end();
const battler = new ARPG_Actor(actorId);
this.arpgTempData().battler = battler;
this.addComponent(battler);
for (const hitBoxParam of ARPG_CorePluginParams.ActorSetting.ActorHitBox
.AttackHitBoxList) {
const rect = new Rectangle(
hitBoxParam.X,
hitBoxParam.Y,
hitBoxParam.Width,
hitBoxParam.Height
);
const hitBox = new HitBox(
"attack",
this,
rect,
ARPG_CorePluginParams.HitBoxSetting.AttackHitBoxColor
);
this.battler().attackHitChecker.addHitBox(hitBox);
}
for (const hitBoxParam of ARPG_CorePluginParams.ActorSetting.ActorHitBox
.DamageHitBoxList) {
const rect = new Rectangle(
hitBoxParam.X,
hitBoxParam.Y,
hitBoxParam.Width,
hitBoxParam.Height
);
const hitBox = new HitBox(
"damage",
this,
rect,
ARPG_CorePluginParams.HitBoxSetting.DamageHitBoxColor
);
this.battler().damageHitChecker.addHitBox(hitBox);
}
}
moveTowardNearActor() {
const actorCharacters = [$gamePlayer];
let minFar = 65535;
let minFarActor = null;
for (const character of actorCharacters) {
const far = this.calcFar(character);
if (far <= minFar) {
minFar = far;
minFarActor = character;
}
}
if (minFarActor) this.moveTowardCharacter(minFarActor);
}
moveAwayNearActor() {
const { character } = ARPG_Utils.searchNearBattler(this, "opponent");
if (character) this.moveAwayFromCharacter(character);
}
addComponent(component) {
let componentRunner = this.arpgTempData().componentRunner;
if (!componentRunner) {
componentRunner = new ComponentRunner(this);
this.arpgTempData().componentRunner = componentRunner;
}
componentRunner.addComponent(component);
}
removeComponent(component) {
let componentRunner = this.arpgTempData().componentRunner;
if (!componentRunner) {
componentRunner = new ComponentRunner(this);
this.arpgTempData().componentRunner = componentRunner;
}
componentRunner.removeComponent(component);
}
hasComponent(component) {
let componentRunner = this.arpgTempData().componentRunner;
if (!componentRunner) {
componentRunner = new ComponentRunner(this);
this.arpgTempData().componentRunner = componentRunner;
}
return componentRunner.hasComponent(component);
}
hasComponentByClass(componentClass) {
let componentRunner = this.arpgTempData().componentRunner;
if (!componentRunner) {
componentRunner = new ComponentRunner(this);
this.arpgTempData().componentRunner = componentRunner;
}
return componentRunner.hasComponentByClass(componentClass);
}
startKnockback(deg, initialVelocity, duration) {
if (this.isKnockbacking()) return;
this.addComponent(new KnockbackProcessor(deg, initialVelocity, duration));
}
isKnockbacking() {
return this.hasComponentByClass(KnockbackProcessor);
}
};
var Game_Character_Mixin2 = _Game_Character_Mixin;
Game_Character_Mixin2._update = Game_Character.prototype.update;
Game_Character_Mixin2._setDirection = Game_Character.prototype.setDirection;
mixin(Game_Character, Game_Character_Mixin2);
// ts/ARPG_Core/ARPG_BattleManager.ts
var ARPG_BattleManager = class extends Component {
constructor() {
super(...arguments);
this._showSkillNameCount = 0;
}
gameover() {
const gameoverComponent = ARPG_CustomManager.gameoverComponent();
if (gameoverComponent) {
this.addComponent(gameoverComponent);
} else {
SceneManager.goto(Scene_Gameover);
}
}
showSkillNameWindow(user, skill) {
const w = 320;
const h = 64;
const x = Graphics.boxWidth / 2 - w / 2;
const y = 0;
const rect = new Rectangle(x, y, w, h);
const skillData = skill.data();
const text1 = skillData.message1.format(user.name(), skillData.name);
$gameMap.showCommonMessageWindow(text1, rect);
if (skillData.message2 && skillData.message2 != "") {
const text2 = skillData.message2.format(user.name(), skillData.name);
$gameMap.showCommonMessageWindow(text2, rect);
}
if (this._showSkillNameCount === 0) {
$gameTemp
.arpgGlobalTempData()
.skillNameWindowController.startManualWait();
}
this._showSkillNameCount++;
}
endShowSkillNameWindow() {
if (this._showSkillNameCount > 0) {
this._showSkillNameCount--;
if (this._showSkillNameCount === 0) {
$gameTemp
.arpgGlobalTempData()
.skillNameWindowController.endManualWait();
}
}
}
};
// ts/ARPG_Core/TransparentObject.ts
var TransparentObject = class extends Game_Character {
constructor(...args) {
super(...args);
}
initialize(...args) {
super.initialize();
this.setNoCheckMapValid(true);
this.setEnableWallSlide(false);
this._remainFar = 0;
this._slideLengthX = 0;
this._slideLengthY = 0;
}
castTo(deg, far) {
let loopCount = 0;
this._remainFar = far;
while (true) {
if (++loopCount > 255) throw new Error("endless loop error");
const pos = this.positionPoint();
if (!$gameMap.isValid(pos.x, pos.y)) {
return false;
}
this.dotMoveByDeg(deg.value);
if (!this.isMovementSucceeded()) {
return true;
}
if (this._remainFar <= 0) {
this.dotMoveByDeg(deg.value);
if (!this.isMovementSucceeded()) {
return true;
} else {
return false;
}
}
}
}
distancePerFrame() {
return 1;
}
moveCallback(moved, dpf) {
super.moveCallback(moved, dpf);
if (moved) {
this._remainFar -= dpf;
}
}
checkCollisionTargetCharacter(x, y, d, character) {
if (character instanceof Game_Player) {
return this.checkCollisionTargetPlayer(x, y, d, character);
} else if (character instanceof Game_Follower) {
if ($gamePlayer.followers().isVisible()) {
return this.checkCollisionTargetFollower(x, y, d, character);
}
} else if (character instanceof Game_Event) {
return this.checkCollisionTargetEvent(x, y, d, character);
} else if (character instanceof Game_Vehicle) {
return this.checkCollisionTargetVehicle(x, y, d, character);
}
return false;
}
};
// ts/ARPG_Core/Game_Map.ts
var _Game_Map_initialize = Game_Map.prototype.initialize;
Game_Map.prototype.initialize = function () {
_Game_Map_initialize.call(this);
this._arpgMode = false;
this._stopped = false;
};
var _Game_Map_setup = Game_Map.prototype.setup;
Game_Map.prototype.setup = function (mapId) {
_Game_Map_setup.call(this, mapId);
this.endARPGMode();
};
Game_Map.prototype.outOfMap = function (character) {
const pos = character.positionPoint();
return (
pos.x + character.width() < 0 ||
pos.y > this.width() ||
pos.y + character.height() < 0 ||
pos.y > this.height()
);
};
Game_Map.prototype.stop = function () {
return (this._stopped = true);
};
Game_Map.prototype.resume = function () {
return (this._stopped = false);
};
Game_Map.prototype.isStopped = function () {
return this._stopped;
};
Game_Map.prototype.startARPGMode = function () {
if (!this._arpgMode) {
const controlCharacter = $gameTemp.arpgGlobalTempData().controlCharacter;
if (!this._arpgBattleManager) {
this._arpgBattleManager = new ARPG_BattleManager();
controlCharacter.addComponent(this._arpgBattleManager);
}
this._arpgMode = true;
}
$gameSwitches.setValue(ARPG_CorePluginParams.EnableARPGSwitchId, true);
};
Game_Map.prototype.endARPGMode = function () {
if (this._arpgMode) {
this._arpgBattleManager?.end();
this._arpgBattleManager = void 0;
$gameTemp.arpgGlobalTempData().bossHpGaugeTargetEnemy = void 0;
this._arpgMode = false;
}
$gameSwitches.setValue(ARPG_CorePluginParams.EnableARPGSwitchId, false);
};
Game_Map.prototype.isEnabledARPGMode = function () {
return this._arpgMode;
};
Game_Map.prototype.arpgBattleManager = function () {
return this._arpgBattleManager;
};
var _Game_Map_allCharacters = Game_Map.prototype.allCharacters;
Game_Map.prototype.allCharacters = function () {
const characters = _Game_Map_allCharacters.call(this);
for (const hitBox of this.allHitBoxs()) {
characters.add(hitBox);
}
if (this._transparentObject) characters.add(this._transparentObject);
return characters;
};
Game_Map.prototype.allHitBoxs = function () {
const hitBoxs = /* @__PURE__ */ new Set();
if ($gamePlayer.isBattler()) {
for (const hitBox of $gamePlayer.battler().damageHitChecker.hitBoxs) {
hitBoxs.add(hitBox);
}
for (const hitBox of $gamePlayer.battler().attackHitChecker.hitBoxs) {
hitBoxs.add(hitBox);
}
}
for (const event of this.events()) {
if (event.isBattler()) {
const battler = event.battler();
for (const hitBox of battler.damageHitChecker.hitBoxs) {
hitBoxs.add(hitBox);
}
for (const hitBox of battler.attackHitChecker.hitBoxs) {
hitBoxs.add(hitBox);
}
for (const customHitChecker of battler.customHitCheckers.values()) {
for (const hitBox of customHitChecker.hitBoxs) {
hitBoxs.add(hitBox);
}
}
} else if (event.isSkillObject()) {
const skillObject = event.skillObject();
for (const hitBox of skillObject.attackHitChecker.hitBoxs) {
hitBoxs.add(hitBox);
}
for (const customHitChecker of skillObject.customHitCheckers.values()) {
for (const hitBox of customHitChecker.hitBoxs) {
hitBoxs.add(hitBox);
}
}
}
}
return hitBoxs;
};
Game_Map.prototype.showCommonMessageWindow = function (text, rect, opt = {}) {
$gameTemp
.arpgGlobalTempData()
.skillNameWindowController.showWindow(text, rect, opt);
};
Game_Map.prototype.startSceneIndication = function (scene) {
let skillNameWindowController =
$gameTemp.arpgGlobalTempData().skillNameWindowController;
const createWindowCallback =
scene.createSkillNameWindowCallback.bind(scene);
const deleteWindowCallback =
scene.deleteSkillNameWindowCallback.bind(scene);
skillNameWindowController.sceneStart(
createWindowCallback,
deleteWindowCallback
);
$gamePlayer.setupActor($gameParty.leader().actorId());
};
Game_Map.prototype.terminateSceneIndication = function (scene) {
$gameTemp.arpgGlobalTempData().skillNameWindowController?.sceneTerminate();
};
Game_Map.prototype.transparentObjectCastTo = function (
pos,
deg,
far,
opt = {}
) {
this._transparentObject = new TransparentObject();
this._transparentObject.setPositionPoint(pos);
if (opt.width) this._transparentObject.setWidth(opt.width);
if (opt.height) this._transparentObject.setHeight(opt.height);
const collided = this._transparentObject.castTo(deg, far);
let result;
if (collided) result = this._transparentObject.positionPoint();
$gameTemp.removeUnusedCache();
this._transparentObject = void 0;
$gameTemp.removeUnusedCache();
return result;
};
// ts/ARPG_Core/PlayerBehavior.ts
var PlayerBehavior = class extends Component {
constructor() {
super(...arguments);
this._attackProcess = new AttackProcess();
this._guardProcess = new GuardProcess();
}
setup() {
super.setup();
this.addComponent(this._attackProcess);
this.addComponent(this._guardProcess);
}
delayAttackable(delayTime) {
this._attackProcess.delayAttackable(delayTime);
}
};
var _AttackProcess = class extends Component {
constructor() {
super(...arguments);
this._waitAttackTimer = new TimerComponent();
this._delayAttackableTimer = new TimerComponent();
}
setup() {
super.setup();
this.addComponent(this._waitAttackTimer);
this.addComponent(this._delayAttackableTimer);
}
delayAttackable(delayTime) {
this._delayAttackableTimer.startTimer(delayTime);
}
update() {
super.update();
if ($gameMap.isEventRunning()) {
this._waitAttackTimer.stop();
}
if (this._waitAttackTimer.checkTimeout()) {
if (!$gameMap.isEventRunning()) {
const actor = this._character.battler();
if (actor.canUsableSkill()) {
for (const skillId of actor.weaponActionSkillIds()) {
if (skillId > 0) {
actor.useSkill("skill", skillId, { queuing: true });
}
}
}
}
}
if (!$gameMap.isEventRunning() && !this._delayAttackableTimer.isBusy()) {
const keysym = ARPG_Utils.getKeySymbol("ActorNormalAttack");
if (keysym && Input.isTriggered(keysym)) {
this._waitAttackTimer.startTimer(_AttackProcess.WAIT_ATTACK_TIME);
}
}
}
};
var AttackProcess = _AttackProcess;
AttackProcess.WAIT_ATTACK_TIME = 2;
var GuardProcess = class extends Component {
update() {
super.update();
const keysym = ARPG_Utils.getKeySymbol("ActorGuard");
if (keysym && Input.isPressed(keysym)) {
this._character.battler().startGuard("input");
} else {
this._character.battler().endGuard("input");
}
}
};
// ts/ARPG_Core/Game_Player.ts
var _Game_Player_Mixin = class extends Game_Player {
initMembers() {
_Game_Player_Mixin._initMembers.call(this);
this._stopMoveByInputReasons = [];
}
update(sceneActive) {
if ($gameMap.isEnabledARPGMode()) {
if (!this._playerBehavior) {
this._playerBehavior = new PlayerBehavior();
this.addComponent(this._playerBehavior);
}
} else {
this._playerBehavior?.end();
this._playerBehavior = void 0;
}
_Game_Player_Mixin._update.call(this, sceneActive);
$gameParty.leader().updateStatesDuration();
}
onStartTargetSelect() {
this.addDisableMoveReason("targetSelect");
}
onEndTargetSelect() {
this.removeDisableMoveReason("targetSelect");
this._playerBehavior.delayAttackable(2);
}
moveByInput() {
if (this.isStoppedMoveByInput()) return;
_Game_Player_Mixin._moveByInput.call(this);
}
stopMoveByInput(reason) {
if (!this._stopMoveByInputReasons.includes(reason))
this._stopMoveByInputReasons.push(reason);
}
resumeMoveByInput(reason) {
this._stopMoveByInputReasons = this._stopMoveByInputReasons.filter(
(r) => r !== reason
);
}
isStoppedMoveByInput() {
return this._stopMoveByInputReasons.length > 0;
}
};
var Game_Player_Mixin = _Game_Player_Mixin;
Game_Player_Mixin._initMembers = Game_Player.prototype.initMembers;
Game_Player_Mixin._update = Game_Player.prototype.update;
Game_Player_Mixin._moveByInput = Game_Player.prototype.moveByInput;
mixin(Game_Player, Game_Player_Mixin);
// ts/ARPG_Core/ARPG_BattlerParameters.ts
var ARPG_BattlerParameters = class {
constructor() {
this._skillCancelDamageRate = 0;
this._noDamageFlag = false;
this._noAttackFlag = false;
}
get skillCancelDamageRate() {
return this._skillCancelDamageRate;
}
set skillCancelDamageRate(value) {
this._skillCancelDamageRate = value;
}
get justGuardFrame() {
return this._justGuardFrame;
}
set justGuardFrame(value) {
this._justGuardFrame = value;
}
get noDamageFlag() {
return this._noDamageFlag;
}
set noDamageFlag(_noDamageFlag) {
this._noDamageFlag = _noDamageFlag;
}
get noAttackFlag() {
return this._noAttackFlag;
}
set noAttackFlag(_noAttackFlag) {
this._noAttackFlag = _noAttackFlag;
}
};
// ts/ARPG_Core/ARPG_Enemy.ts
var ARPG_Enemy = class extends ARPG_Battler {
constructor(enemyId, opt = {}) {
super();
this._needHpGauge = false;
this._showHpGauge = true;
this._defeated = false;
this._arpgParameters = new ARPG_BattlerParameters();
this._enemy = new Game_Enemy(enemyId, 0, 0);
this._enemy.refresh();
this._enemy.recoverAll();
if (opt.collideAttackSkillId != null)
this.setCollideAttackSkillId(opt.collideAttackSkillId);
if (opt.damageCommonEventId != null)
this._damageCommonEventId = opt.damageCommonEventId;
if (opt.defeatEnemyCommonEventId != null)
this._defeatEnemyCommonEventId = opt.defeatEnemyCommonEventId;
}
update() {
super.update();
this.battler().updateStatesDuration();
}
battler() {
return this._enemy;
}
enemy() {
return this.battler();
}
name() {
return this.enemy().battlerName();
}
arpgParameters() {
return this._arpgParameters;
}
isEnemy() {
return true;
}
checkOpponent(battler) {
return battler.isActor();
}
exp() {
return this._enemy.exp();
}
gold() {
return this._enemy.gold();
}
isNeedCharacterHpGauge() {
return this._needHpGauge;
}
isCharacterHpGaugeVisibled() {
if (this.isDefeated()) return false;
return this._showHpGauge;
}
setupHpGauge(hpGaugeColor1, hpGaugeColor2) {
this._needHpGauge = true;
this._hpGaugeColor1 = hpGaugeColor1;
this._hpGaugeColor2 = hpGaugeColor2;
}
setHpGaugeVisible(visible) {
this._showHpGauge = visible;
}
hpGaugeColor1() {
return this._hpGaugeColor1;
}
hpGaugeColor2() {
return this._hpGaugeColor2;
}
makeRecvDamageComponent(result) {
const recvDamageComponent = ARPG_CustomManager.enemyRecvDamageComponent(
this,
result
);
let damageComponent;
if (this.isAlive()) {
damageComponent = recvDamageComponent;
} else {
const defeatComponent = ARPG_CustomManager.enemyDefeatComponent(
this,
result
);
damageComponent = new ChainComponent([
recvDamageComponent,
new DefeatEnemyComponent(this, defeatComponent),
this.onDefeat.bind(this),
]);
}
return damageComponent;
}
onDefeat() {
this._defeated = true;
}
isDefeated() {
return this._defeated;
}
character() {
return super.character();
}
damageCommonEventId() {
if (this._damageCommonEventId != null && this._damageCommonEventId > 0)
return this._damageCommonEventId;
return ARPG_CorePluginParams.EnemySetting.DamageCommonEventId;
}
defeatEnemyCommonEventId() {
if (
this._defeatEnemyCommonEventId != null &&
this._defeatEnemyCommonEventId > 0
)
return this._defeatEnemyCommonEventId;
return ARPG_CorePluginParams.EnemySetting.DefeatEnemyCommonEventId;
}
};
var DefeatEnemyComponent = class extends Component {
constructor(enemy, motionComponent) {
super();
this._enemy = enemy;
this._motionComponent = motionComponent;
}
start() {
super.start();
if (this._character instanceof Game_Event) {
this._character.interpreter()?.lock("defeat");
this._character.stopSelfMovement("defeat");
}
this._character.cancelMove();
if (this._character._moveRoute) {
this._character.processRouteEnd();
}
if (this._motionComponent) this.addComponent(this._motionComponent);
}
update() {
super.update();
if (!this._motionComponent || this._motionComponent.isTerminated()) {
this.end();
}
}
terminate() {
super.terminate();
if (this._character instanceof Game_Event) {
this._character.interpreter()?.unlock("defeat");
this._character.resumeSelfMovement("defeat");
}
const exp = this._enemy.exp();
for (const actor of $gameParty.allMembers()) {
actor.gainExp(exp);
}
$gameParty.gainGold(this._enemy.gold());
}
};
// ts/ARPG_Core/ARPG_SkillObject.ts
var ARPG_SkillObject = class extends Component {
constructor(skill, user) {
super();
this._attackHitChecker = new HitChecker("attack");
this._customHitCheckers = /* @__PURE__ */ new Map();
this._skill = skill;
this._user = user;
}
get attackHitChecker() {
return this._attackHitChecker;
}
get customHitCheckers() {
return this._customHitCheckers;
}
start() {
super.start();
this.addComponent(this._attackHitChecker);
}
skill() {
return this._skill;
}
user() {
return this._user;
}
setAttackDeg(deg) {
this._attackDeg = deg;
}
attackDeg() {
return this._attackDeg;
}
makeSkillObject(srcMapId, srcEventIdOrName, skill, x = 0, y = 0) {
const event = $gameMap.makeDynamicEvent(srcMapId, srcEventIdOrName, x, y);
if (skill == null) {
skill = this._skill;
}
event.setupSkillObject(skill.skillOrItem, skill.id, this._user);
let userKind = 0;
let userEventId = 0;
const userCharacter = this._user.character();
if (userCharacter instanceof Game_Player) {
userKind = 1;
} else if (userCharacter instanceof Game_Event) {
userKind = 3;
userEventId = userCharacter.eventId();
}
if (
ARPG_CorePluginParams.SkillObjectSetting
.SkillObjectUserKindSelfVariableId > 0
) {
event.setSelfVariableValue(
ARPG_CorePluginParams.SkillObjectSetting
.SkillObjectUserKindSelfVariableId,
userKind
);
}
if (
ARPG_CorePluginParams.SkillObjectSetting
.SkillObjectUserEventIdSelfVariableId > 0
) {
event.setSelfVariableValue(
ARPG_CorePluginParams.SkillObjectSetting
.SkillObjectUserEventIdSelfVariableId,
userEventId
);
}
return event;
}
createEffect(subject, target, skill) {
return new ARPG_Effect(subject, target, skill, this.attackDeg());
}
applyDamageEffectToBattler(battler, arpgSkill) {
if (battler.isNoDamage()) return;
const effect = this.createEffect(this.user(), battler, arpgSkill);
this._character.setExSelfSwitchValue(
ARPG_CorePluginParams.SkillObjectSetting.CollisionDetectExSelfSwitchId,
true
);
battler.recvDamage(effect);
}
};
// ts/ARPG_Core/ARPG_FieldObject.ts
var ARPG_FieldObject = class extends Component {
constructor() {
super(...arguments);
this._customHitCheckers = /* @__PURE__ */ new Map();
}
get customHitCheckers() {
return this._customHitCheckers;
}
start() {
super.start();
}
};
// ts/ARPG_Core/Game_Event.ts
var _Game_Event_Mixin2 = class extends Game_Event {
initMembers() {
_Game_Event_Mixin2._initMembers.call(this);
this._stopSelfMovementReasons = [];
}
isValid() {
const margin = 2;
if (
this._realX >= $gameMap.displayX() - margin &&
this._realY >= $gameMap.displayY() - margin
) {
if (
this._realX + this.width() <= $gameMap.displayX() + 17 + margin &&
this._realY + this.height() <= $gameMap.displayY() + 13 + margin
) {
return true;
}
}
return false;
}
isErased() {
return this._erased;
}
setupSkillObject(skillOrItem, id, user) {
const skill = new ARPG_Skill(skillOrItem, id);
const skillObject = new ARPG_SkillObject(skill, user);
this.arpgTempData().skillObject = skillObject;
this.addComponent(skillObject);
}
setupEnemy(enemyId, opt = {}) {
const battler = new ARPG_Enemy(enemyId, opt);
this.arpgTempData().battler = battler;
this.addComponent(battler);
}
setupFieldObject() {
const fieldObject = new ARPG_FieldObject();
this.arpgTempData().fieldObject = fieldObject;
this.addComponent(fieldObject);
}
updateRoutineMove() {
if (
!(this.isBattler() && this.battler().isEnemy()) ||
!SceneManager._scene._messageWindow.isOpen()
) {
_Game_Event_Mixin2._updateRoutineMove.call(this);
}
}
updateSelfMovement() {
if (this.isStoppedSelfMovement()) return;
_Game_Event_Mixin2._updateSelfMovement.call(this);
}
stopSelfMovement(reason) {
if (!this._stopSelfMovementReasons.includes(reason))
this._stopSelfMovementReasons.push(reason);
}
resumeSelfMovement(reason) {
this._stopSelfMovementReasons = this._stopSelfMovementReasons.filter(
(r) => r !== reason
);
}
isStoppedSelfMovement() {
return this._stopSelfMovementReasons.length > 0;
}
interpreter() {
if (this._interpreter == null) return void 0;
return this._interpreter;
}
updateParallel() {
if (this._interpreter && this._interpreter.isLocked()) return;
_Game_Event_Mixin2._updateParallel.call(this);
}
};
var Game_Event_Mixin2 = _Game_Event_Mixin2;
Game_Event_Mixin2._initMembers = Game_Event.prototype.initMembers;
Game_Event_Mixin2._updateRoutineMove = Game_Event.prototype.updateRoutineMove;
Game_Event_Mixin2._updateSelfMovement =
Game_Event.prototype.updateSelfMovement;
Game_Event_Mixin2._updateParallel = Game_Event.prototype.updateParallel;
mixin(Game_Event, Game_Event_Mixin2);
// ts/ARPG_Core/LevelUpProcessor.ts
var LevelUpProcessor = class extends Processor {
constructor(actor, levelUpMessage, newSkills) {
super();
this._actor = actor;
this._displayLevelUpProcessor = new DisplayLevelUpProcessor(
levelUpMessage,
newSkills
);
}
*process() {
this.addComponent(this._displayLevelUpProcessor);
const component = ARPG_CustomManager.levelUpComponent(this._actor);
if (component) {
$gamePlayer.addComponent(component);
yield* this.waitComponent(component);
}
yield* this.waitComponent(this._displayLevelUpProcessor);
}
};
var DisplayLevelUpProcessor = class extends Processor {
constructor(levelUpMessage, newSkills) {
super();
this._levelUpMessage = levelUpMessage;
this._newSkills = newSkills;
}
*process() {
const w = 640;
const h = 64;
const x = Graphics.boxWidth / 2 - w / 2;
const y = 0;
const rect = new Rectangle(x, y, w, h);
$gameMap.showCommonMessageWindow(this._levelUpMessage, rect);
for (const skill of this._newSkills) {
yield* this.waitProcess(30);
const text = TextManager.obtainSkill.format(skill.name);
$gameMap.showCommonMessageWindow(text, rect);
}
}
};
// ts/ARPG_Core/Game_Actor.ts
var _Game_Actor_Mixin = class extends Game_Actor {
initialize(actorId) {
_Game_Actor_Mixin._initialize.call(this, actorId);
this._arpgParameters = new ARPG_BattlerParameters();
}
displayLevelUp(newSkills) {
if (SceneManager._scene instanceof Scene_Map) {
const text = TextManager.levelUp.format(
this._name,
TextManager.level,
this._level
);
$gamePlayer.addComponent(new LevelUpProcessor(this, text, newSkills));
} else {
_Game_Actor_Mixin._displayLevelUp.call(this, newSkills);
}
}
arpgParameters() {
return this._arpgParameters;
}
};
var Game_Actor_Mixin = _Game_Actor_Mixin;
Game_Actor_Mixin._initialize = Game_Actor.prototype.initialize;
Game_Actor_Mixin._displayLevelUp = Game_Actor.prototype.displayLevelUp;
mixin(Game_Actor, Game_Actor_Mixin);
// ts/ARPG_Core/Game_Interpreter.ts
var _Game_Interpreter_Mixin = class extends Game_Interpreter {
initialize() {
_Game_Interpreter_Mixin._initialize.call(this);
this._needChantWait = false;
this._needTargetSelectWait = false;
}
clear() {
_Game_Interpreter_Mixin._clear.call(this);
this._lockReason = [];
}
lock(reason) {
if (!this._lockReason.includes(reason)) {
this._lockReason.push(reason);
}
}
unlock(reason) {
this._lockReason = this._lockReason.filter((r) => r !== reason);
}
isLocked() {
return this._lockReason.length > 0;
}
update() {
if (this.isLocked()) return;
_Game_Interpreter_Mixin._update.call(this);
}
event() {
return $gameMap.event(this._eventId);
}
findCharacterBySpecification(param) {
let characterKind = 0;
if (param.CharacterKindByVariable === 0) {
switch (param.CharacterKind) {
case "thisEvent":
characterKind = 0;
break;
case "player":
characterKind = 1;
break;
case "follower":
characterKind = 2;
break;
case "event":
characterKind = 3;
break;
case "vehicle":
characterKind = 4;
break;
}
} else {
characterKind = $gameVariables.value(param.CharacterKindByVariable);
}
let character;
switch (characterKind) {
case 0:
character = $gameMap.event(this._eventId);
break;
case 1:
character = $gamePlayer;
break;
case 2:
let followerIndex = 0;
if (param.FollowerIndex > 0) {
followerIndex = $gameVariables.value(param.FollowerIndexByVariable);
} else {
followerIndex = param.FollowerIndex;
}
character = $gamePlayer.followers().data()[followerIndex - 1];
break;
case 3:
let eventId = 0;
if (param.EventIdByVariable > 0) {
eventId = $gameVariables.value(param.EventIdByVariable);
} else {
if (typeof param.EventIdOrName === "number") {
eventId = param.EventIdOrName;
} else {
eventId = this.eventNameToId(param.EventIdOrName);
}
}
if (eventId > 0) character = $gameMap.event(eventId);
break;
case 4:
let VehicleKind;
if (param.FollowerIndex > 0) {
VehicleKind = $gameVariables.value(param.FollowerIndexByVariable);
} else {
if (param.VehicleKind === "boat") {
VehicleKind = 1;
} else if (param.VehicleKind === "ship") {
VehicleKind = 2;
} else if (param.VehicleKind === "airship") {
VehicleKind = 3;
}
}
if (VehicleKind === 1) {
character = $gameMap.boat();
} else if (VehicleKind === 2) {
character = $gameMap.ship();
} else if (VehicleKind === 3) {
character = $gameMap.airship();
}
break;
}
if (character == null) {
throw new Error(`${JSON.stringify(param)} is invalid.`);
}
return character;
}
findArpgSkillBySpecification(param) {
if (param.SkillOrItem === "skill") {
let idOrName;
if (param.SkillIdByVariable > 0) {
idOrName = $gameVariables.value(param.SkillIdByVariable);
} else if (param.SkillByName && param.SkillByName !== "") {
idOrName = param.SkillByName;
} else {
idOrName = param.SkillId;
}
return new ARPG_Skill("skill", idOrName);
} else if (param.SkillOrItem === "item") {
let idOrName;
if (param.ItemIdByVariable > 0) {
idOrName = $gameVariables.value(param.ItemIdByVariable);
} else if (param.ItemByName && param.ItemByName !== "") {
idOrName = param.ItemByName;
} else {
idOrName = param.ItemId;
}
return new ARPG_Skill("item", idOrName);
}
throw new Error(`${JSON.stringify(param)} is invalid.`);
}
eventNameToId(eventName) {
for (const event of $gameMap.events()) {
if (event.event().name === eventName) {
return event.eventId();
}
}
throw new Error(`Event name(${eventName}) is not found.`);
}
arpgCharacter() {
if (this._eventId > 0) {
return $gameMap.event(this._eventId);
} else {
return $gamePlayer;
}
}
updateWait() {
const result = _Game_Interpreter_Mixin._updateWait.call(this);
if (result) return true;
return this.updateWait_ARPG_Core();
}
updateWait_ARPG_Core() {
const character = this.arpgCharacter();
if (!character) return false;
if (this._needChantWait) {
if (character.isBattler() && character.battler().isChanting()) {
return true;
} else {
this._needChantWait = false;
return false;
}
} else if (this._needTargetSelectWait) {
if ($gameMap.isTargetSelecting()) {
return true;
} else {
this._needTargetSelectWait = false;
return false;
}
}
return false;
}
};
var Game_Interpreter_Mixin = _Game_Interpreter_Mixin;
Game_Interpreter_Mixin._initialize = Game_Interpreter.prototype.initialize;
Game_Interpreter_Mixin._clear = Game_Interpreter.prototype.clear;
Game_Interpreter_Mixin._update = Game_Interpreter.prototype.update;
Game_Interpreter_Mixin._updateWait = Game_Interpreter.prototype.updateWait;
mixin(Game_Interpreter, Game_Interpreter_Mixin);
// ts/ARPG_Core/Sprite_Label.ts
var Sprite_Label = class extends Sprite {
constructor(...args) {
super(...args);
}
initialize(...args) {
super.initialize();
let width;
let height;
let opt;
if (args.length === 2) {
[width, height] = args;
opt = {};
} else {
[width, height, opt] = args;
}
this._text = "";
this._align = opt.align ?? "left";
this.bitmap = new Bitmap(width, height);
this.bitmap.fontFace = opt.fontFace ?? $gameSystem.mainFontFace();
this.bitmap.fontSize = opt.fontSize ?? $gameSystem.mainFontSize();
}
get text() {
return this._text;
}
set text(_text) {
this._text = _text;
this.redrawText();
}
get fontSize() {
return this.bitmap.fontSize;
}
set fontSize(_fontSize) {
this.bitmap.fontSize = _fontSize;
this.redrawText();
}
get fontFace() {
return this.bitmap.fontFace;
}
set fontFace(_fontFace) {
this.bitmap.fontFace = _fontFace;
this.redrawText();
}
get align() {
return this.bitmap.fontFace;
}
set align(_align) {
this._align = _align;
this.redrawText();
}
redrawText() {
if (this._text === "") {
this.hide();
} else {
this.show();
this.bitmap.clear();
this.bitmap.drawText(
this._text,
0,
0,
this.bitmap.width,
this.bitmap.fontSize,
this._align
);
}
}
};
// ts/ARPG_Core/Sprite_GaugeCustom.ts
var Sprite_GaugeCustom = class extends Sprite_Gauge {
setColorConfig(colorConfig) {
this._colorConfig = colorConfig;
}
gaugeColor1() {
switch (this._statusType) {
case "hp":
if (this._colorConfig?.hpGaugeColor1)
return this._colorConfig.hpGaugeColor1;
return ColorManager.hpGaugeColor1();
case "mp":
if (this._colorConfig?.mpGaugeColor1)
return this._colorConfig.mpGaugeColor1;
return ColorManager.mpGaugeColor1();
case "tp":
if (this._colorConfig?.tpGaugeColor1)
return this._colorConfig.tpGaugeColor1;
return ColorManager.tpGaugeColor1();
case "time":
if (this._colorConfig?.ctGaugeColor1)
return this._colorConfig.ctGaugeColor1;
return ColorManager.ctGaugeColor1();
default:
if (this._colorConfig?.normalColor)
return this._colorConfig.normalColor;
return ColorManager.normalColor();
}
}
gaugeColor2() {
switch (this._statusType) {
case "hp":
if (this._colorConfig?.hpGaugeColor2)
return this._colorConfig.hpGaugeColor2;
return ColorManager.hpGaugeColor2();
case "mp":
if (this._colorConfig?.mpGaugeColor2)
return this._colorConfig.mpGaugeColor2;
return ColorManager.mpGaugeColor2();
case "tp":
if (this._colorConfig?.tpGaugeColor2)
return this._colorConfig.tpGaugeColor2;
return ColorManager.tpGaugeColor2();
case "time":
if (this._colorConfig?.ctGaugeColor2)
return this._colorConfig.ctGaugeColor2;
return ColorManager.ctGaugeColor2();
default:
return ColorManager.normalColor();
}
}
};
// ts/ARPG_Core/Sprite_BossHpGauge.ts
var Sprite_BossHpGauge = class extends Sprite_GaugeCustom {
initMembers() {
super.initMembers();
this.x = (Graphics.boxWidth - this.bitmapWidth()) / 2;
this.y = 16;
}
bitmapWidth() {
return 500;
}
bitmapHeight() {
return 24;
}
gaugeHeight() {
return 12;
}
gaugeX() {
return 0;
}
redraw() {
this.bitmap.clear();
const currentValue = this.currentValue();
if (!isNaN(currentValue)) {
this.drawGauge();
}
}
};
// ts/ARPG_Core/Sprite_HitBox.ts
var Sprite_HitBox = class extends Sprite {
constructor(...args) {
super(...args);
}
initialize(hitBox) {
super.initialize();
this.initMembers();
this._hitBox = hitBox;
this.bitmap = this.createBitmap();
this.update();
}
initMembers() {
this.anchor.x = 0;
this.anchor.y = 0;
}
createBitmap() {
const width = this._hitBox.width() * $gameMap.tileWidth();
const height = this._hitBox.height() * $gameMap.tileHeight();
const bitmap = new Bitmap(width, height);
bitmap.fillRect(0, 0, width, height, this._hitBox.hitBoxColor);
return bitmap;
}
hitBox() {
return this._hitBox;
}
checkHitBox(hitBox) {
return this._hitBox === hitBox;
}
update() {
super.update();
this.updatePosition();
this.updateVisibility();
}
updatePosition() {
this.x = this._hitBox.screenX();
this.y = this._hitBox.screenY();
this.z = this._hitBox.screenZ();
}
updateVisibility() {
this.visible = this._hitBox.enabled;
}
};
// ts/ARPG_Core/Spriteset_Map.ts
var _Spriteset_Map_Mixin3 = class extends Spriteset_Map {
initialize() {
_Spriteset_Map_Mixin3._initialize.call(this);
this._hitBoxSprites = /* @__PURE__ */ new Set();
}
update() {
_Spriteset_Map_Mixin3._update.call(this);
if ($gameMap.isStopped()) {
this._tilemap.stopAnimation();
} else {
this._tilemap.resumeAnimation();
}
this.updateBossHpGauge();
this.updateHitBoxSprites();
}
updateHitBoxSprites() {
if (
ARPG_CorePluginParams.HitBoxSetting.VisibleHitAreaSwitchId > 0 &&
$gameSwitches.value(
ARPG_CorePluginParams.HitBoxSetting.VisibleHitAreaSwitchId
)
) {
const hitBoxs = $gameMap.allHitBoxs();
const hasSpriteHitBoxs = /* @__PURE__ */ new Set();
for (const sprite of this._hitBoxSprites) {
hasSpriteHitBoxs.add(sprite.hitBox());
}
for (const hitBox of hitBoxs) {
if (!hasSpriteHitBoxs.has(hitBox)) this.createHitBoxSprite(hitBox);
}
for (const hitBox of hasSpriteHitBoxs) {
if (!hitBoxs.has(hitBox)) this.deleteHitBoxSprite(hitBox);
}
} else {
for (const sprite of this._hitBoxSprites) {
this.deleteHitBoxSprite(sprite.hitBox());
}
}
}
createHitBoxSprite(hitBox) {
const sprite = new Sprite_HitBox(hitBox);
this._hitBoxSprites.add(sprite);
this._tilemap.addChild(sprite);
}
deleteHitBoxSprite(hitBox) {
const sprite = this.findTargetHitBoxSprite(hitBox);
if (!sprite) return;
this._hitBoxSprites.delete(sprite);
this._tilemap.removeChild(sprite);
}
findTargetHitBoxSprite(target) {
return [...this._hitBoxSprites].find((sprite) =>
sprite.checkHitBox(target)
);
}
updatePosition() {
const screen = $gameScreen;
const scale = screen.zoomScale();
this._baseSprite.scale.x = scale;
this._baseSprite.scale.y = scale;
this._baseSprite.x = Math.round(-screen.zoomX() * (scale - 1));
this._baseSprite.y = Math.round(-screen.zoomY() * (scale - 1));
this._baseSprite.x += Math.round(screen.shake());
}
// TODO: 本当に必要か要検討
destroy(options) {}
createLowerLayer() {
_Spriteset_Map_Mixin3._createLowerLayer.call(this);
this.createBossHpGauge();
}
createBossHpGauge() {
this._bossHpGauge = new Sprite_BossHpGauge();
this._bossHpGauge.anchor.y = 0.5;
this._bossHpGauge.hide();
this.addChild(this._bossHpGauge);
this._bossHpGaugeLabel = new Sprite_Label(
64,
Math.floor($gameSystem.mainFontSize() * 1.5)
);
this._bossHpGaugeLabel.anchor.x = 1;
this._bossHpGaugeLabel.x = this._bossHpGauge.x;
this._bossHpGaugeLabel.anchor.y = 0.5;
this._bossHpGaugeLabel.y =
this._bossHpGauge.y + this._bossHpGauge.bitmapHeight() / 2;
this._bossHpGaugeLabel.hide();
this._bossHpGaugeLabel.text =
ARPG_CorePluginParams.EnemyHpGaugeSetting.BossEnemyHpGaugeLabel;
this.addChild(this._bossHpGaugeLabel);
}
setupBossHpGauge(battler, hpGaugeColor1, hpGaugeColor2) {
this._bossHpGauge.setup(battler.battler(), "hp");
this._bossHpGauge.setColorConfig({ hpGaugeColor1, hpGaugeColor2 });
this._bossHpGauge.show();
this._bossHpGaugeLabel.show();
}
updateBossHpGauge() {
const enemy = $gameTemp.arpgGlobalTempData().bossHpGaugeTargetEnemy;
if (enemy && enemy.isCharacterHpGaugeVisibled()) {
this._bossHpGauge.show();
this._bossHpGaugeLabel.show();
} else {
this._bossHpGauge.hide();
this._bossHpGaugeLabel.hide();
}
}
};
var Spriteset_Map_Mixin3 = _Spriteset_Map_Mixin3;
Spriteset_Map_Mixin3._initialize = Spriteset_Map.prototype.initialize;
Spriteset_Map_Mixin3._update = Spriteset_Map.prototype.update;
Spriteset_Map_Mixin3._createLowerLayer =
Spriteset_Map.prototype.createLowerLayer;
Spriteset_Map_Mixin3._findTargetSprite =
Spriteset_Map.prototype.findTargetSprite;
mixin(Spriteset_Map, Spriteset_Map_Mixin3);
// ts/ARPG_Core/Sprite_MapEventGauge.ts
var Sprite_MapEventGauge = class extends Sprite_GaugeCustom {
initMembers() {
super.initMembers();
this.inner = new Point();
this.inner.x -= 24;
this.inner.y -= 64;
}
bitmapWidth() {
return 48;
}
bitmapHeight() {
return 8;
}
gaugeHeight() {
return 22;
}
gaugeX() {
return 0;
}
redraw() {
this.bitmap.clear();
const currentValue = this.currentValue();
if (!isNaN(currentValue)) {
this.drawGauge();
}
}
};
// ts/ARPG_Core/Sprite_Character.ts
var _Sprite_Character_initMembers = Sprite_Character.prototype.initMembers;
Sprite_Character.prototype.initMembers = function () {
_Sprite_Character_initMembers.call(this);
this._innerChildren = [];
};
var _Sprite_Character_update = Sprite_Character.prototype.update;
Sprite_Character.prototype.update = function () {
_Sprite_Character_update.call(this);
this.updateHpGauge();
this.updateInnerChildren();
};
Sprite_Character.prototype.updateHpGauge = function () {
if (this._character.isNeedCharacterHpGauge()) {
if (!this._hpGauge) {
this.createHpGauge();
}
this._hpGauge.visible = this._character.isCharacterHpGaugeVisibled();
}
};
Sprite_Character.prototype.createHpGauge = function () {
this._hpGauge = new Sprite_MapEventGauge();
const hpGaugeColor1 = this._character.hpGaugeColor1();
const hpGaugeColor2 = this._character.hpGaugeColor2();
this._hpGauge.setColorConfig({ hpGaugeColor1, hpGaugeColor2 });
this.addInnerChild(this._hpGauge);
this._hpGauge.setup(this._character.battler().battler(), "hp");
};
Sprite_Character.prototype.addInnerChild = function (child) {
this._innerChildren.push(child);
const tilemap = SceneManager._scene._spriteset._tilemap;
tilemap.addChild(child);
tilemap._sortChildren();
};
Sprite_Character.prototype.removeInnerChild = function (child) {
this._innerChildren = this._innerChildren.filter((cld) => cld !== child);
const tilemap = SceneManager._scene._spriteset._tilemap;
tilemap.removeChild(child);
};
Sprite_Character.prototype.updateInnerChildren = function () {
for (const child of this._innerChildren) {
if (!child.inner) continue;
child.x = this.x + child.inner.x;
child.y = this.y + child.inner.y;
if (child.innerVisible == null) {
} else {
child.visible = child.innerVisible;
}
}
};
// ts/ARPG_Core/Scene_Map.ts
if (!Scene_Map.prototype.hasOwnProperty("isAutosaveEnabled")) {
Scene_Map.prototype.isAutosaveEnabled = function () {
return Scene_Base.prototype.isAutosaveEnabled.call(this);
};
}
var _Scene_Map_Mixin3 = class extends Scene_Map {
initialize() {
_Scene_Map_Mixin3._initialize.call(this);
this._setupBossHpGaugeCompleted = false;
}
start() {
_Scene_Map_Mixin3._start.call(this);
$gameMap.startSceneIndication(this);
}
update() {
_Scene_Map_Mixin3._update.call(this);
if (!this._setupBossHpGaugeCompleted) {
const battler = $gameTemp.arpgGlobalTempData().bossHpGaugeTargetEnemy;
if (battler) {
this._spriteset.setupBossHpGauge(
battler,
ARPG_CorePluginParams.EnemyHpGaugeSetting.BossEnemyHpGaugeColor1,
ARPG_CorePluginParams.EnemyHpGaugeSetting.BossEnemyHpGaugeColor2
);
this._setupBossHpGaugeCompleted = true;
}
}
}
terminate() {
Scene_Message.prototype.terminate.call(this);
if (!SceneManager.isNextScene(Scene_Battle)) {
this._spriteset.update();
this._mapNameWindow.hide();
this.hideMenuButton();
SceneManager.snapForBackground();
}
$gameScreen.clearZoom();
$gameMap.terminateSceneIndication(this);
}
createSpriteset() {
if (!this._spriteset) {
this._spriteset = new Spriteset_Map();
this.addChild(this._spriteset);
this._spriteset.update();
}
}
createSkillNameWindowCallback(window2) {
this.addWindow(window2);
}
deleteSkillNameWindowCallback(window2) {
this._windowLayer.removeChild(window2);
}
checkGameover() {
if (!$gameMap.isEnabledARPGMode()) {
_Scene_Map_Mixin3._checkGameover.call(this);
}
}
isMenuEnabled() {
const result = _Scene_Map_Mixin3._isMenuEnabled.call(this);
if (!result) return false;
if ($gameMap.isEnabledARPGMode()) {
if ($gamePlayer.battler().isChanting()) return false;
}
return true;
}
updateMain() {
$gameTemp.arpgGlobalTempData().controlCharacter.update();
if (!$gameMap.isStopped()) {
_Scene_Map_Mixin3._updateMain.call(this);
}
}
isAutosaveEnabled() {
const result = _Scene_Map_Mixin3._isAutosaveEnabled.call(this);
if (!result) return false;
if ($gameMap.isEnabledARPGMode()) return false;
return true;
}
};
var Scene_Map_Mixin3 = _Scene_Map_Mixin3;
Scene_Map_Mixin3._initialize = Scene_Map.prototype.initialize;
Scene_Map_Mixin3._start = Scene_Map.prototype.start;
Scene_Map_Mixin3._update = Scene_Map.prototype.update;
Scene_Map_Mixin3._checkGameover = Scene_Map.prototype.checkGameover;
Scene_Map_Mixin3._isMenuEnabled = Scene_Map.prototype.isMenuEnabled;
Scene_Map_Mixin3._updateMain = Scene_Map.prototype.updateMain;
Scene_Map_Mixin3._isAutosaveEnabled = Scene_Map.prototype.isAutosaveEnabled;
mixin(Scene_Map, Scene_Map_Mixin3);
// ts/ARPG_Core/Tilemap.ts
var _Tilemap_Mixin = class extends Tilemap {
initialize() {
_Tilemap_Mixin._initialize.call(this);
this._stoppedAnimation = false;
}
update() {
if (!this._stoppedAnimation) {
this.animationCount++;
this.animationFrame = Math.floor(this.animationCount / 30);
}
for (const child of this.children) {
if (child.update) {
child.update();
}
}
}
stopAnimation() {
this._stoppedAnimation = true;
}
resumeAnimation() {
this._stoppedAnimation = false;
}
};
var Tilemap_Mixin = _Tilemap_Mixin;
Tilemap_Mixin._initialize = Tilemap.prototype.initialize;
Tilemap_Mixin._update = Tilemap.prototype.update;
mixin(Tilemap, Tilemap_Mixin);
// ts/ARPG_Core/Game_System.ts
var _Game_System_Mixin = class extends Game_System {
isSaveEnabled() {
const result = _Game_System_Mixin._isSaveEnabled.call(this);
if (!result) return false;
if ($gameMap.isEnabledARPGMode()) return false;
return true;
}
};
var Game_System_Mixin = _Game_System_Mixin;
Game_System_Mixin._isSaveEnabled = Game_System.prototype.isSaveEnabled;
mixin(Game_System, Game_System_Mixin);
// ts/ARPG_Core/CharacterMover.ts
var import_DotMoveSystem2 = __require("DotMoveSystem");
var _CharacterMover_Mixin = class extends import_DotMoveSystem2.CharacterMover {
continuousMoveProcess() {
if (this._character.isDisableMove()) {
this._character.cancelAcceleration();
this._character._moving = false;
this.cancelMove();
} else {
_CharacterMover_Mixin._continuousMoveProcess.call(this);
}
}
dotMoveByDeg(deg, dpf = this._character.distancePerFrame()) {
if (this._character.isDisableMove()) {
this._character.cancelAcceleration();
this._character._moving = false;
this.cancelMove();
} else {
_CharacterMover_Mixin._dotMoveByDeg.call(this, deg, dpf);
}
}
};
var CharacterMover_Mixin = _CharacterMover_Mixin;
CharacterMover_Mixin._continuousMoveProcess =
import_DotMoveSystem2.CharacterMover.prototype.continuousMoveProcess;
CharacterMover_Mixin._dotMoveByDeg =
import_DotMoveSystem2.CharacterMover.prototype.dotMoveByDeg;
mixin(import_DotMoveSystem2.CharacterMover, CharacterMover_Mixin);
// ts/ARPG_Core/CharacterCollisionChecker.ts
var import_DotMoveSystem3 = __require("DotMoveSystem");
var _CharacterCollisionChecker_Mixin = class extends import_DotMoveSystem3.CharacterCollisionChecker {
checkPassMass(ix, iy, d) {
if (!$gameMap.isValid(ix, iy)) {
if (this._character.isNoCheckMapValid()) {
return true;
} else {
return false;
}
}
return _CharacterCollisionChecker_Mixin._checkPassMass.call(
this,
ix,
iy,
d
);
}
};
var CharacterCollisionChecker_Mixin = _CharacterCollisionChecker_Mixin;
CharacterCollisionChecker_Mixin._checkPassMass =
import_DotMoveSystem3.CharacterCollisionChecker.prototype.checkPassMass;
mixin(
import_DotMoveSystem3.CharacterCollisionChecker,
CharacterCollisionChecker_Mixin
);
// ts/ARPG_Core/Main.ts
simpleExport("ARPG_Core/ARPG_Actor/ARPG_Actor", ARPG_Actor);
simpleExport(
"ARPG_Core/ARPG_BattleManager/ARPG_BattleManager",
ARPG_BattleManager
);
simpleExport("ARPG_Core/ARPG_Battler/ARPG_Battler", ARPG_Battler);
simpleExport(
"ARPG_Core/ARPG_BattlerParameters/ARPG_BattlerParameters",
ARPG_BattlerParameters
);
simpleExport(
"ARPG_Core/ARPG_CharacterTempData/ARPG_CharacterTempData",
ARPG_CharacterTempData
);
simpleExport(
"ARPG_Core/ARPG_CorePluginParams/ARPG_CorePluginParams",
ARPG_CorePluginParams
);
simpleExport("ARPG_Core/ARPG_Effect/ARPG_Effect", ARPG_Effect);
simpleExport("ARPG_Core/ARPG_SkillObject/ARPG_SkillObject", ARPG_SkillObject);
simpleExport("ARPG_Core/ARPG_Enemy/ARPG_Enemy", ARPG_Enemy);
simpleExport("ARPG_Core/ARPG_Skill/ARPG_Skill", ARPG_Skill);
simpleExport("ARPG_Core/ARPG_Utils/ARPG_Utils", ARPG_Utils);
simpleExport(
"ARPG_Core/ARPG_CustomManager/ARPG_CustomManager",
ARPG_CustomManager
);
simpleExport("ARPG_Core/HitBox/HitBox", HitBox);
simpleExport("ARPG_Core/HitChecker/HitChecker", HitChecker);
simpleExport(
"ARPG_Core/KnockbackProcessor/KnockbackProcessor",
KnockbackProcessor
);
simpleExport("ARPG_Core/LevelUpProcessor/LevelUpProcessor", LevelUpProcessor);
simpleExport("ARPG_Core/PlayerBehavior/PlayerBehavior", PlayerBehavior);
simpleExport(
"ARPG_Core/MessageWindowController/MessageWindowController",
MessageWindowController
);
simpleExport(
"ARPG_Core/Sprite_BossHpGauge/Sprite_BossHpGauge",
Sprite_BossHpGauge
);
simpleExport("ARPG_Core/Sprite_HitBox/Sprite_HitBox", Sprite_HitBox);
simpleExport(
"ARPG_Core/Sprite_MapEventGauge/Sprite_MapEventGauge",
Sprite_MapEventGauge
);
simpleExport("ARPG_Core/Sprite_Label/Sprite_Label", Sprite_Label);
simpleExport("CommonLibrary/ChainComponent/ChainComponent", ChainComponent);
simpleExport(
"CommonLibrary/CommonEventComponent/CommonEventComponent",
CommonEventComponent
);
simpleExport("CommonLibrary/Component/Component", Component);
simpleExport(
"CommonLibrary/ComponentRunner/ComponentRunner",
ComponentRunner
);
simpleExport("CommonLibrary/Degree/Degree", Degree);
simpleExport("CommonLibrary/HttpRequest/HttpRequest", HttpRequest);
simpleExport("CommonLibrary/HttpResponse/HttpResponse", HttpResponse);
simpleExport("CommonLibrary/MapLoader/MapLoader", MapLoader);
simpleExport("CommonLibrary/mixin/mixin", mixin);
simpleExport(
"CommonLibrary/PluginParamsParser/PluginParamsParser",
PluginParamsParser
);
simpleExport("CommonLibrary/Processor/Processor", Processor);
simpleExport("CommonLibrary/TimerComponent/TimerComponent", TimerComponent);
window.ARPG_BattlerParameters = ARPG_BattlerParameters;
})();
require = __tmp__require;