Medina Stories License Board

I cracked the code, you fucktards. Finally, after five days of struggling, the stupid Action List window works! Fuck you.

Now I just have to organize the code, make a demo, and a video. Hopefully, I'll be releasing v2.0 tonight.

EDIT: The code now is now definitely finished. Now I'm uploading files and making a demo.
cool 😀 definitely been waiting :lol:
My Internet connection sucks, so I haven't been able to upload the resources, code, or demo. :/
I'll try uploading them at school.
its alright, take ur time 🙂
Excellent script, Juan Definitely one of my favorites.

I have this script set up to use different boards for each class, but this only affects the character's database class. The board stays the same when I change a character's class.

Would it be possible to make it so when a character's class changes, their class' license board ID also changes to the corresponding class' board ID? And would it be too difficult to have it where if a character's class changes, the character would keep all of their parameter increases and licenses that they activated after getting a new board ID?

I followed the instructions in the YouTube video's comments on how to make boards character specific, and just changed "if board_id == 1" to "if class_id == 1" for each board.

This is the edited script I currently have, it's merged with Moghunter's title screen to fix compatibility issues:

  1.  
  2.  
  3. #==============================================================================
  4. # ** FFXII
  5. #------------------------------------------------------------------------------
  6. #  This module contains global variables and classes.
  7. #==============================================================================
  8.  
  9. module FFXII
  10.   #--------------------------------------------------------------------------
  11.   # * Game_Actor
  12.   #     AP_MAX : ability points max
  13.   #--------------------------------------------------------------------------
  14.   AP_MAX = 9999
  15.   #--------------------------------------------------------------------------
  16.   # * Game_Party
  17.   #     ACTOR_MAX : actor max
  18.   #--------------------------------------------------------------------------
  19.   ACTOR_MAX = 12
  20.   #--------------------------------------------------------------------------
  21.   # * Sprite_AvailableLP
  22.   #     STATUS : status bitmap
  23.   #     AVATAR : avatar bitmap
  24.   #--------------------------------------------------------------------------
  25.   STATUS = RPG::Cache.picture("bar")
  26.   def AVATAR(id)
  27.     return RPG::Cache.picture("avatar#{id}") rescue
  28.            RPG::Cache.picture("avatar-1")
  29.   end
  30.   #--------------------------------------------------------------------------
  31.   # * Sprite_LicenseDescription
  32.   #     HELP         : help bitmap
  33.   #     CATEGORY     : category bitmap
  34.   #     CATEGORY_HUE : category hue
  35.   #     STAR         : star bitmap
  36.   #--------------------------------------------------------------------------
  37.   HELP = RPG::Cache.picture("Help")
  38.   CATEGORY = RPG::Cache.picture("Category")
  39.   CATEGORY_HUE = [90, 270, 0, 180, 0, 180, 120, 120, 240, 0, 180]
  40.   STAR = RPG::Cache.picture("Star")
  41.   #--------------------------------------------------------------------------
  42.   # * Sprite_Cursor
  43.   #     CURSOR : cursor bitmap
  44.   #--------------------------------------------------------------------------
  45.   CURSOR = RPG::Cache.picture("cursor")
  46.   #--------------------------------------------------------------------------
  47.   # * Spriteset_Board
  48.   #     BOARD_BG             : board background
  49.   #     TILE                 : tile bitmap
  50.   #     ICON                 : icon bitmap
  51.   #     TILE_XSIZE           : tile x-size
  52.   #     TILE_YSIZE           : tile y-size
  53.   #     TILE_AP_FONT_SIZE    : tile ap font size
  54.   #     TILE_LEVEL_FONT_SIZE : tile level font size
  55.   #--------------------------------------------------------------------------
  56.   BOARD_BG = RPG::Cache.picture("parchment")
  57.   def TILE(id)
  58.     return RPG::Cache.picture("tile#{id}")
  59.   end
  60.   def ICON(type)
  61.     return RPG::Cache.picture("#{type}")
  62.   end
  63.   TILE_X_SIZE = 32
  64.   TILE_Y_SIZE = 32
  65.   TILE_AP_FONT_SIZE = 16
  66.   TILE_LEVEL_FONT_SIZE = 16
  67.   #--------------------------------------------------------------------------
  68.   # * Bitmap
  69.   #     HIDDEN : hidden text
  70.   #     LP     : license points text
  71.   #--------------------------------------------------------------------------
  72.   HIDDEN = "???"
  73.   LP = "AP"
  74.   #--------------------------------------------------------------------------
  75.   # * Bitmap_MiniBoard
  76.   #     MINIBOARD        : miniature board bitmap directory
  77.   #     MINIBOARD_MARGIN : miniature board margin (pixels)
  78.   #     MINI_TILE        : miniature board tile
  79.   #     MINI_TILE_XSIZE  : miniature tile x-size
  80.   #     MINI_TILE_YSIZE  : miniature tile y-size
  81.   #--------------------------------------------------------------------------
  82.   MINIBOARD = "Graphics/Pictures/minibg"
  83.   MINIBOARD_MARGIN = 8
  84.   def MINI_TILE(type)
  85.     return RPG::Cache.picture("mini#{type}") rescue
  86.            RPG::Cache.picture("mini-1")
  87.   end
  88.   MINI_TILE_XSIZE = 8
  89.   MINI_TILE_YSIZE = 8
  90.   #--------------------------------------------------------------------------
  91.   # * Scene_Board
  92.   #     BOARD_OX                    : board initial x-coordinate
  93.   #     BOARD_OY                    : board initial y-coordinate
  94.   #     BOARD_MARGIN                : board margin (tiles)
  95.   #     SHADOW                      : shadow sprite
  96.   #     BLACK                       : black sprite
  97.   #     CONFIRM_MESSAGE             : confirm window message
  98.   #     ANIMATION                   : animation bitmap
  99.   #     ANIMATION_HORIZONTAL_FRAMES : animation horizontal frames
  100.   #     ANIMATION_VERTICAL_FRAMES   : animation vertical frames
  101.   #     ANIMATION_TOTAL_FRAMES      : animation total frames
  102.   #     ANIMATION_BLENDTYPE         : animation blend type
  103.   #--------------------------------------------------------------------------
  104.   BOARD_OX = 0
  105.   BOARD_OY = 0
  106.   BOARD_MARGIN = 3
  107.   SHADOW = RPG::Cache.picture("shadow")
  108.   BLACK = RPG::Cache.picture("black")
  109.   def CONFIRM_MESSAGE(message)
  110.     return "Obtain #{message}?"
  111.   end
  112.   ANIMATION = RPG::Cache.picture("Light1")
  113.   ANIMATION_HORIZONTAL_FRAMES = 5
  114.   ANIMATION_VERTICAL_FRAMES = 3
  115.   ANIMATION_TOTAL_FRAMES = 15
  116.   ANIMATION_BLENDTYPE = 1
  117.   #--------------------------------------------------------------------------
  118.   # * Board
  119.   #     BOARD_NAME        : board name
  120.   #     BOARD_ITEM        : board item
  121.   #     BOARD_DESCRIPTION : board description
  122.   #     BOARD_CLASS       : board class
  123.   #--------------------------------------------------------------------------
  124.   def BOARD_NAME(id)
  125.     case id
  126.     when 0
  127.       return "No Board"
  128.     end
  129.     return "Board"
  130.   end
  131.   def BOARD_ITEM(type, value)
  132.     case type
  133.     when 8   # Skills
  134.       return $data_skills[value]
  135.     when 9   # Weapon Set
  136.       return $data_weapons[value]
  137.     when 10  # Armor Set
  138.       return $data_armors[value]
  139.     end
  140.     return nil
  141.   end
  142.   def BOARD_DESCRIPTION(type, value)
  143.     case type
  144.     when 0   # HP
  145.       return "Increase max HP by #{value}"
  146.     when 1   # SP
  147.       return "Increase max MP by #{value}"
  148.     when 2   # Strength
  149.       return "Increase physical attack"
  150.     when 3   # Physical Defense
  151.       return "Increase physical defense"
  152.     when 4   # Intelligence
  153.       return "Increase magic potency"
  154.     when 5   # Magic Defense
  155.       return "Increase magic resistance"
  156.     when 6   # Agility
  157.       return "Increase agility"
  158.     when 7   # Dexterity
  159.       return "Increase dexterity"
  160.     when 8   # Skills
  161.       return "#{$data_skills[value].description}"
  162.     when 9   # Weapon Set
  163.       return "#{$data_weapons[value].description}"
  164.     when 10  # Armor Set
  165.       return "#{$data_armors[value].description}"
  166.     end
  167.     return nil
  168.   end
  169.   def BOARD_CLASS(type, value, level)
  170.     case type
  171.     when 0   # HP
  172.       return "Max HP"
  173.     when 1   # SP
  174.       return "Max MP"
  175.     when 2   # Strength
  176.       return "Strength"
  177.     when 3   # Physical Defense
  178.       return "Physical Defense"
  179.     when 4   # Intelligence
  180.       return "Intelligence"
  181.     when 5   # Magic Defense
  182.       return "Magic Defense"
  183.     when 6   # Agility
  184.       return "Agility"
  185.     when 7   # Dexterity
  186.       return "Dexterity"
  187.     when 8   # Skills
  188.       if level == -1
  189.         return ""
  190.       elsif value >= 0 and value <= 6
  191.         return "White Magic #{level}"
  192.       elsif value >= 7 and value <= 32
  193.         return "Black Magic #{level}"
  194.       elsif value >= 33 and value <= 56
  195.         return "Green Magic #{level}"
  196.       elsif value >= 57 and value <= 80
  197.         return "Arcane Magic #{level}"
  198.       else
  199.         return "#{$data_skills[value].name}"
  200.       end
  201.     when 9   # Weapon Set
  202.       if level == -1
  203.         return ""
  204.       elsif value >= 0 and value <= 4
  205.         return "Swords #{level}"
  206.       elsif value >= 5 and value <= 8
  207.         return "Spears #{level}"
  208.       elsif value >= 9 and value <= 12
  209.         return "Axes #{level}"
  210.       elsif value >= 13 and value <= 16
  211.         return "Daggers #{level}"
  212.       elsif value >= 17 and value <= 20
  213.         return "Bows #{level}"
  214.       elsif value >= 21 and value <= 24
  215.         return "Guns #{level}"
  216.       elsif value >= 25 and value <= 28
  217.         return "Maces #{level}"
  218.       elsif value >= 29 and value <= 32
  219.         return "Poles #{level}"
  220.       else
  221.         return "#{$data_weapons[value].name}"
  222.       end
  223.     when 10  # Armor Set
  224.       if level == -1
  225.         return ""
  226.       elsif value >= 0 and value <= 4
  227.         return "Shields #{level}"
  228.       elsif value >= 5 and value <= 8
  229.         return "Helmets #{level}"
  230.       elsif value >= 9 and value <= 12
  231.         return "Hats #{level}"
  232.       elsif value >= 13 and value <= 16
  233.         return "Armors #{level}"
  234.       elsif value >= 17 and value <= 20
  235.         return "Breastplates #{level}"
  236.       elsif value >= 21 and value <= 24
  237.         return "Robes #{level}"
  238.       elsif value >= 25 and value <= 32
  239.         return "Rings #{level}"
  240.       else
  241.         return "#{$data_armors[value].name}"
  242.       end
  243.     end
  244.     return nil
  245.   end
  246. end
  247.  
  248. #==============================================================================
  249. # ** Boards
  250. #------------------------------------------------------------------------------
  251. #  This module contains global variables and classes.
  252. #==============================================================================
  253.  
  254. module Boards
  255.   #--------------------------------------------------------------------------
  256.   # * Scene_EditBoard
  257.   #     NEW_BOARD_XSIZE : new board x-size
  258.   #     NEW_BOARD_YSIZE : new board y-size
  259.   #--------------------------------------------------------------------------
  260.   NEW_BOARD_XSIZE = 24
  261.   NEW_BOARD_YSIZE = 24
  262.   #--------------------------------------------------------------------------
  263.   # * Creates an empty board
  264.   #--------------------------------------------------------------------------
  265.   def new_board(xsize, ysize)
  266.     $data_boards = get_boards
  267.     board = Table.new(xsize, ysize, 9)
  268.     for x in 0...board.xsize
  269.       for y in 0...board.ysize
  270.         for z in 0...board.zsize
  271.           case z
  272.           when 0  # ACTIVATED
  273.             board[x, y, z] = 0
  274.           when 1  # VISIBLE
  275.             board[x, y, z] = 0
  276.           when 2  # AP
  277.             board[x, y, z] = 0
  278.           when 3  # TYPE
  279.             board[x, y, z] = -1
  280.           when 4  # OBJECT 1 VALUE
  281.             board[x, y, z] = 0
  282.           when 5  # OBJECT 2 VALUE
  283.             board[x, y, z] = 0
  284.           when 6  # OBJECT 3 VALUE
  285.             board[x, y, z] = 0
  286.           when 7  # OBJECT 4 VALUE
  287.             board[x, y, z] = 0
  288.           when 8  # LEVEL
  289.             board[x, y, z] = -1
  290.           end
  291.         end
  292.       end
  293.     end
  294.     $data_boards.push(board)
  295.     save_boards($data_boards)
  296.   end
  297.   #--------------------------------------------------------------------------
  298.   # * Deletes a board
  299.   #     index : index
  300.   #--------------------------------------------------------------------------
  301.   def delete_board(index)
  302.     $data_boards = get_boards
  303.     $data_boards.delete_at(index)
  304.     save_boards($data_boards)
  305.   end
  306.   #--------------------------------------------------------------------------
  307.   # * Save boards
  308.   #     board : board
  309.   #--------------------------------------------------------------------------
  310.   def save_boards(boards)
  311.     save_data(boards, "Data/Boards.rxdata")
  312.   end
  313.   #--------------------------------------------------------------------------
  314.   # * Get boards
  315.   #--------------------------------------------------------------------------
  316.   def get_boards
  317.     $data_boards = load_data("Data/Boards.rxdata") rescue
  318.     $data_boards = []
  319.     return $data_boards
  320.   end
  321. end
  322.  
  323. #==============================================================================
  324. # ** List
  325. #------------------------------------------------------------------------------
  326. #  This module contains global variables and classes.
  327. #==============================================================================
  328.  
  329. module List
  330.   #--------------------------------------------------------------------------
  331.   # * Create item lists
  332.   #--------------------------------------------------------------------------
  333.   def item_list
  334.     # Load database
  335.     $data_skills  = load_data("Data/Skills.rxdata")
  336.     $data_weapons = load_data("Data/Weapons.rxdata")
  337.     $data_armors  = load_data("Data/Armors.rxdata")
  338.     # Create a new file and write to it  
  339.     File.open("README.txt", "wb") do |file|  
  340.       # Add skills
  341.       for i in 1...$data_skills.size
  342.         item = $data_skills[i]
  343.         file.print("#{item.id}\t")
  344.         file.print("#{item.name}\t")
  345.         file.puts("#{item.description}\n")
  346.         end
  347.       # Add weapons
  348.       for i in 1...$data_weapons.size
  349.         item = $data_weapons[i]
  350.         file.print("#{item.id}\t")
  351.         file.print("#{item.name}\t")
  352.         file.puts("#{item.description}\n")
  353.       end
  354.       # Add armors
  355.       for i in 1...$data_armors.size
  356.         item = $data_armors[i]
  357.         file.print("#{item.id}\t")
  358.         file.print("#{item.name}\t")
  359.         file.puts("#{item.description}\n")
  360.       end
  361.     end
  362.   end
  363. end
  364.  
  365. #==============================================================================
  366. # ** Game_Actor
  367. #------------------------------------------------------------------------------
  368. #  This class handles the actor. It's used within the Game_Actors class
  369. #  ($game_actors) and refers to the Game_Party class ($game_party).
  370. #==============================================================================
  371.  
  372. class Game_Actor < Game_Battler
  373.   #--------------------------------------------------------------------------
  374.   # * Invariables
  375.   #--------------------------------------------------------------------------
  376.   include FFXII                           # FFXII module
  377.   #--------------------------------------------------------------------------
  378.   # * Public Instance Variables
  379.   #--------------------------------------------------------------------------
  380.   attr_reader   :name                     # name
  381.   attr_reader   :character_name           # character file name
  382.   attr_reader   :character_hue            # character hue
  383.   attr_reader   :class_id                 # class ID
  384.   attr_reader   :weapon_id                # weapon ID
  385.   attr_reader   :armor1_id                # shield ID
  386.   attr_reader   :armor2_id                # helmet ID
  387.   attr_reader   :armor3_id                # body armor ID
  388.   attr_reader   :armor4_id                # accessory ID
  389.   attr_reader   :board                    # board ID
  390.   attr_reader   :level                    # level
  391.   attr_reader   :exp                      # experience
  392.   attr_reader   :ap                       # ability points
  393.   attr_reader   :skills                   # skills
  394.   #--------------------------------------------------------------------------
  395.   # * Object Initialization
  396.   #     actor_id : actor ID
  397.   #--------------------------------------------------------------------------
  398.   def initialize(actor_id)
  399.     super()
  400.     setup(actor_id)
  401.   end
  402.   #--------------------------------------------------------------------------
  403.   # * Setup
  404.   #     actor_id : actor ID
  405.   #--------------------------------------------------------------------------
  406.   def setup(actor_id)
  407.     actor = $data_actors[actor_id]
  408.     @actor_id = actor_id
  409.     @name = actor.name
  410.     @character_name = actor.character_name
  411.     @character_hue = actor.character_hue
  412.     @battler_name = actor.battler_name
  413.     @battler_hue = actor.battler_hue
  414.     @class_id = actor.class_id
  415.     @weapon_id = actor.weapon_id
  416.     @armor1_id = actor.armor1_id
  417.     @armor2_id = actor.armor2_id
  418.     @armor3_id = actor.armor3_id
  419.     @armor4_id = actor.armor4_id
  420.     @board   = Board.new(0)
  421.    
  422.    
  423.    
  424.    
  425.    
  426.    
  427.    
  428.     ##############################
  429.     # EDIT CUSTOM BOARD IDs HERE #
  430.     ##############################
  431.    
  432.     @board = Board.new(1) if class_id == 1
  433.     @board = Board.new(2) if class_id == 2
  434.     @board = Board.new(3) if class_id == 3
  435.     @board = Board.new(4) if class_id == 4
  436.     @board = Board.new(5) if class_id == 5
  437.     @board = Board.new(6) if class_id == 6
  438.     @board = Board.new(7) if class_id == 7
  439.     @board = Board.new(8) if class_id == 8
  440.     @board = Board.new(9) if class_id == 9
  441.     @board = Board.new(10) if class_id == 10
  442.     @board = Board.new(11) if class_id == 11
  443.     @board = Board.new(12) if class_id == 12
  444.     @board = Board.new(13) if class_id == 13
  445.     @board = Board.new(14) if class_id == 14
  446.     @board = Board.new(15) if class_id == 15
  447.     @board = Board.new(16) if class_id == 16
  448.     @board = Board.new(17) if class_id == 17
  449.     @board = Board.new(18) if class_id == 18
  450.     @board = Board.new(19) if class_id == 19
  451.     @board = Board.new(20) if class_id == 20
  452.     @board = Board.new(21) if class_id == 21
  453.     @board = Board.new(22) if class_id == 22
  454.     @board = Board.new(23) if class_id == 23
  455.     @board = Board.new(24) if class_id == 24
  456.     @board = Board.new(25) if class_id == 25
  457.     @board = Board.new(26) if class_id == 26
  458.     @board = Board.new(27) if class_id == 27
  459.     @board = Board.new(28) if class_id == 28
  460.     @board = Board.new(29) if class_id == 29
  461.     @board = Board.new(30) if class_id == 30
  462.     @board = Board.new(31) if class_id == 31
  463.     @board = Board.new(32) if class_id == 32
  464.     @board = Board.new(33) if class_id == 33
  465.     @board = Board.new(34) if class_id == 34
  466.     @board = Board.new(35) if class_id == 35
  467.     @board = Board.new(36) if class_id == 36
  468.     @board = Board.new(37) if class_id == 37
  469.     @board = Board.new(38) if class_id == 38
  470.     @board = Board.new(39) if class_id == 39
  471.     @board = Board.new(40) if class_id == 40
  472.     @board = Board.new(41) if class_id == 41
  473.     @board = Board.new(42) if class_id == 42
  474.     @board = Board.new(43) if class_id == 43
  475.     @board = Board.new(44) if class_id == 44
  476.     @board = Board.new(45) if class_id == 45
  477.     @board = Board.new(46) if class_id == 46
  478.     @board = Board.new(47) if class_id == 47
  479.     @board = Board.new(48) if class_id == 48
  480.     @board = Board.new(49) if class_id == 49
  481.     @board = Board.new(50) if class_id == 50
  482.     @board = Board.new(51) if class_id == 51
  483.     @board = Board.new(52) if class_id == 52
  484.     @board = Board.new(53) if class_id == 53
  485.     @board = Board.new(54) if class_id == 54
  486.     @board = Board.new(55) if class_id == 55
  487.     @board = Board.new(56) if class_id == 56
  488.     @board = Board.new(57) if class_id == 57
  489.     @board = Board.new(58) if class_id == 58
  490.     @board = Board.new(59) if class_id == 59
  491.     @board = Board.new(60) if class_id == 60
  492.     @board = Board.new(61) if class_id == 61
  493.     @board = Board.new(62) if class_id == 62
  494.     @board = Board.new(63) if class_id == 63
  495.     @board = Board.new(64) if class_id == 64
  496.     @board = Board.new(65) if class_id == 65
  497.     @board = Board.new(66) if class_id == 66
  498.     @board = Board.new(67) if class_id == 67
  499.     @board = Board.new(68) if class_id == 68
  500.     @board = Board.new(69) if class_id == 69
  501.     @board = Board.new(70) if class_id == 70
  502.     @board = Board.new(71) if class_id == 71
  503.     @board = Board.new(72) if class_id == 72
  504.     @board = Board.new(73) if class_id == 73
  505.     @board = Board.new(74) if class_id == 74
  506.     @board = Board.new(75) if class_id == 75
  507.     @board = Board.new(76) if class_id == 76
  508.     @board = Board.new(77) if class_id == 77
  509.     @board = Board.new(78) if class_id == 78
  510.     @board = Board.new(79) if class_id == 79
  511.     @board = Board.new(80) if class_id == 80
  512.     @board = Board.new(81) if class_id == 81
  513.     @board = Board.new(82) if class_id == 82
  514.     @board = Board.new(83) if class_id == 83
  515.     @board = Board.new(84) if class_id == 84
  516.     @board = Board.new(85) if class_id == 85
  517.     @board = Board.new(86) if class_id == 86
  518.     @board = Board.new(87) if class_id == 87
  519.     @board = Board.new(88) if class_id == 88
  520.     @board = Board.new(89) if class_id == 89
  521.     @board = Board.new(90) if class_id == 90
  522.     @board = Board.new(91) if class_id == 91
  523.     @board = Board.new(92) if class_id == 92
  524.     @board = Board.new(93) if class_id == 93
  525.     @board = Board.new(94) if class_id == 94
  526.     @board = Board.new(95) if class_id == 95
  527.     @board = Board.new(96) if class_id == 96
  528.     @board = Board.new(97) if class_id == 97
  529.     @board = Board.new(98) if class_id == 98
  530.     @board = Board.new(99) if class_id == 99
  531.    
  532.    
  533.    
  534.     @level = actor.initial_level
  535.     @exp_list = Array.new(101)
  536.     make_exp_list
  537.     @exp = @exp_list[@level]
  538.     @ap = 0
  539.     @skills = []
  540.     @hp = maxhp
  541.     @sp = maxsp
  542.     @states = []
  543.     @states_turn = {}
  544.     @maxhp_plus = 0
  545.     @maxsp_plus = 0
  546.     @str_plus = 0
  547.     @dex_plus = 0
  548.     @agi_plus = 0
  549.     @int_plus = 0
  550.     # Learn skill
  551.     for i in 1..@level
  552.       for j in $data_classes[@class_id].learnings
  553.         if j.level == i
  554.           learn_skill(j.skill_id)
  555.         end
  556.       end
  557.     end
  558.     # Update auto state
  559.     update_auto_state(nil, $data_armors[@armor1_id])
  560.     update_auto_state(nil, $data_armors[@armor2_id])
  561.     update_auto_state(nil, $data_armors[@armor3_id])
  562.     update_auto_state(nil, $data_armors[@armor4_id])
  563.   end
  564.   #--------------------------------------------------------------------------
  565.   # * Get Actor ID
  566.   #--------------------------------------------------------------------------
  567.   def id
  568.     return @actor_id
  569.   end
  570.   #--------------------------------------------------------------------------
  571.   # * Get Index
  572.   #--------------------------------------------------------------------------
  573.   def index
  574.     return $game_party.actors.index(self)
  575.   end
  576.   #--------------------------------------------------------------------------
  577.   # * Calculate EXP
  578.   #--------------------------------------------------------------------------
  579.   def make_exp_list
  580.     actor = $data_actors[@actor_id]
  581.     @exp_list[1] = 0
  582.     pow_i = 2.4 + actor.exp_inflation / 100.0
  583.     for i in 2..100
  584.       if i > actor.final_level
  585.         @exp_list[i] = 0
  586.       else
  587.         n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
  588.         @exp_list[i] = @exp_list[i-1] + Integer(n)
  589.       end
  590.     end
  591.   end
  592.   #--------------------------------------------------------------------------
  593.   # * Get Element Revision Value
  594.   #     element_id : element ID
  595.   #--------------------------------------------------------------------------
  596.   def element_rate(element_id)
  597.     # Get values corresponding to element effectiveness
  598.     table = [0,200,150,100,50,0,-100]
  599.     result = table[$data_classes[@class_id].element_ranks[element_id]]
  600.     # If this element is protected by armor, then it's reduced by half
  601.     for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
  602.       armor = $data_armors[i]
  603.       if armor != nil and armor.guard_element_set.include?(element_id)
  604.         result /= 2
  605.       end
  606.     end
  607.     # If this element is protected by states, then it's reduced by half
  608.     for i in @states
  609.       if $data_states[i].guard_element_set.include?(element_id)
  610.         result /= 2
  611.       end
  612.     end
  613.     # End Method
  614.     return result
  615.   end
  616.   #--------------------------------------------------------------------------
  617.   # * Get State Effectiveness
  618.   #--------------------------------------------------------------------------
  619.   def state_ranks
  620.     return $data_classes[@class_id].state_ranks
  621.   end
  622.   #--------------------------------------------------------------------------
  623.   # * Determine State Guard
  624.   #     state_id : state ID
  625.   #--------------------------------------------------------------------------
  626.   def state_guard?(state_id)
  627.     for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
  628.       armor = $data_armors[i]
  629.       if armor != nil
  630.         if armor.guard_state_set.include?(state_id)
  631.           return true
  632.         end
  633.       end
  634.     end
  635.     return false
  636.   end
  637.   #--------------------------------------------------------------------------
  638.   # * Get Normal Attack Element
  639.   #--------------------------------------------------------------------------
  640.   def element_set
  641.     weapon = $data_weapons[@weapon_id]
  642.     return weapon != nil ? weapon.element_set : []
  643.   end
  644.   #--------------------------------------------------------------------------
  645.   # * Get Normal Attack State Change (+)
  646.   #--------------------------------------------------------------------------
  647.   def plus_state_set
  648.     weapon = $data_weapons[@weapon_id]
  649.     return weapon != nil ? weapon.plus_state_set : []
  650.   end
  651.   #--------------------------------------------------------------------------
  652.   # * Get Normal Attack State Change (-)
  653.   #--------------------------------------------------------------------------
  654.   def minus_state_set
  655.     weapon = $data_weapons[@weapon_id]
  656.     return weapon != nil ? weapon.minus_state_set : []
  657.   end
  658.   #--------------------------------------------------------------------------
  659.   # * Get AP
  660.   #--------------------------------------------------------------------------
  661.   def ap=(ap)
  662.     @ap = [[ap, 0].max, AP_MAX].min
  663.   end
  664.   #--------------------------------------------------------------------------
  665.   # * Get Maximum HP
  666.   #--------------------------------------------------------------------------
  667.   def maxhp
  668.     n = [[base_maxhp + @maxhp_plus, 1].max, 9999].min
  669.     for i in @states
  670.       n *= $data_states[i].maxhp_rate / 100.0
  671.     end
  672.     n += @board.hp
  673.     n = [[Integer(n), 1].max, 9999].min
  674.     return n
  675.   end
  676.   #--------------------------------------------------------------------------
  677.   # * Get Maximum SP
  678.   #--------------------------------------------------------------------------
  679.   def maxsp
  680.     n = [[base_maxsp + @maxsp_plus, 0].max, 999].min
  681.     for i in @states
  682.       n *= $data_states[i].maxsp_rate / 100.0
  683.     end
  684.     n += @board.sp
  685.     n = [[Integer(n), 0].max, 999].min
  686.     return n
  687.   end
  688.   #--------------------------------------------------------------------------
  689.   # * Get Strength
  690.   #--------------------------------------------------------------------------
  691.   def str
  692.     n = [[base_str + @str_plus, 1].max, 99].min
  693.     for i in @states
  694.       n *= $data_states[i].str_rate / 100.0
  695.     end
  696.     n += @board.str
  697.     n = [[Integer(n), 1].max, 99].min
  698.     return n
  699.   end
  700.   #--------------------------------------------------------------------------
  701.   # * Get Intelligence
  702.   #--------------------------------------------------------------------------
  703.   def int
  704.     n = [[base_int + @int_plus, 1].max, 99].min
  705.     for i in @states
  706.       n *= $data_states[i].int_rate / 100.0
  707.     end
  708.     n += @board.int
  709.     n = [[Integer(n), 1].max, 99].min
  710.     return n
  711.   end
  712.   #--------------------------------------------------------------------------
  713.   # * Get Dexterity
  714.   #--------------------------------------------------------------------------
  715.   def dex
  716.     n = [[base_dex + @dex_plus, 1].max, 99].min
  717.     for i in @states
  718.       n *= $data_states[i].dex_rate / 100.0
  719.     end
  720.     n += @board.dex
  721.     n = [[Integer(n), 1].max, 99].min
  722.     return n
  723.   end
  724.   #--------------------------------------------------------------------------
  725.   # * Get Agility
  726.   #--------------------------------------------------------------------------
  727.   def agi
  728.     n = [[base_agi + @agi_plus, 1].max, 99].min
  729.     for i in @states
  730.       n *= $data_states[i].agi_rate / 100.0
  731.     end
  732.     n += @board.agi
  733.     n = [[Integer(n), 1].max, 99].min
  734.     return n
  735.   end
  736.   #--------------------------------------------------------------------------
  737.   # * Get Physical Defense
  738.   #--------------------------------------------------------------------------
  739.   def pdef
  740.     n = [[base_pdef, 0].max, 999].min
  741.     for i in @states
  742.       n *= $data_states[i].pdef_rate / 100.0
  743.     end
  744.     n += @board.pdef
  745.     n = [[Integer(n), 0].max, 999].min
  746.     return n
  747.   end
  748.   #--------------------------------------------------------------------------
  749.   # * Get Magic Defense
  750.   #--------------------------------------------------------------------------
  751.   def mdef
  752.     n = [[base_mdef, 0].max, 999].min
  753.     for i in @states
  754.       n *= $data_states[i].mdef_rate / 100.0
  755.     end
  756.     n += @board.mdef
  757.     n = [[Integer(n), 0].max, 999].min
  758.     return n
  759.   end
  760.   #--------------------------------------------------------------------------
  761.   # * Get Basic Maximum HP
  762.   #--------------------------------------------------------------------------
  763.   def base_maxhp
  764.     return $data_actors[@actor_id].parameters[0, @level]
  765.   end
  766.   #--------------------------------------------------------------------------
  767.   # * Get Basic Maximum SP
  768.   #--------------------------------------------------------------------------
  769.   def base_maxsp
  770.     return $data_actors[@actor_id].parameters[1, @level]
  771.   end
  772.   #--------------------------------------------------------------------------
  773.   # * Get Basic Strength
  774.   #--------------------------------------------------------------------------
  775.   def base_str
  776.     n = $data_actors[@actor_id].parameters[2, @level]
  777.     weapon = $data_weapons[@weapon_id]
  778.     armor1 = $data_armors[@armor1_id]
  779.     armor2 = $data_armors[@armor2_id]
  780.     armor3 = $data_armors[@armor3_id]
  781.     armor4 = $data_armors[@armor4_id]
  782.     n += weapon != nil ? weapon.str_plus : 0
  783.     n += armor1 != nil ? armor1.str_plus : 0
  784.     n += armor2 != nil ? armor2.str_plus : 0
  785.     n += armor3 != nil ? armor3.str_plus : 0
  786.     n += armor4 != nil ? armor4.str_plus : 0
  787.     return [[n, 1].max, 999].min
  788.   end
  789.   #--------------------------------------------------------------------------
  790.   # * Get Basic Dexterity
  791.   #--------------------------------------------------------------------------
  792.   def base_dex
  793.     n = $data_actors[@actor_id].parameters[3, @level]
  794.     weapon = $data_weapons[@weapon_id]
  795.     armor1 = $data_armors[@armor1_id]
  796.     armor2 = $data_armors[@armor2_id]
  797.     armor3 = $data_armors[@armor3_id]
  798.     armor4 = $data_armors[@armor4_id]
  799.     n += weapon != nil ? weapon.dex_plus : 0
  800.     n += armor1 != nil ? armor1.dex_plus : 0
  801.     n += armor2 != nil ? armor2.dex_plus : 0
  802.     n += armor3 != nil ? armor3.dex_plus : 0
  803.     n += armor4 != nil ? armor4.dex_plus : 0
  804.     return [[n, 1].max, 999].min
  805.   end
  806.   #--------------------------------------------------------------------------
  807.   # * Get Basic Agility
  808.   #--------------------------------------------------------------------------
  809.   def base_agi
  810.     n = $data_actors[@actor_id].parameters[4, @level]
  811.     weapon = $data_weapons[@weapon_id]
  812.     armor1 = $data_armors[@armor1_id]
  813.     armor2 = $data_armors[@armor2_id]
  814.     armor3 = $data_armors[@armor3_id]
  815.     armor4 = $data_armors[@armor4_id]
  816.     n += weapon != nil ? weapon.agi_plus : 0
  817.     n += armor1 != nil ? armor1.agi_plus : 0
  818.     n += armor2 != nil ? armor2.agi_plus : 0
  819.     n += armor3 != nil ? armor3.agi_plus : 0
  820.     n += armor4 != nil ? armor4.agi_plus : 0
  821.     return [[n, 1].max, 999].min
  822.   end
  823.   #--------------------------------------------------------------------------
  824.   # * Get Basic Intelligence
  825.   #--------------------------------------------------------------------------
  826.   def base_int
  827.     n = $data_actors[@actor_id].parameters[5, @level]
  828.     weapon = $data_weapons[@weapon_id]
  829.     armor1 = $data_armors[@armor1_id]
  830.     armor2 = $data_armors[@armor2_id]
  831.     armor3 = $data_armors[@armor3_id]
  832.     armor4 = $data_armors[@armor4_id]
  833.     n += weapon != nil ? weapon.int_plus : 0
  834.     n += armor1 != nil ? armor1.int_plus : 0
  835.     n += armor2 != nil ? armor2.int_plus : 0
  836.     n += armor3 != nil ? armor3.int_plus : 0
  837.     n += armor4 != nil ? armor4.int_plus : 0
  838.     return [[n, 1].max, 999].min
  839.   end
  840.   #--------------------------------------------------------------------------
  841.   # * Get Basic Attack Power
  842.   #--------------------------------------------------------------------------
  843.   def base_atk
  844.     weapon = $data_weapons[@weapon_id]
  845.     return weapon != nil ? weapon.atk : 0
  846.   end
  847.   #--------------------------------------------------------------------------
  848.   # * Get Basic Physical Defense
  849.   #--------------------------------------------------------------------------
  850.   def base_pdef
  851.     weapon = $data_weapons[@weapon_id]
  852.     armor1 = $data_armors[@armor1_id]
  853.     armor2 = $data_armors[@armor2_id]
  854.     armor3 = $data_armors[@armor3_id]
  855.     armor4 = $data_armors[@armor4_id]
  856.     pdef1 = weapon != nil ? weapon.pdef : 0
  857.     pdef2 = armor1 != nil ? armor1.pdef : 0
  858.     pdef3 = armor2 != nil ? armor2.pdef : 0
  859.     pdef4 = armor3 != nil ? armor3.pdef : 0
  860.     pdef5 = armor4 != nil ? armor4.pdef : 0
  861.     return pdef1 + pdef2 + pdef3 + pdef4 + pdef5
  862.   end
  863.   #--------------------------------------------------------------------------
  864.   # * Get Basic Magic Defense
  865.   #--------------------------------------------------------------------------
  866.   def base_mdef
  867.     weapon = $data_weapons[@weapon_id]
  868.     armor1 = $data_armors[@armor1_id]
  869.     armor2 = $data_armors[@armor2_id]
  870.     armor3 = $data_armors[@armor3_id]
  871.     armor4 = $data_armors[@armor4_id]
  872.     mdef1 = weapon != nil ? weapon.mdef : 0
  873.     mdef2 = armor1 != nil ? armor1.mdef : 0
  874.     mdef3 = armor2 != nil ? armor2.mdef : 0
  875.     mdef4 = armor3 != nil ? armor3.mdef : 0
  876.     mdef5 = armor4 != nil ? armor4.mdef : 0
  877.     return mdef1 + mdef2 + mdef3 + mdef4 + mdef5
  878.   end
  879.   #--------------------------------------------------------------------------
  880.   # * Get Basic Evasion Correction
  881.   #--------------------------------------------------------------------------
  882.   def base_eva
  883.     armor1 = $data_armors[@armor1_id]
  884.     armor2 = $data_armors[@armor2_id]
  885.     armor3 = $data_armors[@armor3_id]
  886.     armor4 = $data_armors[@armor4_id]
  887.     eva1 = armor1 != nil ? armor1.eva : 0
  888.     eva2 = armor2 != nil ? armor2.eva : 0
  889.     eva3 = armor3 != nil ? armor3.eva : 0
  890.     eva4 = armor4 != nil ? armor4.eva : 0
  891.     return eva1 + eva2 + eva3 + eva4
  892.   end
  893.   #--------------------------------------------------------------------------
  894.   # * Get Offensive Animation ID for Normal Attacks
  895.   #--------------------------------------------------------------------------
  896.   def animation1_id
  897.     weapon = $data_weapons[@weapon_id]
  898.     return weapon != nil ? weapon.animation1_id : 0
  899.   end
  900.   #--------------------------------------------------------------------------
  901.   # * Get Target Animation ID for Normal Attacks
  902.   #--------------------------------------------------------------------------
  903.   def animation2_id
  904.     weapon = $data_weapons[@weapon_id]
  905.     return weapon != nil ? weapon.animation2_id : 0
  906.   end
  907.   #--------------------------------------------------------------------------
  908.   # * Get Class Name
  909.   #--------------------------------------------------------------------------
  910.   def class_name
  911.     return $data_classes[@class_id].name
  912.   end
  913.   #--------------------------------------------------------------------------
  914.   # * Get EXP String
  915.   #--------------------------------------------------------------------------
  916.   def exp_s
  917.     return @exp.to_s
  918.   end
  919.  
  920.   #--------------------------------------------------------------------------
  921.   # * Update Auto State
  922.   #     old_armor : unequipped armor
  923.   #     new_armor : equipped armor
  924.   #--------------------------------------------------------------------------
  925.   def update_auto_state(old_armor, new_armor)
  926.     # Forcefully remove unequipped armor's auto state
  927.     if old_armor != nil and old_armor.auto_state_id != 0
  928.       remove_state(old_armor.auto_state_id, true)
  929.     end
  930.     # Forcefully add unequipped armor's auto state
  931.     if new_armor != nil and new_armor.auto_state_id != 0
  932.       add_state(new_armor.auto_state_id, true)
  933.     end
  934.   end
  935.   #--------------------------------------------------------------------------
  936.   # * Determine Fixed Equipment
  937.   #     equip_type : type of equipment
  938.   #--------------------------------------------------------------------------
  939.   def equip_fix?(equip_type)
  940.     case equip_type
  941.     when 0  # Weapon
  942.       return $data_actors[@actor_id].weapon_fix
  943.     when 1  # Shield
  944.       return $data_actors[@actor_id].armor1_fix
  945.     when 2  # Head
  946.       return $data_actors[@actor_id].armor2_fix
  947.     when 3  # Body
  948.       return $data_actors[@actor_id].armor3_fix
  949.     when 4  # Accessory
  950.       return $data_actors[@actor_id].armor4_fix
  951.     end
  952.     return false
  953.   end
  954.   #--------------------------------------------------------------------------
  955.   # * Change Equipment
  956.   #     equip_type : type of equipment
  957.   #     id    : weapon or armor ID (If 0, remove equipment)
  958.   #--------------------------------------------------------------------------
  959.   def equip(equip_type, id)
  960.     case equip_type
  961.     when 0  # Weapon
  962.       if id == 0 or $game_party.weapon_number(id) > 0
  963.         $game_party.gain_weapon(@weapon_id, 1)
  964.         @weapon_id = id
  965.         $game_party.lose_weapon(id, 1)
  966.       end
  967.     when 1  # Shield
  968.       if id == 0 or $game_party.armor_number(id) > 0
  969.         update_auto_state($data_armors[@armor1_id], $data_armors[id])
  970.         $game_party.gain_armor(@armor1_id, 1)
  971.         @armor1_id = id
  972.         $game_party.lose_armor(id, 1)
  973.       end
  974.     when 2  # Head
  975.       if id == 0 or $game_party.armor_number(id) > 0
  976.         update_auto_state($data_armors[@armor2_id], $data_armors[id])
  977.         $game_party.gain_armor(@armor2_id, 1)
  978.         @armor2_id = id
  979.         $game_party.lose_armor(id, 1)
  980.       end
  981.     when 3  # Body
  982.       if id == 0 or $game_party.armor_number(id) > 0
  983.         update_auto_state($data_armors[@armor3_id], $data_armors[id])
  984.         $game_party.gain_armor(@armor3_id, 1)
  985.         @armor3_id = id
  986.         $game_party.lose_armor(id, 1)
  987.       end
  988.     when 4  # Accessory
  989.       if id == 0 or $game_party.armor_number(id) > 0
  990.         update_auto_state($data_armors[@armor4_id], $data_armors[id])
  991.         $game_party.gain_armor(@armor4_id, 1)
  992.         @armor4_id = id
  993.         $game_party.lose_armor(id, 1)
  994.       end
  995.     end
  996.   end
  997.   #--------------------------------------------------------------------------
  998.   # * Determine if Equippable
  999.   #     item : item
  1000.   #--------------------------------------------------------------------------
  1001.   def equippable?(item)
  1002.     # If weapon
  1003.     if item.is_a?(RPG::Weapon)
  1004.       weapon_set = $data_classes[@class_id].weapon_set
  1005.       weapon_set = @board.weapon_set | weapon_set
  1006.       # If included among equippable weapons in current class and board
  1007.       if weapon_set.include?(item.id)
  1008.         return true
  1009.       end
  1010.     end
  1011.     # If armor
  1012.     if item.is_a?(RPG::Armor)
  1013.       armor_set = $data_classes[@class_id].armor_set
  1014.       armor_set = @board.armor_set | armor_set
  1015.       # If included among equippable armor in current class and board
  1016.       if armor_set.include?(item.id)
  1017.         return true
  1018.       end
  1019.     end
  1020.     return false
  1021.   end
  1022.   #--------------------------------------------------------------------------
  1023.   # * Change EXP
  1024.   #     exp : new EXP
  1025.   #--------------------------------------------------------------------------
  1026.   def exp=(exp)
  1027.     @exp = [[exp, 9999999].min, 0].max
  1028.     # Level up
  1029.     while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  1030.       @level += 1
  1031.       # Learn skill
  1032.       for j in $data_classes[@class_id].learnings
  1033.         if j.level == @level
  1034.           learn_skill(j.skill_id)
  1035.         end
  1036.       end
  1037.     end
  1038.     # Level down
  1039.     while @exp < @exp_list[@level]
  1040.       @level -= 1
  1041.     end
  1042.     # Correction if exceeding current max HP and max SP
  1043.     @hp = [@hp, self.maxhp].min
  1044.     @sp = [@sp, self.maxsp].min
  1045.   end
  1046.   #--------------------------------------------------------------------------
  1047.   # * Change Level
  1048.   #     level : new level
  1049.   #--------------------------------------------------------------------------
  1050.   def level=(level)
  1051.     # Check up and down limits
  1052.     level = [[level, $data_actors[@actor_id].final_level].min, 1].max
  1053.     # Change EXP
  1054.     self.exp = @exp_list[level]
  1055.   end
  1056.   #--------------------------------------------------------------------------
  1057.   # * Skills
  1058.   #--------------------------------------------------------------------------
  1059.   def skills
  1060.     @board.skills.sort!
  1061.     skills = @board.skills | @skills
  1062.     return skills
  1063.   end
  1064.   #--------------------------------------------------------------------------
  1065.   # * Learn Skill
  1066.   #     skill_id : skill ID
  1067.   #--------------------------------------------------------------------------
  1068.   def learn_skill(skill_id)
  1069.     if skill_id > 0 and not skill_learn?(skill_id)
  1070.       @skills.push(skill_id)
  1071.       @skills.sort!
  1072.     end
  1073.   end
  1074.   #--------------------------------------------------------------------------
  1075.   # * Forget Skill
  1076.   #     skill_id : skill ID
  1077.   #--------------------------------------------------------------------------
  1078.   def forget_skill(skill_id)
  1079.     @skills.delete(skill_id)
  1080.   end
  1081.   #--------------------------------------------------------------------------
  1082.   # * Determine if Finished Learning Skill
  1083.   #     skill_id : skill ID
  1084.   #--------------------------------------------------------------------------
  1085.   def skill_learn?(skill_id)
  1086.     return (@skills + @board.skills).include?(skill_id)
  1087.   end
  1088.   #--------------------------------------------------------------------------
  1089.   # * Determine if Skill can be Used
  1090.   #     skill_id : skill ID
  1091.   #--------------------------------------------------------------------------
  1092.   def skill_can_use?(skill_id)
  1093.     if not skill_learn?(skill_id)
  1094.       return false
  1095.     end
  1096.     return super
  1097.   end
  1098.   #--------------------------------------------------------------------------
  1099.   # * Change Name
  1100.   #     name : new name
  1101.   #--------------------------------------------------------------------------
  1102.   def name=(name)
  1103.     @name = name
  1104.   end
  1105.   #--------------------------------------------------------------------------
  1106.   # * Change Class ID
  1107.   #     class_id : new class ID
  1108.   #--------------------------------------------------------------------------
  1109.   def class_id=(class_id)
  1110.     if $data_classes[class_id] != nil
  1111.       @class_id = class_id
  1112.       # Remove items that are no longer equippable
  1113.       unless equippable?($data_weapons[@weapon_id])
  1114.         equip(0, 0)
  1115.       end
  1116.       unless equippable?($data_armors[@armor1_id])
  1117.         equip(1, 0)
  1118.       end
  1119.       unless equippable?($data_armors[@armor2_id])
  1120.         equip(2, 0)
  1121.       end
  1122.       unless equippable?($data_armors[@armor3_id])
  1123.         equip(3, 0)
  1124.       end
  1125.       unless equippable?($data_armors[@armor4_id])
  1126.         equip(4, 0)
  1127.       end
  1128.     end
  1129.   end
  1130.   #--------------------------------------------------------------------------
  1131.   # * Change Graphics
  1132.   #     character_name : new character file name
  1133.   #     character_hue  : new character hue
  1134.   #     battler_name   : new battler file name
  1135.   #     battler_hue    : new battler hue
  1136.   #--------------------------------------------------------------------------
  1137.   def set_graphic(character_name, character_hue, battler_name, battler_hue)
  1138.     @character_name = character_name
  1139.     @character_hue = character_hue
  1140.     @battler_name = battler_name
  1141.     @battler_hue = battler_hue
  1142.   end
  1143.   #--------------------------------------------------------------------------
  1144.   # * Get Battle Screen X-Coordinate
  1145.   #--------------------------------------------------------------------------
  1146.   def screen_x
  1147.     # Return after calculating x-coordinate by order of members in party
  1148.     if self.index != nil
  1149.       return self.index * 160 + 80
  1150.     else
  1151.       return 0
  1152.     end
  1153.   end
  1154.   #--------------------------------------------------------------------------
  1155.   # * Get Battle Screen Y-Coordinate
  1156.   #--------------------------------------------------------------------------
  1157.   def screen_y
  1158.     return 464
  1159.   end
  1160.   #--------------------------------------------------------------------------
  1161.   # * Get Battle Screen Z-Coordinate
  1162.   #--------------------------------------------------------------------------
  1163.   def screen_z
  1164.     # Return after calculating z-coordinate by order of members in party
  1165.     if self.index != nil
  1166.       return 4 - self.index
  1167.     else
  1168.       return 0
  1169.     end
  1170.   end
  1171. end
  1172.  
  1173. #==============================================================================
  1174. # ** Game_Party
  1175. #------------------------------------------------------------------------------
  1176. #  This class handles the party. It includes information on amount of gold
  1177. #  and items. Refer to "$game_party" for the instance of this class.
  1178. #==============================================================================
  1179.  
  1180. class Game_Party
  1181.   #--------------------------------------------------------------------------
  1182.   # * Invariables
  1183.   #--------------------------------------------------------------------------
  1184.   include FFXII                           # FFXII module
  1185.   #--------------------------------------------------------------------------
  1186.   # * Public Instance Variables
  1187.   #--------------------------------------------------------------------------
  1188.   attr_reader   :actors                   # actors
  1189.   attr_reader   :gold                     # amount of gold
  1190.   attr_reader   :steps                    # number of steps
  1191.   #--------------------------------------------------------------------------
  1192.   # * Add an Actor
  1193.   #     actor_id : actor ID
  1194.   #--------------------------------------------------------------------------
  1195.   def add_actor(actor_id)
  1196.     # Get actor
  1197.     actor = $game_actors[actor_id]
  1198.     # If the party has less than 4 members and this actor is not in the party
  1199.     if @actors.size < ACTOR_MAX and not @actors.include?(actor)
  1200.       # Add actor
  1201.       @actors.push(actor)
  1202.       # Refresh player
  1203.       $game_player.refresh
  1204.     end
  1205.   end
  1206. end
  1207.  
  1208. #==============================================================================
  1209. # ** Animated_Sprite
  1210. #------------------------------------------------------------------------------
  1211. #  This sprite is used to display an animated image. It observes a superclass
  1212. #  and automatically changes sprite conditions.
  1213. #==============================================================================
  1214.  
  1215. class Animated_Sprite < RPG::Sprite
  1216.   #--------------------------------------------------------------------------
  1217.   # * Public Instance Variables
  1218.   #--------------------------------------------------------------------------
  1219.   attr_reader   :frames                   # frames total
  1220.   attr_reader   :bitmap                   # bitmap
  1221.   attr_accessor :frame                    # frame ID
  1222.   attr_accessor :wait                     # frame delay
  1223.   #--------------------------------------------------------------------------
  1224.   # * Object Initialization
  1225.   #     bitmap   : bitmap
  1226.   #     x        : draw spot x-coordinate
  1227.   #     y        : draw spot y-coordinate
  1228.   #     columns  : columns
  1229.   #     rows     : rows
  1230.   #     wait     : frame delay
  1231.   #     viewport : viewport
  1232.   #--------------------------------------------------------------------------
  1233.   def initialize(bitmap, x, y, columns, rows, frames,
  1234.                  blend_type = 0, wait = 1, viewport = nil)
  1235.     super(viewport)
  1236.     @bitmap = bitmap
  1237.     @ox, @oy = x, y
  1238.     @columns = columns
  1239.     @rows = rows
  1240.     @frames = frames
  1241.     self.blend_type = blend_type
  1242.     @wait = wait
  1243.     @counter = wait
  1244.     @frame = 0
  1245.     update
  1246.   end
  1247.   #--------------------------------------------------------------------------
  1248.   # * Frame Update
  1249.   #--------------------------------------------------------------------------
  1250.   def update
  1251.     super
  1252.     if ready?
  1253.       self.bitmap = @bitmap
  1254.       self.x = @ox
  1255.       self.y = @oy
  1256.       cw = @bitmap.width / @columns
  1257.       ch = @bitmap.height / @rows
  1258.       self.src_rect.set(0, 0, cw, ch)
  1259.       sx = (@frame % @columns) * cw
  1260.       sy = (@frame / @columns) * ch
  1261.       self.src_rect.set(sx, sy, cw, ch)
  1262.       @counter = 0
  1263.     else
  1264.       @counter += 1
  1265.     end
  1266.   end
  1267.   #--------------------------------------------------------------------------
  1268.   # * Ready?
  1269.   #--------------------------------------------------------------------------
  1270.   def ready?
  1271.     return @counter >= @wait
  1272.   end
  1273. end
  1274.  
  1275. #==============================================================================
  1276. # ** Dynamic_Sprite
  1277. #------------------------------------------------------------------------------
  1278. #  This sprite is used to display a moving image. It observes a superclass
  1279. #  and automatically changes sprite conditions.
  1280. #==============================================================================
  1281.  
  1282. class Dynamic_Sprite < RPG::Sprite
  1283.   #--------------------------------------------------------------------------
  1284.   # * Public Instance Variables
  1285.   #--------------------------------------------------------------------------
  1286.   attr_accessor :true_x                   # true x
  1287.   attr_accessor :true_y                   # true y
  1288.   attr_accessor :true_zoom_x              # true zoom x
  1289.   attr_accessor :true_zoom_y              # true zoom y
  1290.   attr_accessor :true_opacity             # true opacity
  1291.   attr_accessor :speed                    # speed
  1292.   #--------------------------------------------------------------------------
  1293.   # * Object Initialization
  1294.   #     viewport : viewport
  1295.   #--------------------------------------------------------------------------
  1296.   def initialize(viewport = nil)
  1297.     super(viewport)
  1298.     @true_x = 0
  1299.     @true_y = 0
  1300.     @true_zoom_x = 1.00
  1301.     @true_zoom_y = 1.00
  1302.     @true_opacity = 255
  1303.     @speed = 5
  1304.   end
  1305.   #--------------------------------------------------------------------------
  1306.   # * Frame Update
  1307.   #--------------------------------------------------------------------------
  1308.   def update
  1309.     super
  1310.     if self.y < @true_y
  1311.       n = (@true_y - self.y) / @speed
  1312.       n = 1 if n == 0
  1313.       self.y += n
  1314.     elsif self.y > @true_y
  1315.       n = (self.y - @true_y) / @speed
  1316.       n = 1 if n == 0
  1317.       self.y -= n
  1318.     end
  1319.     if self.x < @true_x
  1320.       n = (@true_x - self.x) / @speed
  1321.       n = 1 if n == 0
  1322.       self.x += n
  1323.     elsif self.x > @true_x
  1324.       n = (self.x - @true_x) / @speed
  1325.       n = 1 if n == 0
  1326.       self.x -= n
  1327.     end
  1328.     if self.zoom_y < @true_zoom_y
  1329.       n = (@true_zoom_y - self.zoom_y) / @speed
  1330.       n = 1 if n == 0
  1331.       self.zoom_y += n
  1332.     elsif self.zoom_y > @true_zoom_y
  1333.       n = (self.zoom_y - @true_zoom_y) / @speed
  1334.       n = 1 if n == 0
  1335.       self.zoom_y -= n
  1336.     end
  1337.     if self.zoom_x < @true_zoom_x
  1338.       n = (@true_zoom_x - self.zoom_x) / @speed
  1339.       n = 1 if n == 0
  1340.       self.zoom_x += n
  1341.     elsif self.zoom_x > @true_zoom_x
  1342.       n = (self.zoom_x - @true_zoom_x) / @speed
  1343.       n = 1 if n == 0
  1344.       self.zoom_x -= n
  1345.     end
  1346.     if self.opacity < @true_opacity
  1347.       n = (@true_opacity - self.opacity) / @speed
  1348.       n = 1 if n == 0
  1349.       self.opacity += n
  1350.     elsif self.opacity > @true_opacity
  1351.       n = (self.opacity - @true_opacity) / @speed
  1352.       n = 1 if n == 0
  1353.       self.opacity -= n
  1354.     end
  1355.   end
  1356. end
  1357.  
  1358. #==============================================================================
  1359. # ** Sprite_AvailableLP
  1360. #------------------------------------------------------------------------------
  1361. #  This sprite is used to display available LP. It observes the Scene_Board
  1362. #  class and automatically changes sprite conditions.
  1363. #==============================================================================
  1364.  
  1365. class Sprite_AvailableLP < RPG::Sprite
  1366.   #--------------------------------------------------------------------------
  1367.   # * Invariables
  1368.   #--------------------------------------------------------------------------
  1369.   include FFXII                           # FFXII module
  1370.   #--------------------------------------------------------------------------
  1371.   # * Object Initialization
  1372.   #     actor    : actor
  1373.   #     board    : board
  1374.   #     viewport : viewport
  1375.   #--------------------------------------------------------------------------
  1376.   def initialize(actor, board, viewport = nil)
  1377.     super(viewport)
  1378.     self.bitmap = STATUS.dup
  1379.     @actor = actor
  1380.     @board = board
  1381.     $ap = @actor.ap
  1382.     self.y = 15
  1383.     refresh
  1384.   end
  1385.   #--------------------------------------------------------------------------
  1386.   # * Refresh
  1387.   #--------------------------------------------------------------------------
  1388.   def refresh
  1389.     self.bitmap.clear
  1390.     self.bitmap = STATUS.dup
  1391.     self.bitmap.draw_actor_name(  @actor, 72, -5)
  1392.     self.bitmap.draw_actor_ap(    @actor, 71, 15)
  1393.     self.bitmap.draw_actor_avatar(@actor, 12, 0)
  1394.   end
  1395.   #--------------------------------------------------------------------------
  1396.   # * Frame Update
  1397.   #--------------------------------------------------------------------------
  1398.   def update
  1399.     super
  1400.     if @actor.ap != @ap
  1401.       @ap = @actor.ap
  1402.       refresh
  1403.     end
  1404.   end
  1405. end
  1406.  
  1407. #==============================================================================
  1408. # ** Sprite_BoardHelp
  1409. #------------------------------------------------------------------------------
  1410. #  This sprite is used to display board help. It observes the Scene_Board
  1411. #  class and automatically changes sprite conditions.
  1412. #==============================================================================
  1413.  
  1414. class Sprite_LicenseDescription < Dynamic_Sprite
  1415.   #--------------------------------------------------------------------------
  1416.   # * Invariables
  1417.   #--------------------------------------------------------------------------
  1418.   include FFXII                           # FFXII module
  1419.   #--------------------------------------------------------------------------
  1420.   # * Object Initialization
  1421.   #     cursor    : cursor
  1422.   #     board     : board
  1423.   #     edit_mode : edit mode ON
  1424.   #     viewport  : viewport
  1425.   #--------------------------------------------------------------------------
  1426.   def initialize(cursor, board, edit_mode = false, viewport = nil)
  1427.     super(viewport)
  1428.     self.bitmap = HELP.dup
  1429.     @cursor = cursor
  1430.     @board = board
  1431.     @edit_mode = edit_mode
  1432.     @ox, @oy = @cursor.tile_x, @cursor.tile_y
  1433.     self.y = 370
  1434.     self.opacity = 0
  1435.     refresh
  1436.   end
  1437.   #--------------------------------------------------------------------------
  1438.   # * Refresh
  1439.   #--------------------------------------------------------------------------
  1440.   def refresh
  1441.     self.bitmap.clear
  1442.     self.bitmap = HELP.dup
  1443.     x, y = @cursor.tile_x, @cursor.tile_y
  1444.     hue = CATEGORY_HUE[@board.type?(x, y)]
  1445.     self.bitmap.draw_board_category(   @board, x, y, 28,  20, hue)
  1446.     self.bitmap.draw_board_ap(         @board, x, y, 55,  16)
  1447.     self.bitmap.draw_board_activated(  @board, x, y, 114, 18,    @edit_mode)
  1448.     self.bitmap.draw_board_class(      @board, x, y, 138, 16)
  1449.     self.bitmap.draw_board_item(       @board, x, y, 62,  42, 0, @edit_mode)
  1450.     self.bitmap.draw_board_item(       @board, x, y, 312, 42, 1, @edit_mode)
  1451.     self.bitmap.draw_board_item(       @board, x, y, 62,  63, 2, @edit_mode)
  1452.     self.bitmap.draw_board_item(       @board, x, y, 312, 63, 3, @edit_mode)
  1453.     self.bitmap.draw_board_description(@board, x, y, 90,  42,    @edit_mode)
  1454.   end
  1455.   #--------------------------------------------------------------------------
  1456.   # * Frame Update
  1457.   #--------------------------------------------------------------------------
  1458.   def update
  1459.     super
  1460.     if [@cursor.tile_x, @cursor.tile_y] != [@ox, @oy]
  1461.       @ox, @oy = @cursor.tile_x, @cursor.tile_y
  1462.       refresh
  1463.     end
  1464.   end
  1465. end
  1466.  
  1467. #==============================================================================
  1468. # ** Cursor_Base
  1469. #------------------------------------------------------------------------------
  1470. #  This sprite is used to display the cursor. It observes a superclass
  1471. #  and automatically changes sprite conditions.
  1472. #==============================================================================
  1473.  
  1474. class Sprite_Cursor < Dynamic_Sprite
  1475.   #--------------------------------------------------------------------------
  1476.   # * Invariables
  1477.   #--------------------------------------------------------------------------
  1478.   include FFXII                           # FFXII module
  1479.   #--------------------------------------------------------------------------
  1480.   # * Object Initialization
  1481.   #     viewport : viewport
  1482.   #--------------------------------------------------------------------------
  1483.   def initialize(viewport = nil)
  1484.     super(viewport)
  1485.     self.bitmap = CURSOR
  1486.   end
  1487. end
  1488.  
  1489. #==============================================================================
  1490. # ** Spriteset_Board
  1491. #------------------------------------------------------------------------------
  1492. #  This class brings together the board tiles, icons and active slots.
  1493. #  It's used within the Scene_Board class.
  1494. #==============================================================================
  1495.  
  1496. class Spriteset_Board
  1497.   #--------------------------------------------------------------------------
  1498.   # * Invariables
  1499.   #--------------------------------------------------------------------------
  1500.   include FFXII                           # FFXII module
  1501.   #--------------------------------------------------------------------------
  1502.   # * Public Instance Variables
  1503.   #--------------------------------------------------------------------------
  1504.   attr_accessor :tiles                    # tiles
  1505.   attr_accessor :icons                    # icons
  1506.   attr_accessor :active                   # active
  1507.   #--------------------------------------------------------------------------
  1508.   # * Object Initialization
  1509.   #     board     : board
  1510.   #     edit_mode : edit mode ON
  1511.   #--------------------------------------------------------------------------
  1512.   def initialize(board, edit_mode = false)
  1513.     @board = board
  1514.     @edit_mode = edit_mode
  1515.     @bg = Plane.new
  1516.     @bg.bitmap = BOARD_BG
  1517.     @xs, @ys = TILE_X_SIZE, TILE_Y_SIZE
  1518.     @tiles = Dynamic_Sprite.new
  1519.     @tiles.bitmap = Bitmap.new(@board.xsize * @xs, @board.ysize * @ys)
  1520.     @icons = Dynamic_Sprite.new
  1521.     @icons.bitmap = Bitmap.new(@board.xsize * @xs, @board.ysize * @ys)
  1522.     @icons.blink_on
  1523.     @active = Dynamic_Sprite.new
  1524.     @active.bitmap = Bitmap.new(@board.xsize * @xs, @board.ysize * @ys)
  1525.     refresh
  1526.   end
  1527.   #--------------------------------------------------------------------------
  1528.   # * Refresh
  1529.   #--------------------------------------------------------------------------
  1530.   def refresh
  1531.     @tiles.bitmap.clear
  1532.     @icons.bitmap.clear
  1533.     @active.bitmap.clear
  1534.     for x in [email hidden]
  1535.       for y in [email hidden]
  1536.         @tiles.bitmap.draw_board_tile(@board, x, y)
  1537.         @icons.bitmap.draw_board_icon(@board, x, y, @edit_mode)
  1538.         @active.bitmap.draw_board_active(@board, x, y, @edit_mode)
  1539.       end
  1540.     end
  1541.   end
  1542.   #--------------------------------------------------------------------------
  1543.   # * Dispose
  1544.   #--------------------------------------------------------------------------
  1545.   def dispose
  1546.     @bg.dispose
  1547.     @tiles.dispose
  1548.     @icons.dispose
  1549.     @active.dispose
  1550.   end
  1551.   #--------------------------------------------------------------------------
  1552.   # * Frame Update
  1553.   #--------------------------------------------------------------------------
  1554.   def update
  1555.     @tiles.update
  1556.     @icons.update
  1557.     @active.update
  1558.   end
  1559. end
  1560.  
  1561. #==============================================================================
  1562. # ** Bitmap
  1563. #------------------------------------------------------------------------------
  1564. #  The bitmap class. Bitmaps are expressions of so-called graphics.
  1565. #  Sprites and other objects must be used to display bitmaps on the screen.
  1566. #==============================================================================
  1567.  
  1568. class Bitmap
  1569.   #--------------------------------------------------------------------------
  1570.   # * Invariables
  1571.   #--------------------------------------------------------------------------
  1572.   include FFXII                           # FFXII module
  1573.   #--------------------------------------------------------------------------
  1574.   # * Draw Actor Name
  1575.   #     actor : actor
  1576.   #     x     : draw spot x-coordinate
  1577.   #     y     : draw spot y-coordinate
  1578.   #--------------------------------------------------------------------------
  1579.   def draw_actor_name(actor, x, y)
  1580.     self.draw_outline(x, y, 120, 32, actor.name)
  1581.   end
  1582.   #--------------------------------------------------------------------------
  1583.   # * Draw Actor AP
  1584.   #     actor : actor
  1585.   #     x     : draw spot x-coordinate
  1586.   #     y     : draw spot y-coordinate
  1587.   #     width : draw spot width
  1588.   #--------------------------------------------------------------------------
  1589.   def draw_actor_ap(actor, x, y, width = 78)
  1590.     color = Color.new(204, 204, 153)
  1591.     text = LP
  1592.     self.draw_outline(x, y, 32, 32, text, 0, color)
  1593.     ap_x = x + width - 48
  1594.     ap = actor.ap.to_s
  1595.     self.draw_outline(ap_x, y, 48, 32, ap, 2, color)
  1596.   end
  1597.   #--------------------------------------------------------------------------
  1598.   # * Draw Actor Avatar
  1599.   #     actor : actor
  1600.   #     x     : draw spot x-coordinate
  1601.   #     y     : draw spot y-coordinate
  1602.   #--------------------------------------------------------------------------
  1603.   def draw_actor_avatar(actor, x, y)
  1604.     rect = Rect.new(0, 0, 60, 60)
  1605.     avatar = AVATAR(actor.id)
  1606.     self.blt(x, y, avatar, rect)
  1607.   end
  1608.   #--------------------------------------------------------------------------
  1609.   # * Draw Actor Minimap
  1610.   #     actor : actor
  1611.   #     x     : draw spot x-coordinate
  1612.   #     y     : draw spot y-coordinate
  1613.   #--------------------------------------------------------------------------
  1614.   def draw_actor_minimap(actor, x, y)
  1615.     bitmap = Bitmap_MiniBoard.new(actor.board)
  1616.     rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  1617.     self.blt(x, y, bitmap, rect)
  1618.   end
  1619.   #--------------------------------------------------------------------------
  1620.   # * Draw Board Category
  1621.   #     board : board
  1622.   #     bx    : board x-coordinate
  1623.   #     by    : board y-coordinate
  1624.   #     x     : draw spot x-coordinate
  1625.   #     y     : draw spot y-coordinate
  1626.   #     hue   : hue
  1627.   #--------------------------------------------------------------------------
  1628.   def draw_board_category(board, bx, by, x, y, hue = 0)
  1629.     if board.ap_cost?(bx, by) > 0
  1630.       bitmap = Bitmap.new(26, 26)
  1631.       rect = Rect.new(0, 0, 26, 26)
  1632.       bitmap.blt(0, 0, CATEGORY, rect)
  1633.       bitmap.hue_change(hue)
  1634.       self.blt(x, y, bitmap, rect)
  1635.     end
  1636.   end
  1637.   #--------------------------------------------------------------------------
  1638.   # * Draw Board AP
  1639.   #     board : board
  1640.   #     bx    : board x-coordinate
  1641.   #     by    : board y-coordinate
  1642.   #     x     : draw spot x-coordinate
  1643.   #     y     : draw spot y-coordinate
  1644.   #     width : draw spot width
  1645.   #--------------------------------------------------------------------------
  1646.   def draw_board_ap(board, bx, by, x, y, width = 56)
  1647.     if board.ap_cost?(bx, by) > 0
  1648.       color = Color.new(204, 204, 153)
  1649.       text = LP
  1650.       self.draw_outline(x, y, 32, 32, text, 0, color)
  1651.       ap_x = x + width - 48
  1652.       ap = board.ap_cost?(bx, by).to_s
  1653.       self.draw_outline(ap_x, y, 48, 32, ap, 2, color)
  1654.     end
  1655.   end
  1656.   #--------------------------------------------------------------------------
  1657.   # * Draw Board Activated
  1658.   #     board     : board
  1659.   #     bx        : board x-coordinate
  1660.   #     by        : board y-coordinate
  1661.   #     x         : draw spot x-coordinate
  1662.   #     y         : draw spot y-coordinate
  1663.   #     edit_mode : edit mode ON
  1664.   #--------------------------------------------------------------------------
  1665.   def draw_board_activated(board, bx, by, x, y, edit_mode = false)
  1666.     if board.activated?(bx, by) or edit_mode and board.visible?(bx, by)
  1667.       bitmap = Bitmap.new(24, 24)
  1668.       rect = Rect.new(0, 0, 24, 24)
  1669.       bitmap.blt(0, 0, STAR, rect)
  1670.       self.blt(x, y, bitmap, rect)
  1671.     end
  1672.   end
  1673.   #--------------------------------------------------------------------------
  1674.   # * Draw Board Class
  1675.   #     board : board
  1676.   #     bx    : board x-coordinate
  1677.   #     by    : board y-coordinate
  1678.   #     x     : draw spot x-coordinate
  1679.   #     y     : draw spot y-coordinate
  1680.   #     width : draw spot width
  1681.   #--------------------------------------------------------------------------
  1682.   def draw_board_class(board, bx, by, x, y, width = 472)
  1683.     board_class = board.class(bx, by)
  1684.     if board_class != nil
  1685.       self.draw_outline(x, y, width, 32, board_class)
  1686.     end
  1687.   end
  1688.   #--------------------------------------------------------------------------
  1689.   # * Draw Board Item
  1690.   #     board     : board
  1691.   #     bx        : board x-coordinate
  1692.   #     by        : board y-coordinate
  1693.   #     x         : draw spot x-coordinate
  1694.   #     y         : draw spot y-coordinate
  1695.   #     n         : item number
  1696.   #     edit_mode : edit mode ON
  1697.   #     width     : draw spot width
  1698.   #--------------------------------------------------------------------------
  1699.   def draw_board_item(board, bx, by, x, y, n = 0, edit_mode = false, width = 240)
  1700.     item = board.item(bx, by, n)
  1701.     if item != nil
  1702.       if board.visible?(bx, by) or edit_mode
  1703.         bitmap = RPG::Cache.icon(item.icon_name)
  1704.         rect = Rect.new(0, 0, 24, 24)
  1705.         self.blt(x, y + 4, bitmap, rect)
  1706.         self.draw_outline(x + 28, y, 212, 32, item.name)
  1707.       else
  1708.         text = HIDDEN
  1709.         self.draw_outline(x + 28, y, 212, 32, text)
  1710.       end
  1711.     end
  1712.   end
  1713.   #--------------------------------------------------------------------------
  1714.   # * Draw Board Description
  1715.   #     board     : board
  1716.   #     bx        : board x-coordinate
  1717.   #     by        : board y-coordinate
  1718.   #     x         : draw spot x-coordinate
  1719.   #     y         : draw spot y-coordinate
  1720.   #     edit_mode : edit mode ON
  1721.   #     width     : draw spot width
  1722.   #--------------------------------------------------------------------------
  1723.   def draw_board_description(board, bx, by, x, y, edit_mode = false, width = 480)
  1724.     type = board.type?(bx, by)
  1725.     if type >= 0 and type < 8
  1726.       if board.visible?(bx, by) or edit_mode
  1727.         description = board.description(bx, by)
  1728.         self.draw_outline(x, y, width, 32, description)
  1729.       else
  1730.         text = HIDDEN
  1731.         self.draw_outline(x, y, width, 32, text)
  1732.       end
  1733.     end
  1734.   end
  1735.   #--------------------------------------------------------------------------
  1736.   # * Draw Board Tile
  1737.   #     board : board
  1738.   #     bx    : board x-coordinate
  1739.   #     by    : board y-coordinate
  1740.   #--------------------------------------------------------------------------
  1741.   def draw_board_tile(board, bx, by)
  1742.     type = board.type?(bx, by)
  1743.     if type >= 0
  1744.       xs, ys = TILE_X_SIZE, TILE_Y_SIZE
  1745.       bitmap = Bitmap.new(xs, ys)
  1746.       id = (bx + by) % 2
  1747.       rect = Rect.new(0, 0, xs, ys)
  1748.       bitmap.blt(0, 0, TILE(id), rect)
  1749.       self.blt(bx * xs, by * ys, bitmap, rect)
  1750.     end
  1751.   end
  1752.   #--------------------------------------------------------------------------
  1753.   # * Draw Board Icon
  1754.   #     board     : board
  1755.   #     bx        : board x-coordinate
  1756.   #     by        : board y-coordinate
  1757.   #     edit_mode : edit mode ON
  1758.   #--------------------------------------------------------------------------
  1759.   def draw_board_icon(board, bx, by, edit_mode)
  1760.     visible = board.visible?(bx, by)
  1761.     activated = board.activated?(bx, by)
  1762.     if visible and not activated and not edit_mode
  1763.       xs, ys = TILE_X_SIZE, TILE_Y_SIZE
  1764.       bitmap = Bitmap.new(xs, ys)
  1765.       type = board.type?(bx, by)
  1766.       rect = Rect.new(0, 0, xs, ys)
  1767.       bitmap.blt(0, 0, ICON(type), rect)
  1768.       bitmap.font.size = TILE_AP_FONT_SIZE
  1769.       ap_y = ys - bitmap.font.size - 8
  1770.       ap_cost = board.ap_cost?(bx, by).to_s
  1771.       color = Color.new(204, 204, 153)
  1772.       bitmap.draw_outline(0, ap_y, xs, ys, ap_cost, 0, color)
  1773.       bitmap.font.size = TILE_LEVEL_FONT_SIZE
  1774.       level = board.level?(bx, by)
  1775.       if level >= 0
  1776.         bitmap.draw_outline(0, -8, xs, ys, level.to_s, 2)
  1777.       end
  1778.       self.blt(bx * xs, by * ys, bitmap, rect)
  1779.     end
  1780.   end
  1781.   #--------------------------------------------------------------------------
  1782.   # * Draw Board Active
  1783.   #     board     : board
  1784.   #     bx        : board x-coordinate
  1785.   #     by        : board y-coordinate
  1786.   #     edit_mode : edit mode ON
  1787.   #--------------------------------------------------------------------------
  1788.   def draw_board_active(board, bx, by, edit_mode)
  1789.     visible = board.visible?(bx, by)
  1790.     activated = board.activated?(bx, by)
  1791.     if visible and activated or edit_mode
  1792.       xs, ys = TILE_X_SIZE, TILE_Y_SIZE
  1793.       bitmap = Bitmap.new(xs, ys)
  1794.       type = board.type?(bx, by)
  1795.       rect = Rect.new(0, 0, xs, ys)
  1796.       bitmap.blt(0, 0, ICON(type), rect)
  1797.       bitmap.font.size = TILE_LEVEL_FONT_SIZE
  1798.       level = board.level?(bx, by)
  1799.       if level >= 0
  1800.         bitmap.draw_outline(0, -8, xs, ys, level.to_s, 2)
  1801.       end
  1802.       self.blt(bx * xs, by * ys, bitmap, rect)
  1803.     end
  1804.   end
  1805.   #--------------------------------------------------------------------------
  1806.   # * Draw Board Statistics
  1807.   #     board : board
  1808.   #--------------------------------------------------------------------------
  1809.   def draw_board_statistics(board)
  1810.     self.draw_text(0, 0, 408, 32, board.name)
  1811.     self.draw_text(0, 0, 408, 32, "ID: #{board.id}", 2)
  1812.     self.draw_text(32, 48, 344, 32, "X Size: #{board.xsize}")
  1813.     self.draw_text(32, 48, 344, 32, "Y Size: #{board.ysize}", 2)
  1814.     stats = board.statistics
  1815.     text = ["HP", "SP", "Strength", "Physical Defense",
  1816.             "Intelligence", "Magical Defense", "Agility",
  1817.             "Dexterity", "Skills", "Weapon Set", "Armor Set"]
  1818.     for i in 0...text.length
  1819.       self.draw_text(32, 96 + i * 32, 344, 32, "#{text[i]}: #{stats[i]}")
  1820.     end
  1821.   end
  1822.   #--------------------------------------------------------------------------
  1823.   # * Draw Miniature Board Tile
  1824.   #     board : board
  1825.   #     bx    : board x-coordinate
  1826.   #     by    : board y-coordinate
  1827.   #--------------------------------------------------------------------------
  1828.   def draw_miniboard_tile(board, bx, by)
  1829.     type = board.type?(bx, by)
  1830.     activated = board.activated?(bx, by)
  1831.     xs, ys = MINI_TILE_XSIZE, MINI_TILE_YSIZE
  1832.     margin = MINIBOARD_MARGIN
  1833.     cx, cy = bx * xs + margin, by * ys + margin
  1834.     rect = Rect.new(0, 0, xs, ys)
  1835.     if type != -1 and not activated
  1836.       self.blt(cx, cy, MINI_TILE(-1), rect)
  1837.     elsif activated
  1838.       self.blt(cx, cy, MINI_TILE(type), rect)
  1839.     end
  1840.   end
  1841.   #--------------------------------------------------------------------------
  1842.   # * Draw Outline
  1843.   #     x     : draw spot x-coordinate
  1844.   #     y     : draw spot y-coordinate
  1845.   #     w     : draw spot width
  1846.   #     h     : draw spot height
  1847.   #     text  : text string displayed
  1848.   #     align : alignment (0..flush left, 1..center, 2..flush right)
  1849.   #     color : text string color
  1850.   #--------------------------------------------------------------------------
  1851.   def draw_outline(x, y, w, h, text, align=0, color=Color.new(255, 255, 255))
  1852.     self.font.color = Color.new(0, 0, 0)
  1853.     self.draw_text(x,     y + 1, w, h, text, align)  # U
  1854.     self.draw_text(x - 1, y + 1, w, h, text, align)  # UL
  1855.     self.draw_text(x - 1, y,     w, h, text, align)  # L
  1856.     self.draw_text(x - 1, y - 1, w, h, text, align)  # DL
  1857.     self.draw_text(x,     y - 1, w, h, text, align)  # D
  1858.     self.draw_text(x + 1, y - 1, w, h, text, align)  # DR
  1859.     self.draw_text(x + 1, y,     w, h, text, align)  # R
  1860.     self.draw_text(x + 1, y + 1, w, h, text, align)  # UR
  1861.     self.font.color = color
  1862.     self.draw_text(x, y, w, h, text, align)
  1863.   end
  1864. end
  1865.  
  1866. #==============================================================================
  1867. # ** Bitmap_MiniBoard
  1868. #------------------------------------------------------------------------------
  1869. #  This bitmap draws a miniature board. It observes the Window_BoardSelectable
  1870. #  class and automatically changes bitmap conditions.
  1871. #==============================================================================
  1872.  
  1873. class Bitmap_MiniBoard < Bitmap
  1874.   #--------------------------------------------------------------------------
  1875.   # * Invariables
  1876.   #--------------------------------------------------------------------------
  1877.   include FFXII                           # FFXII module
  1878.   #--------------------------------------------------------------------------
  1879.   # * Object Initialization
  1880.   #     board : board
  1881.   #--------------------------------------------------------------------------
  1882.   def initialize(board)
  1883.     super(MINIBOARD)
  1884.     @board = board
  1885.     update
  1886.   end
  1887.   #--------------------------------------------------------------------------
  1888.   # * Frame Update
  1889.   #--------------------------------------------------------------------------
  1890.   def update
  1891.     for x in [email hidden]
  1892.       for y in [email hidden]
  1893.         self.draw_miniboard_tile(@board, x, y)
  1894.       end
  1895.     end
  1896.   end
  1897. end
  1898.  
  1899. #==============================================================================
  1900. # ** Window_EquipItem
  1901. #------------------------------------------------------------------------------
  1902. #  This window displays choices when opting to change equipment on the
  1903. #  equipment screen.
  1904. #==============================================================================
  1905.  
  1906. class Window_EquipItem < Window_Selectable
  1907.   #--------------------------------------------------------------------------
  1908.   # * Refresh
  1909.   #--------------------------------------------------------------------------
  1910.   def refresh
  1911.     if self.contents != nil
  1912.       self.contents.dispose
  1913.       self.contents = nil
  1914.     end
  1915.     @data = []
  1916.     # Add equippable weapons
  1917.     if @equip_type == 0
  1918.       weapon_set = $data_classes[@actor.class_id].weapon_set
  1919.       for i in 1...$data_weapons.size
  1920.         if $game_party.weapon_number(i) > 0 and
  1921.             @actor.equippable?($data_weapons[i])
  1922.           @data.push($data_weapons[i])
  1923.         end
  1924.       end
  1925.     end
  1926.     # Add equippable armor
  1927.     if @equip_type != 0
  1928.       armor_set = $data_classes[@actor.class_id].armor_set
  1929.       for i in 1...$data_armors.size
  1930.         if $game_party.armor_number(i) > 0 and
  1931.             @actor.equippable?($data_armors[i])
  1932.           if $data_armors[i].kind == @equip_type-1
  1933.             @data.push($data_armors[i])
  1934.           end
  1935.         end
  1936.       end
  1937.     end
  1938.     # Add blank page
  1939.     @data.push(nil)
  1940.     # Make a bit map and draw all items
  1941.     @item_max = @data.size
  1942.     self.contents = Bitmap.new(width - 32, row_max * 32)
  1943.     for i in 0...@item_max-1
  1944.       draw_item(i)
  1945.     end
  1946.   end
  1947. end
  1948.  
  1949.  
  1950. #==============================================================================
  1951. # ** Window_InputNumber
  1952. #------------------------------------------------------------------------------
  1953. #  This window is for inputting numbers, and is used within the
  1954. #  message window.
  1955. #==============================================================================
  1956.  
  1957. class Window_InputNumber < Window_Base
  1958.   #--------------------------------------------------------------------------
  1959.   # * Object Initialization
  1960.   #     digits_max : digit count
  1961.   #--------------------------------------------------------------------------
  1962.   def initialize(digits_max, message, width)
  1963.     @digits_max = digits_max
  1964.     @message = message
  1965.     @number = 0
  1966.     # Calculate cursor width from number width (0-9 equal width and postulate)
  1967.     dummy_bitmap = Bitmap.new(32, 32)
  1968.     @cursor_width = dummy_bitmap.text_size("0").width + 8
  1969.     dummy_bitmap.dispose
  1970.     super(0, 0, width, 64)
  1971.     self.contents = Bitmap.new(width - 32, height - 32)
  1972.     text_x = @cursor_width * @digits_max + 32
  1973.     self.contents.draw_text(text_x, 0, width - text_x - 32, 32, @message)
  1974.     self.z += 9999
  1975.     @index = 0
  1976.     refresh
  1977.     update_cursor_rect
  1978.   end
  1979.   #--------------------------------------------------------------------------
  1980.   # * Get Number
  1981.   #--------------------------------------------------------------------------
  1982.   def number
  1983.     return @number
  1984.   end
  1985.   #--------------------------------------------------------------------------
  1986.   # * Set Number
  1987.   #     number : new number
  1988.   #--------------------------------------------------------------------------
  1989.   def number=(number)
  1990.     @number = [[number, 0].max, 10 ** @digits_max - 1].min
  1991.     refresh
  1992.   end
  1993.   #--------------------------------------------------------------------------
  1994.   # * Cursor Rectangle Update
  1995.   #--------------------------------------------------------------------------
  1996.   def update_cursor_rect
  1997.     self.cursor_rect.set(@index * @cursor_width, 0, @cursor_width, 32)
  1998.   end
  1999.   #--------------------------------------------------------------------------
  2000.   # * Frame Update
  2001.   #--------------------------------------------------------------------------
  2002.   def update
  2003.     super
  2004.     # If up or down directional button was pressed
  2005.     if Input.repeat?(Input::UP) or Input.repeat?(Input::DOWN)
  2006.       $game_system.se_play($data_system.cursor_se)
  2007.       # Get current place number and change it to 0
  2008.       place = 10 ** (@digits_max - 1 - @index)
  2009.       n = @number / place % 10
  2010.       @number -= n * place
  2011.       # If up add 1, if down substract 1
  2012.       n = (n + 1) % 10 if Input.repeat?(Input::UP)
  2013.       n = (n + 9) % 10 if Input.repeat?(Input::DOWN)
  2014.       # Reset current place number
  2015.       @number += n * place
  2016.       refresh
  2017.     end
  2018.     # Cursor right
  2019.     if Input.repeat?(Input::RIGHT)
  2020.       if @digits_max >= 2
  2021.         $game_system.se_play($data_system.cursor_se)
  2022.         @index = (@index + 1) % @digits_max
  2023.       end
  2024.     end
  2025.     # Cursor left
  2026.     if Input.repeat?(Input::LEFT)
  2027.       if @digits_max >= 2
  2028.         $game_system.se_play($data_system.cursor_se)
  2029.         @index = (@index + @digits_max - 1) % @digits_max
  2030.       end
  2031.     end
  2032.     update_cursor_rect
  2033.   end
  2034.   #--------------------------------------------------------------------------
  2035.   # * Refresh
  2036.   #--------------------------------------------------------------------------
  2037.   def refresh
  2038.     self.contents.clear
  2039.     self.contents.font.color = normal_color
  2040.     s = sprintf("%0*d", @digits_max, @number)
  2041.     for i in 0...@digits_max
  2042.       self.contents.draw_text(i * @cursor_width + 4, 0, 32, 32, s[i,1])
  2043.     end
  2044.     text_x = @cursor_width * @digits_max + 32
  2045.     self.contents.draw_text(text_x, 0, width - text_x - 32, 32, @message)
  2046.   end
  2047. end
  2048.  
  2049. #==============================================================================
  2050. # ** Window_BoardSelectable
  2051. #------------------------------------------------------------------------------
  2052. #  This window class contains cursor movement and scroll functions.
  2053. #==============================================================================
  2054.  
  2055. class Window_BoardSelectable < Window_Base
  2056.   #--------------------------------------------------------------------------
  2057.   # * Public Instance Variables
  2058.   #--------------------------------------------------------------------------
  2059.   attr_reader   :index                    # cursor position
  2060.   #--------------------------------------------------------------------------
  2061.   # * Object Initialization
  2062.   #     x      : window x-coordinate
  2063.   #     y      : window y-coordinate
  2064.   #     width  : window width
  2065.   #     height : window height
  2066.   #--------------------------------------------------------------------------
  2067.   def initialize(x, y, width, height)
  2068.     super(x, y, width, height)
  2069.     @item_max = 1
  2070.     @column_max = 1
  2071.     @index = -1
  2072.     @scroll_y = 0
  2073.     @scroll_speed = 5
  2074.     @cursor = Sprite_Cursor.new
  2075.     @cursor.z = 65536
  2076.     update_cursor
  2077.   end
  2078.   #--------------------------------------------------------------------------
  2079.   # * Set Cursor Position
  2080.   #     index : new cursor position
  2081.   #--------------------------------------------------------------------------
  2082.   def index=(index)
  2083.     @index = index
  2084.     update_cursor_rect
  2085.   end
  2086.   #--------------------------------------------------------------------------
  2087.   # * Get Row Count
  2088.   #--------------------------------------------------------------------------
  2089.   def row_max
  2090.     return (@item_max + @column_max - 1) / @column_max
  2091.   end
  2092.   #--------------------------------------------------------------------------
  2093.   # * Get Top Row
  2094.   #--------------------------------------------------------------------------
  2095.   def top_row
  2096.     return @scroll_y / (self.contents.height / row_max) rescue 0
  2097.   end
  2098.   #--------------------------------------------------------------------------
  2099.   # * Set Top Row
  2100.   #     row : row shown on top
  2101.   #--------------------------------------------------------------------------
  2102.   def top_row=(row)
  2103.     if row < 0
  2104.       row = 0
  2105.     elsif row > row_max - 1
  2106.       row = row_max - 1
  2107.     end
  2108.     @scroll_y = row * ((self.height - 32) / page_row_max)
  2109.   end
  2110.   #--------------------------------------------------------------------------
  2111.   # * Get Number of Rows Displayable on 1 Page
  2112.   #--------------------------------------------------------------------------
  2113.   def page_row_max
  2114.     return (self.height - 32) / (self.contents.height / row_max) rescue 1
  2115.   end
  2116.   #--------------------------------------------------------------------------
  2117.   # * Get Number of Items Displayable on 1 Page
  2118.   #--------------------------------------------------------------------------
  2119.   def page_item_max
  2120.     return page_row_max * @column_max
  2121.   end
  2122.   #--------------------------------------------------------------------------
  2123.   # * Update Cursor Rectangle
  2124.   #--------------------------------------------------------------------------
  2125.   def update_cursor_rect
  2126.     if @index < 0
  2127.       self.cursor_rect.empty
  2128.       return
  2129.     end
  2130.     row = @index / @column_max
  2131.     if row < self.top_row
  2132.       self.top_row = row
  2133.     elsif row > self.top_row + (self.page_row_max - 1)
  2134.       self.top_row = row - (self.page_row_max - 1)
  2135.     end
  2136.     cursor_width = (self.width - 32) / @column_max
  2137.     x = @index % @column_max * cursor_width
  2138.     y = @index / @column_max * (self.contents.height / row_max) -
  2139.         @scroll_y rescue 0
  2140.     self.cursor_rect.set(x, y, 0, 0)
  2141.   end
  2142.   #--------------------------------------------------------------------------
  2143.   # * Frame Update
  2144.   #--------------------------------------------------------------------------
  2145.   def update
  2146.     super
  2147.     if self.active and @item_max > 0 and @index >= 0
  2148.       if Input.repeat?(Input::DOWN)
  2149.         if Input.press?(Input::SHIFT)
  2150.           $game_system.se_play($data_system.cursor_se)
  2151.           n = @index + page_item_max
  2152.           @index = n > @item_max - 1 ? @item_max - 1 : n
  2153.         elsif (@column_max == 1 and Input.trigger?(Input::DOWN)) or
  2154.             @index < @item_max - @column_max
  2155.           $game_system.se_play($data_system.cursor_se)
  2156.           @index = (@index + @column_max) % @item_max
  2157.         end
  2158.       end
  2159.       if Input.repeat?(Input::UP)
  2160.         if Input.press?(Input::SHIFT)
  2161.           $game_system.se_play($data_system.cursor_se)
  2162.           n = @index - page_item_max
  2163.           @index = n < 0 ? 0 : n
  2164.         elsif (@column_max == 1 and Input.trigger?(Input::UP)) or
  2165.             @index >= @column_max
  2166.           $game_system.se_play($data_system.cursor_se)
  2167.           @index = (@index - @column_max + @item_max) % @item_max
  2168.         end
  2169.       end
  2170.       if Input.repeat?(Input::RIGHT)
  2171.         if @column_max >= 2 and @index < @item_max - 1
  2172.           $game_system.se_play($data_system.cursor_se)
  2173.           @index += 1
  2174.         end
  2175.       end
  2176.       if Input.repeat?(Input::LEFT)
  2177.         if @column_max >= 2 and @index > 0
  2178.           $game_system.se_play($data_system.cursor_se)
  2179.           @index -= 1
  2180.         end
  2181.       end
  2182.       if Input.repeat?(Input::R)
  2183.         if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
  2184.           $game_system.se_play($data_system.cursor_se)
  2185.           @index = [@index + self.page_item_max, @item_max - 1].min
  2186.           self.top_row += self.page_row_max
  2187.         end
  2188.       end
  2189.       if Input.repeat?(Input::L)
  2190.         if self.top_row > 0
  2191.           $game_system.se_play($data_system.cursor_se)
  2192.           @index = [@index - self.page_item_max, 0].max
  2193.           self.top_row -= self.page_row_max
  2194.         end
  2195.       end
  2196.     end
  2197.     update_cursor_rect
  2198.     update_scroll
  2199.     update_cursor
  2200.   end
  2201.   #--------------------------------------------------------------------------
  2202.   # * Update Cursor
  2203.   #--------------------------------------------------------------------------
  2204.   def update_cursor
  2205.     @cursor.true_x = self.cursor_rect.x + self.x
  2206.     @cursor.true_y = self.cursor_rect.y + self.y + 16
  2207.     @cursor.update
  2208.     @cursor.visible = (self.visible and self.index >= 0)
  2209.   end
  2210.   #--------------------------------------------------------------------------
  2211.   # * Update Scroll
  2212.   #--------------------------------------------------------------------------
  2213.   def update_scroll
  2214.     if self.oy < @scroll_y
  2215.       n = (@scroll_y - self.oy) / @scroll_speed
  2216.       n = 1 if n == 0
  2217.       self.oy += n
  2218.     elsif self.oy > @scroll_y
  2219.       n = (self.oy - @scroll_y) / @scroll_speed
  2220.       n = 1 if n == 0
  2221.       self.oy -= n
  2222.     end
  2223.   end
  2224.   #--------------------------------------------------------------------------
  2225.   # * Dispose
  2226.   #--------------------------------------------------------------------------
  2227.   def dispose
  2228.     @cursor.dispose
  2229.     super
  2230.   end
  2231. end
  2232.  
  2233. #==============================================================================
  2234. # ** Window_BoardConfirm
  2235. #------------------------------------------------------------------------------
  2236. #  This window is used to confirm the activation of a slot.
  2237. #==============================================================================
  2238.  
  2239. class Window_BoardConfirm < Window_BoardSelectable
  2240.   #--------------------------------------------------------------------------
  2241.   # * Public Instance Variables
  2242.   #--------------------------------------------------------------------------
  2243.   attr_accessor :message              # message
  2244.   #--------------------------------------------------------------------------
  2245.   # * Object Initialization
  2246.   #     width    : window width
  2247.   #     commands : command text string array
  2248.   #--------------------------------------------------------------------------
  2249.   def initialize(width, commands, message = "")
  2250.     super(0, 0, width, commands.size * 32 + 64)
  2251.     @item_max = commands.size
  2252.     @commands = commands
  2253.     @message = message
  2254.     self.contents = Bitmap.new(width - 32, @item_max * 32 + 32)
  2255.     refresh
  2256.     self.index = 0
  2257.   end
  2258.   #--------------------------------------------------------------------------
  2259.   # * Refresh
  2260.   #--------------------------------------------------------------------------
  2261.   def refresh
  2262.     self.contents.clear
  2263.     self.contents.draw_text(0, 0, self.width - 32, 32, @message)
  2264.     for i in 0...@item_max
  2265.       self.draw_item(i, 32, i * 32 + 32)
  2266.     end
  2267.   end
  2268.   #--------------------------------------------------------------------------
  2269.   # * Draw Item
  2270.   #     index : item number
  2271.   #     x     : item x-coordinate
  2272.   #     y     : item y-coordinate
  2273.   #--------------------------------------------------------------------------
  2274.   def draw_item(index, x, y)
  2275.     self.contents.draw_text(x, y, 120, 32, @commands[index])
  2276.   end
  2277.   #--------------------------------------------------------------------------
  2278.   # * Update Cursor
  2279.   #--------------------------------------------------------------------------
  2280.   def update_cursor
  2281.     @cursor.true_x = self.cursor_rect.x + self.x + 8
  2282.     correction = @index % @item_max * 16
  2283.     @cursor.true_y = self.cursor_rect.y + self.y + 48 - correction
  2284.     @cursor.update
  2285.     @cursor.visible = (self.visible and self.index >= 0)
  2286.   end
  2287. end
  2288.  
  2289. #==============================================================================
  2290. # ** Window_BoardSelect
  2291. #------------------------------------------------------------------------------
  2292. #  This window selects a board to display from an actor.
  2293. #==============================================================================
  2294.  
  2295. class Window_BoardSelect < Window_BoardSelectable
  2296.   #--------------------------------------------------------------------------
  2297.   # * Invariables
  2298.   #--------------------------------------------------------------------------
  2299.   include FFXII                           # FFXII module
  2300.   #--------------------------------------------------------------------------
  2301.   # * Object Initialization
  2302.   #--------------------------------------------------------------------------
  2303.   def initialize
  2304.     super(0, 0, 672, 512)
  2305.     @item_max = $game_party.actors.size
  2306.     @column_max = 3
  2307.     rows_max = (@item_max + @column_max - 1) / @column_max
  2308.     self.contents = Bitmap.new(width - 32, rows_max * 240)
  2309.     @bg = Plane.new
  2310.     @bg.bitmap = BOARD_BG
  2311.     @shadow_sprite = RPG::Sprite.new
  2312.     @shadow_sprite.bitmap = SHADOW.dup
  2313.     refresh
  2314.     self.index = 0
  2315.     self.x = -16
  2316.     self.y = -16
  2317.     self.opacity = 0
  2318.   end
  2319.   #--------------------------------------------------------------------------
  2320.   # * Refresh
  2321.   #--------------------------------------------------------------------------
  2322.   def refresh
  2323.     self.contents.clear
  2324.     for i in 0...$game_party.actors.size
  2325.       x = i % @column_max * 208
  2326.       y = i / @column_max * 240
  2327.       actor = $game_party.actors[i]
  2328.       self.contents.draw_actor_minimap(actor, x + 8,   y + 32)
  2329.       self.contents.draw_actor_name(   actor, x + 12,  y)
  2330.       self.contents.draw_actor_ap(     actor, x + 126, y + 4)
  2331.     end
  2332.   end
  2333.   #--------------------------------------------------------------------------
  2334.   # * Update Cursor
  2335.   #--------------------------------------------------------------------------
  2336.   def update_cursor
  2337.     correction = @index % @column_max * 5
  2338.     @cursor.true_x = self.cursor_rect.x + self.x + 26 - correction
  2339.     @cursor.true_y = self.cursor_rect.y + self.y + 48
  2340.     @cursor.update
  2341.     @cursor.visible = (self.visible and self.index >= 0)
  2342.   end
  2343.   #--------------------------------------------------------------------------
  2344.   # * Dispose
  2345.   #--------------------------------------------------------------------------
  2346.   def dispose
  2347.     self.contents.clear
  2348.     @bg.dispose
  2349.     @shadow_sprite.dispose
  2350.     super
  2351.   end
  2352. end
  2353.  
  2354. #==============================================================================
  2355. # ** Window_EditBoardLeft
  2356. #------------------------------------------------------------------------------
  2357. #  This window designates boards on the board edit screen.
  2358. #==============================================================================
  2359.  
  2360. class Window_EditBoardLeft < Window_Selectable
  2361.   #--------------------------------------------------------------------------
  2362.   # * Object Initialization
  2363.   #--------------------------------------------------------------------------
  2364.   def initialize
  2365.     super(0, 0, 192, 352)
  2366.     self.index = 0
  2367.     refresh
  2368.   end
  2369.   #--------------------------------------------------------------------------
  2370.   # * Refresh
  2371.   #--------------------------------------------------------------------------
  2372.   def refresh
  2373.     if self.contents != nil
  2374.       self.contents.dispose
  2375.       self.contents = nil
  2376.     end
  2377.     @item_max = $data_boards.size + 1
  2378.     self.contents = Bitmap.new(width - 32, @item_max * 32)
  2379.     for i in 0...@item_max - 1
  2380.       text = "License Board #{i}"
  2381.       self.contents.draw_text(4, i * 32, 152, 32, text)
  2382.     end
  2383.     self.contents.draw_text(4, self.contents.height - 32, 152, 32, "New board")
  2384.   end
  2385.   #--------------------------------------------------------------------------
  2386.   # * Get Index
  2387.   #--------------------------------------------------------------------------
  2388.   def index?
  2389.     return self.index
  2390.   end
  2391.   #--------------------------------------------------------------------------
  2392.   # * Get Board
  2393.   #--------------------------------------------------------------------------
  2394.   def board
  2395.     return Board.new(index?) rescue nil
  2396.   end
  2397. end
  2398.  
  2399. #==============================================================================
  2400. # ** Window_EditBoardRight
  2401. #------------------------------------------------------------------------------
  2402. #  This window displays boards separately on the board edit screen.
  2403. #==============================================================================
  2404.  
  2405. class Window_EditBoardRight < Window_Base
  2406.   #--------------------------------------------------------------------------
  2407.   # * Public Instance Variables
  2408.   #--------------------------------------------------------------------------
  2409.   attr_accessor :board                    # board
  2410.   #--------------------------------------------------------------------------
  2411.   # * Object Initialization
  2412.   #--------------------------------------------------------------------------
  2413.   def initialize(board = nil)
  2414.     super(192, 0, 448, 480)
  2415.     self.contents = Bitmap.new(width - 32, height - 32)
  2416.     @board = board
  2417.     refresh
  2418.   end
  2419.   #--------------------------------------------------------------------------
  2420.   # * Refresh
  2421.   #--------------------------------------------------------------------------
  2422.   def refresh
  2423.     self.contents.clear
  2424.     if @board != nil
  2425.       self.contents.draw_board_statistics(@board)
  2426.     else
  2427.       self.contents.draw_text(4, 0, 408, 32, "Create new board")
  2428.     end
  2429.   end
  2430. end
  2431.  
  2432. #==============================================================================
  2433. # ** Window_EditBoardKey
  2434. #------------------------------------------------------------------------------
  2435. #  This window designates boards on the board edit screen.
  2436. #==============================================================================
  2437.  
  2438. class Window_EditBoardKey < Window_Base
  2439.   #--------------------------------------------------------------------------
  2440.   # * Object Initialization
  2441.   #--------------------------------------------------------------------------
  2442.   def initialize
  2443.     super(0, 352, 192, 128)
  2444.     self.contents = Bitmap.new(width - 32, height - 32)
  2445.     refresh
  2446.   end
  2447.   #--------------------------------------------------------------------------
  2448.   # * Refresh
  2449.   #--------------------------------------------------------------------------
  2450.   def refresh
  2451.     self.contents.draw_text(0, 0,  152, 32, "A: Delete")
  2452.     self.contents.draw_text(0, 32, 152, 32, "B: Cancel")
  2453.     self.contents.draw_text(0, 64, 152, 32, "C: Decision")
  2454.   end
  2455. end
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464. module MOG
  2465.   #Ativar fullScreen automático.  
  2466.   FULL_SCREEN = false
  2467.   #Velocidade da animação
  2468.   BACKTITLESPEED = 10
  2469.   #Posição do comando.
  2470.   COM_X = 0  # Com X Pos
  2471.   COM_Y = 0  # Com Y Pos
  2472. end
  2473. #----------------------------------
  2474. # Scene_Title
  2475. #----------------------------------
  2476. $mogscript = {} if $mogscript == nil
  2477. $mogscript["title_celia"] = true
  2478. $full_screen = 0
  2479. class Scene_Title
  2480.   include Boards
  2481.   def main
  2482.     if $BTEST
  2483.       battle_test
  2484.       return
  2485.     end
  2486.     $full_screen += 1
  2487.     if MOG::FULL_SCREEN == true and $full_screen == 1
  2488.     $showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), ' '
  2489.     $showm.call(18,0,0,0)
  2490.     $showm.call(13,0,0,0)
  2491.     $showm.call(13,0,2,0)
  2492.     $showm.call(18,0,2,0)
  2493.     end            
  2494.     $data_actors        = load_data("Data/Actors.rxdata")
  2495.     $data_classes       = load_data("Data/Classes.rxdata")
  2496.     $data_skills        = load_data("Data/Skills.rxdata")
  2497.     $data_items         = load_data("Data/Items.rxdata")
  2498.     $data_weapons       = load_data("Data/Weapons.rxdata")
  2499.     $data_armors        = load_data("Data/Armors.rxdata")
  2500.     $data_enemies       = load_data("Data/Enemies.rxdata")
  2501.     $data_troops        = load_data("Data/Troops.rxdata")
  2502.     $data_states        = load_data("Data/States.rxdata")
  2503.     $data_animations    = load_data("Data/Animations.rxdata")
  2504.     $data_tilesets      = load_data("Data/Tilesets.rxdata")
  2505.     $data_common_events = load_data("Data/CommonEvents.rxdata")
  2506.     $data_system        = load_data("Data/System.rxdata")
  2507.    
  2508.    
  2509.    
  2510.     # Load Boards.rxdata, create new if it does not exist
  2511.     $data_boards = get_boards
  2512.     if $data_boards.empty?
  2513.       new_board(NEW_BOARD_XSIZE, NEW_BOARD_YSIZE)
  2514.       p "New Boards.rxdata file created!"
  2515.     end
  2516.    
  2517.    
  2518.    
  2519.     $game_system = Game_System.new
  2520.     s1 = "New Game"
  2521.     s2 = "Continue"
  2522.     s3 = "Shutdown"
  2523.     @command_window = Window_Command.new(192, [s1, s2, s3])
  2524.     @command_window.back_opacity = 160
  2525.     @command_window.x = 320 - @command_window.width / 2
  2526.     @command_window.y = 288
  2527.     @command_window.visible = false
  2528.     @com = Sprite.new
  2529.     @com.bitmap = RPG::Cache.title("Com_01") rescue nil
  2530.     @com.z = 10
  2531.     @com.x = (MOG::COM_X)
  2532.     @com.y = (MOG::COM_Y)
  2533.     @continue_enabled = false
  2534.     @frmtitle = Sprite.new
  2535.     @frmtitle.bitmap = Bitmap.new(640,480)
  2536.     @frmtitle.bitmap = RPG::Cache.title("Title0") rescue nil
  2537.     @backtitleref = 0
  2538.     @backtitlespeed = 0
  2539.     for i in 0..3
  2540.       if FileTest.exist?("Save#{i+1}.rxdata")
  2541.         @continue_enabled = true
  2542.       end
  2543.     end
  2544.     if @continue_enabled
  2545.       @command_window.index = 1
  2546.     else
  2547.       @command_window.disable_item(1)
  2548.     end
  2549.     $game_system.bgm_play($data_system.title_bgm)
  2550.     Audio.me_stop
  2551.     Audio.bgs_stop
  2552.     Graphics.transition
  2553.     loop do
  2554.       Graphics.update
  2555.       Input.update
  2556.       update
  2557.       if $scene != self
  2558.         break
  2559.       end
  2560.     end
  2561.     Graphics.freeze
  2562.     @command_window.dispose
  2563.     @frmtitle.dispose
  2564.     @com.dispose
  2565.   end
  2566.   def update
  2567.     @command_window.update
  2568.      case @command_window.index
  2569.      when 0
  2570.      @com.bitmap = RPG::Cache.title("Com_01") rescue nil      
  2571.      when 1
  2572.      @com.bitmap = RPG::Cache.title("Com_02") rescue nil      
  2573.      when 2
  2574.      @com.bitmap = RPG::Cache.title("Com_03") rescue nil
  2575.      end      
  2576.     if Input.trigger?(Input::C)
  2577.       case @command_window.index
  2578.       when 0  
  2579.         command_new_game
  2580.       when 1  
  2581.         command_continue
  2582.       when 2
  2583.         command_shutdown
  2584.       end
  2585.     end
  2586.      @backtitlespeed += 1    
  2587.   if @backtitlespeed > MOG::BACKTITLESPEED
  2588.      @backtitleref += 1
  2589.      @backtitlespeed = 0
  2590.   end
  2591.   if @frmtitle.bitmap != nil
  2592.   @frmtitle.bitmap = RPG::Cache.title("Title" + @backtitleref.to_s) rescue nil
  2593.   end
  2594.   if @frmtitle.bitmap == nil
  2595.      @backtitleref = 0
  2596.   @frmtitle.bitmap = RPG::Cache.title("Title" + @backtitleref.to_s) rescue nil
  2597.   end  
  2598.   end
  2599.   def command_new_game
  2600.     $game_system.se_play($data_system.decision_se)
  2601.     Audio.bgm_stop
  2602.     Graphics.frame_count = 0
  2603.     $game_temp          = Game_Temp.new
  2604.     $game_system        = Game_System.new
  2605.     $game_switches      = Game_Switches.new
  2606.     $game_variables     = Game_Variables.new
  2607.     $game_self_switches = Game_SelfSwitches.new
  2608.     $game_screen        = Game_Screen.new
  2609.     $game_actors        = Game_Actors.new
  2610.     $game_party         = Game_Party.new
  2611.     $game_troop         = Game_Troop.new
  2612.     $game_map           = Game_Map.new
  2613.     $game_player        = Game_Player.new
  2614.     $game_party.setup_starting_members
  2615.     $game_map.setup($data_system.start_map_id)
  2616.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  2617.     $game_player.refresh
  2618.     $game_map.autoplay
  2619.     $game_map.update
  2620.    
  2621.    
  2622.    
  2623.    
  2624.    
  2625.    
  2626.    
  2627.    
  2628.     #Disable Prologue?
  2629.     $scene = Scene_Map.new
  2630.     #$scene = Scene_Prologue.new
  2631.     #######################
  2632.    
  2633.    
  2634.    
  2635.    
  2636.    
  2637.    
  2638.    
  2639.    
  2640.     #
  2641.   end
  2642.   def command_continue
  2643.     unless @continue_enabled
  2644.       $game_system.se_play($data_system.buzzer_se)
  2645.       return
  2646.     end
  2647.     $game_system.se_play($data_system.decision_se)
  2648.     $scene = Scene_Load.new
  2649.   end
  2650.   def command_shutdown
  2651.     $game_system.se_play($data_system.decision_se)
  2652.     Audio.bgm_fade(800)
  2653.     Audio.bgs_fade(800)
  2654.     Audio.me_fade(800)
  2655.     $scene = nil
  2656.   end
  2657.   def battle_test
  2658.     $data_actors        = load_data("Data/BT_Actors.rxdata")
  2659.     $data_classes       = load_data("Data/BT_Classes.rxdata")
  2660.     $data_skills        = load_data("Data/BT_Skills.rxdata")
  2661.     $data_items         = load_data("Data/BT_Items.rxdata")
  2662.     $data_weapons       = load_data("Data/BT_Weapons.rxdata")
  2663.     $data_armors        = load_data("Data/BT_Armors.rxdata")
  2664.     $data_enemies       = load_data("Data/BT_Enemies.rxdata")
  2665.     $data_troops        = load_data("Data/BT_Troops.rxdata")
  2666.     $data_states        = load_data("Data/BT_States.rxdata")
  2667.     $data_animations    = load_data("Data/BT_Animations.rxdata")
  2668.     $data_tilesets      = load_data("Data/BT_Tilesets.rxdata")
  2669.     $data_common_events = load_data("Data/BT_CommonEvents.rxdata")
  2670.     $data_system        = load_data("Data/BT_System.rxdata")
  2671.     Graphics.frame_count = 0
  2672.     $game_temp          = Game_Temp.new
  2673.     $game_system        = Game_System.new
  2674.     $game_switches      = Game_Switches.new
  2675.     $game_variables     = Game_Variables.new
  2676.     $game_self_switches = Game_SelfSwitches.new
  2677.     $game_screen        = Game_Screen.new
  2678.     $game_actors        = Game_Actors.new
  2679.     $game_party         = Game_Party.new
  2680.     $game_troop         = Game_Troop.new
  2681.     $game_map           = Game_Map.new
  2682.     $game_player        = Game_Player.new
  2683.     $game_party.setup_battle_test_members
  2684.     $game_temp.battle_troop_id = $data_system.test_troop_id
  2685.     $game_temp.battle_can_escape = true
  2686.     $game_map.battleback_name = $data_system.battleback_name
  2687.     $game_system.se_play($data_system.battle_start_se)
  2688.     $game_system.bgm_play($game_system.battle_bgm)
  2689.     $scene = Scene_Battle.new
  2690.   end
  2691. end
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698. #==============================================================================
  2699. # ** Scene_BoardSelect
  2700. #------------------------------------------------------------------------------
  2701. #  This class performs board select screen processing.
  2702. #==============================================================================
  2703.  
  2704. class Scene_BoardSelect
  2705.   #--------------------------------------------------------------------------
  2706.   # * Invariables
  2707.   #--------------------------------------------------------------------------
  2708.   include FFXII                           # FFXII module
  2709.   include Boards                          # Boards module
  2710.   #--------------------------------------------------------------------------
  2711.   # * Object Initialization
  2712.   #     index : index
  2713.   #--------------------------------------------------------------------------
  2714.   def initialize(index = 0)
  2715.     @index = index
  2716.   end
  2717.   #--------------------------------------------------------------------------
  2718.   # * Main Processing
  2719.   #--------------------------------------------------------------------------
  2720.   def main
  2721.     $data_boards = get_boards
  2722.     @select_window = Window_BoardSelect.new
  2723.     @select_window.index = @index
  2724.     Graphics.transition
  2725.     loop do
  2726.       Graphics.update
  2727.       Input.update
  2728.       update
  2729.       if $scene != self
  2730.         break
  2731.       end  
  2732.     end
  2733.     Graphics.freeze
  2734.     @select_window.dispose
  2735.   end
  2736.   #--------------------------------------------------------------------------
  2737.   # * Frame Update
  2738.   #--------------------------------------------------------------------------
  2739.   def update
  2740.     @select_window.update
  2741.     if Input.trigger?(Input::B)
  2742.       $game_system.se_play($data_system.cancel_se)
  2743.       $scene = Scene_Map.new
  2744.       return
  2745.     end
  2746.     if Input.trigger?(Input::C)
  2747.       $game_system.se_play($data_system.decision_se)
  2748.       actor_index = @select_window.index
  2749.       actor = $game_party.actors[actor_index]
  2750.       board = actor.board
  2751.       $scene = Scene_Board.new(board, actor_index)
  2752.       return
  2753.     end
  2754.   end
  2755. end
  2756.  
  2757. #==============================================================================
  2758. # ** Scene_Board
  2759. #------------------------------------------------------------------------------
  2760. #  This class performs board screen processing.
  2761. #==============================================================================
  2762.  
  2763. class Scene_Board
  2764.   #--------------------------------------------------------------------------
  2765.   # * Invariables
  2766.   #--------------------------------------------------------------------------
  2767.   include FFXII                           # FFXII module
  2768.   include Boards                          # Boards module
  2769.   #--------------------------------------------------------------------------
  2770.   # * Object Initialization
  2771.   #     board       : board
  2772.   #     actor_index : actor index
  2773.   #--------------------------------------------------------------------------
  2774.   def initialize(board, actor_index)
  2775.     @board = board
  2776.     @actor_index = actor_index
  2777.     @actor = $game_party.actors[@actor_index]
  2778.   end
  2779.   #--------------------------------------------------------------------------
  2780.   # * Main Processing
  2781.   #--------------------------------------------------------------------------
  2782.   def main
  2783.     $data_boards = get_boards
  2784.     @spriteset = Spriteset_Board.new(@board)
  2785.     x, y = BOARD_OX, BOARD_OY
  2786.     @cursor = Cursor_Board.new(@board, x, y)
  2787.     @cursor.px, @cursor.py = BOARD_MARGIN, BOARD_MARGIN
  2788.     update_cursor
  2789.     @shadow_sprite = RPG::Sprite.new
  2790.     @shadow_sprite.bitmap = SHADOW.dup
  2791.     @status_sprite = Sprite_AvailableLP.new(@actor, @board)
  2792.     @help_sprite = Sprite_LicenseDescription.new(@cursor, @board)
  2793.     update_help
  2794.     @confirm_window = Window_BoardConfirm.new(240, ["Yes","No"])
  2795.     @confirm_window.back_opacity = 160
  2796.     @confirm_window.x = 320 - @confirm_window.width / 2
  2797.     @confirm_window.y = 240 - @confirm_window.height / 2
  2798.     @confirm_window.index = -1
  2799.     @confirm_window.active = false
  2800.     @confirm_window.visible = false
  2801.     @black_sprite = Dynamic_Sprite.new
  2802.     @black_sprite.bitmap = BLACK
  2803.     @black_sprite.true_opacity = 0
  2804.     @black_sprite.opacity = 0
  2805.     Graphics.transition
  2806.     loop do
  2807.       Graphics.update
  2808.       Input.update
  2809.       update
  2810.       if $scene != self
  2811.         break
  2812.       end  
  2813.     end
  2814.     Graphics.freeze
  2815.     @spriteset.dispose
  2816.     @cursor.dispose
  2817.     @shadow_sprite.dispose
  2818.     @status_sprite.dispose
  2819.     @help_sprite.dispose
  2820.     @confirm_window.dispose
  2821.     @black_sprite.dispose
  2822.   end
  2823.   #--------------------------------------------------------------------------
  2824.   # * Frame Update
  2825.   #--------------------------------------------------------------------------
  2826.   def update
  2827.     @spriteset.update
  2828.     @cursor.update
  2829.     @status_sprite.update
  2830.     @help_sprite.update
  2831.     @confirm_window.update
  2832.     @black_sprite.update
  2833.     if @confirm_window.active
  2834.       update_confirm
  2835.       return
  2836.     end
  2837.     if Input.repeat?(Input.dir8)
  2838.       $game_system.se_play($data_system.cursor_se)
  2839.       update_cursor
  2840.       update_help
  2841.     end
  2842.     if Input.trigger?(Input::B)
  2843.       $game_system.se_play($data_system.cancel_se)
  2844.       $scene = Scene_BoardSelect.new(@actor_index)
  2845.       return
  2846.     end
  2847.     if Input.trigger?(Input::C)
  2848.       x, y = @cursor.tile_x, @cursor.tile_y
  2849.       valid = @board.valid?(x, y)
  2850.       visible = @board.visible?(x, y)
  2851.       activated = @board.activated?(x, y)
  2852.       ap_cost = @board.ap_cost?(x, y)
  2853.       if valid and visible and not activated and @actor.ap >= ap_cost
  2854.         $game_system.se_play($data_system.decision_se)
  2855.         board_class = @board.class(x, y)
  2856.         @confirm_window.message = CONFIRM_MESSAGE(board_class)
  2857.         @confirm_window.refresh
  2858.         @confirm_window.index = 1
  2859.         @confirm_window.active = true
  2860.         @confirm_window.visible = true
  2861.         @black_sprite.true_opacity = 128
  2862.       else
  2863.         $game_system.se_play($data_system.buzzer_se)
  2864.       end
  2865.       return
  2866.     end
  2867.     if Input.trigger?(Input::R)
  2868.       $game_system.se_play($data_system.cursor_se)
  2869.       @actor_index += 1
  2870.       @actor_index %= $game_party.actors.size
  2871.       actor = $game_party.actors[@actor_index]
  2872.       board = actor.board
  2873.       $scene = Scene_Board.new(board, @actor_index)
  2874.       return
  2875.     end
  2876.     if Input.trigger?(Input::L)
  2877.       $game_system.se_play($data_system.cursor_se)
  2878.       @actor_index += $game_party.actors.size - 1
  2879.       @actor_index %= $game_party.actors.size
  2880.       actor = $game_party.actors[@actor_index]
  2881.       board = actor.board
  2882.       $scene = Scene_Board.new(board, @actor_index)
  2883.       return
  2884.     end
  2885.   end
  2886.   #--------------------------------------------------------------------------
  2887.   # * Help Update
  2888.   #--------------------------------------------------------------------------
  2889.   def update_help
  2890.     x, y = @cursor.tile_x, @cursor.tile_y
  2891.     if @board.valid?(x, y)
  2892.       @help_sprite.true_y = 360
  2893.       @help_sprite.true_opacity = 255
  2894.     else
  2895.       @help_sprite.true_y = 370
  2896.       @help_sprite.true_opacity = 0
  2897.     end
  2898.   end
  2899.   #--------------------------------------------------------------------------
  2900.   # * Cursor Update
  2901.   #--------------------------------------------------------------------------
  2902.   def update_cursor
  2903.     xs, ys = TILE_X_SIZE, TILE_Y_SIZE
  2904.     max_x = 640 / xs - 1
  2905.     max_y = 480 / ys - 1
  2906.     margin = BOARD_MARGIN
  2907.     case Input.dir8
  2908.     when 2  # Down
  2909.       @cursor.tile_y += 1
  2910.       if @cursor.py < max_y - margin
  2911.         @cursor.py += 1
  2912.       elsif @cursor.tile_y >= @board.ysize
  2913.         @cursor.py = margin
  2914.       end
  2915.     when 4  # Left
  2916.       @cursor.tile_x -= 1
  2917.       if @cursor.px > margin
  2918.         @cursor.px -= 1
  2919.       elsif @cursor.tile_x < 0
  2920.         @cursor.px = max_x - margin
  2921.       end
  2922.     when 6  # Right
  2923.       @cursor.tile_x += 1
  2924.       if @cursor.px < max_x - margin
  2925.         @cursor.px += 1
  2926.       elsif @cursor.tile_x >= @board.xsize
  2927.         @cursor.px = margin
  2928.       end
  2929.     when 8  # Up
  2930.       @cursor.tile_y -= 1
  2931.       if @cursor.py > margin
  2932.         @cursor.py -= 1
  2933.       elsif @cursor.tile_y < 0
  2934.         @cursor.py = max_y - margin
  2935.       end
  2936.     end
  2937.     @cursor.tile_x %= @board.xsize
  2938.     @cursor.tile_y %= @board.ysize
  2939.     cx = (@cursor.px - @cursor.tile_x) * xs
  2940.     cy = (@cursor.py - @cursor.tile_y) * ys
  2941.     @spriteset.tiles.true_x  = cx
  2942.     @spriteset.tiles.true_y  = cy
  2943.     @spriteset.icons.true_x  = cx
  2944.     @spriteset.icons.true_y  = cy
  2945.     @spriteset.active.true_x = cx
  2946.     @spriteset.active.true_y = cy
  2947.     @cursor.true_x = (@cursor.px * xs) - 20
  2948.     @cursor.true_y = (@cursor.py * ys) - 4
  2949.   end
  2950.   #--------------------------------------------------------------------------
  2951.   # * Confirm Window Update
  2952.   #--------------------------------------------------------------------------
  2953.   def update_confirm
  2954.     if Input.trigger?(Input::B)
  2955.       $game_system.se_play($data_system.cursor_se)
  2956.       @confirm_window.index = 1
  2957.       return
  2958.     end
  2959.     if Input.trigger?(Input::C)
  2960.       case @confirm_window.index
  2961.       when 0  # Confirm
  2962.         $game_system.se_play($data_system.decision_se)
  2963.         @confirm_window.index = -1
  2964.         @confirm_window.active = false
  2965.         @confirm_window.visible = false
  2966.         @confirm_window.update
  2967.         @black_sprite.true_opacity = 0
  2968.         x, y = @cursor.tile_x, @cursor.tile_y
  2969.         @board.activate(x, y, true)
  2970.         @actor.ap -= @board.ap_cost?(x, y)
  2971.         @spriteset.refresh
  2972.         @status_sprite.refresh
  2973.         @help_sprite.refresh
  2974.         animation
  2975.       when 1  # Cancel
  2976.         $game_system.se_play($data_system.cancel_se)
  2977.         @confirm_window.index = -1
  2978.         @confirm_window.active = false
  2979.         @confirm_window.visible = false
  2980.         @confirm_window.update
  2981.         @black_sprite.true_opacity = 0
  2982.       end
  2983.       return
  2984.     end
  2985.   end
  2986.   #--------------------------------------------------------------------------
  2987.   # * Animation
  2988.   #--------------------------------------------------------------------------
  2989.   def animation
  2990.     bitmap = ANIMATION
  2991.     xs, ys = TILE_X_SIZE, TILE_Y_SIZE
  2992.     hf = ANIMATION_HORIZONTAL_FRAMES
  2993.     vf = ANIMATION_VERTICAL_FRAMES
  2994.     tf = ANIMATION_TOTAL_FRAMES
  2995.     blend = ANIMATION_BLENDTYPE
  2996.     cx = (@cursor.px * xs) - ((bitmap.width / hf) - xs) / 2
  2997.     cy = (@cursor.py * ys) - ((bitmap.height / vf) - ys) / 2
  2998.     @animation = Animated_Sprite.new(bitmap, cx, cy, hf, vf, tf, blend)
  2999.     loop do
  3000.       if @animation.ready?
  3001.         @animation.frame += 1
  3002.       end
  3003.       @animation.update
  3004.       @black_sprite.update
  3005.       Graphics.update
  3006.       if @animation.frame == @animation.frames
  3007.         break
  3008.       end
  3009.     end
  3010.     @animation.dispose
  3011.   end
  3012. end
  3013.  
  3014. #==============================================================================
  3015. # ** Scene_EditBoard
  3016. #------------------------------------------------------------------------------
  3017. #  This class performs board edit screen processing.
  3018. #==============================================================================
  3019.  
  3020. class Scene_EditBoard
  3021.   #--------------------------------------------------------------------------
  3022.   # * Invariables
  3023.   #--------------------------------------------------------------------------
  3024.   include FFXII                           # FFXII module
  3025.   include Boards                          # Boards module
  3026.   include List                            # List module
  3027.   #--------------------------------------------------------------------------
  3028.   # * Object Initialization
  3029.   #     index : index
  3030.   #--------------------------------------------------------------------------
  3031.   def initialize(index = 0)
  3032.     @index = index
  3033.     item_list
  3034.   end
  3035.   #--------------------------------------------------------------------------
  3036.   # * Main Processing
  3037.   #--------------------------------------------------------------------------
  3038.   def main
  3039.     $data_boards = get_boards
  3040.     @left_window = Window_EditBoardLeft.new
  3041.     @right_window = Window_EditBoardRight.new
  3042.     @key_window = Window_EditBoardKey.new
  3043.     @left_window.index = @index
  3044.     @right_window.board = @left_window.board
  3045.     @right_window.refresh
  3046.     Graphics.transition
  3047.     loop do
  3048.       Graphics.update
  3049.       Input.update
  3050.       update
  3051.       if $scene != self
  3052.         break
  3053.       end
  3054.     end
  3055.     Graphics.freeze
  3056.     @left_window.dispose
  3057.     @right_window.dispose
  3058.     @key_window.dispose
  3059.   end
  3060.   #--------------------------------------------------------------------------
  3061.   # * Frame Update
  3062.   #--------------------------------------------------------------------------
  3063.   def update
  3064.     @right_window.board = @left_window.board
  3065.     @right_window.refresh
  3066.     @left_window.update
  3067.     @right_window.update
  3068.     if @left_window.active
  3069.       update_left
  3070.       return
  3071.     end
  3072.   end
  3073.   #--------------------------------------------------------------------------
  3074.   # * Frame Update (when left window is active)
  3075.   #--------------------------------------------------------------------------
  3076.   def update_left
  3077.     if Input.trigger?(Input::A)
  3078.       $game_system.se_play($data_system.decision_se)
  3079.       index = @left_window.index?
  3080.       delete_board(index)
  3081.       shutdown
  3082.       return
  3083.     end
  3084.     if Input.trigger?(Input::B)
  3085.       $game_system.se_play($data_system.cancel_se)
  3086.       shutdown
  3087.       return
  3088.     end
  3089.     if Input.trigger?(Input::C)
  3090.       $game_system.se_play($data_system.decision_se)
  3091.       board = @right_window.board
  3092.       index = @left_window.index?
  3093.       if board != nil
  3094.         $scene = Scene_CreateBoard.new(board)
  3095.       else
  3096.         xsize, ysize = NEW_BOARD_XSIZE, NEW_BOARD_YSIZE
  3097.         new_board(xsize, ysize)
  3098.         shutdown
  3099.       end
  3100.       return
  3101.     end
  3102.   end
  3103.   #--------------------------------------------------------------------------
  3104.   # * Shutdown
  3105.   #--------------------------------------------------------------------------
  3106.   def shutdown
  3107.     Audio.bgm_fade(800)
  3108.     Audio.bgs_fade(800)
  3109.     Audio.me_fade(800)
  3110.     $scene = nil
  3111.   end
  3112. end
  3113.  
  3114. #==============================================================================
  3115. # ** Scene_CreateBoard
  3116. #------------------------------------------------------------------------------
  3117. #  This class performs board create screen processing.
  3118. #==============================================================================
  3119.  
  3120. class Scene_CreateBoard
  3121.   #--------------------------------------------------------------------------
  3122.   # * Invariables
  3123.   #--------------------------------------------------------------------------
  3124.   include FFXII                           # FFXII module
  3125.   include Boards                          # Boards module
  3126.   #--------------------------------------------------------------------------
  3127.   # * Object Initialization
  3128.   #     board : board
  3129.   #--------------------------------------------------------------------------
  3130.   def initialize(board)
  3131.     @board = board
  3132.   end
  3133.   #--------------------------------------------------------------------------
  3134.   # * Main Processing
  3135.   #--------------------------------------------------------------------------
  3136.   def main
  3137.     $data_boards = get_boards
  3138.     @spriteset = Spriteset_Board.new(@board, true)
  3139.     x, y = BOARD_OX, BOARD_OY
  3140.     @cursor = Cursor_Board.new(@board, x, y)
  3141.     @cursor.px, @cursor.py = BOARD_MARGIN, BOARD_MARGIN
  3142.     update_cursor
  3143.     @shadow_sprite = RPG::Sprite.new
  3144.     @shadow_sprite.bitmap = SHADOW.dup
  3145.     @help_sprite = Sprite_LicenseDescription.new(@cursor, @board, true)
  3146.     update_help
  3147.     @commands = ["Health Points", "Magic Points", "Strength", "Power Defense",
  3148.                 "Intelligence", "Magic Defense", "Agility", "Dexterity",
  3149.                 "Skill", "Weapon", "Armor", "Empty"]
  3150.     @command_window = Window_Command.new(192, @commands)
  3151.     @command_window.back_opacity = 160
  3152.     @command_window.x = 160 - @command_window.width / 2
  3153.     @command_window.y = 240 - @command_window.height / 2
  3154.     @command_window.index = -1
  3155.     @command_window.active = false
  3156.     @command_window.visible = false
  3157.     width = 640 - @command_window.width - @command_window.x * 2
  3158.     @input_window = []
  3159.     for i in 0..5
  3160.       if i == 5
  3161.         @input_window.push(Window_InputNumber.new(3, "Set a level",      width))
  3162.       elsif i == 4
  3163.         @input_window.push(Window_InputNumber.new(3, "Set an AP cost",   width))
  3164.       else
  3165.         @input_window.push(Window_InputNumber.new(3, "Set value #{i+1}", width))
  3166.       end
  3167.       @input_window[i].back_opacity = 160
  3168.       @input_window[i].x = 160 + @command_window.width / 2
  3169.       @input_window[i].y = @command_window.y + @input_window[i].height * i
  3170.       @input_window[i].active = false
  3171.       @input_window[i].visible = false
  3172.     end
  3173.     @confirm_window = Window_Command.new(192, ["Save changes","Discard changes"])
  3174.     @confirm_window.back_opacity = 160
  3175.     @confirm_window.x = 320 - @confirm_window.width / 2
  3176.     @confirm_window.y = 240 - @confirm_window.height / 2
  3177.     @confirm_window.index = -1
  3178.     @confirm_window.active = false
  3179.     @confirm_window.visible = false
  3180.     Graphics.transition
  3181.     loop do
  3182.       Graphics.update
  3183.       Input.update
  3184.       update
  3185.       if $scene != self
  3186.         break
  3187.       end  
  3188.     end
  3189.     Graphics.freeze
  3190.     @spriteset.dispose
  3191.     @cursor.dispose
  3192.     @shadow_sprite.dispose
  3193.     @help_sprite.dispose
  3194.     @command_window.dispose
  3195.     for i in 0..5
  3196.       @input_window[i].dispose
  3197.     end
  3198.     @confirm_window.dispose
  3199.   end
  3200.   #--------------------------------------------------------------------------
  3201.   # * Frame Update
  3202.   #--------------------------------------------------------------------------
  3203.   def update
  3204.     @spriteset.update
  3205.     @cursor.update
  3206.     @help_sprite.update
  3207.     if @command_window.active
  3208.       loop do
  3209.         Graphics.update
  3210.         Input.update
  3211.         @command_window.update
  3212.         update_command
  3213.         if !@command_window.active
  3214.           break
  3215.         end
  3216.       end
  3217.       return
  3218.     end
  3219.     for i in 0..5
  3220.       if @input_window[i].active
  3221.         loop do
  3222.           Graphics.update
  3223.           Input.update
  3224.           @input_window[i].update
  3225.           update_input(i)
  3226.           if !@input_window[i].active
  3227.             break
  3228.           end
  3229.         end
  3230.         return
  3231.       end
  3232.     end
  3233.     if @confirm_window.active
  3234.       loop do
  3235.         Graphics.update
  3236.         Input.update
  3237.         @confirm_window.update
  3238.         update_confirm
  3239.         if !@confirm_window.active
  3240.           break
  3241.         end
  3242.       end
  3243.       return
  3244.     end
  3245.     if Input.repeat?(Input.dir8)
  3246.       $game_system.se_play($data_system.cursor_se)
  3247.       update_cursor
  3248.       update_help
  3249.     end
  3250.     if Input.trigger?(Input::A)
  3251.       $game_system.se_play($data_system.decision_se)
  3252.       x, y = @cursor.tile_x, @cursor.tile_y
  3253.       visible = @board.visible?(x, y) == true ? false : true
  3254.       @board.visible(x, y, visible)
  3255.       @help_sprite.refresh
  3256.       @help_sprite.update
  3257.       return
  3258.     end
  3259.     if Input.trigger?(Input::B)
  3260.       $game_system.se_play($data_system.cancel_se)
  3261.       @confirm_window.index = 0
  3262.       @confirm_window.active = true
  3263.       @confirm_window.visible = true
  3264.       return
  3265.     end
  3266.     if Input.trigger?(Input::C)
  3267.       $game_system.se_play($data_system.decision_se)
  3268.       @command_window.index = 0
  3269.       @command_window.active = true
  3270.       @command_window.visible = true
  3271.       return
  3272.     end
  3273.   end
  3274.   #--------------------------------------------------------------------------
  3275.   # * Help Update
  3276.   #--------------------------------------------------------------------------
  3277.   def update_help
  3278.     x, y = @cursor.tile_x, @cursor.tile_y
  3279.     if @board.valid?(x, y)
  3280.       @help_sprite.true_y = 360
  3281.       @help_sprite.true_opacity = 255
  3282.     else
  3283.       @help_sprite.true_y = 370
  3284.       @help_sprite.true_opacity = 0
  3285.     end
  3286.   end
  3287.   #--------------------------------------------------------------------------
  3288.   # * Cursor Update
  3289.   #--------------------------------------------------------------------------
  3290.   def update_cursor
  3291.     xs, ys = TILE_X_SIZE, TILE_Y_SIZE
  3292.     max_x = 640 / xs - 1
  3293.     max_y = 480 / ys - 1
  3294.     margin = BOARD_MARGIN
  3295.     case Input.dir8
  3296.     when 2  # Down
  3297.       @cursor.tile_y += 1
  3298.       if @cursor.py < max_y - margin
  3299.         @cursor.py += 1
  3300.       elsif @cursor.tile_y >= @board.ysize
  3301.         @cursor.py = margin
  3302.       end
  3303.     when 4  # Left
  3304.       @cursor.tile_x -= 1
  3305.       if @cursor.px > margin
  3306.         @cursor.px -= 1
  3307.       elsif @cursor.tile_x < 0
  3308.         @cursor.px = max_x - margin
  3309.       end
  3310.     when 6  # Right
  3311.       @cursor.tile_x += 1
  3312.       if @cursor.px < max_x - margin
  3313.         @cursor.px += 1
  3314.       elsif @cursor.tile_x >= @board.xsize
  3315.         @cursor.px = margin
  3316.       end
  3317.     when 8  # Up
  3318.       @cursor.tile_y -= 1
  3319.       if @cursor.py > margin
  3320.         @cursor.py -= 1
  3321.       elsif @cursor.tile_y < 0
  3322.         @cursor.py = max_y - margin
  3323.       end
  3324.     end
  3325.     @cursor.tile_x %= @board.xsize
  3326.     @cursor.tile_y %= @board.ysize
  3327.     cx = (@cursor.px - @cursor.tile_x) * xs
  3328.     cy = (@cursor.py - @cursor.tile_y) * ys
  3329.     @spriteset.tiles.true_x  = cx
  3330.     @spriteset.tiles.true_y  = cy
  3331.     @spriteset.icons.true_x  = cx
  3332.     @spriteset.icons.true_y  = cy
  3333.     @spriteset.active.true_x = cx
  3334.     @spriteset.active.true_y = cy
  3335.     @cursor.true_x = (@cursor.px * xs) - 20
  3336.     @cursor.true_y = (@cursor.py * ys) - 4
  3337.   end
  3338.   #--------------------------------------------------------------------------
  3339.   # * Command Window Update
  3340.   #--------------------------------------------------------------------------
  3341.   def update_command
  3342.     if Input.trigger?(Input::B)
  3343.       $game_system.se_play($data_system.cancel_se)
  3344.       @command_window.index = -1
  3345.       @command_window.active = false
  3346.       @command_window.visible = false
  3347.       @command_window.update
  3348.       @help_sprite.refresh
  3349.       update_help
  3350.       return
  3351.     end
  3352.     if Input.trigger?(Input::C)
  3353.       $game_system.se_play($data_system.decision_se)
  3354.       length = @commands.length - 1
  3355.       if @command_window.index == length
  3356.         @command_window.index = -1
  3357.         @command_window.active = false
  3358.         @command_window.visible = false
  3359.         @command_window.update
  3360.         x, y = @cursor.tile_x, @cursor.tile_y
  3361.         @board.reset_tile(x, y)
  3362.         @spriteset.refresh
  3363.         @help_sprite.refresh
  3364.         update_help
  3365.       else
  3366.         @command_window.active = false
  3367.         @command_window.update
  3368.         @input_window[0].number = 0
  3369.         @input_window[0].active = true
  3370.         @input_window[0].visible = true
  3371.         @input_window[0].update
  3372.       end
  3373.       return
  3374.     end
  3375.   end
  3376.   #--------------------------------------------------------------------------
  3377.   # * Input Window Update
  3378.   #--------------------------------------------------------------------------
  3379.   def update_input(i)
  3380.     if Input.trigger?(Input::B)
  3381.       $game_system.se_play($data_system.cancel_se)
  3382.       if i == 0
  3383.         @command_window.active = true
  3384.         @command_window.update
  3385.       else
  3386.         @input_window[i - 1].active = true
  3387.         @input_window[i - 1].visible = true
  3388.         @input_window[i - 1].update
  3389.       end
  3390.       @input_window[i].active = false
  3391.       @input_window[i].visible = false
  3392.       @input_window[i].update
  3393.       return
  3394.     end
  3395.     if Input.trigger?(Input::C)
  3396.       $game_system.se_play($data_system.decision_se)
  3397.       @input_window[i].active = false
  3398.       @input_window[i].update
  3399.       if i == 5
  3400.         @command_window.visible = false
  3401.         for i in 0..5
  3402.           @input_window[i].visible = false
  3403.         end
  3404.         x, y = @cursor.tile_x, @cursor.tile_y
  3405.         input = [@input_window[4].number, @command_window.index,
  3406.                  @input_window[0].number, @input_window[1].number,
  3407.                  @input_window[2].number, @input_window[3].number,
  3408.                  @input_window[5].number == 0 ? -1 : @input_window[5].number]
  3409.         @board.set_tile(x, y, input)
  3410.         @spriteset.refresh
  3411.         @help_sprite.refresh
  3412.         update_help
  3413.       else
  3414.         @input_window[i + 1].number = 0
  3415.         @input_window[i + 1].active = true
  3416.         @input_window[i + 1].visible = true
  3417.         @input_window[i + 1].update
  3418.       end
  3419.       return
  3420.     end
  3421.   end
  3422.   #--------------------------------------------------------------------------
  3423.   # * Confirm Window Update
  3424.   #--------------------------------------------------------------------------
  3425.   def update_confirm
  3426.     if Input.trigger?(Input::B)
  3427.       $game_system.se_play($data_system.cancel_se)
  3428.       @confirm_window.index = -1
  3429.       @confirm_window.active = false
  3430.       @confirm_window.visible = false
  3431.       @confirm_window.update
  3432.       return
  3433.     end
  3434.     if Input.trigger?(Input::C)
  3435.       if @confirm_window.index == 0
  3436.         $game_system.se_play($data_system.decision_se)
  3437.         boards = get_boards
  3438.         boards[@board.id] = @board.board
  3439.         save_boards(boards)
  3440.       end
  3441.       @confirm_window.index = -1
  3442.       @confirm_window.active = false
  3443.       @confirm_window.visible = false
  3444.       @confirm_window.update
  3445.       $scene = Scene_EditBoard.new(@board.id)
  3446.       return
  3447.     end
  3448.   end
  3449. end
  3450.  
  3451. #==============================================================================
  3452. # ** Board
  3453. #------------------------------------------------------------------------------
  3454. #
  3455. #  This class defines a board and all of its settings. Board data is found in
  3456. #  the Data folder under the name Board.rxdata. Refer to the Board Module in
  3457. #  order to learn how to make a Board.rxdata file.
  3458. #
  3459. #------------------------------------------------------------------------------
  3460. #
  3461. #  Boards.rxdata
  3462. #
  3463. #  Boards are stored in Table[] BOARDS.
  3464. #
  3465. #      BOARDS = Table[BOARD_0, BOARD_1, BOARD_2, ...]
  3466. #
  3467. #  Each board is a Table with three dimensions (x, y, z), BOARD_n, where n is
  3468. #  an integer equal to or greater than 0.
  3469. #
  3470. #      BOARD_n = Table.new(x, y, z)
  3471. #
  3472. #  Dimensions x and y measure, respectively, the Table's width and height.
  3473. #  Dimension z manages attributes such as ACTIVATED, VISIBLE, AP COST, TYPE,
  3474. #  VALUE and LEVEL. This data is stored as integers.
  3475. #
  3476. #  If BOARD_n[x, y, 0] = v, this means the space occupied by the coordinate
  3477. #  (x, y) when z is equal to 0 is equal to v. If v is equal to 0, then tile
  3478. #  (x, y) is false or NOT ACTIVATED. If v is equal to 1, then tile (x, y) is
  3479. #  true or ACTIVATED.
  3480. #
  3481. #  The following figure outlines the board data structure:
  3482. #
  3483. #      x : 24 (default)
  3484. #      y : 24 (default)
  3485. #      z :
  3486. #          0 : ACTIVATED
  3487. #              0 : false
  3488. #              1 : true
  3489. #          1 : VISIBLE
  3490. #              0 : false
  3491. #              1 : true
  3492. #          2 : AP COST
  3493. #          3 : TYPE
  3494. #              -1 : nothing
  3495. #              0  : hp
  3496. #              1  : mp
  3497. #              2  : str
  3498. #              3  : pdef
  3499. #              4  : int
  3500. #              5  : mdef
  3501. #              6  : agi
  3502. #              7  : dex
  3503. #              8  : skill
  3504. #              9  : weapon
  3505. #              10 : armor
  3506. #          4, 5, 6, 7 : VALUE
  3507. #              statistic boost
  3508. #              skill id
  3509. #              weapon id
  3510. #              armor id
  3511. #          8 : LEVEL
  3512. #
  3513. #  By default, all slots are NOT ACTIVATED, NOT VISIBLE, AP COST 0, TYPE -1,
  3514. #  VALUE 0 and LEVEL -1.
  3515. #
  3516. #  The following code excerpt creates an empty board:
  3517. #
  3518. #    BOARD_n = Table.new(24, 24, 9)
  3519. #    for x in 0...BOARD_n.xsize
  3520. #      for y in 0...BOARD_n.ysize
  3521. #        for z in 0...BOARD_n.zsize
  3522. #          case z
  3523. #          when 0  # ACTIVATED
  3524. #            BOARD_n[x, y, z] = 0
  3525. #          when 1  # VISIBLE
  3526. #            BOARD_n[x, y, z] = 0
  3527. #          when 2  # AP COST
  3528. #            BOARD_n[x, y, z] = 0
  3529. #          when 3  # TYPE
  3530. #            BOARD_n[x, y, z] = -1
  3531. #          when 4  # OBJECT 1 VALUE
  3532. #            BOARD_n[x, y, z] = 0
  3533. #          when 5  # OBJECT 2 VALUE
  3534. #            BOARD_n[x, y, z] = 0
  3535. #          when 6  # OBJECT 3 VALUE
  3536. #            BOARD_n[x, y, z] = 0
  3537. #          when 7  # OBJECT 4 VALUE
  3538. #            BOARD_n[x, y, z] = 0
  3539. #          when 8  # LEVEL
  3540. #            BOARD_n[x, y, z] = -1
  3541. #          end
  3542. #        end
  3543. #      end
  3544. #    end
  3545. #
  3546. #  Once created, boards can be edited manually. Simply type in a coordinate
  3547. #  (x, y), an attribute number and a value. Always start with OBJECT 1 VALUE,
  3548. #  since this value is necessary to compute board data. You might have up to
  3549. #  four different values in a single coordinate (x, y). Hence, if you're TYPE
  3550. #  is a skill, by activating tile (x, y) you can learn up to four skills.
  3551. #
  3552. #  The following code excerpt creates a coordinate (x, y) with four skills:
  3553. #
  3554. #      # Define ACTIVATED
  3555. #      BOARD_n[x, y, 0] = 0
  3556. #      # Define VISIBLE
  3557. #      BOARD_n[x, y, 1] = 0
  3558. #      # Define AP COST
  3559. #      BOARD_n[x, y, 2] = 40
  3560. #      # Define TYPE
  3561. #      BOARD_n[x, y, 3] = 8
  3562. #      # Define OBJECT 1 VALUE
  3563. #      BOARD_n[x, y, 4] = 1
  3564. #      # Define OBJECT 2 VALUE
  3565. #      BOARD_n[x, y, 5] = 2
  3566. #      # Define OBJECT 3 VALUE
  3567. #      BOARD_n[x, y, 6] = 3
  3568. #      # Define OBJECT 4 VALUE
  3569. #      BOARD_n[x, y, 7] = 4
  3570. #      # Define LEVEL
  3571. #      BOARD_n[x, y, 8] = 9
  3572. #
  3573. #  Tile (x, y) is NOT ACTIVATED and NOT VISIBLE. To activate tile (x, y), you
  3574. #  need to spend 40 ability points. Tile (x, y) TYPE is a skill with values
  3575. #  1, 2, 3 and 4. By activating this tile you will learn skills 1, 2, 3 and 4.
  3576. #
  3577. #   _____   The attribute AP COST appears in the lower left corner of the
  3578. #  |    9|  tile. The attribute LEVEL appears in the upper right corner of
  3579. #  |     |  the tile. If LEVEL is equal to -1, then no level will be shown
  3580. #  |40___|  and OBJECT 1 will be used as the tile's class name.
  3581. #
  3582. #  To write a file, simply edit the boards Method in the BOARDS Module and
  3583. #  type in the following code excerpt in the Main Class:
  3584. #
  3585. #      BOARDS::boards
  3586. #
  3587. #  Boards graphic files and text can be edited in the FFXII Module.
  3588. #
  3589. #==============================================================================
  3590.  
  3591. class Board
  3592.   #--------------------------------------------------------------------------
  3593.   # * Invariables
  3594.   #--------------------------------------------------------------------------
  3595.   include FFXII                           # FFXII module
  3596.   #--------------------------------------------------------------------------
  3597.   # * Public Instance Variables
  3598.   #--------------------------------------------------------------------------
  3599.   attr_reader   :id                       # board ID
  3600.   attr_reader   :board                    # board table
  3601.   attr_reader   :xsize                    # board x size
  3602.   attr_reader   :ysize                    # board y size
  3603.   attr_accessor :hp                       # health points
  3604.   attr_accessor :sp                       # special points
  3605.   attr_accessor :str                      # strength
  3606.   attr_accessor :pdef                     # physical defense
  3607.   attr_accessor :int                      # intelligence
  3608.   attr_accessor :mdef                     # magic defense
  3609.   attr_accessor :agi                      # agility
  3610.   attr_accessor :dex                      # dexterity
  3611.   attr_accessor :skills                   # skills
  3612.   attr_accessor :weapon_set               # weapon set
  3613.   attr_accessor :armor_set                # armor set
  3614.   #--------------------------------------------------------------------------
  3615.   # * Object Initialization
  3616.   #     board_id : board ID
  3617.   #--------------------------------------------------------------------------
  3618.   def initialize(board_id)
  3619.     @id = board_id
  3620.     @board = $data_boards[@id].dup
  3621.     @xsize = @board.xsize
  3622.     @ysize = @board.ysize
  3623.     reset
  3624.   end
  3625.   #--------------------------------------------------------------------------
  3626.   # * Reset Board
  3627.   #--------------------------------------------------------------------------
  3628.   def reset
  3629.     @hp = 0
  3630.     @sp = 0
  3631.     @str = 0
  3632.     @pdef = 0
  3633.     @int = 0
  3634.     @mdef = 0
  3635.     @agi = 0
  3636.     @dex = 0
  3637.     @skills = []
  3638.     @weapon_set = []
  3639.     @armor_set = []
  3640.   end
  3641.   #--------------------------------------------------------------------------
  3642.   # * Reset Tile
  3643.   #     x : board x-coordinate
  3644.   #     y : board y-coordinate
  3645.   #--------------------------------------------------------------------------
  3646.   def reset_tile(x, y)
  3647.     activated(x, y, false)
  3648.     visible(x, y, false)
  3649.     ap_cost(x, y, 0)
  3650.     type(x, y, -1)
  3651.     for i in 0..3
  3652.       value(x, y, 0, i)
  3653.     end
  3654.     level(x, y, -1)
  3655.   end
  3656.   #--------------------------------------------------------------------------
  3657.   # * Determine if Valid
  3658.   #     x : board x-coordinate
  3659.   #     y : board y-coordinate
  3660.   #--------------------------------------------------------------------------
  3661.   def valid?(x, y)
  3662.     return @board[x, y, 3] >= 0 rescue false
  3663.   end
  3664.   #--------------------------------------------------------------------------
  3665.   # * Activate Slot
  3666.   #     x       : board x-coordinate
  3667.   #     y       : board y-coordinate
  3668.   #     boolean : false / true
  3669.   #--------------------------------------------------------------------------
  3670.   def activate(x, y, boolean)
  3671.     @board[x, y, 0] = [false, true].index(boolean)
  3672.     for obj in 0..3
  3673.       n = value?(x, y, obj)
  3674.       case type?(x, y)
  3675.       when 0   # HP
  3676.         @hp += n
  3677.       when 1   # SP
  3678.         @sp += n
  3679.       when 2   # Strength
  3680.         @str += n
  3681.       when 3   # Physical Defense
  3682.         @pdef += n
  3683.       when 4   # Intelligence
  3684.         @int += n
  3685.       when 5   # Magic Defense
  3686.         @mdef += n
  3687.       when 6   # Agility
  3688.         @agi += n
  3689.       when 7   # Dexterity
  3690.         @dex += n
  3691.       when 8   # Skills
  3692.         @skills.push(n)
  3693.       when 9   # Weapon Set
  3694.         @weapon_set.push(n)
  3695.       when 10  # Armor Set
  3696.         @armor_set.push(n)
  3697.       end
  3698.     end
  3699.     if (y - 1) >= 0
  3700.       if valid?(x, y - 1)  # Up
  3701.         visible(x, y - 1, true)
  3702.       end
  3703.     end
  3704.     if (y + 1) < @board.ysize
  3705.       if valid?(x, y + 1)  # Down
  3706.         visible(x, y + 1, true)
  3707.       end
  3708.     end
  3709.     if (x - 1) >= 0
  3710.       if valid?(x - 1, y)  # Left
  3711.         visible(x - 1, y, true)
  3712.       end
  3713.     end
  3714.     if (x + 1) < @board.xsize
  3715.       if valid?(x + 1, y)  # Right
  3716.         visible(x + 1, y, true)
  3717.       end
  3718.     end
  3719.   end
  3720.   #--------------------------------------------------------------------------
  3721.   # * Set Activated
  3722.   #     x       : board x-coordinate
  3723.   #     y       : board y-coordinate
  3724.   #     boolean : false / true
  3725.   #--------------------------------------------------------------------------
  3726.   def activated(x, y, bool)
  3727.     @board[x, y, 0] = bool == true ? 1 : 0
  3728.   end
  3729.   #--------------------------------------------------------------------------
  3730.   # * Set Visible
  3731.   #     x       : board x-coordinate
  3732.   #     y       : board y-coordinate
  3733.   #     boolean : false / true
  3734.   #--------------------------------------------------------------------------
  3735.   def visible(x, y, bool)
  3736.     @board[x, y, 1] = bool == true ? 1 : 0
  3737.   end
  3738.   #--------------------------------------------------------------------------
  3739.   # * Set AP Cost
  3740.   #     x       : board x-coordinate
  3741.   #     y       : board y-coordinate
  3742.   #     ap_cost : AP cost
  3743.   #--------------------------------------------------------------------------
  3744.   def ap_cost(x, y, ap_cost)
  3745.     @board[x, y, 2] = ap_cost
  3746.   end
  3747.   #--------------------------------------------------------------------------
  3748.   # * Set Type
  3749.   #     x    : board x-coordinate
  3750.   #     y    : board y-coordinate
  3751.   #     type : type
  3752.   #--------------------------------------------------------------------------
  3753.   def type(x, y, type)
  3754.     @board[x, y, 3] = type
  3755.   end
  3756.   #--------------------------------------------------------------------------
  3757.   # * Set Value
  3758.   #     x     : board x-coordinate
  3759.   #     y     : board y-coordinate
  3760.   #     value : value
  3761.   #     obj   : object ID
  3762.   #--------------------------------------------------------------------------
  3763.   def value(x, y, value, obj = 0)
  3764.     @board[x, y, 4 + obj] = value
  3765.   end
  3766.   #--------------------------------------------------------------------------
  3767.   # * Set Level
  3768.   #     x     : board x-coordinate
  3769.   #     y     : board y-coordinate
  3770.   #     level : level
  3771.   #--------------------------------------------------------------------------
  3772.   def level(x, y, level)
  3773.     @board[x, y, 8] = level
  3774.   end
  3775.   #--------------------------------------------------------------------------
  3776.   # * Set Tile
  3777.   #     x         : board x-coordinate
  3778.   #     y         : board y-coordinate
  3779.   #     input     : input
  3780.   #--------------------------------------------------------------------------
  3781.   def set_tile(x, y, input)
  3782.     if input
  3783.       ap_cost(x, y, input[0])
  3784.       type(x, y, input[1])
  3785.       for i in 0..3
  3786.         value(x, y, input[2 + i], i)
  3787.       end
  3788.       level(x, y, input[6])
  3789.     end
  3790.   end
  3791.   #--------------------------------------------------------------------------
  3792.   # * Get Activated
  3793.   #     x : board x-coordinate
  3794.   #     y : board y-coordinate
  3795.   #--------------------------------------------------------------------------
  3796.   def activated?(x, y)
  3797.     return [false, true][@board[x, y, 0]]
  3798.   end
  3799.   #--------------------------------------------------------------------------
  3800.   # * Get Visible
  3801.   #     x : board x-coordinate
  3802.   #     y : board y-coordinate
  3803.   #--------------------------------------------------------------------------
  3804.   def visible?(x, y)
  3805.     return [false, true][@board[x, y, 1]]
  3806.   end
  3807.   #--------------------------------------------------------------------------
  3808.   # * Get AP Cost
  3809.   #     x : board x-coordinate
  3810.   #     y : board y-coordinate
  3811.   #--------------------------------------------------------------------------
  3812.   def ap_cost?(x, y)
  3813.     if @board[x, y, 2]
  3814.       return @board[x, y, 2]
  3815.     end
  3816.     return 0
  3817.   end
  3818.   #--------------------------------------------------------------------------
  3819.   # * Get Type
  3820.   #     x : board x-coordinate
  3821.   #     y : board y-coordinate
  3822.   #--------------------------------------------------------------------------
  3823.   def type?(x, y)
  3824.     if @board[x, y, 3]
  3825.       return @board[x, y, 3]
  3826.     end
  3827.     return -1
  3828.   end
  3829.   #--------------------------------------------------------------------------
  3830.   # * Get Value
  3831.   #     x   : board x-coordinate
  3832.   #     y   : board y-coordinate
  3833.   #     obj : object ID
  3834.   #--------------------------------------------------------------------------
  3835.   def value?(x, y, obj = 0)
  3836.     if @board[x, y, 4 + obj]
  3837.       return @board[x, y, 4 + obj]
  3838.     end
  3839.     return 0
  3840.   end
  3841.   #--------------------------------------------------------------------------
  3842.   # * Get Level
  3843.   #     x : board x-coordinate
  3844.   #     y : board y-coordinate
  3845.   #--------------------------------------------------------------------------
  3846.   def level?(x, y)
  3847.     if @board[x, y, 8]
  3848.       return @board[x, y, 8]
  3849.     end
  3850.     return -1
  3851.   end
  3852.   #--------------------------------------------------------------------------
  3853.   # * Get Board Name
  3854.   #--------------------------------------------------------------------------
  3855.   def name
  3856.     return BOARD_NAME(@id)
  3857.   end
  3858.   #--------------------------------------------------------------------------
  3859.   # * Get Board Statistics
  3860.   #--------------------------------------------------------------------------
  3861.   def statistics
  3862.     stats = []
  3863.     for x in [email hidden]
  3864.       for y in [email hidden]
  3865.         type = type?(x, y)
  3866.         if type >= 0 and type < 8
  3867.           value = value?(x, y)
  3868.         stats[type] += value rescue
  3869.           stats[type] = value
  3870.         elsif type >= 8
  3871.           for i in 0..3
  3872.             value = value?(x, y, i)
  3873.             if value > 0
  3874.               stats[type] += 1 rescue
  3875.               stats[type] = 1
  3876.             end
  3877.           end
  3878.         end
  3879.       end
  3880.     end
  3881.     return stats
  3882.   end
  3883.   #--------------------------------------------------------------------------
  3884.   # * Get Item
  3885.   #     x   : board x-coordinate
  3886.   #     y   : board y-coordinate
  3887.   #     obj : object ID
  3888.   #--------------------------------------------------------------------------
  3889.   def item(x, y, obj = 0)
  3890.     type = type?(x, y)
  3891.     value = value?(x, y, obj)
  3892.     return BOARD_ITEM(type, value)
  3893.   end
  3894.   #--------------------------------------------------------------------------
  3895.   # * Get Description
  3896.   #     x   : board x-coordinate
  3897.   #     y   : board y-coordinate
  3898.   #     obj : object ID
  3899.   #--------------------------------------------------------------------------
  3900.   def description(x, y, obj = 0)
  3901.     type = type?(x, y)
  3902.     value = value?(x, y, obj)
  3903.     return BOARD_DESCRIPTION(type, value)
  3904.   end
  3905.   #--------------------------------------------------------------------------
  3906.   # * Get Class
  3907.   #     x : board x-coordinate
  3908.   #     y : board y-coordinate
  3909.   #--------------------------------------------------------------------------
  3910.   def class(x, y)
  3911.     type = type?(x, y)
  3912.     value = value?(x, y)
  3913.     level = level?(x, y)
  3914.     return BOARD_CLASS(type, value, level)
  3915.   end
  3916. end
  3917.  
  3918. #==============================================================================
  3919. # ** Cursor_Board
  3920. #------------------------------------------------------------------------------
  3921. #  This sprite is used to display the cursor. It observes the Scene_Board
  3922. #  class and automatically changes sprite conditions.
  3923. #==============================================================================
  3924.  
  3925. class Cursor_Board < Sprite_Cursor
  3926.   #--------------------------------------------------------------------------
  3927.   # * Public Instance Variables
  3928.   #--------------------------------------------------------------------------
  3929.   attr_accessor :tile_x                   # tile x
  3930.   attr_accessor :tile_y                   # tile y
  3931.   attr_accessor :px                       # pan x
  3932.   attr_accessor :py                       # pan y
  3933.   #--------------------------------------------------------------------------
  3934.   # * Object Initialization
  3935.   #     board    : board
  3936.   #     x        : cursor x-coordinate
  3937.   #     y        : cursor y-coordinate
  3938.   #     viewport : viewport
  3939.   #--------------------------------------------------------------------------
  3940.   def initialize(board, x = 0, y = 0, viewport = nil)
  3941.     super(viewport)
  3942.     @board = board
  3943.     @tile_x, @tile_y = x, y
  3944.     @px, @py = 0, 0
  3945.   end
  3946. end
  3947.  
  3948.  
  3949. #=================
  3950. # Custom AP Stuff
  3951. #=================
  3952.  
  3953. class Scene_Battle
  3954.   include FFXII
  3955.   def gain_exp
  3956.     exp = exp_gained
  3957.     for i in 0...$game_party.actors.size
  3958.       actor = $game_party.actors[i]
  3959.      
  3960.       # Gain AP instead of EXP
  3961.       actor.ap += exp_gained
  3962.     end
  3963.     return exp
  3964.   end
  3965. end
  3966.  
Expand to see the code.


Also, the scripts I am using are:
Content Hidden Spoiler
Ultimate Splash Scene 3.1.2 Plug-n-Play Edition
Glitchfinder's Multiple Timers
FFXII License Board (Merged with Moghunter's Title Screen for compatibility)
Wachunga's Auto Font Installer
RPG Advocate's Custom Debugger
Fantasist's Transition Pack
Modified Advanced Weather System
Guillaume777's Multi-Slot Equipment
Nechigawara's Skill Shop
Prexus' Music Selector
MiDas Mike's Credits (duplicate for prologue)
PreXCraft
SephirothSpawn's Slanted Bars
Cogwheel's Pixelmovement
Tileset Changer
All of Moghunter's Menu enhancements (except the level up one, it's not compatible with something.)


I don't know exactly how your script works, or if you'd have to totally rewrite it for this to happen, but I would be eternally grateful if you could make it work like that. I have 88 different board IDs for each class if that helps. Thanks in advance.
Rathuldr, it wouldn't be too difficult to change the board according to each character's class. However, this can't be done directly with my script, it must be done with whatever script you're using to change character classes. It must be done like this, since the Game_Actor class isn't regularly updated.

As for keeping all of the learned parameters, this would require extensive rewriting of the script, particularly the Game_Actor class. Here's the updated version of the Game_Actor class, if you're interested in giving it a shot.

  1. #==============================================================================
  2. # ** Game_Actor
  3. #------------------------------------------------------------------------------
  4. #  This class handles the actor. It's used within the Game_Actors class
  5. #  ($game_actors) and refers to the Game_Party class ($game_party).
  6. #==============================================================================
  7.  
  8. class Game_Actor < Game_Battler
  9.   #--------------------------------------------------------------------------
  10.   # * Invariables
  11.   #--------------------------------------------------------------------------
  12.   include FFXII                           # Final Fantasy XII module
  13.   #--------------------------------------------------------------------------
  14.   # * Public Instance Variables
  15.   #--------------------------------------------------------------------------
  16.   attr_reader   :board                    # board ID
  17.   attr_reader   :ap                       # ability points
  18.   #--------------------------------------------------------------------------
  19.   # * Setup
  20.   #     actor_id : actor ID
  21.   #--------------------------------------------------------------------------
  22.   alias mslb_game_actor_setup setup
  23.   def setup(actor_id)
  24.     board_id = actor_id == 1 ? 0 :
  25.                actor_id == 2 ? 1 :
  26.                actor_id == 3 ? 0 :
  27.                actor_id == 4 ? 1 :
  28.                actor_id == 5 ? 0 :
  29.                actor_id == 6 ? 1 : 0
  30.     @board = Board.new(board_id)
  31.     @ap = 0
  32.     mslb_game_actor_setup(actor_id)
  33.   end
  34.   #--------------------------------------------------------------------------
  35.   # * Get AP
  36.   #--------------------------------------------------------------------------
  37.   def ap=(ap)
  38.     @ap = [[ap, 0].max, AP_MAX].min
  39.   end
  40.   #--------------------------------------------------------------------------
  41.   # * Get Maximum HP
  42.   #--------------------------------------------------------------------------
  43.   def maxhp
  44.     n = [[base_maxhp + @maxhp_plus, 1].max, 9999].min
  45.     for i in @states
  46.       n *= $data_states[i].maxhp_rate / 100.0
  47.     end
  48.     n += @board.hp
  49.     n = [[Integer(n), 1].max, 9999].min
  50.     return n
  51.   end
  52.   #--------------------------------------------------------------------------
  53.   # * Get Maximum SP
  54.   #--------------------------------------------------------------------------
  55.   def maxsp
  56.     n = [[base_maxsp + @maxsp_plus, 0].max, 999].min
  57.     for i in @states
  58.       n *= $data_states[i].maxsp_rate / 100.0
  59.     end
  60.     n += @board.sp
  61.     n = [[Integer(n), 0].max, 999].min
  62.     return n
  63.   end
  64.   #--------------------------------------------------------------------------
  65.   # * Get Strength
  66.   #--------------------------------------------------------------------------
  67.   def str
  68.     n = [[base_str + @str_plus, 1].max, 99].min
  69.     for i in @states
  70.       n *= $data_states[i].str_rate / 100.0
  71.     end
  72.     n += @board.str
  73.     n = [[Integer(n), 1].max, 99].min
  74.     return n
  75.   end
  76.   #--------------------------------------------------------------------------
  77.   # * Get Intelligence
  78.   #--------------------------------------------------------------------------
  79.   def int
  80.     n = [[base_int + @int_plus, 1].max, 99].min
  81.     for i in @states
  82.       n *= $data_states[i].int_rate / 100.0
  83.     end
  84.     n += @board.int
  85.     n = [[Integer(n), 1].max, 99].min
  86.     return n
  87.   end
  88.   #--------------------------------------------------------------------------
  89.   # * Get Dexterity
  90.   #--------------------------------------------------------------------------
  91.   def dex
  92.     n = [[base_dex + @dex_plus, 1].max, 99].min
  93.     for i in @states
  94.       n *= $data_states[i].dex_rate / 100.0
  95.     end
  96.     n += @board.dex
  97.     n = [[Integer(n), 1].max, 99].min
  98.     return n
  99.   end
  100.   #--------------------------------------------------------------------------
  101.   # * Get Agility
  102.   #--------------------------------------------------------------------------
  103.   def agi
  104.     n = [[base_agi + @agi_plus, 1].max, 99].min
  105.     for i in @states
  106.       n *= $data_states[i].agi_rate / 100.0
  107.     end
  108.     n += @board.agi
  109.     n = [[Integer(n), 1].max, 99].min
  110.     return n
  111.   end
  112.   #--------------------------------------------------------------------------
  113.   # * Get Physical Defense
  114.   #--------------------------------------------------------------------------
  115.   def pdef
  116.     n = [[base_pdef, 0].max, 999].min
  117.     for i in @states
  118.       n *= $data_states[i].pdef_rate / 100.0
  119.     end
  120.     n += @board.pdef
  121.     n = [[Integer(n), 0].max, 999].min
  122.     return n
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   # * Get Magic Defense
  126.   #--------------------------------------------------------------------------
  127.   def mdef
  128.     n = [[base_mdef, 0].max, 999].min
  129.     for i in @states
  130.       n *= $data_states[i].mdef_rate / 100.0
  131.     end
  132.     n += @board.mdef
  133.     n = [[Integer(n), 0].max, 999].min
  134.     return n
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # * Determine if Equippable
  138.   #     item : item
  139.   #--------------------------------------------------------------------------
  140.   def equippable?(item)
  141.     # If weapon
  142.     if item.is_a?(RPG::Weapon)
  143.       weapon_set = $data_classes[@class_id].weapon_set
  144.       weapon_set = @board.weapon_set | weapon_set
  145.       # If included among equippable weapons in current class and board
  146.       if weapon_set.include?(item.id)
  147.         return true
  148.       end
  149.     end
  150.     # If armor
  151.     if item.is_a?(RPG::Armor)
  152.       armor_set = $data_classes[@class_id].armor_set
  153.       armor_set = @board.armor_set | armor_set
  154.       # If included among equippable armor in current class and board
  155.       if armor_set.include?(item.id)
  156.         return true
  157.       end
  158.     end
  159.     return false
  160.   end
  161.   #--------------------------------------------------------------------------
  162.   # * Skills
  163.   #--------------------------------------------------------------------------
  164.   def skills
  165.     @board.skills.sort!
  166.     skills = @board.skills | @skills
  167.     return skills
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # * Determine if Finished Learning Skill
  171.   #     skill_id : skill ID
  172.   #--------------------------------------------------------------------------
  173.   def skill_learn?(skill_id)
  174.     return (@skills + @board.skills).include?(skill_id)
  175.   end
  176. end
Expand to see the code.


I won't do this for you, but I can help you out. I would suggest you have a boards array in the Game_Actor class and have a new variable called current board. Then you simply have to edit the Game_Actor methods to go through all of the boards. You can do this with a simply loop.

If you're not familiar with scripting, find someone to do this for you. If you need help, I'll gladly be of assistance.
Guys, it's finally done, demo and everything. I didn't make a new video. I don't think it's necessary (as the previous video covers all the basics). However, I took a bunch of screenshots to show the differences. I hope you guys like it!

ImageImageImageImageImageImageImageImage
wooot its awesome :thumb: well its already awesome, now its even more :lol: you certainly out did your self for making this @Juan J.Sanchez
havent tinker further with this, but so far its all smooth :thumb:
its a bit laggy when reading description skill that comes out when press X (A keyboard) meaning the finger icon got a bit laggy if we move too fast or keep pressing left/right (i think it happen when the skill already opened) not that big of a problem though. just want to let you know :thumb:
Sadly, I think I've optimized the code as much as I can. Having so much heavy graphics really takes a blow on memory. My only advice would be smaller graphics. Thanks, by the way. I really feel like it's done.
So, what the hell, guys? Did anyone try out the new license board? I'd just like to know if you people like it. :(
hi guys, i dont want to bother you but the download links are not working, I'd really like to try this awesome system 🙂
please, it would be really nice if someone reuploaded the v2.0.0 demo or even just the pictures folder required for test the script, thank you so much in advance, have a nice day :thumb:
I might have the files in my PC. Remind me again tomorrow, please.
Thanks, man! 😀
This is the demo. It includes an encrypted Pictures folder.

http://www.mediafire.com/?scp2v311inorbd8
Thanks dude, I really aprecciate your help, I hope to see more of your work soon :grin:
I'm more than retired from RPG Maker. It heavily interferes with my studies and considering I study medicine I really can't afford not to study. You know, people might die or something.
Very well done sir, :P A lot better than mine :<
Image

Q_Q, But hey thats fine, Mind If I link it on my blog? Also is it okay if I use some of those graphics in my future projects? i got a few ideas from this :3
Have a blast.
Are you the guy who was working on Ace of Spades? That wasn't a bad project.
Yeah, I finished aces hud, and thanks! ^^

This is what I was using the images for:
Image
Image
It looks nice, but images loose definition when you scale them too much. Also, I thought you were using my license board script. You can modify it if you want. It's a pretty good script. It allows multiple party members (not only 4), different boards for each actor, it has an ability list window, it's very animated (very faithful to the original system), it even has zooming. Just saying.
Hello, I hate to be that noob, but when I plug in the script in VX Ace's "Materials > (Insert Here)" section of the script and try to playtest it to see if it works, I get the following error:

Script '(Insert Here)' line 194: NameError occurred.

uninitialized constant RPG::Cache


I (obviously) have no experience with code or scripting. I would love to try and toy with this script, though. If anyone could tell me how to initialize this and the other things I'll need to, or point me to a place that will teach me how to, I would greatly appreciate it, if that is the problem. I may have put the Pictures folder in the wrong location, or put the script in the wrong spot. If you know of any way to help or have any advice, thank you in advance.
im pretty sure this only works for xp, if i recall
I'm sorry, mate. This is for XP and I don't even have a PC at the moment. Find someone who can help you convert it.
I know this maybe sound stupid but how do i change the fonts, im not a scripter i looked in every script you made but i didnt find that option. what do i do?

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