ACBS - Atoa Custom Battle System 3.2

It's an syntax erro, you configurated the thing wrong.

{17 => {1 => 127}}, {1 => {1 => 126}}

You closed the main Key,

the correct is:
{17 => {1 => 127}, 1 => {1 => 126}}

As you can see, the first key must be closed only at the end.
Ahh, i see, but I fixed it and now it gives me this error :sad: Image

But still, it there a code for the changing battler, or is it somewhere but I just missed it or "was to lazy to look for it so therefore I will not help you with it."

Thank you and have a nice day!
strange, it wasn't supposed to return nil for an equip...

in any case, just add this line above the line that returns this error:
next if eqp.nil?
Ahh, thanks it works flawlessly now, thanks.

Thank you and have a nice day!
Huh? When i kill a phantom i get a random item!


what the heck?
Yea dylstew that same problem happens to me as well. Even If I pinned a specific item to a specific monster there is still time when I receive a random item. such armor or weapons. I thought it was just me.
No ID wrote:
Yea dylstew that same problem happens to me as well. Even If I pinned a specific item to a specific monster there is still time when I receive a random item. such armor or weapons. I thought it was just me.




I guess we found a bug...

Dammit!

EDIT;
i found soemthing out..

If i try to look at my stats the game crashes:

Image
Quote:
I guess we found a bug...

I guess I foundo someone that don't look *all* settings before reporting bugs...

This "Random Item", it's the Multi Drop Feature.
Just change it on the Advanced settings.
  1. #¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
  2.   # MULTI DROP ITEMS
  3.   #¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
  4.   # Enemy_Drops[ID] = {'ITEM' => RATE}
  5.   #
  6.   # ID = Enemy ID
  7.   # ITEM = Item type and ID. Must be expressed as 'xY'
  8.   #  where x = item type and Y = item ID
  9.   #  x must be 'a' for armors, 'w' for weapons, 'i' for items
  10.   #  E.g.: 'a12' = Armor ID 12
  11.   # RATE = Item drop %. An value between 0 and 100, can be decimals
  12.   #  E.g.: '5.4' = 5.4% drop rate
  13.   #
  14.   # E.g.: Enemy_Drops[15] = {'w6' => 22.5, 'a9' => 12}
  15.   # That means enemy ID 15 (Enemy_Drops[15])
  16.   # has 22,5% of dropping the weapon ID 6 ('w6' => 22.5)
  17.   # and have 12% of dropping the armor ID 9 ('a9' => 12)
  18.   #
  19.   # Repeated items won't be considered
  20.   #
  21.   Enemy_Drops[1] = {'a1' => 15.5, 'w1' => 10, 'i2' =>  50}
  22.   Enemy_Drops[2] = {'i3' => 22.5, 'w2' => 0.5}
Expand to see the code.

As you can see, the ghots and the slime have extra drops

@ dylstew
Try don't use the ACBS with pirated RMXP versions. u.u
Atoa wrote:
Quote:
I guess we found a bug...

I guess I foundo someone that don't look *all* settings before reporting bugs...

This "Random Item", it's the Multi Drop Feature.
Just change it on the Advanced settings.
  1. #¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
  2.   # MULTI DROP ITEMS
  3.   #¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
  4.   # Enemy_Drops[ID] = {'ITEM' => RATE}
  5.   #
  6.   # ID = Enemy ID
  7.   # ITEM = Item type and ID. Must be expressed as 'xY'
  8.   #  where x = item type and Y = item ID
  9.   #  x must be 'a' for armors, 'w' for weapons, 'i' for items
  10.   #  E.g.: 'a12' = Armor ID 12
  11.   # RATE = Item drop %. An value between 0 and 100, can be decimals
  12.   #  E.g.: '5.4' = 5.4% drop rate
  13.   #
  14.   # E.g.: Enemy_Drops[15] = {'w6' => 22.5, 'a9' => 12}
  15.   # That means enemy ID 15 (Enemy_Drops[15])
  16.   # has 22,5% of dropping the weapon ID 6 ('w6' => 22.5)
  17.   # and have 12% of dropping the armor ID 9 ('a9' => 12)
  18.   #
  19.   # Repeated items won't be considered
  20.   #
  21.   Enemy_Drops[1] = {'a1' => 15.5, 'w1' => 10, 'i2' =>  50}
  22.   Enemy_Drops[2] = {'i3' => 22.5, 'w2' => 0.5}
Expand to see the code.

As you can see, the ghots and the slime have extra drops

@ dylstew
Try don't use the ACBS with pirated RMXP versions. u.u


I'm going to buy RMXP tommorow!

By the way you didn't pay in the begining too!

EDIT:
Wat! How am i going to do it?
Uninstall RMXp and then buy it? 0.o
Atoa wrote:
I guess I found someone that don't look *all* settings before reporting bugs...

This "Random Item", it's the Multi Drop Feature.
Just change it on the Advanced settings.


wow I'm an idiot. I've been looking at it the whole time and never payed any attention to what it does. I feel dumb because the whole time I'm thinking "I wonder if Atoa could add a muti item drop feature" :specs:
No ID wrote:
Atoa wrote:
I guess I found someone that don't look *all* settings before reporting bugs...

This "Random Item", it's the Multi Drop Feature.
Just change it on the Advanced settings.


wow I'm an idiot. I've been looking at it the whole time and never payed any attention to what it does. I feel dumb because the whole time I'm thinking "I wonder if Atoa could add a muti item drop feature" :specs:


You made me lol.
i feel like an idiot too...
Quote:
By the way you didn't pay in the begining too!
By the way this is nothing about the thread...
Atoa, I'm going to go out on a limb and ask a silly question. This module right here:

viewtopic.php?f=11&t=63673

The scripter does say that it's not generally compatible with other battle systems, but he singles out ABS's, not RTBS's. In your expert opinion, would this function with your Battle Engine? I can see immense space-savings if it does.

Thanks again for a great engine!
@MayorAnime
Since he aliases most method i suppose this would work fine.
Just put it bellow other battle scripts.

I was thinking in making my own version of this system, something like FF8, where you could also set an level for enemies (that could be used with the scan script), an random variance of level difference, a range level for troops, change exp and drops according level difference.
Atoa wrote:
@MayorAnime
Since he aliases most method i suppose this would work fine.
Just put it bellow other battle scripts.

I was thinking in making my own version of this system, something like FF8, where you could also set an level for enemies (that could be used with the scan script), an random variance of level difference, a range level for troops, change exp and drops according level difference.



That would be very awesome. This could work in the meantime, or whatnot. But anyway, I'll try it and see what happens.

By the way, we ARE your next additions going to be?

EDIT: Meant to say "By the way, -what- ARE your next additions going to be?" Hurray for typos!
Hello just wanted to say i've been using rpg maker for years now, and i have searched and prayed that someone would make a CT BATTLE system, and i must say , yours is fantastic. You really did a great job with this one, it has so many features and possibilities.
I just had one question, how do you turn on the diagonal movement, a chrono trigger game just dont feel right with 4 directional movement. i used to used fotz pixelmovement but its not compatible with this script.

I read through most of this thread and couldnt find an answer

Thanks again ATOA for this wonderfully done script.
And thanks for eveyone who tested it for him, without you guys it wouldnt be as perfected as it is now.

EDIT, Also i plan on making a chrono trigger battler pack, its fitting for this package, if anyone would like to help me , theyre more than welcome too.
Quote:
I just had one question, how do you turn on the diagonal movement, a chrono trigger game just dont feel right with 4 directional movement.
I removed the 8-way movement from the CT battle, i willl make it as an separated script (compatible with CT Caterpillar obviously)
Atoa, I know your a busy man and everything but I am really no good with scripts.
I was wondering if you or anyone who is reading this with any scripting ability could make the cms coded below compatible with this cbs.

Now for the most part they are but there are a few issues: The New Status and Equip Muti Slots don't show up in the menu, instead they show the defaults from the system database. Now I tried putting the cms below this script but it still didn't work.

If this task is to time consuming or impossible then it's fine, I was just posting, hoping there was a chance this problem could be fixed easily.

  1. #==============================================================================
  2. # ** Chrono Trigger CMS
  3. #------------------------------------------------------------------------------
  4. # Raziel
  5. # 2006-09-09
  6. # Version 1.20
  7. #------------------------------------------------------------------------------
  8. # Thanks to
  9. # ~ Squall/Selwyn for his Cursor Script
  10. # ~ RPG Advocate for his Party Members change script
  11. # ~ MeisMe for fixing some bugs and helping me
  12. # ~ Squaresoft for the pictures
  13. #==============================================================================
  14. # ~Instructions
  15. #  Icons of the characters are used in the save menu.
  16. #  Make sure you put them in the icon folder and name them
  17. #  like you name your character file, for example the icon for
  18. #  Arshes would be 001-Fighter01
  19. #  
  20. #  For the chapter function, just use $game_system = "desired filename"
  21. #  in a call script command and then the savefile will have the name
  22. #  you choose.
  23. #==============================================================================
  24. #==============================================================================
  25. # ** Scene_Menu
  26. #------------------------------------------------------------------------------
  27. #  This class performs menu screen processing.
  28. #==============================================================================
  29. class Scene_Menu
  30.   #--------------------------------------------------------------------------
  31.   # * Object Initialization
  32.   #     menu_index : command cursor's initial position
  33.   #--------------------------------------------------------------------------
  34.   def initialize(menu_index = 0)
  35.     @menu_index = menu_index
  36.   end
  37.   #--------------------------------------------------------------------------
  38.   # * Main Processing
  39.   #--------------------------------------------------------------------------
  40.   def main
  41.     # Make command window
  42.     @equip_background = Window_Base.new(315, 37, 270, 410)
  43.     @target_background = Window_Base.new(320, 101, 267, 329)
  44.     @accessory_window = Window_Base.new(45, 139, 270, 75)
  45.     @help_background = Window_Base.new(45, 35, 540, 82)
  46.     @accessory_window.z = 999
  47.     @weapon_window = Window_Base.new(45, 214, 270, 233)
  48.     @skill_left = Window_Base.new(45, 36, 270, 340)
  49.     @skill_right = Window_Base.new(315, 36, 274, 340)
  50.     @save_left = Window_Base.new(39,273,241,172)
  51.     @save_right = Window_Base.new(280,273,320,172)
  52.     @weapon_window.z = 999
  53.     @target_background.z = 999
  54.     @back_ground = Sprite.new
  55.     @back_ground.bitmap = RPG::Cache.picture(CT_Pictures::BG_Picture)
  56.     @item_background = Window_Base.new(45, 117, 540, 330)
  57.     @playtime_background = Window_Base.new(0, 384, 160, 96)
  58.     @playtime_background.z = 9999
  59.     @party_change = Window_PartyChange.new
  60.     @command_window = Window_IconCommands.new
  61.     @command_window.index = @menu_index
  62.     @actor_window = Window_Actors.new
  63.     @new_equip = Window_NewEquip.new
  64.     $game_temp.equip_window = @new_equip
  65.     @item_window = Window_Item.new
  66.     @help_window = Window_Help.new
  67.     @playtime_window = Window_PlayTime.new
  68.     @item_window.help_window = @help_window
  69.     @help_window.opacity, @item_window.opacity = 0, 0
  70.     @help_window.x, @help_window.y = 48, 45
  71.     @target_window = Window_Target.new
  72.     @actor_skillwindow = Window_SkillActor.new
  73.     @target_cursor = []
  74.     @target_cursor_skill = []
  75.     @switch_cursor = []
  76.     @equip_item = []
  77.     @actor_background = []
  78.     @switch_window = []
  79.     @save_window = []
  80.     @switch = 0
  81.     @actor_background[0] = Window_Base.new(45, 0 + 37, 270, 102)
  82.     @actor_background[1] = Window_Base.new(45, 102 + 37, 270, 102)
  83.     @actor_background[2] = Window_Base.new(45, 204 + 37, 270, 102)
  84.     @actor_background[3] = Window_Base.new(45, 306 + 37, 270, 102)
  85.     @target_cursor[0] = Sprite_Cursor.new(306, 196)
  86.     @target_cursor[1] = Sprite_Cursor.new(306, 276)
  87.     @target_cursor[2] = Sprite_Cursor.new(306, 356)
  88.     @target_cursor_skill[0] = Sprite_Cursor.new(306, 121)
  89.     @target_cursor_skill[1] = Sprite_Cursor.new(306, 201)
  90.     @target_cursor_skill[2] = Sprite_Cursor.new(306, 281)
  91.     @switch_cursor[0] = Sprite_Cursor.new(182, 15)
  92.     @switch_cursor[1] = Sprite_Cursor.new(182, 125)
  93.     @switch_cursor[2] = Sprite_Cursor.new(182, 235)
  94.     @switch_cursor[3] = Sprite_Cursor.new(182, 345)
  95.     @equip_item[0] = Window_EquipItem2.new(0)
  96.     @equip_item[1] = Window_EquipItem2.new(1)
  97.     @equip_item[2] = Window_EquipItem2.new(2)
  98.     @equip_item[3] = Window_EquipItem2.new(3)
  99.     @equip_item[4] = Window_EquipItem2.new(4)
  100.     @switch_window[0] = Window_Base.new(190,15,270,110)
  101.     @switch_window[1] = Window_Base.new(190,125,270,110)
  102.     @switch_window[2] = Window_Base.new(190,235,270,110)
  103.     @switch_window[3] = Window_Base.new(190,345,270,110)
  104.     @save_window[0] = Window_Base.new(39,32, 560, 70)
  105.     @save_window[1] = Window_Base.new(39,102, 560, 70)
  106.     @save_window[2] = Window_Base.new(39,172, 560, 70)
  107.     @equip_description = Window_EquipDescription.new
  108.     @counter = 0
  109.     @end_window = Window_End.new
  110.     @end_window.x = 320 - @end_window.width / 2
  111.     @end_window.y = 220 - @end_window.height / 2
  112.     @savefile_windows = []
  113.     for i in 0..2
  114.       @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
  115.     end
  116.     @file_index = $game_temp.last_file_index
  117.     @savefile_windows[@file_index].selected = true
  118.     @save_status = Window_SaveStatus.new
  119.     @skill_actor_window2 = []
  120.     @skill_window = []
  121.     unless $game_party.actors[0] == nil
  122.       @skill_actor_window2[0] = Window_SkillActor2.new($game_party.actors[0])
  123.       @skill_window[0] = Window_Skill.new($game_party.actors[0])
  124.     end
  125.     unless $game_party.actors[1] == nil
  126.       @skill_actor_window2[1] = Window_SkillActor2.new($game_party.actors[1])
  127.       @skill_window[1] = Window_Skill.new($game_party.actors[1])
  128.     end
  129.     unless $game_party.actors[2] == nil
  130.       @skill_actor_window2[2] = Window_SkillActor2.new($game_party.actors[2])
  131.       @skill_window[2] = Window_Skill.new($game_party.actors[2])
  132.     end
  133.     unless $game_party.actors[3] == nil
  134.       @skill_actor_window2[3] = Window_SkillActor2.new($game_party.actors[3])
  135.       @skill_window[3] = Window_Skill.new($game_party.actors[3])
  136.     end
  137.     @item_window.visible = false
  138.     @help_window.visible = false
  139.     @item_background.visible = false
  140.     @help_background.visible = false
  141.     @target_window.visible = false
  142.     @actor_skillwindow.visible = false
  143.     @save_status.visible = false
  144.     @end_window.visible = false
  145.     @party_change.visible = false
  146.     @equip_description.visible = false
  147.     @target_background.visible = false
  148.     @accessory_window.visible = false
  149.     @weapon_window.visible = false
  150.     @help_background.visible = false
  151.     @skill_left.visible = false
  152.     @skill_right.visible = false
  153.     @save_left.visible = false
  154.     @save_right.visible = false
  155.     for i in 0..2
  156.       @target_cursor[i].visible = false
  157.       @target_cursor_skill[i].visible = false
  158.       @savefile_windows[i].visible = false
  159.       @switch_cursor[i].visible = false
  160.       @switch_window[i].visible = false
  161.       @switch_cursor[3].visible = false
  162.       @switch_window[3].visible = false
  163.       @save_window[i].visible = false
  164.     end
  165.     for i in 0..4
  166.       @equip_item[i].active = false
  167.       @equip_item[i].visible = false
  168.     end
  169.     for i in 0...$game_party.actors.size
  170.       @skill_window[i].visible = false
  171.       @skill_window[i].active = false
  172.       @skill_window[i].width = 300
  173.       @skill_actor_window2[i].visible = false
  174.       @skill_actor_window2[i].active = false
  175.     end
  176.     @item_window.active = false
  177.     @target_window.active = false
  178.     @actor_skillwindow.active = false
  179.     @end_window.active = false
  180.     @party_change.active = false
  181.     for i in 0..2
  182.       @savefile_windows[i].active = false
  183.     end
  184.     #refresh
  185.     equip_refresh
  186.     # Execute transition
  187.     Graphics.transition
  188.     # Main loop
  189.     loop do
  190.       # Update game screen
  191.       Graphics.update
  192.       # Update input information
  193.       Input.update
  194.       # Frame update
  195.       update
  196.       # Abort loop if screen is changed
  197.       if $scene != self
  198.         break
  199.       end
  200.     end
  201.     # Prepare for transition
  202.     Graphics.freeze
  203.     # Dispose of windows
  204.     @back_ground.dispose
  205.     @actor_window.dispose
  206.     @command_window.dispose
  207.     @new_equip.dispose
  208.     @item_window.dispose
  209.     @help_window.dispose
  210.     @item_background.dispose
  211.     @target_window.dispose
  212.     @actor_skillwindow.dispose
  213.     @save_status.dispose
  214.     @end_window.dispose
  215.     @party_change.dispose
  216.     @switch_cursor[3].dispose
  217.     @equip_description.dispose
  218.     @playtime_window.dispose
  219.     @playtime_background.dispose
  220.     @equip_background.dispose
  221.     @accessory_window.dispose
  222.     @help_background.dispose
  223.     @skill_left.dispose
  224.     @skill_right.dispose
  225.     @save_left.dispose
  226.     @save_right.dispose
  227.     for i in @skill_actor_window2
  228.       i.dispose
  229.     end
  230.     for i in @skill_window
  231.       i.dispose
  232.     end
  233.     for i in @savefile_windows
  234.       i.dispose
  235.     end
  236.     for i in @target_cursor
  237.       i.dispose
  238.     end
  239.     for i in @target_cursor_skill
  240.       i.dispose
  241.     end
  242.     for i in @switch_cursor
  243.       i.dispose
  244.     end
  245.     for i in @equip_item
  246.       i.dispose
  247.     end
  248.     for i in @save_window
  249.       i.dispose
  250.     end
  251.     for i in @actor_background
  252.       i.dispose
  253.     end
  254.     for i in @switch_window
  255.       i.dispose
  256.     end
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # * Frame Update
  260.   #--------------------------------------------------------------------------
  261.   def update
  262.     # Update windows
  263.     @actor_window.update
  264.     @command_window.update
  265.     @new_equip.update
  266.     @item_window.update
  267.     @help_window.update
  268.     @target_window.update
  269.     @actor_skillwindow.update
  270.     @save_status.update
  271.     @party_change.update
  272.     @end_window.update
  273.     @equip_description.update
  274.     @playtime_window.update
  275.     equip_refresh
  276.     for i in @savefile_windows
  277.       i.update
  278.     end
  279.     for i in @skill_window
  280.       i.update
  281.     end
  282.     for i in @skill_actor_window2
  283.       i.update
  284.     end
  285.     for i in @equip_item
  286.       i.update
  287.     end
  288.     if @command_window.active
  289.       # If command window is active: call update_command
  290.       update_command
  291.     elsif @actor_window.active
  292.       # If actor window is active: call update_actor
  293.       update_actor
  294.     elsif @new_equip.active
  295.       # If new equip window is active: call update_equip
  296.       update_equip
  297.     elsif @equip_item[@new_equip.index].active
  298.       # If item equip window is active: call update_equipitem
  299.       update_equipitem
  300.     elsif @item_window.active
  301.       # If item window is active: call update_item
  302.       update_item
  303.     elsif @target_window.active
  304.       # If target window is active: call update_target
  305.       update_target
  306.     elsif @actor_skillwindow.active
  307.       # If actor skill window is active: call update_actor_skill
  308.       update_actor_skill
  309.     elsif @skill_window[@actor_skillwindow.index].active
  310.       # If skill window is active: call update_skill
  311.       update_skill
  312.     elsif @savefile_windows[@file_index].active
  313.       # If savefile window is active: call update_savefile
  314.       update_savefile
  315.     elsif @party_change.active
  316.       # If party change window is active: call update_change
  317.       update_change
  318.     elsif @end_window.active
  319.       # If end window is active: call update_end
  320.       update_end
  321.     end
  322.     $game_temp.save_index = @file_index
  323.     $game_temp.skill_index = @skill_window[@actor_skillwindow.index].index
  324.     $game_temp.equip_index = @new_equip.index
  325.   end
  326.   #--------------------------------------------------------------------------
  327.   # * Frame Update (when command window is active)
  328.   #--------------------------------------------------------------------------
  329.   def update_command
  330.     case @command_window.index
  331.     when 0
  332.       for i in 0..3
  333.         @actor_background[i].visible = true
  334.       end
  335.       @equip_background.visible = true
  336.       @actor_window.visible = true
  337.       @new_equip.visible = true
  338.       @item_window.visible = false
  339.       @item_background.visible = false
  340.       @help_background.visible = false
  341.       @help_background.visible = false
  342.     when 1
  343.       for i in 0..3
  344.         @actor_background[i].visible = false
  345.       end
  346.       @equip_background.visible = false
  347.       @actor_window.visible = false
  348.       @new_equip.visible = false
  349.       @actor_skillwindow.visible = false
  350.       @item_window.visible = true
  351.       @item_background.visible = true
  352.       @help_background.visible = true
  353.       @help_background.y = 35
  354.       @help_window.y = 45
  355.       @help_background.width = 540
  356.       @skill_left.visible = false
  357.       @skill_right.visible = false
  358.     when 2
  359.       for i in 0..3
  360.         @switch_window[i].visible = false
  361.       end
  362.       @skill_left.visible = true
  363.       @skill_right.visible = true
  364.       @item_window.visible = false
  365.       @item_background.visible = false
  366.       @party_change.visible = false
  367.       @actor_skillwindow.visible = true
  368.       @help_background.y = 375
  369.       @help_background.width = 545
  370.       @help_background.visible = true
  371.       @help_window.y = 385
  372.     when 3
  373.       for i in 0..2
  374.         @savefile_windows[i].visible = false
  375.         @save_window[i].visible = false
  376.       end
  377.       @help_window.visible = false
  378.       @help_background.visible = false
  379.       @actor_skillwindow.visible = false
  380.       @save_status.visible = false
  381.       @party_change.visible = true
  382.       for i in 0..3
  383.         @switch_window[i].visible = true
  384.       end
  385.       @skill_left.visible = false
  386.       @skill_right.visible = false
  387.       @save_left.visible = false
  388.       @save_right.visible = false
  389.     when 4
  390.       for i in 0..3
  391.         @switch_window[i].visible = false
  392.       end
  393.       @end_window.visible = false
  394.       @party_change.visible = false
  395.       @save_left.visible = true
  396.       @save_right.visible = true
  397.     for i in 0..2
  398.       @savefile_windows[i].visible = true
  399.       @save_window[i].visible = true
  400.     end
  401.     @save_status.visible = true
  402.     when 5
  403.     for i in 0..2
  404.       @savefile_windows[i].visible = false
  405.       @save_window[i].visible = false
  406.     end
  407.     @save_left.visible = false
  408.     @save_right.visible = false
  409.     @save_status.visible = false
  410.     @end_window.visible = true
  411.     end
  412.     # If B button was pressed
  413.     if Input.trigger?(Input::B)
  414.       # Play cancel SE
  415.       $game_system.se_play($data_system.cancel_se)
  416.       # Switch to map screen
  417.       $scene = Scene_Map.new
  418.       return
  419.     end
  420.     # If C button was pressed
  421.     if Input.trigger?(Input::C)
  422.       @playtime_background.visible = false
  423.       @playtime_window.visible = false
  424.       # Branch by command window cursor position
  425.       case @command_window.index
  426.       when 0  # equip/status
  427.         $game_system.se_play($data_system.decision_se)
  428.         @command_window.active = false
  429.         @command_window.visible = false
  430.         @actor_window.active = true
  431.         @actor_window.index = 0
  432.       when 1  # item
  433.         # Make item window active
  434.         $game_system.se_play($data_system.decision_se)
  435.         @command_window.active = false
  436.         @command_window.visible = false
  437.         @item_window.active = true
  438.         @item_window.index = 0
  439.       when 2  # skills
  440.         $game_system.se_play($data_system.decision_se)
  441.         @command_window.visible = false
  442.         @command_window.active = false
  443.         @actor_skillwindow.active = true
  444.         @actor_skillwindow.index = 0
  445.       when 3 #excahnge
  446.         $game_system.se_play($data_system.decision_se)
  447.         @command_window.visible = false
  448.         @command_window.active = false
  449.         @party_change.active = true
  450.         @checker = 0
  451.       when 4 #save
  452.         if $game_system.save_disabled
  453.         $game_system.se_play($data_system.buzzer_se)
  454.         return
  455.       end
  456.         $game_system.se_play($data_system.decision_se)
  457.         @command_window.visible = false
  458.         @command_window.active = false
  459.         @file_index = 0
  460.         for i in 0..2
  461.           @savefile_windows[i].active = true
  462.           @savefile_windows[i].selected = false
  463.         end
  464.         @savefile_windows[0].selected = true
  465.       when 5 #quit
  466.         $game_system.se_play($data_system.decision_se)
  467.         @command_window.active = false
  468.         @command_window.visible = false
  469.         @end_window.active = true
  470.       end
  471.       return
  472.     end
  473.   end
  474.   #--------------------------------------------------------------------------
  475.   # * Make File Name
  476.   #     file_index : save file index (0-2)
  477.   #--------------------------------------------------------------------------
  478.   def make_filename(file_index)
  479.     return "Save#{file_index + 1}.rxdata"
  480.   end
  481.   #--------------------------------------------------------------------------
  482.   # * Frame Update (when end window is active)
  483.   #--------------------------------------------------------------------------
  484.   def update_end
  485.     # If B button was pressed
  486.     if Input.trigger?(Input::B)
  487.       $game_system.se_play($data_system.cancel_se)
  488.       @end_window.active = false
  489.       @end_window.index = 0
  490.       @command_window.visible = true
  491.       @command_window.active = true
  492.       @playtime_background.visible = true
  493.       @playtime_window.visible = true
  494.     end
  495.     # If C button was pressed
  496.     if Input.trigger?(Input::C)
  497.       $game_system.se_play($data_system.decision_se)
  498.       case @end_window.index
  499.       when 0
  500.         $scene = Scene_Title.new
  501.       when 1
  502.         $scene = nil
  503.       when 2
  504.         @end_window.active = false
  505.         @command_window.visible = true
  506.         @command_window.active = true
  507.       end
  508.     end
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # * Frame Update (when change window is active)
  512.   #--------------------------------------------------------------------------
  513.   def update_change
  514.     # If B button was pressed
  515.     if Input.trigger?(Input::B)
  516.       # Play cancel SE
  517.       $game_system.se_play($data_system.cancel_se)
  518.       @party_change.active = false
  519.       @party_change.index = 0
  520.       @command_window.visible = true
  521.       @command_window.active = true
  522.       @playtime_background.visible = true
  523.       @playtime_window.visible = true
  524.       @checker = 0
  525.       for i in 0..3
  526.         @switch_cursor[i].visible = false
  527.       end
  528.     end
  529.     # If C button was pressed
  530.     if Input.trigger?(Input::C)
  531.       # Play decision SE
  532.       $game_system.se_play($data_system.decision_se)
  533.       if @checker == 0
  534.         @changer = $game_party.actors[@party_change.index]
  535.         @changer_skill = @skill_window[@party_change.index]
  536.         @changer_skill2 = @skill_actor_window2[@party_change.index]
  537.         @where = @party_change.index
  538.         @switch_cursor[@party_change.index].visible = true
  539.         @checker = 1
  540.         else
  541.         $game_party.actors[@where] = $game_party.actors[@party_change.index]
  542.         $game_party.actors[@party_change.index] = @changer
  543.         @skill_actor_window2[@where] = @skill_actor_window2[@party_change.index]
  544.         @skill_actor_window2[@party_change.index] = @changer_skill2
  545.         @skill_window[@where] = @skill_window[@party_change.index]
  546.         @skill_window[@party_change.index] = @changer_skill
  547.         @checker = 0
  548.         @party_change.refresh
  549.         @actor_window.refresh
  550.         @new_equip.refresh
  551.         @target_window.refresh
  552.         @actor_skillwindow.refresh
  553.         @save_status.refresh
  554.         for i in 0..3
  555.           @switch_cursor[i].visible = false
  556.         end
  557.       end
  558.     end
  559.   end
  560.   #--------------------------------------------------------------------------
  561.   # * Frame Update (when save window is active)
  562.   #--------------------------------------------------------------------------
  563.   def update_savefile
  564.     # If C button was pressed
  565.     if Input.trigger?(Input::C)
  566.       # Call method: on_decision (defined by the subclasses)
  567.       on_decision(make_filename(@file_index))
  568.       $game_temp.last_file_index = @file_index
  569.       return
  570.     end
  571.     # If B button was pressed
  572.     if Input.trigger?(Input::B)
  573.       # Call method: on_cancel (defined by the subclasses)
  574.       on_cancel
  575.       return
  576.     end
  577.     # If the down directional button was pressed
  578.     if Input.repeat?(Input::DOWN)
  579.       # If the down directional button pressed down is not a repeat,
  580.       # or cursor position is more in front than 3
  581.       unless @file_index == 2
  582.       if Input.trigger?(Input::DOWN)
  583.         # Play cursor SE
  584.         $game_system.se_play($data_system.cursor_se)
  585.         # Move cursor down
  586.         @savefile_windows[@file_index].selected = false
  587.         @file_index = (@file_index + 1)# % 3
  588.         @savefile_windows[@file_index].selected = true
  589.         return
  590.       end
  591.       end
  592.     # If the up directional button was pressed
  593.     elsif Input.repeat?(Input::UP)
  594.       # If the up directional button pressed down is not a repeat、
  595.       # or cursor position is more in back than 0
  596.       unless @file_index == 0
  597.         if Input.trigger?(Input::UP)
  598.           # Play cursor SE
  599.           $game_system.se_play($data_system.cursor_se)
  600.           # Move cursor up
  601.           @savefile_windows[@file_index].selected = false
  602.           @file_index = (@file_index - 1)# % 3
  603.           @savefile_windows[@file_index].selected = true
  604.           return
  605.         end
  606.       end
  607.     end
  608.   end
  609.   #--------------------------------------------------------------------------
  610.   # * Decision Processing
  611.   #--------------------------------------------------------------------------
  612.   def on_decision(filename)
  613.     # Play save SE
  614.     $game_system.se_play($data_system.save_se)
  615.     # Write save data
  616.     file = File.open(filename, "wb")
  617.     write_save_data(file)
  618.     file.close
  619.     # If called from event
  620.     if $game_temp.save_calling
  621.       # Clear save call flag
  622.       $game_temp.save_calling = false
  623.       # Switch to map screen
  624.       $scene = Scene_Map.new
  625.       return
  626.     end
  627.     for i in 0..2
  628.       @savefile_windows[i].active = false
  629.       @savefile_windows[i].selected = false
  630.     end
  631.     @savefile_windows[0].selected = true
  632.     @playtime_background.visible = true
  633.     @playtime_window.visible = true
  634.     # Switch to map screen
  635.     $scene = Scene_Map.new
  636.   end
  637.   #--------------------------------------------------------------------------
  638.   # * Cancel Processing
  639.   #--------------------------------------------------------------------------
  640.   def on_cancel
  641.     # Play cancel SE
  642.     $game_system.se_play($data_system.cancel_se)
  643.     # If called from event
  644.     if $game_temp.save_calling
  645.       # Clear save call flag
  646.       $game_temp.save_calling = false
  647.       # Switch to map screen
  648.       $scene = Scene_Map.new
  649.       return
  650.     end
  651.     # Switch to menu screen
  652.     for i in 0..2
  653.       @savefile_windows[i].active = false
  654.       @savefile_windows[i].selected = false
  655.     end
  656.     @savefile_windows[0].selected = true
  657.     @save_status.refresh
  658.     @command_window.visible = true
  659.     @command_window.active = true
  660.     @command_window.index = 4
  661.     @playtime_background.visible = true
  662.     @playtime_window.visible = true
  663.   end
  664.   #--------------------------------------------------------------------------
  665.   # * Write Save Data
  666.   #     file : write file object (opened)
  667.   #--------------------------------------------------------------------------
  668.   def write_save_data(file)
  669.     # Make character data for drawing save file
  670.     characters = []
  671.     for i in 0...$game_party.actors.size
  672.       actor = $game_party.actors[i]
  673.       characters.push([actor.character_name, actor.character_hue])
  674.     end
  675.     # Write character data for drawing save file
  676.     Marshal.dump(characters, file)
  677.     # Wrire frame count for measuring play time
  678.     Marshal.dump(Graphics.frame_count, file)
  679.     # Increase save count by 1
  680.     $game_system.save_count += 1
  681.     # Save magic number
  682.     # (A random value will be written each time saving with editor)
  683.     $game_system.magic_number = $data_system.magic_number
  684.     # Write each type of game object
  685.     Marshal.dump($game_system, file)
  686.     Marshal.dump($game_switches, file)
  687.     Marshal.dump($game_variables, file)
  688.     Marshal.dump($game_self_switches, file)
  689.     Marshal.dump($game_screen, file)
  690.     Marshal.dump($game_actors, file)
  691.     Marshal.dump($game_party, file)
  692.     Marshal.dump($game_troop, file)
  693.     Marshal.dump($game_map, file)
  694.     Marshal.dump($game_player, file)
  695.   end
  696.   #--------------------------------------------------------------------------
  697.   # * Frame Update (when equip window is active)
  698.   #--------------------------------------------------------------------------
  699.   def update_equip
  700.     for i in 0..4
  701.       @equip_item[i].visible = false
  702.     end
  703.     @equip_item[@new_equip.index].visible = true
  704.     # If B button was pressed
  705.     if Input.trigger?(Input::B)
  706.       # Play cancel SE
  707.       $game_system.se_play($data_system.cancel_se)
  708.       @new_equip.index = 0
  709.       @new_equip.active = false
  710.       @actor_window.active = true
  711.       @actor_window.visible = true
  712.       @equip_description.visible = false
  713.       @accessory_window.visible = false
  714.       @weapon_window.visible = false
  715.       for i in 0..4
  716.         @equip_item[i].visible = false
  717.       end
  718.       @item_window.refresh
  719.       @target_window.refresh
  720.       @party_change.refresh
  721.     end
  722.     # If C button was pressed
  723.     if Input.trigger?(Input::C)
  724.       @actor = $game_party.actors[$game_temp.cms_index]
  725.       if @actor.equip_fix?(@new_equip.index)
  726.         # Play buzzer SE
  727.         $game_system.se_play($data_system.buzzer_se)
  728.         return
  729.       end
  730.       # Play decission SE
  731.       $game_system.se_play($data_system.decision_se)
  732.       @new_equip.active = false
  733.       @equip_item[@new_equip.index].active = true
  734.       @equip_item[@new_equip.index].index = 0
  735.     end
  736.   end
  737.   #--------------------------------------------------------------------------
  738.   # * Frame Update (when equip window is refreshed)
  739.   #--------------------------------------------------------------------------
  740.    def equip_refresh
  741.     if @new_equip.active
  742.       # Erase parameters for after equipment change
  743.       @new_equip.set_new_parameters(nil, nil, nil, nil, nil, nil, nil)
  744.     end
  745.     if @equip_item[@new_equip.index].active
  746.       @actor = $game_party.actors[$game_temp.cms_index]
  747.       # Get currently selected item
  748.       item1 = $game_temp.equip_window.item
  749.       item2 = @equip_item[@new_equip.index].item
  750.       # Change equipment
  751.       @actor.equip($game_temp.equip_index, item2 == nil ? 0 : item2.id)
  752.       # Get parameters for after equipment change
  753.       new_str = @actor.str
  754.       new_atk = @actor.atk
  755.       new_int = @actor.int
  756.       new_agi = @actor.agi
  757.       new_pdef = @actor.pdef
  758.       new_mdef = @actor.mdef
  759.       new_dex = @actor.dex
  760.       # Return equipment
  761.       @actor.equip($game_temp.equip_index, item1 == nil ? 0 : item1.id)
  762.       # Draw in left window
  763.       $game_temp.equip_window.set_new_parameters(new_str, new_atk, new_int, new_agi, new_pdef, new_mdef, new_dex)
  764.     end
  765.   end
  766.   #--------------------------------------------------------------------------
  767.   # * Frame Update (when equip item window is active)
  768.   #--------------------------------------------------------------------------
  769.   def update_equipitem
  770.     # If B button was pressed
  771.     if Input.trigger?(Input::B)
  772.       # Play cancel SE
  773.       $game_system.se_play($data_system.cancel_se)
  774.       # Activate right window
  775.       @equip_item[@new_equip.index].active = false
  776.       @equip_item[@new_equip.index].index = 0
  777.       @new_equip.active = true
  778.       return
  779.     end
  780.     # If C button was pressed
  781.     if Input.trigger?(Input::C)
  782.       # Play equip SE
  783.       $game_system.se_play($data_system.equip_se)
  784.       # Get currently selected data on the item window
  785.       item = @equip_item[@new_equip.index].item
  786.       # Change equipment
  787.       @actor.equip(@new_equip.index, item == nil ? 0 : item.id)
  788.       # Activate right window
  789.       @new_equip.active = true
  790.       @equip_item[@new_equip.index].active = false
  791.       @equip_item[@new_equip.index].index = 0
  792.       # Remake right window and item window contents
  793.       @new_equip.refresh
  794.       @equip_item[@new_equip.index].refresh
  795.       @equip_description.refresh
  796.       @actor_window.refresh
  797.       return
  798.     end
  799.   end
  800.   #--------------------------------------------------------------------------
  801.   # * Frame Update (when actor window is active)
  802.   #--------------------------------------------------------------------------
  803.   def update_actor
  804.     # If B button was pressed
  805.     if Input.trigger?(Input::B)
  806.       # Play cancel SE
  807.       $game_system.se_play($data_system.cancel_se)
  808.       @actor_window.active = false
  809.       @actor_window.index = 0
  810.       @command_window.visible = true
  811.       @command_window.active = true
  812.       @playtime_background.visible = true
  813.       @playtime_window.visible = true
  814.     end
  815.     # If C button was pressed
  816.     if Input.trigger?(Input::C)
  817.       # Play decisiion SE
  818.       $game_system.se_play($data_system.decision_se)
  819.       @actor_window.active = false
  820.       @actor_window.visible = false
  821.       @accessory_window.visible = true
  822.       @weapon_window.visible = true
  823.       @equip_item[0].visible = true
  824.       @new_equip.active = true
  825.       @equip_description.visible = true
  826.     end
  827.   end
  828.   #--------------------------------------------------------------------------
  829.   # * Frame Update (when actor skill window is active)
  830.   #--------------------------------------------------------------------------
  831.   def update_actor_skill
  832.     # If B button was pressed
  833.     if Input.trigger?(Input::B)
  834.       # Play cancel SE
  835.       $game_system.se_play($data_system.cancel_se)
  836.       @actor_skillwindow.active = false
  837.       @actor_skillwindow.index = 0
  838.       @command_window.visible = true
  839.       @command_window.active = true
  840.       @command_window.index = 2
  841.       @playtime_background.visible = true
  842.       @playtime_window.visible = true
  843.     end
  844.     # If C button was pressed
  845.     if Input.trigger?(Input::C)
  846.       # Play decision SE
  847.       $game_system.se_play($data_system.decision_se)
  848.       @actor_skillwindow.active = false
  849.       @skill_window[@actor_skillwindow.index].help_window = @help_window
  850.       @skill_window[@actor_skillwindow.index].visible = true
  851.       @skill_window[@actor_skillwindow.index].active = true
  852.       @skill_window[@actor_skillwindow.index].index = 0
  853.       @actor_skillwindow.visible = false
  854.       @skill_actor_window2[@actor_skillwindow.index].visible = true
  855.     end
  856.   end
  857.   #--------------------------------------------------------------------------
  858.   # * Frame Update (when item window is active)
  859.   #--------------------------------------------------------------------------
  860.   def update_item
  861.     # If B button was pressed
  862.     if @target_window.visible == false
  863.       for i in 0...$game_party.actors.size - 1
  864.         @target_cursor[i].visible = false
  865.       end
  866.     end
  867.     if Input.trigger?(Input::B)
  868.       # Play cancel SE
  869.       $game_system.se_play($data_system.cancel_se)
  870.       # Switch to menu screen
  871.       @item_window.visible = false
  872.       @item_window.active = false
  873.       @command_window.visible = true
  874.       @command_window.active = true
  875.       @help_window.visible = false
  876.       @playtime_background.visible = true
  877.       @playtime_window.visible = true
  878.       @item_window.index = 0
  879.       @command_window.index = 1
  880.       return
  881.     # If C button was pressed
  882.     elsif Input.trigger?(Input::C)
  883.       # Get currently selected data on the item window
  884.       @item = @item_window.item
  885.       # If not a use item
  886.       unless @item.is_a?(RPG::Item)
  887.         # Play buzzer SE
  888.         $game_system.se_play($data_system.buzzer_se)
  889.         return
  890.       end
  891.       # If it can't be used
  892.       unless $game_party.item_can_use?(@item.id)
  893.         # Play buzzer SE
  894.         $game_system.se_play($data_system.buzzer_se)
  895.         return
  896.       end
  897.       # Play decision SE
  898.       $game_system.se_play($data_system.decision_se)
  899.       # If effect scope is an ally
  900.       if @item.scope >= 3
  901.         # Activate target window
  902.         @item_window.active = false
  903.         @target_window.visible = true
  904.         @target_background.visible = true
  905.         @target_window.active = true
  906.         @target_window.y = 0
  907.         @target_background.y = 118
  908.         # Set cursor position to effect scope (single / all)
  909.         if @item.scope == 4 || @item.scope == 6
  910.           @target_window.index = -1
  911.         else
  912.           @target_window.index = 0
  913.         end
  914.       # If effect scope is other than an ally
  915.       else
  916.         # If command event ID is valid
  917.         if @item.common_event_id > 0
  918.           # Command event call reservation
  919.           $game_temp.common_event_id = @item.common_event_id
  920.           # Play item use SE
  921.           $game_system.se_play(@item.menu_se)
  922.           # If consumable
  923.           if @item.consumable
  924.             # Decrease used items by 1
  925.             $game_party.lose_item(@item.id, 1)
  926.             # Draw item window item
  927.             @item_window.draw_item(@item_window.index)
  928.           end
  929.           # Switch to map screen
  930.           $scene = Scene_Map.new
  931.           return
  932.         end
  933.       end
  934.       return
  935.     end
  936.   end
  937.   #--------------------------------------------------------------------------
  938.   # * Frame Update (when skill window is active)
  939.   #--------------------------------------------------------------------------
  940.   def update_skill
  941.     if @target_window.visible == false
  942.       for i in 0...$game_party.actors.size - 1
  943.         @target_cursor_skill[i].visible = false
  944.       end
  945.     end
  946.     # If B button was pressed
  947.     if Input.trigger?(Input::B)
  948.       # Play cancel SE
  949.       $game_system.se_play($data_system.cancel_se)
  950.       @skill_window[@actor_skillwindow.index].visible = false
  951.       @skill_window[@actor_skillwindow.index].active = false
  952.       @skill_window[@actor_skillwindow.index].index = 0
  953.       @help_window.visible = false
  954.       @skill_actor_window2[@actor_skillwindow.index].visible = false
  955.       @actor_skillwindow.visible = true
  956.       @actor_skillwindow.active = true
  957.       # If C button was pressed
  958.     elsif Input.trigger?(Input::C)
  959.       @actor = $game_party.actors[@actor_skillwindow.index]
  960.       # Get currently selected data on the skill window
  961.       @skill = @skill_window[@actor_skillwindow.index].skill
  962.       # If unable to use
  963.       if @skill == nil or not @actor.skill_can_use?(@skill.id)
  964.         # Play buzzer SE
  965.         $game_system.se_play($data_system.buzzer_se)
  966.         return
  967.       end
  968.       # Play decision SE
  969.       $game_system.se_play($data_system.decision_se)
  970.       # If effect scope is ally
  971.       if @skill.scope >= 3
  972.         # Activate target window
  973.         @skill_window[@actor_skillwindow.index].active = false
  974.         @skill_window[@actor_skillwindow.index].visible = false
  975.         @target_window.visible = true
  976.         @target_window.active = true
  977.         @target_window.y = -75
  978.         # Set cursor position to effect scope (single / all)
  979.         if @skill.scope == 4 || @skill.scope == 6
  980.           @target_window.index = -1
  981.         elsif @skill.scope == 7
  982.           @target_window.index = @actor_index - 10
  983.         else
  984.           @target_window.index = 0
  985.         end
  986.       # If effect scope is other than ally
  987.       else
  988.         # If common event ID is valid
  989.         if @skill.common_event_id > 0
  990.           # Common event call reservation
  991.           $game_temp.common_event_id = @skill.common_event_id
  992.           # Play use skill SE
  993.           $game_system.se_play(@skill.menu_se)
  994.           # Use up SP
  995.           @actor.sp -= @skill.sp_cost
  996.           # Remake each window content
  997.           @status_window.refresh
  998.           @skill_window[@actor_skillwindow.index].refresh
  999.           @target_window.refresh
  1000.           # Switch to map screen
  1001.           $scene = Scene_Map.new
  1002.           return
  1003.         end
  1004.       end
  1005.       return
  1006.     end
  1007.   end
  1008.   #--------------------------------------------------------------------------
  1009.   # * Frame Update (when target window is active)
  1010.   #--------------------------------------------------------------------------
  1011.   def update_target
  1012.     if @item_window.visible
  1013.       if @target_window.index < 0
  1014.         for i in 0...$game_party.actors.size - 1
  1015.           @target_cursor[i].visible = true
  1016.         end
  1017.       end
  1018.       # If B button was pressed
  1019.       if Input.trigger?(Input::B)
  1020.         # Play cancel SE
  1021.         $game_system.se_play($data_system.cancel_se)
  1022.         # If unable to use because items ran out
  1023.         unless $game_party.item_can_use?(@item.id)
  1024.           # Remake item window contents
  1025.           @item_window.refresh
  1026.         end
  1027.         # Erase target window
  1028.         @item_window.active = true
  1029.         @target_window.visible = false
  1030.         @target_background.visible = false
  1031.         @target_window.active = false
  1032.         return
  1033.       end
  1034.       # If C button was pressed
  1035.       if Input.trigger?(Input::C)
  1036.         # If items are used up
  1037.         if $game_party.item_number(@item.id) == 0
  1038.           # Play buzzer SE
  1039.           $game_system.se_play($data_system.buzzer_se)
  1040.           return
  1041.         end
  1042.         # If target is all
  1043.         if @target_window.index == -1
  1044.           # Apply item effects to entire party
  1045.           used = false
  1046.           for i in $game_party.actors
  1047.             used |= i.item_effect(@item)
  1048.           end
  1049.         end
  1050.         # If single target
  1051.         if @target_window.index >= 0
  1052.           # Apply item use effects to target actor
  1053.           target = $game_party.actors[@target_window.index]
  1054.           used = target.item_effect(@item)
  1055.         end
  1056.         # If an item was used
  1057.         if used
  1058.           # Play item use SE
  1059.           $game_system.se_play(@item.menu_se)
  1060.           # If consumable
  1061.           if @item.consumable
  1062.             # Decrease used items by 1
  1063.             $game_party.lose_item(@item.id, 1)
  1064.             # Redraw item window item
  1065.             @item_window.draw_item(@item_window.index)
  1066.           end
  1067.           # Remake target window contents
  1068.           @target_window.refresh
  1069.           @actor_skillwindow.refresh
  1070.           @skill_actor_window2[@actor_skillwindow.index].refresh
  1071.           # If all party members are dead
  1072.           if $game_party.all_dead?
  1073.             # Switch to game over screen
  1074.             $scene = Scene_Gameover.new
  1075.             return
  1076.           end
  1077.           # If common event ID is valid
  1078.           if @item.common_event_id > 0
  1079.             # Common event call reservation
  1080.             $game_temp.common_event_id = @item.common_event_id
  1081.             # Switch to map screen
  1082.             $scene = Scene_Map.new
  1083.             return
  1084.           end
  1085.         end
  1086.         # If item wasn't used
  1087.         unless used
  1088.           # Play buzzer SE
  1089.           $game_system.se_play($data_system.buzzer_se)
  1090.         end
  1091.         return
  1092.       end
  1093.     else
  1094.       if @target_window.index < 0
  1095.         for i in 0...$game_party.actors.size - 1
  1096.           @target_cursor_skill[i].visible = true
  1097.         end
  1098.       end
  1099.       # If B button was pressed
  1100.       if Input.trigger?(Input::B)
  1101.         # Play cancel SE
  1102.         $game_system.se_play($data_system.cancel_se)
  1103.         # Erase target window
  1104.         @skill_window[@actor_skillwindow.index].active = true
  1105.         @skill_window[@actor_skillwindow.index].visible = true
  1106.         @target_window.visible = false
  1107.         @target_background.visible = false
  1108.         @target_window.active = false
  1109.         return
  1110.       end
  1111.       # If C button was pressed
  1112.       if Input.trigger?(Input::C)
  1113.         # If unable to use because SP ran out
  1114.         unless @actor.skill_can_use?(@skill.id)
  1115.           # Play buzzer SE
  1116.           $game_system.se_play($data_system.buzzer_se)
  1117.           return
  1118.         end
  1119.         # If target is all
  1120.         if @target_window.index == -1
  1121.           # Apply skill use effects to entire party
  1122.           used = false
  1123.           for i in $game_party.actors
  1124.             used |= i.skill_effect(@actor, @skill)
  1125.           end
  1126.         end
  1127.         # If target is user
  1128.         if @target_window.index <= -2
  1129.           # Apply skill use effects to target actor
  1130.           target = $game_party.actors[@target_window.index + 10]
  1131.           used = target.skill_effect(@actor, @skill)
  1132.         end
  1133.         # If single target
  1134.         if @target_window.index >= 0
  1135.           # Apply skill use effects to target actor
  1136.           target = $game_party.actors[@target_window.index]
  1137.           used = target.skill_effect(@actor, @skill)
  1138.         end
  1139.         # If skill was used
  1140.         if used
  1141.           # Play skill use SE
  1142.           $game_system.se_play(@skill.menu_se)
  1143.           # Use up SP
  1144.           @actor.sp -= @skill.sp_cost
  1145.           # Remake each window content
  1146.           @actor_skillwindow.refresh
  1147.           @skill_window[@actor_skillwindow.index].refresh
  1148.           @skill_actor_window2[@actor_skillwindow.index].refresh
  1149.           @target_window.refresh
  1150.           # If entire party is dead
  1151.           if $game_party.all_dead?
  1152.             # Switch to game over screen
  1153.             $scene = Scene_Gameover.new
  1154.             return
  1155.          end
  1156.           # If command event ID is valid
  1157.           if @skill.common_event_id > 0
  1158.             # Command event call reservation
  1159.             $game_temp.common_event_id = @skill.common_event_id
  1160.             # Switch to map screen
  1161.             $scene = Scene_Map.new
  1162.             return
  1163.           end
  1164.         end
  1165.         # If skill wasn't used
  1166.         unless used
  1167.           # Play buzzer SE
  1168.           $game_system.se_play($data_system.buzzer_se)
  1169.         end
  1170.         return
  1171.       end
  1172.     end
  1173.   end  
  1174. end
  1175. #==============================================================================
  1176. # ** Window_IcoonCommands
  1177. #------------------------------------------------------------------------------
  1178. #  This class performs command processing.
  1179. #==============================================================================
  1180. class Window_IconCommands < Window_Selectable
  1181.   #--------------------------------------------------------------------------
  1182.   # * Object Initialization
  1183.   #--------------------------------------------------------------------------
  1184.   def initialize
  1185.     super(210, 190, 220, 64)
  1186.     self.contents = Bitmap.new(width - 32, height - 32)
  1187.     self.index = 0
  1188.     self.z = 200
  1189.     @column_max = 6
  1190.     @item_max = 6
  1191.     refresh
  1192.   end
  1193.   #--------------------------------------------------------------------------
  1194.   # * Refresh
  1195.   #--------------------------------------------------------------------------
  1196.   def refresh
  1197.     self.contents.clear
  1198.     self.contents.blt(4,5,RPG::Cache.icon(CT_Pictures::Icon_1), Rect.new(0,0,24,24))
  1199.     self.contents.blt(36,5,RPG::Cache.icon(CT_Pictures::Icon_2), Rect.new(0,0,24,24))
  1200.     self.contents.blt(68,5,RPG::Cache.icon(CT_Pictures::Icon_3), Rect.new(0,0,24,24))
  1201.     self.contents.blt(100,5,RPG::Cache.icon(CT_Pictures::Icon_4), Rect.new(0,0,24,24))
  1202.     self.contents.blt(132,5,RPG::Cache.icon(CT_Pictures::Icon_5), Rect.new(0,0,24,24))
  1203.     self.contents.blt(164,5,RPG::Cache.icon(CT_Pictures::Icon_6), Rect.new(0,0,24,24))
  1204.   end
  1205.   #--------------------------------------------------------------------------
  1206.   # * Cursor Rectangle Update
  1207.   #--------------------------------------------------------------------------
  1208.   def update_cursor_rect
  1209.     self.cursor_rect.set(@index * 32, 1, 32, 32)
  1210.   end
  1211. end
  1212. #==============================================================================
  1213. # ** Window_Actors
  1214. #------------------------------------------------------------------------------
  1215. #  This class is for choosing an actor to be equipped
  1216. #==============================================================================
  1217. class Window_Actors < Window_Selectable
  1218.   #--------------------------------------------------------------------------
  1219.   # * Object Initialization
  1220.   #--------------------------------------------------------------------------
  1221.   def initialize
  1222.     super(30, 21, 350, 450)
  1223.     self.contents = Bitmap.new(width - 32, height - 32)
  1224.     self.index = 0
  1225.     self.z += 50
  1226.     self.active = false
  1227.     self.opacity = 0
  1228.     @item_max = $game_party.actors.size
  1229.     refresh
  1230.   end
  1231.   #--------------------------------------------------------------------------
  1232.   # * Refresh
  1233.   #--------------------------------------------------------------------------
  1234.   def refresh
  1235.     self.contents.clear
  1236.     self.contents.font.size = 18
  1237.     self.contents.font.bold = true
  1238.     $game_temp.cms_index = @old_index = @index
  1239.     for i in 0...$game_party.actors.size
  1240.       actor = $game_party.actors[i]
  1241.       y  = i * 102
  1242.       pow = actor.str + actor.atk
  1243.       self.contents.draw_text(14, y, 100, 32, actor.name)
  1244.       self.contents.draw_text(154, y, 100, 32, "LV #{actor.level}")
  1245.       self.contents.draw_text(60, y + 65, 100, 32, "#{pow}")
  1246.       self.contents.draw_text(210, y + 65, 100, 32, "#{actor.pdef}")
  1247.       draw_actor_hp(actor, 14, y + 20)
  1248.       draw_actor_sp(actor, 14, y + 40)
  1249.       self.contents.blt(14, y + 70, RPG::Cache.icon($data_weapons[actor.weapon_id] == nil ? CT_Pictures::Weapon_alternative : $data_weapons[actor.weapon_id].icon_name), Rect.new(0,0,24,24))
  1250.       self.contents.blt(174, y + 70, RPG::Cache.icon($data_armors[actor.armor1_id] == nil ? CT_Pictures::Shield_alternative : $data_armors[actor.armor1_id].icon_name), Rect.new(0,0,24,24))
  1251.     end
  1252.   end
  1253.   #--------------------------------------------------------------------------
  1254.   # * Cursor Rectangle Update
  1255.   #--------------------------------------------------------------------------
  1256.   def update_cursor_rect
  1257.     self.cursor_rect.set(0, @index * 102, 0, 0)
  1258.   end
  1259.   #--------------------------------------------------------------------------
  1260.   # * Update
  1261.   #--------------------------------------------------------------------------
  1262.   def update
  1263.     super
  1264.     if @old_index != @index
  1265.       refresh
  1266.       @old_index = @index
  1267.     end
  1268.   end    
  1269. end
  1270. #==============================================================================
  1271. # ** Window_NewEquip
  1272. #------------------------------------------------------------------------------
  1273. #  This window displays items the actor is currently equipped with on the
  1274. #  equipment screen, stats etc.
  1275. #==============================================================================
  1276. class Window_NewEquip < Window_Selectable
  1277.   #--------------------------------------------------------------------------
  1278.   # * Object Initialization
  1279.   #--------------------------------------------------------------------------
  1280.   def initialize
  1281.     super(300, 20, 350, 450)
  1282.     self.contents = Bitmap.new(width - 32, height - 32)
  1283.     self.index = 0
  1284.     self.active = false
  1285.     self.opacity = 0
  1286.     @item_max = 5
  1287.     @old_index = $game_temp.cms_index
  1288.     refresh
  1289.   end
  1290.   #--------------------------------------------------------------------------
  1291.   # * Item Acquisition
  1292.   #--------------------------------------------------------------------------
  1293.   def item
  1294.     return @data[self.index]
  1295.   end
  1296.   #--------------------------------------------------------------------------
  1297.   # * Refresh
  1298.   #--------------------------------------------------------------------------
  1299.   def refresh
  1300.     self.contents.clear
  1301.     self.contents.font.size = 18
  1302.     self.contents.font.bold = true
  1303.     @actor = $game_party.actors[$game_temp.cms_index]
  1304.     self.contents.draw_text(164, 10, 100, 32, @actor.name)
  1305.     draw_actor_state(@actor, 164, 42)
  1306.     self.contents.draw_text(164, 74, 100, 32, "LV #{@actor.level}")
  1307.     self.contents.blt(20,20,RPG::Cache.picture("Faces/" + @actor.character_name), Rect.new(0,0,100,100))
  1308.     @data = []
  1309.     @data.push($data_weapons[@actor.weapon_id])
  1310.     @data.push($data_armors[@actor.armor1_id])
  1311.     @data.push($data_armors[@actor.armor2_id])
  1312.     @data.push($data_armors[@actor.armor3_id])
  1313.     @data.push($data_armors[@actor.armor4_id])
  1314.     @item_max = @data.size
  1315.     self.contents.font.color = system_color
  1316.     y = 115
  1317.     self.contents.draw_text(14, 25 * 0 + y, 92, 32, $data_system.words.weapon)
  1318.     self.contents.draw_text(14, 25 * 1 + y, 92, 32, $data_system.words.armor1)
  1319.     self.contents.draw_text(14, 25 * 2 + y, 92, 32, $data_system.words.armor2)
  1320.     self.contents.draw_text(14, 25 * 3 + y, 92, 32, $data_system.words.armor3)
  1321.     self.contents.draw_text(15, 25 * 4 + y, 92, 32, $data_system.words.armor4)
  1322.     draw_item_name(@data[0], 110, 25 * 0 + y)
  1323.     draw_item_name(@data[1], 110, 25 * 1 + y)
  1324.     draw_item_name(@data[2], 110, 25 * 2 + y)
  1325.     draw_item_name(@data[3], 110, 25 * 3 + y)
  1326.     draw_item_name(@data[4], 110, 25 * 4 + y)
  1327.     self.contents.font.color = normal_color
  1328.     self.contents.draw_text(14, 250, 500, 32, $data_system.words.str)
  1329.     self.contents.draw_text(14, 270, 500, 32, $data_system.words.atk)
  1330.     self.contents.draw_text(14, 290, 500, 32, $data_system.words.int)
  1331.     self.contents.draw_text(14, 310, 500, 32, $data_system.words.dex)
  1332.     self.contents.draw_text(144, 250, 500, 32, $data_system.words.agi)
  1333.     self.contents.draw_text(144, 270, 500, 32, $data_system.words.pdef)
  1334.     self.contents.draw_text(144, 290, 500, 32, $data_system.words.mdef)
  1335.     up_color = Color.new(60, 255, 255)
  1336.     str = @actor.str.to_s
  1337.     if @new_str != nil
  1338.       str = @new_str.to_s
  1339.       @actor.str == @new_str ? self.contents.font.color = normal_color : @actor.str < @new_str ?
  1340.       self.contents.font.color = up_color : self.contents.font.color = disabled_color
  1341.     end
  1342.     self.contents.draw_text(25, 250, 100, 32, str, 2)
  1343.     atk = @actor.atk.to_s
  1344.     if @new_atk != nil
  1345.       atk = @new_atk.to_s
  1346.       @actor.atk == @new_atk ? self.contents.font.color = normal_color : @actor.atk < @new_atk ?
  1347.       self.contents.font.color = up_color : self.contents.font.color = disabled_color
  1348.     end
  1349.     self.contents.draw_text(25, 270, 100, 32, atk, 2)
  1350.     int = @actor.int.to_s
  1351.     if @new_int != nil
  1352.       int = @new_int.to_s
  1353.       @actor.int == @new_int ? self.contents.font.color = normal_color : @actor.int < @new_int ?
  1354.       self.contents.font.color = up_color : self.contents.font.color = disabled_color
  1355.     end
  1356.     self.contents.draw_text(25, 290, 100, 32, int, 2)
  1357.     agi = @actor.agi.to_s
  1358.     if @new_agi != nil
  1359.       agi = @new_agi.to_s
  1360.       @actor.agi == @new_agi ? self.contents.font.color = normal_color : @actor.agi < @new_agi ?
  1361.       self.contents.font.color = up_color : self.contents.font.color = disabled_color
  1362.     end
  1363.     self.contents.draw_text(160, 250, 100, 32, agi, 2)
  1364.     pdef = @actor.pdef.to_s
  1365.     if @new_pdef != nil
  1366.       pdef = @new_pdef.to_s
  1367.       @actor.pdef == @new_pdef ? self.contents.font.color = normal_color : @actor.pdef < @new_pdef ?
  1368.       self.contents.font.color = up_color : self.contents.font.color = disabled_color
  1369.     end
  1370.     self.contents.draw_text(160, 270, 100, 32, pdef, 2)
  1371.     mdef = @actor.mdef.to_s
  1372.     if @new_mdef != nil
  1373.       mdef = @new_mdef.to_s
  1374.       @actor.mdef == @new_mdef ? self.contents.font.color = normal_color : @actor.mdef < @new_mdef ?
  1375.       self.contents.font.color = up_color : self.contents.font.color = disabled_color
  1376.     end
  1377.     self.contents.draw_text(160, 290, 100, 32, mdef, 2)
  1378.     dex = @actor.dex.to_s
  1379.     if @new_mdef != nil
  1380.       dex = @new_dex.to_s
  1381.       @actor.dex == @new_dex ? self.contents.font.color = normal_color : @actor.dex < @new_dex ?
  1382.       self.contents.font.color = up_color : self.contents.font.color = disabled_color
  1383.     end
  1384.     self.contents.draw_text(160, 310, 100, 32, dex, 2)
  1385.     self.contents.font.color = normal_color
  1386.     self.contents.draw_text(14, 353, 500, 32, "EXP")
  1387.     self.contents.draw_text(14, 370, 500, 32, "NEXT")
  1388.     self.contents.draw_text(14, 353, 240, 32, "#{@actor.exp}",2)
  1389.     self.contents.draw_text(14, 370, 240, 32, "#{@actor.next_exp}",2)
  1390.   end
  1391.   #--------------------------------------------------------------------------
  1392.   # * Set parameters after changing equipment
  1393.   #--------------------------------------------------------------------------
  1394.   def set_new_parameters(new_str, new_atk, new_int, new_agi, new_pdef, new_mdef, new_dex)
  1395.     if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or
  1396.       @new_str != new_str or @new_int != new_int or @new_agi != new_agi or @new_dex != new_dex
  1397.       @new_str = new_str
  1398.       @new_atk = new_atk
  1399.       @new_int = new_int
  1400.       @new_agi = new_agi
  1401.       @new_pdef = new_pdef
  1402.       @new_mdef = new_mdef
  1403.       @new_dex = new_dex
  1404.       refresh
  1405.     end
  1406.   end
  1407.   #--------------------------------------------------------------------------
  1408.   # * Cursor Rectangle Update
  1409.   #--------------------------------------------------------------------------
  1410.   def update_cursor_rect
  1411.     self.cursor_rect.set(14, @index * 25 + 115, 0, 0)
  1412.   end
  1413.   #--------------------------------------------------------------------------
  1414.   # * Update
  1415.   #--------------------------------------------------------------------------
  1416.   def update
  1417.     super
  1418.     if @old_index != $game_temp.cms_index
  1419.       refresh
  1420.       @old_index = $game_temp.cms_index
  1421.     end
  1422.   end
  1423. end
  1424. #==============================================================================
  1425. # ** Window_Item
  1426. #------------------------------------------------------------------------------
  1427. #  This window displays items in possession on the item and battle screens.
  1428. #==============================================================================
  1429. class Window_Item < Window_Selectable
  1430.   #--------------------------------------------------------------------------
  1431.   # * Draw Item
  1432.   #     index : item number
  1433.   #--------------------------------------------------------------------------
  1434.   def initialize
  1435.     super(48, 125, 500, 320)
  1436.     self.index = 0
  1437.     self.z = 150
  1438.     # If in battle, move window to center of screen
  1439.     # and make it semi-transparent
  1440.     if $game_temp.in_battle
  1441.       @column_max = 2
  1442.       self.y = 64
  1443.       self.x = 0
  1444.       self.y = 64
  1445.       self.width = 640
  1446.       self.height = 256
  1447.       self.back_opacity = 160
  1448.     end
  1449.     refresh
  1450.   end
  1451.   #--------------------------------------------------------------------------
  1452.   # * Draw Item
  1453.   #     index : item number
  1454.   #--------------------------------------------------------------------------
  1455.   def draw_item(index)
  1456.     item = @data[index]
  1457.     case item
  1458.     when RPG::Item
  1459.       number = $game_party.item_number(item.id)
  1460.     when RPG::Weapon
  1461.       number = $game_party.weapon_number(item.id)
  1462.     when RPG::Armor
  1463.       number = $game_party.armor_number(item.id)
  1464.     end
  1465.     if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id)
  1466.       self.contents.font.color = normal_color
  1467.     else
  1468.       self.contents.font.color = disabled_color
  1469.     end
  1470.     if $game_temp.in_battle
  1471.       x = 4 + index % 2 * (288 + 32)
  1472.       y = index / 2 * 32
  1473.     else
  1474.       self.contents.font.size = 18
  1475.       self.contents.font.bold = true
  1476.       x = 4
  1477.       y = index * 32
  1478.     end
  1479.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  1480.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  1481.     bitmap = RPG::Cache.icon(item.icon_name)
  1482.     opacity = self.contents.font.color == normal_color ? 255 : 128
  1483.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  1484.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  1485.     if $game_temp.in_battle
  1486.       self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  1487.       self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  1488.     else
  1489.       self.contents.draw_text(x + 300, y, 16, 32, ":", 1)
  1490.       self.contents.draw_text(x + 316, y, 24, 32, number.to_s, 2)
  1491.     end
  1492.   end
  1493. end
  1494. #==============================================================================
  1495. # ** Window_Help
  1496. #------------------------------------------------------------------------------
  1497. #  This window shows skill and item explanations along with actor status.
  1498. #==============================================================================
  1499. class Window_Help < Window_Base
  1500.   #--------------------------------------------------------------------------
  1501.   # * Set Text
  1502.   #  text  : text string displayed in window
  1503.   #  align : alignment (0..flush left, 1..center, 2..flush right)
  1504.   #--------------------------------------------------------------------------
  1505.   def set_text(text, align = 0)
  1506.     # If at least one part of text and alignment differ from last time
  1507.     if text != @text or align != @align
  1508.       # Redraw text
  1509.       self.contents.clear
  1510.       unless $game_temp.in_battle
  1511.         self.contents.font.size = 18
  1512.         self.contents.font.bold = true
  1513.       end
  1514.       self.contents.font.color = normal_color
  1515.       self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
  1516.       @text = text
  1517.       @align = align
  1518.       @actor = nil
  1519.     end
  1520.     self.visible = true
  1521.   end
  1522. end
  1523. #==============================================================================
  1524. # ** Window_Target
  1525. #------------------------------------------------------------------------------
  1526. #  This window selects a use target for the actor on item and skill screens.
  1527. #==============================================================================
  1528. class Window_Target < Window_Selectable
  1529.   #--------------------------------------------------------------------------
  1530.   # * Object Initialization
  1531.   #--------------------------------------------------------------------------
  1532.   def initialize
  1533.     super(305, 0, 336, 480)
  1534.     self.contents = Bitmap.new(width - 32, height - 32)
  1535.     self.z += 999
  1536.     self.opacity = 0
  1537.     @item_max = $game_party.actors.size
  1538.     refresh
  1539.   end
  1540.   #--------------------------------------------------------------------------
  1541.   # * Refresh
  1542.   #--------------------------------------------------------------------------
  1543.   def refresh
  1544.     self.contents.clear
  1545.     self.contents.font.size = 18
  1546.     self.contents.font.bold = true
  1547.     for i in 0...$game_party.actors.size
  1548.       x = 4
  1549.       y = i * 79 + 100
  1550.       actor = $game_party.actors[i]
  1551.       pow = actor.str + actor.atk
  1552.       draw_actor_graphic(actor, 235, y + 85)
  1553.       self.contents.font.size = 17
  1554.       self.contents.draw_text(14, y, 100, 32, actor.name)
  1555.       self.contents.draw_text(154, y, 100, 32, "LV #{actor.level}")
  1556.       self.contents.draw_text(50, y + 55, 100, 32, "#{pow}")
  1557.       self.contents.draw_text(190, y + 55, 100, 32, "#{actor.pdef}")
  1558.       draw_actor_hp(actor, 14, y + 15)
  1559.       draw_actor_sp(actor, 14, y + 30)
  1560.       self.contents.blt(14, y + 60, RPG::Cache.icon($data_weapons[actor.weapon_id] == nil ? CT_Pictures::Weapon_alternative : $data_weapons[actor.weapon_id].icon_name), Rect.new(0,0,24,24))
  1561.       self.contents.blt(154, y + 60, RPG::Cache.icon($data_armors[actor.armor1_id] == nil ? CT_Pictures::Shield_alternative : $data_armors[actor.armor1_id].icon_name), Rect.new(0,0,24,24))
  1562.     end
  1563.   end
  1564.   #--------------------------------------------------------------------------
  1565.   # * Cursor Rectangle Update
  1566.   #--------------------------------------------------------------------------
  1567.   def update_cursor_rect
  1568.     # Cursor position -1 = all choices, -2 or lower = independent choice
  1569.     # (meaning the user's own choice)
  1570.     if @index >= 0
  1571.       self.cursor_rect.set(10, @index * 82 + 100, 0, 0)
  1572.     else
  1573.       self.cursor_rect.set(10, 100, 0, 0)
  1574.     end
  1575.   end
  1576. end
  1577. #==============================================================================
  1578. # ** Window_Skill
  1579. #------------------------------------------------------------------------------
  1580. #  This window displays usable skills on the skill and battle screens.
  1581. #==============================================================================
  1582. class Window_Skill < Window_Selectable
  1583.   #--------------------------------------------------------------------------
  1584.   # * Object Initialization
  1585.   #     actor : actor
  1586.   #--------------------------------------------------------------------------
  1587.   def initialize(actor)
  1588.     super(310, 32, 300, 352)
  1589.     self.contents = Bitmap.new (width - 32, height - 32)
  1590.     self.index = 0
  1591.     self.opacity = 0
  1592.     @actor = actor
  1593.     # If in battle, move window to center of screen
  1594.     # and make it semi-transparent
  1595.     if $game_temp.in_battle
  1596.       @column_max = 2
  1597.       self.opacity = 255
  1598.       self.x = 0
  1599.       self.y = 64
  1600.       self.height = 256
  1601.       self.width = 640
  1602.       self.back_opacity = 160
  1603.     end
  1604.     refresh
  1605.   end
  1606.   #--------------------------------------------------------------------------
  1607.   # * Draw Item
  1608.   #     index : item number
  1609.   #--------------------------------------------------------------------------
  1610.   def draw_item(index)
  1611.     skill = @data[index]
  1612.     if @actor.skill_can_use?(skill.id)
  1613.       self.contents.font.color = normal_color
  1614.     else
  1615.       self.contents.font.color = disabled_color
  1616.     end
  1617.     if $game_temp.in_battle
  1618.       x = 4 + index % 2 * (288 + 32)
  1619.       y = index / 2 * 32
  1620.     else
  1621.       self.contents.font.size = 18
  1622.       self.contents.font.bold = true
  1623.       x = 4
  1624.       y = index * 32
  1625.     end
  1626.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  1627.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  1628.     bitmap = RPG::Cache.icon(skill.icon_name)
  1629.     opacity = self.contents.font.color == normal_color ? 255 : 128
  1630.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  1631.     self.contents.draw_text(x + 28, y, 150, 32, skill.name, 0)
  1632.     if $game_temp.in_battle
  1633.       self.contents.draw_text(x + 200, y, 48, 32, skill.sp_cost.to_s, 2)
  1634.     end
  1635.   end
  1636. end
  1637. #==============================================================================
  1638. # ** Window_SkillActor
  1639. #------------------------------------------------------------------------------
  1640. #  This window displays selectable characters for the skill window
  1641. #==============================================================================
  1642. class Window_SkillActor < Window_Selectable
  1643.   #--------------------------------------------------------------------------
  1644.   # * Object Initialization
  1645.   #--------------------------------------------------------------------------
  1646.   def initialize
  1647.     super(32,20,320,350)
  1648.     self.contents = Bitmap.new(width - 32, height - 32)
  1649.     self.opacity = 0
  1650.     self.index = 0
  1651.     @column_max = 1
  1652.     @item_max = $game_party.actors.size
  1653.     refresh
  1654.   end
  1655.   #--------------------------------------------------------------------------
  1656.   # * Refresh
  1657.   #--------------------------------------------------------------------------
  1658.   def refresh
  1659.     self.contents.clear
  1660.     self.contents.font.size = 18
  1661.     self.contents.font.bold = true
  1662.     for i in 0...$game_party.actors.size
  1663.       actor = $game_party.actors[i]
  1664.       x = 60
  1665.       y = i * 80
  1666.       draw_actor_graphic(actor, 30, y + 65)
  1667.       self.contents.draw_text(x, y, 150, 32, "#{actor.name}")
  1668.       self.contents.draw_text(x + 80, y, 150, 32, "LV #{actor.level}")
  1669.       draw_actor_hp(actor, x, y + 15)
  1670.       draw_actor_sp(actor, x, y + 30)
  1671.       draw_actor_state(actor, x, y + 45)
  1672.     end
  1673.   end
  1674.   #--------------------------------------------------------------------------
  1675.   # * Cursor Rectangle Update
  1676.   #-------------------------------------------------------------------------
  1677.   def update_cursor_rect
  1678.     self.cursor_rect.set(10, @index * 80 + 10, 0, 0)
  1679.   end
  1680. end
  1681. #==============================================================================
  1682. # ** Window_SkillActor2
  1683. #------------------------------------------------------------------------------
  1684. #  This window displays selected character for the skill window
  1685. #==============================================================================
  1686. class Window_SkillActor2 < Window_Base
  1687.   #--------------------------------------------------------------------------
  1688.   # * Object Initialization
  1689.   #   actor : actor
  1690.   #--------------------------------------------------------------------------
  1691.   def initialize(actor)
  1692.     super(32,20,320,350)
  1693.     self.contents = Bitmap.new(width - 32, height - 32)
  1694.     self.opacity = 0
  1695.     @old_index = $game_temp.skill_index
  1696.     @actor = actor
  1697.     refresh
  1698.   end
  1699.   #--------------------------------------------------------------------------
  1700.   # * Refresh
  1701.   #--------------------------------------------------------------------------
  1702.   def refresh
  1703.     self.contents.clear
  1704.     self.contents.font.color = normal_color
  1705.     self.contents.font.size = 18
  1706.     self.contents.font.bold = true
  1707.     x = 60
  1708.     y = 0
  1709.     draw_actor_graphic(@actor, 30, y + 65)
  1710.     self.contents.draw_text(x, y, 150, 32, "#{@actor.name}")
  1711.     self.contents.draw_text(x + 80, y, 150, 32, "LV #{@actor.level}")
  1712.     draw_actor_hp(@actor, x, y + 15)
  1713.     draw_actor_sp(@actor, x, y + 30)
  1714.     draw_actor_state(@actor, x, y + 45)
  1715.     self.contents.draw_text(x + 70, y + 45, 150, 32,$data_system.words.sp + " uses ")
  1716.     unless @actor.skills[$game_temp.skill_index] == nil
  1717.       if @actor.sp < $data_skills[@actor.skills[$game_temp.skill_index]].sp_cost
  1718.         self.contents.font.color = knockout_color
  1719.       else
  1720.         self.contents.font.color = normal_color
  1721.       end
  1722.     end
  1723.     @sp_uses = @actor.skills[$game_temp.skill_index] == nil ? "" : $data_skills[@actor.skills[$game_temp.skill_index]].sp_cost.to_s
  1724.     self.contents.draw_text(x + 135, y + 45, 150, 32, @sp_uses)
  1725.   end
  1726.   #--------------------------------------------------------------------------
  1727.   # * Update
  1728.   #--------------------------------------------------------------------------
  1729.   def update
  1730.     super
  1731.     if $game_temp.skill_index != @old_index
  1732.       refresh
  1733.       @old_index = $game_temp.skill_index
  1734.     end
  1735.   end
  1736. end
  1737. #==============================================================================
  1738. # ** Window_SaveFile
  1739. #------------------------------------------------------------------------------
  1740. #  This window displays save files on the save and load screens.
  1741. #==============================================================================
  1742. class Window_SaveFile < Window_Base
  1743.   #--------------------------------------------------------------------------
  1744.   # * Object Initialization
  1745.   #     file_index : save file index (0-2)
  1746.   #     filename   : file name
  1747.   #--------------------------------------------------------------------------
  1748.   def initialize(file_index, filename)
  1749.     super(42, 35 + file_index % 4 * 70, 640, 90)
  1750.     self.contents = Bitmap.new(width - 32, height - 32)
  1751.     self.opacity = 0
  1752.     @file_index = file_index
  1753.     @filename = "Save#{@file_index + 1}.rxdata"
  1754.     @time_stamp = Time.at(0)
  1755.     @file_exist = FileTest.exist?(@filename)
  1756.     if @file_exist
  1757.       file = File.open(@filename, "r")
  1758.       @time_stamp = file.mtime
  1759.       @characters = Marshal.load(file)
  1760.       @frame_count = Marshal.load(file)
  1761.       @game_system = Marshal.load(file)
  1762.       @game_switches = Marshal.load(file)
  1763.       @game_variables = Marshal.load(file)
  1764.       @total_sec = @frame_count / Graphics.frame_rate
  1765.       file.close
  1766.     end
  1767.     refresh
  1768.     @selected = false
  1769.   end
  1770.   #--------------------------------------------------------------------------
  1771.   # * Refresh
  1772.   #--------------------------------------------------------------------------
  1773.   def refresh
  1774.     self.contents.clear
  1775.     self.contents.font.size = 18
  1776.     self.contents.font.bold = true
  1777.     # Draw file number
  1778.     self.contents.font.color = normal_color
  1779.     name = "File#{@file_index + 1}"
  1780.     self.contents.draw_text(4, 0, 600, 32, name)
  1781.     @name_width = contents.text_size(name).width
  1782.     # If save file exists
  1783.     if @file_exist
  1784.       self.contents.draw_text(0, 0, 600, 32, @game_system.chapter.to_s,1)
  1785.     end
  1786.   end
  1787. end
  1788. #==============================================================================
  1789. # ** Window_SaveStatus
  1790. #------------------------------------------------------------------------------
  1791. #  This window displays stats on the save files.
  1792. #==============================================================================
  1793. class Window_SaveStatus < Window_Base
  1794.   #--------------------------------------------------------------------------
  1795.   # * Object Initialization
  1796.   #--------------------------------------------------------------------------
  1797.   def initialize
  1798.     super(0,0,640,480)
  1799.     self.contents = Bitmap.new(width - 32, height - 32)
  1800.     self.opacity = 0
  1801.     @index = $game_temp.save_index
  1802.     refresh
  1803.   end
  1804.   #--------------------------------------------------------------------------
  1805.   # * Refresh
  1806.   #--------------------------------------------------------------------------
  1807.   def refresh
  1808.     self.contents.clear
  1809.     filename = "Save#{$game_temp.save_index + 1}.rxdata"
  1810.     return unless FileTest.exist?(filename)
  1811.     file = File.open(filename, "r")
  1812.     @characters = Marshal.load(file)
  1813.     @frame_count = Marshal.load(file)
  1814.     @game_system = Marshal.load(file)
  1815.     @game_switches = Marshal.load(file)
  1816.     @game_variables = Marshal.load(file)
  1817.     Marshal.load(file)
  1818.     Marshal.load(file)
  1819.     Marshal.load(file)
  1820.     party = Marshal.load(file)
  1821.     Marshal.load(file)
  1822.     map = Marshal.load(file)
  1823.     self.contents.font.size = 20
  1824.     self.contents.font.bold = true
  1825.     for i in 0...party.actors.size
  1826.       actor = party.actors[i]
  1827.       x = 284
  1828.       y = i * 36 + 265
  1829.       draw_actor_name(actor, x + 40, y - 2)
  1830.       draw_actor_level(actor, x + 170, y - 2)
  1831.       self.contents.blt(x + 5, y + 10, RPG::Cache.icon(actor.character_name), Rect.new(0,0,24,24))
  1832.       self.contents.draw_text(x + 40, y + 16, 150, 32, "#{$data_system.words.hp} #{actor.hp} / #{actor.maxhp}")
  1833.       self.contents.draw_text(x + 170, y + 16, 150, 32, "#{$data_system.words.sp} #{actor.sp} / #{actor.maxsp}")
  1834.     end
  1835.     total_sec = @frame_count / Graphics.frame_rate
  1836.     hour = total_sec / 60 / 60
  1837.     min = total_sec / 60 % 60
  1838.     sec = total_sec % 60
  1839.     text = sprintf("%02d:%02d:%02d", hour, min, sec)
  1840.     map_name = load_data("Data/MapInfos.rxdata")[map.map_id].name
  1841.     self.contents.font.size = 20
  1842.     self.contents.draw_text(45, 272, 144, 32, map_name)
  1843.     self.contents.draw_text(45, 304, 144, 32, "TIME:")
  1844.     self.contents.draw_text(100, 304, 144, 32, text,2)
  1845.     self.contents.draw_text(45, 336, 144, 32, $data_system.words.gold + ":")
  1846.     self.contents.draw_text(100, 336, 144, 32, party.gold.to_s,2)
  1847.     self.contents.draw_text(45, 368, 144, 32, "Save #:")
  1848.     self.contents.draw_text(100, 368, 144, 32, @game_system.save_count.to_s, 2)
  1849.   end
  1850.   #--------------------------------------------------------------------------
  1851.   # * Update
  1852.   #--------------------------------------------------------------------------
  1853.   def update
  1854.     super
  1855.     if @index != $game_temp.save_index
  1856.       refresh
  1857.     @index = $game_temp.save_index
  1858.     end
  1859.   end
  1860. end
  1861. #==============================================================================
  1862. # ** Window_PartyChange
  1863. #------------------------------------------------------------------------------
  1864. #  This window displays changable characters.
  1865. #==============================================================================
  1866. class Window_PartyChange < Window_Selectable
  1867.   #--------------------------------------------------------------------------
  1868.   # * Object Initialization
  1869.   #--------------------------------------------------------------------------
  1870.   def initialize
  1871.     super(0,0,640,480)
  1872.     self.index = 0
  1873.     self.opacity = 0
  1874.     @item_max = $game_party.actors.size
  1875.     self.contents = Bitmap.new(width - 32, height - 32)
  1876.     refresh
  1877.   end
  1878.   #--------------------------------------------------------------------------
  1879.   # * Refresh
  1880.   #--------------------------------------------------------------------------
  1881.   def refresh
  1882.     self.contents.clear
  1883.     self.contents.font.size = 18
  1884.     self.contents.font.bold = true
  1885.     for i in 0...$game_party.actors.size
  1886.       actor = $game_party.actors[i]
  1887.       x = 140
  1888.       y = i * 110
  1889.       draw_actor_graphic(actor, x + 260, y + 80)
  1890.       draw_actor_name(actor,x + 80, y)
  1891.       draw_actor_level(actor, x + 160, y)
  1892.       draw_actor_hp(actor, x + 80, y + 20)
  1893.       draw_actor_sp(actor, x + 80, y + 40)
  1894.       self.contents.draw_text(x + 104, y + 72, 150, 32, (actor.str + actor.atk).to_s)
  1895.       self.contents.draw_text(x + 204, y + 72, 150, 32, actor.pdef.to_s)
  1896.       self.contents.blt(x + 80, y + 72, RPG::Cache.icon($data_weapons[actor.weapon_id] == nil ? CT_Pictures::Weapon_alternative : $data_weapons[actor.weapon_id].icon_name), Rect.new(0,0,24,24))
  1897.       self.contents.blt(x + 180, y + 72, RPG::Cache.icon($data_armors[actor.armor1_id] == nil ? CT_Pictures::Shield_alternative : $data_armors[actor.armor1_id].icon_name), Rect.new(0,0,24,24))
  1898.     end
  1899.   end
  1900.   #--------------------------------------------------------------------------
  1901.   # * Cursor Rectangle Update
  1902.   #-------------------------------------------------------------------------
  1903.   def update_cursor_rect
  1904.     self.cursor_rect.set(190, @index * 110, 0, 0)
  1905.   end
  1906. end
  1907. #==============================================================================
  1908. # ** Window_EquipItem
  1909. #------------------------------------------------------------------------------
  1910. #  This window displays choices when opting to change equipment on the
  1911. #  equipment screen.
  1912. #==============================================================================
  1913. class Window_EquipItem2 < Window_Selectable
  1914.   #--------------------------------------------------------------------------
  1915.   # * Object Initialization
  1916.   #     equip_type : equip region (0-3)
  1917.   #--------------------------------------------------------------------------
  1918.   def initialize(equip_type)
  1919.     super(50, 210, 275, 240)
  1920.     self.contents = Bitmap.new(width - 32, height - 32)
  1921.     @actor = $game_party.actors[$game_temp.cms_index]
  1922.     @equip_type = equip_type
  1923.     @old_actor = $game_temp.cms_index
  1924.     self.active = false
  1925.     @old_index = @index
  1926.     self.z = 1000
  1927.     self.opacity = 0
  1928.     self.index = 0
  1929.     refresh
  1930.   end
  1931.   #--------------------------------------------------------------------------
  1932.   # * Item Acquisition
  1933.   #--------------------------------------------------------------------------
  1934.   def item
  1935.     return @data[self.index]
  1936.   end
  1937.   #--------------------------------------------------------------------------
  1938.   # * Refresh
  1939.   #--------------------------------------------------------------------------
  1940.   def refresh
  1941.     if self.contents != nil
  1942.       self.contents.dispose
  1943.       self.contents = nil
  1944.     end
  1945.     @data = []
  1946.     # Add equippable weapons
  1947.     if @equip_type == 0
  1948.       weapon_set = $data_classes[@actor.class_id].weapon_set
  1949.       for i in 1...$data_weapons.size
  1950.         if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
  1951.           @data.push($data_weapons[i])
  1952.         end
  1953.       end
  1954.     end
  1955.     # Add equippable armor
  1956.     if @equip_type != 0
  1957.       armor_set = $data_classes[@actor.class_id].armor_set
  1958.       for i in 1...$data_armors.size
  1959.         if $game_party.armor_number(i) > 0 and armor_set.include?(i)
  1960.           if $data_armors[i].kind == @equip_type-1
  1961.             @data.push($data_armors[i])
  1962.           end
  1963.         end
  1964.       end
  1965.     end
  1966.     # Add blank page
  1967.     @data.push(nil)
  1968.     # Make a bit map and draw all items
  1969.     @item_max = @data.size
  1970.     self.contents = Bitmap.new(width - 32, row_max * 32)
  1971.     for i in 0...@item_max-1
  1972.       draw_item(i)
  1973.     end
  1974.   end
  1975.   #--------------------------------------------------------------------------
  1976.   # * Draw Item
  1977.   #     index : item number
  1978.   #--------------------------------------------------------------------------
  1979.   def draw_item(index)
  1980.     item = @data[index]
  1981.     x = 4
  1982.     y = index * 32
  1983.     case item
  1984.     when RPG::Weapon
  1985.       number = $game_party.weapon_number(item.id)
  1986.     when RPG::Armor
  1987.       number = $game_party.armor_number(item.id)
  1988.     end
  1989.     bitmap = RPG::Cache.icon(item.icon_name)
  1990.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  1991.     self.contents.font.color = normal_color
  1992.     self.contents.font.size = 18
  1993.     self.contents.font.bold = true
  1994.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  1995.     self.contents.draw_text(x + 185, y, 16, 32, ":", 1)
  1996.     self.contents.draw_text(x + 201, y, 24, 32, number.to_s, 2)
  1997.   end
  1998.   #--------------------------------------------------------------------------
  1999.   # * Update
  2000.   #-------------------------------------------------------------------------
  2001.   def update
  2002.     super
  2003.     if $game_temp.cms_index != @old_actor
  2004.       @actor = $game_party.actors[$game_temp.cms_index]
  2005.       refresh
  2006.       @old_actor = $game_temp.cms_index
  2007.     end
  2008.   end
  2009. end
  2010. #==============================================================================
  2011. # ** Window_EquipDescription
  2012. #------------------------------------------------------------------------------
  2013. #  This window displays the kind of equipment
  2014. #==============================================================================
  2015. class Window_EquipDescription < Window_Base
  2016.   #--------------------------------------------------------------------------
  2017.   # * Object Initialization
  2018.   #--------------------------------------------------------------------------
  2019.   def initialize
  2020.     super(30, 21, 320, 480)
  2021.     self.contents = Bitmap.new(width - 32, height - 32)
  2022.     self.opacity = 0
  2023.     self.z = 1000
  2024.     @cms_index = $game_temp.cms_index
  2025.     @equip_index = $game_temp.equip_index
  2026.     refresh
  2027.   end
  2028.   #--------------------------------------------------------------------------
  2029.   # * Refresh
  2030.   #--------------------------------------------------------------------------
  2031.   def refresh
  2032.     self.contents.clear
  2033.     self.contents.font.size = 18
  2034.     self.contents.font.bold = true
  2035.     actor = $game_party.actors[$game_temp.cms_index]
  2036.     y  = 0
  2037.     pow = actor.str + actor.atk
  2038.     self.contents.draw_text(14, y, 100, 32, actor.name)
  2039.     self.contents.draw_text(154, y, 100, 32, "LV #{actor.level}")
  2040.     self.contents.draw_text(60, y + 65, 100, 32, "#{pow}")
  2041.     self.contents.draw_text(210, y + 65, 100, 32, "#{actor.pdef}")
  2042.     draw_actor_hp(actor, 14, y + 20)
  2043.     draw_actor_sp(actor, 14, y + 40)
  2044.     self.contents.blt(14, y + 70, RPG::Cache.icon($data_weapons[actor.weapon_id] == nil ? CT_Pictures::Weapon_alternative : $data_weapons[actor.weapon_id].icon_name), Rect.new(0,0,24,24))
  2045.     self.contents.blt(174, y + 70, RPG::Cache.icon($data_armors[actor.armor1_id] == nil ? CT_Pictures::Shield_alternative : $data_armors[actor.armor1_id].icon_name), Rect.new(0,0,24,24))
  2046.     if $game_temp.equip_index == 0
  2047.       text = $data_system.words.weapon
  2048.     else
  2049.       text = eval("$data_system.words.armor#{$game_temp.equip_index}")
  2050.     end
  2051.     self.contents.draw_text(14,122,250,32, "#{text}", 1)
  2052.   end
  2053.   #--------------------------------------------------------------------------
  2054.   # * Update
  2055.   #--------------------------------------------------------------------------
  2056.   def update
  2057.     super
  2058.     if @cms_index != $game_temp.cms_index or @equip_index != $game_temp.equip_index
  2059.       refresh
  2060.       @cms_index = $game_temp.cms_index
  2061.       @equip_index = $game_temp.equip_index
  2062.     end
  2063.   end
  2064. end
  2065. #==============================================================================
  2066. # ** Window_PlayTime
  2067. #------------------------------------------------------------------------------
  2068. #  This window displays play time on the menu screen.
  2069. #==============================================================================
  2070. class Window_PlayTime < Window_Base
  2071.   #--------------------------------------------------------------------------
  2072.   # * Object Initialization
  2073.   #--------------------------------------------------------------------------
  2074.   def initialize
  2075.     super(0, 384, 160, 96)
  2076.     self.contents = Bitmap.new(width - 32, height - 32)
  2077.     self.opacity = 0
  2078.     self.z = 9999
  2079.     refresh
  2080.   end
  2081.   #--------------------------------------------------------------------------
  2082.   # * Refresh
  2083.   #--------------------------------------------------------------------------
  2084.   def refresh
  2085.     self.contents.clear
  2086.     self.contents.font.color = system_color
  2087.     self.contents.font.size = 18
  2088.     self.contents.font.bold = true
  2089.     self.contents.draw_text(4, 0, 120, 32, "TIME:")
  2090.     self.contents.draw_text(4, 32, 120, 32, $data_system.words.gold + ":")
  2091.     @total_sec = Graphics.frame_count / Graphics.frame_rate
  2092.     hour = @total_sec / 60 / 60
  2093.     min = @total_sec / 60 % 60
  2094.     sec = @total_sec % 60
  2095.     text = sprintf("%02d:%02d:%02d", hour, min, sec)
  2096.     self.contents.font.color = normal_color
  2097.     self.contents.draw_text(4, 0, 120, 32, text, 2)
  2098.     self.contents.draw_text(4, 32, 120, 32, $game_party.gold.to_s, 2)
  2099.   end
  2100.   #--------------------------------------------------------------------------
  2101.   # * Frame Update
  2102.   #--------------------------------------------------------------------------
  2103.   def update
  2104.     super
  2105.     if Graphics.frame_count / Graphics.frame_rate != @total_sec
  2106.       refresh
  2107.     end
  2108.   end
  2109. end
  2110. #==============================================================================
  2111. # ** Window_End
  2112. #------------------------------------------------------------------------------
  2113. #  This window displays the end window.
  2114. #==============================================================================
  2115. class Window_End < Window_Selectable
  2116.   def initialize
  2117.     super(0,0,192,128)
  2118.     self.contents = Bitmap.new(width - 32, height - 32)
  2119.     @item_max = 3
  2120.     refresh
  2121.   end
  2122.   #--------------------------------------------------------------------------
  2123.   # * Refresh
  2124.   #--------------------------------------------------------------------------
  2125.   def refresh
  2126.     self.contents.clear
  2127.     self.contents.draw_text(4, 0, 150, 32, "To Title")
  2128.     self.contents.draw_text(4, 32, 150, 32, "Shutdown")
  2129.     self.contents.draw_text(4, 64, 150, 32, "Cancel")
  2130.   end
  2131.   #--------------------------------------------------------------------------
  2132.   # * Cursor Rectangle Update
  2133.   #--------------------------------------------------------------------------
  2134.   def update_cursor_rect
  2135.     self.cursor_rect.set(4, @index * 32, 0, 0)
  2136.   end
  2137. end
  2138. #==============================================================================
  2139. # ** Window_Base
  2140. #------------------------------------------------------------------------------
  2141. #  This class is for all in-game windows.
  2142. #==============================================================================
  2143. class Window_Base < Window
  2144.   def draw_item_name(item, x, y)
  2145.     if item == nil
  2146.       return
  2147.     end
  2148.     bitmap = RPG::Cache.icon(item.icon_name)
  2149.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  2150.     self.contents.font.color = normal_color
  2151.     self.contents.draw_text(x + 28, y, 110, 32, item.name)
  2152.   end
  2153. end
  2154. #==============================================================================
  2155. # ** Game_Actor
  2156. #------------------------------------------------------------------------------
  2157. #  This class handles the actor. It's used within the Game_Actors class
  2158. #  ($game_actors) and refers to the Game_Party class ($game_party).
  2159. #==============================================================================
  2160. class Game_Actor < Game_Battler
  2161.   #--------------------------------------------------------------------------
  2162.   # * Get the current EXP
  2163.   #--------------------------------------------------------------------------
  2164.   def now_exp
  2165.     return @exp - @exp_list[@level]
  2166.   end
  2167.   #--------------------------------------------------------------------------
  2168.   # * Get the next level's EXP
  2169.   #--------------------------------------------------------------------------
  2170.   def next_exp
  2171.     return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  2172.   end
  2173. end
  2174. #==============================================================================
  2175. # ** Game_System
  2176. #------------------------------------------------------------------------------
  2177. #  This class handles data surrounding the system. Backround music, etc.
  2178. #  is managed here as well. Refer to "$game_system" for the instance of
  2179. #  this class.
  2180. #==============================================================================
  2181. class Game_System
  2182.   attr_accessor :chapter
  2183.   alias raz_cms_system_initialize initialize
  2184.   #--------------------------------------------------------------------------
  2185.   # * Object Initialization
  2186.   #--------------------------------------------------------------------------
  2187.   def initialize
  2188.     @chapter = ""
  2189.     raz_cms_system_initialize
  2190.   end
  2191. end
  2192. #==============================================================================
  2193. # ** Game_Temp
  2194. #------------------------------------------------------------------------------
  2195. #  This class handles temporary data that is not included with save data.
  2196. #  Refer to "$game_temp" for the instance of this class.
  2197. #==============================================================================
  2198. class Game_Temp
  2199.   attr_accessor :cms_index
  2200.   attr_accessor :skill_index
  2201.   attr_accessor :save_index
  2202.   attr_accessor :equip_index
  2203.   attr_accessor :equip_window
  2204.   alias raz_cms_initialize initialize
  2205.   #--------------------------------------------------------------------------
  2206.   # * Object Initialization
  2207.   #--------------------------------------------------------------------------
  2208.   def initialize
  2209.     @cms_index = 0
  2210.     @skill_index = 0
  2211.     @save_index = 0
  2212.     @equip_index = 0
  2213.     raz_cms_initialize
  2214.   end
  2215. end
  2216. #==============================================================================
  2217. # ** Scene_File
  2218. #------------------------------------------------------------------------------
  2219. #  This is a superclass for the save screen and load screen.
  2220. #==============================================================================
  2221. class Scene_File
  2222.   #--------------------------------------------------------------------------
  2223.   # * Object Initialization
  2224.   #     help_text : text string shown in the help window
  2225.   #--------------------------------------------------------------------------
  2226.   def initialize(help_text)
  2227.     @help_text = help_text
  2228.   end
  2229.   #--------------------------------------------------------------------------
  2230.   # * Main Processing
  2231.   #--------------------------------------------------------------------------
  2232.   def main
  2233.     # Make save file window
  2234.     @back_ground = Sprite.new
  2235.     @back_ground.bitmap = RPG::Cache.picture(CT_Pictures::BG_Picture)
  2236.     @save_window = []
  2237.     @save_window[0] = Window_Base.new(39,32, 560, 70)
  2238.     @save_window[1] = Window_Base.new(39,102, 560, 70)
  2239.     @save_window[2] = Window_Base.new(39,172, 560, 70)
  2240.     @save_left = Window_Base.new(39,273,241,172)
  2241.     @save_right = Window_Base.new(280,273,320,172)
  2242.     @savefile_windows = []
  2243.     @save_status = Window_SaveStatus.new
  2244.     for i in 0..2
  2245.       @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
  2246.     end
  2247.     # Select last file to be operated
  2248.     @file_index = $game_temp.last_file_index
  2249.     @savefile_windows[@file_index].selected = true
  2250.     # Execute transition
  2251.     Graphics.transition
  2252.     # Main loop
  2253.     loop do
  2254.       # Update game screen
  2255.       Graphics.update
  2256.       # Update input information
  2257.       Input.update
  2258.       # Frame update
  2259.       update
  2260.       # Abort loop if screen is changed
  2261.       if $scene != self
  2262.         break
  2263.       end
  2264.     end
  2265.     # Prepare for transition
  2266.     Graphics.freeze
  2267.     # Dispose of windows
  2268.     @save_status.dispose
  2269.     @back_ground.dispose
  2270.     @save_left.dispose
  2271.     @save_right.dispose
  2272.     for i in 0..2
  2273.       @save_window[i].dispose
  2274.     end
  2275.     for i in @savefile_windows
  2276.       i.dispose
  2277.     end
  2278.   end
  2279.   #--------------------------------------------------------------------------
  2280.   # * Frame Update
  2281.   #--------------------------------------------------------------------------
  2282.   def update
  2283.     @save_status.update
  2284.     $game_temp.save_index = @file_index
  2285.     if Input.trigger?(Input::C)
  2286.       # Call method: on_decision (defined by the subclasses)
  2287.       on_decision(make_filename(@file_index))
  2288.       $game_temp.last_file_index = @file_index
  2289.       return
  2290.     end
  2291.     # If B button was pressed
  2292.     if Input.trigger?(Input::B)
  2293.       # Call method: on_cancel (defined by the subclasses)
  2294.       on_cancel
  2295.       return
  2296.     end
  2297.     # If the down directional button was pressed
  2298.     if Input.repeat?(Input::DOWN)
  2299.       # If the down directional button pressed down is not a repeat,
  2300.       # or cursor position is more in front than 3
  2301.       unless @file_index == 2
  2302.         if Input.trigger?(Input::DOWN)
  2303.           # Play cursor SE
  2304.           $game_system.se_play($data_system.cursor_se)
  2305.           # Move cursor down
  2306.           @savefile_windows[@file_index].selected = false
  2307.           @file_index = (@file_index + 1)
  2308.           @savefile_windows[@file_index].selected = true
  2309.           return
  2310.         end
  2311.       end
  2312.       # If the up directional button was pressed
  2313.       elsif Input.repeat?(Input::UP)
  2314.         # If the up directional button pressed down is not a repeat、
  2315.         # or cursor position is more in back than 0
  2316.         unless @file_index == 0
  2317.         if Input.trigger?(Input::UP)
  2318.           # Play cursor SE
  2319.           $game_system.se_play($data_system.cursor_se)
  2320.           # Move cursor up
  2321.           @savefile_windows[@file_index].selected = false
  2322.           @file_index = (@file_index - 1)
  2323.           @savefile_windows[@file_index].selected = true
  2324.           return
  2325.         end
  2326.       end
  2327.     end
  2328.   end
  2329. end
Expand to see the code.


There are three parts to this script but the other two are just for pictures and the cursor.
Hey just a quick question, is there a template for the chrono styled battlers, im trying to make a battler add on pack for it, but its a pain without a template. I tried the one posted earlier in the thread but it wasnt correct.

if you could just tell me how you aligned yours ATOA id greatly appreciate it, i know you probably just used paint, but how did you align them, you must have had a template.

Thanks again
Joe
Look I don't use the chrono battle system but I think I know how the template goes.

Each character has three different battler sheets, and the three types are:
First, is the default battler facing left.(which will turn right I suppose if you face right)
Second, is the up battler, and third is the down battler.
Each of the three battle sheets have the sprite's poses in this order:
Ready pose
hit pose
low hp pose
defense pose
advance pose
return pose
attack pose
magic/item pose
battle intro pose
victory pose
dead pose

Each Individual frame is 128 X 128. You can have a larger or smaller individual frame size, but each frame must be the same height and width for that character.
I use one of these templates, depending on the battler dimensions:

Image

Image

Image

Image

Image

Image

Image

I use the red and blue lines as reference so i can align the battler correctly.
Once i finish placing all frames, i remove the frames not used and the template lines.
edit. nevermind
Hey Atoa. Just a couple quick questions. Did you make the demo side view sprites or did you get them somewhere? And I can't figure out how to, or if i can, stop a specific side battler to not advance, and attack from afar, like a gunner or archer. Ive gone through the pose editors and your explaination on here several times and I just can't get it. @.@

EDIT: This is the battler i wish to use:
Image

EDIT #2: Disregard! I forgot the most important part.....an equipped gun....
Hi Atoa,

I have two questions for you. I'm not lazy, I've looked through all your script and the full thread. I'm just reasonably new to scripting, so I may be overlooking something.

Firstly, the only battlers that the shadows work for are the two that actually have shadow added into their advanced settings (I believe Thanatos and Adel), even though I have Shadows turned to true (to always use shadow, not the advanced setting) in the basic settings. Any advice?

Secondly, is there any way I can add in a command in the advanced setting to make a battle animation appear below the battle sprites?

Thanks again for all your hard work on this game-changing script. :)
@Avarius
I will check the shadow settings.

Battle Animations are aways shown above sprites, there's no command to changed that now, maybe in the future.
Uhh, I'm pretty sure I just missed it but I couldn't find it in the core scripts, I looked through th add-ons but i didn't fine it, I'm looking for the line that can be used to disable the enemy animation thing. I think you could be able to edit the graphic of every monster and make them unanimated but that will take centuries for me. is there another and simpler way?

Thank you and have a nice day!
To make enemies non animated juts add an "$" on the battler filename.

Also i Suggest adding "LOCKMOVE/NOMOVE" in the advanced settings for enemies for enemies with non-animated battlers, so they won't move to targert never.
Atoa, were you able to find anything in the shadow settings? 🙂

I dont know if I'm the only one having this problem, but I haven't messed around with anything since downloading the demo.
Atoa I have a question, I see in config-basic script it have option for battler to have 4 direction.

what does this mean? it will decide which direction by random per battle?

I'm not really sure how to use it.
@Android

No, this mean that battler direction will be decided based on his position compared with enemy party/target postion.

This doesn't have direct effect in battler postion.

So if battler is on right and targets on left, battlers will face left. If battler is above and enemies bellow, battler will face down.

It's possible to change battler formation via scritp calls.

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=62914