Mime Skill
Version: 1.0
Author: modern algebra
Date: April 22, 2010
Version History
- <Version 1.0> 04.22.2010 - Original Release
Description
This script allows you to make mime skills, meaning that the person using such a skill will perform the same action as the ally who went before him/her.
Features
- Allows you to make a skill where the user will perform the same action as the ally before him/her did
- Will consume only the MP set for the mime skill, even if the mimed action is itself another skill
- Will consume an extra instance of an item if the previous action was item use. Will do nothing if out of that item
Instructions
Paste the script in its own slot in the Script Editor, below Materials and above Main
Script
#==============================================================================
# Mime Skill
# Version: 1.0
# Author: modern algebra (rmrk.net)
# Date: April 22, 2010
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
#
# This script allows you to make mime skills, meaning that the person using
# such a skill will perform the same action as the ally who went before
# him/her.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Instructions:
#
# Paste this script below Materials and above Main in the Script Editor.
#
# To set up a mime skill, just put the code: \mime in the notebox. It is
# recommended that you set the scope to None, since the mime skill will
# use the same targetting mechanism as the action it is miming.
#==============================================================================
#==============================================================================
# ** RPG::Skill
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new method - mime?
#==============================================================================
class RPG::Skill
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Mime Skill?
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def mime?
return self.note[/\\MIME/i] != nil
end
end
#==============================================================================
# ** Game_Battler
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# attr_accessor - km_override_mp_cost
# attr_writer - action
# aliased method - calc_mp_cost
#==============================================================================
class Game_Battler
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_accessor :km_override_mp_cost
attr_writer :action
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Calc MP Cost
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modlba_ken_calcmp_7ux1 calc_mp_cost
def calc_mp_cost (*args)
return @km_override_mp_cost unless @km_override_mp_cost.nil?
return modlba_ken_calcmp_7ux1 (*args) # Run Original Method
end
end
#==============================================================================
# ** Game Unit
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new attr_accessor :km_last_action
#==============================================================================
class Game_Unit
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_accessor :km_last_action
end
#==============================================================================
# ** Scene_Battle
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - execute_action
#==============================================================================
class Scene_Battle
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Execute Battle Actions
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias ma_kntn_mimic_exact_6yh1 execute_action
def execute_action (*args)
# If using a mime skill
if @active_battler.action.skill? && @active_battler.action.skill.mime?
last_action = @active_battler.action.friends_unit.km_last_action.dup
if last_action.nil? || (last_action.item? && !$game_party.has_item? (last_action.item))
# Do nothing
@active_battler.action.clear
@active_battler.action.kind = 0
@active_battler.action.basic = 3
else
# Do last action
@active_battler.km_override_mp_cost = @active_battler.calc_mp_cost (@active_battler.action.skill)
@active_battler.action = last_action
@active_battler.action.battler = @active_battler
end
else
# Set this action to the last action of this unit
@active_battler.action.friends_unit.km_last_action = @active_battler.action.dup
end
ma_kntn_mimic_exact_6yh1 (*args) # Run Original Method
if @active_battler.km_override_mp_cost
@active_battler.mp -= @active_battler.km_override_mp_cost unless @active_battler.action.skill?
@active_battler.km_override_mp_cost = nil
end
end
end
Credit
Thanks
Support
Please post in this topic at RMRK if you have any issues with the script.
Known Compatibility Issues
It will not work with some exotic battle systems, particularly ones that do not use a similar Scene_Battle script or execute actions quite differently.