Difference between revisions of "Steal & Snatch (YEP)"

From Yanfly.moe Wiki
Jump to navigation Jump to search
Line 216: Line 216:
 
   actor stole from. 'user' will refer to the actor stealing the item.
 
   actor stole from. 'user' will refer to the actor stealing the item.
 
</nowiki>
 
</nowiki>
 +
 +
{{Tips & Tricks MV}}
 +
 +
* [[Thievery (MV Plugin Tips & Tricks)|Thievery]]
  
 
== Changelog ==
 
== Changelog ==

Revision as of 15:06, 8 July 2019

Welcome to the wiki! This is where you can find resources from Yanfly.moe, Ækashics.moe,
VisuStella, Caz Wolf, Fallen Angel Olivia, Atelier Irina, and other affiliated content creators.



Download

System

This is a plugin created for RPG Maker MV.

For help on how to install plugins, click here.

For help on how to update plugins, click here.

Got errors with your RPG Maker MV plugin? Click here.


Masterarbeit Writer

Yanfly Engine Plugins

This plugin is a part of the Yanfly Engine Plugins library.


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

NotetagsMV.png

RPG Maker MV's editor is unable to allow for custom traits/properties that a game dev may wish to associate with a database object, event, map, etc. Notetags are used to work around such limitations by allowing the game dev to tag certain traits/properties using specific Notetags declared by the related plugin.

Here is a list of Notetag(s) that you may use.

---

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

JavaScript.png

For advanced users who have an understanding of JavaScript, you can use the following features added by the plugin to further enhance what you can do with your game project.

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.level * 0.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.

Tips & Tricks

The following Tips & Tricks effects use this plugin:

Changelog

Version 1.10:
- Bypass the isDevToolsOpen() error when bad code is inserted into a script
call or custom Lunatic Mode code segment due to updating to MV 1.6.1.

Version 1.09:
- Updated for RPG Maker MV version 1.5.0.

Version 1.08:
- Lunatic Mode fail safes added.

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!