<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Save-Point - RPGMaker XP (RGSS) Engine]]></title>
		<link>https://www.save-point.org/</link>
		<description><![CDATA[Save-Point - https://www.save-point.org]]></description>
		<pubDate>Thu, 11 Jun 2026 23:24:24 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Ring Menu Advanced]]></title>
			<link>https://www.save-point.org/thread-13496.html</link>
			<pubDate>Thu, 04 Jun 2026 22:37:09 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13496.html</guid>
			<description><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Ring Menu Advanced</span><br />
Based upon the <br />
XRXS Ring Menu Implementation<br />
by Kazuki (2007)</span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.1</span></div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This is another Ring Menu based upon the classic. But with new options:<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><ul class="mycode_list"><li>All editable options now in a single configuration page<br />
</li>
<li>Customize the speed, size and options in the ring menu<br />
</li>
<li>Able to add and/or remove menu options by configuration<br />
</li>
<li>Flexible menu system that can begin with even 0(zero) options shown<br />
</li>
<li>Able to execute/switch-to custom scenes or common events<br />
</li>
<li>Able to use either the original or Dubealex-styled status window<br />
</li>
<li>Able to enable/disable a gold window, either XRXS or Dubealex-styled<br />
</li>
<li>Able to enable/disable a Dubealex-styled location window<br />
</li>
<li>Set the font, windowskin and opacity levels of most any window<br />
 <br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">BONUS:</span>  The Targeted Return Patch included<br />
</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Screenshots</span></span><br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> Yep... this time</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div style="text-align: center;" class="mycode_align"><img src="https://i.imgur.com/4WN6QAW.jpg" loading="lazy"  alt="[Image: 4WN6QAW.jpg]" class="mycode_img" /><br />
<span style="font-size: small;" class="mycode_size">A typical Ring Menu for those familiar with Dubealex's version.<br />
It includes the Location and Gold window he designed and his version<br />
of the Party Select window replacing the Window_MenuStatus code.<br />
Note that Hilda is not present.</span><br />
 <br />
<img src="https://i.imgur.com/oAgYECw.jpg" loading="lazy"  alt="[Image: oAgYECw.jpg]" class="mycode_img" /><br />
<span style="font-size: small;" class="mycode_size">Oops? There are only five menu items?  Indeed.<br />
Hilda is still not around, and the menu is set to only show SKILLS when she's around.<br />
The Location window has been removed, and the default Gold Menu is in use.<br />
The Save Menu option is disabled.<br />
There is a faint haze of Golden Ember (or Gomashio Yellow) across the screen, Kazuki's color choice and not mine.<br />
And this time the Party Select window is Kazuki's</span></div>
</div>
		</div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<br />
<a href="https://app.box.com/s/0ywqdknznk3bhbjwd1jieynrstg444gf" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Here it is!  <span style="color: #E82A1F;" class="mycode_color">A Box.Com</span> Link</span></a><br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Completely within the demo.  The header page is dedicated to the instructions while compact instructions are in the configuration page.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">FAQ</span></span><br />
<br />
Believe it or not, I had this working with game windows larger than 640x480.<br />
I also added a nice and sporty little NOT/CANCEL icon.  Took like... 2 minutes to sprite?<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
This will overwrite Scene_Menu. And it uses its own Window_MenuStatus code.  So add-ons that affect the window in the main menu showing the party won't function.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
My thanks to Kazuki who created the original version of the Ring Menu.  Thanks to Dubealex for the Location and Gold windows, and the center forced Menu command display. And thanks to Ouga Zaitou who provided some bitmap content for Kazuki's original work.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Though Kazuki ended support for the Ring Menu nearly two decades ago, actively placing this within an actual 'abandoned' script list, I ask for due credit for myself, Kazuki and Ouga Zaitou.]]></description>
			<content:encoded><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Ring Menu Advanced</span><br />
Based upon the <br />
XRXS Ring Menu Implementation<br />
by Kazuki (2007)</span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.1</span></div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This is another Ring Menu based upon the classic. But with new options:<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><ul class="mycode_list"><li>All editable options now in a single configuration page<br />
</li>
<li>Customize the speed, size and options in the ring menu<br />
</li>
<li>Able to add and/or remove menu options by configuration<br />
</li>
<li>Flexible menu system that can begin with even 0(zero) options shown<br />
</li>
<li>Able to execute/switch-to custom scenes or common events<br />
</li>
<li>Able to use either the original or Dubealex-styled status window<br />
</li>
<li>Able to enable/disable a gold window, either XRXS or Dubealex-styled<br />
</li>
<li>Able to enable/disable a Dubealex-styled location window<br />
</li>
<li>Set the font, windowskin and opacity levels of most any window<br />
 <br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">BONUS:</span>  The Targeted Return Patch included<br />
</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Screenshots</span></span><br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> Yep... this time</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div style="text-align: center;" class="mycode_align"><img src="https://i.imgur.com/4WN6QAW.jpg" loading="lazy"  alt="[Image: 4WN6QAW.jpg]" class="mycode_img" /><br />
<span style="font-size: small;" class="mycode_size">A typical Ring Menu for those familiar with Dubealex's version.<br />
It includes the Location and Gold window he designed and his version<br />
of the Party Select window replacing the Window_MenuStatus code.<br />
Note that Hilda is not present.</span><br />
 <br />
<img src="https://i.imgur.com/oAgYECw.jpg" loading="lazy"  alt="[Image: oAgYECw.jpg]" class="mycode_img" /><br />
<span style="font-size: small;" class="mycode_size">Oops? There are only five menu items?  Indeed.<br />
Hilda is still not around, and the menu is set to only show SKILLS when she's around.<br />
The Location window has been removed, and the default Gold Menu is in use.<br />
The Save Menu option is disabled.<br />
There is a faint haze of Golden Ember (or Gomashio Yellow) across the screen, Kazuki's color choice and not mine.<br />
And this time the Party Select window is Kazuki's</span></div>
</div>
		</div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<br />
<a href="https://app.box.com/s/0ywqdknznk3bhbjwd1jieynrstg444gf" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Here it is!  <span style="color: #E82A1F;" class="mycode_color">A Box.Com</span> Link</span></a><br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Completely within the demo.  The header page is dedicated to the instructions while compact instructions are in the configuration page.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">FAQ</span></span><br />
<br />
Believe it or not, I had this working with game windows larger than 640x480.<br />
I also added a nice and sporty little NOT/CANCEL icon.  Took like... 2 minutes to sprite?<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
This will overwrite Scene_Menu. And it uses its own Window_MenuStatus code.  So add-ons that affect the window in the main menu showing the party won't function.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
My thanks to Kazuki who created the original version of the Ring Menu.  Thanks to Dubealex for the Location and Gold windows, and the center forced Menu command display. And thanks to Ouga Zaitou who provided some bitmap content for Kazuki's original work.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Though Kazuki ended support for the Ring Menu nearly two decades ago, actively placing this within an actual 'abandoned' script list, I ask for due credit for myself, Kazuki and Ouga Zaitou.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[XRXS_MP 6. Ring Menu Implementation]]></title>
			<link>https://www.save-point.org/thread-13495.html</link>
			<pubDate>Tue, 02 Jun 2026 21:09:26 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13495.html</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">XRXS_MP 6. Ring Menu Implementation</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version:  1.2<br />
by Kazuki</span><br />
<span style="font-size: xx-small;" class="mycode_size">&copy; 2007<br />
Version 1.0 Release &copy; 2005</span><br />
<span style="font-style: italic;" class="mycode_i">Yes, the creator's name is Kazuki, NOT XRXS</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
For years, I've seen the XRXS Ring Menu with additions by Dubealex and others.  But never a pure version of the original version. So I decided to use my lycanthropic werewolf hunting skills to track down a pure version untouched by western editors.<br />
<br />
And here it is.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><ul class="mycode_list"><li>Its a RING menu<br />
</li>
<li>Contains a compact actor menu when selecting choices like Equip or Skill<br />
</li>
<li>Able to customize the icons<br />
</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<br />
I am providing BOTH the original version 1.2 (circa 2007 which Kazuki stated was abandoned) and an English version thanks to an hour's worth of wolfish translation.<br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> Japanese Original Version</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># ▼▲▼ XRXS_MP 6. リングメニュー導入 ver.1.2 ▼▲▼<br />
# by 和希<br />
<br />
#==============================================================================<br />
# □ カスタマイズポイント<br />
#==============================================================================<br />
class Window_RingMenu &lt; Window_Base<br />
  STARTUP_FRAMES =  20 # 初期アニメーションのフレーム数<br />
  MOVING_FRAMES  = &nbsp;&nbsp;5 # リングを回した時のフレーム数<br />
  RING_R       &nbsp;&nbsp;=  64 # リングの半径<br />
  SE_STARTUP  = "056-Right02" # メニューを開いたときに鳴らすSE<br />
  ICON_ITEM &nbsp;&nbsp;= RPG::Cache.icon("034-Item03") &nbsp;&nbsp;# 「 アイテム 」メニューのアイコン<br />
  ICON_SKILL  = RPG::Cache.icon("044-Skill01")  # 「　スキル　」メニューのアイコン<br />
  ICON_EQUIP  = RPG::Cache.icon("001-Weapon01") # 「　 装備 　」メニューのアイコン<br />
  ICON_STATUS = RPG::Cache.icon("050-Skill07")  # 「ステータス」メニューのアイコン<br />
  ICON_SAVE &nbsp;&nbsp;= RPG::Cache.icon("038-Item07") &nbsp;&nbsp;# 「　セーブ　」メニューのアイコン<br />
  ICON_EXIT &nbsp;&nbsp;= RPG::Cache.icon("046-Skill03")  # 「　 終了 　」メニューのアイコン<br />
  ICON_DISABLE= RPG::Cache.icon("")           &nbsp;&nbsp;# 使用禁止項目に付くアイコン<br />
  BACKGROUND_COLOR = Color.new(0xcc,0x99,0x33,0x3f)<br />
end<br />
###############################################################################<br />
# リングメニュー導入スクリプト Ver. 1.2<br />
#               &nbsp;&nbsp;writen by 和希<br />
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
# ▽導入<br />
# &nbsp;&nbsp;０．先に XRXL 2. ビットマップ/アイコン描写 を入れて置いてください。<br />
# &nbsp;&nbsp;１．このスクリプトをMainセクションの上に作った新しいセクションにコピーする<br />
# &nbsp;&nbsp;２．Window_RingMenuの上部にある７つの RPG::Cache.icon("") の "" の中に<br />
#     &nbsp;&nbsp;右の説明に書いてあるコマンド用のアイコン名を書く。<br />
#     &nbsp;&nbsp;(一番下の使用禁止は選べないメニューに重ねるアイコンです。<br />
#        こんなのがいいかも→ φ )<br />
# &nbsp;&nbsp;３．アイコン設定のすぐ下にある SE_STARTUP = "" の "" の中にメニューを<br />
#     &nbsp;&nbsp;開いたときに鳴らしたいのSEの名前を書く。<br />
# ▽スクリプト触れる人へ<br />
# &nbsp;&nbsp;とりあえず動く物を目標に作ったものなので(志低いｗ)、座標の調整などが不完全です。<br />
# &nbsp;&nbsp;より正確にアクターの画面座標を取得する処理を追加したり、アクター一覧の位置を<br />
# &nbsp;&nbsp;変えたり、文字表示などなどを調整するといい感じに仕上がる気がします。<br />
###############################################################################<br />
<br />
#==============================================================================<br />
# ■ Window_RingMenu<br />
#==============================================================================<br />
class Window_RingMenu &lt; Window_Base<br />
  #--------------------------------------------------------------------------<br />
  # ○ クラス定数<br />
  #--------------------------------------------------------------------------<br />
  MODE_START = 1 # スタートアップアニメーション<br />
  MODE_WAIT  = 2 # 待機<br />
  MODE_MOVER = 3 # 時計回り回転アニメーション<br />
  MODE_MOVEL = 4 # 反時計回り回転アニメーション<br />
  #--------------------------------------------------------------------------<br />
  # ○ アクセサ<br />
  #--------------------------------------------------------------------------<br />
  attr_accessor :index<br />
  attr_reader :commands<br />
  #--------------------------------------------------------------------------<br />
  # ● オブジェクト初期化<br />
  #--------------------------------------------------------------------------<br />
  def initialize( center_x, center_y )<br />
    super(-16, -16, 640+32, 480+32)<br />
    self.contents = Bitmap.new(width-32, height-32)<br />
    self.opacity = 0<br />
    self.back_opacity = 0<br />
    s1 = &#36;data_system.words.item<br />
    s2 = &#36;data_system.words.skill<br />
    s3 = &#36;data_system.words.equip<br />
    s4 = "ステータス"<br />
    s5 = "セーブ"<br />
    s6 = "ゲーム終了"<br />
    @commands = [ s1, s2, s3, s4, s5, s6 ]<br />
    @item_max = 6<br />
    @index = 0<br />
    @items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_EXIT ]<br />
    @disabled = [ false, false, false, false, false, false ]<br />
    @cx = center_x<br />
    @cy = center_y<br />
    setup_move_start<br />
    refresh<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● フレーム更新<br />
  #--------------------------------------------------------------------------<br />
  def update<br />
    super<br />
    refresh<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● 画面再描画<br />
  #--------------------------------------------------------------------------<br />
  def refresh<br />
    self.contents.clear<br />
    # 背景描画<br />
    if BACKGROUND_COLOR.alpha &gt; 0<br />
      self.contents.fill_rect(0,0,640,480,BACKGROUND_COLOR)<br />
    end<br />
    # アイコンを描画<br />
    case @mode<br />
    when MODE_START<br />
      refresh_start<br />
    when MODE_WAIT<br />
      refresh_wait<br />
    when MODE_MOVER<br />
      refresh_move(1)<br />
    when MODE_MOVEL<br />
      refresh_move(0)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 画面再描画(初期化時)<br />
  #--------------------------------------------------------------------------<br />
  def refresh_start<br />
    d1 = 2.0 * Math::PI / @item_max<br />
    d2 = 1.0 * Math::PI / STARTUP_FRAMES<br />
    r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      d = d1 * j + d2 * @steps<br />
      x = @cx + ( r * Math.sin( d ) ).to_i<br />
      y = @cy - ( r * Math.cos( d ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
    @steps -= 1<br />
    if @steps &lt; 1<br />
      @mode = MODE_WAIT<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 画面再描画(待機時)<br />
  #--------------------------------------------------------------------------<br />
  def refresh_wait<br />
    d = 2.0 * Math::PI / @item_max<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      x = @cx + ( RING_R * Math.sin( d * j ) ).to_i<br />
      y = @cy - ( RING_R * Math.cos( d * j ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 画面再描画(回転時)<br />
  #  mode : 0=反時計回り 1=時計回り<br />
  #--------------------------------------------------------------------------<br />
  def refresh_move( mode )<br />
    d1 = 2.0 * Math::PI / @item_max<br />
    d2 = d1 / MOVING_FRAMES<br />
    d2 *= -1 if mode != 0<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      d = d1 * j + d2 * @steps<br />
      x = @cx + ( RING_R * Math.sin( d ) ).to_i<br />
      y = @cy - ( RING_R * Math.cos( d ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
    @steps -= 1<br />
    if @steps &lt; 1<br />
      @mode = MODE_WAIT<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● 項目の描画<br />
  #   &nbsp;&nbsp;x : <br />
  #   &nbsp;&nbsp;y : <br />
  #   &nbsp;&nbsp;i : 項目番号<br />
  #--------------------------------------------------------------------------<br />
  def draw_item(x, y, i)<br />
    rect = Rect.new(0, 0, @items[i].width, @items[i].height)<br />
    x -= rect.width/2<br />
    y -= rect.height/2<br />
    if @index == i<br />
      self.contents.blt( x, y, @items[i], rect )<br />
      if @disabled[@index]<br />
        self.contents.blt( x, y, ICON_DISABLE, rect )<br />
      end<br />
    else<br />
      self.contents.blt( x, y, @items[i], rect, 128 )<br />
      if @disabled[@index]<br />
        self.contents.blt( x, y, ICON_DISABLE, rect, 128 )<br />
      end<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● 項目を無効にする<br />
  #   &nbsp;&nbsp;index : 項目番号<br />
  #--------------------------------------------------------------------------<br />
  def disable_item(index)<br />
    @disabled[index] = true<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 初期化アニメーションの準備<br />
  #--------------------------------------------------------------------------<br />
  def setup_move_start<br />
    @mode = MODE_START<br />
    @steps = STARTUP_FRAMES<br />
    if  SE_STARTUP != nil and SE_STARTUP != ""<br />
      Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 回転アニメーションの準備<br />
  #--------------------------------------------------------------------------<br />
  def setup_move_move(mode)<br />
    if mode == MODE_MOVER<br />
      @index -= 1<br />
      @index = @items.size - 1 if @index &lt; 0<br />
    elsif mode == MODE_MOVEL<br />
      @index += 1<br />
      @index = 0 if @index &gt;= @items.size<br />
    else<br />
      return<br />
    end<br />
    @mode = mode<br />
    @steps = MOVING_FRAMES<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ アニメーション中かどうか<br />
  #--------------------------------------------------------------------------<br />
  def animation?<br />
    return @mode != MODE_WAIT<br />
  end<br />
end<br />
#==============================================================================<br />
# ■ Window_MenuStatus<br />
#------------------------------------------------------------------------------<br />
# 　メニュー画面でパーティメンバーのステータスを表示するウィンドウです。<br />
#==============================================================================<br />
<br />
class Window_RingMenuStatus &lt; Window_Selectable<br />
  attr_reader :max_index<br />
  #--------------------------------------------------------------------------<br />
  # ● オブジェクト初期化<br />
  #--------------------------------------------------------------------------<br />
  def initialize<br />
    @max_index = &#36;game_party.actors.size - 1<br />
    h = 32 * (@max_index + 1) + 32<br />
    h = 416 if h &gt; 416<br />
    x = 0<br />
    x = 456 if &#36;game_player.screen_x &lt; 200 + Window_RingMenu::RING_R<br />
    super(x, 64, 184, h)<br />
    self.contents = Bitmap.new(width - 32, &#36;game_party.actors.size * 32)<br />
    refresh<br />
    self.active = false<br />
    self.index = -1<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● リフレッシュ<br />
  #--------------------------------------------------------------------------<br />
  def refresh<br />
    self.contents.clear<br />
    @item_max = &#36;game_party.actors.size<br />
    for i in 0...&#36;game_party.actors.size<br />
      x = 32<br />
      y = 32 * i<br />
      actor = &#36;game_party.actors[i]<br />
      self.contents.draw_facesquare(actor.character_name, actor.character_hue,<br />
                                    4, y + 4 )<br />
      draw_actor_name(actor, x, y)<br />
    end<br />
  end<br />
end<br />
#==============================================================================<br />
# ■ Scene_Menu<br />
#------------------------------------------------------------------------------<br />
# 　メニュー画面の処理を行うクラスです。<br />
#==============================================================================<br />
<br />
class Scene_Menu<br />
  #--------------------------------------------------------------------------<br />
  # ● オブジェクト初期化<br />
  #   &nbsp;&nbsp;menu_index : コマンドのカーソル初期位置<br />
  #--------------------------------------------------------------------------<br />
  def initialize(menu_index = 0)<br />
    @menu_index = menu_index<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● メイン処理<br />
  #--------------------------------------------------------------------------<br />
  def main<br />
    # スプライトセットを作成<br />
    @spriteset = Spriteset_Map.new<br />
    # コマンドウィンドウを作成<br />
    bmp = RPG::Cache.character(&#36;game_party.actors[0].character_name, 0)<br />
    px = &#36;game_player.screen_x<br />
    py = &#36;game_player.screen_y - bmp.rect.height / 4 / 2<br />
    @command_window = Window_RingMenu.new(px,py)<br />
    @command_window.index = @menu_index<br />
    # パーティ人数が 0 人の場合<br />
    if &#36;game_party.actors.size == 0<br />
      # アイテム、スキル、装備、ステータスを無効化<br />
      @command_window.disable_item(0)<br />
      @command_window.disable_item(1)<br />
      @command_window.disable_item(2)<br />
      @command_window.disable_item(3)<br />
    end<br />
    @command_window.z = 100<br />
    # セーブ禁止の場合<br />
    if &#36;game_system.save_disabled<br />
      # セーブを無効にする<br />
      @command_window.disable_item(4)<br />
    end<br />
    # ステータスウィンドウを作成<br />
    @status_window = Window_RingMenuStatus.new<br />
    @status_window.z = 200<br />
    @status_window.visible = false<br />
    # ヘルプウィンドウを作成<br />
    @help_window = Window_Help.new<br />
    @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
    # トランジション実行<br />
    Graphics.transition<br />
    # メインループ<br />
    loop do<br />
      # ゲーム画面を更新<br />
      Graphics.update<br />
      # 入力情報を更新<br />
      Input.update<br />
      # フレーム更新<br />
      update<br />
      # 画面が切り替わったらループを中断<br />
      if &#36;scene != self<br />
        break<br />
      end<br />
    end<br />
    # トランジション準備<br />
    Graphics.freeze<br />
    # スプライトセットを解放<br />
    @spriteset.dispose<br />
    # ウィンドウを解放<br />
    @command_window.dispose<br />
    @status_window.dispose<br />
    @help_window.dispose<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● フレーム更新<br />
  #--------------------------------------------------------------------------<br />
  def update<br />
    # ウィンドウを更新<br />
    @command_window.update<br />
    @status_window.update<br />
    @help_window.update<br />
    # コマンドウィンドウがアクティブの場合: update_command を呼ぶ<br />
    if @command_window.active<br />
      update_command<br />
      return<br />
    end<br />
    # ステータスウィンドウがアクティブの場合: update_status を呼ぶ<br />
    if @status_window.active<br />
      update_status<br />
      return<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● フレーム更新 (コマンドウィンドウがアクティブの場合)<br />
  #--------------------------------------------------------------------------<br />
  def update_command<br />
    # B ボタンが押された場合<br />
    if Input.trigger?(Input::B)<br />
      # キャンセル SE を演奏<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      # マップ画面に切り替え<br />
      &#36;scene = Scene_Map.new<br />
      return<br />
    end<br />
    # C ボタンが押された場合<br />
    if Input.trigger?(Input::C)<br />
      # パーティ人数が 0 人で、セーブ、ゲーム終了以外のコマンドの場合<br />
      if &#36;game_party.actors.size == 0 and @command_window.index &lt; 4<br />
        # ブザー SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      # コマンドウィンドウのカーソル位置で分岐<br />
      case @command_window.index<br />
      when 0  # アイテム<br />
        # 決定  SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # アイテム画面に切り替え<br />
        &#36;scene = Scene_Item.new<br />
      when 1  # スキル<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ステータスウィンドウをアクティブにする<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 2  # 装備<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ステータスウィンドウをアクティブにする<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 3  # ステータス<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ステータスウィンドウをアクティブにする<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 4  # セーブ<br />
        # セーブ禁止の場合<br />
        if &#36;game_system.save_disabled<br />
          # ブザー SE を演奏<br />
          &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
          return<br />
        end<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # セーブ画面に切り替え<br />
        &#36;scene = Scene_Save.new<br />
      when 5  # ゲーム終了<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ゲーム終了画面に切り替え<br />
        &#36;scene = Scene_End.new<br />
      end<br />
      return<br />
    end<br />
    # アニメーション中ならカーソルの処理を行わない<br />
    return if @command_window.animation?<br />
    # ↑or← ボタンが押された場合<br />
    if Input.press?(Input::UP) or  Input.press?(Input::LEFT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)<br />
      @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
      return<br />
    end<br />
    # ↓or→ ボタンが押された場合<br />
    if Input.press?(Input::DOWN) or  Input.press?(Input::RIGHT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @command_window.setup_move_move(Window_RingMenu::MODE_MOVER)<br />
      @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
      return<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● フレーム更新 (ステータスウィンドウがアクティブの場合)<br />
  #--------------------------------------------------------------------------<br />
  def update_status<br />
    # B ボタンが押された場合<br />
    if Input.trigger?(Input::B)<br />
      # キャンセル SE を演奏<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      # コマンドウィンドウをアクティブにする<br />
      @command_window.active = true<br />
      @status_window.active = false<br />
      @status_window.visible = false<br />
      @status_window.index = -1<br />
      return<br />
    end<br />
    # C ボタンが押された場合<br />
    if Input.trigger?(Input::C)<br />
      # コマンドウィンドウのカーソル位置で分岐<br />
      case @command_window.index<br />
      when 1  # スキル<br />
        # このアクターの行動制限が 2 以上の場合<br />
        if &#36;game_party.actors[@status_window.index].restriction &gt;= 2<br />
          # ブザー SE を演奏<br />
          &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
          return<br />
        end<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # スキル画面に切り替え<br />
        &#36;scene = Scene_Skill.new(@status_window.index)<br />
      when 2  # 装備<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # 装備画面に切り替え<br />
        &#36;scene = Scene_Equip.new(@status_window.index)<br />
      when 3  # ステータス<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ステータス画面に切り替え<br />
        &#36;scene = Scene_Status.new(@status_window.index)<br />
      end<br />
      return<br />
    end<br />
  end<br />
end<br />
#==============================================================================<br />
# ◇ 外部ライブラリ<br />
#==============================================================================<br />
class Bitmap<br />
# ▼▲▼ XRXL 1. ライン・図形描写 ▼▲▼<br />
  #--------------------------------------------------------------------------<br />
  # ● ライン描画 by 桜雅 在土<br />
  #--------------------------------------------------------------------------<br />
  def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)<br />
    # 描写距離の計算。大きめに直角時の長さ。<br />
    distance = (start_x - end_x).abs + (start_y - end_y).abs<br />
    # 描写開始<br />
    if end_color == start_color<br />
      for i in 1..distance<br />
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i<br />
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i<br />
        if width == 1<br />
          self.set_pixel(x, y, start_color) <br />
        else<br />
          self.fill_rect(x, y, width, width, start_color) <br />
        end<br />
      end<br />
    else<br />
      for i in 1..distance<br />
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i<br />
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i<br />
        r = start_color.red &nbsp;&nbsp;* (distance-i)/distance + end_color.red &nbsp;&nbsp;* i/distance<br />
        g = start_color.green * (distance-i)/distance + end_color.green * i/distance<br />
        b = start_color.blue  * (distance-i)/distance + end_color.blue  * i/distance<br />
        a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance<br />
        if width == 1<br />
          self.set_pixel(x, y, Color.new(r, g, b, a))<br />
        else<br />
          self.fill_rect(x, y, width, width, Color.new(r, g, b, a)) <br />
        end<br />
      end<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● 多角形の描画(塗りつぶしなし) by 和希<br />
  #    peaks    : 頂点座標の配列 [[x1,y1],[x2,y2],[x3,y3], ... ]<br />
  #    color    : 線の色<br />
  #    width    : 線の幅<br />
  #--------------------------------------------------------------------------<br />
  def draw_polygon(peaks, color, width = 1)<br />
    # 辺(=頂点)の個数分だけ辺を描く<br />
    for i in 0 ... (peaks.size - 1)<br />
      # 頂点同士を線で結ぶ<br />
      draw_line( peaks[i][0], peaks[i][1], peaks[i+1][0], peaks[i+1][1], color, width )<br />
    end<br />
    # 最後の頂点と最初の頂点を結ぶ<br />
    draw_line( peaks[peaks.size - 1][0], peaks[peaks.size - 1][1], peaks[0][0], peaks[0][1], color, width )<br />
  end<br />
# ▼▲▼ XRXL 2. ビットマップ/アイコン描写 ▼▲▼<br />
  #--------------------------------------------------------------------------<br />
  # ● 顔＆枠の描画 by 桜雅 在土<br />
  #   &nbsp;&nbsp;character_name : 描写に利用するキャラクターグラフィック<br />
  #   &nbsp;&nbsp;character_hue  : 描写の色合い<br />
  #   &nbsp;&nbsp;x     &nbsp;&nbsp;: 描画先 X 座標<br />
  #   &nbsp;&nbsp;y     &nbsp;&nbsp;: 描画先 Y 座標<br />
  #--------------------------------------------------------------------------<br />
  def draw_facesquare(character_name, character_hue, x, y, size = 24)<br />
    bitmap = RPG::Cache.character(character_name, character_hue)<br />
    src_rect = Rect.new((bitmap.width/4 - size)/2, 0, size, size)<br />
    self.blt(x, y, bitmap, src_rect)<br />
    self.draw_polygon([[x,y],[x+size,y],[x+size,y+size],[x,y+size]], Color.new(255,255,255,128))<br />
  end<br />
end</code></div></div></div>
		</div>
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> English Translated Version</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># ▼▲▼ XRXS_MP 6. Ring Menu Implementation ver.1.2 ▼▲▼<br />
# By Kazuki<br />
<br />
#==============================================================================<br />
# □ Customization Points<br />
#==============================================================================<br />
class Window_RingMenu &lt; Window_Base<br />
  STARTUP_FRAMES =  20 # Number of frames in the initial animation<br />
  MOVING_FRAMES  = &nbsp;&nbsp;5 # The number of frames when rotating the ring<br />
  RING_R       &nbsp;&nbsp;=  64 # Radius of the ring<br />
  SE_STARTUP  = "056-Right02" # The sound effect played when opening the menu<br />
  ICON_ITEM &nbsp;&nbsp;= RPG::Cache.icon("034-Item03") &nbsp;&nbsp;# Icons in the "Items" Menu<br />
  ICON_SKILL  = RPG::Cache.icon("044-Skill01")  # Icons in the "Skills" Menu<br />
  ICON_EQUIP  = RPG::Cache.icon("001-Weapon01") # "Equipment" Menu Icon<br />
  ICON_STATUS = RPG::Cache.icon("050-Skill07")  # "Status" Menu Icons<br />
  ICON_SAVE &nbsp;&nbsp;= RPG::Cache.icon("038-Item07") &nbsp;&nbsp;# "Save" Menu Icon<br />
  ICON_EXIT &nbsp;&nbsp;= RPG::Cache.icon("046-Skill03")  # "Exit" Menu Icon<br />
  ICON_DISABLE= RPG::Cache.icon("")           &nbsp;&nbsp;# Icons for Prohibited Items<br />
  BACKGROUND_COLOR = Color.new(0xcc,0x99,0x33,0x3f)<br />
end<br />
###############################################################################<br />
# Ring Menu Implementation Script Ver. 1.2<br />
#               &nbsp;&nbsp;writen by Kazuki<br />
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
# ▽ Introduction<br />
# &nbsp;&nbsp;0. Please install "XRXL 2. Bitmap/Icon Rendering" beforehand.<br />
# &nbsp;&nbsp;1. Copy this script into a new section created above the Main section.<br />
# &nbsp;&nbsp;2. Inside the double quotas (`""`) of the sevenRPG::Cache.icon("") entries<br />
#      located at the top of `Window_RingMenu, enter the icon for each command.<br />
#      Follow as they are described in the comments to the right.<br />
#      The "Disabled" icon at the bottom is an icon that overlays atop the<br />
#      menu icons that cannot be selected. Recommended is something like: φ<br />
# &nbsp;&nbsp;3. Inside the "" of the TSE_STARTUP value, place the sound effect that you<br />
#      want to sound when the menu opens<br />
# ▽ For those comfortable working with scripts<br />
# &nbsp;&nbsp;Since I built this with the sole goal of getting something—anything—up and<br />
# &nbsp;&nbsp;running (yeah, I set the bar pretty low!), the coordinate alignment and<br />
# &nbsp;&nbsp;similar details are still incomplete.<br />
# &nbsp;&nbsp;We added a process to obtain the actor's screen coordinates more accurately,<br />
# &nbsp;&nbsp;and the position of the actor list.<br />
# &nbsp;&nbsp;I feel like if you tweak things—such as making changes or adjusting the text<br />
# &nbsp;&nbsp;display—it will turn out really nicely.<br />
###############################################################################<br />
<br />
#==============================================================================<br />
# ■ Window_RingMenu<br />
#==============================================================================<br />
class Window_RingMenu &lt; Window_Base<br />
  #--------------------------------------------------------------------------<br />
  # ○ Class Constants<br />
  #--------------------------------------------------------------------------<br />
  MODE_START = 1 # Startup Animation<br />
  MODE_WAIT  = 2 # Stand By<br />
  MODE_MOVER = 3 # Clockwise Rotation Animation<br />
  MODE_MOVEL = 4 # Counter-clockwise Rotation Animation<br />
  #--------------------------------------------------------------------------<br />
  # ○ Public Instance Variables<br />
  #--------------------------------------------------------------------------<br />
  attr_accessor :index<br />
  attr_reader :commands<br />
  #--------------------------------------------------------------------------<br />
  # ● Object Initialization<br />
  #--------------------------------------------------------------------------<br />
  def initialize( center_x, center_y )<br />
    super(-16, -16, 640+32, 480+32)<br />
    self.contents = Bitmap.new(width-32, height-32)<br />
    self.opacity = 0<br />
    self.back_opacity = 0<br />
    s1 = &#36;data_system.words.item<br />
    s2 = &#36;data_system.words.skill<br />
    s3 = &#36;data_system.words.equip<br />
    s4 = "Status"<br />
    s5 = "Save"<br />
    s6 = "Game Over"<br />
    @commands = [ s1, s2, s3, s4, s5, s6 ]<br />
    @item_max = 6<br />
    @index = 0<br />
    @items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_EXIT ]<br />
    @disabled = [ false, false, false, false, false, false ]<br />
    @cx = center_x<br />
    @cy = center_y<br />
    setup_move_start<br />
    refresh<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Frame Update<br />
  #--------------------------------------------------------------------------<br />
  def update<br />
    super<br />
    refresh<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Refresh<br />
  #--------------------------------------------------------------------------<br />
  def refresh<br />
    self.contents.clear<br />
    # Draw background<br />
    if BACKGROUND_COLOR.alpha &gt; 0<br />
      self.contents.fill_rect(0,0,640,480,BACKGROUND_COLOR)<br />
    end<br />
    # Draw Icon<br />
    case @mode<br />
    when MODE_START<br />
      refresh_start<br />
    when MODE_WAIT<br />
      refresh_wait<br />
    when MODE_MOVER<br />
      refresh_move(1)<br />
    when MODE_MOVEL<br />
      refresh_move(0)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Screen redraw (at initialization)<br />
  #--------------------------------------------------------------------------<br />
  def refresh_start<br />
    d1 = 2.0 * Math::PI / @item_max<br />
    d2 = 1.0 * Math::PI / STARTUP_FRAMES<br />
    r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      d = d1 * j + d2 * @steps<br />
      x = @cx + ( r * Math.sin( d ) ).to_i<br />
      y = @cy - ( r * Math.cos( d ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
    @steps -= 1<br />
    if @steps &lt; 1<br />
      @mode = MODE_WAIT<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Screen redraw (standby)<br />
  #--------------------------------------------------------------------------<br />
  def refresh_wait<br />
    d = 2.0 * Math::PI / @item_max<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      x = @cx + ( RING_R * Math.sin( d * j ) ).to_i<br />
      y = @cy - ( RING_R * Math.cos( d * j ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Screen Redraw (on Rotation)<br />
  #  mode : 0=Counter-clockwise 1=Clockwise<br />
  #--------------------------------------------------------------------------<br />
  def refresh_move( mode )<br />
    d1 = 2.0 * Math::PI / @item_max<br />
    d2 = d1 / MOVING_FRAMES<br />
    d2 *= -1 if mode != 0<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      d = d1 * j + d2 * @steps<br />
      x = @cx + ( RING_R * Math.sin( d ) ).to_i<br />
      y = @cy - ( RING_R * Math.cos( d ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
    @steps -= 1<br />
    if @steps &lt; 1<br />
      @mode = MODE_WAIT<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Draw Item<br />
  #   &nbsp;&nbsp;x : <br />
  #   &nbsp;&nbsp;y : <br />
  #   &nbsp;&nbsp;i : Item number<br />
  #--------------------------------------------------------------------------<br />
  def draw_item(x, y, i)<br />
    rect = Rect.new(0, 0, @items[i].width, @items[i].height)<br />
    x -= rect.width/2<br />
    y -= rect.height/2<br />
    if @index == i<br />
      self.contents.blt( x, y, @items[i], rect )<br />
      if @disabled[@index]<br />
        self.contents.blt( x, y, ICON_DISABLE, rect )<br />
      end<br />
    else<br />
      self.contents.blt( x, y, @items[i], rect, 128 )<br />
      if @disabled[@index]<br />
        self.contents.blt( x, y, ICON_DISABLE, rect, 128 )<br />
      end<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Disable Item<br />
  #   &nbsp;&nbsp;index : Item number<br />
  #--------------------------------------------------------------------------<br />
  def disable_item(index)<br />
    @disabled[index] = true<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Preparing the Initialization Animation<br />
  #--------------------------------------------------------------------------<br />
  def setup_move_start<br />
    @mode = MODE_START<br />
    @steps = STARTUP_FRAMES<br />
    if  SE_STARTUP != nil and SE_STARTUP != ""<br />
      Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Preparing the Rotation Animation<br />
  #--------------------------------------------------------------------------<br />
  def setup_move_move(mode)<br />
    if mode == MODE_MOVER<br />
      @index -= 1<br />
      @index = @items.size - 1 if @index &lt; 0<br />
    elsif mode == MODE_MOVEL<br />
      @index += 1<br />
      @index = 0 if @index &gt;= @items.size<br />
    else<br />
      return<br />
    end<br />
    @mode = mode<br />
    @steps = MOVING_FRAMES<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Whether currently animating<br />
  #--------------------------------------------------------------------------<br />
  def animation?<br />
    return @mode != MODE_WAIT<br />
  end<br />
end<br />
#==============================================================================<br />
# ■ Window_MenuStatus<br />
#------------------------------------------------------------------------------<br />
# 　This window displays party member status on the menu screen.<br />
#==============================================================================<br />
<br />
class Window_RingMenuStatus &lt; Window_Selectable<br />
  attr_reader :max_index<br />
  #--------------------------------------------------------------------------<br />
  # ● Object Initialization<br />
  #--------------------------------------------------------------------------<br />
  def initialize<br />
    @max_index = &#36;game_party.actors.size - 1<br />
    h = 32 * (@max_index + 1) + 32<br />
    h = 416 if h &gt; 416<br />
    x = 0<br />
    x = 456 if &#36;game_player.screen_x &lt; 200 + Window_RingMenu::RING_R<br />
    super(x, 64, 184, h)<br />
    self.contents = Bitmap.new(width - 32, &#36;game_party.actors.size * 32)<br />
    refresh<br />
    self.active = false<br />
    self.index = -1<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Refresh<br />
  #--------------------------------------------------------------------------<br />
  def refresh<br />
    self.contents.clear<br />
    @item_max = &#36;game_party.actors.size<br />
    for i in 0...&#36;game_party.actors.size<br />
      x = 32<br />
      y = 32 * i<br />
      actor = &#36;game_party.actors[i]<br />
      self.contents.draw_facesquare(actor.character_name, actor.character_hue,<br />
                                    4, y + 4 )<br />
      draw_actor_name(actor, x, y)<br />
    end<br />
  end<br />
end<br />
#==============================================================================<br />
# ■ Scene_Menu<br />
#------------------------------------------------------------------------------<br />
# 　This class performs menu screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Menu<br />
  #--------------------------------------------------------------------------<br />
  # ● Object Initialization<br />
  #   &nbsp;&nbsp;menu_index : command cursor's initial position<br />
  #--------------------------------------------------------------------------<br />
  def initialize(menu_index = 0)<br />
    @menu_index = menu_index<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Main Processing<br />
  #--------------------------------------------------------------------------<br />
  def main<br />
    # Make spriteset<br />
    @spriteset = Spriteset_Map.new<br />
    # Make command window<br />
    bmp = RPG::Cache.character(&#36;game_party.actors[0].character_name, 0)<br />
    px = &#36;game_player.screen_x<br />
    py = &#36;game_player.screen_y - bmp.rect.height / 4 / 2<br />
    @command_window = Window_RingMenu.new(px,py)<br />
    @command_window.index = @menu_index<br />
    # If number of party members is 0<br />
    if &#36;game_party.actors.size == 0<br />
      # Disable items, skills, equipment, and status<br />
      @command_window.disable_item(0)<br />
      @command_window.disable_item(1)<br />
      @command_window.disable_item(2)<br />
      @command_window.disable_item(3)<br />
    end<br />
    @command_window.z = 100<br />
    # If save is forbidden<br />
    if &#36;game_system.save_disabled<br />
      # Disable save<br />
      @command_window.disable_item(4)<br />
    end<br />
    # Make status window<br />
    @status_window = Window_RingMenuStatus.new<br />
    @status_window.z = 200<br />
    @status_window.visible = false<br />
    # Make help window<br />
    @help_window = Window_Help.new<br />
    @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
    # Execute transition<br />
    Graphics.transition<br />
    # Main loop<br />
    loop do<br />
      # Update game screen<br />
      Graphics.update<br />
      # Update input information<br />
      Input.update<br />
      # Frame update<br />
      update<br />
      # Abort loop if screen is changed<br />
      if &#36;scene != self<br />
        break<br />
      end<br />
    end<br />
    # Prepare for transition<br />
    Graphics.freeze<br />
    # Dispose of spriteset<br />
    @spriteset.dispose<br />
    # Dispose of windows<br />
    @command_window.dispose<br />
    @status_window.dispose<br />
    @help_window.dispose<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Frame Update<br />
  #--------------------------------------------------------------------------<br />
  def update<br />
    # Update windows<br />
    @command_window.update<br />
    @status_window.update<br />
    @help_window.update<br />
    # If command window is active: call update_command<br />
    if @command_window.active<br />
      update_command<br />
      return<br />
    end<br />
    # If status window is active: call update_status<br />
    if @status_window.active<br />
      update_status<br />
      return<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Frame Update (when command window is active)<br />
  #--------------------------------------------------------------------------<br />
  def update_command<br />
    # If B button was pressed<br />
    if Input.trigger?(Input::B)<br />
      # Play cancel SE<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      # Switch to map screen<br />
      &#36;scene = Scene_Map.new<br />
      return<br />
    end<br />
    # If C button was pressed<br />
    if Input.trigger?(Input::C)<br />
      # If command other than save or end game, and party members = 0<br />
      if &#36;game_party.actors.size == 0 and @command_window.index &lt; 4<br />
        # Play buzzer SE<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      # Branch by command window cursor position<br />
      case @command_window.index<br />
      when 0  # item<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to item screen<br />
        &#36;scene = Scene_Item.new<br />
      when 1  # skill<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Make status window active<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 2  # equipment<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Make status window active<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 3  # status<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Make status window active<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 4  # save<br />
        # If saving is forbidden<br />
        if &#36;game_system.save_disabled<br />
          # Play buzzer SE<br />
          &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
          return<br />
        end<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to save screen<br />
        &#36;scene = Scene_Save.new<br />
      when 5  # Game Over<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to end game screen<br />
        &#36;scene = Scene_End.new<br />
      end<br />
      return<br />
    end<br />
    # Do not process the cursor while an animation is in progress.<br />
    return if @command_window.animation?<br />
    # ↑or← ボタンが押された場合<br />
    if Input.press?(Input::UP) or  Input.press?(Input::LEFT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)<br />
      @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
      return<br />
    end<br />
    # If the ↓ or → button is pressed<br />
    if Input.press?(Input::DOWN) or  Input.press?(Input::RIGHT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @command_window.setup_move_move(Window_RingMenu::MODE_MOVER)<br />
      @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
      return<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Frame Update (when status window is active)<br />
  #--------------------------------------------------------------------------<br />
  def update_status<br />
    # If B button was pressed<br />
    if Input.trigger?(Input::B)<br />
      # Play cancel SE<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      # Make command window active<br />
      @command_window.active = true<br />
      @status_window.active = false<br />
      @status_window.visible = false<br />
      @status_window.index = -1<br />
      return<br />
    end<br />
    # If C button was pressed<br />
    if Input.trigger?(Input::C)<br />
      # Branch by command window cursor position<br />
      case @command_window.index<br />
      when 1  # skill<br />
        # If this actor's action limit is 2 or more<br />
        if &#36;game_party.actors[@status_window.index].restriction &gt;= 2<br />
          # Play buzzer SE<br />
          &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
          return<br />
        end<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to skill screen<br />
        &#36;scene = Scene_Skill.new(@status_window.index)<br />
      when 2  # equipment<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to equipment screen<br />
        &#36;scene = Scene_Equip.new(@status_window.index)<br />
      when 3  # status<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to status screen<br />
        &#36;scene = Scene_Status.new(@status_window.index)<br />
      end<br />
      return<br />
    end<br />
  end<br />
end<br />
#==============================================================================<br />
# ◇ External Libraries<br />
#==============================================================================<br />
class Bitmap<br />
# ▼▲▼ XRXL 1. Line and Shape Drawing ▼▲▼<br />
  #--------------------------------------------------------------------------<br />
  # ● Line drawing by Ouga Zaitou<br />
  #--------------------------------------------------------------------------<br />
  def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)<br />
    # Calculation of rendering distance. A generous estimate for the length at a right angle.<br />
    distance = (start_x - end_x).abs + (start_y - end_y).abs<br />
    # Start drawing<br />
    if end_color == start_color<br />
      for i in 1..distance<br />
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i<br />
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i<br />
        if width == 1<br />
          self.set_pixel(x, y, start_color) <br />
        else<br />
          self.fill_rect(x, y, width, width, start_color) <br />
        end<br />
      end<br />
    else<br />
      for i in 1..distance<br />
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i<br />
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i<br />
        r = start_color.red &nbsp;&nbsp;* (distance-i)/distance + end_color.red &nbsp;&nbsp;* i/distance<br />
        g = start_color.green * (distance-i)/distance + end_color.green * i/distance<br />
        b = start_color.blue  * (distance-i)/distance + end_color.blue  * i/distance<br />
        a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance<br />
        if width == 1<br />
          self.set_pixel(x, y, Color.new(r, g, b, a))<br />
        else<br />
          self.fill_rect(x, y, width, width, Color.new(r, g, b, a)) <br />
        end<br />
      end<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Drawing a Polygon (Unfilled) by Kazuki<br />
  #    peaks    : Array of vertex coordinates [[x1,y1],[x2,y2],[x3,y3], ... ]<br />
  #    color    : Line Color<br />
  #    width    : Line width<br />
  #--------------------------------------------------------------------------<br />
  def draw_polygon(peaks, color, width = 1)<br />
    # Draw a number of edges equal to the number of edges (or vertices).<br />
    for i in 0 ... (peaks.size - 1)<br />
      # Connect the vertices with lines.<br />
      draw_line( peaks[i][0], peaks[i][1], peaks[i+1][0], peaks[i+1][1], color, width )<br />
    end<br />
    # Connect the last vertex to the first vertex.<br />
    draw_line( peaks[peaks.size - 1][0], peaks[peaks.size - 1][1], peaks[0][0], peaks[0][1], color, width )<br />
  end<br />
# ▼▲▼ XRXL 2. Bitmap/Icon Rendering ▼▲▼<br />
  #--------------------------------------------------------------------------<br />
  # ● Face and frame drawing by Ouga Zaitou<br />
  #   &nbsp;&nbsp;character_name : Character Graphics Used for Depiction<br />
  #   &nbsp;&nbsp;character_hue  : The Hue of the Character<br />
  #   &nbsp;&nbsp;x     &nbsp;&nbsp;: Drawing Destination X-Coordinate<br />
  #   &nbsp;&nbsp;y     &nbsp;&nbsp;: Drawing Destination Y-Coordinate<br />
  #--------------------------------------------------------------------------<br />
  def draw_facesquare(character_name, character_hue, x, y, size = 24)<br />
    bitmap = RPG::Cache.character(character_name, character_hue)<br />
    src_rect = Rect.new((bitmap.width/4 - size)/2, 0, size, size)<br />
    self.blt(x, y, bitmap, src_rect)<br />
    self.draw_polygon([[x,y],[x+size,y],[x+size,y+size],[x,y+size]], Color.new(255,255,255,128))<br />
  end<br />
end</code></div></div></div>
		</div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
From the translation:<ul class="mycode_list"><li>Please install "XRXL 2. Bitmap/Icon Rendering" beforehand.<br />
</li>
<li>Copy this script into a new section created above the Main section.<br />
</li>
<li>Inside the double quotas (`""`) of the sevenRPG::Cache.icon("") entries located at the top of `Window_RingMenu, enter the icon for each command.<ul class="mycode_list"><li>Follow as they are described in the comments to the right.<br />
</li>
<li>The "Disabled" icon at the bottom is an icon that overlays atop the menu icons that cannot be selected. Recommended is something like: φ<br />
</li>
</ul>
</li>
<li>Inside the "" of the TSE_STARTUP value, place the sound effect that you want to sound when the menu opens<br />
</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
Code courtesy of Kazuki, the creator of the XRXS script.<br />
Line Drawing and Face and frame drawing by Ouga Zaitou]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">XRXS_MP 6. Ring Menu Implementation</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version:  1.2<br />
by Kazuki</span><br />
<span style="font-size: xx-small;" class="mycode_size">&copy; 2007<br />
Version 1.0 Release &copy; 2005</span><br />
<span style="font-style: italic;" class="mycode_i">Yes, the creator's name is Kazuki, NOT XRXS</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
For years, I've seen the XRXS Ring Menu with additions by Dubealex and others.  But never a pure version of the original version. So I decided to use my lycanthropic werewolf hunting skills to track down a pure version untouched by western editors.<br />
<br />
And here it is.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><ul class="mycode_list"><li>Its a RING menu<br />
</li>
<li>Contains a compact actor menu when selecting choices like Equip or Skill<br />
</li>
<li>Able to customize the icons<br />
</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<br />
I am providing BOTH the original version 1.2 (circa 2007 which Kazuki stated was abandoned) and an English version thanks to an hour's worth of wolfish translation.<br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> Japanese Original Version</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># ▼▲▼ XRXS_MP 6. リングメニュー導入 ver.1.2 ▼▲▼<br />
# by 和希<br />
<br />
#==============================================================================<br />
# □ カスタマイズポイント<br />
#==============================================================================<br />
class Window_RingMenu &lt; Window_Base<br />
  STARTUP_FRAMES =  20 # 初期アニメーションのフレーム数<br />
  MOVING_FRAMES  = &nbsp;&nbsp;5 # リングを回した時のフレーム数<br />
  RING_R       &nbsp;&nbsp;=  64 # リングの半径<br />
  SE_STARTUP  = "056-Right02" # メニューを開いたときに鳴らすSE<br />
  ICON_ITEM &nbsp;&nbsp;= RPG::Cache.icon("034-Item03") &nbsp;&nbsp;# 「 アイテム 」メニューのアイコン<br />
  ICON_SKILL  = RPG::Cache.icon("044-Skill01")  # 「　スキル　」メニューのアイコン<br />
  ICON_EQUIP  = RPG::Cache.icon("001-Weapon01") # 「　 装備 　」メニューのアイコン<br />
  ICON_STATUS = RPG::Cache.icon("050-Skill07")  # 「ステータス」メニューのアイコン<br />
  ICON_SAVE &nbsp;&nbsp;= RPG::Cache.icon("038-Item07") &nbsp;&nbsp;# 「　セーブ　」メニューのアイコン<br />
  ICON_EXIT &nbsp;&nbsp;= RPG::Cache.icon("046-Skill03")  # 「　 終了 　」メニューのアイコン<br />
  ICON_DISABLE= RPG::Cache.icon("")           &nbsp;&nbsp;# 使用禁止項目に付くアイコン<br />
  BACKGROUND_COLOR = Color.new(0xcc,0x99,0x33,0x3f)<br />
end<br />
###############################################################################<br />
# リングメニュー導入スクリプト Ver. 1.2<br />
#               &nbsp;&nbsp;writen by 和希<br />
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
# ▽導入<br />
# &nbsp;&nbsp;０．先に XRXL 2. ビットマップ/アイコン描写 を入れて置いてください。<br />
# &nbsp;&nbsp;１．このスクリプトをMainセクションの上に作った新しいセクションにコピーする<br />
# &nbsp;&nbsp;２．Window_RingMenuの上部にある７つの RPG::Cache.icon("") の "" の中に<br />
#     &nbsp;&nbsp;右の説明に書いてあるコマンド用のアイコン名を書く。<br />
#     &nbsp;&nbsp;(一番下の使用禁止は選べないメニューに重ねるアイコンです。<br />
#        こんなのがいいかも→ φ )<br />
# &nbsp;&nbsp;３．アイコン設定のすぐ下にある SE_STARTUP = "" の "" の中にメニューを<br />
#     &nbsp;&nbsp;開いたときに鳴らしたいのSEの名前を書く。<br />
# ▽スクリプト触れる人へ<br />
# &nbsp;&nbsp;とりあえず動く物を目標に作ったものなので(志低いｗ)、座標の調整などが不完全です。<br />
# &nbsp;&nbsp;より正確にアクターの画面座標を取得する処理を追加したり、アクター一覧の位置を<br />
# &nbsp;&nbsp;変えたり、文字表示などなどを調整するといい感じに仕上がる気がします。<br />
###############################################################################<br />
<br />
#==============================================================================<br />
# ■ Window_RingMenu<br />
#==============================================================================<br />
class Window_RingMenu &lt; Window_Base<br />
  #--------------------------------------------------------------------------<br />
  # ○ クラス定数<br />
  #--------------------------------------------------------------------------<br />
  MODE_START = 1 # スタートアップアニメーション<br />
  MODE_WAIT  = 2 # 待機<br />
  MODE_MOVER = 3 # 時計回り回転アニメーション<br />
  MODE_MOVEL = 4 # 反時計回り回転アニメーション<br />
  #--------------------------------------------------------------------------<br />
  # ○ アクセサ<br />
  #--------------------------------------------------------------------------<br />
  attr_accessor :index<br />
  attr_reader :commands<br />
  #--------------------------------------------------------------------------<br />
  # ● オブジェクト初期化<br />
  #--------------------------------------------------------------------------<br />
  def initialize( center_x, center_y )<br />
    super(-16, -16, 640+32, 480+32)<br />
    self.contents = Bitmap.new(width-32, height-32)<br />
    self.opacity = 0<br />
    self.back_opacity = 0<br />
    s1 = &#36;data_system.words.item<br />
    s2 = &#36;data_system.words.skill<br />
    s3 = &#36;data_system.words.equip<br />
    s4 = "ステータス"<br />
    s5 = "セーブ"<br />
    s6 = "ゲーム終了"<br />
    @commands = [ s1, s2, s3, s4, s5, s6 ]<br />
    @item_max = 6<br />
    @index = 0<br />
    @items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_EXIT ]<br />
    @disabled = [ false, false, false, false, false, false ]<br />
    @cx = center_x<br />
    @cy = center_y<br />
    setup_move_start<br />
    refresh<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● フレーム更新<br />
  #--------------------------------------------------------------------------<br />
  def update<br />
    super<br />
    refresh<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● 画面再描画<br />
  #--------------------------------------------------------------------------<br />
  def refresh<br />
    self.contents.clear<br />
    # 背景描画<br />
    if BACKGROUND_COLOR.alpha &gt; 0<br />
      self.contents.fill_rect(0,0,640,480,BACKGROUND_COLOR)<br />
    end<br />
    # アイコンを描画<br />
    case @mode<br />
    when MODE_START<br />
      refresh_start<br />
    when MODE_WAIT<br />
      refresh_wait<br />
    when MODE_MOVER<br />
      refresh_move(1)<br />
    when MODE_MOVEL<br />
      refresh_move(0)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 画面再描画(初期化時)<br />
  #--------------------------------------------------------------------------<br />
  def refresh_start<br />
    d1 = 2.0 * Math::PI / @item_max<br />
    d2 = 1.0 * Math::PI / STARTUP_FRAMES<br />
    r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      d = d1 * j + d2 * @steps<br />
      x = @cx + ( r * Math.sin( d ) ).to_i<br />
      y = @cy - ( r * Math.cos( d ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
    @steps -= 1<br />
    if @steps &lt; 1<br />
      @mode = MODE_WAIT<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 画面再描画(待機時)<br />
  #--------------------------------------------------------------------------<br />
  def refresh_wait<br />
    d = 2.0 * Math::PI / @item_max<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      x = @cx + ( RING_R * Math.sin( d * j ) ).to_i<br />
      y = @cy - ( RING_R * Math.cos( d * j ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 画面再描画(回転時)<br />
  #  mode : 0=反時計回り 1=時計回り<br />
  #--------------------------------------------------------------------------<br />
  def refresh_move( mode )<br />
    d1 = 2.0 * Math::PI / @item_max<br />
    d2 = d1 / MOVING_FRAMES<br />
    d2 *= -1 if mode != 0<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      d = d1 * j + d2 * @steps<br />
      x = @cx + ( RING_R * Math.sin( d ) ).to_i<br />
      y = @cy - ( RING_R * Math.cos( d ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
    @steps -= 1<br />
    if @steps &lt; 1<br />
      @mode = MODE_WAIT<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● 項目の描画<br />
  #   &nbsp;&nbsp;x : <br />
  #   &nbsp;&nbsp;y : <br />
  #   &nbsp;&nbsp;i : 項目番号<br />
  #--------------------------------------------------------------------------<br />
  def draw_item(x, y, i)<br />
    rect = Rect.new(0, 0, @items[i].width, @items[i].height)<br />
    x -= rect.width/2<br />
    y -= rect.height/2<br />
    if @index == i<br />
      self.contents.blt( x, y, @items[i], rect )<br />
      if @disabled[@index]<br />
        self.contents.blt( x, y, ICON_DISABLE, rect )<br />
      end<br />
    else<br />
      self.contents.blt( x, y, @items[i], rect, 128 )<br />
      if @disabled[@index]<br />
        self.contents.blt( x, y, ICON_DISABLE, rect, 128 )<br />
      end<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● 項目を無効にする<br />
  #   &nbsp;&nbsp;index : 項目番号<br />
  #--------------------------------------------------------------------------<br />
  def disable_item(index)<br />
    @disabled[index] = true<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 初期化アニメーションの準備<br />
  #--------------------------------------------------------------------------<br />
  def setup_move_start<br />
    @mode = MODE_START<br />
    @steps = STARTUP_FRAMES<br />
    if  SE_STARTUP != nil and SE_STARTUP != ""<br />
      Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 回転アニメーションの準備<br />
  #--------------------------------------------------------------------------<br />
  def setup_move_move(mode)<br />
    if mode == MODE_MOVER<br />
      @index -= 1<br />
      @index = @items.size - 1 if @index &lt; 0<br />
    elsif mode == MODE_MOVEL<br />
      @index += 1<br />
      @index = 0 if @index &gt;= @items.size<br />
    else<br />
      return<br />
    end<br />
    @mode = mode<br />
    @steps = MOVING_FRAMES<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ アニメーション中かどうか<br />
  #--------------------------------------------------------------------------<br />
  def animation?<br />
    return @mode != MODE_WAIT<br />
  end<br />
end<br />
#==============================================================================<br />
# ■ Window_MenuStatus<br />
#------------------------------------------------------------------------------<br />
# 　メニュー画面でパーティメンバーのステータスを表示するウィンドウです。<br />
#==============================================================================<br />
<br />
class Window_RingMenuStatus &lt; Window_Selectable<br />
  attr_reader :max_index<br />
  #--------------------------------------------------------------------------<br />
  # ● オブジェクト初期化<br />
  #--------------------------------------------------------------------------<br />
  def initialize<br />
    @max_index = &#36;game_party.actors.size - 1<br />
    h = 32 * (@max_index + 1) + 32<br />
    h = 416 if h &gt; 416<br />
    x = 0<br />
    x = 456 if &#36;game_player.screen_x &lt; 200 + Window_RingMenu::RING_R<br />
    super(x, 64, 184, h)<br />
    self.contents = Bitmap.new(width - 32, &#36;game_party.actors.size * 32)<br />
    refresh<br />
    self.active = false<br />
    self.index = -1<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● リフレッシュ<br />
  #--------------------------------------------------------------------------<br />
  def refresh<br />
    self.contents.clear<br />
    @item_max = &#36;game_party.actors.size<br />
    for i in 0...&#36;game_party.actors.size<br />
      x = 32<br />
      y = 32 * i<br />
      actor = &#36;game_party.actors[i]<br />
      self.contents.draw_facesquare(actor.character_name, actor.character_hue,<br />
                                    4, y + 4 )<br />
      draw_actor_name(actor, x, y)<br />
    end<br />
  end<br />
end<br />
#==============================================================================<br />
# ■ Scene_Menu<br />
#------------------------------------------------------------------------------<br />
# 　メニュー画面の処理を行うクラスです。<br />
#==============================================================================<br />
<br />
class Scene_Menu<br />
  #--------------------------------------------------------------------------<br />
  # ● オブジェクト初期化<br />
  #   &nbsp;&nbsp;menu_index : コマンドのカーソル初期位置<br />
  #--------------------------------------------------------------------------<br />
  def initialize(menu_index = 0)<br />
    @menu_index = menu_index<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● メイン処理<br />
  #--------------------------------------------------------------------------<br />
  def main<br />
    # スプライトセットを作成<br />
    @spriteset = Spriteset_Map.new<br />
    # コマンドウィンドウを作成<br />
    bmp = RPG::Cache.character(&#36;game_party.actors[0].character_name, 0)<br />
    px = &#36;game_player.screen_x<br />
    py = &#36;game_player.screen_y - bmp.rect.height / 4 / 2<br />
    @command_window = Window_RingMenu.new(px,py)<br />
    @command_window.index = @menu_index<br />
    # パーティ人数が 0 人の場合<br />
    if &#36;game_party.actors.size == 0<br />
      # アイテム、スキル、装備、ステータスを無効化<br />
      @command_window.disable_item(0)<br />
      @command_window.disable_item(1)<br />
      @command_window.disable_item(2)<br />
      @command_window.disable_item(3)<br />
    end<br />
    @command_window.z = 100<br />
    # セーブ禁止の場合<br />
    if &#36;game_system.save_disabled<br />
      # セーブを無効にする<br />
      @command_window.disable_item(4)<br />
    end<br />
    # ステータスウィンドウを作成<br />
    @status_window = Window_RingMenuStatus.new<br />
    @status_window.z = 200<br />
    @status_window.visible = false<br />
    # ヘルプウィンドウを作成<br />
    @help_window = Window_Help.new<br />
    @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
    # トランジション実行<br />
    Graphics.transition<br />
    # メインループ<br />
    loop do<br />
      # ゲーム画面を更新<br />
      Graphics.update<br />
      # 入力情報を更新<br />
      Input.update<br />
      # フレーム更新<br />
      update<br />
      # 画面が切り替わったらループを中断<br />
      if &#36;scene != self<br />
        break<br />
      end<br />
    end<br />
    # トランジション準備<br />
    Graphics.freeze<br />
    # スプライトセットを解放<br />
    @spriteset.dispose<br />
    # ウィンドウを解放<br />
    @command_window.dispose<br />
    @status_window.dispose<br />
    @help_window.dispose<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● フレーム更新<br />
  #--------------------------------------------------------------------------<br />
  def update<br />
    # ウィンドウを更新<br />
    @command_window.update<br />
    @status_window.update<br />
    @help_window.update<br />
    # コマンドウィンドウがアクティブの場合: update_command を呼ぶ<br />
    if @command_window.active<br />
      update_command<br />
      return<br />
    end<br />
    # ステータスウィンドウがアクティブの場合: update_status を呼ぶ<br />
    if @status_window.active<br />
      update_status<br />
      return<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● フレーム更新 (コマンドウィンドウがアクティブの場合)<br />
  #--------------------------------------------------------------------------<br />
  def update_command<br />
    # B ボタンが押された場合<br />
    if Input.trigger?(Input::B)<br />
      # キャンセル SE を演奏<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      # マップ画面に切り替え<br />
      &#36;scene = Scene_Map.new<br />
      return<br />
    end<br />
    # C ボタンが押された場合<br />
    if Input.trigger?(Input::C)<br />
      # パーティ人数が 0 人で、セーブ、ゲーム終了以外のコマンドの場合<br />
      if &#36;game_party.actors.size == 0 and @command_window.index &lt; 4<br />
        # ブザー SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      # コマンドウィンドウのカーソル位置で分岐<br />
      case @command_window.index<br />
      when 0  # アイテム<br />
        # 決定  SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # アイテム画面に切り替え<br />
        &#36;scene = Scene_Item.new<br />
      when 1  # スキル<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ステータスウィンドウをアクティブにする<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 2  # 装備<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ステータスウィンドウをアクティブにする<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 3  # ステータス<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ステータスウィンドウをアクティブにする<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 4  # セーブ<br />
        # セーブ禁止の場合<br />
        if &#36;game_system.save_disabled<br />
          # ブザー SE を演奏<br />
          &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
          return<br />
        end<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # セーブ画面に切り替え<br />
        &#36;scene = Scene_Save.new<br />
      when 5  # ゲーム終了<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ゲーム終了画面に切り替え<br />
        &#36;scene = Scene_End.new<br />
      end<br />
      return<br />
    end<br />
    # アニメーション中ならカーソルの処理を行わない<br />
    return if @command_window.animation?<br />
    # ↑or← ボタンが押された場合<br />
    if Input.press?(Input::UP) or  Input.press?(Input::LEFT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)<br />
      @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
      return<br />
    end<br />
    # ↓or→ ボタンが押された場合<br />
    if Input.press?(Input::DOWN) or  Input.press?(Input::RIGHT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @command_window.setup_move_move(Window_RingMenu::MODE_MOVER)<br />
      @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
      return<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● フレーム更新 (ステータスウィンドウがアクティブの場合)<br />
  #--------------------------------------------------------------------------<br />
  def update_status<br />
    # B ボタンが押された場合<br />
    if Input.trigger?(Input::B)<br />
      # キャンセル SE を演奏<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      # コマンドウィンドウをアクティブにする<br />
      @command_window.active = true<br />
      @status_window.active = false<br />
      @status_window.visible = false<br />
      @status_window.index = -1<br />
      return<br />
    end<br />
    # C ボタンが押された場合<br />
    if Input.trigger?(Input::C)<br />
      # コマンドウィンドウのカーソル位置で分岐<br />
      case @command_window.index<br />
      when 1  # スキル<br />
        # このアクターの行動制限が 2 以上の場合<br />
        if &#36;game_party.actors[@status_window.index].restriction &gt;= 2<br />
          # ブザー SE を演奏<br />
          &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
          return<br />
        end<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # スキル画面に切り替え<br />
        &#36;scene = Scene_Skill.new(@status_window.index)<br />
      when 2  # 装備<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # 装備画面に切り替え<br />
        &#36;scene = Scene_Equip.new(@status_window.index)<br />
      when 3  # ステータス<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ステータス画面に切り替え<br />
        &#36;scene = Scene_Status.new(@status_window.index)<br />
      end<br />
      return<br />
    end<br />
  end<br />
end<br />
#==============================================================================<br />
# ◇ 外部ライブラリ<br />
#==============================================================================<br />
class Bitmap<br />
# ▼▲▼ XRXL 1. ライン・図形描写 ▼▲▼<br />
  #--------------------------------------------------------------------------<br />
  # ● ライン描画 by 桜雅 在土<br />
  #--------------------------------------------------------------------------<br />
  def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)<br />
    # 描写距離の計算。大きめに直角時の長さ。<br />
    distance = (start_x - end_x).abs + (start_y - end_y).abs<br />
    # 描写開始<br />
    if end_color == start_color<br />
      for i in 1..distance<br />
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i<br />
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i<br />
        if width == 1<br />
          self.set_pixel(x, y, start_color) <br />
        else<br />
          self.fill_rect(x, y, width, width, start_color) <br />
        end<br />
      end<br />
    else<br />
      for i in 1..distance<br />
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i<br />
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i<br />
        r = start_color.red &nbsp;&nbsp;* (distance-i)/distance + end_color.red &nbsp;&nbsp;* i/distance<br />
        g = start_color.green * (distance-i)/distance + end_color.green * i/distance<br />
        b = start_color.blue  * (distance-i)/distance + end_color.blue  * i/distance<br />
        a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance<br />
        if width == 1<br />
          self.set_pixel(x, y, Color.new(r, g, b, a))<br />
        else<br />
          self.fill_rect(x, y, width, width, Color.new(r, g, b, a)) <br />
        end<br />
      end<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● 多角形の描画(塗りつぶしなし) by 和希<br />
  #    peaks    : 頂点座標の配列 [[x1,y1],[x2,y2],[x3,y3], ... ]<br />
  #    color    : 線の色<br />
  #    width    : 線の幅<br />
  #--------------------------------------------------------------------------<br />
  def draw_polygon(peaks, color, width = 1)<br />
    # 辺(=頂点)の個数分だけ辺を描く<br />
    for i in 0 ... (peaks.size - 1)<br />
      # 頂点同士を線で結ぶ<br />
      draw_line( peaks[i][0], peaks[i][1], peaks[i+1][0], peaks[i+1][1], color, width )<br />
    end<br />
    # 最後の頂点と最初の頂点を結ぶ<br />
    draw_line( peaks[peaks.size - 1][0], peaks[peaks.size - 1][1], peaks[0][0], peaks[0][1], color, width )<br />
  end<br />
# ▼▲▼ XRXL 2. ビットマップ/アイコン描写 ▼▲▼<br />
  #--------------------------------------------------------------------------<br />
  # ● 顔＆枠の描画 by 桜雅 在土<br />
  #   &nbsp;&nbsp;character_name : 描写に利用するキャラクターグラフィック<br />
  #   &nbsp;&nbsp;character_hue  : 描写の色合い<br />
  #   &nbsp;&nbsp;x     &nbsp;&nbsp;: 描画先 X 座標<br />
  #   &nbsp;&nbsp;y     &nbsp;&nbsp;: 描画先 Y 座標<br />
  #--------------------------------------------------------------------------<br />
  def draw_facesquare(character_name, character_hue, x, y, size = 24)<br />
    bitmap = RPG::Cache.character(character_name, character_hue)<br />
    src_rect = Rect.new((bitmap.width/4 - size)/2, 0, size, size)<br />
    self.blt(x, y, bitmap, src_rect)<br />
    self.draw_polygon([[x,y],[x+size,y],[x+size,y+size],[x,y+size]], Color.new(255,255,255,128))<br />
  end<br />
end</code></div></div></div>
		</div>
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> English Translated Version</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># ▼▲▼ XRXS_MP 6. Ring Menu Implementation ver.1.2 ▼▲▼<br />
# By Kazuki<br />
<br />
#==============================================================================<br />
# □ Customization Points<br />
#==============================================================================<br />
class Window_RingMenu &lt; Window_Base<br />
  STARTUP_FRAMES =  20 # Number of frames in the initial animation<br />
  MOVING_FRAMES  = &nbsp;&nbsp;5 # The number of frames when rotating the ring<br />
  RING_R       &nbsp;&nbsp;=  64 # Radius of the ring<br />
  SE_STARTUP  = "056-Right02" # The sound effect played when opening the menu<br />
  ICON_ITEM &nbsp;&nbsp;= RPG::Cache.icon("034-Item03") &nbsp;&nbsp;# Icons in the "Items" Menu<br />
  ICON_SKILL  = RPG::Cache.icon("044-Skill01")  # Icons in the "Skills" Menu<br />
  ICON_EQUIP  = RPG::Cache.icon("001-Weapon01") # "Equipment" Menu Icon<br />
  ICON_STATUS = RPG::Cache.icon("050-Skill07")  # "Status" Menu Icons<br />
  ICON_SAVE &nbsp;&nbsp;= RPG::Cache.icon("038-Item07") &nbsp;&nbsp;# "Save" Menu Icon<br />
  ICON_EXIT &nbsp;&nbsp;= RPG::Cache.icon("046-Skill03")  # "Exit" Menu Icon<br />
  ICON_DISABLE= RPG::Cache.icon("")           &nbsp;&nbsp;# Icons for Prohibited Items<br />
  BACKGROUND_COLOR = Color.new(0xcc,0x99,0x33,0x3f)<br />
end<br />
###############################################################################<br />
# Ring Menu Implementation Script Ver. 1.2<br />
#               &nbsp;&nbsp;writen by Kazuki<br />
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
# ▽ Introduction<br />
# &nbsp;&nbsp;0. Please install "XRXL 2. Bitmap/Icon Rendering" beforehand.<br />
# &nbsp;&nbsp;1. Copy this script into a new section created above the Main section.<br />
# &nbsp;&nbsp;2. Inside the double quotas (`""`) of the sevenRPG::Cache.icon("") entries<br />
#      located at the top of `Window_RingMenu, enter the icon for each command.<br />
#      Follow as they are described in the comments to the right.<br />
#      The "Disabled" icon at the bottom is an icon that overlays atop the<br />
#      menu icons that cannot be selected. Recommended is something like: φ<br />
# &nbsp;&nbsp;3. Inside the "" of the TSE_STARTUP value, place the sound effect that you<br />
#      want to sound when the menu opens<br />
# ▽ For those comfortable working with scripts<br />
# &nbsp;&nbsp;Since I built this with the sole goal of getting something—anything—up and<br />
# &nbsp;&nbsp;running (yeah, I set the bar pretty low!), the coordinate alignment and<br />
# &nbsp;&nbsp;similar details are still incomplete.<br />
# &nbsp;&nbsp;We added a process to obtain the actor's screen coordinates more accurately,<br />
# &nbsp;&nbsp;and the position of the actor list.<br />
# &nbsp;&nbsp;I feel like if you tweak things—such as making changes or adjusting the text<br />
# &nbsp;&nbsp;display—it will turn out really nicely.<br />
###############################################################################<br />
<br />
#==============================================================================<br />
# ■ Window_RingMenu<br />
#==============================================================================<br />
class Window_RingMenu &lt; Window_Base<br />
  #--------------------------------------------------------------------------<br />
  # ○ Class Constants<br />
  #--------------------------------------------------------------------------<br />
  MODE_START = 1 # Startup Animation<br />
  MODE_WAIT  = 2 # Stand By<br />
  MODE_MOVER = 3 # Clockwise Rotation Animation<br />
  MODE_MOVEL = 4 # Counter-clockwise Rotation Animation<br />
  #--------------------------------------------------------------------------<br />
  # ○ Public Instance Variables<br />
  #--------------------------------------------------------------------------<br />
  attr_accessor :index<br />
  attr_reader :commands<br />
  #--------------------------------------------------------------------------<br />
  # ● Object Initialization<br />
  #--------------------------------------------------------------------------<br />
  def initialize( center_x, center_y )<br />
    super(-16, -16, 640+32, 480+32)<br />
    self.contents = Bitmap.new(width-32, height-32)<br />
    self.opacity = 0<br />
    self.back_opacity = 0<br />
    s1 = &#36;data_system.words.item<br />
    s2 = &#36;data_system.words.skill<br />
    s3 = &#36;data_system.words.equip<br />
    s4 = "Status"<br />
    s5 = "Save"<br />
    s6 = "Game Over"<br />
    @commands = [ s1, s2, s3, s4, s5, s6 ]<br />
    @item_max = 6<br />
    @index = 0<br />
    @items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_EXIT ]<br />
    @disabled = [ false, false, false, false, false, false ]<br />
    @cx = center_x<br />
    @cy = center_y<br />
    setup_move_start<br />
    refresh<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Frame Update<br />
  #--------------------------------------------------------------------------<br />
  def update<br />
    super<br />
    refresh<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Refresh<br />
  #--------------------------------------------------------------------------<br />
  def refresh<br />
    self.contents.clear<br />
    # Draw background<br />
    if BACKGROUND_COLOR.alpha &gt; 0<br />
      self.contents.fill_rect(0,0,640,480,BACKGROUND_COLOR)<br />
    end<br />
    # Draw Icon<br />
    case @mode<br />
    when MODE_START<br />
      refresh_start<br />
    when MODE_WAIT<br />
      refresh_wait<br />
    when MODE_MOVER<br />
      refresh_move(1)<br />
    when MODE_MOVEL<br />
      refresh_move(0)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Screen redraw (at initialization)<br />
  #--------------------------------------------------------------------------<br />
  def refresh_start<br />
    d1 = 2.0 * Math::PI / @item_max<br />
    d2 = 1.0 * Math::PI / STARTUP_FRAMES<br />
    r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      d = d1 * j + d2 * @steps<br />
      x = @cx + ( r * Math.sin( d ) ).to_i<br />
      y = @cy - ( r * Math.cos( d ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
    @steps -= 1<br />
    if @steps &lt; 1<br />
      @mode = MODE_WAIT<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Screen redraw (standby)<br />
  #--------------------------------------------------------------------------<br />
  def refresh_wait<br />
    d = 2.0 * Math::PI / @item_max<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      x = @cx + ( RING_R * Math.sin( d * j ) ).to_i<br />
      y = @cy - ( RING_R * Math.cos( d * j ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Screen Redraw (on Rotation)<br />
  #  mode : 0=Counter-clockwise 1=Clockwise<br />
  #--------------------------------------------------------------------------<br />
  def refresh_move( mode )<br />
    d1 = 2.0 * Math::PI / @item_max<br />
    d2 = d1 / MOVING_FRAMES<br />
    d2 *= -1 if mode != 0<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      d = d1 * j + d2 * @steps<br />
      x = @cx + ( RING_R * Math.sin( d ) ).to_i<br />
      y = @cy - ( RING_R * Math.cos( d ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
    @steps -= 1<br />
    if @steps &lt; 1<br />
      @mode = MODE_WAIT<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Draw Item<br />
  #   &nbsp;&nbsp;x : <br />
  #   &nbsp;&nbsp;y : <br />
  #   &nbsp;&nbsp;i : Item number<br />
  #--------------------------------------------------------------------------<br />
  def draw_item(x, y, i)<br />
    rect = Rect.new(0, 0, @items[i].width, @items[i].height)<br />
    x -= rect.width/2<br />
    y -= rect.height/2<br />
    if @index == i<br />
      self.contents.blt( x, y, @items[i], rect )<br />
      if @disabled[@index]<br />
        self.contents.blt( x, y, ICON_DISABLE, rect )<br />
      end<br />
    else<br />
      self.contents.blt( x, y, @items[i], rect, 128 )<br />
      if @disabled[@index]<br />
        self.contents.blt( x, y, ICON_DISABLE, rect, 128 )<br />
      end<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Disable Item<br />
  #   &nbsp;&nbsp;index : Item number<br />
  #--------------------------------------------------------------------------<br />
  def disable_item(index)<br />
    @disabled[index] = true<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Preparing the Initialization Animation<br />
  #--------------------------------------------------------------------------<br />
  def setup_move_start<br />
    @mode = MODE_START<br />
    @steps = STARTUP_FRAMES<br />
    if  SE_STARTUP != nil and SE_STARTUP != ""<br />
      Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Preparing the Rotation Animation<br />
  #--------------------------------------------------------------------------<br />
  def setup_move_move(mode)<br />
    if mode == MODE_MOVER<br />
      @index -= 1<br />
      @index = @items.size - 1 if @index &lt; 0<br />
    elsif mode == MODE_MOVEL<br />
      @index += 1<br />
      @index = 0 if @index &gt;= @items.size<br />
    else<br />
      return<br />
    end<br />
    @mode = mode<br />
    @steps = MOVING_FRAMES<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Whether currently animating<br />
  #--------------------------------------------------------------------------<br />
  def animation?<br />
    return @mode != MODE_WAIT<br />
  end<br />
end<br />
#==============================================================================<br />
# ■ Window_MenuStatus<br />
#------------------------------------------------------------------------------<br />
# 　This window displays party member status on the menu screen.<br />
#==============================================================================<br />
<br />
class Window_RingMenuStatus &lt; Window_Selectable<br />
  attr_reader :max_index<br />
  #--------------------------------------------------------------------------<br />
  # ● Object Initialization<br />
  #--------------------------------------------------------------------------<br />
  def initialize<br />
    @max_index = &#36;game_party.actors.size - 1<br />
    h = 32 * (@max_index + 1) + 32<br />
    h = 416 if h &gt; 416<br />
    x = 0<br />
    x = 456 if &#36;game_player.screen_x &lt; 200 + Window_RingMenu::RING_R<br />
    super(x, 64, 184, h)<br />
    self.contents = Bitmap.new(width - 32, &#36;game_party.actors.size * 32)<br />
    refresh<br />
    self.active = false<br />
    self.index = -1<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Refresh<br />
  #--------------------------------------------------------------------------<br />
  def refresh<br />
    self.contents.clear<br />
    @item_max = &#36;game_party.actors.size<br />
    for i in 0...&#36;game_party.actors.size<br />
      x = 32<br />
      y = 32 * i<br />
      actor = &#36;game_party.actors[i]<br />
      self.contents.draw_facesquare(actor.character_name, actor.character_hue,<br />
                                    4, y + 4 )<br />
      draw_actor_name(actor, x, y)<br />
    end<br />
  end<br />
end<br />
#==============================================================================<br />
# ■ Scene_Menu<br />
#------------------------------------------------------------------------------<br />
# 　This class performs menu screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Menu<br />
  #--------------------------------------------------------------------------<br />
  # ● Object Initialization<br />
  #   &nbsp;&nbsp;menu_index : command cursor's initial position<br />
  #--------------------------------------------------------------------------<br />
  def initialize(menu_index = 0)<br />
    @menu_index = menu_index<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Main Processing<br />
  #--------------------------------------------------------------------------<br />
  def main<br />
    # Make spriteset<br />
    @spriteset = Spriteset_Map.new<br />
    # Make command window<br />
    bmp = RPG::Cache.character(&#36;game_party.actors[0].character_name, 0)<br />
    px = &#36;game_player.screen_x<br />
    py = &#36;game_player.screen_y - bmp.rect.height / 4 / 2<br />
    @command_window = Window_RingMenu.new(px,py)<br />
    @command_window.index = @menu_index<br />
    # If number of party members is 0<br />
    if &#36;game_party.actors.size == 0<br />
      # Disable items, skills, equipment, and status<br />
      @command_window.disable_item(0)<br />
      @command_window.disable_item(1)<br />
      @command_window.disable_item(2)<br />
      @command_window.disable_item(3)<br />
    end<br />
    @command_window.z = 100<br />
    # If save is forbidden<br />
    if &#36;game_system.save_disabled<br />
      # Disable save<br />
      @command_window.disable_item(4)<br />
    end<br />
    # Make status window<br />
    @status_window = Window_RingMenuStatus.new<br />
    @status_window.z = 200<br />
    @status_window.visible = false<br />
    # Make help window<br />
    @help_window = Window_Help.new<br />
    @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
    # Execute transition<br />
    Graphics.transition<br />
    # Main loop<br />
    loop do<br />
      # Update game screen<br />
      Graphics.update<br />
      # Update input information<br />
      Input.update<br />
      # Frame update<br />
      update<br />
      # Abort loop if screen is changed<br />
      if &#36;scene != self<br />
        break<br />
      end<br />
    end<br />
    # Prepare for transition<br />
    Graphics.freeze<br />
    # Dispose of spriteset<br />
    @spriteset.dispose<br />
    # Dispose of windows<br />
    @command_window.dispose<br />
    @status_window.dispose<br />
    @help_window.dispose<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Frame Update<br />
  #--------------------------------------------------------------------------<br />
  def update<br />
    # Update windows<br />
    @command_window.update<br />
    @status_window.update<br />
    @help_window.update<br />
    # If command window is active: call update_command<br />
    if @command_window.active<br />
      update_command<br />
      return<br />
    end<br />
    # If status window is active: call update_status<br />
    if @status_window.active<br />
      update_status<br />
      return<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Frame Update (when command window is active)<br />
  #--------------------------------------------------------------------------<br />
  def update_command<br />
    # If B button was pressed<br />
    if Input.trigger?(Input::B)<br />
      # Play cancel SE<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      # Switch to map screen<br />
      &#36;scene = Scene_Map.new<br />
      return<br />
    end<br />
    # If C button was pressed<br />
    if Input.trigger?(Input::C)<br />
      # If command other than save or end game, and party members = 0<br />
      if &#36;game_party.actors.size == 0 and @command_window.index &lt; 4<br />
        # Play buzzer SE<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      # Branch by command window cursor position<br />
      case @command_window.index<br />
      when 0  # item<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to item screen<br />
        &#36;scene = Scene_Item.new<br />
      when 1  # skill<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Make status window active<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 2  # equipment<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Make status window active<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 3  # status<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Make status window active<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 4  # save<br />
        # If saving is forbidden<br />
        if &#36;game_system.save_disabled<br />
          # Play buzzer SE<br />
          &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
          return<br />
        end<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to save screen<br />
        &#36;scene = Scene_Save.new<br />
      when 5  # Game Over<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to end game screen<br />
        &#36;scene = Scene_End.new<br />
      end<br />
      return<br />
    end<br />
    # Do not process the cursor while an animation is in progress.<br />
    return if @command_window.animation?<br />
    # ↑or← ボタンが押された場合<br />
    if Input.press?(Input::UP) or  Input.press?(Input::LEFT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)<br />
      @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
      return<br />
    end<br />
    # If the ↓ or → button is pressed<br />
    if Input.press?(Input::DOWN) or  Input.press?(Input::RIGHT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @command_window.setup_move_move(Window_RingMenu::MODE_MOVER)<br />
      @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
      return<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Frame Update (when status window is active)<br />
  #--------------------------------------------------------------------------<br />
  def update_status<br />
    # If B button was pressed<br />
    if Input.trigger?(Input::B)<br />
      # Play cancel SE<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      # Make command window active<br />
      @command_window.active = true<br />
      @status_window.active = false<br />
      @status_window.visible = false<br />
      @status_window.index = -1<br />
      return<br />
    end<br />
    # If C button was pressed<br />
    if Input.trigger?(Input::C)<br />
      # Branch by command window cursor position<br />
      case @command_window.index<br />
      when 1  # skill<br />
        # If this actor's action limit is 2 or more<br />
        if &#36;game_party.actors[@status_window.index].restriction &gt;= 2<br />
          # Play buzzer SE<br />
          &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
          return<br />
        end<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to skill screen<br />
        &#36;scene = Scene_Skill.new(@status_window.index)<br />
      when 2  # equipment<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to equipment screen<br />
        &#36;scene = Scene_Equip.new(@status_window.index)<br />
      when 3  # status<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to status screen<br />
        &#36;scene = Scene_Status.new(@status_window.index)<br />
      end<br />
      return<br />
    end<br />
  end<br />
end<br />
#==============================================================================<br />
# ◇ External Libraries<br />
#==============================================================================<br />
class Bitmap<br />
# ▼▲▼ XRXL 1. Line and Shape Drawing ▼▲▼<br />
  #--------------------------------------------------------------------------<br />
  # ● Line drawing by Ouga Zaitou<br />
  #--------------------------------------------------------------------------<br />
  def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)<br />
    # Calculation of rendering distance. A generous estimate for the length at a right angle.<br />
    distance = (start_x - end_x).abs + (start_y - end_y).abs<br />
    # Start drawing<br />
    if end_color == start_color<br />
      for i in 1..distance<br />
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i<br />
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i<br />
        if width == 1<br />
          self.set_pixel(x, y, start_color) <br />
        else<br />
          self.fill_rect(x, y, width, width, start_color) <br />
        end<br />
      end<br />
    else<br />
      for i in 1..distance<br />
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i<br />
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i<br />
        r = start_color.red &nbsp;&nbsp;* (distance-i)/distance + end_color.red &nbsp;&nbsp;* i/distance<br />
        g = start_color.green * (distance-i)/distance + end_color.green * i/distance<br />
        b = start_color.blue  * (distance-i)/distance + end_color.blue  * i/distance<br />
        a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance<br />
        if width == 1<br />
          self.set_pixel(x, y, Color.new(r, g, b, a))<br />
        else<br />
          self.fill_rect(x, y, width, width, Color.new(r, g, b, a)) <br />
        end<br />
      end<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Drawing a Polygon (Unfilled) by Kazuki<br />
  #    peaks    : Array of vertex coordinates [[x1,y1],[x2,y2],[x3,y3], ... ]<br />
  #    color    : Line Color<br />
  #    width    : Line width<br />
  #--------------------------------------------------------------------------<br />
  def draw_polygon(peaks, color, width = 1)<br />
    # Draw a number of edges equal to the number of edges (or vertices).<br />
    for i in 0 ... (peaks.size - 1)<br />
      # Connect the vertices with lines.<br />
      draw_line( peaks[i][0], peaks[i][1], peaks[i+1][0], peaks[i+1][1], color, width )<br />
    end<br />
    # Connect the last vertex to the first vertex.<br />
    draw_line( peaks[peaks.size - 1][0], peaks[peaks.size - 1][1], peaks[0][0], peaks[0][1], color, width )<br />
  end<br />
# ▼▲▼ XRXL 2. Bitmap/Icon Rendering ▼▲▼<br />
  #--------------------------------------------------------------------------<br />
  # ● Face and frame drawing by Ouga Zaitou<br />
  #   &nbsp;&nbsp;character_name : Character Graphics Used for Depiction<br />
  #   &nbsp;&nbsp;character_hue  : The Hue of the Character<br />
  #   &nbsp;&nbsp;x     &nbsp;&nbsp;: Drawing Destination X-Coordinate<br />
  #   &nbsp;&nbsp;y     &nbsp;&nbsp;: Drawing Destination Y-Coordinate<br />
  #--------------------------------------------------------------------------<br />
  def draw_facesquare(character_name, character_hue, x, y, size = 24)<br />
    bitmap = RPG::Cache.character(character_name, character_hue)<br />
    src_rect = Rect.new((bitmap.width/4 - size)/2, 0, size, size)<br />
    self.blt(x, y, bitmap, src_rect)<br />
    self.draw_polygon([[x,y],[x+size,y],[x+size,y+size],[x,y+size]], Color.new(255,255,255,128))<br />
  end<br />
end</code></div></div></div>
		</div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
From the translation:<ul class="mycode_list"><li>Please install "XRXL 2. Bitmap/Icon Rendering" beforehand.<br />
</li>
<li>Copy this script into a new section created above the Main section.<br />
</li>
<li>Inside the double quotas (`""`) of the sevenRPG::Cache.icon("") entries located at the top of `Window_RingMenu, enter the icon for each command.<ul class="mycode_list"><li>Follow as they are described in the comments to the right.<br />
</li>
<li>The "Disabled" icon at the bottom is an icon that overlays atop the menu icons that cannot be selected. Recommended is something like: φ<br />
</li>
</ul>
</li>
<li>Inside the "" of the TSE_STARTUP value, place the sound effect that you want to sound when the menu opens<br />
</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
Code courtesy of Kazuki, the creator of the XRXS script.<br />
Line Drawing and Face and frame drawing by Ouga Zaitou]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[MUSIC EFFECT FADE  (A small Scriptette)]]></title>
			<link>https://www.save-point.org/thread-13490.html</link>
			<pubDate>Fri, 29 May 2026 13:56:51 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13490.html</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">MUSIC EFFECT FADE</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.0</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This simple scriptette takes advantage of a feature built into RPGMaker's built-in Audio module,  and allows you to  fade out music events  in much the same way as you could background music and ambient sound effects.<br />
<br />
Indeed, no alteration was made to the Audio class.  However, this feature has always  been available  despite no method  defined for it  within the Game_System class nor any map event akin to [Fade Out BGM] or the like.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> I can't believe EnterBrain neglected to include THIS</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#==============================================================================<br />
# ** MUSIC EFFECT FADE<br />
#------------------------------------------------------------------------------<br />
#    by DerVVulfman<br />
#    version 1.0<br />
#    05-29-2026 (mm/dd/yyyy)<br />
#    RGSS / RPGMaker XP<br />
#==============================================================================<br />
#<br />
#  INTRODUCTION:<br />
#<br />
#  This simple scriptette takes advantage of a feature built into RPGMaker's<br />
#  built-in Audio module,  and allows you to  fade out music events  in much<br />
#  the same way as you could background music and ambient sound effects.<br />
#<br />
#  Indeed, no alteration was made to the Audio class.  However, this feature<br />
#  has always  been available  despite no method  defined for it  within the<br />
#  Game_System class nor any map event akin to [Fade Out BGM] or the like.<br />
#<br />
#  To use upon an already playing ME/Music Event, run either script call:<br />
#<br />
#        * &#36;game_system.me_fade(time)<br />
#        * me_fade(time)<br />
#          - time : duration in seconds<br />
#<br />
#        EX: &#36;game_system.me_fade(0.5)<br />
#          - Fades out the currently playing ME in 1/2 a second<br />
#<br />
#  This is to be executed after music events are already playing, and inten-<br />
#  def for music events that are considered longer than normal.  Such longer<br />
#  music events would be akin to victory music from a Final Fantasy game.<br />
#<br />
#==============================================================================<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Game_System<br />
#------------------------------------------------------------------------------<br />
#  This class handles data surrounding the system. Backround music, etc.<br />
#  is managed here as well. Refer to "&#36;game_system" for the instance of <br />
#  this class.<br />
#==============================================================================<br />
<br />
class Game_System<br />
<br />
  #--------------------------------------------------------------------------<br />
  # * Fade Out Music Effect<br />
  #   &nbsp;&nbsp;time : fade-out time (in seconds)<br />
  #--------------------------------------------------------------------------<br />
  def me_fade(time)<br />
    Audio.me_fade(time * 1000)<br />
  end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Interpreter<br />
#------------------------------------------------------------------------------<br />
#  This interpreter runs event commands. This class is used within the<br />
#  Game_System class and the Game_Event class.<br />
#==============================================================================<br />
<br />
class Interpreter<br />
<br />
  #--------------------------------------------------------------------------<br />
  # * Fade Out Music Effect<br />
  #   &nbsp;&nbsp;time : fade-out time (in seconds)<br />
  #--------------------------------------------------------------------------<br />
  def me_fade(time)<br />
    &#36;game_system.me_fade(time)<br />
  end<br />
<br />
end</code></div></div></div>
		</div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Just paste this below Scene_Debug and above Main.  And use either script command noted in the script to fade out the music event effect.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
ABSOLUTELY NO INCOMPATABILITIES!  I don't think anyone noticed this.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Author's Notes</span></span><br />
<br />
<span style="color: #B20080;" class="mycode_color"><span style="font-family: Comic Sans MS;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b">WHY HAD NO ONE NOTICED THIS!?!?</span></span></span>  <img src="https://www.save-point.org/images/smilies/ejlol/Thud.gif" alt="Head-desk Thud" title="Head-desk Thud" class="smilie smilie_56" /> <br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Yell at Enterbrainless for not including this in the base system even though I did no alteration to the Audio class itself.  THEY HAD THIS FEATURE POSSIBLE ALL THESE YEARS!!!]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">MUSIC EFFECT FADE</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.0</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This simple scriptette takes advantage of a feature built into RPGMaker's built-in Audio module,  and allows you to  fade out music events  in much the same way as you could background music and ambient sound effects.<br />
<br />
Indeed, no alteration was made to the Audio class.  However, this feature has always  been available  despite no method  defined for it  within the Game_System class nor any map event akin to [Fade Out BGM] or the like.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> I can't believe EnterBrain neglected to include THIS</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#==============================================================================<br />
# ** MUSIC EFFECT FADE<br />
#------------------------------------------------------------------------------<br />
#    by DerVVulfman<br />
#    version 1.0<br />
#    05-29-2026 (mm/dd/yyyy)<br />
#    RGSS / RPGMaker XP<br />
#==============================================================================<br />
#<br />
#  INTRODUCTION:<br />
#<br />
#  This simple scriptette takes advantage of a feature built into RPGMaker's<br />
#  built-in Audio module,  and allows you to  fade out music events  in much<br />
#  the same way as you could background music and ambient sound effects.<br />
#<br />
#  Indeed, no alteration was made to the Audio class.  However, this feature<br />
#  has always  been available  despite no method  defined for it  within the<br />
#  Game_System class nor any map event akin to [Fade Out BGM] or the like.<br />
#<br />
#  To use upon an already playing ME/Music Event, run either script call:<br />
#<br />
#        * &#36;game_system.me_fade(time)<br />
#        * me_fade(time)<br />
#          - time : duration in seconds<br />
#<br />
#        EX: &#36;game_system.me_fade(0.5)<br />
#          - Fades out the currently playing ME in 1/2 a second<br />
#<br />
#  This is to be executed after music events are already playing, and inten-<br />
#  def for music events that are considered longer than normal.  Such longer<br />
#  music events would be akin to victory music from a Final Fantasy game.<br />
#<br />
#==============================================================================<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Game_System<br />
#------------------------------------------------------------------------------<br />
#  This class handles data surrounding the system. Backround music, etc.<br />
#  is managed here as well. Refer to "&#36;game_system" for the instance of <br />
#  this class.<br />
#==============================================================================<br />
<br />
class Game_System<br />
<br />
  #--------------------------------------------------------------------------<br />
  # * Fade Out Music Effect<br />
  #   &nbsp;&nbsp;time : fade-out time (in seconds)<br />
  #--------------------------------------------------------------------------<br />
  def me_fade(time)<br />
    Audio.me_fade(time * 1000)<br />
  end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Interpreter<br />
#------------------------------------------------------------------------------<br />
#  This interpreter runs event commands. This class is used within the<br />
#  Game_System class and the Game_Event class.<br />
#==============================================================================<br />
<br />
class Interpreter<br />
<br />
  #--------------------------------------------------------------------------<br />
  # * Fade Out Music Effect<br />
  #   &nbsp;&nbsp;time : fade-out time (in seconds)<br />
  #--------------------------------------------------------------------------<br />
  def me_fade(time)<br />
    &#36;game_system.me_fade(time)<br />
  end<br />
<br />
end</code></div></div></div>
		</div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Just paste this below Scene_Debug and above Main.  And use either script command noted in the script to fade out the music event effect.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
ABSOLUTELY NO INCOMPATABILITIES!  I don't think anyone noticed this.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Author's Notes</span></span><br />
<br />
<span style="color: #B20080;" class="mycode_color"><span style="font-family: Comic Sans MS;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b">WHY HAD NO ONE NOTICED THIS!?!?</span></span></span>  <img src="https://www.save-point.org/images/smilies/ejlol/Thud.gif" alt="Head-desk Thud" title="Head-desk Thud" class="smilie smilie_56" /> <br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Yell at Enterbrainless for not including this in the base system even though I did no alteration to the Audio class itself.  THEY HAD THIS FEATURE POSSIBLE ALL THESE YEARS!!!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Reserve Party Tools]]></title>
			<link>https://www.save-point.org/thread-13488.html</link>
			<pubDate>Wed, 27 May 2026 18:01:15 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13488.html</guid>
			<description><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Reserve Party Tools</span></span><br />
<span style="font-size: medium;" class="mycode_size">Original Version by RPG Advocate 4/12/2005<br />
Edit and repairs by DerVVulfman</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This script enables support  for a "reserve" party of arbitrary size.  These characters don't fight in battle.  You are able to remove party members  and place them within the reserves by use of a new menu designed in the system. And adding new party members (with "Change Party Member") while the party is full will add them to the reserves.<br />
<br />
The original version required rewrites everywhere and expected the end-user to perform direct edits to the default scripts.  This version fixes some errors and oversights . And while still containing some direct alterations of default scripts, has those edited areas clearly marked for reference.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> The Script</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;"><div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#==============================================================================<br />
# Reserve Party Tools<br />
#------------------------------------------------------------------------------<br />
# by RPG Advocate 4/12/2005<br />
# Edit and repairs by DerVVulfman 6/27/2026<br />
# RGSS / RPGMaker XP<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# THE RESERVE PARTY MENU<br />
#<br />
# This script enables support&nbsp;&nbsp;for a "reserve" party of arbitrary size.&nbsp;&nbsp;These<br />
# characters don't fight in battle. If you want to give the player the ability<br />
# to switch characters between the party and reserve party,&nbsp;&nbsp;use either script<br />
# call shown below:<br />
#<br />
# *&nbsp;&nbsp;&#36;scene = Scene_PartyChange.new(value)<br />
# *&nbsp;&nbsp;change_party(value)<br />
#<br />
# The 'value' represents&nbsp;&nbsp;the maximun number of members you want in the party,<br />
# and can be left empty if using the default party size of '4'. You may set it<br />
# the range from 0-4, with 0 indicating full default party size of '4'. Values<br />
# beyond that range are invalid.<br />
#<br />
# *&nbsp;&nbsp;&#36;scene = Scene_PartyChange.new<br />
# *&nbsp;&nbsp;change_party<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# RESERVIST BATTLE EXPERIENCE<br />
#<br />
# By default, inactive party members gain experience at the same rate as active<br />
# members. To change this,&nbsp;&nbsp;edit the EXP_PERCENT constant&nbsp;&nbsp;in the RPGAdvReserve<br />
# module to the percentage of experience you want the inactive party to gain.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# REQUIRED / PERMANENT PARTY MEMBERS<br />
#<br />
# This script supports required party members, actors that have been classified<br />
# as necessary within the party&nbsp;&nbsp;and cannot be removed.&nbsp;&nbsp;To make a party member<br />
# required or remove its required status, you may use either script calls:<br />
#<br />
# *&nbsp;&nbsp;&#36;game_party.actors[actor_id].required = true/false<br />
# *&nbsp;&nbsp;required_actor(actor_id, true/false)<br />
#<br />
# Both calls requests you&nbsp;&nbsp;to set a value of true,&nbsp;&nbsp;or false in order to remove<br />
# the required status.&nbsp;&nbsp;And within the Change Member menu,&nbsp;&nbsp;these party members<br />
# will appear with a predefined color in their names, default to Goldenrod.<br />
#<br />
# You should only make a character already in the party required. <br />
#<br />
# Making a reserve member 'required' will not work.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# CHANGING PARTY MEMBERS<br />
#<br />
# This script changes how the "Change Party Members" event command works.<br />
#<br />
# If you try to add a charater to the party when the party is full, that char-<br />
# acter will automatically be added to the reserve party.&nbsp;&nbsp;And if you remove a<br />
# party member, that character will be removed if they are in either the party<br />
# or the reserve party. However, it only recognizes a 4-party system when this<br />
# is applied, and does not recognize alternate party sizes.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# SCRIPT CALLS<br />
#<br />
# Initially,&nbsp;&nbsp;the only script calls noted were lenghty&nbsp;&nbsp;and direct commands to<br />
# the Game_Party class&nbsp;&nbsp;or direct calls&nbsp;&nbsp;to &#36;scene itself.&nbsp;&nbsp;Other script calls<br />
# were possible but not given. Here, we view all relevant script calls showing<br />
# both original and newer quick commands found in the Interpreter class:<br />
#<br />
#&nbsp;&nbsp; The Menu Command<br />
#&nbsp;&nbsp; ----------------<br />
#&nbsp;&nbsp; Used to bring up the actual Party/Reservist changing menu<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;scene = Scene_ChangeParty.new(max_size)<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;change_party(max_size)<br />
#<br />
#&nbsp;&nbsp; Set Actor Required Status<br />
#&nbsp;&nbsp; -------------------------<br />
#&nbsp;&nbsp; Used to define an in-party&nbsp;&nbsp;(not a reservist member)&nbsp;&nbsp;as a fixed member of<br />
#&nbsp;&nbsp; the current party.&nbsp;&nbsp;The 'actor_id' value is from the database ID.&nbsp;&nbsp;And the<br />
#&nbsp;&nbsp; 'flag' value is either true or false.<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;game_party.actors[actor_id].required = flag<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;required_actor(actor_id, flag)<br />
#<br />
#&nbsp;&nbsp; Swap Actors by database ID<br />
#&nbsp;&nbsp; --------------------------<br />
#&nbsp;&nbsp; Assuming there is a system&nbsp;&nbsp;tracking what actors&nbsp;&nbsp;(by database ID)&nbsp;&nbsp;are in<br />
#&nbsp;&nbsp; both the party and reserve party, this command lets you exchange one actor<br />
#&nbsp;&nbsp; from the party with one from the reserves.<br />
#&nbsp;&nbsp; IT DOES NOT RECOGNIZE THE 'REQUIRED" ACTOR STATUS<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;game_party.swap_by_id(party_actor_id, reserve_actor_id)<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;swap_by_id(party_actor_id, reserve_actor_id)<br />
#<br />
#&nbsp;&nbsp; Transfer Reservist to the Party by ID<br />
#&nbsp;&nbsp; -------------------------------------<br />
#&nbsp;&nbsp; Assuming there is a system&nbsp;&nbsp;tracking what actors&nbsp;&nbsp;(by database ID)&nbsp;&nbsp;are in<br />
#&nbsp;&nbsp; the reserve party, this command lets you remove the actor from the reserve<br />
#&nbsp;&nbsp; party and places it into the main/active party.<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;game_party.transfer_to_party_by_id(reserve_actor_id)<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;transfer_to_party_by_id(reserve_actor_id)<br />
#<br />
#&nbsp;&nbsp; Transfer Party Member to the Reserves by ID<br />
#&nbsp;&nbsp; -------------------------------------------<br />
#&nbsp;&nbsp; Assuming there is a system&nbsp;&nbsp;tracking what actors&nbsp;&nbsp;(by database ID)&nbsp;&nbsp;are in<br />
#&nbsp;&nbsp; main/active party,&nbsp;&nbsp;this command lets you remove the actor&nbsp;&nbsp;from the party<br />
#&nbsp;&nbsp; and places it into the reserves.<br />
#&nbsp;&nbsp; IT DOES NOT RECOGNIZE THE 'REQUIRED" ACTOR STATUS<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;game_party.transfer_to_reserve_by_id(party_actor_id)<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;transfer_to_reserve_by_id(party_actor_id)<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# CHANGES FROM THE ORIGINAL<br />
#<br />
# This revision creates an RPGAdvReserve module where configuration values are<br />
# found.&nbsp;&nbsp;Originally, the script had only two values to adjust, but these were<br />
# actively situated&nbsp;&nbsp;within the script itself.&nbsp;&nbsp;And this would&nbsp;&nbsp;require you to<br />
# navigate through the script to find those values. The creation of the module<br />
# should make it easier to define what settings are desired.<br />
#<br />
# The system had values that were hardwired into the original script, be these<br />
# the color settings for Required Actor displays&nbsp;&nbsp;or the descriptive texts and<br />
# warning notices within.&nbsp;&nbsp;These have also been&nbsp;&nbsp;migrated to the configuration<br />
# section so you have no need to search within the scripts.<br />
#<br />
# Repairs had to be performed.&nbsp;&nbsp;You could previously exit&nbsp;&nbsp;the above described<br />
# Party Changing menu&nbsp;&nbsp;with a party containing no members at all.&nbsp;&nbsp;This effec-<br />
# tively would prevent&nbsp;&nbsp;the game to continue.&nbsp;&nbsp;The configuration section has a<br />
# switch to permit this, but not recommended.<br />
#<br />
# Likewise, there were issues&nbsp;&nbsp;with identifying required and reservist members<br />
# in the change party menu. RPG Advorate indeed created the Goldenrod Required<br />
# member color, but never applied its use in the menu. This has been corrected<br />
# while also creating a like color for reserve members appearing in the menus.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# COMPATABILITY / SCRIPT ATTACHED CODE AND REWRITES<br />
#<br />
# This script, when initially released, was not designed to paste the contents<br />
# in place,&nbsp;&nbsp;but instead instructed you&nbsp;&nbsp;to directly edit the default scripts.<br />
# At the time of release,&nbsp;&nbsp;there was little knowledge&nbsp;&nbsp;of the 'alias' property<br />
# which would allow the insertion of new code into methods. And this rework of<br />
# his script takes advantage of the alias technique where it was possible.<br />
# the default scripts. It was not released as a script to insert into <br />
#<br />
# Not all sections were able to benefit of the alias technique,&nbsp;&nbsp;those methods<br />
# still requiring their code rewritten/overwritten. However, said methods have<br />
# the rewritten sections identified.<br />
#<br />
# New Script Content:<br />
#&nbsp;&nbsp;* RPGAdvReserve&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: (New) Used to hold configuration values<br />
#&nbsp;&nbsp;* Game_Party&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : (Used by ChangeParty) Methods made to swap members<br />
#&nbsp;&nbsp;* Window_Base&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: (Used by ChangeParty) Makes color identified names<br />
#&nbsp;&nbsp;* Window_ChangeMain&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: (Used by ChangeParty) Draws the current party<br />
#&nbsp;&nbsp;* Window_ChangeReserve&nbsp;&nbsp; : (Used by ChangeParty) Draws the reserve party<br />
#&nbsp;&nbsp;* Window_PartyChangeInfo : (Used by ChangeParty) Draws recommended party size<br />
#&nbsp;&nbsp;* Interpreter&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: Shortcut script calls made for the system<br />
#&nbsp;&nbsp;* Scene_ChangeParty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: Engine that switches party and reservists around<br />
#<br />
# Aliased Script Content:<br />
#&nbsp;&nbsp;* Game_Actor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Adds the required member status variable<br />
#&nbsp;&nbsp;* Game_Party&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Makes the reserve array &amp; alters add/remove member<br />
#<br />
# Rewritten Script Content:<br />
#&nbsp;&nbsp;* Scene_Menu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : update_status edited for reservist restrictions<br />
#&nbsp;&nbsp;* Scene_Skill&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: main method altered to allow access to reserves<br />
#&nbsp;&nbsp;* Scene_Equip&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: main method altered to allow access to reserves<br />
#&nbsp;&nbsp;* Scene_Battle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : start_phase5 altered to allow reserve EXP gains<br />
#<br />
# All scripts that are rewrites of the default scripts have their new code in<br />
# defined areas&nbsp;&nbsp;beginning with&nbsp;&nbsp;either "Beginning of Replaced Code"&nbsp;&nbsp;or with<br />
# "Beginning of Inserted Code",&nbsp;&nbsp;and ending&nbsp;&nbsp;with a like commented statement.<br />
# In many cases, the original code is still available,&nbsp;&nbsp;but commented out for<br />
# end-user recognition.<br />
#<br />
#<br />
#==============================================================================<br />
<br />
<br />
<br />
module RPGAdvReserve<br />
<br />
<br />
&nbsp;&nbsp;# FEATURE SETTINGS<br />
&nbsp;&nbsp;# =======================================================================<br />
<br />
&nbsp;&nbsp;# If Reserve members appear in the menu status screen.<br />
&nbsp;&nbsp;&nbsp;&nbsp;MENU_STATUS = true<br />
<br />
&nbsp;&nbsp;# The percent of Exp reserve members get compared to active.<br />
&nbsp;&nbsp;&nbsp;&nbsp;EXP_PERCENT = 100<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;# (NEW) Allow party to be emptied by Party Changer (not recommended)<br />
&nbsp;&nbsp;# Original did not have a block to prevent emptying ... what a flaw!<br />
&nbsp;&nbsp;&nbsp;&nbsp;PERMIT_EMPTY = true<br />
<br />
<br />
&nbsp;&nbsp;# COLOR SETTINGS<br />
&nbsp;&nbsp;# =======================================================================<br />
<br />
&nbsp;&nbsp;# Color of actor name when required to be in party.<br />
&nbsp;&nbsp;# Default 216,150,20,255:&nbsp;&nbsp;Goldenrod<br />
&nbsp;&nbsp;&nbsp;&nbsp;COLOR_REQUIRED = Color.new(216, 150, 20, 255)<br />
<br />
&nbsp;&nbsp;# Color of actor name in menu status if a reserve member.<br />
&nbsp;&nbsp;# Default 152, 181, 100, 255:&nbsp;&nbsp;Olive<br />
&nbsp;&nbsp;&nbsp;&nbsp;COLOR_RESERVIST = Color.new(152, 181, 100, 255)<br />
<br />
<br />
&nbsp;&nbsp;# ACTOR WARNING MESSAGES<br />
&nbsp;&nbsp;# =======================================================================<br />
&nbsp;&nbsp;# A carte-blanch error if actor IDs values given are invalid<br />
&nbsp;&nbsp;&nbsp;&nbsp;ID_INVALID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "ID given is invalid."<br />
&nbsp;&nbsp;# Define the text used to show at least one invalid party or reservist ID.<br />
&nbsp;&nbsp;&nbsp;&nbsp;SWAP_Invalid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "Cannot swap members. One or both are invalid."<br />
&nbsp;&nbsp;# Define the text used to show the actor ID is not in the reservist party.<br />
&nbsp;&nbsp;&nbsp;&nbsp;TO_PARTY_Invalid&nbsp;&nbsp;&nbsp;&nbsp;= "Warning: Character is not in the reserve party."<br />
&nbsp;&nbsp;# Define the text used to show the party is full.<br />
&nbsp;&nbsp;&nbsp;&nbsp;TO_PARTY_Full&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "Warning: Main party is full."<br />
&nbsp;&nbsp;# Define the text used to show the actor ID is not in the current party.<br />
&nbsp;&nbsp;&nbsp;&nbsp;TO_RESERVE_Invalid&nbsp;&nbsp;= "Warning: Character is not in the main party."<br />
<br />
<br />
&nbsp;&nbsp;# PARTY CHANGER MESSAGES<br />
&nbsp;&nbsp;# =======================================================================<br />
<br />
&nbsp;&nbsp;# Single-line text used to request a party be formed to default.<br />
&nbsp;&nbsp;&nbsp;&nbsp;INFO_Request1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "Please form a party."<br />
&nbsp;&nbsp;# Dual-line text used to request a custom sized party. Must include {size}.<br />
&nbsp;&nbsp;&nbsp;&nbsp;INFO_Request2a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "Please form a party"<br />
&nbsp;&nbsp;&nbsp;&nbsp;INFO_Request2b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "of up to {size} members."<br />
&nbsp;&nbsp;# Warning to note max size setting is invalid.<br />
&nbsp;&nbsp;&nbsp;&nbsp;SIZE_Invalid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "Warning: Invalid max size for party."<br />
&nbsp;&nbsp;# Text used to indicate empty position in party<br />
&nbsp;&nbsp;&nbsp;&nbsp;EMPTY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "- Empty -"<br />
&nbsp;&nbsp;&nbsp;&nbsp;DISALLOWED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "- Disallowed -"<br />
<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Game_Actor<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class handles the actor. It's used within the Game_Actors class<br />
#&nbsp;&nbsp;(&#36;game_actors) and refers to the Game_Party class (&#36;game_party).<br />
#==============================================================================<br />
<br />
class Game_Actor &lt; Game_Battler<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Public Instance Variables<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;attr_accessor :required&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # required party member flag<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Alias Listings<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias rpgadv_reserve_g_actor_setup setup<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Setup<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def setup(actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;rpgadv_reserve_g_actor_setup(actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;@required = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add the additional flag<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
#==============================================================================<br />
# ** Game_Party<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class handles the party. It includes information on amount of gold<br />
#&nbsp;&nbsp;and items. Refer to "&#36;game_party" for the instance of this class.<br />
#==============================================================================<br />
<br />
class Game_Party<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Public Instance Variables<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;attr_accessor :reserve_actors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # reserve actors array<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Alias Listings<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias rpgadv_reserve_g_party_init initialize<br />
&nbsp;&nbsp;alias rpgadv_reserve_g_party_setup_add add_actor<br />
&nbsp;&nbsp;alias rpgadv_reserve_g_party_setup_remove remove_actor<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;rpgadv_reserve_g_party_init&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors = []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add the additional array<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Add an Actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def add_actor(actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_actors[actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get actor&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @actors.size &gt;= 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If the party is full<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if not @actors.include?(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If actor not in party&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if not @reserve_actors.include?(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If actor not in reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.push(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add actor to reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;rpgadv_reserve_g_party_setup_add(actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Remove Actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def remove_actor(actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.delete(&#36;game_actors[actor_id])&nbsp;&nbsp;# Delete actor from reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;rpgadv_reserve_g_party_setup_remove(actor_id)&nbsp;&nbsp; # Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Swap Actors<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor1 : actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor2 : actor<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def swap(actor1, actor2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;error = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set no error<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if not @actors.include?(actor1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If actor1 not in party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set error <br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if not @reserve_actors.include?(actor2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If actor2 not in reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set error <br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if error&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If in error<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::SWAP_Invalid)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Display error message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.push(actor1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add party actor to reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;@actors.delete(actor1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Delete actor from party<br />
&nbsp;&nbsp;&nbsp;&nbsp;add_actor(actor2.id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add reserve actor to party<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.delete(actor2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Delete from reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Party<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor : actor<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_party(actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if not @reserve_actors.include?(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If actor not in reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::TO_PARTY_Invalid)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Display error message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @actors.size == 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If party is full<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::TO_PARTY_Full)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Display error message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;add_actor(actor.id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add reservist to party<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.delete(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Delete from reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Reserve<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor : actor<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_reserve(actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if not @actors.include?(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If actor not in party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::TO_RESERVE_Invalid)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Display error message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;remove_actor(actor.id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Delete actor from party<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.push(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add party actor to reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Swap Actors by ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; party_actor_id&nbsp;&nbsp; : actor ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; reserve_actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def swap_by_id(party_actor_id, reserve_actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless valid_id?(party_actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid actor ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless valid_id?(reserve_actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid reserve ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor1 = &#36;game_actors[party_actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get party member actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor2 = &#36;game_actors[reserve_actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get reserve member actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;swap(actor1, actor2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Swap the actors<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Party by ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; reserve_actor : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_party_by_id(reserve_actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless valid_id?(reserve_actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid reserve ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_actors[reserve_actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get reserve member actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;transfer_to_party(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer actor to party<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Reserve by ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; main_party_actor : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_reserve_by_id(party_actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless valid_id?(party_actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid actor ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_actors[party_actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get party member actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;transfer_to_reserve(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer actor to reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Test for valid values above 0<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def valid_id?(actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;test = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume passes<br />
&nbsp;&nbsp;&nbsp;&nbsp;test = false if actor_id.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Fail if nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;test = false unless actor_id.is_a?(Numeric)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Fail if not numeric<br />
&nbsp;&nbsp;&nbsp;&nbsp;test = false if actor_id &lt;= 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid value<br />
&nbsp;&nbsp;&nbsp;&nbsp;return true&nbsp;&nbsp;if test&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit true if passes<br />
&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::ID_INVALID)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Render ID alert<br />
&nbsp;&nbsp;&nbsp;&nbsp;return false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit method false<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_Base<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class is for all in-game windows.<br />
#==============================================================================<br />
<br />
class Window_Base &lt; Window<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Required Color (Goldenrod)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def required_color<br />
&nbsp;&nbsp;&nbsp;&nbsp;return RPGAdvReserve::COLOR_REQUIRED<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Required Color (Olive)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def reservist_color<br />
&nbsp;&nbsp;&nbsp;&nbsp;return RPGAdvReserve::COLOR_RESERVIST<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Draw Required Name<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor : actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp; : draw spot x-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; y&nbsp;&nbsp;&nbsp;&nbsp; : draw spot y-coordinate<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def draw_actor_required(actor, x, y)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.font.color = required_color<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(x, y, 120, 32, actor.name)<br />
&nbsp;&nbsp;end&nbsp;&nbsp;<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Draw Reservist Name<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor : actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp; : draw spot x-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; y&nbsp;&nbsp;&nbsp;&nbsp; : draw spot y-coordinate<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def draw_actor_reservist(actor, x, y)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.font.color = reservist_color<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(x, y, 120, 32, actor.name)<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_MenuStatus<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window displays party member status on the menu screen.<br />
#==============================================================================<br />
<br />
class Window_MenuStatus &lt; Window_Selectable<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.dispose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Erase contents at start<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_max = &#36;game_party.actors.size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set max size by party<br />
&nbsp;&nbsp;&nbsp;&nbsp;if RPGAdvReserve::MENU_STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If Switch engaged&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@item_max += &#36;game_party.reserve_actors.size&nbsp;&nbsp;&nbsp;&nbsp;# Add reserves to size<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;&nbsp;&nbsp;= width - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set width<br />
&nbsp;&nbsp;&nbsp;&nbsp;ht&nbsp;&nbsp;&nbsp;&nbsp;= @item_max * 120 - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set height by max size<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(wd, ht)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # And make contents clear<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor_array = []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# create actor array<br />
&nbsp;&nbsp;&nbsp;&nbsp;for actor in &#36;game_party.actors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle through party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor_array.push(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # and push actors in array<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if RPGAdvReserve::MENU_STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If Switch engaged<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for actor in &#36;game_party.reserve_actors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle through reserves<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor_array.push(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # and push actors in array<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;party_idx_max = &#36;game_party.actors.size - 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get last ID for party<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;for id in 0...@item_max&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle total actor size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 64&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set X Coordinate<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = id * 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set Y coord by counter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = actor_array[id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get actor by counter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_graphic(actor, x - 40, y + 80)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw character<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_name(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if id &gt; party_idx_max&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If counter past party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_reservist(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw reservist name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_class(actor, x + 144, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw class<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_level(actor, x, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_state(actor, x + 90, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw state<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_exp(actor, x, y + 64)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw exp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_hp(actor, x + 236, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw hp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_sp(actor, x + 236, y + 64)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw sp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end&nbsp;&nbsp;<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Cursor Rectangle Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_cursor_rect<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @index &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If no valid index <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.empty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Remove cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp; = @index * 116 - self.oy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get y-position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;= self.width - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get width <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.set(0, y, wd, 96)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And set cursor dimension<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if self.cursor_rect.y &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If position less than 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oy -= 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Reduce origin <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Refresh menu contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_cursor_rect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And redraw cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if self.cursor_rect.y &gt; 348&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If position over 348<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oy += 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Increase origin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Refresh menu contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_cursor_rect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And redraw cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_ChangeMain<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window displays the current party members in the Party Changer scene<br />
#==============================================================================<br />
<br />
class Window_ChangeMain &lt; Window_Selectable<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize(max_size=3)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;super(0, 0, 320, 480)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width - 32, height - 32)<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.active = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.index&nbsp;&nbsp;= -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;@max_size&nbsp;&nbsp; = max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Make contents clear<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_max = 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set max&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;for idx in 0..3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle through party max<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 64&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set text x coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = idx * 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set Y coords by counter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors[idx] != nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If a valid actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_party.actors[idx]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if idx &gt; @max_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If space above max size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text = RPGAdvReserve::DISALLOWED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set disallowed text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text = RPGAdvReserve::EMPTY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set empty space text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(0,y+32,288,32,text,1) # Display the text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And skip to next actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_graphic(actor, x - 40, y + 80)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw Graphic<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_name(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if actor.required == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If a required actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_required(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Redraw Required name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_level(actor, x + 160, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw Level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_hp(actor, x, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw HP<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_sp(actor, x, y + 64)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw SP<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Cursor Rectangle Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_cursor_rect<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @index &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If no valid index <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.empty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Remove cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp; = @index * 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get y-position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;= self.width - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get width <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.set(0, y, wd, 96)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And set cursor dimension<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_ChangeReserve<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window displays the reserve party members in the Party Changer scene<br />
#==============================================================================<br />
<br />
class Window_ChangeReserve &lt; Window_Selectable<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;super(320, 0, 320, 360)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width - 32, height - 32)<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.active = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.index = -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_max = &#36;game_party.reserve_actors.size + 1&nbsp;&nbsp; # Get reservist party max<br />
&nbsp;&nbsp;&nbsp;&nbsp;size&nbsp;&nbsp;= 96 + @item_max * 96 - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set reservist area size<br />
&nbsp;&nbsp;&nbsp;&nbsp;size&nbsp;&nbsp;= 328 if size &lt; 328&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Limit size to window<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.dispose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Erase contents area<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width - 32, size)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # And make contents clear<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;for idx in 0...&#36;game_party.reserve_actors.size&nbsp;&nbsp;&nbsp;&nbsp;# Cycle through reservists<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 64&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set text x coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = idx * 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set Y coords by counter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_party.reserve_actors[idx]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get reservist actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_graphic(actor, x - 40, y + 80)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw character<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_name(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_level(actor, x + 160, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw Level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_hp(actor, x, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw HP<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_sp(actor, x, y + 64)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw SP<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Cursor Rectangle Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_cursor_rect<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @index &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If no valid index <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.empty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Remove cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp; = @index * 116 - self.oy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get y-position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;= self.width - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get width <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.set(0, y, wd, 96)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And set cursor dimension<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if self.cursor_rect.y &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If position less than 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oy -= 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Reduce origin <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Refresh menu contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_cursor_rect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And redraw cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if self.cursor_rect.y &gt; 232&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If position over 232<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oy += 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Increase origin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Refresh menu contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_cursor_rect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And redraw cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
#==============================================================================<br />
# ** Window_PartyChangeInfo<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window displays help information in the Party Changer scene<br />
#==============================================================================<br />
<br />
class Window_PartyChangeInfo &lt; Window_Base<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Public Instance Variables<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;attr_reader&nbsp;&nbsp; :max_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # maximum party size<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize(max_size)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;super(320, 360, 320, 120)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width - 32, height - 32)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@max_size = max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # And make contents clear<br />
&nbsp;&nbsp;&nbsp;&nbsp;text1 = RPGAdvReserve::INFO_Request1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get Full Party Size note<br />
&nbsp;&nbsp;&nbsp;&nbsp;text2 = RPGAdvReserve::INFO_Request2a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get 1st Set party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;tempt = RPGAdvReserve::INFO_Request2b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get 2nd Set party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;text3 = tempt.gsub(/{size}/) {(@max_size.to_s) }&nbsp;&nbsp;# Replace string with size<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @max_size == 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If max size default<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(4, 0, 240, 32, text1)&nbsp;&nbsp; # Show full party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @max_size &gt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If alternate size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(4, 0, 240, 32, text2)&nbsp;&nbsp; # Show 1st party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(4, 32, 240, 32, text3)&nbsp;&nbsp;# Show 2nd party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Interpreter<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This interpreter runs event commands. This class is used within the<br />
#&nbsp;&nbsp;Game_System class and the Game_Event class.<br />
#==============================================================================<br />
<br />
class Interpreter<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Swap Actors by database ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; party_actor_id&nbsp;&nbsp; : actor ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; reserve_actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def swap_by_id(party_actor_id=1, reserve_actor_id=1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.swap_by_id(party_actor_id, reserve_actor_id)<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Party by database ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; reserve_actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_party_by_id(reserve_actor_id=1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_party_by_id(reserve_actor_id)<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Reserve by database ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; party_actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_reserve_by_id(party_actor_id=1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_reserve_by_id(party_actor_id)<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set required actor flag<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; flag&nbsp;&nbsp;&nbsp;&nbsp; : boolean value (true/false)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def required_actor(actor_id=0, flag=true)<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if actor_id.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless value.is_a?(Numeric)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit if not numeric<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if actor_id &lt;= 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid value<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if &#36;game_party.actors[actor_id] == nil&nbsp;&nbsp;&nbsp;&nbsp; # Exit if no actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless (flag == true || flag == false)&nbsp;&nbsp;&nbsp;&nbsp; # Exit if not boolean<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.actors[actor_id].required = flag&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Apply the flag<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Party Changer Menu<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; max_size : party size maximum<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def change_party(max_size=0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_ChangeParty.new(max_size)<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Menu<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs menu screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Menu<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when status window is active)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_status<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If B button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::B)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play cancel SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.cancel_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make command window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@command_window.active = true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@status_window.active = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@status_window.index = -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If C button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::C)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Branch by command window cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case @command_window.index<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when 1&nbsp;&nbsp;# skill<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## If this actor's action limit is 2 or more<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#if &#36;game_party.actors[@status_window.index].restriction &gt;= 2<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# * Beginning of Replaced Code<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#--------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Check actor restriction if index points to active party member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if @status_window.index &lt; &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check_actor = &#36;game_party.actors[@status_window.index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Or check actor restriction for reserve party member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size = &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check_actor = &#36;game_party.reserve_actors[@status_window.index - size]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If this actor's action limit is 2 or more<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if check_actor.restriction &gt;= 2<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#--------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# * Replaced Code End<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Switch to skill screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_Skill.new(@status_window.index)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when 2&nbsp;&nbsp;# equipment<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Switch to equipment screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_Equip.new(@status_window.index)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when 3&nbsp;&nbsp;# status<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Switch to status screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_Status.new(@status_window.index)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Skill<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs skill screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Skill<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;## Get actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;#@actor = &#36;game_party.actors[@actor_index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Beginning of Replaced Code<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If actor index within party size<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @actor_index &lt; &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get actor from party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor = &#36;game_party.actors[@actor_index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise get actor from reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;idx = @actor_index - &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor = &#36;game_party.reserve_actors[idx]<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Replaced Code End<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make help window, status window, and skill window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@help_window = Window_Help.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;@status_window = Window_SkillStatus.new(@actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@skill_window = Window_Skill.new(@actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Associate help window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@skill_window.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make target window (set to invisible / inactive)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@target_window = Window_Target.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;@target_window.visible = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;@target_window.active = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Execute transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Main loop<br />
&nbsp;&nbsp;&nbsp;&nbsp;loop do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update game screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Graphics.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update input information<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Input.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Frame update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Abort loop if screen is changed<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;scene != self<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Prepare for transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.freeze<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Dispose of windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@help_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@status_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@skill_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@target_window.dispose<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Equip<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs equipment screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Equip<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;## Get actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;#@actor = &#36;game_party.actors[@actor_index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Beginning of Replaced Code<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If actor index within party size<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @actor_index &lt; &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get actor from party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor = &#36;game_party.actors[@actor_index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise get actor from reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;idx = @actor_index - &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor = &#36;game_party.reserve_actors[idx]<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Replaced Code End<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@help_window = Window_Help.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;@left_window = Window_EquipLeft.new(@actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@right_window = Window_EquipRight.new(@actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window1 = Window_EquipItem.new(@actor, 0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window2 = Window_EquipItem.new(@actor, 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window3 = Window_EquipItem.new(@actor, 2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window4 = Window_EquipItem.new(@actor, 3)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window5 = Window_EquipItem.new(@actor, 4)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Associate help window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@right_window.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window1.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window2.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window3.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window4.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window5.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;@right_window.index = @equip_index<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Execute transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Main loop<br />
&nbsp;&nbsp;&nbsp;&nbsp;loop do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update game screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Graphics.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update input information<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Input.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Frame update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Abort loop if screen is changed<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;scene != self<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Prepare for transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.freeze<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Dispose of windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@help_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@left_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@right_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window1.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window2.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window3.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window4.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window5.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Battle<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs battle screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Battle<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Start After Battle Phase<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def start_phase5<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Shift to phase 5<br />
&nbsp;&nbsp;&nbsp;&nbsp;@phase = 5<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Play battle end ME<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.me_play(&#36;game_system.battle_end_me)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Return to BGM before battle started<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.bgm_play(&#36;game_temp.map_bgm)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Initialize EXP, amount of gold, and treasure<br />
&nbsp;&nbsp;&nbsp;&nbsp;exp = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;gold = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;treasures = []<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Loop<br />
&nbsp;&nbsp;&nbsp;&nbsp;for enemy in &#36;game_troop.enemies<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If enemy is not hidden<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unless enemy.hidden<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add EXP and amount of gold obtained<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exp += enemy.exp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gold += enemy.gold<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Determine if treasure appears<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if rand(100) &lt; enemy.treasure_prob<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if enemy.item_id &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;treasures.push(&#36;data_items[enemy.item_id])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if enemy.weapon_id &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;treasures.push(&#36;data_weapons[enemy.weapon_id])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if enemy.armor_id &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;treasures.push(&#36;data_armors[enemy.armor_id])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Treasure is limited to a maximum of 6 items<br />
&nbsp;&nbsp;&nbsp;&nbsp;treasures = treasures[0..5]<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtaining EXP<br />
&nbsp;&nbsp;&nbsp;&nbsp;for i in 0...&#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_party.actors[i]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if actor.cant_get_exp? == false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;last_level = actor.level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor.exp += exp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if actor.level &gt; last_level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@status_window.level_up(i)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Beginning of Inserted Code<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtain Reserve Character Exp Percentage<br />
&nbsp;&nbsp;&nbsp;&nbsp;perc = RPGAdvReserve::EXP_PERCENT<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Reserve Characters Obtaining EXP&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;for i in 0...&#36;game_party.reserve_actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_party.reserve_actors[i]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if actor.cant_get_exp? == false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor.exp += exp * perc / 100<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Inserted&nbsp;&nbsp;Code End<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtaining gold<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.gain_gold(gold)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtaining treasure<br />
&nbsp;&nbsp;&nbsp;&nbsp;for item in treasures<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case item<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when RPG::Item<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.gain_item(item.id, 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when RPG::Weapon<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.gain_weapon(item.id, 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when RPG::Armor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.gain_armor(item.id, 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make battle result window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@result_window = Window_BattleResult.new(exp, gold, treasures)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set wait count<br />
&nbsp;&nbsp;&nbsp;&nbsp;@phase5_wait_count = 100<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_ChangeParty<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs party management processing.<br />
#==============================================================================<br />
<br />
class Scene_ChangeParty<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; max_size : max size of party<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize(max_size=0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtain text warning<br />
&nbsp;&nbsp;&nbsp;&nbsp;text = RPGAdvReserve::SIZE_Invalid<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set message and exit If below 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;if max_size &lt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(text)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set message and exit if above standard limit of 4<br />
&nbsp;&nbsp;&nbsp;&nbsp;if max_size &gt; 4<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(text)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set max size based on index positions (0-3) rather than (1-4)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@max_size = max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Define party max for Change Party menu (0-3)<br />
&nbsp;&nbsp;&nbsp;&nbsp;party_max&nbsp;&nbsp; = @max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;party_max&nbsp;&nbsp; = 4 if party_max == 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;party_max&nbsp;&nbsp; -= 1<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window&nbsp;&nbsp; = Window_ChangeMain.new(party_max)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window = Window_ChangeReserve.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;@info_window&nbsp;&nbsp;&nbsp;&nbsp;= Window_PartyChangeInfo.new(@max_size)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set window values<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.index&nbsp;&nbsp;&nbsp;&nbsp; = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.index&nbsp;&nbsp; = -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.active&nbsp;&nbsp;&nbsp;&nbsp;= true<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.active&nbsp;&nbsp;= false<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Clear memorized actors<br />
&nbsp;&nbsp;&nbsp;&nbsp;@actor1 = nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;@actor2 = nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Execute transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Main loop<br />
&nbsp;&nbsp;&nbsp;&nbsp;loop do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update game screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Graphics.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update input information<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Input.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Frame update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Abort loop if screen is changed<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;scene != self<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Prepare for transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.freeze<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Dispose of windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@info_window.dispose<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Update windows&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;@info_window.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If party window is active: call update_party<br />
&nbsp;&nbsp;&nbsp;&nbsp;return update_party&nbsp;&nbsp;&nbsp;&nbsp; if @party_window.active<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If reserve window is active: call update_reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;return update_reserve&nbsp;&nbsp; if @reserve_window.active<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when updating the party window)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_party<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If B button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::B)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If party is empty and not permitted to empty<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors.size == 0 &amp;&amp; !RPGAdvReserve::PERMIT_EMPTY<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If party is larger than maximum size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;val = @max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;val = 4 if val == 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors.size &gt; val<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play cancel SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.cancel_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Switch to map screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_Map.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If C button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::C)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set party window cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;place = @party_window.index<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# if cursor goes beyond party size and no one in that spot<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if @max_size &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if place &gt;= @max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors[place].nil?<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If party member exists at cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors[place] != nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And if party is required (cannot remove)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors[place].required<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If there are no reserve party members<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.reserve_actors.size == 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer the actor to the reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_reserve(&#36;game_party.actors[place])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Refresh both windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@party_window.refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If reserve party members exist<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.reserve_actors.size &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make reserve window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@party_window.active&nbsp;&nbsp;&nbsp;&nbsp;= false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.index&nbsp;&nbsp; = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.active&nbsp;&nbsp;= true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Memorize party member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor1 = &#36;game_party.actors[place]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when updating the reserve window)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If B button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::B)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play cancel SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.cancel_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If C button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::C)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set reserve window cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;place = @reserve_window.index<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# if cursor goes beyond reserve party size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if place == &#36;game_party.reserve_actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If no memorized party actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if @actor1 == nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer stored party member to reserves<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_reserve(@actor1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If there is no stored party actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if @actor1 == nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Memorize reserve member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor2 = &#36;game_party.reserve_actors[place]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer reserve member to party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_party(@actor2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If there a stored party actor exists<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Memorize reserve member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor2 = &#36;game_party.reserve_actors[place]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Swap both party and reserve party members<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.swap(@actor1, @actor2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when making the party window active)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.index&nbsp;&nbsp; = -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.active&nbsp;&nbsp;= false<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.active&nbsp;&nbsp;&nbsp;&nbsp;= true<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end</code></div></div></div>
		</div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
Place below Scene_Debug and above Main.  It rewrites methods in four Scene_ classes, so it should be high in your list of custom scripts. Be aware it may conflict with the menu, skill, equip and battle treasure systems.<br />
<br />
Detailed instructions are included in the script itself.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
As noted, there are major rewrites.  Be warned.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
RPGAdvocate for the original version.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
There were no terms of use listed at RPG Advocate's site, Phylomortis.com. However, I would think it would be prudent to give him credit for the work.]]></description>
			<content:encoded><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Reserve Party Tools</span></span><br />
<span style="font-size: medium;" class="mycode_size">Original Version by RPG Advocate 4/12/2005<br />
Edit and repairs by DerVVulfman</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This script enables support  for a "reserve" party of arbitrary size.  These characters don't fight in battle.  You are able to remove party members  and place them within the reserves by use of a new menu designed in the system. And adding new party members (with "Change Party Member") while the party is full will add them to the reserves.<br />
<br />
The original version required rewrites everywhere and expected the end-user to perform direct edits to the default scripts.  This version fixes some errors and oversights . And while still containing some direct alterations of default scripts, has those edited areas clearly marked for reference.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> The Script</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;"><div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#==============================================================================<br />
# Reserve Party Tools<br />
#------------------------------------------------------------------------------<br />
# by RPG Advocate 4/12/2005<br />
# Edit and repairs by DerVVulfman 6/27/2026<br />
# RGSS / RPGMaker XP<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# THE RESERVE PARTY MENU<br />
#<br />
# This script enables support&nbsp;&nbsp;for a "reserve" party of arbitrary size.&nbsp;&nbsp;These<br />
# characters don't fight in battle. If you want to give the player the ability<br />
# to switch characters between the party and reserve party,&nbsp;&nbsp;use either script<br />
# call shown below:<br />
#<br />
# *&nbsp;&nbsp;&#36;scene = Scene_PartyChange.new(value)<br />
# *&nbsp;&nbsp;change_party(value)<br />
#<br />
# The 'value' represents&nbsp;&nbsp;the maximun number of members you want in the party,<br />
# and can be left empty if using the default party size of '4'. You may set it<br />
# the range from 0-4, with 0 indicating full default party size of '4'. Values<br />
# beyond that range are invalid.<br />
#<br />
# *&nbsp;&nbsp;&#36;scene = Scene_PartyChange.new<br />
# *&nbsp;&nbsp;change_party<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# RESERVIST BATTLE EXPERIENCE<br />
#<br />
# By default, inactive party members gain experience at the same rate as active<br />
# members. To change this,&nbsp;&nbsp;edit the EXP_PERCENT constant&nbsp;&nbsp;in the RPGAdvReserve<br />
# module to the percentage of experience you want the inactive party to gain.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# REQUIRED / PERMANENT PARTY MEMBERS<br />
#<br />
# This script supports required party members, actors that have been classified<br />
# as necessary within the party&nbsp;&nbsp;and cannot be removed.&nbsp;&nbsp;To make a party member<br />
# required or remove its required status, you may use either script calls:<br />
#<br />
# *&nbsp;&nbsp;&#36;game_party.actors[actor_id].required = true/false<br />
# *&nbsp;&nbsp;required_actor(actor_id, true/false)<br />
#<br />
# Both calls requests you&nbsp;&nbsp;to set a value of true,&nbsp;&nbsp;or false in order to remove<br />
# the required status.&nbsp;&nbsp;And within the Change Member menu,&nbsp;&nbsp;these party members<br />
# will appear with a predefined color in their names, default to Goldenrod.<br />
#<br />
# You should only make a character already in the party required. <br />
#<br />
# Making a reserve member 'required' will not work.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# CHANGING PARTY MEMBERS<br />
#<br />
# This script changes how the "Change Party Members" event command works.<br />
#<br />
# If you try to add a charater to the party when the party is full, that char-<br />
# acter will automatically be added to the reserve party.&nbsp;&nbsp;And if you remove a<br />
# party member, that character will be removed if they are in either the party<br />
# or the reserve party. However, it only recognizes a 4-party system when this<br />
# is applied, and does not recognize alternate party sizes.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# SCRIPT CALLS<br />
#<br />
# Initially,&nbsp;&nbsp;the only script calls noted were lenghty&nbsp;&nbsp;and direct commands to<br />
# the Game_Party class&nbsp;&nbsp;or direct calls&nbsp;&nbsp;to &#36;scene itself.&nbsp;&nbsp;Other script calls<br />
# were possible but not given. Here, we view all relevant script calls showing<br />
# both original and newer quick commands found in the Interpreter class:<br />
#<br />
#&nbsp;&nbsp; The Menu Command<br />
#&nbsp;&nbsp; ----------------<br />
#&nbsp;&nbsp; Used to bring up the actual Party/Reservist changing menu<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;scene = Scene_ChangeParty.new(max_size)<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;change_party(max_size)<br />
#<br />
#&nbsp;&nbsp; Set Actor Required Status<br />
#&nbsp;&nbsp; -------------------------<br />
#&nbsp;&nbsp; Used to define an in-party&nbsp;&nbsp;(not a reservist member)&nbsp;&nbsp;as a fixed member of<br />
#&nbsp;&nbsp; the current party.&nbsp;&nbsp;The 'actor_id' value is from the database ID.&nbsp;&nbsp;And the<br />
#&nbsp;&nbsp; 'flag' value is either true or false.<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;game_party.actors[actor_id].required = flag<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;required_actor(actor_id, flag)<br />
#<br />
#&nbsp;&nbsp; Swap Actors by database ID<br />
#&nbsp;&nbsp; --------------------------<br />
#&nbsp;&nbsp; Assuming there is a system&nbsp;&nbsp;tracking what actors&nbsp;&nbsp;(by database ID)&nbsp;&nbsp;are in<br />
#&nbsp;&nbsp; both the party and reserve party, this command lets you exchange one actor<br />
#&nbsp;&nbsp; from the party with one from the reserves.<br />
#&nbsp;&nbsp; IT DOES NOT RECOGNIZE THE 'REQUIRED" ACTOR STATUS<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;game_party.swap_by_id(party_actor_id, reserve_actor_id)<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;swap_by_id(party_actor_id, reserve_actor_id)<br />
#<br />
#&nbsp;&nbsp; Transfer Reservist to the Party by ID<br />
#&nbsp;&nbsp; -------------------------------------<br />
#&nbsp;&nbsp; Assuming there is a system&nbsp;&nbsp;tracking what actors&nbsp;&nbsp;(by database ID)&nbsp;&nbsp;are in<br />
#&nbsp;&nbsp; the reserve party, this command lets you remove the actor from the reserve<br />
#&nbsp;&nbsp; party and places it into the main/active party.<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;game_party.transfer_to_party_by_id(reserve_actor_id)<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;transfer_to_party_by_id(reserve_actor_id)<br />
#<br />
#&nbsp;&nbsp; Transfer Party Member to the Reserves by ID<br />
#&nbsp;&nbsp; -------------------------------------------<br />
#&nbsp;&nbsp; Assuming there is a system&nbsp;&nbsp;tracking what actors&nbsp;&nbsp;(by database ID)&nbsp;&nbsp;are in<br />
#&nbsp;&nbsp; main/active party,&nbsp;&nbsp;this command lets you remove the actor&nbsp;&nbsp;from the party<br />
#&nbsp;&nbsp; and places it into the reserves.<br />
#&nbsp;&nbsp; IT DOES NOT RECOGNIZE THE 'REQUIRED" ACTOR STATUS<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;game_party.transfer_to_reserve_by_id(party_actor_id)<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;transfer_to_reserve_by_id(party_actor_id)<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# CHANGES FROM THE ORIGINAL<br />
#<br />
# This revision creates an RPGAdvReserve module where configuration values are<br />
# found.&nbsp;&nbsp;Originally, the script had only two values to adjust, but these were<br />
# actively situated&nbsp;&nbsp;within the script itself.&nbsp;&nbsp;And this would&nbsp;&nbsp;require you to<br />
# navigate through the script to find those values. The creation of the module<br />
# should make it easier to define what settings are desired.<br />
#<br />
# The system had values that were hardwired into the original script, be these<br />
# the color settings for Required Actor displays&nbsp;&nbsp;or the descriptive texts and<br />
# warning notices within.&nbsp;&nbsp;These have also been&nbsp;&nbsp;migrated to the configuration<br />
# section so you have no need to search within the scripts.<br />
#<br />
# Repairs had to be performed.&nbsp;&nbsp;You could previously exit&nbsp;&nbsp;the above described<br />
# Party Changing menu&nbsp;&nbsp;with a party containing no members at all.&nbsp;&nbsp;This effec-<br />
# tively would prevent&nbsp;&nbsp;the game to continue.&nbsp;&nbsp;The configuration section has a<br />
# switch to permit this, but not recommended.<br />
#<br />
# Likewise, there were issues&nbsp;&nbsp;with identifying required and reservist members<br />
# in the change party menu. RPG Advorate indeed created the Goldenrod Required<br />
# member color, but never applied its use in the menu. This has been corrected<br />
# while also creating a like color for reserve members appearing in the menus.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# COMPATABILITY / SCRIPT ATTACHED CODE AND REWRITES<br />
#<br />
# This script, when initially released, was not designed to paste the contents<br />
# in place,&nbsp;&nbsp;but instead instructed you&nbsp;&nbsp;to directly edit the default scripts.<br />
# At the time of release,&nbsp;&nbsp;there was little knowledge&nbsp;&nbsp;of the 'alias' property<br />
# which would allow the insertion of new code into methods. And this rework of<br />
# his script takes advantage of the alias technique where it was possible.<br />
# the default scripts. It was not released as a script to insert into <br />
#<br />
# Not all sections were able to benefit of the alias technique,&nbsp;&nbsp;those methods<br />
# still requiring their code rewritten/overwritten. However, said methods have<br />
# the rewritten sections identified.<br />
#<br />
# New Script Content:<br />
#&nbsp;&nbsp;* RPGAdvReserve&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: (New) Used to hold configuration values<br />
#&nbsp;&nbsp;* Game_Party&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : (Used by ChangeParty) Methods made to swap members<br />
#&nbsp;&nbsp;* Window_Base&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: (Used by ChangeParty) Makes color identified names<br />
#&nbsp;&nbsp;* Window_ChangeMain&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: (Used by ChangeParty) Draws the current party<br />
#&nbsp;&nbsp;* Window_ChangeReserve&nbsp;&nbsp; : (Used by ChangeParty) Draws the reserve party<br />
#&nbsp;&nbsp;* Window_PartyChangeInfo : (Used by ChangeParty) Draws recommended party size<br />
#&nbsp;&nbsp;* Interpreter&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: Shortcut script calls made for the system<br />
#&nbsp;&nbsp;* Scene_ChangeParty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: Engine that switches party and reservists around<br />
#<br />
# Aliased Script Content:<br />
#&nbsp;&nbsp;* Game_Actor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Adds the required member status variable<br />
#&nbsp;&nbsp;* Game_Party&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Makes the reserve array &amp; alters add/remove member<br />
#<br />
# Rewritten Script Content:<br />
#&nbsp;&nbsp;* Scene_Menu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : update_status edited for reservist restrictions<br />
#&nbsp;&nbsp;* Scene_Skill&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: main method altered to allow access to reserves<br />
#&nbsp;&nbsp;* Scene_Equip&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: main method altered to allow access to reserves<br />
#&nbsp;&nbsp;* Scene_Battle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : start_phase5 altered to allow reserve EXP gains<br />
#<br />
# All scripts that are rewrites of the default scripts have their new code in<br />
# defined areas&nbsp;&nbsp;beginning with&nbsp;&nbsp;either "Beginning of Replaced Code"&nbsp;&nbsp;or with<br />
# "Beginning of Inserted Code",&nbsp;&nbsp;and ending&nbsp;&nbsp;with a like commented statement.<br />
# In many cases, the original code is still available,&nbsp;&nbsp;but commented out for<br />
# end-user recognition.<br />
#<br />
#<br />
#==============================================================================<br />
<br />
<br />
<br />
module RPGAdvReserve<br />
<br />
<br />
&nbsp;&nbsp;# FEATURE SETTINGS<br />
&nbsp;&nbsp;# =======================================================================<br />
<br />
&nbsp;&nbsp;# If Reserve members appear in the menu status screen.<br />
&nbsp;&nbsp;&nbsp;&nbsp;MENU_STATUS = true<br />
<br />
&nbsp;&nbsp;# The percent of Exp reserve members get compared to active.<br />
&nbsp;&nbsp;&nbsp;&nbsp;EXP_PERCENT = 100<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;# (NEW) Allow party to be emptied by Party Changer (not recommended)<br />
&nbsp;&nbsp;# Original did not have a block to prevent emptying ... what a flaw!<br />
&nbsp;&nbsp;&nbsp;&nbsp;PERMIT_EMPTY = true<br />
<br />
<br />
&nbsp;&nbsp;# COLOR SETTINGS<br />
&nbsp;&nbsp;# =======================================================================<br />
<br />
&nbsp;&nbsp;# Color of actor name when required to be in party.<br />
&nbsp;&nbsp;# Default 216,150,20,255:&nbsp;&nbsp;Goldenrod<br />
&nbsp;&nbsp;&nbsp;&nbsp;COLOR_REQUIRED = Color.new(216, 150, 20, 255)<br />
<br />
&nbsp;&nbsp;# Color of actor name in menu status if a reserve member.<br />
&nbsp;&nbsp;# Default 152, 181, 100, 255:&nbsp;&nbsp;Olive<br />
&nbsp;&nbsp;&nbsp;&nbsp;COLOR_RESERVIST = Color.new(152, 181, 100, 255)<br />
<br />
<br />
&nbsp;&nbsp;# ACTOR WARNING MESSAGES<br />
&nbsp;&nbsp;# =======================================================================<br />
&nbsp;&nbsp;# A carte-blanch error if actor IDs values given are invalid<br />
&nbsp;&nbsp;&nbsp;&nbsp;ID_INVALID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "ID given is invalid."<br />
&nbsp;&nbsp;# Define the text used to show at least one invalid party or reservist ID.<br />
&nbsp;&nbsp;&nbsp;&nbsp;SWAP_Invalid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "Cannot swap members. One or both are invalid."<br />
&nbsp;&nbsp;# Define the text used to show the actor ID is not in the reservist party.<br />
&nbsp;&nbsp;&nbsp;&nbsp;TO_PARTY_Invalid&nbsp;&nbsp;&nbsp;&nbsp;= "Warning: Character is not in the reserve party."<br />
&nbsp;&nbsp;# Define the text used to show the party is full.<br />
&nbsp;&nbsp;&nbsp;&nbsp;TO_PARTY_Full&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "Warning: Main party is full."<br />
&nbsp;&nbsp;# Define the text used to show the actor ID is not in the current party.<br />
&nbsp;&nbsp;&nbsp;&nbsp;TO_RESERVE_Invalid&nbsp;&nbsp;= "Warning: Character is not in the main party."<br />
<br />
<br />
&nbsp;&nbsp;# PARTY CHANGER MESSAGES<br />
&nbsp;&nbsp;# =======================================================================<br />
<br />
&nbsp;&nbsp;# Single-line text used to request a party be formed to default.<br />
&nbsp;&nbsp;&nbsp;&nbsp;INFO_Request1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "Please form a party."<br />
&nbsp;&nbsp;# Dual-line text used to request a custom sized party. Must include {size}.<br />
&nbsp;&nbsp;&nbsp;&nbsp;INFO_Request2a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "Please form a party"<br />
&nbsp;&nbsp;&nbsp;&nbsp;INFO_Request2b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "of up to {size} members."<br />
&nbsp;&nbsp;# Warning to note max size setting is invalid.<br />
&nbsp;&nbsp;&nbsp;&nbsp;SIZE_Invalid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "Warning: Invalid max size for party."<br />
&nbsp;&nbsp;# Text used to indicate empty position in party<br />
&nbsp;&nbsp;&nbsp;&nbsp;EMPTY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "- Empty -"<br />
&nbsp;&nbsp;&nbsp;&nbsp;DISALLOWED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "- Disallowed -"<br />
<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Game_Actor<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class handles the actor. It's used within the Game_Actors class<br />
#&nbsp;&nbsp;(&#36;game_actors) and refers to the Game_Party class (&#36;game_party).<br />
#==============================================================================<br />
<br />
class Game_Actor &lt; Game_Battler<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Public Instance Variables<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;attr_accessor :required&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # required party member flag<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Alias Listings<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias rpgadv_reserve_g_actor_setup setup<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Setup<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def setup(actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;rpgadv_reserve_g_actor_setup(actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;@required = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add the additional flag<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
#==============================================================================<br />
# ** Game_Party<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class handles the party. It includes information on amount of gold<br />
#&nbsp;&nbsp;and items. Refer to "&#36;game_party" for the instance of this class.<br />
#==============================================================================<br />
<br />
class Game_Party<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Public Instance Variables<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;attr_accessor :reserve_actors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # reserve actors array<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Alias Listings<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias rpgadv_reserve_g_party_init initialize<br />
&nbsp;&nbsp;alias rpgadv_reserve_g_party_setup_add add_actor<br />
&nbsp;&nbsp;alias rpgadv_reserve_g_party_setup_remove remove_actor<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;rpgadv_reserve_g_party_init&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors = []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add the additional array<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Add an Actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def add_actor(actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_actors[actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get actor&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @actors.size &gt;= 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If the party is full<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if not @actors.include?(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If actor not in party&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if not @reserve_actors.include?(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If actor not in reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.push(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add actor to reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;rpgadv_reserve_g_party_setup_add(actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Remove Actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def remove_actor(actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.delete(&#36;game_actors[actor_id])&nbsp;&nbsp;# Delete actor from reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;rpgadv_reserve_g_party_setup_remove(actor_id)&nbsp;&nbsp; # Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Swap Actors<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor1 : actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor2 : actor<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def swap(actor1, actor2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;error = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set no error<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if not @actors.include?(actor1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If actor1 not in party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set error <br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if not @reserve_actors.include?(actor2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If actor2 not in reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set error <br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if error&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If in error<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::SWAP_Invalid)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Display error message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.push(actor1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add party actor to reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;@actors.delete(actor1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Delete actor from party<br />
&nbsp;&nbsp;&nbsp;&nbsp;add_actor(actor2.id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add reserve actor to party<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.delete(actor2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Delete from reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Party<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor : actor<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_party(actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if not @reserve_actors.include?(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If actor not in reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::TO_PARTY_Invalid)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Display error message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @actors.size == 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If party is full<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::TO_PARTY_Full)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Display error message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;add_actor(actor.id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add reservist to party<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.delete(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Delete from reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Reserve<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor : actor<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_reserve(actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if not @actors.include?(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If actor not in party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::TO_RESERVE_Invalid)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Display error message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;remove_actor(actor.id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Delete actor from party<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.push(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add party actor to reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Swap Actors by ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; party_actor_id&nbsp;&nbsp; : actor ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; reserve_actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def swap_by_id(party_actor_id, reserve_actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless valid_id?(party_actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid actor ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless valid_id?(reserve_actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid reserve ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor1 = &#36;game_actors[party_actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get party member actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor2 = &#36;game_actors[reserve_actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get reserve member actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;swap(actor1, actor2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Swap the actors<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Party by ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; reserve_actor : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_party_by_id(reserve_actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless valid_id?(reserve_actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid reserve ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_actors[reserve_actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get reserve member actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;transfer_to_party(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer actor to party<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Reserve by ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; main_party_actor : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_reserve_by_id(party_actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless valid_id?(party_actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid actor ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_actors[party_actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get party member actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;transfer_to_reserve(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer actor to reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Test for valid values above 0<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def valid_id?(actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;test = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume passes<br />
&nbsp;&nbsp;&nbsp;&nbsp;test = false if actor_id.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Fail if nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;test = false unless actor_id.is_a?(Numeric)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Fail if not numeric<br />
&nbsp;&nbsp;&nbsp;&nbsp;test = false if actor_id &lt;= 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid value<br />
&nbsp;&nbsp;&nbsp;&nbsp;return true&nbsp;&nbsp;if test&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit true if passes<br />
&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::ID_INVALID)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Render ID alert<br />
&nbsp;&nbsp;&nbsp;&nbsp;return false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit method false<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_Base<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class is for all in-game windows.<br />
#==============================================================================<br />
<br />
class Window_Base &lt; Window<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Required Color (Goldenrod)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def required_color<br />
&nbsp;&nbsp;&nbsp;&nbsp;return RPGAdvReserve::COLOR_REQUIRED<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Required Color (Olive)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def reservist_color<br />
&nbsp;&nbsp;&nbsp;&nbsp;return RPGAdvReserve::COLOR_RESERVIST<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Draw Required Name<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor : actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp; : draw spot x-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; y&nbsp;&nbsp;&nbsp;&nbsp; : draw spot y-coordinate<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def draw_actor_required(actor, x, y)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.font.color = required_color<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(x, y, 120, 32, actor.name)<br />
&nbsp;&nbsp;end&nbsp;&nbsp;<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Draw Reservist Name<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor : actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp; : draw spot x-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; y&nbsp;&nbsp;&nbsp;&nbsp; : draw spot y-coordinate<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def draw_actor_reservist(actor, x, y)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.font.color = reservist_color<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(x, y, 120, 32, actor.name)<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_MenuStatus<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window displays party member status on the menu screen.<br />
#==============================================================================<br />
<br />
class Window_MenuStatus &lt; Window_Selectable<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.dispose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Erase contents at start<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_max = &#36;game_party.actors.size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set max size by party<br />
&nbsp;&nbsp;&nbsp;&nbsp;if RPGAdvReserve::MENU_STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If Switch engaged&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@item_max += &#36;game_party.reserve_actors.size&nbsp;&nbsp;&nbsp;&nbsp;# Add reserves to size<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;&nbsp;&nbsp;= width - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set width<br />
&nbsp;&nbsp;&nbsp;&nbsp;ht&nbsp;&nbsp;&nbsp;&nbsp;= @item_max * 120 - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set height by max size<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(wd, ht)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # And make contents clear<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor_array = []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# create actor array<br />
&nbsp;&nbsp;&nbsp;&nbsp;for actor in &#36;game_party.actors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle through party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor_array.push(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # and push actors in array<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if RPGAdvReserve::MENU_STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If Switch engaged<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for actor in &#36;game_party.reserve_actors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle through reserves<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor_array.push(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # and push actors in array<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;party_idx_max = &#36;game_party.actors.size - 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get last ID for party<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;for id in 0...@item_max&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle total actor size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 64&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set X Coordinate<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = id * 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set Y coord by counter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = actor_array[id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get actor by counter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_graphic(actor, x - 40, y + 80)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw character<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_name(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if id &gt; party_idx_max&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If counter past party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_reservist(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw reservist name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_class(actor, x + 144, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw class<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_level(actor, x, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_state(actor, x + 90, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw state<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_exp(actor, x, y + 64)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw exp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_hp(actor, x + 236, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw hp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_sp(actor, x + 236, y + 64)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw sp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end&nbsp;&nbsp;<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Cursor Rectangle Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_cursor_rect<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @index &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If no valid index <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.empty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Remove cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp; = @index * 116 - self.oy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get y-position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;= self.width - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get width <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.set(0, y, wd, 96)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And set cursor dimension<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if self.cursor_rect.y &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If position less than 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oy -= 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Reduce origin <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Refresh menu contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_cursor_rect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And redraw cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if self.cursor_rect.y &gt; 348&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If position over 348<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oy += 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Increase origin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Refresh menu contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_cursor_rect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And redraw cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_ChangeMain<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window displays the current party members in the Party Changer scene<br />
#==============================================================================<br />
<br />
class Window_ChangeMain &lt; Window_Selectable<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize(max_size=3)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;super(0, 0, 320, 480)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width - 32, height - 32)<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.active = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.index&nbsp;&nbsp;= -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;@max_size&nbsp;&nbsp; = max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Make contents clear<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_max = 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set max&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;for idx in 0..3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle through party max<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 64&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set text x coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = idx * 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set Y coords by counter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors[idx] != nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If a valid actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_party.actors[idx]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if idx &gt; @max_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If space above max size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text = RPGAdvReserve::DISALLOWED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set disallowed text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text = RPGAdvReserve::EMPTY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set empty space text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(0,y+32,288,32,text,1) # Display the text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And skip to next actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_graphic(actor, x - 40, y + 80)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw Graphic<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_name(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if actor.required == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If a required actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_required(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Redraw Required name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_level(actor, x + 160, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw Level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_hp(actor, x, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw HP<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_sp(actor, x, y + 64)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw SP<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Cursor Rectangle Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_cursor_rect<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @index &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If no valid index <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.empty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Remove cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp; = @index * 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get y-position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;= self.width - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get width <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.set(0, y, wd, 96)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And set cursor dimension<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_ChangeReserve<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window displays the reserve party members in the Party Changer scene<br />
#==============================================================================<br />
<br />
class Window_ChangeReserve &lt; Window_Selectable<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;super(320, 0, 320, 360)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width - 32, height - 32)<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.active = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.index = -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_max = &#36;game_party.reserve_actors.size + 1&nbsp;&nbsp; # Get reservist party max<br />
&nbsp;&nbsp;&nbsp;&nbsp;size&nbsp;&nbsp;= 96 + @item_max * 96 - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set reservist area size<br />
&nbsp;&nbsp;&nbsp;&nbsp;size&nbsp;&nbsp;= 328 if size &lt; 328&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Limit size to window<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.dispose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Erase contents area<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width - 32, size)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # And make contents clear<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;for idx in 0...&#36;game_party.reserve_actors.size&nbsp;&nbsp;&nbsp;&nbsp;# Cycle through reservists<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 64&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set text x coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = idx * 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set Y coords by counter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_party.reserve_actors[idx]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get reservist actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_graphic(actor, x - 40, y + 80)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw character<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_name(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_level(actor, x + 160, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw Level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_hp(actor, x, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw HP<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_sp(actor, x, y + 64)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw SP<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Cursor Rectangle Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_cursor_rect<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @index &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If no valid index <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.empty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Remove cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp; = @index * 116 - self.oy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get y-position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;= self.width - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get width <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.set(0, y, wd, 96)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And set cursor dimension<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if self.cursor_rect.y &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If position less than 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oy -= 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Reduce origin <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Refresh menu contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_cursor_rect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And redraw cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if self.cursor_rect.y &gt; 232&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If position over 232<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oy += 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Increase origin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Refresh menu contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_cursor_rect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And redraw cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
#==============================================================================<br />
# ** Window_PartyChangeInfo<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window displays help information in the Party Changer scene<br />
#==============================================================================<br />
<br />
class Window_PartyChangeInfo &lt; Window_Base<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Public Instance Variables<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;attr_reader&nbsp;&nbsp; :max_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # maximum party size<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize(max_size)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;super(320, 360, 320, 120)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width - 32, height - 32)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@max_size = max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # And make contents clear<br />
&nbsp;&nbsp;&nbsp;&nbsp;text1 = RPGAdvReserve::INFO_Request1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get Full Party Size note<br />
&nbsp;&nbsp;&nbsp;&nbsp;text2 = RPGAdvReserve::INFO_Request2a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get 1st Set party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;tempt = RPGAdvReserve::INFO_Request2b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get 2nd Set party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;text3 = tempt.gsub(/{size}/) {(@max_size.to_s) }&nbsp;&nbsp;# Replace string with size<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @max_size == 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If max size default<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(4, 0, 240, 32, text1)&nbsp;&nbsp; # Show full party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @max_size &gt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If alternate size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(4, 0, 240, 32, text2)&nbsp;&nbsp; # Show 1st party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(4, 32, 240, 32, text3)&nbsp;&nbsp;# Show 2nd party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Interpreter<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This interpreter runs event commands. This class is used within the<br />
#&nbsp;&nbsp;Game_System class and the Game_Event class.<br />
#==============================================================================<br />
<br />
class Interpreter<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Swap Actors by database ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; party_actor_id&nbsp;&nbsp; : actor ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; reserve_actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def swap_by_id(party_actor_id=1, reserve_actor_id=1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.swap_by_id(party_actor_id, reserve_actor_id)<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Party by database ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; reserve_actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_party_by_id(reserve_actor_id=1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_party_by_id(reserve_actor_id)<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Reserve by database ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; party_actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_reserve_by_id(party_actor_id=1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_reserve_by_id(party_actor_id)<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set required actor flag<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; flag&nbsp;&nbsp;&nbsp;&nbsp; : boolean value (true/false)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def required_actor(actor_id=0, flag=true)<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if actor_id.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless value.is_a?(Numeric)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit if not numeric<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if actor_id &lt;= 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid value<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if &#36;game_party.actors[actor_id] == nil&nbsp;&nbsp;&nbsp;&nbsp; # Exit if no actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless (flag == true || flag == false)&nbsp;&nbsp;&nbsp;&nbsp; # Exit if not boolean<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.actors[actor_id].required = flag&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Apply the flag<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Party Changer Menu<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; max_size : party size maximum<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def change_party(max_size=0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_ChangeParty.new(max_size)<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Menu<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs menu screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Menu<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when status window is active)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_status<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If B button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::B)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play cancel SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.cancel_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make command window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@command_window.active = true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@status_window.active = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@status_window.index = -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If C button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::C)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Branch by command window cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case @command_window.index<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when 1&nbsp;&nbsp;# skill<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## If this actor's action limit is 2 or more<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#if &#36;game_party.actors[@status_window.index].restriction &gt;= 2<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# * Beginning of Replaced Code<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#--------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Check actor restriction if index points to active party member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if @status_window.index &lt; &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check_actor = &#36;game_party.actors[@status_window.index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Or check actor restriction for reserve party member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size = &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check_actor = &#36;game_party.reserve_actors[@status_window.index - size]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If this actor's action limit is 2 or more<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if check_actor.restriction &gt;= 2<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#--------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# * Replaced Code End<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Switch to skill screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_Skill.new(@status_window.index)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when 2&nbsp;&nbsp;# equipment<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Switch to equipment screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_Equip.new(@status_window.index)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when 3&nbsp;&nbsp;# status<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Switch to status screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_Status.new(@status_window.index)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Skill<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs skill screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Skill<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;## Get actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;#@actor = &#36;game_party.actors[@actor_index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Beginning of Replaced Code<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If actor index within party size<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @actor_index &lt; &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get actor from party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor = &#36;game_party.actors[@actor_index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise get actor from reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;idx = @actor_index - &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor = &#36;game_party.reserve_actors[idx]<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Replaced Code End<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make help window, status window, and skill window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@help_window = Window_Help.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;@status_window = Window_SkillStatus.new(@actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@skill_window = Window_Skill.new(@actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Associate help window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@skill_window.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make target window (set to invisible / inactive)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@target_window = Window_Target.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;@target_window.visible = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;@target_window.active = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Execute transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Main loop<br />
&nbsp;&nbsp;&nbsp;&nbsp;loop do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update game screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Graphics.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update input information<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Input.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Frame update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Abort loop if screen is changed<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;scene != self<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Prepare for transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.freeze<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Dispose of windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@help_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@status_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@skill_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@target_window.dispose<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Equip<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs equipment screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Equip<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;## Get actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;#@actor = &#36;game_party.actors[@actor_index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Beginning of Replaced Code<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If actor index within party size<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @actor_index &lt; &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get actor from party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor = &#36;game_party.actors[@actor_index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise get actor from reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;idx = @actor_index - &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor = &#36;game_party.reserve_actors[idx]<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Replaced Code End<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@help_window = Window_Help.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;@left_window = Window_EquipLeft.new(@actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@right_window = Window_EquipRight.new(@actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window1 = Window_EquipItem.new(@actor, 0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window2 = Window_EquipItem.new(@actor, 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window3 = Window_EquipItem.new(@actor, 2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window4 = Window_EquipItem.new(@actor, 3)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window5 = Window_EquipItem.new(@actor, 4)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Associate help window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@right_window.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window1.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window2.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window3.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window4.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window5.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;@right_window.index = @equip_index<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Execute transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Main loop<br />
&nbsp;&nbsp;&nbsp;&nbsp;loop do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update game screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Graphics.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update input information<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Input.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Frame update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Abort loop if screen is changed<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;scene != self<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Prepare for transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.freeze<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Dispose of windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@help_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@left_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@right_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window1.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window2.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window3.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window4.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window5.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Battle<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs battle screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Battle<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Start After Battle Phase<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def start_phase5<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Shift to phase 5<br />
&nbsp;&nbsp;&nbsp;&nbsp;@phase = 5<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Play battle end ME<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.me_play(&#36;game_system.battle_end_me)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Return to BGM before battle started<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.bgm_play(&#36;game_temp.map_bgm)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Initialize EXP, amount of gold, and treasure<br />
&nbsp;&nbsp;&nbsp;&nbsp;exp = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;gold = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;treasures = []<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Loop<br />
&nbsp;&nbsp;&nbsp;&nbsp;for enemy in &#36;game_troop.enemies<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If enemy is not hidden<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unless enemy.hidden<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add EXP and amount of gold obtained<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exp += enemy.exp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gold += enemy.gold<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Determine if treasure appears<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if rand(100) &lt; enemy.treasure_prob<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if enemy.item_id &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;treasures.push(&#36;data_items[enemy.item_id])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if enemy.weapon_id &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;treasures.push(&#36;data_weapons[enemy.weapon_id])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if enemy.armor_id &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;treasures.push(&#36;data_armors[enemy.armor_id])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Treasure is limited to a maximum of 6 items<br />
&nbsp;&nbsp;&nbsp;&nbsp;treasures = treasures[0..5]<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtaining EXP<br />
&nbsp;&nbsp;&nbsp;&nbsp;for i in 0...&#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_party.actors[i]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if actor.cant_get_exp? == false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;last_level = actor.level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor.exp += exp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if actor.level &gt; last_level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@status_window.level_up(i)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Beginning of Inserted Code<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtain Reserve Character Exp Percentage<br />
&nbsp;&nbsp;&nbsp;&nbsp;perc = RPGAdvReserve::EXP_PERCENT<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Reserve Characters Obtaining EXP&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;for i in 0...&#36;game_party.reserve_actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_party.reserve_actors[i]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if actor.cant_get_exp? == false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor.exp += exp * perc / 100<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Inserted&nbsp;&nbsp;Code End<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtaining gold<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.gain_gold(gold)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtaining treasure<br />
&nbsp;&nbsp;&nbsp;&nbsp;for item in treasures<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case item<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when RPG::Item<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.gain_item(item.id, 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when RPG::Weapon<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.gain_weapon(item.id, 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when RPG::Armor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.gain_armor(item.id, 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make battle result window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@result_window = Window_BattleResult.new(exp, gold, treasures)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set wait count<br />
&nbsp;&nbsp;&nbsp;&nbsp;@phase5_wait_count = 100<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_ChangeParty<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs party management processing.<br />
#==============================================================================<br />
<br />
class Scene_ChangeParty<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; max_size : max size of party<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize(max_size=0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtain text warning<br />
&nbsp;&nbsp;&nbsp;&nbsp;text = RPGAdvReserve::SIZE_Invalid<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set message and exit If below 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;if max_size &lt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(text)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set message and exit if above standard limit of 4<br />
&nbsp;&nbsp;&nbsp;&nbsp;if max_size &gt; 4<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(text)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set max size based on index positions (0-3) rather than (1-4)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@max_size = max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Define party max for Change Party menu (0-3)<br />
&nbsp;&nbsp;&nbsp;&nbsp;party_max&nbsp;&nbsp; = @max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;party_max&nbsp;&nbsp; = 4 if party_max == 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;party_max&nbsp;&nbsp; -= 1<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window&nbsp;&nbsp; = Window_ChangeMain.new(party_max)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window = Window_ChangeReserve.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;@info_window&nbsp;&nbsp;&nbsp;&nbsp;= Window_PartyChangeInfo.new(@max_size)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set window values<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.index&nbsp;&nbsp;&nbsp;&nbsp; = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.index&nbsp;&nbsp; = -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.active&nbsp;&nbsp;&nbsp;&nbsp;= true<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.active&nbsp;&nbsp;= false<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Clear memorized actors<br />
&nbsp;&nbsp;&nbsp;&nbsp;@actor1 = nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;@actor2 = nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Execute transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Main loop<br />
&nbsp;&nbsp;&nbsp;&nbsp;loop do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update game screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Graphics.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update input information<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Input.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Frame update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Abort loop if screen is changed<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;scene != self<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Prepare for transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.freeze<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Dispose of windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@info_window.dispose<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Update windows&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;@info_window.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If party window is active: call update_party<br />
&nbsp;&nbsp;&nbsp;&nbsp;return update_party&nbsp;&nbsp;&nbsp;&nbsp; if @party_window.active<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If reserve window is active: call update_reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;return update_reserve&nbsp;&nbsp; if @reserve_window.active<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when updating the party window)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_party<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If B button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::B)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If party is empty and not permitted to empty<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors.size == 0 &amp;&amp; !RPGAdvReserve::PERMIT_EMPTY<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If party is larger than maximum size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;val = @max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;val = 4 if val == 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors.size &gt; val<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play cancel SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.cancel_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Switch to map screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_Map.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If C button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::C)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set party window cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;place = @party_window.index<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# if cursor goes beyond party size and no one in that spot<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if @max_size &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if place &gt;= @max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors[place].nil?<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If party member exists at cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors[place] != nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And if party is required (cannot remove)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors[place].required<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If there are no reserve party members<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.reserve_actors.size == 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer the actor to the reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_reserve(&#36;game_party.actors[place])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Refresh both windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@party_window.refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If reserve party members exist<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.reserve_actors.size &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make reserve window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@party_window.active&nbsp;&nbsp;&nbsp;&nbsp;= false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.index&nbsp;&nbsp; = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.active&nbsp;&nbsp;= true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Memorize party member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor1 = &#36;game_party.actors[place]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when updating the reserve window)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If B button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::B)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play cancel SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.cancel_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If C button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::C)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set reserve window cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;place = @reserve_window.index<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# if cursor goes beyond reserve party size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if place == &#36;game_party.reserve_actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If no memorized party actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if @actor1 == nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer stored party member to reserves<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_reserve(@actor1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If there is no stored party actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if @actor1 == nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Memorize reserve member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor2 = &#36;game_party.reserve_actors[place]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer reserve member to party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_party(@actor2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If there a stored party actor exists<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Memorize reserve member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor2 = &#36;game_party.reserve_actors[place]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Swap both party and reserve party members<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.swap(@actor1, @actor2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when making the party window active)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.index&nbsp;&nbsp; = -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.active&nbsp;&nbsp;= false<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.active&nbsp;&nbsp;&nbsp;&nbsp;= true<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end</code></div></div></div>
		</div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
Place below Scene_Debug and above Main.  It rewrites methods in four Scene_ classes, so it should be high in your list of custom scripts. Be aware it may conflict with the menu, skill, equip and battle treasure systems.<br />
<br />
Detailed instructions are included in the script itself.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
As noted, there are major rewrites.  Be warned.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
RPGAdvocate for the original version.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
There were no terms of use listed at RPG Advocate's site, Phylomortis.com. However, I would think it would be prudent to give him credit for the work.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KustomElemState XP]]></title>
			<link>https://www.save-point.org/thread-13485.html</link>
			<pubDate>Tue, 26 May 2026 03:36:40 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=1471">kyonides</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13485.html</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">KustomElemState XP</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align">The Script is NOT COMPATIBLE With Other Element or State Related Scripts!</div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
It's a very brief one for sure. <img src="https://www.save-point.org/images/smilies/ejlol/wink.gif" alt="Winking" title="Winking" class="smilie smilie_33" /><br />
Alter a given Actor's element or state rate during gameplay! <img src="https://www.save-point.org/images/smilies/ejlol/gamer.gif" alt="Gamer" title="Gamer" class="smilie smilie_183" /> <br />
The script creates or loads the custom ranks based on the current class. <img src="https://www.save-point.org/images/smilies/ejlol/orson.gif" alt="Orson" title="Orson" class="smilie smilie_167" /> <img src="https://www.save-point.org/images/smilies/ejlol/ghim.gif" alt="Ghim" title="Ghim" class="smilie smilie_226" /> <img src="https://www.save-point.org/images/smilies/ejlol/slayne.gif" alt="Slayne" title="Slayne" class="smilie smilie_228" /> <br />
It will never try to alter the Classes database contents! <img src="https://www.save-point.org/images/smilies/ejlol/thumbs.gif" alt="Two Thumbs Up!" title="Two Thumbs Up!" class="smilie smilie_61" /> <br />
<br />
Element / State Efficiency Letter 2 Percentage Conversion Table<br />
<br />
<span style="font-weight: bold;" class="mycode_b">A</span> - 200% (Weak)<br />
<span style="font-weight: bold;" class="mycode_b">B</span> - 150%<br />
<span style="font-weight: bold;" class="mycode_b">C</span> - 100% (Default)<br />
<span style="font-weight: bold;" class="mycode_b">D</span> - 50%<br />
<span style="font-weight: bold;" class="mycode_b">E</span> - 0% (Immune)<br />
<span style="font-weight: bold;" class="mycode_b">F</span> - -100% (Gets Healed?)<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Script Calls</span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">STEP 1</span><br />
Get an Actor first! - 2 Methods:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor = &#36;game_party.actors[Index]<br />
actor = &#36;game_actors[ActorID]</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">STEP 2</span><br />
Use any of the following calls.<br />
<br />
Check out the current Index of an Element Rate:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.find_element_rate(ElementID)</code></div></div><br />
Check out the current Effect % of an Element:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.element_effect(ElementID)</code></div></div><br />
Change an Actor's Element Rate!  Rate Indices: 1 through 6<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.custom_element_rank(ElementID, RateIndex)</code></div></div><br />
Change an Actor's State Rate!    Rate Indices: 1 through 6<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.custom_state_rank(StateID, RateIndex)</code></div></div><br />
Move Current Element State 1 Position to the Left<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.prev_element_rate!(ElementID)</code></div></div><br />
Move Current Element State 1 Position to the Right<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.next_element_rate!(ElementID)</code></div></div><br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> USAGE EXAMPLE</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div style="text-align: center;" class="mycode_align"><img src="https://i.postimg.cc/zfSdFYxM/kustomelemstate-xp001.jpg" loading="lazy"  alt="[Image: kustomelemstate-xp001.jpg]" class="mycode_img" /></div>
</div>
		</div>
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">The Script</span></span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * KustomElemState XP * #<br />
#   Scripter : Kyonides<br />
#   2025-05-25<br />
<br />
# * NOT COMPATIBLE With Other Element or State Related Scripts! * #<br />
<br />
# Alter a given Actor's element or state rate during gameplay!<br />
# The script creates / loads the custom ranks based on the current class.<br />
# It will never try to alter the Classes DB contents!<br />
<br />
# * Script Calls * #<br />
<br />
# STEP #1: Get an Actor first! - 2 Methods:<br />
# actor = &#36;game_party.actors[Index]<br />
# actor = &#36;game_actors[ActorID]<br />
<br />
# STEP #2: Use any of the following calls.<br />
# - Check out the current Index of an Element Rate:<br />
# actor.find_element_rate(ElementID)<br />
<br />
# - Check out the current Effect % of an Element:<br />
# actor.element_effect(ElementID)<br />
<br />
# - Change an Actor's Element Rate!  Rate Indices: 1 through 6<br />
# actor.custom_element_rank(ElementID, RateIndex)<br />
<br />
# - Change an Actor's State Rate!    Rate Indices: 1 through 6<br />
# actor.custom_state_rank(StateID, RateIndex)<br />
<br />
# - Move Current Element State 1 Position to the Left<br />
# actor.prev_element_rate!(ElementID)<br />
<br />
# - Move Current Element State 1 Position to the Right<br />
# actor.next_element_rate!(ElementID)<br />
<br />
class Game_Actor<br />
  ER_TABLE = [0,200,150,100,50,0,-100]<br />
  alias :kyon_kust_elem_stt_gm_act_setup :setup<br />
  alias :kyon_kust_elem_stt_gm_act_class_id_set :class_id=<br />
  def setup(actor_id)<br />
    kyon_kust_elem_stt_gm_act_setup(actor_id)<br />
    @element_ranks = {}<br />
    @state_ranks = {}<br />
    custom_element_ranks!<br />
    custom_state_ranks!<br />
  end<br />
<br />
  def custom_element_ranks!<br />
    @element_ranks[@class_id] ||= &#36;data_classes[@class_id].element_ranks.dup<br />
  end<br />
<br />
  def custom_state_ranks!<br />
    @state_ranks[@class_id] ||= &#36;data_classes[@class_id].state_ranks.dup<br />
  end<br />
<br />
  def find_element_rate(elem_id)<br />
    @element_ranks[@class_id][elem_id]<br />
  end<br />
<br />
  def element_effect(elem_id)<br />
    n = find_element_rate(elem_id)<br />
    ER_TABLE[n]<br />
  end<br />
<br />
  def armor_ids<br />
    [@armor1_id, @armor2_id, @armor3_id, @armor4_id]<br />
  end<br />
<br />
  def element_rate(element_id)<br />
    pos = find_element_rate(element_id)<br />
    result = ER_TABLE[pos]<br />
    armor_ids.each do |i|<br />
      armor = &#36;data_armors[i]<br />
      if armor != nil and armor.guard_element_set.include?(element_id)<br />
        result /= 2<br />
      end<br />
    end<br />
    @states.each do |i|<br />
      if &#36;data_states[i].guard_element_set.include?(element_id)<br />
        result /= 2<br />
      end<br />
    end<br />
    return result<br />
  end<br />
<br />
  def state_ranks<br />
    @state_ranks[@class_id]<br />
  end<br />
<br />
  def custom_element_rank(n, value)<br />
    @element_ranks[@class_id][n] = value<br />
  end<br />
<br />
  def custom_state_rank(n, value)<br />
    @state_ranks[@class_id][n] = value<br />
  end<br />
<br />
  def class_id=(class_id)<br />
    class_id_set(class_id)<br />
    custom_element_ranks!<br />
    custom_state_ranks!<br />
  end<br />
<br />
  def change_element_rate(elem_id, value, start)<br />
    pos = find_element_rate(elem_id)<br />
    pos = (pos + value) % 7<br />
    pos = start if pos == 0<br />
    custom_element_rank(elem_id, pos)<br />
    pos<br />
  end<br />
<br />
  def prev_element_rate!(elem_id)<br />
    change_element_rate(elem_id, -1, 6)<br />
  end<br />
<br />
  def next_element_rate!(elem_id)<br />
    change_element_rate(elem_id, 1, 1)<br />
  end<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
Free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer.<br />
Mention me in your game credits.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">KustomElemState XP</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align">The Script is NOT COMPATIBLE With Other Element or State Related Scripts!</div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
It's a very brief one for sure. <img src="https://www.save-point.org/images/smilies/ejlol/wink.gif" alt="Winking" title="Winking" class="smilie smilie_33" /><br />
Alter a given Actor's element or state rate during gameplay! <img src="https://www.save-point.org/images/smilies/ejlol/gamer.gif" alt="Gamer" title="Gamer" class="smilie smilie_183" /> <br />
The script creates or loads the custom ranks based on the current class. <img src="https://www.save-point.org/images/smilies/ejlol/orson.gif" alt="Orson" title="Orson" class="smilie smilie_167" /> <img src="https://www.save-point.org/images/smilies/ejlol/ghim.gif" alt="Ghim" title="Ghim" class="smilie smilie_226" /> <img src="https://www.save-point.org/images/smilies/ejlol/slayne.gif" alt="Slayne" title="Slayne" class="smilie smilie_228" /> <br />
It will never try to alter the Classes database contents! <img src="https://www.save-point.org/images/smilies/ejlol/thumbs.gif" alt="Two Thumbs Up!" title="Two Thumbs Up!" class="smilie smilie_61" /> <br />
<br />
Element / State Efficiency Letter 2 Percentage Conversion Table<br />
<br />
<span style="font-weight: bold;" class="mycode_b">A</span> - 200% (Weak)<br />
<span style="font-weight: bold;" class="mycode_b">B</span> - 150%<br />
<span style="font-weight: bold;" class="mycode_b">C</span> - 100% (Default)<br />
<span style="font-weight: bold;" class="mycode_b">D</span> - 50%<br />
<span style="font-weight: bold;" class="mycode_b">E</span> - 0% (Immune)<br />
<span style="font-weight: bold;" class="mycode_b">F</span> - -100% (Gets Healed?)<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Script Calls</span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">STEP 1</span><br />
Get an Actor first! - 2 Methods:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor = &#36;game_party.actors[Index]<br />
actor = &#36;game_actors[ActorID]</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">STEP 2</span><br />
Use any of the following calls.<br />
<br />
Check out the current Index of an Element Rate:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.find_element_rate(ElementID)</code></div></div><br />
Check out the current Effect % of an Element:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.element_effect(ElementID)</code></div></div><br />
Change an Actor's Element Rate!  Rate Indices: 1 through 6<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.custom_element_rank(ElementID, RateIndex)</code></div></div><br />
Change an Actor's State Rate!    Rate Indices: 1 through 6<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.custom_state_rank(StateID, RateIndex)</code></div></div><br />
Move Current Element State 1 Position to the Left<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.prev_element_rate!(ElementID)</code></div></div><br />
Move Current Element State 1 Position to the Right<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.next_element_rate!(ElementID)</code></div></div><br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> USAGE EXAMPLE</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div style="text-align: center;" class="mycode_align"><img src="https://i.postimg.cc/zfSdFYxM/kustomelemstate-xp001.jpg" loading="lazy"  alt="[Image: kustomelemstate-xp001.jpg]" class="mycode_img" /></div>
</div>
		</div>
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">The Script</span></span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * KustomElemState XP * #<br />
#   Scripter : Kyonides<br />
#   2025-05-25<br />
<br />
# * NOT COMPATIBLE With Other Element or State Related Scripts! * #<br />
<br />
# Alter a given Actor's element or state rate during gameplay!<br />
# The script creates / loads the custom ranks based on the current class.<br />
# It will never try to alter the Classes DB contents!<br />
<br />
# * Script Calls * #<br />
<br />
# STEP #1: Get an Actor first! - 2 Methods:<br />
# actor = &#36;game_party.actors[Index]<br />
# actor = &#36;game_actors[ActorID]<br />
<br />
# STEP #2: Use any of the following calls.<br />
# - Check out the current Index of an Element Rate:<br />
# actor.find_element_rate(ElementID)<br />
<br />
# - Check out the current Effect % of an Element:<br />
# actor.element_effect(ElementID)<br />
<br />
# - Change an Actor's Element Rate!  Rate Indices: 1 through 6<br />
# actor.custom_element_rank(ElementID, RateIndex)<br />
<br />
# - Change an Actor's State Rate!    Rate Indices: 1 through 6<br />
# actor.custom_state_rank(StateID, RateIndex)<br />
<br />
# - Move Current Element State 1 Position to the Left<br />
# actor.prev_element_rate!(ElementID)<br />
<br />
# - Move Current Element State 1 Position to the Right<br />
# actor.next_element_rate!(ElementID)<br />
<br />
class Game_Actor<br />
  ER_TABLE = [0,200,150,100,50,0,-100]<br />
  alias :kyon_kust_elem_stt_gm_act_setup :setup<br />
  alias :kyon_kust_elem_stt_gm_act_class_id_set :class_id=<br />
  def setup(actor_id)<br />
    kyon_kust_elem_stt_gm_act_setup(actor_id)<br />
    @element_ranks = {}<br />
    @state_ranks = {}<br />
    custom_element_ranks!<br />
    custom_state_ranks!<br />
  end<br />
<br />
  def custom_element_ranks!<br />
    @element_ranks[@class_id] ||= &#36;data_classes[@class_id].element_ranks.dup<br />
  end<br />
<br />
  def custom_state_ranks!<br />
    @state_ranks[@class_id] ||= &#36;data_classes[@class_id].state_ranks.dup<br />
  end<br />
<br />
  def find_element_rate(elem_id)<br />
    @element_ranks[@class_id][elem_id]<br />
  end<br />
<br />
  def element_effect(elem_id)<br />
    n = find_element_rate(elem_id)<br />
    ER_TABLE[n]<br />
  end<br />
<br />
  def armor_ids<br />
    [@armor1_id, @armor2_id, @armor3_id, @armor4_id]<br />
  end<br />
<br />
  def element_rate(element_id)<br />
    pos = find_element_rate(element_id)<br />
    result = ER_TABLE[pos]<br />
    armor_ids.each do |i|<br />
      armor = &#36;data_armors[i]<br />
      if armor != nil and armor.guard_element_set.include?(element_id)<br />
        result /= 2<br />
      end<br />
    end<br />
    @states.each do |i|<br />
      if &#36;data_states[i].guard_element_set.include?(element_id)<br />
        result /= 2<br />
      end<br />
    end<br />
    return result<br />
  end<br />
<br />
  def state_ranks<br />
    @state_ranks[@class_id]<br />
  end<br />
<br />
  def custom_element_rank(n, value)<br />
    @element_ranks[@class_id][n] = value<br />
  end<br />
<br />
  def custom_state_rank(n, value)<br />
    @state_ranks[@class_id][n] = value<br />
  end<br />
<br />
  def class_id=(class_id)<br />
    class_id_set(class_id)<br />
    custom_element_ranks!<br />
    custom_state_ranks!<br />
  end<br />
<br />
  def change_element_rate(elem_id, value, start)<br />
    pos = find_element_rate(elem_id)<br />
    pos = (pos + value) % 7<br />
    pos = start if pos == 0<br />
    custom_element_rank(elem_id, pos)<br />
    pos<br />
  end<br />
<br />
  def prev_element_rate!(elem_id)<br />
    change_element_rate(elem_id, -1, 6)<br />
  end<br />
<br />
  def next_element_rate!(elem_id)<br />
    change_element_rate(elem_id, 1, 1)<br />
  end<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
Free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer.<br />
Mention me in your game credits.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Aced Shops]]></title>
			<link>https://www.save-point.org/thread-13480.html</link>
			<pubDate>Sun, 17 May 2026 18:59:31 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13480.html</guid>
			<description><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Aced Shops</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.2</span><br />
<span style="font-size: xx-small;" class="mycode_size">Initial development began 5-16-2026</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This script lets one set up shops that may limit interactions. In general it permits these functions:<ul class="mycode_list"><li>Can make a store that only buys from the player or only does sales.<br />
</li>
<li>Can restrict items sold to inddividual stores based on the item IDs<br />
</li>
<li>Can set up a store to have custom prices for certain items<br />
</li>
<li>Can make a virtual Dynamic Shop with limited goods until restocked<br />
</li>
<li>Can have favorable or dissatisfied reactions affect store prices<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-size: xx-small;" class="mycode_size">I was always a fan of Bethesda Softwork's mercantile price alteration systems</span></span></li>
</ul>
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">BONUS:</span> Demo includes the "Advanced Shop Status Window" script by RPG Advocate </li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<a href="https://app.box.com/s/lra7bkjqdctvemnzyz0gmsa4stbfpmmb" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">CLICK HERE</span></a>--  Box.Com link<br />
<span style="font-style: italic;" class="mycode_i">Look for the Download link in the top right of the screen</span><br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
On this release, I was barebones on instructions. I will return later with more instructions.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">FAQ</span></span><br />
<br />
This was per a request by Ace_V, said request and development found here:<br />
<a href="https://www.save-point.org/thread-13478-lastpost.html" target="_blank" rel="noopener" class="mycode_url">https://www.save-point.org/thread-13478-lastpost.html</a><br />
<br />
While development began initially with RPG Advocate's Buy Only/Sell-Only script, little of it even remains.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
Performs several rewrites throughout the shop system.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free for use, even in commercial games.  Only due credit is required.]]></description>
			<content:encoded><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Aced Shops</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.2</span><br />
<span style="font-size: xx-small;" class="mycode_size">Initial development began 5-16-2026</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This script lets one set up shops that may limit interactions. In general it permits these functions:<ul class="mycode_list"><li>Can make a store that only buys from the player or only does sales.<br />
</li>
<li>Can restrict items sold to inddividual stores based on the item IDs<br />
</li>
<li>Can set up a store to have custom prices for certain items<br />
</li>
<li>Can make a virtual Dynamic Shop with limited goods until restocked<br />
</li>
<li>Can have favorable or dissatisfied reactions affect store prices<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-size: xx-small;" class="mycode_size">I was always a fan of Bethesda Softwork's mercantile price alteration systems</span></span></li>
</ul>
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">BONUS:</span> Demo includes the "Advanced Shop Status Window" script by RPG Advocate </li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<a href="https://app.box.com/s/lra7bkjqdctvemnzyz0gmsa4stbfpmmb" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">CLICK HERE</span></a>--  Box.Com link<br />
<span style="font-style: italic;" class="mycode_i">Look for the Download link in the top right of the screen</span><br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
On this release, I was barebones on instructions. I will return later with more instructions.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">FAQ</span></span><br />
<br />
This was per a request by Ace_V, said request and development found here:<br />
<a href="https://www.save-point.org/thread-13478-lastpost.html" target="_blank" rel="noopener" class="mycode_url">https://www.save-point.org/thread-13478-lastpost.html</a><br />
<br />
While development began initially with RPG Advocate's Buy Only/Sell-Only script, little of it even remains.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
Performs several rewrites throughout the shop system.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free for use, even in commercial games.  Only due credit is required.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KustomPriceShop XP]]></title>
			<link>https://www.save-point.org/thread-13479.html</link>
			<pubDate>Sun, 17 May 2026 07:20:19 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=1471">kyonides</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13479.html</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">KustomPriceShop XP</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
This script allows you to open a special shop on a given map that offers:<br />
<ul class="mycode_list"><li>Setting custom (buy or sale) prices for specific items.<br />
</li>
<li>Setting certain goods as highly undesirable, making the party lose friendship points at that shop.<br />
</li>
<li>Rewarding loyal customers with free gifts if they buy a given amount of items or weapons or armors.<br />
</li>
<li>Creating buy-only or sell-only shops.<br />
</li>
</ul>
<br />
To keep it separate from normal shops, set the shop's ID via a game variable.<br />
<br />
You can change the maximum number of units per item allowed in your game.<br />
<br />
Leaving the shop without doing anything will decrease the shop's friendship points by 1 (default value).<br />
Purchases and sales will increase those points in no time! <img src="https://www.save-point.org/images/smilies/ejlol/shocked.gif" alt="Shocked" title="Shocked" class="smilie smilie_22" /> <br />
<br />
It also lets you to set a backdrop as well instead of the current map.<br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> SCREENSHOTS</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div style="text-align: center;" class="mycode_align"><img src="https://i.postimg.cc/d04B4wFx/kustompriceshop-xp001.jpg" loading="lazy"  alt="[Image: kustompriceshop-xp001.jpg]" class="mycode_img" /></div>
<div style="text-align: center;" class="mycode_align"><img src="https://i.postimg.cc/252w2rYt/kustompriceshop-xp002.jpg" loading="lazy"  alt="[Image: kustompriceshop-xp002.jpg]" class="mycode_img" /></div>
</div>
		</div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">Optional Script Calls For The Active Shop</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">NOTE:</span> ItemID stands for an actual positive number, starting from 1 onwards.<br />
<br />
Add Items with Custom Prices:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_price_items(ItemID1 =&gt; Price1, etc.)<br />
sell_price_items(ItemID1 =&gt; Price1, etc.)</code></div></div><br />
Add Weapons with Custom Prices:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_price_weapons(WeaponID1 =&gt; Price1, etc.)<br />
sell_price_weapons(WeaponID1 =&gt; Price1, etc.)</code></div></div><br />
Add Armors with Custom Prices:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_price_armors(ArmorID1 =&gt; Price1, etc.)<br />
sell_price_armors(ArmorID1 =&gt; Price1, etc.)</code></div></div><br />
Change Custom Price Shop's Friendship Points - Number stands for any number, either positive or negative.<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>price_shop_friend_points(Number)</code></div></div><br />
Set Minimum Friendship Level for Certain Items, Weapons or Armors - Types: 0 - Item, 1 - Weapon, 2 - Armor<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>price_shop_friendship_min(Mininum, Type, ItemID1, etc.)</code></div></div><br />
Set the Lowest Level The Friendship Points can reach: Number should be equal to 0 or less.<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>price_shop_friend_floor(Number)</code></div></div><br />
Change Custom Price Shop's No Transaction Penalty - Number stands for 0 or any positive number. Default Value: 1.<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>price_shop_set_no_action_penalty(Number)</code></div></div><br />
Reward Your Loyal Customers with Items:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_gifts_items(ItemID, ItemsMin, GiftItemID, Number)</code></div></div><br />
Reward Your Loyal Customers with Weapons:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_gifts_weapons(ItemID, ItemsMin, GiftItemID, Number)</code></div></div><br />
Reward Your Loyal Customers with Armors:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_gifts_armors(ItemID, ItemsMin, GiftItemID, Number)</code></div></div><br />
Punish the Player for Selling the "Wrong" Items: LostPoints stands for 1 or above.<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sell_price_wrong_items(ItemID1 =&gt; LostPoints, etc.)</code></div></div><br />
Punish the Player for Selling the "Wrong" Weapons:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sell_price_wrong_weapons(WeaponID1 =&gt; LostPoints, etc.)</code></div></div><br />
Punish the Player for Selling the "Wrong" Armors:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sell_price_wrong_armors(ArmorID1 =&gt; LostPoints, etc.)</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">The Script</span></span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * KustomPriceShop XP * #<br />
#   Scripter : Kyonides<br />
#   v1.0.0 - 2026-05-23<br />
<br />
# Create a special shop that offers:<br />
# - Setting custom prices for specific items.<br />
# - Setting certain goods as highly undesirable, making the party lose<br />
#   friendship points at that shop.<br />
# - Rewarding loyal customers with free gifts if they buy a given amount of<br />
#   items or weapons or armors.<br />
# - Creating purchase-only or sell-only shops.<br />
<br />
# To keep it separate from normal shops, set the shop's ID via a game variable.<br />
# You can change the maximum number of units per item allowed in your game.<br />
# It also allows you to set a backdrop as well instead of the current map.<br />
# Leaving the shop without doing anything will decrease the shop's friendship<br />
# points by 1 (default value).<br />
<br />
# * Optional Script Calls For The Active Shop * #<br />
<br />
# - Add Items with Custom Prices:<br />
# buy_price_items(ItemID1 =&gt; Price1, etc.)<br />
# sell_price_items(ItemID1 =&gt; Price1, etc.)<br />
<br />
# - Add Weapons with Custom Prices:<br />
# buy_price_weapons(WeaponID1 =&gt; Price1, etc.)<br />
# sell_price_weapons(WeaponID1 =&gt; Price1, etc.)<br />
<br />
# - Add Armors with Custom Prices:<br />
# buy_price_armors(ArmorID1 =&gt; Price1, etc.)<br />
# sell_price_armors(ArmorID1 =&gt; Price1, etc.)<br />
<br />
# - Change Custom Price Shop's Friendship Points:<br />
#   Number stands for any number, either positive or negative.<br />
# price_shop_friend_points(Number)<br />
<br />
# - Set Minimum Friendship Level for Certain Items, Weapons or Armors:<br />
#   Types: 0 - Item, 1 - Weapon, 2 - Armor<br />
# price_shop_friendship_min(Mininum, Type, ItemID1, etc.)<br />
<br />
# - Set the Lowest Level The Friendship Points can reach: 0 or less.<br />
# price_shop_friend_floor(Number)<br />
<br />
# - Change Custom Price Shop's No Transaction Penalty:<br />
#   Number stands for 0 or any positive number. Default Value: 1.<br />
# price_shop_set_no_action_penalty(Number)<br />
<br />
# - Reward Your Loyal Customers with Items:<br />
# buy_gifts_items(ItemID, ItemsMin, GiftItemID, Number)<br />
<br />
# - Reward Your Loyal Customers with Weapons:<br />
# buy_gifts_weapons(ItemID, ItemsMin, GiftItemID, Number)<br />
<br />
# - Reward Your Loyal Customers with Armors:<br />
# buy_gifts_armors(ItemID, ItemsMin, GiftItemID, Number)<br />
<br />
# - Punish the Player for Selling the Wrong Items:<br />
# sell_price_wrong_items(ItemID1 =&gt; LostPoints, etc.)<br />
<br />
# - Punish the Player for Selling the Wrong Weapons:<br />
# sell_price_wrong_weapons(WeaponID1 =&gt; LostPoints, etc.)<br />
<br />
# - Punish the Player for Selling the Wrong Armors:<br />
# sell_price_wrong_armors(ArmorID1 =&gt; LostPoints, etc.)<br />
<br />
module KustomPrice<br />
  ITEM_MAX = 99<br />
  BUY_ONLY_SWITCH  = 8<br />
  SELL_ONLY_SWITCH = 9<br />
  SHOP_ID_VAR = 10<br />
  DEFAULT_BACKDROP = "012-PortTown02"<br />
  FRIENDSHIP_LEVEL = "Friendship Level: %s"<br />
  SPECIAL_REWARDS  = "Special Rewards"<br />
<br />
  class Shop<br />
    class Gifts<br />
      def initialize(item_min, item_id, n)<br />
        @item_min = item_min<br />
        @item_id = item_id<br />
        @amount = n<br />
      end<br />
      attr_reader :item_min, :item_id, :amount<br />
    end<br />
<br />
    def initialize<br />
      @friendship = 0<br />
      @friendship_floor = 0<br />
      @no_action_penalty = 1<br />
      @friendship_min = {}<br />
      @buy_prices = {}<br />
      @sell_prices = {}<br />
      @buy_item_max = {}<br />
      @sell_item_max = {}<br />
      @buy_gifts = {}<br />
      @sell_wrong_goods = {}<br />
      @friendship_min.default = {}<br />
      @buy_prices.default = {}<br />
      @sell_prices.default = {}<br />
      @buy_gifts.default = {}<br />
      @sell_wrong_goods.default = {}<br />
      @buy_item_max.default = ITEM_MAX<br />
      @sell_item_max.default = ITEM_MAX<br />
    end<br />
<br />
    def friendship=(n)<br />
      @friendship = [@friendship + n, @friendship_floor].max<br />
    end<br />
<br />
    def no_action_penalty!<br />
      self.friendship -= @no_action_penalty<br />
    end<br />
<br />
    def frienship_min(mininum, type, *items)<br />
      fmin = @friendship_min[type]<br />
      items.flatten.each {|n| fmin[n] = mininum }<br />
      mininum<br />
    end<br />
<br />
    def set_buy_prices(type, data={})<br />
      @buy_prices[type].merge!(data)<br />
    end<br />
<br />
    def set_sell_prices(type, data={})<br />
      @sell_prices[type].merge!(data)<br />
    end<br />
<br />
    def set_buy_gifts(type, parent_id, item_min, item_id, n)<br />
      @buy_gifts[type][parent_id] = Gifts.new(item_min, item_id, n)<br />
    end<br />
<br />
    def sell_wrong_goods(type, data={})<br />
      @sell_wrong_goods[type].merge!(data)<br />
    end<br />
    attr_reader :friendship, :friendship_floor, :friendship_min<br />
    attr_reader :buy_prices, :sell_prices, :buy_gifts<br />
    attr_reader :buy_item_max, :sell_item_max, :sell_wrong_goods<br />
    attr_accessor :goods, :no_action_penalty<br />
  end<br />
end<br />
<br />
class Game_System<br />
  alias :kyon_kp_shop_gm_sys_init :initialize<br />
  def initialize<br />
    kyon_kp_shop_gm_sys_init<br />
    reset_price_shop_id!<br />
    @custom_price_shops = {}<br />
  end<br />
<br />
  def reset_price_shop_id!<br />
    @price_shop_id = 0<br />
  end<br />
<br />
  def init_price_shop(shop_id)<br />
    @price_shop_id = shop_id<br />
    @custom_price_shops[shop_id] ||= KustomPrice::Shop.new<br />
  end<br />
<br />
  def setup_price_shop(shop_id, new_goods)<br />
    shop = @custom_price_shops[shop_id]<br />
    shop.goods = new_goods<br />
  end<br />
<br />
  def this_price_shop<br />
    @custom_price_shops[@price_shop_id]<br />
  end<br />
  attr_reader :custom_price_shops<br />
end<br />
<br />
class Game_Party<br />
  def bag_items<br />
    @items<br />
  end<br />
<br />
  def bag_weapons<br />
    @weapons<br />
  end<br />
<br />
  def bag_armors<br />
    @armors<br />
  end<br />
<br />
  def compact_bag_items!<br />
    @items.delete_if {|k,v| v == 0 }<br />
    @weapons.delete_if {|k,v| v == 0 }<br />
    @armors.delete_if {|k,v| v == 0 }<br />
  end<br />
end<br />
<br />
class Window_ShopCommand<br />
  def reset_disabled_items<br />
    @disabled = []<br />
  end<br />
<br />
  def disable_current_item?<br />
    @disabled[@index]<br />
  end<br />
end<br />
<br />
module KustomPrice<br />
  module AddMethods<br />
    def item<br />
      @data[@index] || @no_item<br />
    end<br />
<br />
    def price<br />
      @prices[@index] || 0<br />
    end<br />
<br />
    def type<br />
      @types[@index] || 0<br />
    end<br />
<br />
    def get_price(n, item_id, price)<br />
      case @types[n]<br />
      when 0<br />
        @item_prices[item_id] || price<br />
      when 1<br />
        @weapon_prices[item_id] || price<br />
      when 2<br />
        @armor_prices[item_id] || price<br />
      end<br />
    end<br />
  end<br />
<br />
class ShopBuyWindow &lt; Window_Selectable<br />
  include AddMethods<br />
  attr_accessor :shop_goods<br />
  def initialize(shop, shop_goods)<br />
    w = 368<br />
    @tw = w - 64<br />
    super(0, 288, w, 192)<br />
    sp = shop.buy_prices<br />
    @item_prices   = sp[0]<br />
    @weapon_prices = sp[1]<br />
    @armor_prices  = sp[2]<br />
    @shop_goods = shop_goods.dup<br />
    @no_item = RPG::Item.new<br />
    @transparent = Color.new(0, 0, 0, 0)<br />
    @symbol_color = Color.new(255, 255, 80)<br />
    @symbol = &#36;data_system.words.gold<br />
    refresh<br />
    self.index = 0<br />
  end<br />
<br />
  def item_name<br />
    self.item.name<br />
  end<br />
<br />
  def set_goods(goods_item)<br />
    type, goods_id = goods_item<br />
    case type<br />
    when 0<br />
      [type, &#36;data_items[goods_id]]<br />
    when 1<br />
      [type, &#36;data_weapons[goods_id]]<br />
    when 2<br />
      [type, &#36;data_armors[goods_id]]<br />
    end<br />
  end<br />
<br />
  def refresh<br />
    if self.contents != nil<br />
      self.contents.dispose<br />
      self.contents = nil<br />
    end<br />
    @types = []<br />
    @data = []<br />
    @prices = []<br />
    for goods_item in @shop_goods<br />
      type, item = set_goods(goods_item)<br />
      next unless item<br />
      n = @types.size<br />
      @types &lt;&lt; type<br />
      @data &lt;&lt; item<br />
      @prices &lt;&lt; get_price(n, item.id, item.price)<br />
    end<br />
    draw_items<br />
  end<br />
<br />
  def draw_items<br />
    @item_max = @data.size<br />
    self.contents = Bitmap.new(width - 32, row_max * 32) if @item_max &gt; 0<br />
    @item_max.times {|i| draw_item(i) }<br />
  end<br />
<br />
  def clear_line(rx, ry)<br />
    rect = Rect.new(rx, ry, self.width - 32, 32)<br />
    self.contents.fill_rect(rect, @transparent)<br />
  end<br />
<br />
  def draw_item(n)<br />
    item = @data[n]<br />
    font = self.contents.font<br />
    price = @prices[n]<br />
    if &#36;game_party.gold &gt;= price<br />
      font.color = normal_color<br />
      alpha = 255<br />
    else<br />
      font.color = disabled_color<br />
      alpha = 128<br />
    end<br />
    ry = n * 32<br />
    clear_line(4, ry)<br />
    bitmap = RPG::Cache.icon(item.icon_name)<br />
    self.contents.blt(28, ry + 4, bitmap, Rect.new(0, 0, 24, 24), alpha)<br />
    self.contents.draw_text(56, ry, @tw - 100, 32, item.name)<br />
    self.contents.draw_text(@tw - 92, ry, 100, 32, price.to_s, 2)<br />
    @symbol_color.alpha = alpha<br />
    font.color = @symbol_color<br />
    self.contents.draw_text(@tw, ry, 24, 32, @symbol, 2)<br />
  end<br />
<br />
  def update_help<br />
    @help_window.set_text(self.item.description)<br />
  end<br />
<br />
  def delete_item<br />
    @shop_goods.delete(@index)<br />
    item = @data.delete(@index)<br />
    self.contents.dispose if self.contents != nil<br />
    self.contents = nil<br />
    draw_items<br />
  end<br />
<br />
  def disable_item(n)<br />
    draw_item(n, disabled_color)<br />
    @disabled[n] = true<br />
  end<br />
end<br />
<br />
class ShopSellWindow &lt; Window_Selectable<br />
  include AddMethods<br />
  def initialize(shop)<br />
    super(0, 128, 640, 352)<br />
    @column_max = 2<br />
    @no_item = RPG::Item.new<br />
    sp = shop.sell_prices<br />
    @item_prices   = sp[0]<br />
    @weapon_prices = sp[1]<br />
    @armor_prices  = sp[2]<br />
    refresh<br />
    self.index = 0<br />
  end<br />
<br />
  def refresh<br />
    if self.contents != nil<br />
      self.contents.dispose<br />
      self.contents = nil<br />
    end<br />
    @types = []<br />
    @data = []<br />
    @prices = []<br />
    n = 0<br />
    &#36;game_party.bag_items.sort.each do |k,v|<br />
      next if &#36;game_party.item_number(k) == 0<br />
      @types &lt;&lt; 0<br />
      @data &lt;&lt; obj = &#36;data_items[k]<br />
      @prices &lt;&lt; get_price(n, k, obj.price / 2)<br />
      n += 1<br />
    end<br />
    &#36;game_party.bag_weapons.sort.each do |k,v|<br />
      next if &#36;game_party.weapon_number(i) == 0<br />
      @types &lt;&lt; 1<br />
      @data &lt;&lt; obj = &#36;data_weapons[k]<br />
      @prices &lt;&lt; get_price(n, k, obj.price / 2)<br />
      n += 1<br />
    end<br />
    &#36;game_party.bag_armors.sort.each do |k,v|<br />
      next if &#36;game_party.armor_number(i) == 0<br />
      @types &lt;&lt; 2<br />
      @data &lt;&lt; obj = &#36;data_armors[k]<br />
      @prices &lt;&lt; get_price(n, k, obj.price / 2)<br />
      n += 1<br />
    end<br />
    @item_max = @data.size<br />
    return if @item_max == 0<br />
    self.contents = Bitmap.new(width - 32, row_max * 32)<br />
    @item_max.times {|n| draw_item(n) }<br />
  end<br />
<br />
  def draw_item(n)<br />
    item = @data[n]<br />
    case item<br />
    when RPG::Item<br />
      number = &#36;game_party.item_number(item.id)<br />
    when RPG::Weapon<br />
      number = &#36;game_party.weapon_number(item.id)<br />
    when RPG::Armor<br />
      number = &#36;game_party.armor_number(item.id)<br />
    end<br />
    price = @prices[n]<br />
    if price &gt; 0<br />
      self.contents.font.color = normal_color<br />
    else<br />
      self.contents.font.color = disabled_color<br />
    end<br />
    x = 4 + n % 2 * (288 + 32)<br />
    y = n / 2 * 32<br />
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)<br />
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))<br />
    bitmap = RPG::Cache.icon(item.icon_name)<br />
    opacity = self.contents.font.color == normal_color ? 255 : 128<br />
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)<br />
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)<br />
    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)<br />
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)<br />
  end<br />
<br />
  def update_help<br />
    @help_window.set_text(self.item.description)<br />
  end<br />
end<br />
<br />
class ShopGiftWindow &lt; Window_Selectable<br />
  def initialize<br />
    super(160, 144, 320, 128)<br />
    @w = width - 32<br />
    @h = height - 32<br />
    @types = []<br />
    @gifts = []<br />
    @amounts = []<br />
    @pages = 0<br />
    @index = 0<br />
  end<br />
<br />
  def set_gifts(list)<br />
    list.each do |type, gift, n|<br />
      @types &lt;&lt; type<br />
      @gifts &lt;&lt; gift<br />
      @amounts &lt;&lt; n<br />
    end<br />
    @pages = list.size<br />
    refresh<br />
  end<br />
<br />
  def change_page(n)<br />
    return if @pages == 1<br />
    @index = (@index + n) % @pages<br />
    refresh<br />
  end<br />
<br />
  def refresh<br />
    page = @index + 1<br />
    label = "Page " + page.to_s + "/" + @pages.to_s<br />
    n = @amounts[@index]<br />
    b = Bitmap.new(@w, @h)<br />
    font = b.font<br />
    font.color = system_color<br />
    b.draw_text(0, 0, @w, 32, SPECIAL_REWARDS, 1)<br />
    good = get_good<br />
    font.color = normal_color<br />
    b.draw_text(0, 32, @w, 32, good.name)<br />
    b.draw_text(0, 32, @w, 32, n.to_s, 2)<br />
    b.draw_text(0, 64, @w, 32, label, 2)<br />
    self.contents = b<br />
  end<br />
<br />
  def get_good<br />
    item_id = @gifts[@index]<br />
    case @types[@index]<br />
    when 0<br />
      return &#36;data_items[item_id]<br />
    when 1<br />
      return &#36;data_weapons[item_id]<br />
    when 2<br />
      return &#36;data_armors[item_id]<br />
    end<br />
  end<br />
end<br />
<br />
end<br />
<br />
class Interpreter<br />
  alias :kyon_kp_shop_int_chng_vars :command_122<br />
  def command_122<br />
    kyon_kp_shop_int_chng_vars<br />
    var_id = @parameters[0]<br />
    return unless KustomPrice::SHOP_ID_VAR == var_id<br />
    var_id = @parameters[4]<br />
    @price_shop = &#36;game_system.init_price_shop(var_id)<br />
  end<br />
<br />
  def price_shop_friend_points(n)<br />
    @price_shop.friendship += n<br />
  end<br />
<br />
  def price_shop_friend_floor(n)<br />
    @price_shop.friendship_floor = n<br />
  end<br />
<br />
  def price_shop_friendship_min(min, type, *items)<br />
    @price_shop.frienship_min(min, type, *items)<br />
  end<br />
<br />
  def price_shop_set_no_action_penalty(n)<br />
    @price_shop.no_action_penalty = n<br />
  end<br />
<br />
  def buy_price_items(data={})<br />
    @price_shop.set_buy_prices(0, data)<br />
  end<br />
<br />
  def buy_price_weapons(data={})<br />
    @price_shop.set_buy_prices(1, data)<br />
  end<br />
<br />
  def buy_price_armors(data={})<br />
    @price_shop.set_buy_prices(2, data)<br />
  end<br />
<br />
  def sell_price_items(data={})<br />
    @price_shop.set_sell_prices(0, data)<br />
  end<br />
<br />
  def sell_price_weapons(data={})<br />
    @price_shop.set_sell_prices(1, data)<br />
  end<br />
<br />
  def sell_price_armors(data={})<br />
    @price_shop.set_sell_prices(2, data)<br />
  end<br />
<br />
  def buy_gifts_items(item_id, item_min, gift_item_id, n)<br />
    @price_shop.set_buy_gifts(0, item_id, item_min, gift_item_id, n)<br />
  end<br />
<br />
  def buy_gifts_weapons(item_id, item_min, gift_item_id, n)<br />
    @price_shop.set_buy_gifts(1, item_id, item_min, gift_item_id, n)<br />
  end<br />
<br />
  def buy_gifts_armors(item_id, item_min, gift_item_id, n)<br />
    @price_shop.set_buy_gifts(2, item_id, item_min, gift_item_id, n)<br />
  end<br />
  <br />
  def sell_price_wrong_items(data={})<br />
    @price_shop.sell_wrong_goods(0, data)<br />
  end<br />
<br />
  def sell_price_wrong_weapons(data={})<br />
    @price_shop.sell_wrong_goods(1, data)<br />
  end<br />
<br />
  def sell_price_wrong_armors(data={})<br />
    @price_shop.sell_wrong_goods(2, data)<br />
  end<br />
end<br />
<br />
class Scene_Map<br />
  def call_shop<br />
    &#36;game_temp.shop_calling = false<br />
    &#36;game_player.straighten<br />
    shop_var = KustomPrice::SHOP_ID_VAR<br />
    if &#36;game_variables[shop_var] != 0<br />
      &#36;scene = PriceShopScene.new<br />
    else<br />
      &#36;scene = Scene_Shop.new<br />
    end<br />
  end<br />
end<br />
<br />
class PriceShopScene &lt; Scene_Shop<br />
  include KustomPrice<br />
  def find_shop_id<br />
    &#36;game_variables[SHOP_ID_VAR]<br />
  end<br />
<br />
  def main<br />
    prepare_goods<br />
    make_backdrop<br />
    make_windows<br />
    Graphics.transition<br />
    loop do<br />
      Graphics.update<br />
      Input.update<br />
      update<br />
      if &#36;scene != self<br />
        break<br />
      end<br />
    end<br />
    Graphics.freeze<br />
    dispose_windows<br />
    reset_price_shop<br />
  end<br />
<br />
  def prepare_goods<br />
    &#36;game_party.compact_bag_items!<br />
    @transactions = 0<br />
    @shop_id = find_shop_id<br />
    @shop = &#36;game_system.this_price_shop<br />
    @fp = @shop.friendship<br />
    @fp_min = @shop.friendship_min<br />
    @goods = @shop.goods || &#36;game_temp.shop_goods<br />
    setup_friendly_goods<br />
  end<br />
<br />
  def setup_friendly_goods<br />
    @gifts = []<br />
    @shop_goods = []<br />
    @goods.each do |type, obj_id|<br />
      group = @fp_min[type]<br />
      level = group[obj_id] || 0<br />
      @shop_goods &lt;&lt; [type, obj_id] if level == 0 or level &lt;= @fp<br />
    end<br />
    @exclude_goods = @shop_goods.size != @goods.size<br />
  end<br />
<br />
  def make_backdrop<br />
    @backdrop = Sprite.new<br />
    @backdrop.bitmap = RPG::Cache.battleback(DEFAULT_BACKDROP)<br />
  end<br />
<br />
  def make_windows<br />
    @help_window = Window_Help.new<br />
    show_friendship_level<br />
    @command_window = Window_ShopCommand.new<br />
    @command_window.reset_disabled_items<br />
    @command_window.disable_item(0) if &#36;game_switches[SELL_ONLY_SWITCH]<br />
    @command_window.disable_item(1) if &#36;game_switches[BUY_ONLY_SWITCH]<br />
    @gold_window = Window_Gold.new<br />
    @gold_window.x = 480<br />
    @gold_window.y = 64<br />
    @dummy_window = Window_Base.new(0, 288, 640, 192)<br />
    @buy_window = ShopBuyWindow.new(@shop, @shop_goods)<br />
    @buy_window.active = false<br />
    @buy_window.visible = false<br />
    @buy_window.help_window = @help_window<br />
    @sell_window = ShopSellWindow.new(@shop)<br />
    @sell_window.active = false<br />
    @sell_window.visible = false<br />
    @sell_window.help_window = @help_window<br />
    @number_window = Window_ShopNumber.new<br />
    @number_window.active = false<br />
    @number_window.visible = false<br />
    @status_window = Window_ShopStatus.new<br />
    @status_window.visible = false<br />
    @gift_window = ShopGiftWindow.new<br />
    @gift_window.visible = false<br />
  end<br />
<br />
  def show_friendship_level<br />
    points = @shop.friendship.to_s<br />
    points = sprintf(FRIENDSHIP_LEVEL, points)<br />
    @help_window.set_text(points)<br />
  end<br />
<br />
  def update<br />
    if @show_gifts<br />
      update_show_gifts<br />
      return<br />
    end<br />
    super<br />
  end<br />
<br />
  def update_show_gifts<br />
    if Input.trigger?(Input::B) or Input.trigger?(Input::C)<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      &#36;scene = Scene_Map.new<br />
      return @show_gifts = nil<br />
    elsif Input.trigger?(Input::LEFT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @gift_window.change_page(-1)<br />
      return<br />
    elsif Input.trigger?(Input::RIGHT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @gift_window.change_page(1)<br />
    end<br />
  end<br />
<br />
  def update_command<br />
    if Input.trigger?(Input::B)<br />
      if @get_gifts<br />
        &#36;game_system.se_play(&#36;data_system.shop_se)<br />
        @command_window.index = -1<br />
        @gift_window.set_gifts(@gifts)<br />
        @gift_window.visible = true<br />
        Graphics.screenshot<br />
        @get_gifts = nil<br />
        return @show_gifts = true<br />
      else<br />
        &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
        &#36;scene = Scene_Map.new<br />
      end<br />
      return<br />
    elsif Input.trigger?(Input::C)<br />
      if @command_window.disable_current_item?<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      case @command_window.index<br />
      when 0<br />
        open_purchase<br />
      when 1<br />
        open_sale<br />
      when 2<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        &#36;scene = Scene_Map.new<br />
      end<br />
    end<br />
  end<br />
<br />
  def open_purchase<br />
    &#36;game_system.se_play(&#36;data_system.decision_se)<br />
    @command_window.active = false<br />
    @dummy_window.visible = false<br />
    @buy_window.active = true<br />
    @buy_window.visible = true<br />
    @buy_window.refresh<br />
    @status_window.visible = true<br />
  end<br />
<br />
  def open_sale<br />
    &#36;game_system.se_play(&#36;data_system.decision_se)<br />
    @command_window.active = false<br />
    @dummy_window.visible = false<br />
    @sell_window.active = true<br />
    @sell_window.visible = true<br />
    @sell_window.refresh<br />
  end<br />
<br />
  def update_buy<br />
    @status_window.item = @buy_window.item<br />
    if Input.trigger?(Input::B)<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      @command_window.active = true<br />
      @dummy_window.visible = true<br />
      @buy_window.active = false<br />
      @buy_window.visible = false<br />
      @status_window.visible = false<br />
      @status_window.item = nil<br />
      show_friendship_level<br />
      return<br />
    elsif Input.trigger?(Input::C)<br />
      @item = @buy_window.item<br />
      price = @buy_window.price<br />
      if @item == nil or &#36;game_party.gold &lt; price<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      case @item<br />
      when RPG::Item<br />
        number = &#36;game_party.item_number(@item.id)<br />
      when RPG::Weapon<br />
        number = &#36;game_party.weapon_number(@item.id)<br />
      when RPG::Armor<br />
        number = &#36;game_party.armor_number(@item.id)<br />
      end<br />
      if ITEM_MAX == number<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      &#36;game_system.se_play(&#36;data_system.decision_se)<br />
      max = price == 0 ? ITEM_MAX : &#36;game_party.gold / price<br />
      max = [max, ITEM_MAX - number].min<br />
      @buy_window.active = false<br />
      @buy_window.visible = false<br />
      @number_window.set(@item, max, price)<br />
      @number_window.active = true<br />
      @number_window.visible = true<br />
    end<br />
  end<br />
<br />
  def update_sell<br />
    if Input.trigger?(Input::B)<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      @command_window.active = true<br />
      @dummy_window.visible = true<br />
      @sell_window.active = false<br />
      @sell_window.visible = false<br />
      @status_window.item = nil<br />
      show_friendship_level<br />
      return<br />
    elsif Input.trigger?(Input::C)<br />
      @item = @sell_window.item<br />
      @status_window.item = @item<br />
      price = @sell_window.price<br />
      if @item == nil or price == 0<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      &#36;game_system.se_play(&#36;data_system.decision_se)<br />
      case @item<br />
      when RPG::Item<br />
        number = &#36;game_party.item_number(@item.id)<br />
      when RPG::Weapon<br />
        number = &#36;game_party.weapon_number(@item.id)<br />
      when RPG::Armor<br />
        number = &#36;game_party.armor_number(@item.id)<br />
      end<br />
      total = number<br />
      @sell_window.active = false<br />
      @sell_window.visible = false<br />
      @number_window.set(@item, total, price)<br />
      @number_window.active = true<br />
      @number_window.visible = true<br />
      @status_window.visible = true<br />
    end<br />
  end<br />
<br />
  def update_number<br />
    if Input.trigger?(Input::B)<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      @number_window.active = false<br />
      @number_window.visible = false<br />
      case @command_window.index<br />
      when 0  # buy<br />
        @buy_window.active = true<br />
        @buy_window.visible = true<br />
      when 1  # sell<br />
        @sell_window.active = true<br />
        @sell_window.visible = true<br />
        @status_window.visible = false<br />
      end<br />
      return<br />
    elsif Input.trigger?(Input::C)<br />
      &#36;game_system.se_play(&#36;data_system.shop_se)<br />
      @number_window.active = false<br />
      @number_window.visible = false<br />
      item_id = @item.id<br />
      n = @number_window.number<br />
      @transactions += n<br />
      case @command_window.index<br />
      when 0  # buy<br />
        update_number_buy(item_id, n)<br />
        return<br />
      when 1  # sell<br />
        type = @sell_window.type<br />
        lost_points = @shop.sell_wrong_goods[type][item_id] || 0<br />
        if lost_points &gt; 0<br />
          @shop.friendship -= lost_points * n<br />
        else<br />
          @shop.friendship += n<br />
        end<br />
        price = @sell_window.price<br />
        &#36;game_party.gain_gold(n * price)<br />
        case @item<br />
        when RPG::Item<br />
          &#36;game_party.lose_item(item_id, n)<br />
        when RPG::Weapon<br />
          &#36;game_party.lose_weapon(item_id, n)<br />
        when RPG::Armor<br />
          &#36;game_party.lose_armor(item_id, n)<br />
        end<br />
        @gold_window.refresh<br />
        @sell_window.refresh<br />
        @status_window.refresh<br />
        @sell_window.active = true<br />
        @sell_window.visible = true<br />
        @status_window.visible = false<br />
      end<br />
    end<br />
  end<br />
<br />
  def update_number_buy(item_id, n)<br />
    @shop.friendship += n<br />
    price = @buy_window.price<br />
    &#36;game_party.lose_gold(n * price)<br />
    case @item<br />
    when RPG::Item<br />
      type = 0<br />
      &#36;game_party.gain_item(item_id, n)<br />
    when RPG::Weapon<br />
      type = 1<br />
      &#36;game_party.gain_weapon(item_id, n)<br />
    when RPG::Armor<br />
      type = 2<br />
      &#36;game_party.gain_armor(item_id, n)<br />
    end<br />
    @gold_window.refresh<br />
    if @shop.friendship != @fp<br />
      @fp = @shop.friendship<br />
      setup_friendly_goods<br />
      @buy_window.shop_goods = @shop_goods<br />
    end<br />
    @buy_window.refresh<br />
    @status_window.refresh<br />
    @buy_window.active = true<br />
    @buy_window.visible = true<br />
    gifts_list = @shop.buy_gifts[type]<br />
    gift = gifts_list[item_id]<br />
    if gift and gift.item_min &lt;= n<br />
      item_id = gift.item_id<br />
      total = n / gift.item_min * gift.amount<br />
      case type<br />
      when 0<br />
        &#36;game_party.gain_item(item_id, total)<br />
      when 1<br />
        &#36;game_party.gain_weapon(item_id, total)<br />
      when 2<br />
        &#36;game_party.gain_armor(item_id, total)<br />
      end<br />
      @gifts &lt;&lt; [type, item_id, total]<br />
      @get_gifts = true<br />
    end<br />
  end<br />
<br />
  def dispose_windows<br />
    @backdrop.bitmap.dispose<br />
    @backdrop.dispose<br />
    @help_window.dispose<br />
    @command_window.dispose<br />
    @gold_window.dispose<br />
    @dummy_window.dispose<br />
    @buy_window.dispose<br />
    @sell_window.dispose<br />
    @number_window.dispose<br />
    @status_window.dispose<br />
    @gift_window.dispose<br />
  end<br />
<br />
  def reset_price_shop<br />
    &#36;game_variables[SHOP_ID_VAR] = 0<br />
    &#36;game_switches[BUY_ONLY_SWITCH] = false<br />
    &#36;game_switches[SELL_ONLY_SWITCH] = false<br />
    &#36;game_party.compact_bag_items!<br />
    @shop.no_action_penalty! if @transactions == 0<br />
    list = @buy_window.shop_goods<br />
    if !@exclude_goods and list.size != @shop_goods.size<br />
      &#36;game_system.setup_price_shop(@shop_id, list)<br />
    end<br />
    &#36;game_system.reset_price_shop_id!<br />
  end<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
Free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer.<br />
Mention me in your game credits.<br />
You may also add the forum's name and URL there.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">KustomPriceShop XP</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
This script allows you to open a special shop on a given map that offers:<br />
<ul class="mycode_list"><li>Setting custom (buy or sale) prices for specific items.<br />
</li>
<li>Setting certain goods as highly undesirable, making the party lose friendship points at that shop.<br />
</li>
<li>Rewarding loyal customers with free gifts if they buy a given amount of items or weapons or armors.<br />
</li>
<li>Creating buy-only or sell-only shops.<br />
</li>
</ul>
<br />
To keep it separate from normal shops, set the shop's ID via a game variable.<br />
<br />
You can change the maximum number of units per item allowed in your game.<br />
<br />
Leaving the shop without doing anything will decrease the shop's friendship points by 1 (default value).<br />
Purchases and sales will increase those points in no time! <img src="https://www.save-point.org/images/smilies/ejlol/shocked.gif" alt="Shocked" title="Shocked" class="smilie smilie_22" /> <br />
<br />
It also lets you to set a backdrop as well instead of the current map.<br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> SCREENSHOTS</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div style="text-align: center;" class="mycode_align"><img src="https://i.postimg.cc/d04B4wFx/kustompriceshop-xp001.jpg" loading="lazy"  alt="[Image: kustompriceshop-xp001.jpg]" class="mycode_img" /></div>
<div style="text-align: center;" class="mycode_align"><img src="https://i.postimg.cc/252w2rYt/kustompriceshop-xp002.jpg" loading="lazy"  alt="[Image: kustompriceshop-xp002.jpg]" class="mycode_img" /></div>
</div>
		</div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">Optional Script Calls For The Active Shop</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">NOTE:</span> ItemID stands for an actual positive number, starting from 1 onwards.<br />
<br />
Add Items with Custom Prices:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_price_items(ItemID1 =&gt; Price1, etc.)<br />
sell_price_items(ItemID1 =&gt; Price1, etc.)</code></div></div><br />
Add Weapons with Custom Prices:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_price_weapons(WeaponID1 =&gt; Price1, etc.)<br />
sell_price_weapons(WeaponID1 =&gt; Price1, etc.)</code></div></div><br />
Add Armors with Custom Prices:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_price_armors(ArmorID1 =&gt; Price1, etc.)<br />
sell_price_armors(ArmorID1 =&gt; Price1, etc.)</code></div></div><br />
Change Custom Price Shop's Friendship Points - Number stands for any number, either positive or negative.<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>price_shop_friend_points(Number)</code></div></div><br />
Set Minimum Friendship Level for Certain Items, Weapons or Armors - Types: 0 - Item, 1 - Weapon, 2 - Armor<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>price_shop_friendship_min(Mininum, Type, ItemID1, etc.)</code></div></div><br />
Set the Lowest Level The Friendship Points can reach: Number should be equal to 0 or less.<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>price_shop_friend_floor(Number)</code></div></div><br />
Change Custom Price Shop's No Transaction Penalty - Number stands for 0 or any positive number. Default Value: 1.<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>price_shop_set_no_action_penalty(Number)</code></div></div><br />
Reward Your Loyal Customers with Items:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_gifts_items(ItemID, ItemsMin, GiftItemID, Number)</code></div></div><br />
Reward Your Loyal Customers with Weapons:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_gifts_weapons(ItemID, ItemsMin, GiftItemID, Number)</code></div></div><br />
Reward Your Loyal Customers with Armors:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_gifts_armors(ItemID, ItemsMin, GiftItemID, Number)</code></div></div><br />
Punish the Player for Selling the "Wrong" Items: LostPoints stands for 1 or above.<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sell_price_wrong_items(ItemID1 =&gt; LostPoints, etc.)</code></div></div><br />
Punish the Player for Selling the "Wrong" Weapons:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sell_price_wrong_weapons(WeaponID1 =&gt; LostPoints, etc.)</code></div></div><br />
Punish the Player for Selling the "Wrong" Armors:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sell_price_wrong_armors(ArmorID1 =&gt; LostPoints, etc.)</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">The Script</span></span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * KustomPriceShop XP * #<br />
#   Scripter : Kyonides<br />
#   v1.0.0 - 2026-05-23<br />
<br />
# Create a special shop that offers:<br />
# - Setting custom prices for specific items.<br />
# - Setting certain goods as highly undesirable, making the party lose<br />
#   friendship points at that shop.<br />
# - Rewarding loyal customers with free gifts if they buy a given amount of<br />
#   items or weapons or armors.<br />
# - Creating purchase-only or sell-only shops.<br />
<br />
# To keep it separate from normal shops, set the shop's ID via a game variable.<br />
# You can change the maximum number of units per item allowed in your game.<br />
# It also allows you to set a backdrop as well instead of the current map.<br />
# Leaving the shop without doing anything will decrease the shop's friendship<br />
# points by 1 (default value).<br />
<br />
# * Optional Script Calls For The Active Shop * #<br />
<br />
# - Add Items with Custom Prices:<br />
# buy_price_items(ItemID1 =&gt; Price1, etc.)<br />
# sell_price_items(ItemID1 =&gt; Price1, etc.)<br />
<br />
# - Add Weapons with Custom Prices:<br />
# buy_price_weapons(WeaponID1 =&gt; Price1, etc.)<br />
# sell_price_weapons(WeaponID1 =&gt; Price1, etc.)<br />
<br />
# - Add Armors with Custom Prices:<br />
# buy_price_armors(ArmorID1 =&gt; Price1, etc.)<br />
# sell_price_armors(ArmorID1 =&gt; Price1, etc.)<br />
<br />
# - Change Custom Price Shop's Friendship Points:<br />
#   Number stands for any number, either positive or negative.<br />
# price_shop_friend_points(Number)<br />
<br />
# - Set Minimum Friendship Level for Certain Items, Weapons or Armors:<br />
#   Types: 0 - Item, 1 - Weapon, 2 - Armor<br />
# price_shop_friendship_min(Mininum, Type, ItemID1, etc.)<br />
<br />
# - Set the Lowest Level The Friendship Points can reach: 0 or less.<br />
# price_shop_friend_floor(Number)<br />
<br />
# - Change Custom Price Shop's No Transaction Penalty:<br />
#   Number stands for 0 or any positive number. Default Value: 1.<br />
# price_shop_set_no_action_penalty(Number)<br />
<br />
# - Reward Your Loyal Customers with Items:<br />
# buy_gifts_items(ItemID, ItemsMin, GiftItemID, Number)<br />
<br />
# - Reward Your Loyal Customers with Weapons:<br />
# buy_gifts_weapons(ItemID, ItemsMin, GiftItemID, Number)<br />
<br />
# - Reward Your Loyal Customers with Armors:<br />
# buy_gifts_armors(ItemID, ItemsMin, GiftItemID, Number)<br />
<br />
# - Punish the Player for Selling the Wrong Items:<br />
# sell_price_wrong_items(ItemID1 =&gt; LostPoints, etc.)<br />
<br />
# - Punish the Player for Selling the Wrong Weapons:<br />
# sell_price_wrong_weapons(WeaponID1 =&gt; LostPoints, etc.)<br />
<br />
# - Punish the Player for Selling the Wrong Armors:<br />
# sell_price_wrong_armors(ArmorID1 =&gt; LostPoints, etc.)<br />
<br />
module KustomPrice<br />
  ITEM_MAX = 99<br />
  BUY_ONLY_SWITCH  = 8<br />
  SELL_ONLY_SWITCH = 9<br />
  SHOP_ID_VAR = 10<br />
  DEFAULT_BACKDROP = "012-PortTown02"<br />
  FRIENDSHIP_LEVEL = "Friendship Level: %s"<br />
  SPECIAL_REWARDS  = "Special Rewards"<br />
<br />
  class Shop<br />
    class Gifts<br />
      def initialize(item_min, item_id, n)<br />
        @item_min = item_min<br />
        @item_id = item_id<br />
        @amount = n<br />
      end<br />
      attr_reader :item_min, :item_id, :amount<br />
    end<br />
<br />
    def initialize<br />
      @friendship = 0<br />
      @friendship_floor = 0<br />
      @no_action_penalty = 1<br />
      @friendship_min = {}<br />
      @buy_prices = {}<br />
      @sell_prices = {}<br />
      @buy_item_max = {}<br />
      @sell_item_max = {}<br />
      @buy_gifts = {}<br />
      @sell_wrong_goods = {}<br />
      @friendship_min.default = {}<br />
      @buy_prices.default = {}<br />
      @sell_prices.default = {}<br />
      @buy_gifts.default = {}<br />
      @sell_wrong_goods.default = {}<br />
      @buy_item_max.default = ITEM_MAX<br />
      @sell_item_max.default = ITEM_MAX<br />
    end<br />
<br />
    def friendship=(n)<br />
      @friendship = [@friendship + n, @friendship_floor].max<br />
    end<br />
<br />
    def no_action_penalty!<br />
      self.friendship -= @no_action_penalty<br />
    end<br />
<br />
    def frienship_min(mininum, type, *items)<br />
      fmin = @friendship_min[type]<br />
      items.flatten.each {|n| fmin[n] = mininum }<br />
      mininum<br />
    end<br />
<br />
    def set_buy_prices(type, data={})<br />
      @buy_prices[type].merge!(data)<br />
    end<br />
<br />
    def set_sell_prices(type, data={})<br />
      @sell_prices[type].merge!(data)<br />
    end<br />
<br />
    def set_buy_gifts(type, parent_id, item_min, item_id, n)<br />
      @buy_gifts[type][parent_id] = Gifts.new(item_min, item_id, n)<br />
    end<br />
<br />
    def sell_wrong_goods(type, data={})<br />
      @sell_wrong_goods[type].merge!(data)<br />
    end<br />
    attr_reader :friendship, :friendship_floor, :friendship_min<br />
    attr_reader :buy_prices, :sell_prices, :buy_gifts<br />
    attr_reader :buy_item_max, :sell_item_max, :sell_wrong_goods<br />
    attr_accessor :goods, :no_action_penalty<br />
  end<br />
end<br />
<br />
class Game_System<br />
  alias :kyon_kp_shop_gm_sys_init :initialize<br />
  def initialize<br />
    kyon_kp_shop_gm_sys_init<br />
    reset_price_shop_id!<br />
    @custom_price_shops = {}<br />
  end<br />
<br />
  def reset_price_shop_id!<br />
    @price_shop_id = 0<br />
  end<br />
<br />
  def init_price_shop(shop_id)<br />
    @price_shop_id = shop_id<br />
    @custom_price_shops[shop_id] ||= KustomPrice::Shop.new<br />
  end<br />
<br />
  def setup_price_shop(shop_id, new_goods)<br />
    shop = @custom_price_shops[shop_id]<br />
    shop.goods = new_goods<br />
  end<br />
<br />
  def this_price_shop<br />
    @custom_price_shops[@price_shop_id]<br />
  end<br />
  attr_reader :custom_price_shops<br />
end<br />
<br />
class Game_Party<br />
  def bag_items<br />
    @items<br />
  end<br />
<br />
  def bag_weapons<br />
    @weapons<br />
  end<br />
<br />
  def bag_armors<br />
    @armors<br />
  end<br />
<br />
  def compact_bag_items!<br />
    @items.delete_if {|k,v| v == 0 }<br />
    @weapons.delete_if {|k,v| v == 0 }<br />
    @armors.delete_if {|k,v| v == 0 }<br />
  end<br />
end<br />
<br />
class Window_ShopCommand<br />
  def reset_disabled_items<br />
    @disabled = []<br />
  end<br />
<br />
  def disable_current_item?<br />
    @disabled[@index]<br />
  end<br />
end<br />
<br />
module KustomPrice<br />
  module AddMethods<br />
    def item<br />
      @data[@index] || @no_item<br />
    end<br />
<br />
    def price<br />
      @prices[@index] || 0<br />
    end<br />
<br />
    def type<br />
      @types[@index] || 0<br />
    end<br />
<br />
    def get_price(n, item_id, price)<br />
      case @types[n]<br />
      when 0<br />
        @item_prices[item_id] || price<br />
      when 1<br />
        @weapon_prices[item_id] || price<br />
      when 2<br />
        @armor_prices[item_id] || price<br />
      end<br />
    end<br />
  end<br />
<br />
class ShopBuyWindow &lt; Window_Selectable<br />
  include AddMethods<br />
  attr_accessor :shop_goods<br />
  def initialize(shop, shop_goods)<br />
    w = 368<br />
    @tw = w - 64<br />
    super(0, 288, w, 192)<br />
    sp = shop.buy_prices<br />
    @item_prices   = sp[0]<br />
    @weapon_prices = sp[1]<br />
    @armor_prices  = sp[2]<br />
    @shop_goods = shop_goods.dup<br />
    @no_item = RPG::Item.new<br />
    @transparent = Color.new(0, 0, 0, 0)<br />
    @symbol_color = Color.new(255, 255, 80)<br />
    @symbol = &#36;data_system.words.gold<br />
    refresh<br />
    self.index = 0<br />
  end<br />
<br />
  def item_name<br />
    self.item.name<br />
  end<br />
<br />
  def set_goods(goods_item)<br />
    type, goods_id = goods_item<br />
    case type<br />
    when 0<br />
      [type, &#36;data_items[goods_id]]<br />
    when 1<br />
      [type, &#36;data_weapons[goods_id]]<br />
    when 2<br />
      [type, &#36;data_armors[goods_id]]<br />
    end<br />
  end<br />
<br />
  def refresh<br />
    if self.contents != nil<br />
      self.contents.dispose<br />
      self.contents = nil<br />
    end<br />
    @types = []<br />
    @data = []<br />
    @prices = []<br />
    for goods_item in @shop_goods<br />
      type, item = set_goods(goods_item)<br />
      next unless item<br />
      n = @types.size<br />
      @types &lt;&lt; type<br />
      @data &lt;&lt; item<br />
      @prices &lt;&lt; get_price(n, item.id, item.price)<br />
    end<br />
    draw_items<br />
  end<br />
<br />
  def draw_items<br />
    @item_max = @data.size<br />
    self.contents = Bitmap.new(width - 32, row_max * 32) if @item_max &gt; 0<br />
    @item_max.times {|i| draw_item(i) }<br />
  end<br />
<br />
  def clear_line(rx, ry)<br />
    rect = Rect.new(rx, ry, self.width - 32, 32)<br />
    self.contents.fill_rect(rect, @transparent)<br />
  end<br />
<br />
  def draw_item(n)<br />
    item = @data[n]<br />
    font = self.contents.font<br />
    price = @prices[n]<br />
    if &#36;game_party.gold &gt;= price<br />
      font.color = normal_color<br />
      alpha = 255<br />
    else<br />
      font.color = disabled_color<br />
      alpha = 128<br />
    end<br />
    ry = n * 32<br />
    clear_line(4, ry)<br />
    bitmap = RPG::Cache.icon(item.icon_name)<br />
    self.contents.blt(28, ry + 4, bitmap, Rect.new(0, 0, 24, 24), alpha)<br />
    self.contents.draw_text(56, ry, @tw - 100, 32, item.name)<br />
    self.contents.draw_text(@tw - 92, ry, 100, 32, price.to_s, 2)<br />
    @symbol_color.alpha = alpha<br />
    font.color = @symbol_color<br />
    self.contents.draw_text(@tw, ry, 24, 32, @symbol, 2)<br />
  end<br />
<br />
  def update_help<br />
    @help_window.set_text(self.item.description)<br />
  end<br />
<br />
  def delete_item<br />
    @shop_goods.delete(@index)<br />
    item = @data.delete(@index)<br />
    self.contents.dispose if self.contents != nil<br />
    self.contents = nil<br />
    draw_items<br />
  end<br />
<br />
  def disable_item(n)<br />
    draw_item(n, disabled_color)<br />
    @disabled[n] = true<br />
  end<br />
end<br />
<br />
class ShopSellWindow &lt; Window_Selectable<br />
  include AddMethods<br />
  def initialize(shop)<br />
    super(0, 128, 640, 352)<br />
    @column_max = 2<br />
    @no_item = RPG::Item.new<br />
    sp = shop.sell_prices<br />
    @item_prices   = sp[0]<br />
    @weapon_prices = sp[1]<br />
    @armor_prices  = sp[2]<br />
    refresh<br />
    self.index = 0<br />
  end<br />
<br />
  def refresh<br />
    if self.contents != nil<br />
      self.contents.dispose<br />
      self.contents = nil<br />
    end<br />
    @types = []<br />
    @data = []<br />
    @prices = []<br />
    n = 0<br />
    &#36;game_party.bag_items.sort.each do |k,v|<br />
      next if &#36;game_party.item_number(k) == 0<br />
      @types &lt;&lt; 0<br />
      @data &lt;&lt; obj = &#36;data_items[k]<br />
      @prices &lt;&lt; get_price(n, k, obj.price / 2)<br />
      n += 1<br />
    end<br />
    &#36;game_party.bag_weapons.sort.each do |k,v|<br />
      next if &#36;game_party.weapon_number(i) == 0<br />
      @types &lt;&lt; 1<br />
      @data &lt;&lt; obj = &#36;data_weapons[k]<br />
      @prices &lt;&lt; get_price(n, k, obj.price / 2)<br />
      n += 1<br />
    end<br />
    &#36;game_party.bag_armors.sort.each do |k,v|<br />
      next if &#36;game_party.armor_number(i) == 0<br />
      @types &lt;&lt; 2<br />
      @data &lt;&lt; obj = &#36;data_armors[k]<br />
      @prices &lt;&lt; get_price(n, k, obj.price / 2)<br />
      n += 1<br />
    end<br />
    @item_max = @data.size<br />
    return if @item_max == 0<br />
    self.contents = Bitmap.new(width - 32, row_max * 32)<br />
    @item_max.times {|n| draw_item(n) }<br />
  end<br />
<br />
  def draw_item(n)<br />
    item = @data[n]<br />
    case item<br />
    when RPG::Item<br />
      number = &#36;game_party.item_number(item.id)<br />
    when RPG::Weapon<br />
      number = &#36;game_party.weapon_number(item.id)<br />
    when RPG::Armor<br />
      number = &#36;game_party.armor_number(item.id)<br />
    end<br />
    price = @prices[n]<br />
    if price &gt; 0<br />
      self.contents.font.color = normal_color<br />
    else<br />
      self.contents.font.color = disabled_color<br />
    end<br />
    x = 4 + n % 2 * (288 + 32)<br />
    y = n / 2 * 32<br />
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)<br />
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))<br />
    bitmap = RPG::Cache.icon(item.icon_name)<br />
    opacity = self.contents.font.color == normal_color ? 255 : 128<br />
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)<br />
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)<br />
    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)<br />
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)<br />
  end<br />
<br />
  def update_help<br />
    @help_window.set_text(self.item.description)<br />
  end<br />
end<br />
<br />
class ShopGiftWindow &lt; Window_Selectable<br />
  def initialize<br />
    super(160, 144, 320, 128)<br />
    @w = width - 32<br />
    @h = height - 32<br />
    @types = []<br />
    @gifts = []<br />
    @amounts = []<br />
    @pages = 0<br />
    @index = 0<br />
  end<br />
<br />
  def set_gifts(list)<br />
    list.each do |type, gift, n|<br />
      @types &lt;&lt; type<br />
      @gifts &lt;&lt; gift<br />
      @amounts &lt;&lt; n<br />
    end<br />
    @pages = list.size<br />
    refresh<br />
  end<br />
<br />
  def change_page(n)<br />
    return if @pages == 1<br />
    @index = (@index + n) % @pages<br />
    refresh<br />
  end<br />
<br />
  def refresh<br />
    page = @index + 1<br />
    label = "Page " + page.to_s + "/" + @pages.to_s<br />
    n = @amounts[@index]<br />
    b = Bitmap.new(@w, @h)<br />
    font = b.font<br />
    font.color = system_color<br />
    b.draw_text(0, 0, @w, 32, SPECIAL_REWARDS, 1)<br />
    good = get_good<br />
    font.color = normal_color<br />
    b.draw_text(0, 32, @w, 32, good.name)<br />
    b.draw_text(0, 32, @w, 32, n.to_s, 2)<br />
    b.draw_text(0, 64, @w, 32, label, 2)<br />
    self.contents = b<br />
  end<br />
<br />
  def get_good<br />
    item_id = @gifts[@index]<br />
    case @types[@index]<br />
    when 0<br />
      return &#36;data_items[item_id]<br />
    when 1<br />
      return &#36;data_weapons[item_id]<br />
    when 2<br />
      return &#36;data_armors[item_id]<br />
    end<br />
  end<br />
end<br />
<br />
end<br />
<br />
class Interpreter<br />
  alias :kyon_kp_shop_int_chng_vars :command_122<br />
  def command_122<br />
    kyon_kp_shop_int_chng_vars<br />
    var_id = @parameters[0]<br />
    return unless KustomPrice::SHOP_ID_VAR == var_id<br />
    var_id = @parameters[4]<br />
    @price_shop = &#36;game_system.init_price_shop(var_id)<br />
  end<br />
<br />
  def price_shop_friend_points(n)<br />
    @price_shop.friendship += n<br />
  end<br />
<br />
  def price_shop_friend_floor(n)<br />
    @price_shop.friendship_floor = n<br />
  end<br />
<br />
  def price_shop_friendship_min(min, type, *items)<br />
    @price_shop.frienship_min(min, type, *items)<br />
  end<br />
<br />
  def price_shop_set_no_action_penalty(n)<br />
    @price_shop.no_action_penalty = n<br />
  end<br />
<br />
  def buy_price_items(data={})<br />
    @price_shop.set_buy_prices(0, data)<br />
  end<br />
<br />
  def buy_price_weapons(data={})<br />
    @price_shop.set_buy_prices(1, data)<br />
  end<br />
<br />
  def buy_price_armors(data={})<br />
    @price_shop.set_buy_prices(2, data)<br />
  end<br />
<br />
  def sell_price_items(data={})<br />
    @price_shop.set_sell_prices(0, data)<br />
  end<br />
<br />
  def sell_price_weapons(data={})<br />
    @price_shop.set_sell_prices(1, data)<br />
  end<br />
<br />
  def sell_price_armors(data={})<br />
    @price_shop.set_sell_prices(2, data)<br />
  end<br />
<br />
  def buy_gifts_items(item_id, item_min, gift_item_id, n)<br />
    @price_shop.set_buy_gifts(0, item_id, item_min, gift_item_id, n)<br />
  end<br />
<br />
  def buy_gifts_weapons(item_id, item_min, gift_item_id, n)<br />
    @price_shop.set_buy_gifts(1, item_id, item_min, gift_item_id, n)<br />
  end<br />
<br />
  def buy_gifts_armors(item_id, item_min, gift_item_id, n)<br />
    @price_shop.set_buy_gifts(2, item_id, item_min, gift_item_id, n)<br />
  end<br />
  <br />
  def sell_price_wrong_items(data={})<br />
    @price_shop.sell_wrong_goods(0, data)<br />
  end<br />
<br />
  def sell_price_wrong_weapons(data={})<br />
    @price_shop.sell_wrong_goods(1, data)<br />
  end<br />
<br />
  def sell_price_wrong_armors(data={})<br />
    @price_shop.sell_wrong_goods(2, data)<br />
  end<br />
end<br />
<br />
class Scene_Map<br />
  def call_shop<br />
    &#36;game_temp.shop_calling = false<br />
    &#36;game_player.straighten<br />
    shop_var = KustomPrice::SHOP_ID_VAR<br />
    if &#36;game_variables[shop_var] != 0<br />
      &#36;scene = PriceShopScene.new<br />
    else<br />
      &#36;scene = Scene_Shop.new<br />
    end<br />
  end<br />
end<br />
<br />
class PriceShopScene &lt; Scene_Shop<br />
  include KustomPrice<br />
  def find_shop_id<br />
    &#36;game_variables[SHOP_ID_VAR]<br />
  end<br />
<br />
  def main<br />
    prepare_goods<br />
    make_backdrop<br />
    make_windows<br />
    Graphics.transition<br />
    loop do<br />
      Graphics.update<br />
      Input.update<br />
      update<br />
      if &#36;scene != self<br />
        break<br />
      end<br />
    end<br />
    Graphics.freeze<br />
    dispose_windows<br />
    reset_price_shop<br />
  end<br />
<br />
  def prepare_goods<br />
    &#36;game_party.compact_bag_items!<br />
    @transactions = 0<br />
    @shop_id = find_shop_id<br />
    @shop = &#36;game_system.this_price_shop<br />
    @fp = @shop.friendship<br />
    @fp_min = @shop.friendship_min<br />
    @goods = @shop.goods || &#36;game_temp.shop_goods<br />
    setup_friendly_goods<br />
  end<br />
<br />
  def setup_friendly_goods<br />
    @gifts = []<br />
    @shop_goods = []<br />
    @goods.each do |type, obj_id|<br />
      group = @fp_min[type]<br />
      level = group[obj_id] || 0<br />
      @shop_goods &lt;&lt; [type, obj_id] if level == 0 or level &lt;= @fp<br />
    end<br />
    @exclude_goods = @shop_goods.size != @goods.size<br />
  end<br />
<br />
  def make_backdrop<br />
    @backdrop = Sprite.new<br />
    @backdrop.bitmap = RPG::Cache.battleback(DEFAULT_BACKDROP)<br />
  end<br />
<br />
  def make_windows<br />
    @help_window = Window_Help.new<br />
    show_friendship_level<br />
    @command_window = Window_ShopCommand.new<br />
    @command_window.reset_disabled_items<br />
    @command_window.disable_item(0) if &#36;game_switches[SELL_ONLY_SWITCH]<br />
    @command_window.disable_item(1) if &#36;game_switches[BUY_ONLY_SWITCH]<br />
    @gold_window = Window_Gold.new<br />
    @gold_window.x = 480<br />
    @gold_window.y = 64<br />
    @dummy_window = Window_Base.new(0, 288, 640, 192)<br />
    @buy_window = ShopBuyWindow.new(@shop, @shop_goods)<br />
    @buy_window.active = false<br />
    @buy_window.visible = false<br />
    @buy_window.help_window = @help_window<br />
    @sell_window = ShopSellWindow.new(@shop)<br />
    @sell_window.active = false<br />
    @sell_window.visible = false<br />
    @sell_window.help_window = @help_window<br />
    @number_window = Window_ShopNumber.new<br />
    @number_window.active = false<br />
    @number_window.visible = false<br />
    @status_window = Window_ShopStatus.new<br />
    @status_window.visible = false<br />
    @gift_window = ShopGiftWindow.new<br />
    @gift_window.visible = false<br />
  end<br />
<br />
  def show_friendship_level<br />
    points = @shop.friendship.to_s<br />
    points = sprintf(FRIENDSHIP_LEVEL, points)<br />
    @help_window.set_text(points)<br />
  end<br />
<br />
  def update<br />
    if @show_gifts<br />
      update_show_gifts<br />
      return<br />
    end<br />
    super<br />
  end<br />
<br />
  def update_show_gifts<br />
    if Input.trigger?(Input::B) or Input.trigger?(Input::C)<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      &#36;scene = Scene_Map.new<br />
      return @show_gifts = nil<br />
    elsif Input.trigger?(Input::LEFT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @gift_window.change_page(-1)<br />
      return<br />
    elsif Input.trigger?(Input::RIGHT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @gift_window.change_page(1)<br />
    end<br />
  end<br />
<br />
  def update_command<br />
    if Input.trigger?(Input::B)<br />
      if @get_gifts<br />
        &#36;game_system.se_play(&#36;data_system.shop_se)<br />
        @command_window.index = -1<br />
        @gift_window.set_gifts(@gifts)<br />
        @gift_window.visible = true<br />
        Graphics.screenshot<br />
        @get_gifts = nil<br />
        return @show_gifts = true<br />
      else<br />
        &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
        &#36;scene = Scene_Map.new<br />
      end<br />
      return<br />
    elsif Input.trigger?(Input::C)<br />
      if @command_window.disable_current_item?<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      case @command_window.index<br />
      when 0<br />
        open_purchase<br />
      when 1<br />
        open_sale<br />
      when 2<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        &#36;scene = Scene_Map.new<br />
      end<br />
    end<br />
  end<br />
<br />
  def open_purchase<br />
    &#36;game_system.se_play(&#36;data_system.decision_se)<br />
    @command_window.active = false<br />
    @dummy_window.visible = false<br />
    @buy_window.active = true<br />
    @buy_window.visible = true<br />
    @buy_window.refresh<br />
    @status_window.visible = true<br />
  end<br />
<br />
  def open_sale<br />
    &#36;game_system.se_play(&#36;data_system.decision_se)<br />
    @command_window.active = false<br />
    @dummy_window.visible = false<br />
    @sell_window.active = true<br />
    @sell_window.visible = true<br />
    @sell_window.refresh<br />
  end<br />
<br />
  def update_buy<br />
    @status_window.item = @buy_window.item<br />
    if Input.trigger?(Input::B)<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      @command_window.active = true<br />
      @dummy_window.visible = true<br />
      @buy_window.active = false<br />
      @buy_window.visible = false<br />
      @status_window.visible = false<br />
      @status_window.item = nil<br />
      show_friendship_level<br />
      return<br />
    elsif Input.trigger?(Input::C)<br />
      @item = @buy_window.item<br />
      price = @buy_window.price<br />
      if @item == nil or &#36;game_party.gold &lt; price<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      case @item<br />
      when RPG::Item<br />
        number = &#36;game_party.item_number(@item.id)<br />
      when RPG::Weapon<br />
        number = &#36;game_party.weapon_number(@item.id)<br />
      when RPG::Armor<br />
        number = &#36;game_party.armor_number(@item.id)<br />
      end<br />
      if ITEM_MAX == number<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      &#36;game_system.se_play(&#36;data_system.decision_se)<br />
      max = price == 0 ? ITEM_MAX : &#36;game_party.gold / price<br />
      max = [max, ITEM_MAX - number].min<br />
      @buy_window.active = false<br />
      @buy_window.visible = false<br />
      @number_window.set(@item, max, price)<br />
      @number_window.active = true<br />
      @number_window.visible = true<br />
    end<br />
  end<br />
<br />
  def update_sell<br />
    if Input.trigger?(Input::B)<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      @command_window.active = true<br />
      @dummy_window.visible = true<br />
      @sell_window.active = false<br />
      @sell_window.visible = false<br />
      @status_window.item = nil<br />
      show_friendship_level<br />
      return<br />
    elsif Input.trigger?(Input::C)<br />
      @item = @sell_window.item<br />
      @status_window.item = @item<br />
      price = @sell_window.price<br />
      if @item == nil or price == 0<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      &#36;game_system.se_play(&#36;data_system.decision_se)<br />
      case @item<br />
      when RPG::Item<br />
        number = &#36;game_party.item_number(@item.id)<br />
      when RPG::Weapon<br />
        number = &#36;game_party.weapon_number(@item.id)<br />
      when RPG::Armor<br />
        number = &#36;game_party.armor_number(@item.id)<br />
      end<br />
      total = number<br />
      @sell_window.active = false<br />
      @sell_window.visible = false<br />
      @number_window.set(@item, total, price)<br />
      @number_window.active = true<br />
      @number_window.visible = true<br />
      @status_window.visible = true<br />
    end<br />
  end<br />
<br />
  def update_number<br />
    if Input.trigger?(Input::B)<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      @number_window.active = false<br />
      @number_window.visible = false<br />
      case @command_window.index<br />
      when 0  # buy<br />
        @buy_window.active = true<br />
        @buy_window.visible = true<br />
      when 1  # sell<br />
        @sell_window.active = true<br />
        @sell_window.visible = true<br />
        @status_window.visible = false<br />
      end<br />
      return<br />
    elsif Input.trigger?(Input::C)<br />
      &#36;game_system.se_play(&#36;data_system.shop_se)<br />
      @number_window.active = false<br />
      @number_window.visible = false<br />
      item_id = @item.id<br />
      n = @number_window.number<br />
      @transactions += n<br />
      case @command_window.index<br />
      when 0  # buy<br />
        update_number_buy(item_id, n)<br />
        return<br />
      when 1  # sell<br />
        type = @sell_window.type<br />
        lost_points = @shop.sell_wrong_goods[type][item_id] || 0<br />
        if lost_points &gt; 0<br />
          @shop.friendship -= lost_points * n<br />
        else<br />
          @shop.friendship += n<br />
        end<br />
        price = @sell_window.price<br />
        &#36;game_party.gain_gold(n * price)<br />
        case @item<br />
        when RPG::Item<br />
          &#36;game_party.lose_item(item_id, n)<br />
        when RPG::Weapon<br />
          &#36;game_party.lose_weapon(item_id, n)<br />
        when RPG::Armor<br />
          &#36;game_party.lose_armor(item_id, n)<br />
        end<br />
        @gold_window.refresh<br />
        @sell_window.refresh<br />
        @status_window.refresh<br />
        @sell_window.active = true<br />
        @sell_window.visible = true<br />
        @status_window.visible = false<br />
      end<br />
    end<br />
  end<br />
<br />
  def update_number_buy(item_id, n)<br />
    @shop.friendship += n<br />
    price = @buy_window.price<br />
    &#36;game_party.lose_gold(n * price)<br />
    case @item<br />
    when RPG::Item<br />
      type = 0<br />
      &#36;game_party.gain_item(item_id, n)<br />
    when RPG::Weapon<br />
      type = 1<br />
      &#36;game_party.gain_weapon(item_id, n)<br />
    when RPG::Armor<br />
      type = 2<br />
      &#36;game_party.gain_armor(item_id, n)<br />
    end<br />
    @gold_window.refresh<br />
    if @shop.friendship != @fp<br />
      @fp = @shop.friendship<br />
      setup_friendly_goods<br />
      @buy_window.shop_goods = @shop_goods<br />
    end<br />
    @buy_window.refresh<br />
    @status_window.refresh<br />
    @buy_window.active = true<br />
    @buy_window.visible = true<br />
    gifts_list = @shop.buy_gifts[type]<br />
    gift = gifts_list[item_id]<br />
    if gift and gift.item_min &lt;= n<br />
      item_id = gift.item_id<br />
      total = n / gift.item_min * gift.amount<br />
      case type<br />
      when 0<br />
        &#36;game_party.gain_item(item_id, total)<br />
      when 1<br />
        &#36;game_party.gain_weapon(item_id, total)<br />
      when 2<br />
        &#36;game_party.gain_armor(item_id, total)<br />
      end<br />
      @gifts &lt;&lt; [type, item_id, total]<br />
      @get_gifts = true<br />
    end<br />
  end<br />
<br />
  def dispose_windows<br />
    @backdrop.bitmap.dispose<br />
    @backdrop.dispose<br />
    @help_window.dispose<br />
    @command_window.dispose<br />
    @gold_window.dispose<br />
    @dummy_window.dispose<br />
    @buy_window.dispose<br />
    @sell_window.dispose<br />
    @number_window.dispose<br />
    @status_window.dispose<br />
    @gift_window.dispose<br />
  end<br />
<br />
  def reset_price_shop<br />
    &#36;game_variables[SHOP_ID_VAR] = 0<br />
    &#36;game_switches[BUY_ONLY_SWITCH] = false<br />
    &#36;game_switches[SELL_ONLY_SWITCH] = false<br />
    &#36;game_party.compact_bag_items!<br />
    @shop.no_action_penalty! if @transactions == 0<br />
    list = @buy_window.shop_goods<br />
    if !@exclude_goods and list.size != @shop_goods.size<br />
      &#36;game_system.setup_price_shop(@shop_id, list)<br />
    end<br />
    &#36;game_system.reset_price_shop_id!<br />
  end<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
Free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer.<br />
Mention me in your game credits.<br />
You may also add the forum's name and URL there.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Face Sync System Core]]></title>
			<link>https://www.save-point.org/thread-13458.html</link>
			<pubDate>Fri, 10 Apr 2026 23:20:44 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13458.html</guid>
			<description><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Face Sync System Core</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.0</span></div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
The Face Sync System  is perhaps the first of its kind  within the RPG Maker community. <br />
<br />
Based on a concept by Bethesda Softworks and its lip-file system,  Face Sync is a software package that takes the contents of a pre-generated timing data file and then,  with that timing, it then displays individual animation cels in concert atop  of s designated sprite, whether it is a character sprite on the field map, a character portrait shown within a custom message window, or the like.<br />
<br />
The system core covers most of the necessary mechanics, creating the sprites that are rendered, the retrieval of graphics and the timing data,  the animation functions, and their removal.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><br />
<ul class="mycode_list"><li>Custom data files that will cache like any other in the data folder</li>
<li>Includes two example scripts showing how to make the requisite data files</li>
<li>Includes a Message Adaptation script to allow face sync in message portraits</li>
<li>Includes a Character Set script to allow face sync on field map sprites</li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Limitations</span></span><br />
<ul class="mycode_list"><li>Apparently, only one NPC animation per patch script at any one time.  You can show lips syncs occur on a character in the field map and in a message profile pic at the same time, but not two character set sprites on the map at the same time.</li>
<li>Map Movement may affect the accuracy of the Face Sync animations</li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Screenshots</span></span><br />
<br />
You'd literally be watching someone open and close their mouth.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<br />
<a href="https://app.box.com/s/nooplfix63y3al0ggpbufwt7dknr6wxg" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Box Com Download</span></a><br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Plenty, but in the script<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
The main core system does not interfere with any content.  It requires patch scripts to connect it to suitable message systems (included in the demo).<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
Thanks to Remi-Chan for the use of Esperia Frostwhisper from her gaming universe for this demo.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free to use,  even in commercial projects.  However, I will need some form of due credit.<br />
<br />
Esperia Frostwhisper - the sole property of Remi-Chan.  All Rights Reserved.]]></description>
			<content:encoded><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Face Sync System Core</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.0</span></div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
The Face Sync System  is perhaps the first of its kind  within the RPG Maker community. <br />
<br />
Based on a concept by Bethesda Softworks and its lip-file system,  Face Sync is a software package that takes the contents of a pre-generated timing data file and then,  with that timing, it then displays individual animation cels in concert atop  of s designated sprite, whether it is a character sprite on the field map, a character portrait shown within a custom message window, or the like.<br />
<br />
The system core covers most of the necessary mechanics, creating the sprites that are rendered, the retrieval of graphics and the timing data,  the animation functions, and their removal.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><br />
<ul class="mycode_list"><li>Custom data files that will cache like any other in the data folder</li>
<li>Includes two example scripts showing how to make the requisite data files</li>
<li>Includes a Message Adaptation script to allow face sync in message portraits</li>
<li>Includes a Character Set script to allow face sync on field map sprites</li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Limitations</span></span><br />
<ul class="mycode_list"><li>Apparently, only one NPC animation per patch script at any one time.  You can show lips syncs occur on a character in the field map and in a message profile pic at the same time, but not two character set sprites on the map at the same time.</li>
<li>Map Movement may affect the accuracy of the Face Sync animations</li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Screenshots</span></span><br />
<br />
You'd literally be watching someone open and close their mouth.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<br />
<a href="https://app.box.com/s/nooplfix63y3al0ggpbufwt7dknr6wxg" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Box Com Download</span></a><br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Plenty, but in the script<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
The main core system does not interfere with any content.  It requires patch scripts to connect it to suitable message systems (included in the demo).<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
Thanks to Remi-Chan for the use of Esperia Frostwhisper from her gaming universe for this demo.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free to use,  even in commercial projects.  However, I will need some form of due credit.<br />
<br />
Esperia Frostwhisper - the sole property of Remi-Chan.  All Rights Reserved.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Cammy's Anti-Lag]]></title>
			<link>https://www.save-point.org/thread-13422.html</link>
			<pubDate>Sun, 22 Feb 2026 06:12:50 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13422.html</guid>
			<description><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Cammy's Anti-Lag</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.1</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This is a simple-to-use but comprehensive system designed to greatly reduce the amount of lag  within the field map  when an abundance of events exist. It also has the chance to reduce lag when a game developer has an extensive number of common events in play.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><ul class="mycode_list"><li>Its an ANTI-LAG.  Main focus is to only let events in view function<br />
</li>
<li>Has a simple ON/OFF function by defining an RPGMaker XP Switch<br />
</li>
<li>Does not rewrite or replace key event or sprite arrays<br />
</li>
<li>Allows events so-defined to always run despite being in view or not<br />
</li>
<li>Allows events so-defined to never run, basically turning them into tiles<ul class="mycode_list"><li>Events can be defined within their name or by a script call<br />
</li>
<li>Event names are checked the moment you enter the field map <br />
</li>
<li>Script call changes only affect the map on each entry, not saved</li>
</ul>
</li>
<li>Recognizes AutoRun and parallel process events to always run<br />
</li>
<li>Recognizes events given a scripted "Set Move Route" to run until done<br />
</li>
<li>Limits common events being updated, removing 'trigger only' from the list<ul class="mycode_list"><li>Common events are auto-sorted the first time you enter the field map</li>
</ul>
</li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<br />
<a href="https://app.box.com/s/8wo25h2oh7gs6ddvvt8d4mpf3z7wqdnk" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Demo at Box.Com</span></a><br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Plenty... in the script.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
Designed solely for RPGMaker XP.<br />
<br />
Requires rewrites to the Game_Map and Spriteset_Map classes.  A second script, Cammy's Anti-Lag Patch, is a simple copy of both classes with the changes clearly marked.  Those using the RMXP SDK will not require the patch.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
Thanks to Zeriab for the concept of limiting common events.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Author's Notes</span></span><br />
<br />
Making a map with 999 events is time consuming.   Making four virtually identical maps with a lot of individual names with custom anti-lag tags is probably borderline insane.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free for use, even in commercial games.  Only due credit for both myself and Zeriab for the common event feature are required.]]></description>
			<content:encoded><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Cammy's Anti-Lag</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.1</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This is a simple-to-use but comprehensive system designed to greatly reduce the amount of lag  within the field map  when an abundance of events exist. It also has the chance to reduce lag when a game developer has an extensive number of common events in play.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><ul class="mycode_list"><li>Its an ANTI-LAG.  Main focus is to only let events in view function<br />
</li>
<li>Has a simple ON/OFF function by defining an RPGMaker XP Switch<br />
</li>
<li>Does not rewrite or replace key event or sprite arrays<br />
</li>
<li>Allows events so-defined to always run despite being in view or not<br />
</li>
<li>Allows events so-defined to never run, basically turning them into tiles<ul class="mycode_list"><li>Events can be defined within their name or by a script call<br />
</li>
<li>Event names are checked the moment you enter the field map <br />
</li>
<li>Script call changes only affect the map on each entry, not saved</li>
</ul>
</li>
<li>Recognizes AutoRun and parallel process events to always run<br />
</li>
<li>Recognizes events given a scripted "Set Move Route" to run until done<br />
</li>
<li>Limits common events being updated, removing 'trigger only' from the list<ul class="mycode_list"><li>Common events are auto-sorted the first time you enter the field map</li>
</ul>
</li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<br />
<a href="https://app.box.com/s/8wo25h2oh7gs6ddvvt8d4mpf3z7wqdnk" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Demo at Box.Com</span></a><br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Plenty... in the script.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
Designed solely for RPGMaker XP.<br />
<br />
Requires rewrites to the Game_Map and Spriteset_Map classes.  A second script, Cammy's Anti-Lag Patch, is a simple copy of both classes with the changes clearly marked.  Those using the RMXP SDK will not require the patch.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
Thanks to Zeriab for the concept of limiting common events.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Author's Notes</span></span><br />
<br />
Making a map with 999 events is time consuming.   Making four virtually identical maps with a lot of individual names with custom anti-lag tags is probably borderline insane.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free for use, even in commercial games.  Only due credit for both myself and Zeriab for the common event feature are required.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[ChooseFoes XP]]></title>
			<link>https://www.save-point.org/thread-13419.html</link>
			<pubDate>Wed, 18 Feb 2026 02:02:55 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=1471">kyonides</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13419.html</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">ChooseFoes XP</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
This scriptlet allows you to open a simple menu where you can choose your enemy's troops based on the current map's random enemy encounter list.<br />
It will use the map's battleback picture as its backdrop. Don't worry <img src="https://www.save-point.org/images/smilies/ejlol/worried.gif" alt="Worried" title="Worried" class="smilie smilie_216" /> about this, it will cover the whole RMXP game screen by default. <img src="https://www.save-point.org/images/smilies/ejlol/wink.gif" alt="Winking" title="Winking" class="smilie smilie_33" /><br />
You are encouraged to set a custom BGM, otherwise the scene will remain silent until you have finished picking a foe.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">AVAILABLE MODES</span><br />
<ul class="mycode_list"><li>:accessory<br />
</li>
<li>:levels<br />
</li>
</ul>
<br />
<span style="font-weight: bold;" class="mycode_b">Accessory Mode</span><br />
<br />
By the way, setting a specific "Choose Foe" accessory is mandatory here!<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Actors' Level Average Mode</span><br />
<br />
You must set a default level plus any specific map's average level.<br />
<br />
There's now an option to skip the random battle just because. <img src="https://www.save-point.org/images/smilies/ejlol/wink.gif" alt="Winking" title="Winking" class="smilie smilie_33" /> <br />
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">Optional Script Calls</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Change Mode:</span><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&#36;game_party.choose_foes_mode = :your_mode</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Replace the Current Map's Encounter List:</span><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&#36;game_party.new_map_troops(TroopID1, etc.)</code></div></div><br />
<div style="text-align: center;" class="mycode_align"><img src="https://i.postimg.cc/dQmrxZ6z/choosefoes-xp001.jpg" loading="lazy"  alt="[Image: choosefoes-xp001.jpg]" class="mycode_img" /></div>
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">The Script</span></span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">Version 1.1.0</span><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * ChooseFoes XP * #<br />
#   Not Exactly a Plug-n-Play Script<br />
#   Scripter : Kyonides<br />
#   1.1.0 - 2026-06-08<br />
<br />
# Aliased Methods: Game_Party#initialize, Scene_Map#call_battle<br />
<br />
# This scriptlet allows you to open a simple menu where you can choose your<br />
# enemy's troops based on the current map's random enemy encounter list.<br />
# They will be displayed on screen!<br />
<br />
# The new MAP_ID_EXTRA_TROOP hash allows you to set a key-value pair of<br />
# MapID =&gt; TroopID to add any given troop found in the Troops DB to that map.<br />
# You can replace the TroopID with a :highest or :lowest or :random symbol.<br />
# Notice: This is entirely optional. Use it only for maps that truly need it.<br />
<br />
# Thanks to DerVVulfman's evil suggestion, your players might now face a whole<br />
# new set of foes by using a very specific script call. Feel free to change<br />
# the encounter list as many times as needed. Mwahahaha!!<br />
<br />
# - AVAILABLE MODES: :accessory and :levels<br />
<br />
# * Accessory Mode * #<br />
# Setting a specific "Choose Foe" accessory is mandatory here!<br />
# * Average Level Mode * #<br />
# You must set a default level plus any specific map's average level.<br />
<br />
# * Optional Script Calls * #<br />
<br />
# * Change Current Mode:<br />
# &#36;game_party.choose_foes_mode = :your_mode<br />
<br />
# * Replace Curent Map's Troop ID's:<br />
# &#36;game_party.new_map_troops(TroopID1, etc.)<br />
<br />
module ChooseFoes<br />
  MODE = :levels<br />
  ACCESSORY_ID = 33<br />
  MAP_ACTOR_LVL = {}<br />
  MAP_ACTOR_LVL.default = 5<br />
  MAP_ACTOR_LVL[1] = 4<br />
  # MapID =&gt; [TroopID1, etc.] or [:highest] or [:lowest] or [:random]<br />
  MAP_ID_EXTRA_TROOPS = {}<br />
  MAP_ID_EXTRA_TROOPS.default = []<br />
  MAP_ID_EXTRA_TROOPS[1] = [10, 11]<br />
  TITLE = "Pick Your Foe"<br />
  NO_TROOP = "No Troop"<br />
  EXTRA_TROOP = "Special Troop"<br />
  # ["Name", Volume or nil, Pitch or nil]<br />
  BGM = ["052-Negative01", nil, nil]<br />
<br />
  class TroopWindow &lt; Window_Selectable<br />
    def initialize(width, commands)<br />
      line_max = [commands.size, 4].min + 1<br />
      @commands = commands<br />
      super(0, 0, width, line_max * 32)<br />
      @item_max = commands.size<br />
      @cw = width - 32<br />
      @rect = Rect.new(4, 0, @cw - 8, 32)<br />
      self.contents = Bitmap.new(@cw, @item_max * 32)<br />
      refresh<br />
      self.index = 0<br />
      @last_index = 0<br />
    end<br />
<br />
    def refresh<br />
      self.contents.clear<br />
      @item_max.times {|n| draw_item(n, normal_color) }<br />
    end<br />
<br />
    def draw_item(n, color)<br />
      self.contents.font.color = color<br />
      @rect.y = 32 * n<br />
      self.contents.draw_text(@rect, @commands[n])<br />
    end<br />
<br />
    def update<br />
      super<br />
      @change_troop = false<br />
      if @index != @last_index<br />
        @last_index = @index<br />
        @change_troop = true<br />
      end<br />
    end<br />
    attr_reader :change_troop<br />
  end<br />
<br />
  class Scene<br />
    def initialize(cb, replace_troops)<br />
      @callback = cb<br />
      @trooper_max = 8<br />
      @troop_max = &#36;data_troops.size - 1<br />
      @list = []<br />
      map_id = &#36;game_map.map_id<br />
      if replace_troops<br />
        @list += &#36;game_party.map_troop_ids[map_id]<br />
        @commands = @list.map {|n| &#36;data_troops[n].name }<br />
        n = rand(@list.size)<br />
        @troop_id = @list[n]<br />
      else<br />
        @list += &#36;game_map.encounter_list<br />
        @commands = @list.map {|n| &#36;data_troops[n].name }<br />
        troop_ids = MAP_ID_EXTRA_TROOPS[map_id]<br />
        if MAP_ID_EXTRA_TROOPS.has_key?(map_id)<br />
          troop_ids.each {|n| set_extra_troops(n) }<br />
        end<br />
        @troop_id = &#36;game_temp.battle_troop_id<br />
      end<br />
      @list.unshift(nil)<br />
      @commands.unshift(NO_TROOP)<br />
      @troop = Game_Troop.new<br />
      @troop.setup(@troop_id)<br />
      &#36;game_system.se_play(&#36;data_system.battle_start_se)<br />
      &#36;game_system.bgm_stop<br />
      bgm = BGM.compact<br />
      bgm = RPG::AudioFile.new(*bgm)<br />
      Audio.play_anon_bgm(bgm)<br />
    end<br />
<br />
    def set_extra_troops(troop_id)<br />
      @commands &lt;&lt; EXTRA_TROOP<br />
      case troop_id<br />
      when :lowest<br />
        @list &lt;&lt; &#36;game_party.lowest_troop_id<br />
      when :highest<br />
        @list &lt;&lt; &#36;game_party.highest_troop_id<br />
      when :random<br />
        @list &lt;&lt; &#36;game_party.random_troop_id<br />
      when 1..troop_id<br />
        n = [@troop_max, troop_id].min<br />
        @list &lt;&lt; n<br />
      end<br />
    end<br />
<br />
    def main<br />
      @stage = true<br />
      fn = &#36;game_map.battleback_name<br />
      bb = RPG::Cache.battleback(fn)<br />
      battle_bit = Bitmap.new(640, 480)<br />
      battle_bit.stretch_blt(battle_bit.rect, bb, bb.rect)<br />
      enemies = @troop.enemies<br />
      @backdrop = Sprite.new<br />
      @backdrop.bitmap = battle_bit<br />
      @vp = Viewport.new(0, 0, 640, 320)<br />
      @vp.z = 200<br />
      @battlers = []<br />
      @trooper_max.times do |n|<br />
        battler = Sprite_Battler.new(@vp, enemies[n])<br />
        battler.change(enemies[n])<br />
        @battlers &lt;&lt; battler<br />
      end<br />
      @help_window = Window_Help.new<br />
      @help_window.set_text(TITLE, 1)<br />
      @command_window = TroopWindow.new(240, @commands)<br />
      @command_window.x = 200<br />
      @command_window.y = 320<br />
      @command_window.index = @list.index(@troop_id)<br />
      Input.update<br />
      Graphics.transition(Graphics.frame_rate)<br />
      while @stage<br />
        Graphics.update<br />
        Input.update<br />
        update<br />
      end<br />
      Graphics.freeze<br />
      dispose<br />
    end<br />
<br />
    def update<br />
      @command_window.update<br />
      if @command_window.change_troop<br />
        i = @command_window.index<br />
        troop_id = @list[i]<br />
        if troop_id<br />
          @troop.setup(troop_id)<br />
        else<br />
          @troop.empty!<br />
        end<br />
        enemies = @troop.enemies<br />
        @trooper_max.times do |n|<br />
          sbattler = @battlers[n]<br />
          sbattler.change(enemies[n])<br />
        end<br />
      end<br />
      if Input.trigger?(Input::B) or Input.trigger?(Input::C)<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        @stage = nil<br />
        n = @command_window.index<br />
        troop_id = @list[n]<br />
        if troop_id<br />
          &#36;game_temp.battle_troop_id = troop_id<br />
          @callback.call<br />
          return<br />
        else<br />
          &#36;game_temp.battle_calling = false<br />
          &#36;game_temp.menu_calling = false<br />
          &#36;game_temp.menu_beep = false<br />
          &#36;game_temp.battle_troop_id = 0<br />
          &#36;game_player.make_encounter_count<br />
          &#36;game_player.straighten<br />
          &#36;game_map.autoplay<br />
          &#36;scene = Scene_Map.new<br />
        end<br />
      end<br />
    end<br />
<br />
    def dispose<br />
      @battlers.each do |s|<br />
        s.bitmap.dispose if s.bitmap<br />
        s.dispose<br />
      end<br />
      @command_window.dispose<br />
      @help_window.dispose<br />
      @vp.dispose<br />
      @backdrop.bitmap.dispose<br />
      @backdrop.dispose<br />
    end<br />
  end<br />
end<br />
<br />
module Audio<br />
  def self.play_anon_bgm(bgm)<br />
    if !bgm or bgm.name.empty?<br />
      bgm_stop<br />
    else<br />
      bgm_play("Audio/BGM/" + bgm.name, bgm.volume, bgm.pitch)<br />
    end<br />
    Graphics.frame_reset<br />
  end<br />
end<br />
<br />
class Game_Actor<br />
  def can_pick_foes?<br />
    ChooseFoes::ACCESSORY_ID == @armor4_id and @armor4_id &gt; 0<br />
  end<br />
end<br />
<br />
class Game_Party<br />
  alias :kyon_chs_foes_gm_pty_init :initialize<br />
  def initialize<br />
    kyon_chs_foes_gm_pty_init<br />
    @choose_foes_mode = ChooseFoes::MODE<br />
    @defeated_troop_ids = []<br />
    @map_troop_ids = {}<br />
  end<br />
<br />
  def choose_foes_with_accessory?<br />
    @actors.find {|a| a.can_pick_foes? } != nil<br />
  end<br />
<br />
  def choose_foes_level_avg?<br />
    avg_level = @actors.inject(0) {|t, a| t + a.level }<br />
    avg_level /= @actors.size<br />
    map_level = ChooseFoes::MAP_ACTOR_LVL[&#36;game_map.map_id]<br />
    avg_level &gt;= map_level<br />
  end<br />
<br />
  def choose_foes?<br />
    case @choose_foes_mode<br />
    when :accessory<br />
      return choose_foes_with_accessory?<br />
    when :levels<br />
      return choose_foes_level_avg?<br />
    end<br />
  end<br />
<br />
  def lowest_troop_id<br />
    @defeated_troop_ids.min || 1<br />
  end<br />
<br />
  def highest_troop_id<br />
    @defeated_troop_ids.max || 1<br />
  end<br />
<br />
  def random_troop_id<br />
    n = rand(@defeated_troop_ids.size)<br />
    @defeated_troop_ids[n] || 1<br />
  end<br />
<br />
  def new_map_troops?(map_id)<br />
    @map_troop_ids.has_key?(map_id)<br />
  end<br />
<br />
  def new_map_troops(*troop_ids)<br />
    n = &#36;game_map.map_id<br />
    @map_troop_ids[n] = troop_ids.flatten<br />
  end<br />
  attr_accessor :choose_foes_mode, :map_troop_ids<br />
  attr_reader :defeated_troop_ids<br />
end<br />
<br />
class Game_Troop<br />
  def empty!<br />
    @enemies = []<br />
  end<br />
end<br />
<br />
class Sprite_Battler<br />
  def change(battler)<br />
    @battler = battler<br />
    unless @battler<br />
      self.bitmap = nil<br />
      loop_animation(nil)<br />
      return<br />
    end<br />
    @battler_name = @battler.battler_name<br />
    @battler_hue = @battler.battler_hue<br />
    self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)<br />
    @width = self.bitmap.width<br />
    @height = self.bitmap.height<br />
    self.ox = @width / 2<br />
    self.oy = @height<br />
    self.x = @battler.screen_x<br />
    self.y = @battler.screen_y<br />
    self.z = @battler.screen_z<br />
  end<br />
end<br />
<br />
class Scene_Map<br />
  alias :kyon_chs_foes_scn_mp_cll_btl :call_battle<br />
  def call_battle<br />
    list = &#36;game_map.encounter_list<br />
    if list.size &lt; 2<br />
      kyon_chs_foes_scn_mp_cll_btl<br />
      return<br />
    else<br />
      cb = method(:kyon_chs_foes_scn_mp_cll_btl)<br />
      map_id = &#36;game_map.map_id<br />
      if &#36;game_party.new_map_troops?(map_id)<br />
        &#36;scene = ChooseFoes::Scene.new(cb, true)<br />
      elsif &#36;game_party.choose_foes?<br />
        &#36;scene = ChooseFoes::Scene.new(cb, false)<br />
      end<br />
    end<br />
  end<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">Terms &amp; Conditions</span></span><br />
<br />
Free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer.<br />
Include my nickname in your game credits.<br />
You may mention this forum there as well.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">ChooseFoes XP</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
This scriptlet allows you to open a simple menu where you can choose your enemy's troops based on the current map's random enemy encounter list.<br />
It will use the map's battleback picture as its backdrop. Don't worry <img src="https://www.save-point.org/images/smilies/ejlol/worried.gif" alt="Worried" title="Worried" class="smilie smilie_216" /> about this, it will cover the whole RMXP game screen by default. <img src="https://www.save-point.org/images/smilies/ejlol/wink.gif" alt="Winking" title="Winking" class="smilie smilie_33" /><br />
You are encouraged to set a custom BGM, otherwise the scene will remain silent until you have finished picking a foe.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">AVAILABLE MODES</span><br />
<ul class="mycode_list"><li>:accessory<br />
</li>
<li>:levels<br />
</li>
</ul>
<br />
<span style="font-weight: bold;" class="mycode_b">Accessory Mode</span><br />
<br />
By the way, setting a specific "Choose Foe" accessory is mandatory here!<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Actors' Level Average Mode</span><br />
<br />
You must set a default level plus any specific map's average level.<br />
<br />
There's now an option to skip the random battle just because. <img src="https://www.save-point.org/images/smilies/ejlol/wink.gif" alt="Winking" title="Winking" class="smilie smilie_33" /> <br />
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">Optional Script Calls</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Change Mode:</span><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&#36;game_party.choose_foes_mode = :your_mode</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Replace the Current Map's Encounter List:</span><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&#36;game_party.new_map_troops(TroopID1, etc.)</code></div></div><br />
<div style="text-align: center;" class="mycode_align"><img src="https://i.postimg.cc/dQmrxZ6z/choosefoes-xp001.jpg" loading="lazy"  alt="[Image: choosefoes-xp001.jpg]" class="mycode_img" /></div>
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">The Script</span></span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">Version 1.1.0</span><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * ChooseFoes XP * #<br />
#   Not Exactly a Plug-n-Play Script<br />
#   Scripter : Kyonides<br />
#   1.1.0 - 2026-06-08<br />
<br />
# Aliased Methods: Game_Party#initialize, Scene_Map#call_battle<br />
<br />
# This scriptlet allows you to open a simple menu where you can choose your<br />
# enemy's troops based on the current map's random enemy encounter list.<br />
# They will be displayed on screen!<br />
<br />
# The new MAP_ID_EXTRA_TROOP hash allows you to set a key-value pair of<br />
# MapID =&gt; TroopID to add any given troop found in the Troops DB to that map.<br />
# You can replace the TroopID with a :highest or :lowest or :random symbol.<br />
# Notice: This is entirely optional. Use it only for maps that truly need it.<br />
<br />
# Thanks to DerVVulfman's evil suggestion, your players might now face a whole<br />
# new set of foes by using a very specific script call. Feel free to change<br />
# the encounter list as many times as needed. Mwahahaha!!<br />
<br />
# - AVAILABLE MODES: :accessory and :levels<br />
<br />
# * Accessory Mode * #<br />
# Setting a specific "Choose Foe" accessory is mandatory here!<br />
# * Average Level Mode * #<br />
# You must set a default level plus any specific map's average level.<br />
<br />
# * Optional Script Calls * #<br />
<br />
# * Change Current Mode:<br />
# &#36;game_party.choose_foes_mode = :your_mode<br />
<br />
# * Replace Curent Map's Troop ID's:<br />
# &#36;game_party.new_map_troops(TroopID1, etc.)<br />
<br />
module ChooseFoes<br />
  MODE = :levels<br />
  ACCESSORY_ID = 33<br />
  MAP_ACTOR_LVL = {}<br />
  MAP_ACTOR_LVL.default = 5<br />
  MAP_ACTOR_LVL[1] = 4<br />
  # MapID =&gt; [TroopID1, etc.] or [:highest] or [:lowest] or [:random]<br />
  MAP_ID_EXTRA_TROOPS = {}<br />
  MAP_ID_EXTRA_TROOPS.default = []<br />
  MAP_ID_EXTRA_TROOPS[1] = [10, 11]<br />
  TITLE = "Pick Your Foe"<br />
  NO_TROOP = "No Troop"<br />
  EXTRA_TROOP = "Special Troop"<br />
  # ["Name", Volume or nil, Pitch or nil]<br />
  BGM = ["052-Negative01", nil, nil]<br />
<br />
  class TroopWindow &lt; Window_Selectable<br />
    def initialize(width, commands)<br />
      line_max = [commands.size, 4].min + 1<br />
      @commands = commands<br />
      super(0, 0, width, line_max * 32)<br />
      @item_max = commands.size<br />
      @cw = width - 32<br />
      @rect = Rect.new(4, 0, @cw - 8, 32)<br />
      self.contents = Bitmap.new(@cw, @item_max * 32)<br />
      refresh<br />
      self.index = 0<br />
      @last_index = 0<br />
    end<br />
<br />
    def refresh<br />
      self.contents.clear<br />
      @item_max.times {|n| draw_item(n, normal_color) }<br />
    end<br />
<br />
    def draw_item(n, color)<br />
      self.contents.font.color = color<br />
      @rect.y = 32 * n<br />
      self.contents.draw_text(@rect, @commands[n])<br />
    end<br />
<br />
    def update<br />
      super<br />
      @change_troop = false<br />
      if @index != @last_index<br />
        @last_index = @index<br />
        @change_troop = true<br />
      end<br />
    end<br />
    attr_reader :change_troop<br />
  end<br />
<br />
  class Scene<br />
    def initialize(cb, replace_troops)<br />
      @callback = cb<br />
      @trooper_max = 8<br />
      @troop_max = &#36;data_troops.size - 1<br />
      @list = []<br />
      map_id = &#36;game_map.map_id<br />
      if replace_troops<br />
        @list += &#36;game_party.map_troop_ids[map_id]<br />
        @commands = @list.map {|n| &#36;data_troops[n].name }<br />
        n = rand(@list.size)<br />
        @troop_id = @list[n]<br />
      else<br />
        @list += &#36;game_map.encounter_list<br />
        @commands = @list.map {|n| &#36;data_troops[n].name }<br />
        troop_ids = MAP_ID_EXTRA_TROOPS[map_id]<br />
        if MAP_ID_EXTRA_TROOPS.has_key?(map_id)<br />
          troop_ids.each {|n| set_extra_troops(n) }<br />
        end<br />
        @troop_id = &#36;game_temp.battle_troop_id<br />
      end<br />
      @list.unshift(nil)<br />
      @commands.unshift(NO_TROOP)<br />
      @troop = Game_Troop.new<br />
      @troop.setup(@troop_id)<br />
      &#36;game_system.se_play(&#36;data_system.battle_start_se)<br />
      &#36;game_system.bgm_stop<br />
      bgm = BGM.compact<br />
      bgm = RPG::AudioFile.new(*bgm)<br />
      Audio.play_anon_bgm(bgm)<br />
    end<br />
<br />
    def set_extra_troops(troop_id)<br />
      @commands &lt;&lt; EXTRA_TROOP<br />
      case troop_id<br />
      when :lowest<br />
        @list &lt;&lt; &#36;game_party.lowest_troop_id<br />
      when :highest<br />
        @list &lt;&lt; &#36;game_party.highest_troop_id<br />
      when :random<br />
        @list &lt;&lt; &#36;game_party.random_troop_id<br />
      when 1..troop_id<br />
        n = [@troop_max, troop_id].min<br />
        @list &lt;&lt; n<br />
      end<br />
    end<br />
<br />
    def main<br />
      @stage = true<br />
      fn = &#36;game_map.battleback_name<br />
      bb = RPG::Cache.battleback(fn)<br />
      battle_bit = Bitmap.new(640, 480)<br />
      battle_bit.stretch_blt(battle_bit.rect, bb, bb.rect)<br />
      enemies = @troop.enemies<br />
      @backdrop = Sprite.new<br />
      @backdrop.bitmap = battle_bit<br />
      @vp = Viewport.new(0, 0, 640, 320)<br />
      @vp.z = 200<br />
      @battlers = []<br />
      @trooper_max.times do |n|<br />
        battler = Sprite_Battler.new(@vp, enemies[n])<br />
        battler.change(enemies[n])<br />
        @battlers &lt;&lt; battler<br />
      end<br />
      @help_window = Window_Help.new<br />
      @help_window.set_text(TITLE, 1)<br />
      @command_window = TroopWindow.new(240, @commands)<br />
      @command_window.x = 200<br />
      @command_window.y = 320<br />
      @command_window.index = @list.index(@troop_id)<br />
      Input.update<br />
      Graphics.transition(Graphics.frame_rate)<br />
      while @stage<br />
        Graphics.update<br />
        Input.update<br />
        update<br />
      end<br />
      Graphics.freeze<br />
      dispose<br />
    end<br />
<br />
    def update<br />
      @command_window.update<br />
      if @command_window.change_troop<br />
        i = @command_window.index<br />
        troop_id = @list[i]<br />
        if troop_id<br />
          @troop.setup(troop_id)<br />
        else<br />
          @troop.empty!<br />
        end<br />
        enemies = @troop.enemies<br />
        @trooper_max.times do |n|<br />
          sbattler = @battlers[n]<br />
          sbattler.change(enemies[n])<br />
        end<br />
      end<br />
      if Input.trigger?(Input::B) or Input.trigger?(Input::C)<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        @stage = nil<br />
        n = @command_window.index<br />
        troop_id = @list[n]<br />
        if troop_id<br />
          &#36;game_temp.battle_troop_id = troop_id<br />
          @callback.call<br />
          return<br />
        else<br />
          &#36;game_temp.battle_calling = false<br />
          &#36;game_temp.menu_calling = false<br />
          &#36;game_temp.menu_beep = false<br />
          &#36;game_temp.battle_troop_id = 0<br />
          &#36;game_player.make_encounter_count<br />
          &#36;game_player.straighten<br />
          &#36;game_map.autoplay<br />
          &#36;scene = Scene_Map.new<br />
        end<br />
      end<br />
    end<br />
<br />
    def dispose<br />
      @battlers.each do |s|<br />
        s.bitmap.dispose if s.bitmap<br />
        s.dispose<br />
      end<br />
      @command_window.dispose<br />
      @help_window.dispose<br />
      @vp.dispose<br />
      @backdrop.bitmap.dispose<br />
      @backdrop.dispose<br />
    end<br />
  end<br />
end<br />
<br />
module Audio<br />
  def self.play_anon_bgm(bgm)<br />
    if !bgm or bgm.name.empty?<br />
      bgm_stop<br />
    else<br />
      bgm_play("Audio/BGM/" + bgm.name, bgm.volume, bgm.pitch)<br />
    end<br />
    Graphics.frame_reset<br />
  end<br />
end<br />
<br />
class Game_Actor<br />
  def can_pick_foes?<br />
    ChooseFoes::ACCESSORY_ID == @armor4_id and @armor4_id &gt; 0<br />
  end<br />
end<br />
<br />
class Game_Party<br />
  alias :kyon_chs_foes_gm_pty_init :initialize<br />
  def initialize<br />
    kyon_chs_foes_gm_pty_init<br />
    @choose_foes_mode = ChooseFoes::MODE<br />
    @defeated_troop_ids = []<br />
    @map_troop_ids = {}<br />
  end<br />
<br />
  def choose_foes_with_accessory?<br />
    @actors.find {|a| a.can_pick_foes? } != nil<br />
  end<br />
<br />
  def choose_foes_level_avg?<br />
    avg_level = @actors.inject(0) {|t, a| t + a.level }<br />
    avg_level /= @actors.size<br />
    map_level = ChooseFoes::MAP_ACTOR_LVL[&#36;game_map.map_id]<br />
    avg_level &gt;= map_level<br />
  end<br />
<br />
  def choose_foes?<br />
    case @choose_foes_mode<br />
    when :accessory<br />
      return choose_foes_with_accessory?<br />
    when :levels<br />
      return choose_foes_level_avg?<br />
    end<br />
  end<br />
<br />
  def lowest_troop_id<br />
    @defeated_troop_ids.min || 1<br />
  end<br />
<br />
  def highest_troop_id<br />
    @defeated_troop_ids.max || 1<br />
  end<br />
<br />
  def random_troop_id<br />
    n = rand(@defeated_troop_ids.size)<br />
    @defeated_troop_ids[n] || 1<br />
  end<br />
<br />
  def new_map_troops?(map_id)<br />
    @map_troop_ids.has_key?(map_id)<br />
  end<br />
<br />
  def new_map_troops(*troop_ids)<br />
    n = &#36;game_map.map_id<br />
    @map_troop_ids[n] = troop_ids.flatten<br />
  end<br />
  attr_accessor :choose_foes_mode, :map_troop_ids<br />
  attr_reader :defeated_troop_ids<br />
end<br />
<br />
class Game_Troop<br />
  def empty!<br />
    @enemies = []<br />
  end<br />
end<br />
<br />
class Sprite_Battler<br />
  def change(battler)<br />
    @battler = battler<br />
    unless @battler<br />
      self.bitmap = nil<br />
      loop_animation(nil)<br />
      return<br />
    end<br />
    @battler_name = @battler.battler_name<br />
    @battler_hue = @battler.battler_hue<br />
    self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)<br />
    @width = self.bitmap.width<br />
    @height = self.bitmap.height<br />
    self.ox = @width / 2<br />
    self.oy = @height<br />
    self.x = @battler.screen_x<br />
    self.y = @battler.screen_y<br />
    self.z = @battler.screen_z<br />
  end<br />
end<br />
<br />
class Scene_Map<br />
  alias :kyon_chs_foes_scn_mp_cll_btl :call_battle<br />
  def call_battle<br />
    list = &#36;game_map.encounter_list<br />
    if list.size &lt; 2<br />
      kyon_chs_foes_scn_mp_cll_btl<br />
      return<br />
    else<br />
      cb = method(:kyon_chs_foes_scn_mp_cll_btl)<br />
      map_id = &#36;game_map.map_id<br />
      if &#36;game_party.new_map_troops?(map_id)<br />
        &#36;scene = ChooseFoes::Scene.new(cb, true)<br />
      elsif &#36;game_party.choose_foes?<br />
        &#36;scene = ChooseFoes::Scene.new(cb, false)<br />
      end<br />
    end<br />
  end<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">Terms &amp; Conditions</span></span><br />
<br />
Free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer.<br />
Include my nickname in your game credits.<br />
You may mention this forum there as well.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[No Dodge / Not Today]]></title>
			<link>https://www.save-point.org/thread-13415.html</link>
			<pubDate>Sun, 15 Feb 2026 16:29:59 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13415.html</guid>
			<description><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">No Dodge / Not Today</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.0</span></div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
Did you enjoy a feature in the older RPGMaker engines that allowed weapons to avoid or bypass evade or dodge rates?  Do you want an attack that looks at an enemy who is fleet-of-foot and say "Nope!  Not today, pal!" and just fry him with a fire blast regardless of how high his evasion rate was set?<br />
<br />
This script lets you determine which attack objects can slip in and bypass the evasion rate of a battler, be it hero or enemy.  Indeed, you may craft weapons that can get past the EVA score of a custom Hydra,  even if set to a score of 99.  Or you can create a lethal Kobold boss who can get through and ignore the excellent EVA rating of your hero's armor.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><ul class="mycode_list"><li>Define weapons that ignore target EVA scores (akin to RM2K+ dodge rates)</li>
<li>Define skills, states and items that ignore target EVA scores</li>
<li>Make enemies capable of ignoring hero armor EVA scores</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Screenshots</span></span><br />
<br />
Nothing to see here.  Its a base mechanics system with no visible flourishes<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<br />
Nah.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> No Dodging Allowed!!!</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;"><div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#==============================================================================<br />
# ** No Dodge / Not Today<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;by DerVVulfman<br />
#&nbsp;&nbsp;&nbsp;&nbsp;version 1.0<br />
#&nbsp;&nbsp;&nbsp;&nbsp;02-15-2026 (MM-DD-YYYY)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;RGSS / RMXP<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;INTRODUCTION:<br />
#&nbsp;&nbsp;=============<br />
#<br />
#&nbsp;&nbsp;Did you enjoy a feature in the older RPGMaker engines that allowed weapons<br />
#&nbsp;&nbsp;to avoid or bypass evade or dodge rates?&nbsp;&nbsp;Do you want an attack that looks<br />
#&nbsp;&nbsp;at an enemy who is fleet-of-foot and say "Nope!&nbsp;&nbsp;Not today, pal!" and just<br />
#&nbsp;&nbsp;fry him with a fire blast regardless of how high his evasion rate was set?<br />
#<br />
#&nbsp;&nbsp;This script lets you determine which attack objects can slip in and bypass<br />
#&nbsp;&nbsp;the evasion rate of a battler, be it hero or enemy.&nbsp;&nbsp;Indeed, you may craft<br />
#&nbsp;&nbsp;weapons that can get past the EVA score of a custom Hydra,&nbsp;&nbsp;even if set to<br />
#&nbsp;&nbsp;a score of 99.&nbsp;&nbsp;Or you can create a lethal Kobold boss who can get through<br />
#&nbsp;&nbsp;and ignore the excellent EVA rating of your hero's armor.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;INSTRUCTIONS:<br />
#&nbsp;&nbsp;=============<br />
#<br />
#&nbsp;&nbsp;You just fill the appropriate array in the config section&nbsp;&nbsp;with the IDs of<br />
#&nbsp;&nbsp;your weapons, skills, or like effects&nbsp;&nbsp;that ignore the target's EVA value.<br />
#&nbsp;&nbsp;That's REALLY all there is to it.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;WEIRD NOTE:<br />
#&nbsp;&nbsp;===========<br />
#<br />
#&nbsp;&nbsp;You just fill the appropriate array in the config section&nbsp;&nbsp;with the IDs of<br />
#&nbsp;&nbsp;By default,&nbsp;&nbsp;enemies do not use weapons or any form of gear. So enemies do<br />
#&nbsp;&nbsp;not have any form&nbsp;&nbsp;of 'weapon_id' value applied.&nbsp;&nbsp;But,&nbsp;&nbsp;if a scripter does<br />
#&nbsp;&nbsp;make weapon use possible for enemies,&nbsp;&nbsp;I made a value&nbsp;&nbsp;in the config setup<br />
#&nbsp;&nbsp;to permit such a value to be tested.&nbsp;&nbsp;I don't expect this to be used much.<br />
#<br />
#<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;COMPATABILITY:<br />
#&nbsp;&nbsp;==============<br />
#<br />
#&nbsp;&nbsp;Designed solely for RPGMaker XP.<br />
#<br />
#&nbsp;&nbsp;All contents have been aliased, or had code attached to existing methods<br />
#&nbsp;&nbsp;without rewrites.<br />
#<br />
#<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;TERMS AND CONDITIONS:<br />
#&nbsp;&nbsp;=====================<br />
#<br />
#&nbsp;&nbsp;Free for use, even in commercial projects.&nbsp;&nbsp;Only due credit for myself and<br />
#&nbsp;&nbsp;Ace_V who suggested a like feature is required.<br />
#<br />
#<br />
#==============================================================================<br />
<br />
<br />
module NoEvade<br />
<br />
<br />
&nbsp;&nbsp;# IDENTIFIER ARRAYS<br />
&nbsp;&nbsp;# =================<br />
&nbsp;&nbsp;# Here, you list the IDs of the weapons, skills, items and even states that<br />
&nbsp;&nbsp;# an attacker may have that makes an enemy unable to evade.<br />
&nbsp;&nbsp;# ---------------------------------------------------------------------------<br />
&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;ENEMY_IDS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = [2]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # State IDs here&nbsp;&nbsp;(default/example: Basilisk)<br />
&nbsp;&nbsp;&nbsp;&nbsp;STATE_IDS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = [13]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# State IDs here&nbsp;&nbsp;(default/example: Sharp)<br />
&nbsp;&nbsp;&nbsp;&nbsp;WEAPON_IDS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= [1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Weapon IDs here (default/example: Bronze Sw)<br />
&nbsp;&nbsp;&nbsp;&nbsp;SKILL_IDS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = [7]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Skill IDs here&nbsp;&nbsp;(default/example: Fire)<br />
&nbsp;&nbsp;&nbsp;&nbsp;ITEM_IDS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Item IDs here:&nbsp;&nbsp;(default/example: -none-)<br />
<br />
<br />
&nbsp;&nbsp;# WEAPON USING ENEMIES<br />
&nbsp;&nbsp;# ====================<br />
&nbsp;&nbsp;# Rarely if ever touched, this setting informs the system if a Game_Enemy<br />
&nbsp;&nbsp;# is able to use an equipped weapon, suggesting a custom script in use.<br />
&nbsp;&nbsp;# ---------------------------------------------------------------------------<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;ENEMY_WEAPONS&nbsp;&nbsp; = false<br />
<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Game_Battler<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class deals with battlers. It's used as a superclass for the Game_Actor<br />
#&nbsp;&nbsp;and Game_Enemy classes.<br />
#==============================================================================<br />
<br />
class Game_Battler<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Determine [Can't Evade] States<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias ad_nev_gb_noevade_cant_evade? cant_evade?<br />
&nbsp;&nbsp;alias ad_nev_gb_noevade_ae attack_effect<br />
&nbsp;&nbsp;alias ad_nev_gb_noevade_se skill_effect<br />
&nbsp;&nbsp;alias ad_nev_gb_noevade_ie item_effect<br />
<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * ALIASED / ATTACHED-CODE METHODS<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Determine [Can't Evade] States<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def cant_evade?<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return true if cant_evade_flag? == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit true for custom flag<br />
&nbsp;&nbsp;&nbsp;&nbsp;return ad_nev_gb_noevade_cant_evade?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Perform the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Applying Normal Attack Effects<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; attacker : battler<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def attack_effect(attacker)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;enemy_evadable?(attacker)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Test for non-evasion enemy<br />
&nbsp;&nbsp;&nbsp;&nbsp;attacker_evadable?(attacker)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Test for non-evasion state<br />
&nbsp;&nbsp;&nbsp;&nbsp;weapon_evadable?(attacker)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Test for non-evasion weapon<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = ad_nev_gb_noevade_ae(attacker)&nbsp;&nbsp;&nbsp;&nbsp;# Perform the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;return effective&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit with effectiveness<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Apply Skill Effects<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; user&nbsp;&nbsp;: the one using skills (battler)<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; skill : skill<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def skill_effect(user, skill)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;skill_evadable?(skill)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Test for non-evasion skill<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = ad_nev_gb_noevade_se(user, skill) # Perform the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;return effective&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit with effectiveness<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Application of Item Effects<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; item : item<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def item_effect(item)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;item_evadable?(item)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Test for non-evasion item<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = ad_nev_gb_noevade_ie(item)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Perform the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;return effective&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit with effectiveness<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * NEW METHODS<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Determine if custom can't evade flags in use<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def cant_evade_flag?<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return true if @no_ev_enemy&nbsp;&nbsp;&nbsp;&nbsp; == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit true for custom enemy<br />
&nbsp;&nbsp;&nbsp;&nbsp;return true if @no_ev_attacker&nbsp;&nbsp;== true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit true for custom state<br />
&nbsp;&nbsp;&nbsp;&nbsp;return true if @no_ev_weapon&nbsp;&nbsp;&nbsp;&nbsp;== true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit true for custom weapon<br />
&nbsp;&nbsp;&nbsp;&nbsp;return true if @no_ev_skill&nbsp;&nbsp;&nbsp;&nbsp; == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit true for custom skill<br />
&nbsp;&nbsp;&nbsp;&nbsp;return true if @no_ev_item&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;== true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit true for custom item<br />
&nbsp;&nbsp;&nbsp;&nbsp;return false<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Get if Attacker's current state prevents execution<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; attacker : battler<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def attacker_evadable?(attacker)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_attacker = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set flag assuming evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;for id in attacker.states&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle through states<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if NoEvade::STATE_IDS.include?(id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If in the No-Evade list<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_attacker = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# ...set flag as not evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Get if Enemy Attacker prevents evasion<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; attacker : battler<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def enemy_evadable?(attacker)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_enemy = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set flag assuming evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless attacker.is_a?(Game_Enemy)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If the user isn't an enemy<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# ... exit the method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;id = attacker.id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get enemy ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;if NoEvade::ENEMY_IDS.include?(id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If in the No-Evade list<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_enemy = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # ...set flag as not evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Get if Attack Weapon prevents evasion<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; attacker : battler<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def weapon_evadable?(attacker)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_weapon = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set flag assuming evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;if attacker.is_a?(Game_Enemy)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If the user is an enemy<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unless NoEvade::ENEMY_WEAPONS == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # ... and cannot use weapons<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# ... exit the method<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;id = attacker.weapon_id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get the weapon's ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;if NoEvade::WEAPON_IDS.include?(id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If in the No-Evade list<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_weapon = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# ...set flag as not evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Get if Skill prevents evasion<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; skill : skill<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def skill_evadable?(skill)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_skill = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set flag assuming evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;id = skill.id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get the skill's ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;if NoEvade::SKILL_IDS.include?(id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If in the No-Evade list<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_skill = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # ...set flag as not evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Get if item prevents evasion<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; item : item<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def item_evadable?(item)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_item = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set flag assuming evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;id = item.id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get the item's ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;if NoEvade::ITEM_IDS.include?(id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If in the No-Evade list<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_item = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# ...set flag as not evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end</code></div></div></div>
		</div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Pretty much simple instructions in the script.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
Designed solely for RPGMaker XP.<br />
 <br />
All contents have been aliased, or had code attached to existing methods without rewrites.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
Thanks to Ace_V for another script suggestion.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free for use, even in commercial projects.  Only due credit for myself and Ace_V who suggested a like feature is required.]]></description>
			<content:encoded><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">No Dodge / Not Today</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.0</span></div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
Did you enjoy a feature in the older RPGMaker engines that allowed weapons to avoid or bypass evade or dodge rates?  Do you want an attack that looks at an enemy who is fleet-of-foot and say "Nope!  Not today, pal!" and just fry him with a fire blast regardless of how high his evasion rate was set?<br />
<br />
This script lets you determine which attack objects can slip in and bypass the evasion rate of a battler, be it hero or enemy.  Indeed, you may craft weapons that can get past the EVA score of a custom Hydra,  even if set to a score of 99.  Or you can create a lethal Kobold boss who can get through and ignore the excellent EVA rating of your hero's armor.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><ul class="mycode_list"><li>Define weapons that ignore target EVA scores (akin to RM2K+ dodge rates)</li>
<li>Define skills, states and items that ignore target EVA scores</li>
<li>Make enemies capable of ignoring hero armor EVA scores</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Screenshots</span></span><br />
<br />
Nothing to see here.  Its a base mechanics system with no visible flourishes<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<br />
Nah.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> No Dodging Allowed!!!</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;"><div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#==============================================================================<br />
# ** No Dodge / Not Today<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;by DerVVulfman<br />
#&nbsp;&nbsp;&nbsp;&nbsp;version 1.0<br />
#&nbsp;&nbsp;&nbsp;&nbsp;02-15-2026 (MM-DD-YYYY)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;RGSS / RMXP<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;INTRODUCTION:<br />
#&nbsp;&nbsp;=============<br />
#<br />
#&nbsp;&nbsp;Did you enjoy a feature in the older RPGMaker engines that allowed weapons<br />
#&nbsp;&nbsp;to avoid or bypass evade or dodge rates?&nbsp;&nbsp;Do you want an attack that looks<br />
#&nbsp;&nbsp;at an enemy who is fleet-of-foot and say "Nope!&nbsp;&nbsp;Not today, pal!" and just<br />
#&nbsp;&nbsp;fry him with a fire blast regardless of how high his evasion rate was set?<br />
#<br />
#&nbsp;&nbsp;This script lets you determine which attack objects can slip in and bypass<br />
#&nbsp;&nbsp;the evasion rate of a battler, be it hero or enemy.&nbsp;&nbsp;Indeed, you may craft<br />
#&nbsp;&nbsp;weapons that can get past the EVA score of a custom Hydra,&nbsp;&nbsp;even if set to<br />
#&nbsp;&nbsp;a score of 99.&nbsp;&nbsp;Or you can create a lethal Kobold boss who can get through<br />
#&nbsp;&nbsp;and ignore the excellent EVA rating of your hero's armor.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;INSTRUCTIONS:<br />
#&nbsp;&nbsp;=============<br />
#<br />
#&nbsp;&nbsp;You just fill the appropriate array in the config section&nbsp;&nbsp;with the IDs of<br />
#&nbsp;&nbsp;your weapons, skills, or like effects&nbsp;&nbsp;that ignore the target's EVA value.<br />
#&nbsp;&nbsp;That's REALLY all there is to it.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;WEIRD NOTE:<br />
#&nbsp;&nbsp;===========<br />
#<br />
#&nbsp;&nbsp;You just fill the appropriate array in the config section&nbsp;&nbsp;with the IDs of<br />
#&nbsp;&nbsp;By default,&nbsp;&nbsp;enemies do not use weapons or any form of gear. So enemies do<br />
#&nbsp;&nbsp;not have any form&nbsp;&nbsp;of 'weapon_id' value applied.&nbsp;&nbsp;But,&nbsp;&nbsp;if a scripter does<br />
#&nbsp;&nbsp;make weapon use possible for enemies,&nbsp;&nbsp;I made a value&nbsp;&nbsp;in the config setup<br />
#&nbsp;&nbsp;to permit such a value to be tested.&nbsp;&nbsp;I don't expect this to be used much.<br />
#<br />
#<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;COMPATABILITY:<br />
#&nbsp;&nbsp;==============<br />
#<br />
#&nbsp;&nbsp;Designed solely for RPGMaker XP.<br />
#<br />
#&nbsp;&nbsp;All contents have been aliased, or had code attached to existing methods<br />
#&nbsp;&nbsp;without rewrites.<br />
#<br />
#<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;TERMS AND CONDITIONS:<br />
#&nbsp;&nbsp;=====================<br />
#<br />
#&nbsp;&nbsp;Free for use, even in commercial projects.&nbsp;&nbsp;Only due credit for myself and<br />
#&nbsp;&nbsp;Ace_V who suggested a like feature is required.<br />
#<br />
#<br />
#==============================================================================<br />
<br />
<br />
module NoEvade<br />
<br />
<br />
&nbsp;&nbsp;# IDENTIFIER ARRAYS<br />
&nbsp;&nbsp;# =================<br />
&nbsp;&nbsp;# Here, you list the IDs of the weapons, skills, items and even states that<br />
&nbsp;&nbsp;# an attacker may have that makes an enemy unable to evade.<br />
&nbsp;&nbsp;# ---------------------------------------------------------------------------<br />
&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;ENEMY_IDS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = [2]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # State IDs here&nbsp;&nbsp;(default/example: Basilisk)<br />
&nbsp;&nbsp;&nbsp;&nbsp;STATE_IDS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = [13]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# State IDs here&nbsp;&nbsp;(default/example: Sharp)<br />
&nbsp;&nbsp;&nbsp;&nbsp;WEAPON_IDS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= [1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Weapon IDs here (default/example: Bronze Sw)<br />
&nbsp;&nbsp;&nbsp;&nbsp;SKILL_IDS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = [7]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Skill IDs here&nbsp;&nbsp;(default/example: Fire)<br />
&nbsp;&nbsp;&nbsp;&nbsp;ITEM_IDS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Item IDs here:&nbsp;&nbsp;(default/example: -none-)<br />
<br />
<br />
&nbsp;&nbsp;# WEAPON USING ENEMIES<br />
&nbsp;&nbsp;# ====================<br />
&nbsp;&nbsp;# Rarely if ever touched, this setting informs the system if a Game_Enemy<br />
&nbsp;&nbsp;# is able to use an equipped weapon, suggesting a custom script in use.<br />
&nbsp;&nbsp;# ---------------------------------------------------------------------------<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;ENEMY_WEAPONS&nbsp;&nbsp; = false<br />
<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Game_Battler<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class deals with battlers. It's used as a superclass for the Game_Actor<br />
#&nbsp;&nbsp;and Game_Enemy classes.<br />
#==============================================================================<br />
<br />
class Game_Battler<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Determine [Can't Evade] States<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias ad_nev_gb_noevade_cant_evade? cant_evade?<br />
&nbsp;&nbsp;alias ad_nev_gb_noevade_ae attack_effect<br />
&nbsp;&nbsp;alias ad_nev_gb_noevade_se skill_effect<br />
&nbsp;&nbsp;alias ad_nev_gb_noevade_ie item_effect<br />
<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * ALIASED / ATTACHED-CODE METHODS<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Determine [Can't Evade] States<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def cant_evade?<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return true if cant_evade_flag? == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit true for custom flag<br />
&nbsp;&nbsp;&nbsp;&nbsp;return ad_nev_gb_noevade_cant_evade?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Perform the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Applying Normal Attack Effects<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; attacker : battler<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def attack_effect(attacker)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;enemy_evadable?(attacker)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Test for non-evasion enemy<br />
&nbsp;&nbsp;&nbsp;&nbsp;attacker_evadable?(attacker)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Test for non-evasion state<br />
&nbsp;&nbsp;&nbsp;&nbsp;weapon_evadable?(attacker)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Test for non-evasion weapon<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = ad_nev_gb_noevade_ae(attacker)&nbsp;&nbsp;&nbsp;&nbsp;# Perform the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;return effective&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit with effectiveness<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Apply Skill Effects<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; user&nbsp;&nbsp;: the one using skills (battler)<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; skill : skill<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def skill_effect(user, skill)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;skill_evadable?(skill)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Test for non-evasion skill<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = ad_nev_gb_noevade_se(user, skill) # Perform the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;return effective&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit with effectiveness<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Application of Item Effects<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; item : item<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def item_effect(item)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;item_evadable?(item)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Test for non-evasion item<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = ad_nev_gb_noevade_ie(item)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Perform the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;return effective&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit with effectiveness<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * NEW METHODS<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Determine if custom can't evade flags in use<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def cant_evade_flag?<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return true if @no_ev_enemy&nbsp;&nbsp;&nbsp;&nbsp; == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit true for custom enemy<br />
&nbsp;&nbsp;&nbsp;&nbsp;return true if @no_ev_attacker&nbsp;&nbsp;== true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit true for custom state<br />
&nbsp;&nbsp;&nbsp;&nbsp;return true if @no_ev_weapon&nbsp;&nbsp;&nbsp;&nbsp;== true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit true for custom weapon<br />
&nbsp;&nbsp;&nbsp;&nbsp;return true if @no_ev_skill&nbsp;&nbsp;&nbsp;&nbsp; == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit true for custom skill<br />
&nbsp;&nbsp;&nbsp;&nbsp;return true if @no_ev_item&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;== true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit true for custom item<br />
&nbsp;&nbsp;&nbsp;&nbsp;return false<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Get if Attacker's current state prevents execution<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; attacker : battler<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def attacker_evadable?(attacker)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_attacker = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set flag assuming evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;for id in attacker.states&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle through states<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if NoEvade::STATE_IDS.include?(id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If in the No-Evade list<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_attacker = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# ...set flag as not evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Get if Enemy Attacker prevents evasion<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; attacker : battler<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def enemy_evadable?(attacker)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_enemy = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set flag assuming evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless attacker.is_a?(Game_Enemy)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If the user isn't an enemy<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# ... exit the method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;id = attacker.id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get enemy ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;if NoEvade::ENEMY_IDS.include?(id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If in the No-Evade list<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_enemy = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # ...set flag as not evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Get if Attack Weapon prevents evasion<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; attacker : battler<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def weapon_evadable?(attacker)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_weapon = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set flag assuming evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;if attacker.is_a?(Game_Enemy)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If the user is an enemy<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unless NoEvade::ENEMY_WEAPONS == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # ... and cannot use weapons<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# ... exit the method<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;id = attacker.weapon_id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get the weapon's ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;if NoEvade::WEAPON_IDS.include?(id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If in the No-Evade list<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_weapon = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# ...set flag as not evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Get if Skill prevents evasion<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; skill : skill<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def skill_evadable?(skill)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_skill = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set flag assuming evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;id = skill.id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get the skill's ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;if NoEvade::SKILL_IDS.include?(id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If in the No-Evade list<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_skill = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # ...set flag as not evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Get if item prevents evasion<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; item : item<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def item_evadable?(item)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_item = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set flag assuming evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;id = item.id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get the item's ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;if NoEvade::ITEM_IDS.include?(id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If in the No-Evade list<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@no_ev_item = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# ...set flag as not evadable<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end</code></div></div></div>
		</div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Pretty much simple instructions in the script.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
Designed solely for RPGMaker XP.<br />
 <br />
All contents have been aliased, or had code attached to existing methods without rewrites.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
Thanks to Ace_V for another script suggestion.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free for use, even in commercial projects.  Only due credit for myself and Ace_V who suggested a like feature is required.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Active Bound-Area Events]]></title>
			<link>https://www.save-point.org/thread-13405.html</link>
			<pubDate>Sun, 08 Feb 2026 02:23:50 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13405.html</guid>
			<description><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Active Bound-Area Events</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.0</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
Utilizing the area-defining mechanics  of "Expanded Encounter Areas",  you can now create events that move about randomly, but only within areas which  you have defined. Monsters may never leave their hunting area,  guards may be forced to stay  within their posts,  and a throng of wild party animals might find they never leave the opulant dance floor.<br />
<br />
Its up to you.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Screenshots</span></span><br />
<br />
Picture a guy running into an invisible wall and taking a step backwards...<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<br />
<a href="https://app.box.com/s/gqweyt5esn1abpksg9u2n7ncrthzo4h4" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">CLICK HERE</span></a><br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> FUN STUFF HERE</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;"><div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#==============================================================================<br />
# ** Active Bound-Area Events<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Add-On for Expanded Encounter Areas<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;by DerVVulfman<br />
#&nbsp;&nbsp;&nbsp;&nbsp;version 1.0<br />
#&nbsp;&nbsp;&nbsp;&nbsp;02-07-2025 (MM-DD-YYYY)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;RGSS / RMXP<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Requires:&nbsp;&nbsp;Expanded Encounter Areas<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;Utilizing the area-defining mechanics&nbsp;&nbsp;of "Expanded Encounter Areas",&nbsp;&nbsp;you<br />
#&nbsp;&nbsp;can now create events that move about randomly, but only within areas which <br />
#&nbsp;&nbsp;you have defined. Monsters may never leave their hunting area,&nbsp;&nbsp;guards may<br />
#&nbsp;&nbsp;be forced to stay&nbsp;&nbsp;within their posts,&nbsp;&nbsp;and a throng of wild party animals<br />
#&nbsp;&nbsp;might find they never leave the opulant dance floor.<br />
#<br />
#&nbsp;&nbsp;Its up to you.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;<br />
#&nbsp;&nbsp;I will not go into details&nbsp;&nbsp;into how to set up an 'area' where your events<br />
#&nbsp;&nbsp;are to be contained.&nbsp;&nbsp;Instead, I will focus on this script and how to make<br />
#&nbsp;&nbsp;events that are essentially TRAPPED by the areas created with that work.<br />
#<br />
#&nbsp;&nbsp;Okay, setting up an event to be STUCK in an area (or areas).<br />
#<br />
#&nbsp;&nbsp;This is done&nbsp;&nbsp;by adding comments&nbsp;&nbsp;within the&nbsp;&nbsp;'Event commands' window. The<br />
#&nbsp;&nbsp;first comment is one&nbsp;&nbsp;that informs the script&nbsp;&nbsp;that the event is indeed to<br />
#&nbsp;&nbsp;be trapped in an area (or areas).&nbsp;&nbsp;The comment is merely one word,&nbsp;&nbsp;and is<br />
#&nbsp;&nbsp;the word "EEA" by default (no quotes).&nbsp;&nbsp;When I say its 'by default' I mean<br />
#&nbsp;&nbsp;you can change that word in the simple config section of ths script.<br />
#<br />
#&nbsp;&nbsp;But for now, the trigger word that identifies the event as one stuck in an<br />
#&nbsp;&nbsp;area is "EEA". ^_^<br />
#<br />
#&nbsp;&nbsp;Following this,&nbsp;&nbsp;the second comment you add&nbsp;&nbsp;contains the word "EEA_Areas"<br />
#&nbsp;&nbsp;followed by either a number or an array of numbers.&nbsp;&nbsp;The number(s) are the<br />
#&nbsp;&nbsp;ID keys to the "AREA" hashes you have setup in "Expanded Encounter Areas".<br />
#&nbsp;&nbsp;So if you have a comment read "EEA_Areas 4", then the event is stuck with-<br />
#&nbsp;&nbsp;in AREA[4] in your system.&nbsp;&nbsp; And the comment is like "EEA_Areas [5,6,9]", <br />
#&nbsp;&nbsp;then your event will only be able to walk about within those three defined<br />
#&nbsp;&nbsp;areas. Of course, I am going to assume&nbsp;&nbsp;there's some overlap between these<br />
#&nbsp;&nbsp;as the event can't very well HOP distances.<br />
#<br />
#&nbsp;&nbsp;Actually, the JUMP event will work in that instance. ^_^<br />
#<br />
#&nbsp;&nbsp;The last comment is more optional, but understandingly so.&nbsp;&nbsp;It defines the<br />
#&nbsp;&nbsp;way the event behaves&nbsp;&nbsp;when it tries to exit out of the area.&nbsp;&nbsp;By default,<br />
#&nbsp;&nbsp;the event merely backs up (walks backwards) one tile.&nbsp;&nbsp;Otherwise, you have<br />
#&nbsp;&nbsp;access to five other reactions to an attempted area border crossing.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;0 = steps backwards 1 tile (default)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;1 = steps backwards 2 tiles<br />
#&nbsp;&nbsp;&nbsp;&nbsp;2 = turns and walks forward 1 tile (away from border)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;3 = turns and walks forward 2 tiles (away from border)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;4 = Walks/Moves to the vent's origin point (may be hindered by objects)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;5 = Appears at the event's origin point&nbsp;&nbsp;<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Options 0-3 work best when the event is still 'within' an area. If it<br />
#&nbsp;&nbsp;&nbsp;&nbsp;is outside an area,&nbsp;&nbsp;these may cause the event to be stuck and unable<br />
#&nbsp;&nbsp;&nbsp;&nbsp;to move. Options 4&amp;5 allow events to return to its origin despite the<br />
#&nbsp;&nbsp;&nbsp;&nbsp;area movement limitations.<br />
#<br />
#&nbsp;&nbsp;You may neglect to add&nbsp;&nbsp;the "EEA_Return" comment as it has a default,&nbsp;&nbsp;but<br />
#&nbsp;&nbsp;you do need to add the "EEA" trigger word and the "EEA_Areas" otherwise it<br />
#&nbsp;&nbsp;will not finish defining the event.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;<br />
#&nbsp;&nbsp;Something you may not have considered.&nbsp;&nbsp;The EEA commands&nbsp;&nbsp;only work within<br />
#&nbsp;&nbsp;event pages where they are defined.&nbsp;&nbsp;That is to say, you can make an event<br />
#&nbsp;&nbsp;with multiple pages, and each page can have its own set of EEA commands to<br />
#&nbsp;&nbsp;control what areas it may traverse, or have pages where they don't exist.<br />
#<br />
#&nbsp;&nbsp;Being able to set different EEA commands or have them non-existent on some<br />
#&nbsp;&nbsp;pages should give you even MORE control than you might have expected!<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;<br />
#&nbsp;&nbsp;The Configuration section (below)&nbsp;&nbsp;is present solely so you can choose the<br />
#&nbsp;&nbsp;words that you use when you create your event.&nbsp;&nbsp;Its only present for those<br />
#&nbsp;&nbsp;who use another language and for their convenience.&nbsp;&nbsp;Otherwise, its hardly<br />
#&nbsp;&nbsp;ever going to get touched.<br />
#<br />
#&nbsp;&nbsp;NOTE:&nbsp;&nbsp; The EEA Trigger word is case sensitive,&nbsp;&nbsp;so it must be exactly the<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;same in your event comments.&nbsp;&nbsp;The others are case inseneitive, and<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;do not care if you use upper and/or lowercase characters.<br />
#<br />
#<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;COMPATABILITY:<br />
#<br />
#&nbsp;&nbsp;Designed solely for RPGMaker XP and the Expanded Encounter Areas script.<br />
#<br />
#&nbsp;&nbsp;All contents have been aliased, or had code attached to existing methods<br />
#&nbsp;&nbsp;without rewrites.<br />
#<br />
#<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;TERMS AND CONDITIONS<br />
#<br />
#&nbsp;&nbsp;Free for use, even in commercial projects.&nbsp;&nbsp;Only due credit for myself and<br />
#&nbsp;&nbsp;Ace_V who suggested a like feature is required.<br />
#<br />
#<br />
#==============================================================================<br />
<br />
<br />
<br />
<br />
module EncArea<br />
<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;# The Expanded Encounter Area Trigger<br />
&nbsp;&nbsp;# ===================================<br />
&nbsp;&nbsp;# This word needs to be read first by the system to inform the script that<br />
&nbsp;&nbsp;# the event is an EEA controlled event.&nbsp;&nbsp;The word is case sensitive, so if<br />
&nbsp;&nbsp;# your 'replacement' for EEA has upper and lowercase characters, so too it<br />
&nbsp;&nbsp;# must be in your comments.<br />
&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;EEA_FLAG = "EEA"<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;# The Expanded Areas Array<br />
&nbsp;&nbsp;# ========================<br />
&nbsp;&nbsp;# This word informs the system that it will be followed by either the ID of<br />
&nbsp;&nbsp;# an area defined in the "Expanded Encounter Areas" script,&nbsp;&nbsp;or by an array <br />
&nbsp;&nbsp;# filled with multiple IDs.&nbsp;&nbsp;Unlike the EEA_Flag, it is case insensitive.<br />
&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;AREA_FLAG = "EEA_Areas"<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;# The Expanded Areas Return Type<br />
&nbsp;&nbsp;# ==============================<br />
&nbsp;&nbsp;# This word informs the system that you have chosen the manner in which the<br />
&nbsp;&nbsp;# event will back away and remain within the enclosed area.&nbsp;&nbsp;Again, this is<br />
&nbsp;&nbsp;# also a case insensitive word.<br />
&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;RETURN_FLAG = "EEA_RETURn"<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Game_Event<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class deals with events. It handles functions including event page <br />
#&nbsp;&nbsp;switching via condition determinants, and running parallel process events.<br />
#&nbsp;&nbsp;It's used within the Game_Map class.<br />
#==============================================================================<br />
<br />
class Game_Event &lt; Game_Character<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Alias Listings<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias dervv_event_eea_init initialize<br />
&nbsp;&nbsp;alias dervv_event_eea_refresh refresh<br />
&nbsp;&nbsp;alias dervv_event_eea_update update<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Aliased and Attached Methods<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------&nbsp;&nbsp;<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; map_id : map ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; event&nbsp;&nbsp;: event (RPG::Event)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize(map_id, event)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;dervv_event_eea_init(map_id, event)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Perform the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@eea_areas = []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Clear EEA area IDs<br />
&nbsp;&nbsp;&nbsp;&nbsp;@eea_return = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Reset EEA return trigger<br />
&nbsp;&nbsp;&nbsp;&nbsp;dervv_event_eea_refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Perform the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh_eea_events(@list)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Perform checks on event<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Determine if Passable (from Game_Character)<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; x : x-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; y : y-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; d : direction (0,2,4,6,8)<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 0 = Determines if all directions are impassable (for jumping)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def passable?(x, y, d)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;eea_area_exceeded?(x, y, d)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Test if event exceeds area<br />
&nbsp;&nbsp;&nbsp;&nbsp;return super(x, y, d)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit with superclass result<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;update_eea_event_return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Force return on trigger<br />
&nbsp;&nbsp;&nbsp;&nbsp;dervv_event_eea_update&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Perform the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Attached Methods - Direct link to Aliased Methods<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------&nbsp;&nbsp;<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh (when retrieving comment commands)<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; list : list of event commands<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh_eea_events(list)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if list.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if there's no cmd list<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;parameters&nbsp;&nbsp;= []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Create Array for comments<br />
&nbsp;&nbsp;&nbsp;&nbsp;word1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = EncArea::EEA_FLAG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get EEA word (case sensitive)<br />
&nbsp;&nbsp;&nbsp;&nbsp;word2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (EncArea::AREA_FLAG).upcase&nbsp;&nbsp; # Get Area array word<br />
&nbsp;&nbsp;&nbsp;&nbsp;word3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (EncArea::RETURN_FLAG).upcase # Get Event reaction word<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Cycle through list<br />
&nbsp;&nbsp;&nbsp;&nbsp;update_eea_event_return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Force return on trigger<br />
&nbsp;&nbsp;&nbsp;&nbsp;for item in list&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Cycle through the commands<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unless [108, 408].include?(item.code)&nbsp;&nbsp;&nbsp;&nbsp; # If it isn't a comment<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Skip to next item<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parameters.push(item.parameters[0])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Push item into comment array<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if parameters == []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit if no comments<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless parameters.include?(word1)&nbsp;&nbsp;&nbsp;&nbsp;# Exit if no EEA word/flag<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;for param in parameters&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle through comments<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check = param.split&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Split each comment in two<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next if check[1].nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if second half empty<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;trigger = check[0].upcase&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get comment trigger<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if trigger == word2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If it's an area array trigger<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh_eea_event_area(check[1])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Obtain area IDs for the event<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if trigger == word3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If it's a event return trigger<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh_eea_event_return(check[1])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Obtain return for event<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Determine if Encounter Area exceeded<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; x : x-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; y : y-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; d : direction (0,2,4,6,8)<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 0 = Determines if all directions are impassable (for jumping)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def eea_area_exceeded?(x, y, d)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;nx = (x+1) + (d == 6 ? 1 : d == 4 ? -1 : 0) # Get new x coords (start at 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;ny = (y+1) + (d == 2 ? 1 : d == 8 ? -1 : 0) # Get new y coords (start at 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if @eea_areas.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit on invalid areas<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if @eea_areas == []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit if event areas is empty<br />
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume not in a defined area<br />
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;for area in @eea_areas&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Cycle through event's areas<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next if area.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Skip if area is empty<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_map.eea_map_area?(nx, ny, area)&nbsp;&nbsp;# If the event is IN the area&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;effective = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set the effective flag<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if effective == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if still in the area(s)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@eea_trigger = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set trigger - event outside!<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when moving the event back across the border)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_eea_event_return<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless @eea_trigger == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit unless triggered<br />
&nbsp;&nbsp;&nbsp;&nbsp;@eea_trigger = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Clear the trigger<br />
&nbsp;&nbsp;&nbsp;&nbsp;eea_event_motion(@eea_return)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Force the event to move<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * New Methods<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------&nbsp;&nbsp;<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh event areas defined<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; value : area list value<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh_eea_event_area(value)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;val = eval(value)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get evaluated value<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if val.is_a?(Array)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If it is an array<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@eea_areas = val&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Merely accept the value<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if val.is_a?(Integer)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If it is a single integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@eea_areas = [val]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set the value in an array<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh event return condition<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; value : movement return value<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh_eea_event_return(value)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@eea_return =&nbsp;&nbsp;eval(value).to_i&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set return to evaluated value<br />
&nbsp;&nbsp;&nbsp;&nbsp;@eea_return = 0 if @eea_return &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Return is no lower than 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;@eea_return = 5 if @eea_return &gt; 5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Return is no higher than 5<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Perform event movtion based on Encounter area<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; value : movement return value<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def eea_event_motion(value)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# NOTE: Required 1 additional movement to counter attempted crossing.<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;case value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Branch on move value<br />
&nbsp;&nbsp;&nbsp;&nbsp;when 1 ; eea_b ; eea_b; eea_b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Step backwards twice<br />
&nbsp;&nbsp;&nbsp;&nbsp;when 2 ; turn_180 ; eea_f ; eea_f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Turn &amp; step forward<br />
&nbsp;&nbsp;&nbsp;&nbsp;when 3 ; turn_180 ; eea_f ; eea_f; eea_f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Turn &amp; two steps forward<br />
&nbsp;&nbsp;&nbsp;&nbsp;when 4 ; @x, @y = @event.x, @event.y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Move to origin<br />
&nbsp;&nbsp;&nbsp;&nbsp;when 5 ; moveto(@event.x, @event.y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Appear at origin<br />
&nbsp;&nbsp;&nbsp;&nbsp;else ;&nbsp;&nbsp; eea_b ; eea_b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Step backwards<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Shortcut to Game_Character: move_backward<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def eea_b<br />
&nbsp;&nbsp;&nbsp;&nbsp;move_backward<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Shortcut to Game_Character: move_forward<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def eea_f<br />
&nbsp;&nbsp;&nbsp;&nbsp;move_forward<br />
&nbsp;&nbsp;end<br />
<br />
end</code></div></div></div>
		</div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Plenty, and in the script. But most of the work is in the parent script this requires.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
Designed solely for RPGMaker XP and the <a href="showthread.php?tid=8102"><span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">Expanded Encounter Areas</span></span></a> script.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
Gotta thank Ace_V for giving me the idea.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free for use, even in commercial projects.  Only due credit for myself and Ace_V who suggested a like feature is required.]]></description>
			<content:encoded><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Active Bound-Area Events</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.0</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
Utilizing the area-defining mechanics  of "Expanded Encounter Areas",  you can now create events that move about randomly, but only within areas which  you have defined. Monsters may never leave their hunting area,  guards may be forced to stay  within their posts,  and a throng of wild party animals might find they never leave the opulant dance floor.<br />
<br />
Its up to you.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Screenshots</span></span><br />
<br />
Picture a guy running into an invisible wall and taking a step backwards...<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<br />
<a href="https://app.box.com/s/gqweyt5esn1abpksg9u2n7ncrthzo4h4" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">CLICK HERE</span></a><br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> FUN STUFF HERE</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;"><div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#==============================================================================<br />
# ** Active Bound-Area Events<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Add-On for Expanded Encounter Areas<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;by DerVVulfman<br />
#&nbsp;&nbsp;&nbsp;&nbsp;version 1.0<br />
#&nbsp;&nbsp;&nbsp;&nbsp;02-07-2025 (MM-DD-YYYY)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;RGSS / RMXP<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Requires:&nbsp;&nbsp;Expanded Encounter Areas<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;Utilizing the area-defining mechanics&nbsp;&nbsp;of "Expanded Encounter Areas",&nbsp;&nbsp;you<br />
#&nbsp;&nbsp;can now create events that move about randomly, but only within areas which <br />
#&nbsp;&nbsp;you have defined. Monsters may never leave their hunting area,&nbsp;&nbsp;guards may<br />
#&nbsp;&nbsp;be forced to stay&nbsp;&nbsp;within their posts,&nbsp;&nbsp;and a throng of wild party animals<br />
#&nbsp;&nbsp;might find they never leave the opulant dance floor.<br />
#<br />
#&nbsp;&nbsp;Its up to you.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;<br />
#&nbsp;&nbsp;I will not go into details&nbsp;&nbsp;into how to set up an 'area' where your events<br />
#&nbsp;&nbsp;are to be contained.&nbsp;&nbsp;Instead, I will focus on this script and how to make<br />
#&nbsp;&nbsp;events that are essentially TRAPPED by the areas created with that work.<br />
#<br />
#&nbsp;&nbsp;Okay, setting up an event to be STUCK in an area (or areas).<br />
#<br />
#&nbsp;&nbsp;This is done&nbsp;&nbsp;by adding comments&nbsp;&nbsp;within the&nbsp;&nbsp;'Event commands' window. The<br />
#&nbsp;&nbsp;first comment is one&nbsp;&nbsp;that informs the script&nbsp;&nbsp;that the event is indeed to<br />
#&nbsp;&nbsp;be trapped in an area (or areas).&nbsp;&nbsp;The comment is merely one word,&nbsp;&nbsp;and is<br />
#&nbsp;&nbsp;the word "EEA" by default (no quotes).&nbsp;&nbsp;When I say its 'by default' I mean<br />
#&nbsp;&nbsp;you can change that word in the simple config section of ths script.<br />
#<br />
#&nbsp;&nbsp;But for now, the trigger word that identifies the event as one stuck in an<br />
#&nbsp;&nbsp;area is "EEA". ^_^<br />
#<br />
#&nbsp;&nbsp;Following this,&nbsp;&nbsp;the second comment you add&nbsp;&nbsp;contains the word "EEA_Areas"<br />
#&nbsp;&nbsp;followed by either a number or an array of numbers.&nbsp;&nbsp;The number(s) are the<br />
#&nbsp;&nbsp;ID keys to the "AREA" hashes you have setup in "Expanded Encounter Areas".<br />
#&nbsp;&nbsp;So if you have a comment read "EEA_Areas 4", then the event is stuck with-<br />
#&nbsp;&nbsp;in AREA[4] in your system.&nbsp;&nbsp; And the comment is like "EEA_Areas [5,6,9]", <br />
#&nbsp;&nbsp;then your event will only be able to walk about within those three defined<br />
#&nbsp;&nbsp;areas. Of course, I am going to assume&nbsp;&nbsp;there's some overlap between these<br />
#&nbsp;&nbsp;as the event can't very well HOP distances.<br />
#<br />
#&nbsp;&nbsp;Actually, the JUMP event will work in that instance. ^_^<br />
#<br />
#&nbsp;&nbsp;The last comment is more optional, but understandingly so.&nbsp;&nbsp;It defines the<br />
#&nbsp;&nbsp;way the event behaves&nbsp;&nbsp;when it tries to exit out of the area.&nbsp;&nbsp;By default,<br />
#&nbsp;&nbsp;the event merely backs up (walks backwards) one tile.&nbsp;&nbsp;Otherwise, you have<br />
#&nbsp;&nbsp;access to five other reactions to an attempted area border crossing.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;0 = steps backwards 1 tile (default)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;1 = steps backwards 2 tiles<br />
#&nbsp;&nbsp;&nbsp;&nbsp;2 = turns and walks forward 1 tile (away from border)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;3 = turns and walks forward 2 tiles (away from border)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;4 = Walks/Moves to the vent's origin point (may be hindered by objects)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;5 = Appears at the event's origin point&nbsp;&nbsp;<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Options 0-3 work best when the event is still 'within' an area. If it<br />
#&nbsp;&nbsp;&nbsp;&nbsp;is outside an area,&nbsp;&nbsp;these may cause the event to be stuck and unable<br />
#&nbsp;&nbsp;&nbsp;&nbsp;to move. Options 4&amp;5 allow events to return to its origin despite the<br />
#&nbsp;&nbsp;&nbsp;&nbsp;area movement limitations.<br />
#<br />
#&nbsp;&nbsp;You may neglect to add&nbsp;&nbsp;the "EEA_Return" comment as it has a default,&nbsp;&nbsp;but<br />
#&nbsp;&nbsp;you do need to add the "EEA" trigger word and the "EEA_Areas" otherwise it<br />
#&nbsp;&nbsp;will not finish defining the event.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;<br />
#&nbsp;&nbsp;Something you may not have considered.&nbsp;&nbsp;The EEA commands&nbsp;&nbsp;only work within<br />
#&nbsp;&nbsp;event pages where they are defined.&nbsp;&nbsp;That is to say, you can make an event<br />
#&nbsp;&nbsp;with multiple pages, and each page can have its own set of EEA commands to<br />
#&nbsp;&nbsp;control what areas it may traverse, or have pages where they don't exist.<br />
#<br />
#&nbsp;&nbsp;Being able to set different EEA commands or have them non-existent on some<br />
#&nbsp;&nbsp;pages should give you even MORE control than you might have expected!<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;<br />
#&nbsp;&nbsp;The Configuration section (below)&nbsp;&nbsp;is present solely so you can choose the<br />
#&nbsp;&nbsp;words that you use when you create your event.&nbsp;&nbsp;Its only present for those<br />
#&nbsp;&nbsp;who use another language and for their convenience.&nbsp;&nbsp;Otherwise, its hardly<br />
#&nbsp;&nbsp;ever going to get touched.<br />
#<br />
#&nbsp;&nbsp;NOTE:&nbsp;&nbsp; The EEA Trigger word is case sensitive,&nbsp;&nbsp;so it must be exactly the<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;same in your event comments.&nbsp;&nbsp;The others are case inseneitive, and<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;do not care if you use upper and/or lowercase characters.<br />
#<br />
#<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;COMPATABILITY:<br />
#<br />
#&nbsp;&nbsp;Designed solely for RPGMaker XP and the Expanded Encounter Areas script.<br />
#<br />
#&nbsp;&nbsp;All contents have been aliased, or had code attached to existing methods<br />
#&nbsp;&nbsp;without rewrites.<br />
#<br />
#<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;TERMS AND CONDITIONS<br />
#<br />
#&nbsp;&nbsp;Free for use, even in commercial projects.&nbsp;&nbsp;Only due credit for myself and<br />
#&nbsp;&nbsp;Ace_V who suggested a like feature is required.<br />
#<br />
#<br />
#==============================================================================<br />
<br />
<br />
<br />
<br />
module EncArea<br />
<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;# The Expanded Encounter Area Trigger<br />
&nbsp;&nbsp;# ===================================<br />
&nbsp;&nbsp;# This word needs to be read first by the system to inform the script that<br />
&nbsp;&nbsp;# the event is an EEA controlled event.&nbsp;&nbsp;The word is case sensitive, so if<br />
&nbsp;&nbsp;# your 'replacement' for EEA has upper and lowercase characters, so too it<br />
&nbsp;&nbsp;# must be in your comments.<br />
&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;EEA_FLAG = "EEA"<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;# The Expanded Areas Array<br />
&nbsp;&nbsp;# ========================<br />
&nbsp;&nbsp;# This word informs the system that it will be followed by either the ID of<br />
&nbsp;&nbsp;# an area defined in the "Expanded Encounter Areas" script,&nbsp;&nbsp;or by an array <br />
&nbsp;&nbsp;# filled with multiple IDs.&nbsp;&nbsp;Unlike the EEA_Flag, it is case insensitive.<br />
&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;AREA_FLAG = "EEA_Areas"<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;# The Expanded Areas Return Type<br />
&nbsp;&nbsp;# ==============================<br />
&nbsp;&nbsp;# This word informs the system that you have chosen the manner in which the<br />
&nbsp;&nbsp;# event will back away and remain within the enclosed area.&nbsp;&nbsp;Again, this is<br />
&nbsp;&nbsp;# also a case insensitive word.<br />
&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;RETURN_FLAG = "EEA_RETURn"<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Game_Event<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class deals with events. It handles functions including event page <br />
#&nbsp;&nbsp;switching via condition determinants, and running parallel process events.<br />
#&nbsp;&nbsp;It's used within the Game_Map class.<br />
#==============================================================================<br />
<br />
class Game_Event &lt; Game_Character<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Alias Listings<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias dervv_event_eea_init initialize<br />
&nbsp;&nbsp;alias dervv_event_eea_refresh refresh<br />
&nbsp;&nbsp;alias dervv_event_eea_update update<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Aliased and Attached Methods<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------&nbsp;&nbsp;<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; map_id : map ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; event&nbsp;&nbsp;: event (RPG::Event)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize(map_id, event)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;dervv_event_eea_init(map_id, event)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Perform the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@eea_areas = []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Clear EEA area IDs<br />
&nbsp;&nbsp;&nbsp;&nbsp;@eea_return = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Reset EEA return trigger<br />
&nbsp;&nbsp;&nbsp;&nbsp;dervv_event_eea_refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Perform the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh_eea_events(@list)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Perform checks on event<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Determine if Passable (from Game_Character)<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; x : x-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; y : y-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; d : direction (0,2,4,6,8)<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 0 = Determines if all directions are impassable (for jumping)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def passable?(x, y, d)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;eea_area_exceeded?(x, y, d)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Test if event exceeds area<br />
&nbsp;&nbsp;&nbsp;&nbsp;return super(x, y, d)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit with superclass result<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;update_eea_event_return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Force return on trigger<br />
&nbsp;&nbsp;&nbsp;&nbsp;dervv_event_eea_update&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Perform the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Attached Methods - Direct link to Aliased Methods<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------&nbsp;&nbsp;<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh (when retrieving comment commands)<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; list : list of event commands<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh_eea_events(list)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if list.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if there's no cmd list<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;parameters&nbsp;&nbsp;= []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Create Array for comments<br />
&nbsp;&nbsp;&nbsp;&nbsp;word1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = EncArea::EEA_FLAG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get EEA word (case sensitive)<br />
&nbsp;&nbsp;&nbsp;&nbsp;word2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (EncArea::AREA_FLAG).upcase&nbsp;&nbsp; # Get Area array word<br />
&nbsp;&nbsp;&nbsp;&nbsp;word3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (EncArea::RETURN_FLAG).upcase # Get Event reaction word<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Cycle through list<br />
&nbsp;&nbsp;&nbsp;&nbsp;update_eea_event_return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Force return on trigger<br />
&nbsp;&nbsp;&nbsp;&nbsp;for item in list&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Cycle through the commands<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unless [108, 408].include?(item.code)&nbsp;&nbsp;&nbsp;&nbsp; # If it isn't a comment<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Skip to next item<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parameters.push(item.parameters[0])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Push item into comment array<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if parameters == []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit if no comments<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless parameters.include?(word1)&nbsp;&nbsp;&nbsp;&nbsp;# Exit if no EEA word/flag<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;for param in parameters&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle through comments<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check = param.split&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Split each comment in two<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next if check[1].nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if second half empty<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;trigger = check[0].upcase&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get comment trigger<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if trigger == word2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If it's an area array trigger<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh_eea_event_area(check[1])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Obtain area IDs for the event<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if trigger == word3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If it's a event return trigger<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh_eea_event_return(check[1])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Obtain return for event<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Determine if Encounter Area exceeded<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; x : x-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; y : y-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; d : direction (0,2,4,6,8)<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 0 = Determines if all directions are impassable (for jumping)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def eea_area_exceeded?(x, y, d)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;nx = (x+1) + (d == 6 ? 1 : d == 4 ? -1 : 0) # Get new x coords (start at 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;ny = (y+1) + (d == 2 ? 1 : d == 8 ? -1 : 0) # Get new y coords (start at 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if @eea_areas.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit on invalid areas<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if @eea_areas == []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit if event areas is empty<br />
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume not in a defined area<br />
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;for area in @eea_areas&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Cycle through event's areas<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next if area.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Skip if area is empty<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_map.eea_map_area?(nx, ny, area)&nbsp;&nbsp;# If the event is IN the area&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;effective = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set the effective flag<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if effective == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if still in the area(s)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@eea_trigger = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set trigger - event outside!<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when moving the event back across the border)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_eea_event_return<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless @eea_trigger == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit unless triggered<br />
&nbsp;&nbsp;&nbsp;&nbsp;@eea_trigger = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Clear the trigger<br />
&nbsp;&nbsp;&nbsp;&nbsp;eea_event_motion(@eea_return)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Force the event to move<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * New Methods<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------&nbsp;&nbsp;<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh event areas defined<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; value : area list value<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh_eea_event_area(value)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;val = eval(value)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get evaluated value<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if val.is_a?(Array)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If it is an array<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@eea_areas = val&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Merely accept the value<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if val.is_a?(Integer)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If it is a single integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@eea_areas = [val]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set the value in an array<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh event return condition<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; value : movement return value<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh_eea_event_return(value)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@eea_return =&nbsp;&nbsp;eval(value).to_i&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set return to evaluated value<br />
&nbsp;&nbsp;&nbsp;&nbsp;@eea_return = 0 if @eea_return &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Return is no lower than 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;@eea_return = 5 if @eea_return &gt; 5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Return is no higher than 5<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Perform event movtion based on Encounter area<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; value : movement return value<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def eea_event_motion(value)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# NOTE: Required 1 additional movement to counter attempted crossing.<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;case value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Branch on move value<br />
&nbsp;&nbsp;&nbsp;&nbsp;when 1 ; eea_b ; eea_b; eea_b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Step backwards twice<br />
&nbsp;&nbsp;&nbsp;&nbsp;when 2 ; turn_180 ; eea_f ; eea_f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Turn &amp; step forward<br />
&nbsp;&nbsp;&nbsp;&nbsp;when 3 ; turn_180 ; eea_f ; eea_f; eea_f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Turn &amp; two steps forward<br />
&nbsp;&nbsp;&nbsp;&nbsp;when 4 ; @x, @y = @event.x, @event.y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Move to origin<br />
&nbsp;&nbsp;&nbsp;&nbsp;when 5 ; moveto(@event.x, @event.y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Appear at origin<br />
&nbsp;&nbsp;&nbsp;&nbsp;else ;&nbsp;&nbsp; eea_b ; eea_b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Step backwards<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Shortcut to Game_Character: move_backward<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def eea_b<br />
&nbsp;&nbsp;&nbsp;&nbsp;move_backward<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Shortcut to Game_Character: move_forward<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def eea_f<br />
&nbsp;&nbsp;&nbsp;&nbsp;move_forward<br />
&nbsp;&nbsp;end<br />
<br />
end</code></div></div></div>
		</div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Plenty, and in the script. But most of the work is in the parent script this requires.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
Designed solely for RPGMaker XP and the <a href="showthread.php?tid=8102"><span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">Expanded Encounter Areas</span></span></a> script.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
Gotta thank Ace_V for giving me the idea.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free for use, even in commercial projects.  Only due credit for myself and Ace_V who suggested a like feature is required.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[BattleAktionFX XP]]></title>
			<link>https://www.save-point.org/thread-13371.html</link>
			<pubDate>Sat, 27 Dec 2025 12:55:45 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=1471">kyonides</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13371.html</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">BattleAktionFX XP</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
After reading lots of stuff on Discord on some Follow Up Skill script for VX ACE, I thought XP badly needed to get something like that. This is how this script came into existence! <img src="https://www.save-point.org/images/smilies/ejlol/shocked.gif" alt="Shocked" title="Shocked" class="smilie smilie_22" /><br />
<br />
Currently, there are 4 options available:<ul class="mycode_list"><li>:repeat for repeating the skill cast a few moments ago.<br />
</li>
<li>:random_skill for picking a skill from the current actor's or enemy's list of available skills / action.<br />
</li>
<li>:foe_skill for choosing a skill from an opponent's list of available skills / actions.<br />
</li>
<li>Some predefined skill ID - it might fail if the battler doesn't know it.<br />
</li>
<li>nil - it means nothing in Latin.<br />
</li>
</ul>
<br />
To add a new skill to the list, follow this example here:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>SKILL_FX[57] = [:repeat, :random_skill]</code></div></div><br />
57 would stand for the actual skill ID.<br />
<br />
During gameplay, the script will pick one of those options randomly, unless there's just 0 or 1 there.<br />
<br />
And yes, <img src="https://www.save-point.org/images/smilies/ejlol/ghost.gif" alt="Ghost" title="Ghost" class="smilie smilie_86" /> <img src="https://www.save-point.org/images/smilies/ejlol/golem.gif" alt="Golem" title="Golem" class="smilie smilie_172" /> enemies might escape or guard or do nothing if they got no valid action to perform at that point.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The Script</span><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * BattleAktionFX XP * #<br />
#   Scripter : Kyonides<br />
#   v0.5.0 - 2025-12-29<br />
<br />
# Let your actors or troopers get an extra action for certain skills<br />
# IF AND ONLY IF they meet some of the predefined criteria.<br />
<br />
# Warning!<br />
# Enemies using a skill's effect might escape or guard if they've got<br />
# no available action left!<br />
<br />
# Available Options:<br />
# :repeat, :random_skill, :foe_skill, a specific skill ID, nil<br />
<br />
module BAktionFX<br />
  MAX_EXTRA_ACTIONS = 1<br />
  SKILL_FX = {} # Please leave this line alone!<br />
  SKILL_FX.default = [] # Please leave this line alone!<br />
  # [Skill ID] = [Option1, etc.]<br />
  SKILL_FX[57] = [:repeat, :random_skill]<br />
  extend self<br />
  def set_make_targets(set_targets)<br />
    @set_targets = set_targets<br />
  end<br />
<br />
  def skip?<br />
    MAX_EXTRA_ACTIONS == @extra_actions or @skill_hits == 0<br />
  end<br />
<br />
  def process_skill(battler, skill_id)<br />
    if skip?<br />
      clear<br />
      return<br />
    end<br />
    action = battler.current_action<br />
    fx = SKILL_FX[skill_id]<br />
    slots = fx.size<br />
    fx = fx[rand(slots)]<br />
    case fx<br />
    when nil<br />
      clear<br />
      return<br />
    when :repeat<br />
      kind, basic, fx = action.data<br />
    when :random_skill<br />
      kind, basic, fx = battler.find_extra_action<br />
    when :foe_skill<br />
      kind, basic, fx = battler.find_foe_action<br />
    end<br />
    skill = &#36;data_skills[fx]<br />
    unless skill<br />
      clear<br />
      return<br />
    end<br />
    @set_targets.call(skill.scope)<br />
    @targets = @targets.call.flatten<br />
    if @targets.empty?<br />
      clear<br />
      return<br />
    end<br />
    @targets = nil<br />
    @extra_actions += 1<br />
    @skill_hits = 0<br />
    action.set(kind, basic, fx)<br />
    true<br />
  end<br />
<br />
  def clear<br />
    @skill_hits = @extra_actions = 0<br />
  end<br />
  attr_accessor :extra_actions, :skill_hits, :targets<br />
end<br />
<br />
class Game_BattleAction<br />
  def data<br />
    [@kind, @basic, @skill_id]<br />
  end<br />
<br />
  def set(akind, abasic, askill_id)<br />
    @kind = akind<br />
    @basic = abasic<br />
    @skill_id = askill_id<br />
  end<br />
end<br />
<br />
class Game_Battler<br />
  alias :kyon_btl_akt_fx_gm_btlr_sk_fx :skill_effect<br />
  def skill_effect(user, skill)<br />
    result = kyon_btl_akt_fx_gm_btlr_sk_fx(user, skill)<br />
    BAktionFX.skill_hits += 1 if result and @damage.is_a?(Integer)<br />
    result<br />
  end<br />
<br />
  def set_opponent_action(foes)<br />
    return [0, rand(3) + 1, 0] if foes.empty?<br />
    total = foes.size<br />
    foe = foes[rand(total)]<br />
    foe.find_extra_action<br />
  end<br />
<br />
  def skill_can_use_extra?(skill)<br />
    return false if dead? or skill.sp_cost &gt; self.sp<br />
    return false if skill.atk_f == 0 and self.restriction == 1<br />
    skill.occasion &lt; 2 and rand(100) &lt; 50<br />
  end<br />
  attr_accessor :extra_action<br />
end<br />
<br />
class Game_Actor<br />
  def find_extra_action<br />
    skills_found = @skills.select {|sid| skill_can_use?(sid) }<br />
    total = skills_found.size<br />
    skill_id = skills_found[rand(total)]<br />
    [1, 0, skill_id]<br />
  end<br />
<br />
  def find_foe_action<br />
    foes = &#36;game_troop.enemies.select {|e| e.exist? }<br />
    set_opponent_action(foes)<br />
  end<br />
end<br />
<br />
class Game_Enemy<br />
  def find_extra_action<br />
    return [0, rand(3) + 1, 0] unless movable?<br />
    found_actions = []<br />
    for action in self.actions<br />
      n = &#36;game_temp.battle_turn<br />
      a = action.condition_turn_a<br />
      b = action.condition_turn_b<br />
      if (b == 0 and n != a) or<br />
         (b &gt; 0 and (n &lt; 1 or n &lt; a or n % b != a % b))<br />
        next<br />
      end<br />
      if self.hp * 100.0 / self.maxhp &gt; action.condition_hp<br />
        next<br />
      end<br />
      if &#36;game_party.max_level &lt; action.condition_level<br />
        next<br />
      end<br />
      switch_id = action.condition_switch_id<br />
      if switch_id &gt; 0 and !&#36;game_switches[switch_id]<br />
        next<br />
      end<br />
      found_actions &lt;&lt; action<br />
    end<br />
    return [] if found_actions.empty?<br />
    total = found_actions.size<br />
    action = found_actions[rand(total)]<br />
    action.data<br />
  end<br />
<br />
  def find_foe_action<br />
    foes = &#36;game_party.actors.select {|e| e.exist? }<br />
    set_opponent_action(foes)<br />
  end<br />
end<br />
<br />
class Scene_Battle<br />
  alias :kyon_btl_akt_fx_scn_btl_stt_ph4 :start_phase4<br />
  alias :kyon_btl_akt_fx_scn_btl_mk_sk_act_res :make_skill_action_result<br />
  alias :kyon_btl_akt_fx_scn_btl_up_ph4_st6 :update_phase4_step6<br />
  alias :kyon_btl_akt_fx_scn_btl_btl_end :battle_end<br />
  def start_phase4<br />
    BAktionFX.clear<br />
    @used_skill = nil<br />
    kyon_btl_akt_fx_scn_btl_stt_ph4<br />
  end<br />
<br />
  def make_skill_action_result<br />
    if @active_battler.extra_action<br />
      make_extra_skill_action_result<br />
    else<br />
      kyon_btl_akt_fx_scn_btl_mk_sk_act_res<br />
    end<br />
    @used_skill = @phase4_step != 1<br />
  end<br />
<br />
  def make_extra_skill_action_result<br />
    @skill = &#36;data_skills[@active_battler.current_action.skill_id]<br />
    unless @active_battler.current_action.forcing<br />
      unless @active_battler.skill_can_use_extra?(@skill)<br />
        &#36;game_temp.forcing_battler = nil<br />
        @phase4_step = 1<br />
        return<br />
      end<br />
    end<br />
    @active_battler.sp -= @skill.sp_cost<br />
    @status_window.refresh<br />
    @help_window.set_text(@skill.name, 1)<br />
    @animation1_id = @skill.animation1_id<br />
    @animation2_id = @skill.animation2_id<br />
    @common_event_id = @skill.common_event_id<br />
    set_target_battlers(@skill.scope)<br />
    for target in @target_battlers<br />
      target.skill_effect(@active_battler, @skill)<br />
    end<br />
  end<br />
<br />
  def update_phase4_step6<br />
    kyon_btl_akt_fx_scn_btl_up_ph4_st6<br />
    @active_battler.extra_action = nil<br />
    return unless @used_skill<br />
    @target_battlers = []<br />
    BAktionFX.targets = @target_battlers<br />
    unless @embedded<br />
      BAktionFX.set_make_targets(method(:set_target_battlers))<br />
      @embedded = true<br />
    end<br />
    if BAktionFX.process_skill(@active_battler, @skill.id)<br />
      @action_battlers.unshift @active_battler <br />
      @active_battler.extra_action = true<br />
    end<br />
    @target_battlers = []<br />
    @used_skill = nil<br />
  end<br />
<br />
  def battle_end(result)<br />
    BAktionFX.clear<br />
    kyon_btl_akt_fx_scn_btl_btl_end(result)<br />
  end<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
Free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer.<br />
Please include me in your game credits.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">BattleAktionFX XP</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
After reading lots of stuff on Discord on some Follow Up Skill script for VX ACE, I thought XP badly needed to get something like that. This is how this script came into existence! <img src="https://www.save-point.org/images/smilies/ejlol/shocked.gif" alt="Shocked" title="Shocked" class="smilie smilie_22" /><br />
<br />
Currently, there are 4 options available:<ul class="mycode_list"><li>:repeat for repeating the skill cast a few moments ago.<br />
</li>
<li>:random_skill for picking a skill from the current actor's or enemy's list of available skills / action.<br />
</li>
<li>:foe_skill for choosing a skill from an opponent's list of available skills / actions.<br />
</li>
<li>Some predefined skill ID - it might fail if the battler doesn't know it.<br />
</li>
<li>nil - it means nothing in Latin.<br />
</li>
</ul>
<br />
To add a new skill to the list, follow this example here:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>SKILL_FX[57] = [:repeat, :random_skill]</code></div></div><br />
57 would stand for the actual skill ID.<br />
<br />
During gameplay, the script will pick one of those options randomly, unless there's just 0 or 1 there.<br />
<br />
And yes, <img src="https://www.save-point.org/images/smilies/ejlol/ghost.gif" alt="Ghost" title="Ghost" class="smilie smilie_86" /> <img src="https://www.save-point.org/images/smilies/ejlol/golem.gif" alt="Golem" title="Golem" class="smilie smilie_172" /> enemies might escape or guard or do nothing if they got no valid action to perform at that point.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The Script</span><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * BattleAktionFX XP * #<br />
#   Scripter : Kyonides<br />
#   v0.5.0 - 2025-12-29<br />
<br />
# Let your actors or troopers get an extra action for certain skills<br />
# IF AND ONLY IF they meet some of the predefined criteria.<br />
<br />
# Warning!<br />
# Enemies using a skill's effect might escape or guard if they've got<br />
# no available action left!<br />
<br />
# Available Options:<br />
# :repeat, :random_skill, :foe_skill, a specific skill ID, nil<br />
<br />
module BAktionFX<br />
  MAX_EXTRA_ACTIONS = 1<br />
  SKILL_FX = {} # Please leave this line alone!<br />
  SKILL_FX.default = [] # Please leave this line alone!<br />
  # [Skill ID] = [Option1, etc.]<br />
  SKILL_FX[57] = [:repeat, :random_skill]<br />
  extend self<br />
  def set_make_targets(set_targets)<br />
    @set_targets = set_targets<br />
  end<br />
<br />
  def skip?<br />
    MAX_EXTRA_ACTIONS == @extra_actions or @skill_hits == 0<br />
  end<br />
<br />
  def process_skill(battler, skill_id)<br />
    if skip?<br />
      clear<br />
      return<br />
    end<br />
    action = battler.current_action<br />
    fx = SKILL_FX[skill_id]<br />
    slots = fx.size<br />
    fx = fx[rand(slots)]<br />
    case fx<br />
    when nil<br />
      clear<br />
      return<br />
    when :repeat<br />
      kind, basic, fx = action.data<br />
    when :random_skill<br />
      kind, basic, fx = battler.find_extra_action<br />
    when :foe_skill<br />
      kind, basic, fx = battler.find_foe_action<br />
    end<br />
    skill = &#36;data_skills[fx]<br />
    unless skill<br />
      clear<br />
      return<br />
    end<br />
    @set_targets.call(skill.scope)<br />
    @targets = @targets.call.flatten<br />
    if @targets.empty?<br />
      clear<br />
      return<br />
    end<br />
    @targets = nil<br />
    @extra_actions += 1<br />
    @skill_hits = 0<br />
    action.set(kind, basic, fx)<br />
    true<br />
  end<br />
<br />
  def clear<br />
    @skill_hits = @extra_actions = 0<br />
  end<br />
  attr_accessor :extra_actions, :skill_hits, :targets<br />
end<br />
<br />
class Game_BattleAction<br />
  def data<br />
    [@kind, @basic, @skill_id]<br />
  end<br />
<br />
  def set(akind, abasic, askill_id)<br />
    @kind = akind<br />
    @basic = abasic<br />
    @skill_id = askill_id<br />
  end<br />
end<br />
<br />
class Game_Battler<br />
  alias :kyon_btl_akt_fx_gm_btlr_sk_fx :skill_effect<br />
  def skill_effect(user, skill)<br />
    result = kyon_btl_akt_fx_gm_btlr_sk_fx(user, skill)<br />
    BAktionFX.skill_hits += 1 if result and @damage.is_a?(Integer)<br />
    result<br />
  end<br />
<br />
  def set_opponent_action(foes)<br />
    return [0, rand(3) + 1, 0] if foes.empty?<br />
    total = foes.size<br />
    foe = foes[rand(total)]<br />
    foe.find_extra_action<br />
  end<br />
<br />
  def skill_can_use_extra?(skill)<br />
    return false if dead? or skill.sp_cost &gt; self.sp<br />
    return false if skill.atk_f == 0 and self.restriction == 1<br />
    skill.occasion &lt; 2 and rand(100) &lt; 50<br />
  end<br />
  attr_accessor :extra_action<br />
end<br />
<br />
class Game_Actor<br />
  def find_extra_action<br />
    skills_found = @skills.select {|sid| skill_can_use?(sid) }<br />
    total = skills_found.size<br />
    skill_id = skills_found[rand(total)]<br />
    [1, 0, skill_id]<br />
  end<br />
<br />
  def find_foe_action<br />
    foes = &#36;game_troop.enemies.select {|e| e.exist? }<br />
    set_opponent_action(foes)<br />
  end<br />
end<br />
<br />
class Game_Enemy<br />
  def find_extra_action<br />
    return [0, rand(3) + 1, 0] unless movable?<br />
    found_actions = []<br />
    for action in self.actions<br />
      n = &#36;game_temp.battle_turn<br />
      a = action.condition_turn_a<br />
      b = action.condition_turn_b<br />
      if (b == 0 and n != a) or<br />
         (b &gt; 0 and (n &lt; 1 or n &lt; a or n % b != a % b))<br />
        next<br />
      end<br />
      if self.hp * 100.0 / self.maxhp &gt; action.condition_hp<br />
        next<br />
      end<br />
      if &#36;game_party.max_level &lt; action.condition_level<br />
        next<br />
      end<br />
      switch_id = action.condition_switch_id<br />
      if switch_id &gt; 0 and !&#36;game_switches[switch_id]<br />
        next<br />
      end<br />
      found_actions &lt;&lt; action<br />
    end<br />
    return [] if found_actions.empty?<br />
    total = found_actions.size<br />
    action = found_actions[rand(total)]<br />
    action.data<br />
  end<br />
<br />
  def find_foe_action<br />
    foes = &#36;game_party.actors.select {|e| e.exist? }<br />
    set_opponent_action(foes)<br />
  end<br />
end<br />
<br />
class Scene_Battle<br />
  alias :kyon_btl_akt_fx_scn_btl_stt_ph4 :start_phase4<br />
  alias :kyon_btl_akt_fx_scn_btl_mk_sk_act_res :make_skill_action_result<br />
  alias :kyon_btl_akt_fx_scn_btl_up_ph4_st6 :update_phase4_step6<br />
  alias :kyon_btl_akt_fx_scn_btl_btl_end :battle_end<br />
  def start_phase4<br />
    BAktionFX.clear<br />
    @used_skill = nil<br />
    kyon_btl_akt_fx_scn_btl_stt_ph4<br />
  end<br />
<br />
  def make_skill_action_result<br />
    if @active_battler.extra_action<br />
      make_extra_skill_action_result<br />
    else<br />
      kyon_btl_akt_fx_scn_btl_mk_sk_act_res<br />
    end<br />
    @used_skill = @phase4_step != 1<br />
  end<br />
<br />
  def make_extra_skill_action_result<br />
    @skill = &#36;data_skills[@active_battler.current_action.skill_id]<br />
    unless @active_battler.current_action.forcing<br />
      unless @active_battler.skill_can_use_extra?(@skill)<br />
        &#36;game_temp.forcing_battler = nil<br />
        @phase4_step = 1<br />
        return<br />
      end<br />
    end<br />
    @active_battler.sp -= @skill.sp_cost<br />
    @status_window.refresh<br />
    @help_window.set_text(@skill.name, 1)<br />
    @animation1_id = @skill.animation1_id<br />
    @animation2_id = @skill.animation2_id<br />
    @common_event_id = @skill.common_event_id<br />
    set_target_battlers(@skill.scope)<br />
    for target in @target_battlers<br />
      target.skill_effect(@active_battler, @skill)<br />
    end<br />
  end<br />
<br />
  def update_phase4_step6<br />
    kyon_btl_akt_fx_scn_btl_up_ph4_st6<br />
    @active_battler.extra_action = nil<br />
    return unless @used_skill<br />
    @target_battlers = []<br />
    BAktionFX.targets = @target_battlers<br />
    unless @embedded<br />
      BAktionFX.set_make_targets(method(:set_target_battlers))<br />
      @embedded = true<br />
    end<br />
    if BAktionFX.process_skill(@active_battler, @skill.id)<br />
      @action_battlers.unshift @active_battler <br />
      @active_battler.extra_action = true<br />
    end<br />
    @target_battlers = []<br />
    @used_skill = nil<br />
  end<br />
<br />
  def battle_end(result)<br />
    BAktionFX.clear<br />
    kyon_btl_akt_fx_scn_btl_btl_end(result)<br />
  end<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
Free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer.<br />
Please include me in your game credits.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KReviveOnce XP]]></title>
			<link>https://www.save-point.org/thread-13346.html</link>
			<pubDate>Wed, 10 Dec 2025 17:39:06 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=1471">kyonides</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13346.html</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">KReviveOnce XP</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
Sometimes your heroes deserve a second chance to defeat that terrible mega boss. Or you might simply think that their story should not end because they were just too weak after an epic battle as to also <img src="https://www.save-point.org/images/smilies/ejlol/worried.gif" alt="Worried" title="Worried" class="smilie smilie_216" /> worry about facing a couple of slimes right away.<br />
<br />
No matter what your excuse might be, now your heroes can be automatically revived once!<br />
<br />
Just set a specific state ID and the HP percentage they will recover and that's it!<br />
<br />
<img src="https://www.save-point.org/images/smilies/ejlol/sweathappy.gif" alt="Happy with a sweat" title="Happy with a sweat" class="smilie smilie_31" /> Of course, if a given hero dies without having that state listed at that critical moment, it's <img src="https://www.save-point.org/images/smilies/ejlol/skull.gif" alt="Skull" title="Skull" class="smilie smilie_214" /> game over for him or her! <img src="https://www.save-point.org/images/smilies/ejlol/laughing.gif" alt="Laughing" title="Laughing" class="smilie smilie_23" /><br />
<br />
<span style="font-weight: bold;" class="mycode_b">The Script</span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * KReviveOnce XP * #<br />
#  Scripter : Kyonides<br />
#  2025-12-10<br />
<br />
# Let your heroes revive ONCE if they got a very specific state before<br />
# they met their premature demises.<br />
<br />
module KRevive<br />
  ONCE_STATE_ID = 25<br />
  ONCE_STATE_PERC = 25<br />
end<br />
<br />
class Game_Battler<br />
  alias :kyon_revive_once_gm_btlr_remove_state :remove_state<br />
  def check_revive_once(state_id)<br />
    @can_revive = (KRevive::ONCE_STATE_ID == state_id and state?(state_id))<br />
  end<br />
<br />
  def remove_state(state_id, force=false)<br />
    check_revive_once(state_id)<br />
    kyon_revive_once_gm_btlr_remove_state(state_id, force)<br />
    apply_revive_once<br />
  end<br />
<br />
  def apply_revive_once<br />
    if @can_revive and !state?(KRevive::ONCE_STATE_ID) and @hp &lt; 2<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@states.delete(1)<br />
      @hp = maxhp * KRevive::ONCE_STATE_PERC<br />
    end<br />
    @can_revive = nil<br />
  end<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
Free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer.<br />
Include me in your game credits.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">KReviveOnce XP</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
Sometimes your heroes deserve a second chance to defeat that terrible mega boss. Or you might simply think that their story should not end because they were just too weak after an epic battle as to also <img src="https://www.save-point.org/images/smilies/ejlol/worried.gif" alt="Worried" title="Worried" class="smilie smilie_216" /> worry about facing a couple of slimes right away.<br />
<br />
No matter what your excuse might be, now your heroes can be automatically revived once!<br />
<br />
Just set a specific state ID and the HP percentage they will recover and that's it!<br />
<br />
<img src="https://www.save-point.org/images/smilies/ejlol/sweathappy.gif" alt="Happy with a sweat" title="Happy with a sweat" class="smilie smilie_31" /> Of course, if a given hero dies without having that state listed at that critical moment, it's <img src="https://www.save-point.org/images/smilies/ejlol/skull.gif" alt="Skull" title="Skull" class="smilie smilie_214" /> game over for him or her! <img src="https://www.save-point.org/images/smilies/ejlol/laughing.gif" alt="Laughing" title="Laughing" class="smilie smilie_23" /><br />
<br />
<span style="font-weight: bold;" class="mycode_b">The Script</span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * KReviveOnce XP * #<br />
#  Scripter : Kyonides<br />
#  2025-12-10<br />
<br />
# Let your heroes revive ONCE if they got a very specific state before<br />
# they met their premature demises.<br />
<br />
module KRevive<br />
  ONCE_STATE_ID = 25<br />
  ONCE_STATE_PERC = 25<br />
end<br />
<br />
class Game_Battler<br />
  alias :kyon_revive_once_gm_btlr_remove_state :remove_state<br />
  def check_revive_once(state_id)<br />
    @can_revive = (KRevive::ONCE_STATE_ID == state_id and state?(state_id))<br />
  end<br />
<br />
  def remove_state(state_id, force=false)<br />
    check_revive_once(state_id)<br />
    kyon_revive_once_gm_btlr_remove_state(state_id, force)<br />
    apply_revive_once<br />
  end<br />
<br />
  def apply_revive_once<br />
    if @can_revive and !state?(KRevive::ONCE_STATE_ID) and @hp &lt; 2<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@states.delete(1)<br />
      @hp = maxhp * KRevive::ONCE_STATE_PERC<br />
    end<br />
    @can_revive = nil<br />
  end<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
Free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer.<br />
Include me in your game credits.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Hex Colors RG]]></title>
			<link>https://www.save-point.org/thread-13315.html</link>
			<pubDate>Tue, 18 Nov 2025 07:02:54 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=1471">kyonides</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13315.html</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">Hex Colors RG</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
I'm back to leave you another scriptlet that will allow you to use hex colors in your windows and sprites with ease.<br />
<br />
This code will work on RMXP, RMVX and even RMVX ACE! <img src="https://www.save-point.org/images/smilies/ejlol/shocked.gif" alt="Shocked" title="Shocked" class="smilie smilie_22" /><br />
<br />
Just use it like this:<br />
<br />
For Windows:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>self.contents.font.color = hex_color("FF00FF")</code></div></div><br />
For Sprites:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>self.bitmap.font.color = hex_color("FF00FF")</code></div></div><br />
In this particular case, your text will become purple-ish! <img src="https://www.save-point.org/images/smilies/ejlol/virus.gif" alt="Virus" title="Virus" class="smilie smilie_75" /> <br />
<br />
You can also add 2 extra characters to set the alpha value of your custom color manually.<br />
<br />
In both cases you can add the # pound sign at the beginning of the string, but it's not mandatory.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The Script</span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * Hex Colors RG * # <br />
#  Scripter : Kyonides<br />
#  2025-11-18<br />
<br />
module Hex<br />
  def hex_color(hex)<br />
    digits = hex.size<br />
    hex.sub!("#", "")<br />
    red = hex[0, 2].to_i(16)<br />
    green = hex[2, 2].to_i(16)<br />
    blue = hex[4, 2].to_i(16)<br />
    alpha = digits == 8 ? hex[6, 2] : 255<br />
    Color.new(red, green, blue, alpha)<br />
  end<br />
end<br />
<br />
class Window_Base<br />
  include Hex<br />
end<br />
<br />
class Sprite<br />
  include Hex<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
It's free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer. That's all you need to know. <img src="https://www.save-point.org/images/smilies/ejlol/wink.gif" alt="Winking" title="Winking" class="smilie smilie_33" />]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">Hex Colors RG</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
I'm back to leave you another scriptlet that will allow you to use hex colors in your windows and sprites with ease.<br />
<br />
This code will work on RMXP, RMVX and even RMVX ACE! <img src="https://www.save-point.org/images/smilies/ejlol/shocked.gif" alt="Shocked" title="Shocked" class="smilie smilie_22" /><br />
<br />
Just use it like this:<br />
<br />
For Windows:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>self.contents.font.color = hex_color("FF00FF")</code></div></div><br />
For Sprites:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>self.bitmap.font.color = hex_color("FF00FF")</code></div></div><br />
In this particular case, your text will become purple-ish! <img src="https://www.save-point.org/images/smilies/ejlol/virus.gif" alt="Virus" title="Virus" class="smilie smilie_75" /> <br />
<br />
You can also add 2 extra characters to set the alpha value of your custom color manually.<br />
<br />
In both cases you can add the # pound sign at the beginning of the string, but it's not mandatory.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The Script</span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * Hex Colors RG * # <br />
#  Scripter : Kyonides<br />
#  2025-11-18<br />
<br />
module Hex<br />
  def hex_color(hex)<br />
    digits = hex.size<br />
    hex.sub!("#", "")<br />
    red = hex[0, 2].to_i(16)<br />
    green = hex[2, 2].to_i(16)<br />
    blue = hex[4, 2].to_i(16)<br />
    alpha = digits == 8 ? hex[6, 2] : 255<br />
    Color.new(red, green, blue, alpha)<br />
  end<br />
end<br />
<br />
class Window_Base<br />
  include Hex<br />
end<br />
<br />
class Sprite<br />
  include Hex<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
It's free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer. That's all you need to know. <img src="https://www.save-point.org/images/smilies/ejlol/wink.gif" alt="Winking" title="Winking" class="smilie smilie_33" />]]></content:encoded>
		</item>
	</channel>
</rss>