アクション戦闘システム – QABS.js

タイトル
Action Battle System for QMovement
作者名
ヘルプ
============================================================================
## About
============================================================================
A collider based action battle system for QMovement.NoteThis is not
your simple rpg maker action battle system. Using this plugin you can
create more advance like action games.

For a demo visit the steamwork shop or Github repo
- http://steamcommunity.com/sharedfiles/filedetails/?id=952886994
- https://github.com/quxios/QMV-ABS-Demo

_Plugin files in the repo are always kept up to date_
============================================================================
## Is this for you?
============================================================================
First, this is a very complex action battle system. If you're looking for
something that you can spend less than an hour to set up then this plugin
is not for you.

To make full use of this plugin you need to know how to properly use and
setup QMovement. If you don't know what that plugin is or what colliders
are then again, this plugin is not for you.

There are a lot of actions for skill sequences so you can create some pretty
crazy skills. Learning how to use the actions may take awhile since there
are a lot of actions, and maybe more to come.

Enemies have a very basic AI. If you want to create more AI styles, you
will need to know how to JS and create a plugin / extend this plugin.
============================================================================
## Skill Keys
============================================================================
Default Skill keys
----------------------------------------------------------------------------
For the player to be able to use a skill from a hotkey, you will first need
to create a skill key in the plugin parameter `Default Skills`.

![Skill Keys](https://quxios.github.io/imgs/qabs/skillKeys.png)

When creating a skill key you have 4 parameters:

- #### Keyboard Input:
The keyboard input that will trigger this skill, set this to `mouse1` for
left click, and `mouse2` for right click.
- #### Gamepad Input:
The gamepad input that will trigger this skill.
- #### Rebind:
If this is true, the skill that's assigned to this skill key can be
reassigned.
- #### Skill Id:
The skill that this skill key will use when triggered.

_Note_for input values those are the button values; `ok`, `cancel`, ect. Or
if you're using an input plugin, use their value. For example in QInput you can
use the `#A` for the a key or `#tab` for tab, ect.

_Note_that rebind doesn't do much as this doesn't have a rebinding feature.
But the ground work is there so it can easily be created for an addon.

_Note_that the `Skill Key Number` is the number next to the skill key you created.
`Skill Key Number` will be referenced later.

![Skill Keys](https://quxios.github.io/imgs/qabs/skillKeysNumber.png)

----------------------------------------------------------------------------
Class Skill keys
----------------------------------------------------------------------------
You can change the players skill keys based on their class by adding the notetag:
~~~
<skillKeys>
[SKILL KEY NUMBER]: [SKILL ID] [REBIND?]
</skillKeys>
~~~
- #### SKILL KEY NUMBER:
The skill key that you want to change
- #### SKILL ID:
The skill to assign to this skill key number
- #### REBIND?:
Set to true or false if this can be reassigned

If the skill key that you are trying to change has its `Rebind` value set to false,
nothing will happen since it can't be reassigned.

_Important!_make sure the skill key you are trying to set is created in the
plugin parameters `Default Skills`. If it's not, the game will have an error.

Example:
~~~
<skillKeys>
1: 2
3: 15
4: 16
</skillKeys>
~~~
Class Skill keys will replace the default skill keys. So if you set up skill
keys 1 through 9 in the parameters and a class changes the skills for skill
keys 1, 3, 4. The over all skill keys will be, 1, 3, 4 from the class and
the rest are from the default values.

----------------------------------------------------------------------------
Weapon Skill keys
----------------------------------------------------------------------------
Weapons can also change the skill keys. For example you might want to change
the main attack to use a range skill if the player has a bow equipped! To do
this you use a similar tag as the class, but in the weapon
~~~
<skillKeys>
[SKILL KEY NUMBER]: [SKILL ID]
</skillKeys>
~~~
- #### SKILL KEY NUMBER:
The skill key that you want to change
- #### SKILL ID:
The skill to assign to this skill key number

_Important!_make sure the skill key you are trying to set is created in the
plugin parameters `Default Skills`. If it's not, the game will have an error.

Example:
~~~
<skillKeys>
1: 3
</skillKeys>
~~~
Weapon skill keys take top priority, so they will replace both class keys
and the default keys! This example will replace skill key 1 with the skill
id 3

----------------------------------------------------------------------------
Override Skill keys
----------------------------------------------------------------------------
You can manually override a skill key with a plugin command. Override skill keys
take priority over weapon, class and default skill keys.

Plugin command:
~~~
qabs override SKILLKEYNUMBER SKILLID
~~~
- #### SKILLKEYNUMBER:
The skill key that you want to change
- #### SKILLID:
The skill to assign to this skill key number. Set to -1 if you want to
remove this override

_Important!_make sure the skill key you are trying to set is created in the
plugin parameters `Default Skills`. If it's not, the game will have an error.

_Note_that the player still needs to know the skill to be able to use it.
Assigning it won't let him use it if he doesn't know it.

Example:
~~~
qabs override 1 3
~~~
Will override skill key 1 and assign the skill with id 3. To remove this
override later on use the plugin command:
~~~
qabs override 1 -1
~~~

============================================================================
## Skills
============================================================================
Skill Settings
----------------------------------------------------------------------------
Each skill should have a skill settings tag. This tag can change the settings
for the skills cooldown, through, and other effects. The tag is:
~~~
<absSettings>
[SETTINGS]: [VALUE]
</absSettings>
~~~
Here's a list of all the settings:
~~~
collider: [SHAPE], [WIDTH], [HEIGHT]
collides: [STRING]
cooldown: [NUMBER]
infront: [TRUE or FALSE]
rotate: [TRUE or FALSE]
through: [0, 1, 2 or 3]
throughTerrain: [LIST OF TERRAINS IT CAN GO THROUGH]
groundtarget: [NUMBER]
selecttarget: [NUMBER]
~~~
- #### collider:
Set this to the collider this skill will use. See QMovement help for details
on colliders.
Default: The users collider
Format is: `shape, width, height`
- #### collides:
Set this to which collider type to check for against skill hit. If you
want to use a custom collider, use the `<colliders></colliders>` tag
Default: collision
- #### cooldown:
Set to the number of frames until you can use this skill again.
Default: 0
- #### infront:
Set to true or false. When true, the collider will appear in front of the user.
When false the collider will be centered on the user.
Default: false
- #### rotate:
Set to true or false. When true, the collider will rotate based on the users
direction when skill is starting. Default: false
- #### through:
Set to 0, 1, 2, or 3. Default: 0
- 0: Goes through events and tiles
- 1: Goes through tiles but stops when it hits an event
- 2: Goes through events but stops when it hits a tile
- 3: Stops when it hits an event or tile
- #### throughTerrain:
Set to a list of tile terrains it can go through, separate each terrain with a comma
- #### groundtarget:
Set to the max distance, in pixels, for the ground target. If value is 0 ground
targeting will not be used.
Default: 0
- #### selecttarget:
Set to the max distance, in pixels, for the select target. If value is 0 select
targeting will not be used.
Default: 0
----------------------------------------------------------------------------
Skill Sequence
----------------------------------------------------------------------------
When a skill is used, it's sequence will run. You will need to configure
a sequence to tell the skill what it should do or it won't do anything.

This can be done with the notetag:
~~~
<absSequence>
[ACTION]
</absSequence>
~~~
There are a bunch of actions. Each action needs to be on a different line.

Here's a list of all the actions:
~~~
user casting [TRUE or FALSE]
user lock
user unlock
user speed [INC or DEC] [VALUE]
user move [FORWARD or BACKWARD] [DIST] [WAIT? TRUE or FALSE]
user moveHere [WAIT? TRUE or FALSE]
user jump [FORWARD or BACKWARD] [DIST] [WAIT? TRUE or FALSE]
user jumpHere [WAIT? TRUE or FALSE]
user teleport
user setDirection [DIR]
user directionFix [TRUE or FALSE]
user pose [POSE NAME] [WAIT? TRUE or FALSE]
user forceSkill [SKILL ID] [ANGLE OFFSET IN DEGREES]
user animation [ANIMATION ID]
user qaudio [NAME] [QAUDIO OPTIONS]
store
move [FORWARD or BACKWARD] [DIST] [DURATION] [WAIT? TRUE or FALSE]
moveToStored [DURATION] [WAIT? TRUE or FALSE]
wave [FORWARD or BACKWARD] [AMPLITUDE] [HARM] [DIST] [DURATION] [WAIT? TRUE or FALSE]
waveToStored [AMPLITUDE] [HARM] [DURATION] [WAIT? TRUE or FALSE]
trigger
adjustAim
wait [DURATION]
picture [FILE NAME] [ROTATABLE? TRUE or FALSE] [BASE DIRECTION]
trail [FILE NAME] [ROTATABLE? TRUE or FALSE] [BASE DIRECTION]
collider [SHOW or HIDE]
animation [ANIMATION ID]
se [NAME] [VOLUME] [PITCH] [PAN]
qaudio [NAME] [QAUDIO OPTIONS]
forceSkill [SKILL ID] [ANGLE OFFSET IN DEGREES]
globalLock
globalUnlock
~~~
- #### user casting [TRUE or FALSE]
Set the user casting state. If the user is casting, this skill can be
ended early if they get hit with a skill that has `user cancel` in it's
`absOnDamage`

- #### user lock
Locks the users movement. The user can't move or use any actions until
`user unlock` is called.
`user unlock` is called automatically after every skill ends to ensure
the user can move again if the skill ended.

- #### user unlock
Unlocks the users movement. The user is unlocked if it was locked and can
move and use actions again.
`user unlock` is called automatically after every skill ends to ensure
the user can move again if the skill ended.

- #### user speed [INC or DEC] [VALUE]
Changes the users move speed.
INC or DEC:
- Set to `inc` to increase movespeed
- Set to `dec` to decrease move speed
VALUE: Set to a number to inc or dec the movespeed by.

- #### user move [FORWARD or BACKWARD] [DIST] [WAIT? TRUE or FALSE]
The user will move forward or backwards by X distance.
FORWARD or BACKWARD:
- Set to `forward` to move towards the direction the user is facing
- Set to `backward` to move towards the opposite direction the user is facing
DIST: Set to the distance the user should move, in pixels
WAIT: Set to `true` or `false`. If true the sequencer will wait until the move
is complete before going to the next action

- #### user moveHere [WAIT? TRUE or FALSE]
The user will move to the skills current location
WAIT: Set to `true` or `false`. If true the sequencer will wait until the move
is complete before going to the next action

- #### user jump [FORWARD or BACKWARD] [DIST] [WAIT? TRUE or FALSE]
The user will jump forward or backwards by X distance.
FORWARD or BACKWARD:
- Set to `forward` to jump towards the direction the user is facing
- Set to `backward` to jump towards the opposite direction the user is facing
DIST: Set to the distance the user should jump, in pixels
WAIT: Set to `true` or `false`. If true the sequencer will wait until the jump
is complete before going to the next action

- #### user jumpHere [WAIT? TRUE or FALSE]
The user will jump to the skills current location
WAIT: Set to `true` or `false`. If true the sequencer will wait until the jump
is complete before going to the next action

- #### user teleport
The user will be placed at the skills current location. Similar to an
event transfer command.

- #### user setDirection [DIR]
Change the users direction
DIR: Set to: 2, 4, 6 or 8. For diagonals; 1, 3, 7, or 9

- #### user directionFix [TRUE or FALSE]
Sets the users direction fix.
TRUE or FALSE: Set to `true` or `false`. When true the users direction can't change

- #### user pose [POSE NAME] [WAIT? TRUE or FALSE]
_Requires QSprite plugin_
If the user is a QSprite, it will play the pose
POSE NAME: The pose to play
WAIT: Set to `true` or `false`. If true the sequencer will wait until the pose
is done playing before going to the next action

- #### user forceSkill [SKILL ID] [ANGLE OFFSET IN DEGREES]
Forces the user to use a skill.
SKILL ID: The ID of the skill to use
ANGLE OFFSET: Lets you offset the angle, in degrees, that this skill be used
towards. This is optional and can be left out.
- Default: 0

- #### user animation [ANIMATION ID]
Plays an animation on the user
ANIMATION ID: The ID of the animation to play

- #### user qaudio [NAME] [QAUDIO OPTIONS]
_Requires QAudio plugin_
Binds a QAudio to the user
NAME: The name of the audio file to use
QAUDIO OPTIONS: any of the QAudio options besides; xX, yY, bindToCHARAID.
View QAudio help for more details

- #### store
Stores the skills current location. This location value is used when
the actions `moveToStored` or 'waveToStored' are used.

- #### move [FORWARD or BACKWARD] [DIST] [DURATION] [WAIT? TRUE or FALSE]
Moves the skill forward or backwards by X dist in Y frames
FORWARD or BACKWARD:
- Set to `forward` to move towards the direction the skill is currently moving
- Set to `backward` to move towards the opposite direction the skill is current moving
DIST: The distance you want the skill to move, in pixels.
DURATION: How long should it take to complete this move, in frames.
WAIT: Set to `true` or `false`. If true the sequencer will wait until the skill
is done moving before going to the next action

- #### moveToStored [DURATION] [WAIT? TRUE or FALSE]
Moves the skill to the stored position
DURATION: How long should it take to complete this move, in frames.
WAIT: Set to `true` or `false`. If true the sequencer will wait until the skill
is done moving before going to the next action

- #### wave [FORWARD or BACKWARD] [AMPLITUDE] [HARM] [DIST] [DURATION] [WAIT? TRUE or FALSE]

- #### waveToStored [AMPLITUDE] [HARM] [DURATION] [WAIT? TRUE or FALSE]

- #### trigger
Activates the skill at it's current location

- #### adjustAim
Recalculates the direction the skill should move. This is only works
when the skill is used from an enemy.

- #### wait [DURATION]
The sequencer will wait before moving to the next action
DURATION: How long should the wait last, in frames

- #### picture [FILE NAME] [ROTATABLE? TRUE or FALSE] [BASE DIRECTION]
Bind a picture to the skill
FILE NAME: The file name of the picture. Should be located in the
Pictures folder. For an animated picture it should have the format:
- %[COLS-SPEED]
- COLS: The number of slices in the picture
- SPEED: The time to wait between frames
ROTATABLE: Set to `true` or `false`. If true the picture will rotate based
on the direction the skill is moving
BASE DIRECTION: The direction the skill is facing by default. The directions
should be 2, 4, 6, or 8

- #### trail [FILE NAME] [ROTATABLE? TRUE or FALSE] [BASE DIRECTION]
Binds a picture that stretches from the user to the skills position
FILE NAME: The file name of the picture. Should be located in the
Pictures folder.
ROTATABLE: Set to `true` or `false`. If true the picture will rotate based
on the direction the skill is moving
BASE DIRECTION: The direction the skill is facing by default. The directions
should be 2, 4, 6, or 8

- #### collider [SHOW or HIDE]
Shows the skills collider
SHOW or HIDE:
- Set to `show` to show the skills collider
- Set to `hide` to hide the skills collider

- #### animation [ANIMATION ID]
Play an animation at the skills current location
ANIMATION ID: The ID of the animation to play

- #### se [NAME] [VOLUME] [PITCH] [PAN]
Play an se
NAME: The name of the SE to play
VOLUME: The volume of the SE, default: 90
PITCH: The pitch of the SE, default: 100
PAN: The pan of the SE, default: 0

- #### qaudio [NAME] [QAUDIO OPTIONS]
Play a qAudio at the skills location
NAME: The name of the audio file
QAUDIO OPTIONS: Visit the QAudio help for information. The options
are the same from the plugin commands. x, y, bindTo options will not work.

- #### forceSkill [SKILL ID] [ANGLE OFFSET]
Force a skill at the skills current location
SKILL ID: The ID of the skill to use
ANGLE OFFSET: Lets you offset the angle, in degrees, this skill be used towards.
This is optional and can be left out.

- #### globalLock
Locks all characters movement

- #### globalUnlock
Unlocks all characters movement

----------------------------------------------------------------------------
Skill On Damage
----------------------------------------------------------------------------
Whenever a skill hits a target you can run another sequence. This is done
by using the notetag:
~~~
<absOnDamage>
[ACTION]
</absOnDamage>
~~~
There are a few actions you can add here:
~~~
target move [TOWARDS or AWAY or INTO] [DIST]
target jump [TOWARDS or AWAY or INTO] [DIST]
target pose [POSE]
target cancel
target qaudio [NAME] [QAUDIO OPTIONS]
user forceSkill [SKILL ID] [ANGLE OFFSET IN DEGREES]
animationTarget [0 or 1]
~~~
- #### target move [TOWARDS or AWAY or INTO] [DIST]
The target will move X distance.
TOWARDS or AWAY or INTO:
- Set to `towards` to move towards the user of the skill
- Set to `away` to move away from the user of the skill
- Set to `into` to move towards the skill center
DIST: Set to the distance the target should move, in pixels

- #### target jump [TOWARDS or AWAY or INTO] [DIST]
The target will jump X distance.
TOWARDS or AWAY or INTO:
- Set to `towards` to jump towards the user of the skill
- Set to `away` to jump away from the user of the skill
- Set to `into` to jump towards the skill position
DIST: Set to the distance the target should jump, in pixels

- #### target pose [POSE]
_Requires QSprite plugin_
If the target is a QSprite, it will play the pose
POSE NAME: The pose to play

- #### target cancel
If the target is `casting`, it will cancel the skill

- #### target qaudio [NAME] [QAUDIO OPTIONS]
_Requires QAudio plugin_
Binds a QAudio to the target
NAME: The name of the audio file to use
QAUDIO OPTIONS: any of the QAudio options besides; xX, yY, bindToCHARAID.
View QAudio help for more details

- #### user forceSkill [SKILL ID] [ANGLE OFFSET IN DEGREES]
Forces the user to use a skill.
SKILL ID: The ID of the skill to use
ANGLE OFFSET: Lets you offset the angle, in degrees, that this skill be used
towards. This is optional and can be left out.
- Default: 0

- #### animationTarget [0 or 1]
Sets where to play the skill animation
0 or 1:
- When 0, the animation will play at the current location.
Animation will only play once if the skill hit multiple targets
- When 1, the animation will play on the target
Animation will play on all targets it hits

============================================================================
## Enemies
============================================================================
Event
----------------------------------------------------------------------------
To mark an event as an enemy, add the notetag to the event
~~~
<enemy:X>
~~~
Where X is the ID of the enemy in the database.

----------------------------------------------------------------------------
Enemy Database
----------------------------------------------------------------------------
#### To set the enemies respawn time
~~~
<respawn:X>
~~~
- X: How long until it respawns, in frames.

#### To change the team of the enemy
~~~
<team:X>
~~~
Set X to the team number
- 0: Neutral
- 1: Player team
- 2: Enemy team
- 3+ can also be used

_Note_teams don't do much because there is no team based AI

#### To set an Enemies AI type
~~~
<AIType:TYPE>
~~~
- TYPE: The AI type, set this to `none` to disable AI.

_Note_There's only 1 type of AI, so for now that AI is only to disable AI

#### To set it's AI range
~~~
<range:X>
~~~
- X: The range in pixels

#### To disable damage popups on this enemy
~~~
<noPopup>
~~~

#### To add an offset to the popup's y use:
~~~
<popupOY:Y>
~~~
- Y: The y offset in pixels, can be negative

#### To keep the event around after it dies
~~~
<dontErase>
~~~

#### To run some JS when the enemy dies
~~~
<onDeath>
javascript code
</onDeath>
~~~

#### To auto gain the enemies loot
~~~
<autoLoot>
~~~

============================================================================
## Disabling QABS
============================================================================
You can disable the QABS or disable certain events with a plugin command.

#### To disable the QABS for everything use the plugin command
~~~
qabs disable
~~~

#### To re-enable use the plugin command:
~~~
qabs enable
~~~

#### To disable certain event(s) use the plugin command
~~~
qabs disable [LIST OF CHARAIDS TO DISABLE]
~~~
- CHARAID: The character identifier.
For events: EVENTID, eEVENTID, eventEVENTID or this for the event that
called this (replace EVENTID with a number)

Where each CHARAID is separated with a space. CHARAID can only be for events.

#### Example:
~~~
qabs disable event1 e2 4
~~~
Will disable events 1, 2 and 4. Used different types of CHARAIDs as an example
but you can use whichever one you like

#### To re-enable event(s) use the plugin command
~~~
qabs enable [LIST OF CHARAIDS TO DISABLE]
~~~

_Note_that disabling ABS doesn't remove it from the event, it just "pauses"
it until it's re-enabled.

============================================================================
## States
============================================================================
To have a state affect the characters move speed use:
~~~
<moveSpeed:X>
~~~
Set X to the value to modify the move speed by. Can be negative.

To disable a characters actions, use the following notetag. When disabled
the character can't use any skills until the state is removed.
~~~
<stun>

~~~
============================================================================
## Popups
============================================================================
All of the popups are powered with the QPopup plugin. If you want to change
any styles of the popups you can edit their presets in that plugins parameters
or using the plugin commands from the QPopup plugin.

The following are the qPopup presets this ABS uses:
- QABS-LEVEL
- QABS-EXP
- QABS-ITEM
- QABS-MISSED
- QABS-DMG
- QABS-DMG-CRIT
- QABS-HEAL
- QABS-HEAL-CRIT
- QABS-MP
- QABS-MP-CRIT

============================================================================
## Showcase
============================================================================
This section is for user created stuff. If you created a video, game, tutorial,
or an addon for QABS feel free to send me a link and I'll showcase it here!

============================================================================
## Links
============================================================================
Formated Help:

https://quxios.github.io/plugins/QABS

RPGMakerWebs:

http://forums.rpgmakerweb.com/index.php?threads/qplugins.73023/

Terms of use:

https://github.com/quxios/QMV-Master-Demo/blob/master/readme.md

Like my plugins? Support me on Patreon!

https://www.patreon.com/quxios

パラメータ
version 1.7.0
site https://quxios.github.io/
updateurl https://quxios.github.io/data/pluginsMin.json

repo https://github.com/quxios/QABS

requires QMovement

video TODO

param Attack Settings

param Quick Target
parent Attack Settings
desc Ground target skills will instantly cast at mouse location
type Boolean
default false

param Lock when Targeting
parent Attack Settings
desc Player can't move when using Ground / Select targeting skills
type Boolean
on Can't Move
off Can Move
default false

param Aim with Mouse
parent Attack Settings
desc All actions will be used towards your mouse location
type Boolean
on Towards mouse
off Towards player direction
default false

param Aim with Analog
parent Attack Settings
desc All actions will be used towards right analog stick when using a
gamepad.
type Boolean
on Towards right analog
off Towards player direction
default false

param Move Resistance Rate Stat
parent Attack Settings
desc Which stat to use for Move Resistance Rate
Default: xparam(1) This is Evasion
default xparam(1)

param Loot Settings

param Loot Decay
parent Loot Settings
desc How long until the loot disappears, in frames.
type Number
min 1
default 600

param AoE Loot
parent Loot Settings
desc Collect nearby loot or pick up one at a time.
type Boolean
default true

param Loot Touch Trigger
parent Loot Settings
desc Pick up loot on player touch
type Boolean
default false

param Gold Icon
parent Loot Settings
desc Icon Index to display for gold loot
Default: 314
default 314

param Level Animation
parent Loot Settings
desc The animation ID to play on level up.
Default: 52
type Animation
default 52

param Enemy AI

param AI Default Sight Range
parent Enemy AI
desc Default range for enemies to go after player, in pixels
Default: 240
type Number
min 1
default 240

param AI Action Wait
parent Enemy AI
desc How many frames to wait before running AI for next skill
Default: 30
min 1
default 30

param AI Uses QSight
parent Enemy AI
desc Set to true or false if AI should use QSight
May decrease performance
type Boolean
default true

param AI uses QPathfind
parent Enemy AI
desc Set to true or false if AI should use QPathfind
May decrease performance
type Boolean
default true

param Default Skills
type Struct<SkillKey>[]
default []

tags QM-Addon, ABS, Battle
ライセンス表記
Terms of use:
https://github.com/quxios/QMV-Master-Demo/blob/master/readme.md

紹介ページ https://github.com/quxios/QMV-ABS-Demo/blob/master/js/plugins/QABS.js