HUNTERDom Feb 17, 2013 11:02 pm
Super Usuario
Final Fantasy XII (12) License Board
INTRODUCCION:
Este script es una réplica casi idéntica de la Junta de Licencias (License Board) Final Fantasy XII. El desarrollo de los personajes en Final Fantasy XII se basa en gran medida en la adquisición de licencias. Se requieren licencias para equipar armas y armaduras, aprender hechizos y técnicas y aumentar las habilidades de un personaje.
CARACTERISTICAS:
Licencia tabla (la tarjeta puede ser único para cada carácter, o puede ser la misma para todos los caracteres)
Editor de la Junta (se puede editar la imagen y las licencias que quieras)
Puntos de la licencia (que se usan para adquirir licencias)
Tamaño de tabla personalizada
La costumbre tarjeta gráfica (baldosas, por ejemplo, el tamaño de azulejo, tamaño de fuente, fondo, primer plano, animaciones, etc)
Los nombres de tabla personalizado (por ejemplo, descripción de la licencia de licencia de clase, etc.)
Compatible con los grupos largos (grupos de más de cuatro caracteres)
VIDEO DE MUESTRA:si no pueden ver el video hagan lo siguiente: Perfil - Preferencias - Siempre permitir HTML : Si
DESCARGA:
CLICK AQUI PARA DESCARGAR LA DEMO
-
CLICK AQUI PARA DESCARGAR LAS IMAGENES NECESARIAS
por si no quiren descargar nada el Script solo pero se necesitaran las imagenes
SCRIPT:
- Código:
#==============================================================================
# ** Medina Stories License Board v2.0.0
#------------------------------------------------------------------------------
# Author: Juan José Sánchez Ramírez
# Release Date: August 21, 2011
#------------------------------------------------------------------------------
# «Introduction»
#
# This script is a quasi-identical replica of the Final Fantasy XII License
# Board. Character development in Final Fantasy XII is based largely on the
# acquisition of "licenses". Licenses are required to equip weapons and armor,
# learn magicks and technicks, and enhace a character's abilities.
#------------------------------------------------------------------------------
# «Features»
#
# License board (the board can be unique for each character or it can be the
# same for all characters)
# Board editor
# License points
# Custom board size
# Custom board graphics (i.e., tiles, tile size, font size, background,
# foreground, animations, etc.)
# Custom board names (i.e., license description, license class, etc.)
# Compatible with larger parties (parties with more than four characters)
#------------------------------------------------------------------------------
# «Instructions»
#
# Step 1. Copy the script.
#
# Step 2. Add the pictures to your Pictures folder.
#
# Step 3. Call the Scene_EditBoard class with the following code. If you do
# not have a Boards.rxdata file, the game will create one for you. Create a
# new board. The README.txt file in your Game folder contains a list of all
# skills, weapons and armor in the database.
#
# $scene = Scene_EditBoard.new
#
# Step 4. Call the Scene_BoardSelect class with the following code.
#
# $scene = Scene_BoardSelect.new
#
# Step 5. To add license points to your characters, use the following code.
# For the purpose of teaching, I shall add 50 license points to every
# character.
#
# for actor in $game_party.actors
# actor.ap += 50
# end
#
# Configuring your license board
#
# The FFXII module, at the beginning of the script, contains global variables
# and classes which handle the license board interface. Every single class and
# variable in the module is editable. For more information regarding the FFXII
# module, read the comments in the script.
#------------------------------------------------------------------------------
# «FAQ»
#
# What are licenses?
# In addition to enabling a character to equip various items or cast potent
# magicks, there are also licenses to boost stats. Licenses can be obtained on
# the "license board" by using "license points" (LP).
#
# Simply obtaining a license for a skill allows a character to use that
# ability. Licenses for statistic boosts do not require are effective
# immediately after being obtained. Licenses for weapons and armor allow a
# character to equip such weapons or armor, but require the items to be in the
# party's inventory.
#
# How do you choose licenses?
# You are free to choose which licenses each character acquires. There are
# several categories of licenses, and using LP to obtain them will gradually
# open up new licenses on the same area of the board.
#
# Which are the license board categories?
# Licenses are loosely divided into four different categories:
# 1. Statistic Boosts
# 2. Weapons
# 3. Armor
# 4. Skills
#
# How can I display the license board?
# The license board can be displayed by opening the Board Select screen and
# choosing a character.
#------------------------------------------------------------------------------
# «Compatibility»
#
# Not SDK compatible.
#
# The script rewrites the following classes:
# Game_Actor
# Game_Party
# Bitmap
# Window_EquipItem
# Window_InputNumber
# Window_BoardSelectable
# Scene_Title.
#------------------------------------------------------------------------------
# «Credits and Thanks»
#
# All credits go to Juan José Sánchez Ramírez.
# Do not credit me as medinastories, Medina, Medina Stories, or any other
# variation of these names.
#
# Special thanks go to Renan Tsuneo Hangai Junior, also known as RTH, who
# wrote the Ability Grid script, which I edited to write this script, and
# Teekatas S., also known as Raindropmemory, who made the Legendora Iconset.
#
# For more Final Fantasy XII scripts, I suggest searching for Renan Tsuneo
# Hangai Junior's Active Dimension Battle script, which includes the Ability
# Grid script.
#------------------------------------------------------------------------------
# «Author's Notes»
#
# This script was designed for my RPG Maker XP project, Medina Stories. I
# first had the idea to make this script a couple of years ago upon
# encountering Renan Tsuneo Hangai Junior's Active Dimension Battle script,
# which includes the Ability Grid script. When I further analyzed the Ability
# Grid script, I figured how to manage large amounts of information
# effectively using tables, and storing these tables in encrypted arrays.
#
# Please let me know of any bugs, glitches or suggestions.
#
# New in v2.0.0
#
# Added a zoom in/zoom out function.
# The script now draws borders around the edges of the board.
# Fixed the Window_BoardConfirm class. The confirm window now adjusts its
# width to text.
# Added a 'smart start' function. The board cursor now starts at the next
# available tile.
# Added an action list window.
# Aliased the Game_Actor and Scene_title classes.
#
# New in v1.1.2
#
# Fixed the Window_BoardSelectable class.
#
# New in v1.1.1
#
# The README.txt file is now printed when calling the Scene_EditBoard class.
# The Boards.rxdata file is now written if it does not exist.
# The script no longer rewrites the Main class.
#------------------------------------------------------------------------------
# «Terms and Conditions»
#
# Free for Commercial Use. Must include the scripter's name.
#==============================================================================
#==============================================================================
# ** MedinaStories
#------------------------------------------------------------------------------
# This module contains global variables and classes.
#==============================================================================
module MedinaStories
# New board width
NEW_BOARD_XSIZE = 24
# New board height
NEW_BOARD_YSIZE = 24
# Board zoom capability (percentage)
ZOOM = 0.5
# Maximum ability points
AP_MAX = 9999
# Maximum party members
ACTOR_MAX = 12
# Status bitmap
STATUS = RPG::Cache.picture("bar")
# Help bitmap
HELP = RPG::Cache.picture("Help")
# Learned skills bitmap
LEARNED_SKILLS = RPG::Cache.picture("Skills")
# Category bitmap
CATEGORY = RPG::Cache.picture("Category")
# Category hue array
CATEGORY_HUE = [90, 270, 0, 180, 0, 180, 120, 120, 240, 0, 180]
# Star bitmap
STAR = RPG::Cache.picture("Star")
# Line bitmap
LINE = RPG::Cache.picture("Line")
# Cursor bitmap
CURSOR = RPG::Cache.picture("cursor")
# Board background bitmap
BOARD_BG = RPG::Cache.picture("parchment")
# Tile bitmap width
TILE_X_SIZE = 64
# Tile bitmap height
TILE_Y_SIZE = 64
# Board margin in tiles
BOARD_MARGIN = 2
# Tile license points font size
TILE_AP_FONT_SIZE = 16
# Tile level font size
TILE_LEVEL_FONT_SIZE = 16
# Hidden tile text string
HIDDEN = "???"
# License points text string
LP = "LP"
# Miniature board bitmap
MINIBOARD = "Graphics/Pictures/minibg"
# Miniature board margin in pixels
MINIBOARD_MARGIN = 8
# Miniature board tile width
MINI_TILE_XSIZE = 8
# Miniature board tile height
MINI_TILE_YSIZE = 8
# Shadow bitmap
SHADOW = RPG::Cache.picture("shadow")
# Black bitmap
BLACK = RPG::Cache.picture("black")
# Animation bitmap
ANIMATION = RPG::Cache.picture("Light1")
# Animation horizontal frames
ANIMATION_HORIZONTAL_FRAMES = 5
# Animation vertical frames
ANIMATION_VERTICAL_FRAMES = 3
# Animation total frames
ANIMATION_TOTAL_FRAMES = 15
# Animation blend type
ANIMATION_BLENDTYPE = 1
# Random array for board tiles
RANDOM_ARRAY = [
[1, 3, 1, 3, 0, 1, 0, 3, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 3, 2, 3, 1, 3, 2],
[1, 3, 3, 2, 2, 0, 2, 1, 1, 3, 1, 3, 1, 3, 0, 2, 0, 1, 0, 3, 0, 0, 0, 0],
[3, 2, 0, 3, 3, 3, 1, 2, 1, 2, 1, 1, 1, 3, 3, 1, 1, 3, 3, 2, 1, 1, 3, 3],
[1, 1, 0, 3, 3, 1, 1, 3, 3, 0, 2, 3, 2, 0, 0, 3, 1, 3, 0, 3, 1, 2, 3, 2],
[3, 1, 0, 0, 2, 0, 1, 2, 0, 2, 3, 1, 3, 1, 2, 3, 3, 3, 0, 3, 3, 0, 3, 3],
[3, 1, 3, 1, 1, 3, 1, 3, 3, 1, 1, 0, 3, 2, 2, 2, 0, 2, 1, 2, 0, 2, 0, 1],
[2, 3, 2, 3, 1, 3, 0, 2, 0, 0, 3, 1, 2, 0, 0, 2, 0, 2, 2, 2, 2, 1, 1, 3],
[3, 0, 3, 2, 3, 2, 3, 0, 3, 2, 2, 0, 3, 3, 2, 3, 2, 2, 1, 2, 3, 0, 1, 0],
[1, 3, 0, 1, 3, 3, 1, 2, 3, 2, 0, 1, 1, 2, 1, 1, 0, 2, 3, 1, 0, 3, 0, 3],
[0, 2, 2, 0, 2, 2, 2, 0, 2, 0, 2, 2, 1, 0, 2, 3, 2, 0, 3, 2, 3, 0, 1, 0],
[3, 0, 0, 3, 2, 1, 2, 1, 3, 2, 2, 3, 3, 0, 3, 0, 2, 1, 2, 1, 3, 1, 1, 3],
[1, 0, 2, 2, 0, 3, 3, 1, 3, 2, 0, 2, 3, 0, 1, 0, 2, 3, 3, 1, 3, 3, 0, 0],
[3, 0, 3, 0, 3, 0, 3, 2, 1, 3, 1, 0, 3, 1, 2, 3, 0, 2, 2, 0, 2, 0, 2, 1],
[1, 1, 2, 0, 3, 1, 0, 2, 3, 3, 2, 1, 2, 2, 3, 1, 1, 3, 3, 0, 3, 1, 2, 1],
[3, 2, 3, 2, 2, 3, 0, 2, 0, 0, 0, 3, 0, 1, 2, 1, 0, 3, 3, 2, 2, 2, 1, 0],
[1, 2, 2, 1, 1, 0, 2, 2, 2, 2, 1, 2, 1, 2, 2, 0, 1, 0, 3, 0, 2, 1, 2, 1],
[2, 0, 3, 0, 3, 1, 3, 2, 0, 3, 3, 3, 0, 0, 0, 2, 3, 0, 2, 1, 2, 2, 1, 3],
[3, 2, 0, 3, 2, 0, 2, 2, 2, 2, 3, 2, 0, 2, 3, 3, 0, 2, 2, 2, 2, 1, 1, 0],
[3, 0, 1, 0, 3, 2, 1, 3, 3, 3, 1, 1, 1, 3, 0, 3, 3, 0, 0, 3, 2, 2, 1, 1],
[3, 0, 2, 3, 3, 2, 0, 1, 1, 1, 1, 0, 2, 0, 3, 1, 0, 0, 3, 3, 1, 2, 0, 0],
[0, 2, 0, 0, 2, 0, 0, 2, 2, 1, 3, 2, 2, 3, 0, 2, 2, 0, 2, 0, 3, 2, 2, 2],
[3, 1, 3, 3, 2, 1, 0, 1, 1, 0, 0, 3, 1, 1, 2, 2, 1, 0, 3, 0, 2, 2, 1, 1],
[2, 0, 2, 2, 0, 2, 2, 0, 1, 2, 0, 0, 3, 3, 1, 3, 3, 2, 3, 0, 2, 0, 1, 3],
[3, 2, 2, 0, 3, 1, 0, 0, 1, 1, 1, 2, 3, 0, 3, 3, 2, 1, 3, 0, 1, 0, 1, 2]]
#--------------------------------------------------------------------------
# * Avatar Bitmap
# id : actor ID
#--------------------------------------------------------------------------
def AVATAR(id)
return RPG::Cache.picture("avatar#{id}") rescue
RPG::Cache.picture("avatar-1")
end
#--------------------------------------------------------------------------
# * Tile Bitmap
# id : tile ID
# x : tile x-coordinate
# y : tile y-coordinate
#--------------------------------------------------------------------------
def TILE(id, x, y)
return RPG::Cache.picture("white#{RANDOM_ARRAY[x][y]}") if id == 0
return RPG::Cache.picture("dark#{RANDOM_ARRAY[x][y]}") if id == 1
end
#--------------------------------------------------------------------------
# * Icon Bitmap
# type : tile type
# active : true / false
#--------------------------------------------------------------------------
def ICON(type, boolean=false)
return RPG::Cache.picture("#{type}") if boolean == true or type == -1
return RPG::Cache.picture("#{type}v")
end
#--------------------------------------------------------------------------
# * Border Bitmap
# id : tile ID
#--------------------------------------------------------------------------
def BORDER(id)
return RPG::Cache.picture("border#{id}")
end
#--------------------------------------------------------------------------
# * Miniature Board Tile
# type : tile type
#--------------------------------------------------------------------------
def MINI_TILE(type)
return RPG::Cache.picture("mini#{type}") rescue
RPG::Cache.picture("mini-1")
end
#--------------------------------------------------------------------------
# * Confirmation Message
# message : message text string
#--------------------------------------------------------------------------
def CONFIRM_MESSAGE(message)
return "Obtain #{message}?"
end
#--------------------------------------------------------------------------
# * Board Name
# id : board ID
#--------------------------------------------------------------------------
def BOARD_NAME(id)
case id
when 0
return "No Board"
end
return "Board"
end
#--------------------------------------------------------------------------
# * Board Item
# type : tile type
# value : tile value
#--------------------------------------------------------------------------
def BOARD_ITEM(type, value)
case type
when 8 # Skills
return $data_skills[value]
when 9 # Weapon Set
return $data_weapons[value]
when 10 # Armor Set
return $data_armors[value]
end
return nil
end
#--------------------------------------------------------------------------
# * Board Item
# type : tile type
# value : tile value
#--------------------------------------------------------------------------
def BOARD_DESCRIPTION(type, value)
case type
when 0 # HP
return "Increase max HP by #{value}"
when 1 # SP
return "Increase max MP by #{value}"
when 2 # Strength
return "Increase physical attack"
when 3 # Physical Defense
return "Increase physical defense"
when 4 # Intelligence
return "Increase magick potency"
when 5 # Magic Defense
return "Increase magick defense"
when 6 # Agility
return "Increase agility"
when 7 # Dexterity
return "Increase dexterity"
when 8 # Skills
return "#{$data_skills[value].description}"
when 9 # Weapon Set
return "#{$data_weapons[value].description}"
when 10 # Armor Set
return "#{$data_armors[value].description}"
end
return nil
end
#--------------------------------------------------------------------------
# * Board Item
# type : tile type
# value : tile value
# level : tile level
#--------------------------------------------------------------------------
def BOARD_CLASS(type, value, level)
case type
when 0 # HP
return "Max HP"
when 1 # SP
return "Max MP"
when 2 # Strength
return "Strength"
when 3 # Physical Defense
return "Physical Defense"
when 4 # Intelligence
return "Intelligence"
when 5 # Magic Defense
return "Magic Defense"
when 6 # Agility
return "Agility"
when 7 # Dexterity
return "Dexterity"
when 8 # Skills
if level == -1
return ""
elsif value >= 0 and value <= 6
return "White Magick #{level}"
elsif value >= 7 and value <= 32
return "Black Magick #{level}"
elsif value >= 33 and value <= 56
return "Green Magick #{level}"
elsif value >= 57 and value <= 80
return "Arcane Magick #{level}"
else
return "#{$data_skills[value].name}"
end
when 9 # Weapon Set
if level == -1
return ""
elsif value >= 0 and value <= 4
return "Swords #{level}"
elsif value >= 5 and value <= 8
return "Spears #{level}"
elsif value >= 9 and value <= 12
return "Axes #{level}"
elsif value >= 13 and value <= 16
return "Daggers #{level}"
elsif value >= 17 and value <= 20
return "Bows #{level}"
elsif value >= 21 and value <= 24
return "Guns #{level}"
elsif value >= 25 and value <= 28
return "Maces #{level}"
elsif value >= 29 and value <= 32
return "Poles #{level}"
else
return "#{$data_weapons[value].name}"
end
when 10 # Armor Set
if level == -1
return ""
elsif value >= 0 and value <= 4
return "Shields #{level}"
elsif value >= 5 and value <= 8
return "Helmets #{level}"
elsif value >= 9 and value <= 12
return "Hats #{level}"
elsif value >= 13 and value <= 16
return "Armors #{level}"
elsif value >= 17 and value <= 20
return "Breastplates #{level}"
elsif value >= 21 and value <= 24
return "Robes #{level}"
elsif value >= 25 and value <= 32
return "Rings #{level}"
else
return "#{$data_armors[value].name}"
end
end
return nil
end
#==========================================================================
# «Warning»
#
# Do not change the following global variables and classes!
#==========================================================================
#--------------------------------------------------------------------------
# * Print Item List
#--------------------------------------------------------------------------
def item_list
# Load database
$data_skills = load_data("Data/Skills.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
# Create a new file and write to it
File.open("README.txt", "wb") do |file|
# Add skills
for i in 1...$data_skills.size
item = $data_skills[i]
file.print("#{item.id}\t")
file.print("#{item.name}\t")
file.puts("#{item.description}")
end
# Add weapons
for i in 1...$data_weapons.size
item = $data_weapons[i]
file.print("#{item.id}\t")
file.print("#{item.name}\t")
file.puts("#{item.description}")
end
# Add armors
for i in 1...$data_armors.size
item = $data_armors[i]
file.print("#{item.id}\t")
file.print("#{item.name}\t")
file.puts("#{item.description}")
end
end
end
#--------------------------------------------------------------------------
# * Create Empty Board
# xsize : new board width
# ysize : new board height
#--------------------------------------------------------------------------
def new_board(xsize, ysize)
$data_boards = get_boards
board = Table.new(xsize, ysize, 9)
for x in 0...board.xsize
for y in 0...board.ysize
for z in 0...board.zsize
case z
when 0 # ACTIVATED
board[x, y, z] = 0
when 1 # VISIBLE
board[x, y, z] = 0
when 2 # AP
board[x, y, z] = 0
when 3 # TYPE
board[x, y, z] = -1
when 4 # OBJECT 1 VALUE
board[x, y, z] = 0
when 5 # OBJECT 2 VALUE
board[x, y, z] = 0
when 6 # OBJECT 3 VALUE
board[x, y, z] = 0
when 7 # OBJECT 4 VALUE
board[x, y, z] = 0
when 8 # LEVEL
board[x, y, z] = -1
end
end
end
end
$data_boards.push(board)
save_boards($data_boards)
end
#--------------------------------------------------------------------------
# * Delete Board
# index : board ID
#--------------------------------------------------------------------------
def delete_board(index)
$data_boards = get_boards
$data_boards.delete_at(index)
save_boards($data_boards)
end
#--------------------------------------------------------------------------
# * Save Board
# boards : boards data
#--------------------------------------------------------------------------
def save_boards(boards)
save_data(boards, "Data/Boards.rxdata")
end
#--------------------------------------------------------------------------
# * Get Boards
#--------------------------------------------------------------------------
def get_boards
$data_boards = load_data("Data/Boards.rxdata") rescue $data_boards = []
return $data_boards
end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Invariables
#--------------------------------------------------------------------------
include MedinaStories # Medina Stories module
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :board # board ID
attr_reader :ap # ability points
#--------------------------------------------------------------------------
# * Setup
# actor_id : actor ID
#--------------------------------------------------------------------------
alias mslb_game_actor_setup setup
def setup(actor_id)
@board = Board.new(0)
@ap = 0
mslb_game_actor_setup(actor_id)
end
#--------------------------------------------------------------------------
# * Get AP
#--------------------------------------------------------------------------
def ap=(ap)
@ap = [[ap, 0].max, AP_MAX].min
end
#--------------------------------------------------------------------------
# * Get Maximum HP
#--------------------------------------------------------------------------
def maxhp
n = [[base_maxhp + @maxhp_plus, 1].max, 9999].min
for i in @states
n *= $data_states[i].maxhp_rate / 100.0
end
n += @board.hp
n = [[Integer(n), 1].max, 9999].min
return n
end
#--------------------------------------------------------------------------
# * Get Maximum SP
#--------------------------------------------------------------------------
def maxsp
n = [[base_maxsp + @maxsp_plus, 0].max, 999].min
for i in @states
n *= $data_states[i].maxsp_rate / 100.0
end
n += @board.sp
n = [[Integer(n), 0].max, 999].min
return n
end
#--------------------------------------------------------------------------
# * Get Strength
#--------------------------------------------------------------------------
def str
n = [[base_str + @str_plus, 1].max, 99].min
for i in @states
n *= $data_states[i].str_rate / 100.0
end
n += @board.str
n = [[Integer(n), 1].max, 99].min
return n
end
#--------------------------------------------------------------------------
# * Get Intelligence
#--------------------------------------------------------------------------
def int
n = [[base_int + @int_plus, 1].max, 99].min
for i in @states
n *= $data_states[i].int_rate / 100.0
end
n += @board.int
n = [[Integer(n), 1].max, 99].min
return n
end
#--------------------------------------------------------------------------
# * Get Dexterity
#--------------------------------------------------------------------------
def dex
n = [[base_dex + @dex_plus, 1].max, 99].min
for i in @states
n *= $data_states[i].dex_rate / 100.0
end
n += @board.dex
n = [[Integer(n), 1].max, 99].min
return n
end
#--------------------------------------------------------------------------
# * Get Agility
#--------------------------------------------------------------------------
def agi
n = [[base_agi + @agi_plus, 1].max, 99].min
for i in @states
n *= $data_states[i].agi_rate / 100.0
end
n += @board.agi
n = [[Integer(n), 1].max, 99].min
return n
end
#--------------------------------------------------------------------------
# * Get Physical Defense
#--------------------------------------------------------------------------
def pdef
n = [[base_pdef, 0].max, 999].min
for i in @states
n *= $data_states[i].pdef_rate / 100.0
end
n += @board.pdef
n = [[Integer(n), 0].max, 999].min
return n
end
#--------------------------------------------------------------------------
# * Get Magic Defense
#--------------------------------------------------------------------------
def mdef
n = [[base_mdef, 0].max, 999].min
for i in @states
n *= $data_states[i].mdef_rate / 100.0
end
n += @board.mdef
n = [[Integer(n), 0].max, 999].min
return n
end
#--------------------------------------------------------------------------
# * Determine if Equippable
# item : item
#--------------------------------------------------------------------------
def equippable?(item)
# If weapon
if item.is_a?(RPG::Weapon)
weapon_set = $data_classes[@class_id].weapon_set
weapon_set = @board.weapon_set | weapon_set
# If included among equippable weapons in current class and board
if weapon_set.include?(item.id)
return true
end
end
# If armor
if item.is_a?(RPG::Armor)
armor_set = $data_classes[@class_id].armor_set
armor_set = @board.armor_set | armor_set
# If included among equippable armor in current class and board
if armor_set.include?(item.id)
return true
end
end
return false
end
#--------------------------------------------------------------------------
# * Skills
#--------------------------------------------------------------------------
def skills
@board.skills.sort!
skills = @board.skills | @skills
return skills
end
#--------------------------------------------------------------------------
# * Determine if Finished Learning Skill
# skill_id : skill ID
#--------------------------------------------------------------------------
def skill_learn?(skill_id)
return (@skills + @board.skills).include?(skill_id)
end
end
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# This class handles the party. It includes information on amount of gold
# and items. Refer to "$game_party" for the instance of this class.
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# * Invariables
#--------------------------------------------------------------------------
include MedinaStories # Medina Stories module
#--------------------------------------------------------------------------
# * Add an Actor
# actor_id : actor ID
#--------------------------------------------------------------------------
def add_actor(actor_id)
# Get actor
actor = $game_actors[actor_id]
# If the party has less than ACTOR_MAX and this actor is not in the party
if @actors.size < ACTOR_MAX and not @actors.include?(actor)
# Add actor
@actors.push(actor)
# Refresh player
$game_player.refresh
end
end
end
#==============================================================================
# ** Animated_Sprite
#------------------------------------------------------------------------------
# This sprite is used to display an animated image. It observes a superclass
# and automatically changes sprite conditions.
#==============================================================================
class Animated_Sprite < RPG::Sprite
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :frames # frames total
attr_reader :bitmap # bitmap
attr_accessor :frame # frame ID
attr_accessor :wait # frame delay
#--------------------------------------------------------------------------
# * Object Initialization
# bitmap : bitmap
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# columns : columns
# rows : rows
# frames : frame total
# blend_type : blend type
# viewport : viewport
#--------------------------------------------------------------------------
def initialize(bitmap, x, y, columns, rows, frames, blend_type=0, wait=1,
viewport=nil)
super(viewport)
@bitmap = bitmap
@ox, @oy = x, y
@columns = columns
@rows = rows
@frames = frames
self.blend_type = blend_type
@wait = wait
@counter = wait
@frame = 0
update
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if ready?
self.bitmap = @bitmap
self.x = @ox
self.y = @oy
cw = @bitmap.width / @columns
ch = @bitmap.height / @rows
self.src_rect.set(0, 0, cw, ch)
sx = (@frame % @columns) * cw
sy = (@frame / @columns) * ch
self.src_rect.set(sx, sy, cw, ch)
@counter = 0
else
@counter += 1
end
end
#--------------------------------------------------------------------------
# * Ready?
#--------------------------------------------------------------------------
def ready?
return @counter >= @wait
end
end
#==============================================================================
# ** Dynamic_Sprite
#------------------------------------------------------------------------------
# This sprite is used to display a moving image. It observes a superclass
# and automatically changes sprite conditions.
#==============================================================================
class Dynamic_Sprite < RPG::Sprite
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :true_x # true x
attr_accessor :true_y # true y
attr_accessor :true_zoom_x # true zoom x
attr_accessor :true_zoom_y # true zoom y
attr_accessor :true_opacity # true opacity
attr_accessor :speed # speed
#--------------------------------------------------------------------------
# * Object Initialization
# viewport : viewport
#--------------------------------------------------------------------------
def initialize(viewport=nil)
super(viewport)
@true_x = 0
@true_y = 0
@true_zoom_x = 1.00
@true_zoom_y = 1.00
@true_opacity = 255
@speed = 5
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if self.y < @true_y
n = (@true_y - self.y) / @speed
n = 1 if n == 0
self.y += n
elsif self.y > @true_y
n = (self.y - @true_y) / @speed
n = 1 if n == 0
self.y -= n
end
if self.x < @true_x
n = (@true_x - self.x) / @speed
n = 1 if n == 0
self.x += n
elsif self.x > @true_x
n = (self.x - @true_x) / @speed
n = 1 if n == 0
self.x -= n
end
if self.zoom_y < @true_zoom_y
n = (@true_zoom_y - self.zoom_y) / @speed
n = 1 if n == 0
self.zoom_y += n
elsif self.zoom_y > @true_zoom_y
n = (self.zoom_y - @true_zoom_y) / @speed
n = 1 if n == 0
self.zoom_y -= n
end
if self.zoom_x < @true_zoom_x
n = (@true_zoom_x - self.zoom_x) / @speed
n = 1 if n == 0
self.zoom_x += n
elsif self.zoom_x > @true_zoom_x
n = (self.zoom_x - @true_zoom_x) / @speed
n = 1 if n == 0
self.zoom_x -= n
end
if self.opacity < @true_opacity
n = (@true_opacity - self.opacity) / @speed
n = 1 if n == 0
self.opacity += n
elsif self.opacity > @true_opacity
n = (self.opacity - @true_opacity) / @speed
n = 1 if n == 0
self.opacity -= n
end
end
end
#==============================================================================
# ** Sprite_AvailableLP
#------------------------------------------------------------------------------
# This sprite is used to display available LP. It observes the Scene_Board
# class and automatically changes sprite conditions.
#==============================================================================
class Sprite_AvailableLP < RPG::Sprite
#--------------------------------------------------------------------------
# * Invariables
#--------------------------------------------------------------------------
include MedinaStories # Medina Stories module
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
# board : board
# viewport : viewport
#--------------------------------------------------------------------------
def initialize(actor, board, viewport=nil)
super(viewport)
self.bitmap = STATUS.dup
@actor = actor
@board = board
@ap = @actor.ap
self.y = 15
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.bitmap.clear
self.bitmap = STATUS.dup
self.bitmap.draw_actor_name( @actor, 72, -5)
self.bitmap.draw_actor_ap( @actor, 71, 15)
self.bitmap.draw_actor_avatar(@actor, 12, 0)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if @actor.ap != @ap
@ap = @actor.ap
refresh
end
end
end
#==============================================================================
# ** Sprite_LicenseDescription
#------------------------------------------------------------------------------
# This sprite is used to display board help. It observes the Scene_Board
# class and automatically changes sprite conditions.
#==============================================================================
class Sprite_LicenseDescription < Dynamic_Sprite
#--------------------------------------------------------------------------
# * Invariables
#--------------------------------------------------------------------------
include MedinaStories # Medina Stories module
#--------------------------------------------------------------------------
# * Object Initialization
# cursor : cursor
# board : board
# edit_mode : true / false
# viewport : viewport
#--------------------------------------------------------------------------
def initialize(cursor, board, edit_mode=false, viewport=nil)
super(viewport)
self.bitmap = HELP.dup
@cursor = cursor
@board = board
@edit_mode = edit_mode
@ox, @oy = @cursor.tile_x, @cursor.tile_y
self.y = 370
self.opacity = 0
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.bitmap.clear
self.bitmap = HELP.dup
x, y = @cursor.tile_x, @cursor.tile_y
hue = CATEGORY_HUE[@board.type?(x, y)]
self.bitmap.draw_board_category( @board, x, y, 28, 20, hue)
self.bitmap.draw_board_ap( @board, x, y, 55, 16)
self.bitmap.draw_board_activated( @board, x, y, 114, 18, @edit_mode)
self.bitmap.draw_board_class( @board, x, y, 138, 16)
self.bitmap.draw_board_item( @board, x, y, 62, 42, 0, @edit_mode)
self.bitmap.draw_board_item( @board, x, y, 312, 42, 1, @edit_mode)
self.bitmap.draw_board_item( @board, x, y, 62, 63, 2, @edit_mode)
self.bitmap.draw_board_item( @board, x, y, 312, 63, 3, @edit_mode)
self.bitmap.draw_board_description(@board, x, y, 90, 42, @edit_mode)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if [@cursor.tile_x, @cursor.tile_y] != [@ox, @oy]
@ox, @oy = @cursor.tile_x, @cursor.tile_y
refresh
end
end
end
#==============================================================================
# ** Cursor_Base
#------------------------------------------------------------------------------
# This sprite is used to display the cursor. It observes a superclass
# and automatically changes sprite conditions.
#==============================================================================
class Sprite_Cursor < Dynamic_Sprite
#--------------------------------------------------------------------------
# * Invariables
#--------------------------------------------------------------------------
include MedinaStories # Medina Stories module
#--------------------------------------------------------------------------
# * Object Initialization
# viewport : viewport
#--------------------------------------------------------------------------
def initialize(viewport=nil)
super(viewport)
self.bitmap = CURSOR
end
end
#==============================================================================
# ** Spriteset_Board
#------------------------------------------------------------------------------
# This class brings together the board tiles, icons and active slots.
# It's used within the Scene_Board class.
#==============================================================================
class Spriteset_Board
#--------------------------------------------------------------------------
# * Invariables
#--------------------------------------------------------------------------
include MedinaStories # Medina Stories module
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :tiles # tiles
attr_accessor :icons # icons
attr_accessor :active # active
attr_accessor :border # border
attr_accessor :zoom # zoom
#--------------------------------------------------------------------------
# * Object Initialization
# board : board
# edit_mode : true / false
#--------------------------------------------------------------------------
def initialize(board, edit_mode=false)
@board = board
@edit_mode = edit_mode
@bg = Plane.new
@bg.bitmap = BOARD_BG
xs, ys = TILE_X_SIZE, TILE_Y_SIZE
@tiles = Dynamic_Sprite.new
@tiles.bitmap = Bitmap.new(@board.xsize * xs, @board.ysize * ys)
@icons = Dynamic_Sprite.new
@icons.bitmap = Bitmap.new(@board.xsize * xs, @board.ysize * ys)
@icons.blink_on
@active = Dynamic_Sprite.new
@active.bitmap = Bitmap.new(@board.xsize * xs, @board.ysize * ys)
@border = Dynamic_Sprite.new
@border.bitmap = Bitmap.new(@board.xsize * xs, @board.ysize * ys)
@zoom = true
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@tiles.bitmap.clear
@icons.bitmap.clear
@active.bitmap.clear
@border.bitmap.clear
for x in 0...@board.xsize
for y in 0...@board.ysize
@tiles.bitmap.draw_board_tile(@board, x, y)
@icons.bitmap.draw_board_icon(@board, x, y, @edit_mode)
@active.bitmap.draw_board_active(@board, x, y, @edit_mode)
@active.bitmap.draw_board_border(@board, x, y)
end
end
if @zoom == false
@tiles.true_zoom_x = ZOOM
@tiles.true_zoom_y = ZOOM
@icons.true_zoom_x = ZOOM
@icons.true_zoom_y = ZOOM
@active.true_zoom_x = ZOOM
@active.true_zoom_y = ZOOM
@border.true_zoom_x = ZOOM
@border.true_zoom_y = ZOOM
else
@tiles.true_zoom_x = 1.0
@tiles.true_zoom_y = 1.0
@icons.true_zoom_x = 1.0
@icons.true_zoom_y = 1.0
@active.true_zoom_x = 1.0
@active.true_zoom_y = 1.0
@border.true_zoom_x = 1.0
@border.true_zoom_y = 1.0
end
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
@bg.dispose
@tiles.dispose
@icons.dispose
@active.dispose
@border.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@tiles.update
@icons.update
@active.update
@border.update
end
end
#==============================================================================
# ** Bitmap
#------------------------------------------------------------------------------
# The bitmap class. Bitmaps are expressions of so-called graphics.
# Sprites and other objects must be used to display bitmaps on the screen.
#==============================================================================
class Bitmap
#--------------------------------------------------------------------------
# * Invariables
#--------------------------------------------------------------------------
include MedinaStories # Medina Stories module
#--------------------------------------------------------------------------
# * Draw Actor Name
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_name(actor, x, y)
self.draw_outline(x, y, 120, 32, actor.name)
end
#--------------------------------------------------------------------------
# * Draw Actor AP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_ap(actor, x, y, width=78)
color = Color.new(204, 204, 153)
text = LP
self.draw_outline(x, y, 32, 32, text, 0, color)
ap_x = x + width - 48
ap = actor.ap.to_s
self.draw_outline(ap_x, y, 48, 32, ap, 2, color)
end
#--------------------------------------------------------------------------
# * Draw Actor Avatar
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_avatar(actor, x, y)
rect = Rect.new(0, 0, 60, 60)
avatar = AVATAR(actor.id)
self.blt(x, y, avatar, rect)
end
#--------------------------------------------------------------------------
# * Draw Actor Minimap
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_minimap(actor, x, y)
bitmap = Bitmap_MiniBoard.new(actor.board)
rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.blt(x, y, bitmap, rect)
end
#--------------------------------------------------------------------------
# * Draw Board Category
# board : board
# bx : board x-coordinate
# by : board y-coordinate
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# hue : hue
#--------------------------------------------------------------------------
def draw_board_category(board, bx, by, x, y, hue=0)
if board.ap_cost?(bx, by) > 0
bitmap = Bitmap.new(26, 26)
rect = Rect.new(0, 0, 26, 26)
bitmap.blt(0, 0, CATEGORY, rect)
bitmap.hue_change(hue)
ADVERTENCIA:
Si el Script solo con las imagenes no funciona descargen la
demo.
Eso es todo nos leemos.