アクターが敵から奪取できるようにするプラグイン – YEP_StealSnatch.js

タイトル
Allows your actors to be able to steal and snatchitems from enemies.
作者名
ヘルプ
============================================================================
Introduction
============================================================================

Stealing is a commonly used mechanic found in many traditional RPG's. This
plugin enables you to replicate that mechanic and add more depth upon it.

Enemies can have multiple items to steal in addition to their default drops.
When an actor goes to steal from an enemy, the actor has a percent change
for the steal attempt to be successful. If successful, the actor grabs a
random item from the stealable items pool and the party gains the said item.

In addition to stealing, there is a new mechanic called 'Snatch'. While
stealing allows your actors to grab random items from the enemy, snatching
lets your actors target the item they want to steal and focus only on that
item alone.

Another feature for this plugin is that stealing a piece of equipment can
now 'debuff' the enemy. If an actor steals a sword that gives 10 ATK, the
enemy will lose 10 ATK. This feature can be turned off. Also new (and
optional) is the ability to steal the enemy's drop items. Enemies won't
always necessarily drop their items after being defeated, but stealing from
them directly will allow your players to secure those items. Once an item is
stolen, it will not drop again at the end of battle.

============================================================================
Notetags
============================================================================

Use the following notetags to set up your steal effects.

Enemy Notetags:
<Steal Item x: y%>
<Steal Weapon x: y%>
<Steal Armor x: y%>
<Steal Gold x: y%>
Gives the enemy the respect item to be stolen. x is the item's ID while
y% is the rate at which the item can be stolen from.

<Steal Potion: y%>
<Steal Short Sword: y%>
<Steal Round Shield: y%>
If you decide to use names instead of item ID's, you can use the above
notetag format. If you have multiple items with the same name, priority
will be given to the item with the highest item ID in the order of items,
weapons, and then armors.

<Steal Resist: +x%>
<Steal Resist: -x%>
This is the enemy's inherent resistance against stealing.

Skill and Item Notetags:
<Steal>
<Steal: +x%>
<Steal: -x%>
This enables the skill/item to have steal properties. Actions with steal
properties will have a chance of stealing an item. This notetag applies to
all item types. If you use the notetag versions with +x% or -x%, the steal
rate is increased/decreased by x%.

<Steal Item>
<Steal Item: +x%>
<Steal Item: -x%>
This enables the skill/item to have steal properties. Actions with steal
properties will have a chance of stealing an item. This notetag adds item
types to the stealable item pool. If you use the notetag versions with +x%
or -x%, the steal rate is increased/decreased for item types by x%.

<Steal Weapon>
<Steal Weapon: +x%>
<Steal Weapon: -x%>
This enables the skill/item to have steal properties. Actions with steal
properties will have a chance of stealing an item. This notetag adds
weapon types to the stealable item pool. If you use the notetag versions
with +x% or -x%, the steal rate is increased/decreased weapon item types
by x%.

<Steal Armor>
<Steal Armor: +x%>
<Steal Armor: -x%>
This enables the skill/item to have steal properties. Actions with steal
properties will have a chance of stealing an item. This notetag adds armor
types to the stealable item pool. If you use the notetag versions with +x%
or -x%, the steal rate is increased/decreased for armor types by x%.

<Steal Gold>
<Steal Gold: +x%>
<Steal Gold: -x%>
This enables the skill/item to have steal properties. Actions with steal
properties will have a chance of stealing an item. This notetag adds gold
types to the stealable item pool. If you use the notetag versions with +x%
or -x%, the steal rate is increased/decreased for gold by x%.

<Snatch>
<Snatch: +x%>
<Snatch: -x%>
This enables the skill/item to have snatch properties. Actions with snatch
properties are able to select the exact item they wish to steal. This
notetag applies to all item types. If you use the notetag versions with
+x% or -x%, the snatch rate is increased/decreased by x%.
Note: Snatching only works on skills/items that target.

<Snatch Item>
<Snatch Item: +x%>
<Snatch Item: -x%>
This enables the skill/item to have snatch properties. Actions with snatch
properties are able to select the exact item they wish to steal. This
notetag adds items to the pool. If you use the notetag versions with +x%
or -x%, the snatch rate is increased/decreased by x% for items.
Note: Snatching only works on skills/items that target.

<Snatch Weapon>
<Snatch Weapon: +x%>
<Snatch Weapon: -x%>
This enables the skill/item to have snatch properties. Actions with snatch
properties are able to select the exact item they wish to steal. This
notetag adds weapons to the pool. If you use the notetag versions with +x%
or -x%, the snatch rate is increased/decreased by x% for weapons.
Note: Snatching only works on skills/items that target.

<Snatch Armor>
<Snatch Armor: +x%>
<Snatch Armor: -x%>
This enables the skill/item to have snatch properties. Actions with snatch
properties are able to select the exact item they wish to steal. This
notetag adds armors to the pool. If you use the notetag versions with +x%
or -x%, the snatch rate is increased/decreased by x% for armors.
Note: Snatching only works on skills/items that target.

<Snatch Gold>
<Snatch Gold: +x%>
<Snatch Gold: -x%>
This enables the skill/item to have snatch properties. Actions with snatch
properties are able to select the exact item they wish to steal. This
notetag adds gold targets to the pool. If you use the notetag versions
with +x% or -x%, the snatch rate is increased/decreased by x% for gold.
Note: Snatching only works on skills/items that target.

Item, Weapon, and Armor Notetags:
<Enable Automatic Debuff>
<Disable Automatic Debuff>
This let's you override the 'Automatic Effect' settings in the parameters
for this individual item. Enabling it will cause any weapons and armors to
debuff the enemy's parameters relative to the piece of equipment stolen.
Disabling it will make no such thing occur. Automatic Debuffing is only
applied to weapons and armors.

<Steal Sound Name: filename>
If you wish to give an item a unique sound effect when stolen, use this
notetag to accomplish that. Exclude file extensions from the 'filename'.

<Steal Sound Volume: x>
To change the volume for this item's sound effect when it is stolen, use
this notetag and replace x with the volume level desired.

<Steal Sound Pitch: x>
To change the pitch for this item's sound effect when it is stolen, use
this notetag and replace x with the pitch desired.

<Steal Sound Pan: x>
To change the pan for this item's sound effect when it is stolen, use this
notetag and replace x with the pan desired.

Actor, Class, Weapon, Armor, and State Notetags:
<Steal Rate: +x%>
<Steal Rate: -x%>
<Steal Type Rate: +x%>
<Steal Type Rate: -x%>
Increase/decrease the steal rate for the user by x%. If you use the 'Type'
notetag, replace 'Type' with 'Item', 'Weapon', 'Armor', or 'Gold' to apply
individual steal rate bonuses for just those types.

============================================================================
Lunatic Mode - Custom Steal Effects
============================================================================

For those with JavaScript experience and would like to create their own
custom steal rates for individual skills and/or items, you can use this
notetag to accomplish that:

Skill and Item Notetags:
<Custom Steal Rate>
rate += user.hp / user.mhp;
rate += user.level0.01;
</Custom Steal Rate>
The 'rate' variable is already predefined with the default calculations.
You can either add onto it or overwrite it. The 'rate' variable is then
returned after this for rate calculation. This formula is applied for both
steal and snatching.

<Custom Steal Success Effect>
if (item) {
user.gainHp(item.price);
}
</Custom Steal Success Effect>
This allows for custom effects to occur after successfully stealing any
type of item. The 'item' variable refers to the stolen item.

Item, Weapon, and Armor Notetags:
<After Steal Effect>
target.atk -= 10;
user.addBuff(3, 5);
</After Steal Effect>
When this item, weapon, or piece of armor gets stolen, this piece of code
will run affecting the target enemy it was stolen from. 'item' will refer
to the item that was stolen. 'target' will refer to the target enemy the
actor stole from. 'user' will refer to the actor stealing the item.

============================================================================
Changelog
============================================================================

Version 1.07:
- Fixed a bug with the <Steal Rate: +/-x%> notetags not working.

Version 1.06:
- Added <Custom Steal Success Effect> Lunatic Mode notetag for skills and
item usage.

Version 1.05a:
- Updated for RPG Maker MV version 1.1.0.
- Updated Imported name to YEP_StealSnatch.

Version 1.04:
- Fixed a bug with <Steal Rate: +x%> notetag that caused the game to freeze.

Version 1.03:
- Added 'Steal Wait' plugin parameter to add a wait time for those using the
Battle Engine Core.

Version 1.02:
- Message Core's WordWrap will now apply to snatch item descriptions.

Version 1.01:
- 'Success Text' plugin parameter now has %4 for you to add in an icon for
the item you just stole. This requires the most recent Battle Engine Core if
you are using it.
- If enemies have 0 gold, they will not be automatically included in the
list of stealable items.

Version 1.00:
- Finished Plugin!
パラメータ
param ---General---
default
param Bonus Formula
desc The custom formula used to determine stealing bonus rates.
default (user.luk / (512 + user.luk)) / 3

param ---Auto Setup---
default
param Gold Drop
desc Automatically include enemy gold drop into stealable items?
NO - false YES - true
default true

param Gold Rate
desc If automatically include gold drop, what is the steal rate?
0.00 - 0% 1.00 - 100%
default 0.50

param Gold Removal
desc If using automatic gold, remove the rewards from the
enemy gold when defeated? NO - false YES - true
default true

param Drop Items
desc Automatically include drop items into stealable items?
NO - false YES - true
default true

param Drop Rates
desc If drop items are included, adjust the rate by this much.
0.00 - 0% 1.00 - 100%
default 0.80

param Drop Removal
desc If using automatic drops, remove the rewards from the
enemy drops when defeated? NO - false YES - true
default true

param Automatic Debuff
desc If a weapon or armor gets stolen, automatically debuff the
enemy by the equipment's stats? NO - false YES - true
default true

param ---Battle Log---
default
param Center Text
desc If you're using Battle Engine Core, center text?
NO - false YES - true
default true

param Fail Text
desc Text shown if failed to steal an item.
%1 - Actor %2 - Target
default %1 couldn't steal from %2.

param Success Text
desc Text shown if successfully stole an item.
%1 - Actor %2 - Target %3 - Item %4 - Icon
default %1 steals %4%3 from %2!

param Steal Empty
desc Text shown if target has nothing left to steal.
%1 - Target
default %1 has nothing left to steal.

param Gold Format
desc How the gold format will look when it's stolen.
%1 - Amount %2 - Gold
default %1 %2

param Steal Wait
desc If using the Battle Engine Core, this is how many frames
the message will wait.
default 60

param ---Snatch Window---
default
param Gold Help Text
desc Text used for gold in the Help Window.
%1 - Amount %2 - Gold
default There's %1 %2 for you to steal!

param Success Font Size
desc Font size used for the success rate.
Default: 28
default 20

param Decimal Places
desc The amount of decimal places to display for rate.
default 0

param Already Stolen
desc Text used for already stolen items.
default Stolen

param ---Sound Effects---
default
param Failure Sound
desc Sound effect played when failed to steal.
If you don't want to play a sound effect, leave this empty.
default Buzzer2

param Failure Volume
desc Volume for this sound effect.
default 80

param Failure Pitch
desc Pitch for this sound effect.
default 120

param Failure Pan
desc Pan for this sound effect.
default 0

param Empty Sound
desc Sound effect played when there is nothing to steal.
If you don't want to play a sound effect, leave this empty.
default Evasion1

param Empty Volume
desc Volume for this sound effect.
default 80

param Empty Pitch
desc Pitch for this sound effect.
default 120

param Empty Pan
desc Pan for this sound effect.
default 0

param Item Sound
desc Sound effect played when stolen an item.
If you don't want to play a sound effect, leave this empty.
default Item1

param Item Volume
desc Volume for this sound effect.
default 80

param Item Pitch
desc Pitch for this sound effect.
default 120

param Item Pan
desc Pan for this sound effect.
default 0

param Weapon Sound
desc Sound effect played when stolen a weapon.
If you don't want to play a sound effect, leave this empty.
default Equip1

param Weapon Volume
desc Volume for this sound effect.
default 80

param Weapon Pitch
desc Pitch for this sound effect.
default 120

param Weapon Pan
desc Pan for this sound effect.
default 0

param Armor Sound
desc Sound effect played when stolen an armor.
If you don't want to play a sound effect, leave this empty.
default Equip2

param Armor Volume
desc Volume for this sound effect.
default 80

param Armor Pitch
desc Pitch for this sound effect.
default 150

param Armor Pan
desc Pan for this sound effect.
default 0

param Gold Sound
desc Sound effect played when stolen gold.
If you don't want to play a sound effect, leave this empty.
default Shop2

param Gold Volume
desc Volume for this sound effect.
default 80

param Gold Pitch
desc Pitch for this sound effect.
default 120

param Gold Pan
desc Pan for this sound effect.
default 0

ライセンス表記

紹介ページ https://github.com/suppayami/yami-engine-delta/blob/master/demo/js/plugins/YEP_StealSnatch.js