-
Posts
15 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Posts posted by Evil_Jack
-
-
Questo script è fantastico...comunque una cosa che potresti aggiungere a questo script che sicuramnte lo renderebbe perfetto sarebbe quello di poter visionare la canna da pesca, la quale in base a come si trova il giocatore davanti all evento cambia posizione anche la canna.
spero che qst sia possibile farlo.
a meno che qst cosa nn si possa già fare tramite evnto comune
-
Sei un genio :D
-
Funziona però c'è un problema. apro le limit degli eoni ma poi quando esco e provo ad aprire le limit dei pg mi da un errore sullo script delle hp/sp/atb sempre di dev lo script è il seguente
Script "hp...." line 307 nomethoderror occured
undefineded method "limitbreak" for nil class
#======================================================================
=====
# *** HP/MP/ATB/LimitBreak bar Slanted Style Compatible with RTAB ***
# *** Version 2.1
#---------------------------------------------------------------------------
# by Clive
# based on Cogwheel's Bars and Sephiroth Spawn's Slanted Bars.
#---------------------------------------------------------------------------
# ----- GREAT THANKS to DerVVulfman for solving the lag problem
#------This is a plug and play script so it should work without any problem!
#=============================================================================
# If using with Limit Break, must paste BELOW the Limit Break script as it re-
# writes the 'Gauge drawing' system. Will cause an error if not properly put.
# If used with Trickster's STEAL SCRIPT version 6 R1 (revision 1), then the
# height of RTAB's AT Bar (Draw Actor ATG) may not be smaller than 5 pixels
# due to a float-to-float error. A height of 6 pixels is the smallest.
#==============================================================================
# ** 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
#--------------------------------------------------------------------------
# * Get the current EXP
#--------------------------------------------------------------------------
def now_exp
return @exp - @exp_list[@level]
end
#--------------------------------------------------------------------------
# * Get the next level's EXP
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================
class Window_Base < Window
#==========================================================================
# * Draw Slant Bar(by SephirothSpawn)
#==========================================================================
def draw_slant_bar(x, y, min, max, width = 152, height = 6,
bar_color = Color.new(150, 0, 0, 255),
end_color = Color.new(255, 255, 60, 255))
# Draw Border
for i in 0..height
self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
end
# Draw Background
for i in 1..(height - 1)
r = 100 * (height - i) / height + 0 * i / height
g = 100 * (height - i) / height + 0 * i / height
b = 100 * (height - i) / height + 0 * i / height
a = 255 * (height - i) / height + 255 * i / height
self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
end
# Draws Bar
for i in 1..( (min.to_f / max.to_f) * width - 1)
for j in 1..(height - 1)
r = bar_color.red * (width - i) / width + end_color.red * i / width
g = bar_color.green * (width - i) / width + end_color.green * i / width
b = bar_color.blue * (width - i) / width + end_color.blue * i / width
a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
end
end
end
#==========================================================================
# * Draw HP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#==========================================================================
alias :draw_actor_hp_hpsp :draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
draw_slant_bar(x, y + 12, actor.hp, actor.maxhp, width, 6,
bar_color = Color.new(150, 0, 0, 255),
end_color = Color.new(255, 255, 60, 255))
draw_actor_hp_hpsp(actor, x, y, width)
end
#==========================================================================
# * Draw SP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#==========================================================================
alias :draw_actor_sp_hpsp :draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
draw_slant_bar(x, y + 12, actor.sp, actor.maxsp, width, 6,
bar_color = Color.new(0, 0, 155, 255),
end_color = Color.new(255, 255, 255, 255))
draw_actor_sp_hpsp(actor, x, y, width)
end
#==========================================================================
# * Draw EXP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#==========================================================================
alias raz_bars_base_exp draw_actor_exp
def draw_actor_exp(actor, x, y)
if actor.level == 99
draw_slant_bar(x + 13, y + 11, 1, 1, 190, 6, bar_color = Color.new(0, 100, 0, 255), end_color = Color.new(0, 255, 0, 255))
else
draw_slant_bar(x + 13, y + 11, actor.now_exp, actor.next_exp, 190, 6, bar_color = Color.new(0, 100, 0, 255), end_color = Color.new(255, 255, 255, 255))
end
raz_bars_base_exp(actor, x + 8, y - 2)
end
#==========================================================================
# * Draw Parameter
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# type : parameter type (0-6)
#==========================================================================
alias raz_bars_base_parameter draw_actor_parameter
def draw_actor_parameter(actor, x, y, type)
case type
when 0
para_color1 = Color.new(100,0,0)
para_color2 = Color.new(255,0,0)
para_begin = actor.atk
when 1
para_color1 = Color.new(100,100,0)
para_color2 = Color.new(255,255,0)
para_begin = actor.pdef
when 2
para_color1 = Color.new(100,0,100)
para_color2 = Color.new(255,0,255)
para_begin = actor.mdef
when 3
para_color1 = Color.new(50,0,100)
para_color2 = Color.new(50,0,255)
para_begin = actor.str
when 4
para_color1 = Color.new(0,100,0)
para_color2 = Color.new(0,255,0)
para_begin = actor.dex
when 5
para_color1 = Color.new(50,0,50)
para_color2 = Color.new(255,0,255)
para_begin = actor.agi
when 6
para_color1 = Color.new(0,100,100)
para_color2 = Color.new(0,255,255)
para_begin = actor.int
end
draw_slant_bar(x, y + 18, para_begin, 999, 155, 4, bar_color = para_color1,
end_color = para_color2)
raz_bars_base_parameter(actor, x, y, type)
end
#=========================================================================
# * Draw Actor ATG
# actor : Actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#=========================================================================
def draw_actor_atg(actor, x, y, width = 144, height = 6)
if @at_gauge == nil
# plus_x: revised x-coordinate
# rate_x: revised X-coordinate as (%)
# plus_y: revised y-coordinate
# plus_width: revised width
# rate_width: revised width as (%)
# height: Vertical width
# align1: Type 1 ( 0: left justify 1: center justify 2: right justify )
# align2: Type 2 ( 0: Upper stuffing 1: Central arranging 2:Lower stuffing )
# align3: Gauge type 0:Left justify 1: Right justify
@plus_x = 0
@rate_x = 0
@plus_y = 16
@plus_width = 0
@rate_width = 100
@width = @plus_width + width * @rate_width / 100
@height = 6
@align1 = 0
@align2 = 1
@align3 = 0
# Gradation settings: grade1: Empty gauge grade2:Actual gauge
# (0:On side gradation 1:Vertically gradation 2: Slantedly gradation)
grade1 = 1
grade2 = 0
# Color setting. color1: Outermost framework, color2: Medium framework
# color3: Empty framework dark color, color4: Empty framework light/write color
color1 = Color.new(0, 0, 0)
color2 = Color.new(255, 255, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(0, 0, 64, 192)
# Color setting of gauge
# Usually color setting of the time
color5 = Color.new(0, 64, 80)
color6 = Color.new(255, 255, 255)#(0, 128, 160)
# When gauge is MAX, color setting
color7 = Color.new(80, 0, 0)
color8 = Color.new(255, 255,255) #(240,0,0)
# Color setting at time of cooperation skill use
color9 = Color.new(80, 64, 32)
color10 = Color.new(255, 255, 255) #(240, 192, 96)
# Color setting at time of skill permanent residence
color11 = Color.new(80, 0, 64)
color12 = Color.new(255,255, 255) #(240, 0, 192)
# Drawing of gauge
gauge_rect_at(@width, @height, @align3, color1, color2, color3, color4,
color5, color6, color7, color8, color9, color10, color11, color12,
grade1, grade2)
end
# Variable at substituting the width of the gauge which is drawn
if actor.rtp == 0
at = (width + @plus_width) * actor.atp * @rate_width / 10000
else
at = (width + @plus_width) * actor.rt * @rate_width / actor.rtp / 100
end
# AT Width Check
if at > width
at = width
end
# Revision such as the left stuffing central posture of gauge
case @align1
when 1
x += (@rect_width - width) / 2
when 2
x += @rect_width - width
end
case @align2
when 1
y -= @height / 2
when 2
y -= @height
end
# Draw Border
for i in 0..height
self.contents.fill_rect(x + 1.5 + i, y + 12 + height - i, width - 2 , 3,
Color.new(50, 50, 50, 255))
end
# Draw Background
for i in 1..(height - 1)
r = 100 * (height - i) / height + 0 * i / height
g = 100 * (height - i) / height + 0 * i / height
b = 100 * (height - i) / height + 0 * i / height
a = 255 * (height - i) / height + 255 * i / height
self.contents.fill_rect(x + 1.5 + i, y + 12 + height - i, width - 3, 3,
Color.new(r, b, g, a))
end
# Rect_X control
if @align3 == 0
rect_x = 0
else
x += @width - at - 1
rect_x = @width - at - 1
end
# Color setting of gauge
if at == width
#Gauge drawing at the time of MAX
for i in 0..height
self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y -i +
@plus_y, @at_gauge, Rect.new(rect_x, @height * 2, at, @height))
end
else
if actor.rtp == 0
for i in 0..height
# Usually gauge drawing of the time
self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y- i +
@plus_y, @at_gauge,Rect.new(rect_x, @height, at, @height))
end
else
if actor.spell == true
for i in 0..height
#Gauge drawing at time of cooperation skill use
self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y - i +
@plus_y, @at_gauge, Rect.new(rect_x, @height * 3, at, @height))
end
else
for i in 0..height
# Gauge drawing at time of skill permanent residence
self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y - i +
@plus_y, @at_gauge, Rect.new(rect_x, @height * 4, at, @height))
end
end
end
end
end
#=========================================================================
# * Draw Actor Limit Break Bar
# actor : Actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#=========================================================================
def draw_actor_lb(actor, x, y, width = 144)
rate = actor.limitbreak.to_f / LB_MAX
plus_x = 0
rate_x = 0
plus_y = 0
plus_width = 0
rate_width = 100
height = 7
lb = (width + plus_width) * actor.limitbreak * rate_width / 100 / LB_MAX
# Drawing of gauge
if actor.limitbreak == LB_MAX
# Draw Silver Blue Bar
draw_slant_bar(x + plus_x + width * rate_x / 100, y + plus_y, lb, width,
width, height, od_color1 = Color.new(0,80,200,192),
od_color2 = Color.new(255,255,255,192))
else
# Draw Green Bar
draw_slant_bar(x + plus_x + width * rate_x / 100, y + plus_y, lb, width,
width, height, od_color1 = Color.new(31, 128, 0, 128),
od_color2 = Color.new(255, 255, 191))
end
end
end
fammi risapere
-
Ehi Sleeping visto che lo script è il tuo vorrei se gli aggiungesti un opziione al tuo status summon, che potrebbe tornare utile per molte persone. allora vorrei che aggiungesti la possibilità di far scegliere anche alle summon la propria limit break type, io ho utilizzato lo script di dvv
ed è il seguente:
#======================================================================
========
# ** Limit Break (DVV's)
#------------------------------------------------------------------------------
# by DerVVulfman
# version 2.5
# 01-10-2008
# Full SDK 2.2 Compatible (Does not need or require SDK 2.2)
#------------------------------------------------------------------------------
#
# INTRODUCTION:
#
# This system is a revamped & rewritten system that disables 'element-tagged'
# skills until the hero's limitbreak bar is filled. Once the skill is used,
# the skill becomes disabled again. Works with and without the RTAB system.
#
# One feature that was sadly lacking in all other systems was the inability
# to fill the limitbreak bar with item damage. Previous systems only looked
# to damage inflicted through attacks and skill use. Items such as grenades
# were entirely overlooked.
#
# It has been designed 'menu-less' by intent, and this is to prevent any pos-
# sible conflicts with any custom menu system. However Alistor (RMXP.ORG) has
# designed a menu system that can change an actor's limit break fill-type:
# (Attack/Defend/Guard). It is ready for plug-n-play use.
#
# The system, by itself, does not change the 'ATTACK' option in the Actor's
# command window either. Instead, this system enables/disables the skills
# in the skill menu for you to select. Another add-on has been created by
# me to change the 'Attack' option for you. * It's been asked for. :) *
#
# It still requires a bar-drawing system such as 'Cogwheel's HP/SP/EXP Gauge'
# script to draw the Limit Break bar, unless a suitable Bar Drawing script is
# available. However, when not using a bar-drawing system, you merely do not
# have bars visible in-game. Previous versions either had their own built-in
# cheaply designed bar system, or required a separate script to prevent the
# project from crashing. This system neither needs bars to be drawn or re-
# quires a bar system to prevent crashes.
#
#------------------------------------------------------------------------------
#
# SYSTEMS OF NOTE:
#
# While most of the configuration system is set via CONSTANTS, the 'Flexible
# Positioning System' is set via ($)Global values that can be edited from any
# MAP EVENT script call. That way, positioning of the bars can be changed
# based on which menu or battlestatus window you are using at the time. The
# RTAB battlesystem uses its own set of $Global values ($lb_rtab_pos & _var)
# as it has an almost unique way to draw its own BattleStatus window. The
# ParaDog v 2.58 battlesystem also uses these two values for its own limit
# break bar placement.
#
# The $lb_hidden global array can hold the ID of actors in your database that
# do not have their Limit Break bars visible on the screen. It also disables
# the Limit Break Sound Effect from playing if the same actor's 'limit-break'
# value has maxed out (his/her non-visible bar becomes filled). As a $global
# value, it too can be edited from any MAP EVENT script call.
#
#------------------------------------------------------------------------------
#
# COMPATABILITY:
#
# This system has been designed initially for the default and RTAB battlesys-
# tems, however by the use of ALIASes throughout the system... this script is
# also SDK 2.2 compliant, and compliant with both the XRXS #65 and the Para-
# Dog V 2.58 battlesystem:
#
# RE: ParaDog's V 2.58
# * As stated above, the ParaDog system also uses the same section of the
# 'Flexible Positioning System as RTAB. This allows the use of Verti-
# cally aligned Limit Break bars instead of the default Horizontal bars.
#
#
#------------------------------------------------------------------------------
#
# CREDITS AND THANKS:
#
# Thanks goes to link2795 for discovering the 'healing items/RTAB' bug. And
# to Jaide for recommending the 'Death Wipe' feature, & finding an RTAB bug.
# Also to VinVulpis for noting a misplaced @active_battler value, and final-
# ly to Nadim who found that enemies attacking themselves caused nil errors
# as no 'actor' performed these actions.
#
#==============================================================================
#=======================================================================#
# ** C O N F I G U R A T I O N S Y S T E M ** #
#=======================================================================#
# Name of the Limit Break element
LB_NAME = "Limit Break"
# Starting/Default Limit Break Setting
LB_START = 0 # 0 = Attack | 1 = Critical | 2 = Damaged
# 3 = Killed an enemy | 4 = Killed a Boss | 5 = Hero Died
# 6 = Victory | 7 = Escape/Flee | 8 = Defending
# 9 = Lone Combatant | 10 = Any Action | 11 = Crit. Health
# Enemy Bosses (by ID)
# Related to the LB_Rate, it determines if points garnered through 'killing'
# an ememy gives regular 'enemy' points or 'boss' points to your LB gauge.
LB_BOSSES = [17] # Set to enemy 17 (Skeleton)
# Hidden Actors (by ID)
# This array holds the ID number of Actors who hide their own Limit Break bars
# in both the battle and menu screens. Will only apply to both battle & menu.
$lb_hidden = [7] # Set to actor #7: Gloria
# Limit Break Max Value
LB_MAX = 1000
# Limit Break Fill Rates
# For flat rates & max value settings, the max value should not exceed LB_MAX.
LB_RATE = [ 10, 50, 200, # Hero Attacks the Enemy (rate, min., max.)
25, 25, 1000, # Hero delivers a CRITICAL! (rate, min., max.)
30, 1, 1000, # Hero takes Damage (rate, min., max.)
500, 750, 900, # Fatalaties: Enemy, Boss or Self (flat rate)
200, 200, 100, # Victory, Escape & Defending (flat rate)
160, 40, 160] # Loner, Action & Crit. Health (flat rate)
# Limit Break Death Wipe
# This supercedes the LB_RATE condition for the 'Hero Died' setting.
LB_D_WIPE = true # If true, death wipes out their LB points.
# Flexible positioning system. Default position appears under the STATUS txt.
$lb_menu_on = 1 # If set to '1', the bar is shown in the menu.
$lb_menu_pos = [ 0, 0, 190] # Positioning in the menu: X, Y, & bar width.
$lb_battle_pos = [ 0, 64, 120] # Positioning in the battle menu. Same setup.
# For special consideration... # RTAB and ParaDog Limit break bars use below.
$lb_rtab_pos = [ 0, -25, 111] # Position if using RTAB system. Same setup.
$lb_rtab_var = [0, 40] # Variable distances between hero's LB gauges.
# SE played when Limit Break filled
LB_RING = "006-System06"
#------------------------------------------------------------------------------#
# Do not edit below unless you know what you're doing. The following code is #
# for automatic systems in the script. Values are edited or passed elsewhere. #
#------------------------------------------------------------------------------#
# Stores the battler id for item users (needed for non-RTAB systems)
$item_user = nil
# Obtain the Limit Break 'id' from the system
$data_system = load_data("Data/System.rxdata")
$lb_element_id = $data_system.elements.index(LB_NAME)
#========================================================================
# C O N F I G U R A T I O N S Y S T E M E N D #
#========================================================================
module Limit_Shortcuts
#--------------------------------------------------------------------------
# * Attack / Struck an enemy (for type 0 conditions)
# aggressor : battler
# victim : battler
#--------------------------------------------------------------------------
def lb_attacker(aggressor, victim, current_dmg)
# Check to make sure the victim is an enemy and the aggressor is self
if aggressor.is_a?(Game_Actor) && victim.is_a?(Game_Enemy) && aggressor.lb_type == 0
# Limit Break growth calculation
lb_calc = current_dmg * LB_RATE[0] * 10 / victim.base_damage
# Adjust Limit Break growth between min & max values
lb_add = [[lb_calc, LB_RATE[1]].max, LB_RATE[2]].min
# OD gauge increase
aggressor.limitbreak += lb_add
end
end
#--------------------------------------------------------------------------
# * Damaged by an enemy (for type 2 conditions)
# aggressor : battler
# victim : battler
#--------------------------------------------------------------------------
def lb_damaged(aggressor, victim, current_dmg)
# Check to make sure the agressor is an enemy and the victim is self
if aggressor.is_a?(Game_Enemy) && victim.is_a?(Game_Actor) && victim.lb_type == 2
lb_calc = current_dmg * LB_RATE[6] * 10 / victim.maxhp
# Adjust Limit Break growth between min & max values
lb_add = [[lb_calc, LB_RATE[7]].max, LB_RATE[8]].min
victim.limitbreak += lb_add
end
end
end
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles data surrounding the system. Backround music, etc.
# is managed here as well. Refer to "$game_system" for the instance of
# this class.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
# Additional values for the save/load feature
attr_accessor :lb_rtab_detected # Detect RTAB system
attr_accessor :lb_para_detected # Detect ParaDog system
attr_accessor :lb_mn # menu on
attr_accessor :lb_mp # menu position
attr_accessor :lb_bp # battle position
attr_accessor :lb_rp # rtab position
attr_accessor :lb_rv # rtab variance
attr_accessor :lb_h # hidden
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias lb_init initialize
def initialize
# Perform the original call
lb_init
@lb_rtab_detected = nil
@lb_para_detected = nil
# Create the savable values
@lb_mn = 0
@lb_mp = []
@lb_bp = []
@lb_rp = []
@lb_rv = []
@lb_h = []
end
end
#==============================================================================
# ** Scene_Save
#------------------------------------------------------------------------------
# This class performs save screen processing.
#==============================================================================
class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# * Write Save Data
# file : write file object (opened)
#--------------------------------------------------------------------------
alias lb_wsd write_save_data
def write_save_data(file)
# Store the globals
$game_system.lb_mn = $lb_menu_on
$game_system.lb_mp = $lb_menu_pos
$game_system.lb_bp = $lb_battle_pos
$game_system.lb_rp = $lb_rtab_pos
$game_system.lb_rv = $lb_rtab_var
$game_system.lb_h = $lb_hidden
# Perform the original call
lb_wsd(file)
end
end
#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
# This class performs load screen processing.
#==============================================================================
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# * Read Save Data
# file : file object for reading (opened)
#--------------------------------------------------------------------------
alias lb_rsd read_save_data
def read_save_data(file)
#Perform the original call
lb_rsd(file)
# ReStore the globals
$lb_menu_on = $game_system.lb_mn
$lb_menu_pos = $game_system.lb_mp
$lb_battle_pos = $game_system.lb_bp
$lb_rtab_pos = $game_system.lb_rp
$lb_rtab_var = $game_system.lb_rv
$lb_hidden = $game_system.lb_h
end
end
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass for the Game_Actor
# and Game_Enemy classes.
#==============================================================================
class Game_Battler
include Limit_Shortcuts
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :max_ct
attr_accessor :base_damage
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias lb_init initialize
def initialize
lb_init
if max_ct != nil
$game_system.lb_para_detected = true
end
end
#--------------------------------------------------------------------------
# * Applying Normal Attack Effects (Edited)
# attacker : battler
#--------------------------------------------------------------------------
alias lb_attack_effect attack_effect
def attack_effect(attacker)
# Attach base damage to battler (for self.base_damage)
@base_damage = nil
# Execute the original process
result = lb_attack_effect(attacker)
# Set current damage (rtab or not)
current_dmg = self.damage
if $game_system.lb_rtab_detected; current_dmg = self.damage[attacker]; end
# Set crit flag (rtab or not)
current_crit = self.critical
if $game_system.lb_rtab_detected; current_crit = self.critical[attacker]; end
# Calculate basic damage
if @base_damage == nil
@base_damage =
[attacker.atk - self.pdef / 2, 0].max * (20 + attacker.str) / 20
end
# When actual physical damage is applied
if result && current_dmg.is_a?(Numeric) && self.base_damage > 0
# When HERO attacking the enemy (and tagged for 'Attack')
lb_attacker(attacker, self, current_dmg)
# If the HERO made a critical hit on the Enemy
if attacker.is_a?(Game_Actor) && self.is_a?(Game_Enemy) && attacker.lb_type == 1
if current_crit
# Limit Break growth calculation
lb_calc = current_dmg * LB_RATE[3] * 10 / self.base_damage
# Adjust Limit Break growth between min & max values
lb_add = [[lb_calc, LB_RATE[4]].max, LB_RATE[5]].min
# OD gauge increase
attacker.limitbreak += lb_add
end
end
# When HERO is damaged by the enemy (and tagged for 'Damaged')
lb_damaged(attacker, self, current_dmg)
end
return result
end
#--------------------------------------------------------------------------
# * Apply Skill Effects
# user : the one using skills (battler)
# skill : skill
#--------------------------------------------------------------------------
alias lb_skill_effect skill_effect
def skill_effect(user, skill)
# Attach base damage to battler (for self.base_damage)
@base_damage = nil
# Execute the original process
result = lb_skill_effect(user, skill)
# Set current damage (rtab or not)
current_dmg = self.damage
if $game_system.lb_rtab_detected; current_dmg = self.damage[user]; end
# Recalculate the base (unadjusted) damage
if @base_damage == nil
# Calculate power
power = skill.power + user.atk * skill.atk_f / 100
if power > 0
power -= self.pdef * skill.pdef_f / 200
power -= self.mdef * skill.mdef_f / 200
power = [power, 0].max
end
# Calculate rate
rate = 20
rate += (user.str * skill.str_f / 100)
rate += (user.dex * skill.dex_f / 100)
rate += (user.agi * skill.agi_f / 100)
rate += (user.int * skill.int_f / 100)
# Calculate basic damage
@base_damage = power * rate / 20
end
# When actual physical damage is applied
if result && current_dmg.is_a?(Numeric) && self.base_damage > 0
# When HERO attacking the enemy (and tagged for 'Attack')
lb_attacker(user, self, current_dmg)
# When HERO is damaged by the enemy (and tagged for 'Damaged')
lb_damaged(user, self, current_dmg)
end
# When limitbreak skill is used
if user.is_a?(Game_Actor) && skill.element_set.include?($lb_element_id)
# Reset gauge
user.limitbreak = 0
end
return result
end
#--------------------------------------------------------------------------
# * Application of Item Effects
# item : item
#--------------------------------------------------------------------------
alias lb_item_effect item_effect
def item_effect(item, battler = @active_battler)
# Attach base damage to battler (for self.base_damage)
@base_damage = nil
# Set 'user' to the current battler (and ensure if RTAB)
user = $item_user
if $game_system.lb_rtab_detected; user = battler; end
# Execute the original process (RTAB or not)
if $game_system.lb_rtab_detected
result = lb_item_effect(item, user)
else
result = lb_item_effect(item)
end
# Set current damage (rtab or not)
current_dmg = self.damage
if $game_system.lb_rtab_detected; current_dmg = self.damage[user]; end
# Recalculate the base (unadjusted) damage
if @base_damage == nil
#Calculate power
power = maxhp * item.recover_hp_rate / 100 + item.recover_hp
if power < 0
power += self.pdef * item.pdef_f / 20
power = [power, 0].min
end
# Set damage value and reverse item power amount
@base_damage = -power
end
# When actual physical damage is applied
if result && current_dmg.is_a?(Numeric) && self.base_damage > 0
# When HERO attacking the enemy (and tagged for 'Attack')
lb_attacker(user, self, current_dmg)
# When HERO is damaged by the enemy (and tagged for 'Damaged')
lb_damaged(user, self, current_dmg)
end
return result
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
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :limitbreak # Limitbreak value
attr_accessor :lb_type # Limitbreak action type
attr_accessor :limitbreak_ring # Limit Break Ring Checker
attr_accessor :battle_started
#--------------------------------------------------------------------------
# * Setup
# actor_id : actor ID
#--------------------------------------------------------------------------
alias lb_setup setup
def setup(actor_id)
# Perform the original call
lb_setup(actor_id)
@limitbreak = 0 # Reset Limit Break gauge to zero
@lb_type = LB_START # Set the Limit Break type to 'config' settings.
@limitbreak_ring = false # Turn the 'ring' off
@battle_started = false
end
#--------------------------------------------------------------------------
# * Determine if Skill can be Used
# skill_id : skill ID
#--------------------------------------------------------------------------
alias lb_skill_can_use? skill_can_use?
def skill_can_use?(skill_id)
# Get result from original call
result = lb_skill_can_use?(skill_id)
# Return if already disabled
return if result == false
# Obtain skill from database
skill = $data_skills[skill_id]
# Only perform if skill
if skill != nil
# Only perform if includes the Element
if skill.element_set.include?($lb_element_id)
# If the limitbreak bar is filled, skill is available
if self.limitbreak == LB_MAX
result = true
# Otherwise, it isn't
else
result = false
end
end
end
return result & super
end
#--------------------------------------------------------------------------
# * Adjust the limitbreak value (permits addition & keeps within range)
#--------------------------------------------------------------------------
def limitbreak=(limitbreak)
@limitbreak = limitbreak
@limitbreak = LB_MAX if @limitbreak > LB_MAX
@limitbreak = 0 if @limitbreak < 0
end
#--------------------------------------------------------------------------
# * Acquire Limit Break value (nil values won't cause errors now)
#--------------------------------------------------------------------------
def limitbreak
# Return 0 if nil (prevent errors)
@limitbreak = 0 if @limitbreak == nil
return @limitbreak
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================
class Window_Base
#--------------------------------------------------------------------------
# * Draw Actor Name
#--------------------------------------------------------------------------
alias lb_draw_actor_name draw_actor_name
def draw_actor_name(actor, x, y)
# Only perform if the actor isn't hidden
unless $lb_hidden.include?(actor.id)
# Set/reset the x, y and width of the Limit Break bar.
ox = $game_temp.in_battle ? $lb_battle_pos[0] : $lb_menu_pos[0]
oy = $game_temp.in_battle ? $lb_battle_pos[1] : $lb_menu_pos[1]
ow = $game_temp.in_battle ? $lb_battle_pos[2] : $lb_menu_pos[2]
# To menu... or not to menu
if $lb_menu_on == 1 && !$game_temp.in_battle
draw_actor_lb(actor, x + ox, y + oy + 32, ow)
elsif $game_temp.in_battle
unless $game_system.lb_rtab_detected or $game_system.lb_para_detected
draw_actor_lb(actor, x + ox, y + oy + 32, ow)
end
end
end
lb_draw_actor_name(actor, x, y)
end
#--------------------------------------------------------------------------
# * Draw Battler Name
#--------------------------------------------------------------------------
# If the BattleStatus value of 'Alignment' exists
if $bstat_align != nil
alias lb_draw_battler_name draw_battler_name
def draw_battler_name(actor, x, y)
# Only perform if the actor isn't hidden
unless $lb_hidden.include?(actor.id)
# Set/reset the x, y and width of the Limit Break bar.
ox = $game_temp.in_battle ? $lb_battle_pos[0] : $lb_menu_pos[0]
oy = $game_temp.in_battle ? $lb_battle_pos[1] : $lb_menu_pos[1]
ow = $game_temp.in_battle ? $lb_battle_pos[2] : $lb_menu_pos[2]
# To menu... or not to menu
if $lb_menu_on == 1 && !$game_temp.in_battle
draw_actor_lb(actor, x + ox, y + oy + 32, ow)
elsif $game_temp.in_battle
unless $game_system.lb_rtab_detected or $game_system.lb_para_detected
draw_actor_lb(actor, x + ox, y + oy + 32, ow)
end
end
end
lb_draw_battler_name(actor, x, y)
end
end
#--------------------------------------------------------------------------
# * Draw Limit Break Meter
#--------------------------------------------------------------------------
def draw_actor_lb(actor, x, y, width = 144)
if defined?(gauge_rect)
rate = actor.limitbreak.to_f / LB_MAX
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
grade1 = 1
grade2 = 0
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(64, 0, 0, 192)
color5 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192)
color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192)
lb = (width + plus_width) * actor.limitbreak * rate_width / 100 / LB_MAX
gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, lb, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
end
end
end
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
# This window displays the status of all party members on the battle screen.
#==============================================================================
class Window_BattleStatus < Window_Base
alias lb_init initialize
def initialize
lb_init
if defined?(at_refresh)
$game_system.lb_rtab_detected = true
end
refresh
end
#--------------------------------------------------------------------------
# * Full Limit Break Gauge SE
#--------------------------------------------------------------------------
def full_lb_se
if LB_RING != nil
if LB_RING != ""
Audio.se_play("Audio/SE/" + LB_RING, 80, 100)
end
end
end
#--------------------------------------------------------------------------
# * Frame renewal
#--------------------------------------------------------------------------
alias lb_refresh refresh
def refresh(number = 0)
# Call the original def
if $game_system.lb_rtab_detected
lb_refresh(number)
else
lb_refresh
end
# This block is needed only if RTAB in use
if $game_system.lb_rtab_detected or $game_system.lb_para_detected
# Ensure bitmap available for bar drawing
if self.contents == nil
self.contents = Bitmap.new(width - 32 ,height - 32)
end
# Search through actors & draw bar if applicable
if number == 0
for i in 0...$game_party.actors.size
rtab_pos_x = $lb_rtab_pos[0] + ($lb_rtab_var[0] * i)
rtab_pos_y = $lb_rtab_pos[1] + ($lb_rtab_var[1] * i)
unless $lb_hidden.include?($game_party.actors.id)
draw_actor_lb($game_party.actors, rtab_pos_x, rtab_pos_y+10, $lb_rtab_pos[2])
end
end
else
if $game_party.actors[number].is_a?(Game_Actor)
rtab_pos_x = $lb_rtab_pos[0] + ($lb_rtab_var[0] * number)
rtab_pos_y = $lb_rtab_pos[1] + ($lb_rtab_var[1] * number)
unless $lb_hidden.include?($game_party.actors[number].id)
draw_actor_lb($game_party.actors[number], rtab_pos_x, rtab_pos_y+10, $lb_rtab_pos[2])
end
end
end
end
# Go through the Actors
$game_party.actors.each { |actor|
# Only perform if the actor exists
next unless actor.exist?
# When the Limit Break gauge is set to zero,
# Reset the Limit Break Ringer to false
if actor.limitbreak == 0
actor.limitbreak_ring = false
end
# When the Limit Break Ringer hasn't rung
if actor.limitbreak_ring == false
# But, if the Limit Break Bar is filled
if actor.limitbreak == LB_MAX
# Do not permit hidden actor bars to ring
unless $lb_hidden.include?(actor.id)
# If the battle only just started
if actor.battle_started == true
# turn off the battle started flag
actor.battle_started = false
else
# Play the Limit Break Sound Effect
full_lb_se
end
end
# And Set the Limit Break Ringer to true
actor.limitbreak_ring = true
end
end
}
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
alias lb_main main
def main
# Ensure that the limitbreak SE doesn't chime at battle start
for i in 0...$game_party.actors.size
if $game_party.actors.limitbreak == LB_MAX
$game_party.actors.battle_started = true
$game_party.actors.limitbreak_ring = true
end
end
lb_main
end
#--------------------------------------------------------------------------
# * Battle Ends
# result : results (0:win 1:lose 2:escape)
#--------------------------------------------------------------------------
alias lb_battle_end battle_end
def battle_end(result)
# Branch on Battle condition
case result
when 0 # Victory
$game_party.actors.each { |actor|
next unless actor.exist?
# For each actor who won & set to Victory
if actor.lb_type == 6
actor.limitbreak += LB_RATE[12]
end
}
when 1 # Escape
$game_party.actors.each { |actor|
next unless actor.exist?
# For each actor who ran & set to Escape
if actor.lb_type == 7
actor.limitbreak += LB_RATE[13]
end
}
end
# Defeat
lb_battle_end(result)
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 2 : start action)
#--------------------------------------------------------------------------
alias lb_adddate_p4_s2 update_phase4_step2
def update_phase4_step2(battler = @active_battler)
# Perform only if actor
if battler.is_a?(Game_Actor)
# Reset adding value
lb_add = 0
# Branch on LimitBreak type
case battler.lb_type
when 8 # When Defending
if battler.current_action.kind = 0
if battler.current_action.basic == 1
lb_add = LB_RATE[14]
end
end
when 9 # When it's a lone battler
if $game_party.actors.size == 1
lb_add = LB_RATE[15]
end
when 10 # When performing ANY acton
lb_add = LB_RATE[16]
when 11 # If in CRITICAL
if battler.hp <= battler.maxhp / 4
lb_add = LB_RATE[17]
end
end
# Add values to limitbreak
battler.limitbreak += lb_add
end
# Perform the original call
if $game_system.lb_rtab_detected; lb_adddate_p4_s2(battler); else; lb_adddate_p4_s2; end
end
#--------------------------------------------------------------------------
# * Make Item Action Results
#--------------------------------------------------------------------------
alias lb_miar make_item_action_result
def make_item_action_result(battler = @active_battler)
$item_user = battler
# Perform the original call
if $game_system.lb_rtab_detected; lb_miar(battler); else; lb_miar; end
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 4 : animation for target)
#--------------------------------------------------------------------------
alias lb_update_p4_s4 update_phase4_step4
def update_phase4_step4(battler = @active_battler)
if $game_system.lb_rtab_detected
@status_window.update
@status_window.refresh
end
# Perform the original call
if $game_system.lb_rtab_detected; lb_update_p4_s4(battler); else lb_update_p4_s4 ; end
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 6 : refresh)
#--------------------------------------------------------------------------
alias lb_up4s6 update_phase4_step6
def update_phase4_step6(battler = @active_battler)
@rtab = !@target_battlers
for target in (@rtab ? battler.target : @target_battlers)
# If a battler has died
if target.dead?
# If the target battler is an enemy
if target.is_a?(Game_Enemy)
# Only if the attacker is an actor
unless battler.is_a?(Game_Actor)
# If an enemy killed check is performed
if battler.lb_type == 3
battler.limitbreak += LB_RATE[9]
# If a boss enemy check is performed
elsif battler.lb_type == 4
if LB_BOSSES.include?(target.id)
battler.limitbreak += LB_RATE[10]
end
end
end
# else the battler is an actor
else
# if a 'Hero Dies' check is performed
if target.lb_type == 5
target.limitbreak += LB_RATE[11]
end
# If the Limit Break Death Wipe feature is on
if LB_D_WIPE
target.limitbreak = 0
end
end
if $game_system.lb_rtab_detected
@status_window.update
@status_window.refresh
end
end
end
@rtab ? lb_up4s6(battler) : lb_up4s6
end
end
Parte 2
#======================================================================
========
# DerVVulfman's Limit Break Menu v 2.7
# By Alistor, with Edits by DerVVulfman
# Original Concept by SephirothSpawn
#==============================================================================
# This script has an Auto-Detect function that, when used with SDK, replaces the
# internal Window_HorizCommand with the SDK version. Thanks go to DerVVulfman for that
# method. Added a second Auto-Detect function that, when used with the Attack Replacer LB
# Add-On, removes limits from the skill window in battle and vice-versa.
#==============================================================================
#=======================================================================#
# ** C O N F I G U R A T I O N S Y S T E M ** #
#=======================================================================#
# Allows you to hide SP values of zero:
# =====================================
HIDE_ZERO_SP = true
# Basic Menu Text:
# ================
LB_MENU_TITLE = 'Limit Break' # Menu Title
LB_HEADING_1 = 'Limits Personaggio' # Option 1 Text: List of Limit Break Skills
LB_HEADING_2 = 'Modalità Limits' # Option 2 Text: List of Limit Break Types
# Preset Gain Mode Help Text System:
# =================================+
# This customizes the text shown after you choose the limit break style for an
# actor. Originally hardwired, you can now edit the layout right here.
#
# {lb_a_name} :Actor's Name
# {lb_a_type} :Actor's Gain Mode Text (Limit Type)
LB_GAIN_TEXT = "{lb_a_name}'s Gain Mode is Now {lb_a_type}"
# - Sample output: Aluxes's Gain Mode is now Stotic -
#
# Optionally, you could have it be this:
# LB_GAIN_TEXT = "Gain Mode of {lb_a_type} now set to {lb_a_name}"
# - Sample output: Gain Mode of Victor now set to Gloria -
# Array of Limit Break types:
# ===========================
# This allows you to list the limit break styles or settings available in your
# system. You can choose to list them in any order and pick and choose whether
# a limit break style will even be in your game. You no longer have to use
# 'all' the limit break types available. And as such, this system is already
# designed to accomodate any newer limit break types not yet available.
#
# Idx: The index/setting of a 'limit break type' as defined by LB_START
# Type Name: The basic choice/option of a 'limit break type' in the menu
# Type Desc: A help text description of a 'limit break type'
#
# FORMAT:
# LB_MENU_ARRAY = [ [Limit Array], [Limit Array],... ]
# with...
# Limit Array = [idx(as number), Type Name(as string), Type Desc(as string)]
#
# NOTE: The array can be set in any order, so the menu options can be arranged
# in any order. What controls the limit break type in use is the 'Idx'
# number in the array.
#
# Idx Type Name Type Desc
LB_MENU_ARRAY = [ [0, 'Warrior', 'Warrior - Gains When Hero Damages Enemy'] ,
[1, 'Heavy Hitter', 'Heavy Hitter - Gains When Hero Lands a Critical Hit'],
[2, 'Stotic', 'Stotic - Gains When Hero Receives Damage'] ,
[3, 'Slayer', 'Slayer - Gains When Hero Kills Enemy'],
[4, 'Godslayer', 'GodSlayer - Gains When Hero Defeats a Boss'],
[5, 'Victim', 'Victim - Gains When Hero is Slain'],
[6, 'Victor', 'Victor - Gains When Party Wins Battle'],
[7, 'Coward', 'Coward - Gains When Hero Escapes Battle'],
[8, 'Defender', 'Defender - Gains When Hero Chooses to Guard'],
[9, 'Loner', 'Loner - Gains When Hero Is Only Member in Party'],
[10, 'Active', 'Active - Gains When Hero Performs an Action'],
[11, 'Daredevil', 'Daredevil - Gains When Hero is in Critical Condition'] ]
#=======================================================================#
# C O N F I G U R A T I O N S Y S T E M E N D #
#=======================================================================#
#==============================================================================
# ** RMXP Standard Development Kit (SDK)
#------------------------------------------------------------------------------
# A system aimed to increase compatibility between RGSS scripts
#==============================================================================
module SDK
# Set Autodetect global to false
$lbadd_menu_sdk = false
# SDK Autodetect routine
if defined?(log_alias)
# Set Autodetect global to true
$lbadd_menu_sdk = true
end
end
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles data surrounding the system. Backround music, etc.
# is managed here as well. Refer to "$game_system" for the instance of
# this class.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :lb_attack_detected
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias lbadd1_init initialize
def initialize
lbadd1_init
if @lb_height != nil
@lb_attack_detected = true
end
end
end
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# Refer to "$game_temp" for the instance of this class.
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :seperation # Seperation flag
attr_accessor :limitbreak_skills # Limit Break skill flag
attr_accessor :limit_menu # Limit Break menu flag
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias lbadd1_init initialize
def initialize
lbadd1_init
@seperation = true
@limitbreak_skills = false
@limit_menu = false
end
end
#==============================================================================
# ** Window_Skill
#------------------------------------------------------------------------------
# This window displays usable skills on the skill and battle screens.
#==============================================================================
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
unless $gnd_lb_patch
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
unless @actor == nil
for i in 0...@actor.skills.size
skill = $data_skills[@actor.skills]
unless skill == nil
if $game_temp.seperation
if $game_temp.limitbreak_skills
@data.push(skill) if skill.element_set.include?($lb_element_id)
else
@data.push(skill) unless skill.element_set.include?($lb_element_id)
end
else
@data.push(skill)
end
end
end
end
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
$game_temp.seperation = true
$game_temp.limitbreak_skills = false
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
unless HIDE_ZERO_SP && skill.sp_cost == 0
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
end
end
#--------------------------------------------------------------------------
# * Check Data
#--------------------------------------------------------------------------
def data
return @data
end
end
#==============================================================================
# ** Window Horizontal Command (conditional on SDK system)
#------------------------------------------------------------------------------
# This window deals with general command choices, horizontally.
#==============================================================================
# If no SDK exists...
if !$lbadd_menu_sdk
# Use the Non-SDK system
class Window_HorizCommand < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(commands, width = 640, height = 64)
super(0, 0, width, height)
self.contents = Bitmap.new(width - 32, height - 32)
@commands = commands
@item_max = @commands.size
@column_max = @commands.size
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
x = width / @item_max * index
off = width / @item_max - 32
self.contents.draw_text(x, 0, off, 32, @commands[index], 1)
end
#--------------------------------------------------------------------------
# * Disable Item
# index : item number
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end
end
end
#==============================================================================
# ** Scene_LimitMenu
#------------------------------------------------------------------------------
# This class performs limit break screen processing.
#==============================================================================
class Scene_LimitMenu
#--------------------------------------------------------------------------
# * Object Initialization
# actor_index : actor index
#--------------------------------------------------------------------------
def initialize(actor_index = 0)
@actor_index = actor_index
# Attach the Limit Menu flag
$game_temp.limit_menu = true
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
if @actor_index < $game_party.actors.size
@actor = $game_party.actors[@actor_index]
else
@actor = $game_party.reserve_actors[@actor_index - $game_party.actors.size]
end
# Make Help Window
@help_window = Window_Help.new
# Command Window
# If the SDK is disabled
if $lbadd_menu_sdk
@command_window = Window_HorizCommand.new(640, [LB_HEADING_1, LB_HEADING_2])
else
@command_window = Window_HorizCommand.new([LB_HEADING_1, LB_HEADING_2])
end
@command_window.y = 128
# Skill Window
@skill_window = Window_Skill.new(@actor)
@skill_window.y = 192
@skill_window.height = 288
$game_temp.seperation = true
$game_temp.limitbreak_skills = true
@skill_window.refresh
@skill_window.active = false
# Skill Status Window
@status_window = Window_SkillStatus.new(@actor)
@status_window.y = 64
# Limit Break Types Window
@lb_type_window = Window_Limit_Types.new
@lb_type_window.y = 192
@lb_type_window.index = @actor.lb_type
@lb_type_window.visible = @lb_type_window.active = false
# Associate help window
if @skill_window.help_window == nil
@help_window.set_text(LB_MENU_TITLE, 1)
else
@skill_window.help_window = @help_window
end
# Scene Objects
@objects = [@help_window, @command_window, @skill_window, @lb_type_window, @status_window]
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Objects Update
@objects.each {|x| x.update}
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of Objects
@objects.each {|x| x.dispose}
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# If Main Command Active : call update_main
if @command_window.active
update_main
return
end
# If skill window is active: call update_skill
if @skill_window.active
update_skill
return
end
# If Limit Type is active: call update_type
if @lb_type_window.active
update_type
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (if main window is active)
#--------------------------------------------------------------------------
def update_main
# Toggles Windows Visiblity
@skill_window.visible = @command_window.index == 0 ? true : false
@lb_type_window.visible = @command_window.index == 1 ? true : false
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(0)
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch Point
case @command_window.index
when 0 # View Skills
if @skill_window.data.size == 0
$game_system.se_play($data_system.buzzer_se)
@help_window.set_text(LB_MENU_TITLE, 1)
else
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@skill_window.active = true
end
when 1 # Set Limit Break Type
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@lb_type_window.active = true
@help_window.set_text(@lb_type_window.help_text, 1)
end
end
# If R button was pressed
if Input.trigger?(Input::R)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To next actor
@actor_index += 1
@actor_index %= $game_party.actors.size
# Switch to different skill screen
$scene = Scene_LimitMenu.new(@actor_index)
return
end
# If L button was pressed
if Input.trigger?(Input::L)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To previous actor
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# Switch to different skill screen
$scene = Scene_LimitMenu.new(@actor_index)
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (if main window is active)
#--------------------------------------------------------------------------
def update_skill
# Refreshes Help Window Text
@skill_window.help_window = @help_window
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
@help_window.set_text(LB_MENU_TITLE, 1)
# Switch to main menu
@command_window.active = true
@skill_window.active = false
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (if main window is active)
#--------------------------------------------------------------------------
def update_type
# Refreshes Help Window Text (if triggered once or pressed continuously)
if Input.trigger?(Input::UP) || Input.trigger?(Input::DOWN) ||
Input.trigger?(Input::RIGHT) || Input.trigger?(Input::LEFT) ||
Input.press?(Input::UP) || Input.press?(Input::DOWN) ||
Input.press?(Input::RIGHT) || Input.press?(Input::LEFT)
@help_window.set_text(@lb_type_window.help_text, 1)
end
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
@help_window.set_text(LB_MENU_TITLE, 1)
# Switch to main menu
@command_window.active = true
@lb_type_window.active = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Play cancel SE
$game_system.se_play($data_system.decision_se)
# Retrieve Limit Type from array
actor_lb_type = LB_MENU_ARRAY[@lb_type_window.index][0]
# Set Actor Limit Type
@actor.lb_type = actor_lb_type
# Set the character's gain text
lb_a_name = @actor.name
lb_a_type = LB_MENU_ARRAY[@lb_type_window.index][1]
text = LB_GAIN_TEXT.dup
begin
text[/{lb_a_name}/] = "#{lb_a_name}"
rescue
end
begin
text[/{lb_a_type}/] = "#{lb_a_type}"
rescue
end
@help_window.set_text(text, 1)
return
end
end
end
#==============================================================================
# ** Window_Limit_Types
#------------------------------------------------------------------------------
# This window displays the available limit types on the limit break screen.
#==============================================================================
class Window_Limit_Types < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 128, 640, 288)
@column_max = 2
@data = []
for i in 0...LB_MENU_ARRAY.size
@data.push(LB_MENU_ARRAY[1])
end
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Get Type
#--------------------------------------------------------------------------
def get_type
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Help Text
#--------------------------------------------------------------------------
def help_text
for i in 0...LB_MENU_ARRAY.size
text = LB_MENU_ARRAY[2] if LB_MENU_ARRAY[0] == index
end
return text
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
self.contents.draw_text(x, y, contents.width / 2 - 32, 32, @data[index], 1)
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
alias lbmenu_main main
def main
# Autodetect value added
@lb_menu = true
# Perform the original call
lbmenu_main
end
#--------------------------------------------------------------------------
# * Start Skill Selection
#--------------------------------------------------------------------------
unless $gnd_lb_patch
def start_skill_select
# RTAB detection value built into Limit Break (DVV)
# Assigns 'battler' value for the Skill Window.
if $game_system.lb_rtab_detected
battler = @active_actor
else
battler = @active_battler
end
# Make skill window
@skill_window = Window_Skill.new(battler)
if $game_system.lb_attack_detected
$game_temp.seperation = true
$game_temp.limitbreak_skills = false
@skill_window.refresh
else
$game_temp.seperation = false
$game_temp.limitbreak_skills = false
@skill_window.refresh
end
@skill_window.z = 1000
# Associate help window
@skill_window.help_window = @help_window
# Disable actor command window
@actor_command_window.active = false
@actor_command_window.visible = false
end
end
end
parte 3 modificate da me con l'aggiunta della voce eoni e settata con condizione
#======================================================================
========
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make command window
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Limit Break"
s6 = "Eoni"
s7 = "Salva"
s8 = "Esci"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7, s8])
@command_window.index = @menu_index
# If number of party members is 0
if $game_party.actors.size == 0
# Disable items, skills, equipment, and status
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
@command_window.disable_item(4)
end
# If save is forbidden
if $game_system.save_disabled
# Disable save
@command_window.disable_item(6)
end
unless $game_switches[1]
@command_window.disable_item(5)
end
# Make play time window
@playtime_window = Window_PlayTime.new
@playtime_window.x = 0
@playtime_window.y = 320
# Make gold window
@gold_window = Window_Gold.new
@gold_window.x = 0
@gold_window.y = 416
# Make status window
@status_window = Window_MenuStatus.new
@status_window.x = 160
@status_window.y = 0
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@command_window.dispose
@playtime_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
@playtime_window.update
@gold_window.update
@status_window.update
# If command window is active: call update_command
if @command_window.active
update_command
return
end
# If status window is active: call update_status
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If command other than save or end game, and party members = 0
if $game_party.actors.size == 0 and @command_window.index < 5
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Branch by command window cursor position
case @command_window.index
when 0 # item
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to item screen
$scene = Scene_Item.new
when 1 # skill
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4 # limit
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 5 # eoni
if $game_switches[1]
$game_system.se_play($data_system.decision_se)
$scene = Scene_SummonStatus.new
else
$game_system.se_play($data_system.buzzer_se)
end
when 6 # save
# If saving is forbidden
if $game_system.save_disabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to save screen
$scene = Scene_Save.new
when 7 # end game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to end game screen
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Make command window active
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 1 # skill
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to skill screen
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to equipment screen
$scene = Scene_Equip.new(@status_window.index)
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to status screen
$scene = Scene_Status.new(@status_window.index)
when 4 # limits
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to skill screen
$scene = Scene_LimitMenu.new(@status_window.index)
end
return
end
end
end
potrebe tornare utile nn credi?
-
-
Bene adesso funziona grazie
-
Ciao Sleeping...ti scrivo perchè ho scoperto un bug sul sistema di sviluppo delle summon...l'errore è il seguente:
se andiamo nell'menù delle summon, ci spostiamo su attribute, e nell' nostro inventario non possediamo oggetti e cliccando invio come se avessimo degli oggetti da dare al nostro summon la nosta creatura subisce un aumento di +5 alla str per ogni nostro click...dato che io nn ci capisco moolto di ruby speravo che riuscissi a risolverlo...anche perchè non sarebbe bello un gioco dove si possa aumentare di proposito la forza anche senza oggetti
-
Menù FFVII + PHS
1. Descrizione
Menù alla FFVII con l'aggiunta di un add-on,il PHS,una finestra per cambiare i personaggi del party.
2. Autore
Jappo
Traduction and Add-on by:Tio
Il PHS funziona come l'opzione per salvare: se userete il comando dell'evento "Disallow saving", verrà disattivato pure il PHS.Per togliere quest'opzione eliminate questa stringa (riga 661):
CODICE@command_window.disable_item(4)
e più in basso queste stringhe(dalla 757 alla 760):
CODICEif $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
E ora veniamo al code.
Prima di tutto create una classe sopra Main e copiateci tutto questo:
Menù FFVII + PHS
1. Descrizione
Menù alla FFVII con l'aggiunta di un add-on,il PHS,una finestra per cambiare i personaggi del party.
2. Autore
Jappo
Traduction and Add-on by:Tio
Il PHS funziona come l'opzione per salvare: se userete il comando dell'evento "Disallow saving", verrà disattivato pure il PHS.Per togliere quest'opzione eliminate questa stringa (riga 661):
CODICE@command_window.disable_item(4)
e più in basso queste stringhe(dalla 757 alla 760):
CODICEif $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
E ora veniamo al code.
Prima di tutto create una classe sopra Main e copiateci tutto questo:
# ■ Game_Actor
#------------------------------------------------------------------------------
# アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors)
# の内部で使用され、Game_Party クラス ($game_party) からも参照されます。
#===============================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :name # 名前
attr_reader :character_name # キャラクター ファイル名
attr_reader :character_hue # キャラクター 色相
attr_reader :class_id # クラス ID
attr_reader :weapon_id # 武器 ID
attr_reader :armor1_id # 盾 ID
attr_reader :armor2_id # 頭防具 ID
attr_reader :armor3_id # 体防具 ID
attr_reader :armor4_id # 装飾品 ID
attr_reader :level # レベル
attr_reader :exp # EXP
attr_reader :skills # スキル
attr_accessor :fixed_member # 固定メンバーフラグ
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# actor_id : アクター ID
#--------------------------------------------------------------------------
def initialize(actor_id)
super()
setup(actor_id)
end
#--------------------------------------------------------------------------
# ● セットアップ
# actor_id : アクター ID
#--------------------------------------------------------------------------
def setup(actor_id)
actor = $data_actors[actor_id]
@actor_id = actor_id
@name = actor.name
@character_name = actor.character_name
@character_hue = actor.character_hue
@battler_name = actor.battler_name
@battler_hue = actor.battler_hue
@class_id = actor.class_id
@weapon_id = actor.weapon_id
@armor1_id = actor.armor1_id
@armor2_id = actor.armor2_id
@armor3_id = actor.armor3_id
@armor4_id = actor.armor4_id
@level = actor.initial_level
@exp_list = Array.new(101)
make_exp_list
@exp = @exp_list[@level]
@skills = []
@hp = maxhp
@sp = maxsp
@states = []
@states_turn = {}
@maxhp_plus = 0
@maxsp_plus = 0
@str_plus = 0
@dex_plus = 0
@agi_plus = 0
@int_plus = 0
@fixed_member = 0
# スキル習得
for i in 1..@level
for j in $data_classes[@class_id].learnings
if j.level == i
learn_skill(j.skill_id)
end
end
end
# オートステートを更新
update_auto_state(nil, $data_armors[@armor1_id])
update_auto_state(nil, $data_armors[@armor2_id])
update_auto_state(nil, $data_armors[@armor3_id])
update_auto_state(nil, $data_armors[@armor4_id])
end
#--------------------------------------------------------------------------
# ● アクター ID 取得
#--------------------------------------------------------------------------
def id
return @actor_id
end
#--------------------------------------------------------------------------
# ● インデックス取得
#--------------------------------------------------------------------------
def index
return $game_party.actors.index(self)
end
#--------------------------------------------------------------------------
# ● EXP 計算
#--------------------------------------------------------------------------
def make_exp_list
actor = $data_actors[@actor_id]
@exp_list[1] = 0
pow_i = 2.4 + actor.exp_inflation / 100.0
for i in 2..100
if i > actor.final_level
@exp_list = 0
else
n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
@exp_list = @exp_list[i-1] + Integer(n)
end
end
end
#--------------------------------------------------------------------------
# ● 属性補正値の取得
# element_id : 属性 ID
#--------------------------------------------------------------------------
def element_rate(element_id)
# 属性有効度に対応する数値を取得
table = [0,200,150,100,50,0,-100]
result = table[$data_classes[@class_id].element_ranks[element_id]]
# 防具でこの属性が防御されている場合は半減
for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
armor = $data_armors
if armor != nil and armor.guard_element_set.include?(element_id)
result /= 2
end
end
# ステートでこの属性が防御されている場合は半減
for i in @states
if $data_states.guard_element_set.include?(element_id)
result /= 2
end
end
# メソッド終了
return result
end
#--------------------------------------------------------------------------
# ● ステート有効度の取得
#--------------------------------------------------------------------------
def state_ranks
return $data_classes[@class_id].state_ranks
end
#--------------------------------------------------------------------------
# ● ステート防御判定
# state_id : ステート ID
#--------------------------------------------------------------------------
def state_guard?(state_id)
for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
armor = $data_armors
if armor != nil
if armor.guard_state_set.include?(state_id)
return true
end
end
end
return false
end
#--------------------------------------------------------------------------
# ● 通常攻撃の属性取得
#--------------------------------------------------------------------------
def element_set
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.element_set : []
end
#--------------------------------------------------------------------------
# ● 通常攻撃のステート変化 (+) 取得
#--------------------------------------------------------------------------
def plus_state_set
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.plus_state_set : []
end
#--------------------------------------------------------------------------
# ● 通常攻撃のステート変化 (-) 取得
#--------------------------------------------------------------------------
def minus_state_set
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.minus_state_set : []
end
#--------------------------------------------------------------------------
# ● MaxHP の取得
#--------------------------------------------------------------------------
def maxhp
n = [[base_maxhp + @maxhp_plus, 1].max, 9999].min
for i in @states
n *= $data_states.maxhp_rate / 100.0
end
n = [[integer(n), 1].max, 9999].min
return n
end
#--------------------------------------------------------------------------
# ● 基本 MaxHP の取得
#--------------------------------------------------------------------------
def base_maxhp
return $data_actors[@actor_id].parameters[0, @level]
end
#--------------------------------------------------------------------------
# ● 基本 MaxSP の取得
#--------------------------------------------------------------------------
def base_maxsp
return $data_actors[@actor_id].parameters[1, @level]
end
#--------------------------------------------------------------------------
# ● 基本腕力の取得
#--------------------------------------------------------------------------
def base_str
n = $data_actors[@actor_id].parameters[2, @level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.str_plus : 0
n += armor1 != nil ? armor1.str_plus : 0
n += armor2 != nil ? armor2.str_plus : 0
n += armor3 != nil ? armor3.str_plus : 0
n += armor4 != nil ? armor4.str_plus : 0
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 基本器用さの取得
#--------------------------------------------------------------------------
def base_dex
n = $data_actors[@actor_id].parameters[3, @level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.dex_plus : 0
n += armor1 != nil ? armor1.dex_plus : 0
n += armor2 != nil ? armor2.dex_plus : 0
n += armor3 != nil ? armor3.dex_plus : 0
n += armor4 != nil ? armor4.dex_plus : 0
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 基本素早さの取得
#--------------------------------------------------------------------------
def base_agi
n = $data_actors[@actor_id].parameters[4, @level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.agi_plus : 0
n += armor1 != nil ? armor1.agi_plus : 0
n += armor2 != nil ? armor2.agi_plus : 0
n += armor3 != nil ? armor3.agi_plus : 0
n += armor4 != nil ? armor4.agi_plus : 0
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 基本魔力の取得
#--------------------------------------------------------------------------
def base_int
n = $data_actors[@actor_id].parameters[5, @level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.int_plus : 0
n += armor1 != nil ? armor1.int_plus : 0
n += armor2 != nil ? armor2.int_plus : 0
n += armor3 != nil ? armor3.int_plus : 0
n += armor4 != nil ? armor4.int_plus : 0
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 基本攻撃力の取得
#--------------------------------------------------------------------------
def base_atk
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.atk : 0
end
#--------------------------------------------------------------------------
# ● 基本物理防御の取得
#--------------------------------------------------------------------------
def base_pdef
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
pdef1 = weapon != nil ? weapon.pdef : 0
pdef2 = armor1 != nil ? armor1.pdef : 0
pdef3 = armor2 != nil ? armor2.pdef : 0
pdef4 = armor3 != nil ? armor3.pdef : 0
pdef5 = armor4 != nil ? armor4.pdef : 0
return pdef1 + pdef2 + pdef3 + pdef4 + pdef5
end
#--------------------------------------------------------------------------
# ● 基本魔法防御の取得
#--------------------------------------------------------------------------
def base_mdef
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
mdef1 = weapon != nil ? weapon.mdef : 0
mdef2 = armor1 != nil ? armor1.mdef : 0
mdef3 = armor2 != nil ? armor2.mdef : 0
mdef4 = armor3 != nil ? armor3.mdef : 0
mdef5 = armor4 != nil ? armor4.mdef : 0
return mdef1 + mdef2 + mdef3 + mdef4 + mdef5
end
#--------------------------------------------------------------------------
# ● 基本回避修正の取得
#--------------------------------------------------------------------------
def base_eva
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
eva1 = armor1 != nil ? armor1.eva : 0
eva2 = armor2 != nil ? armor2.eva : 0
eva3 = armor3 != nil ? armor3.eva : 0
eva4 = armor4 != nil ? armor4.eva : 0
return eva1 + eva2 + eva3 + eva4
end
#--------------------------------------------------------------------------
# ● 通常攻撃 攻撃側アニメーション ID の取得
#--------------------------------------------------------------------------
def animation1_id
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.animation1_id : 0
end
#--------------------------------------------------------------------------
# ● 通常攻撃 対象側アニメーション ID の取得
#--------------------------------------------------------------------------
def animation2_id
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.animation2_id : 0
end
#--------------------------------------------------------------------------
# ● クラス名の取得
#--------------------------------------------------------------------------
def class_name
return $data_classes[@class_id].name
end
#--------------------------------------------------------------------------
# ● EXP の文字列取得
#--------------------------------------------------------------------------
def exp_s
return @exp_list[@level+1] > 0 ? @exp.to_s : "-------"
end
#--------------------------------------------------------------------------
# ● 次のレベルの EXP の文字列取得
#--------------------------------------------------------------------------
def next_exp_s
return @exp_list[@level+1] > 0 ? @exp_list[@level+1].to_s : "-------"
end
#--------------------------------------------------------------------------
# ● 次のレベルまでの EXP の文字列取得
#--------------------------------------------------------------------------
def next_rest_exp_s
return @exp_list[@level+1] > 0 ?
(@exp_list[@level+1] - @exp).to_s : "-------"
end
#--------------------------------------------------------------------------
# ● オートステートの更新
# old_armor : 外した防具
# new_armor : 装備した防具
#--------------------------------------------------------------------------
def update_auto_state(old_armor, new_armor)
# 外した防具のオートステートを強制解除
if old_armor != nil and old_armor.auto_state_id != 0
remove_state(old_armor.auto_state_id, true)
end
# 装備した防具のオートステートを強制付加
if new_armor != nil and new_armor.auto_state_id != 0
add_state(new_armor.auto_state_id, true)
end
end
#--------------------------------------------------------------------------
# ● 装備固定判定
# equip_type : 装備タイプ
#--------------------------------------------------------------------------
def equip_fix?(equip_type)
case equip_type
when 0 # 武器
return $data_actors[@actor_id].weapon_fix
when 1 # 盾
return $data_actors[@actor_id].armor1_fix
when 2 # 頭
return $data_actors[@actor_id].armor2_fix
when 3 # 身体
return $data_actors[@actor_id].armor3_fix
when 4 # 装飾品
return $data_actors[@actor_id].armor4_fix
end
return false
end
#--------------------------------------------------------------------------
# ● 装備の変更
# equip_type : 装備タイプ
# id : 武器 or 防具 ID (0 なら装備解除)
#--------------------------------------------------------------------------
def equip(equip_type, id)
case equip_type
when 0 # 武器
if id == 0 or $game_party.weapon_number(id) > 0
$game_party.gain_weapon(@weapon_id, 1)
@weapon_id = id
$game_party.lose_weapon(id, 1)
end
when 1 # 盾
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor1_id], $data_armors[id])
$game_party.gain_armor(@armor1_id, 1)
@armor1_id = id
$game_party.lose_armor(id, 1)
end
when 2 # 頭
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor2_id], $data_armors[id])
$game_party.gain_armor(@armor2_id, 1)
@armor2_id = id
$game_party.lose_armor(id, 1)
end
when 3 # 身体
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor3_id], $data_armors[id])
$game_party.gain_armor(@armor3_id, 1)
@armor3_id = id
$game_party.lose_armor(id, 1)
end
when 4 # 装飾品
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor4_id], $data_armors[id])
$game_party.gain_armor(@armor4_id, 1)
@armor4_id = id
$game_party.lose_armor(id, 1)
end
end
end
#--------------------------------------------------------------------------
# ● 装備可能判定
# item : アイテム
#--------------------------------------------------------------------------
def equippable?(item)
# 武器の場合
if item.is_a?(RPG::Weapon)
# 現在のクラスの装備可能な武器に含まれている場合
if $data_classes[@class_id].weapon_set.include?(item.id)
return true
end
end
# 防具の場合
if item.is_a?(RPG::Armor)
# 現在のクラスの装備可能な防具に含まれている場合
if $data_classes[@class_id].armor_set.include?(item.id)
return true
end
end
return false
end
#--------------------------------------------------------------------------
# ● EXP の変更
# exp : 新しい EXP
#--------------------------------------------------------------------------
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
# レベルアップ
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
# スキル習得
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
# レベルダウン
while @exp < @exp_list[@level]
@level -= 1
end
# 現在の HP と SP が最大値を超えていたら修正
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
#--------------------------------------------------------------------------
# ● レベルの変更
# level : 新しいレベル
#--------------------------------------------------------------------------
def level=(level)
# 上下限チェック
level = [[level, $data_actors[@actor_id].final_level].min, 1].max
# EXP を変更
self.exp = @exp_list[level]
end
#--------------------------------------------------------------------------
# ● スキルを覚える
# skill_id : スキル ID
#--------------------------------------------------------------------------
def learn_skill(skill_id)
if skill_id > 0 and not skill_learn?(skill_id)
@skills.push(skill_id)
@skills.sort!
end
end
#--------------------------------------------------------------------------
# ● スキルを忘れる
# skill_id : スキル ID
#--------------------------------------------------------------------------
def forget_skill(skill_id)
@skills.delete(skill_id)
end
#--------------------------------------------------------------------------
# ● スキルの習得済み判定
# skill_id : スキル ID
#--------------------------------------------------------------------------
def skill_learn?(skill_id)
return @skills.include?(skill_id)
end
#--------------------------------------------------------------------------
# ● スキルの使用可能判定
# skill_id : スキル ID
#--------------------------------------------------------------------------
def skill_can_use?(skill_id)
if not skill_learn?(skill_id)
return false
end
return super
end
#--------------------------------------------------------------------------
# ● 名前の変更
# name : 新しい名前
#--------------------------------------------------------------------------
def name=(name)
@name = name
end
#--------------------------------------------------------------------------
# ● クラス ID の変更
# class_id : 新しいクラス ID
#--------------------------------------------------------------------------
def class_id=(class_id)
if $data_classes[class_id] != nil
@class_id = class_id
# 装備できなくなったアイテムを外す
unless equippable?($data_weapons[@weapon_id])
equip(0, 0)
end
unless equippable?($data_armors[@armor1_id])
equip(1, 0)
end
unless equippable?($data_armors[@armor2_id])
equip(2, 0)
end
unless equippable?($data_armors[@armor3_id])
equip(3, 0)
end
unless equippable?($data_armors[@armor4_id])
equip(4, 0)
end
end
end
#--------------------------------------------------------------------------
# ● グラフィックの変更
# character_name : 新しいキャラクター ファイル名
# character_hue : 新しいキャラクター 色相
# battler_name : 新しいバトラー ファイル名
# battler_hue : 新しいバトラー 色相
#--------------------------------------------------------------------------
def set_graphic(character_name, character_hue, battler_name, battler_hue)
@character_name = character_name
@character_hue = character_hue
@battler_name = battler_name
@battler_hue = battler_hue
end
#--------------------------------------------------------------------------
# ● バトル画面 X 座標の取得
#--------------------------------------------------------------------------
def screen_x
# パーティ内の並び順から X 座標を計算して返す
if self.index != nil
return self.index * 160 + 80
else
return 0
end
end
#--------------------------------------------------------------------------
# ● バトル画面 Y 座標の取得
#--------------------------------------------------------------------------
def screen_y
return 464
end
#--------------------------------------------------------------------------
# ● バトル画面 Z 座標の取得
#--------------------------------------------------------------------------
def screen_z
# パーティ内の並び順から Z 座標を計算して返す
if self.index != nil
return 4 - self.index
else
return 0
end
end
end
Game_Party
#===============================================================
===============
# ■ Game_Party
#------------------------------------------------------------------------------
# パーティを扱うクラスです。ゴールドやアイテムなどの惼br />?報が含まれます。このク
# ラスのインスタンスは $game_party で参照されます。
#===============================================================
===============
class Game_Party
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :actors # アクター
attr_reader :gold # ゴールド
attr_reader :steps # 歩数
attr_accessor :member # パーティーメンバー
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
# アクターの配列を作成
@actors = []
# ゴールドと歩数を初期化
@gold = 0
@steps = 0
# アイテム、武器、防具の所持数ハッシュを作成
@items = {}
@weapons = {}
@armors = {}
# PTメンバー用配列を作成
@member = []
end
#--------------------------------------------------------------------------
# ● 初期パーティのセットアップ
#--------------------------------------------------------------------------
def setup_starting_members
@actors = []
for i in $data_system.party_members
@actors.push($game_actors)
@member.push($game_actors.id)
end
@member.sort!
end
#--------------------------------------------------------------------------
# ● 戦闘テスト用パーティのセットアップ
#--------------------------------------------------------------------------
def setup_battle_test_members
@actors = []
for battler in $data_system.test_battlers
actor = $game_actors[battler.actor_id]
actor.level = battler.level
gain_weapon(battler.weapon_id, 1)
gain_armor(battler.armor1_id, 1)
gain_armor(battler.armor2_id, 1)
gain_armor(battler.armor3_id, 1)
gain_armor(battler.armor4_id, 1)
actor.equip(0, battler.weapon_id)
actor.equip(1, battler.armor1_id)
actor.equip(2, battler.armor2_id)
actor.equip(3, battler.armor3_id)
actor.equip(4, battler.armor4_id)
actor.recover_all
@actors.push(actor)
end
@items = {}
for i in 1...$data_items.size
if $data_items.name != ""
occasion = $data_items.occasion
if occasion == 0 or occasion == 1
@items = 99
end
end
end
end
#--------------------------------------------------------------------------
# ● パーティメンバーのリフレッシュ
#--------------------------------------------------------------------------
def refresh
# ゲームデータをロードした直後はアクターオブジェクトが
# $game_actors から分離してしまっている。
# ロードのたびにアクターを再設定することで問題を回避すゼbr />?。
new_actors = []
for i in 0...@actors.size
if $data_actors[@actors.id] != nil
new_actors.push($game_actors[@actors.id])
end
end
@actors = new_actors
end
#--------------------------------------------------------------------------
# ● 最大レベルの取得
#--------------------------------------------------------------------------
def max_level
# パーティ人数が 0 人の場合
if @actors.size == 0
return 0
end
# ローカル変数 level を初期化
level = 0
# パーティメンバーの最大レベルを求める
for actor in @actors
if level < actor.level
level = actor.level
end
end
return level
end
#--------------------------------------------------------------------------
# ● アクターを加える
# actor_id : アクター ID
#--------------------------------------------------------------------------
def add_actor(actor_id)
# アクターを取得
actor = $game_actors[actor_id]
# パーティ人数が 4 人未満で、このアクターがパーティにいない場合
if @actors.size < 4 and not @actors.include?(actor)
# アクターを追加
@actors.push(actor)
# プレイヤーをリフレッシュ
$game_player.refresh
end
# パーティーメンバー配列にアクターID追加
unless @member.include?(actor.id)
@member.push(actor.id)
@member.sort!
end
end
#--------------------------------------------------------------------------
# ● アクターを外す
# actor_id : アクター ID
#--------------------------------------------------------------------------
def remove_actor(actor_id)
# アクターを削除
@actors.delete($game_actors[actor_id])
# プレイヤーをリフレッシュ
$game_player.refresh
# パーティーメンバー配列からアクターID削除
@member.delete(actor_id)
end
#--------------------------------------------------------------------------
# ● アクターを外す : 待機メンバーに配置
# actor_id : アクター ID
#--------------------------------------------------------------------------
def wait_actor(actor_id)
# アクターを削除
@actors.delete($game_actors[actor_id])
# プレイヤーをリフレッシュ
$game_player.refresh
end
#--------------------------------------------------------------------------
# ● アクターを変更
# actor_id : アクター ID
# index : 交換を行う位置
#--------------------------------------------------------------------------
def change_actor(actor_id, index)
# アクターを変更
@actors[index] = $game_actors[actor_id]
# プレイヤーをリフレッシュ
$game_player.refresh
end
#--------------------------------------------------------------------------
# ● ゴールドの増加 (減少)
# n : 金額
#--------------------------------------------------------------------------
def gain_gold(n)
@gold = [[@gold + n, 0].max, 9999999].min
end
#--------------------------------------------------------------------------
# ● ゴールドの減少
# n : 金額
#--------------------------------------------------------------------------
def lose_gold(n)
# 数値を逆転して gain_gold を呼ぶ
gain_gold(-n)
end
#--------------------------------------------------------------------------
# ● 歩数増加
#--------------------------------------------------------------------------
def increase_steps
@steps = [@steps + 1, 9999999].min
end
#--------------------------------------------------------------------------
# ● アイテムの所持数取得
# item_id : アイテム ID
#--------------------------------------------------------------------------
def item_number(item_id)
# ハッシュに個数データがあればその数値を、なければ 0 を返す
return @items.include?(item_id) ? @items[item_id] : 0
end
#--------------------------------------------------------------------------
# ● 武器の所持数取得
# weapon_id : 武器 ID
#--------------------------------------------------------------------------
def weapon_number(weapon_id)
# ハッシュに個数データがあればその数値を、なければ 0 を返す
return @weapons.include?(weapon_id) ? @weapons[weapon_id] : 0
end
#--------------------------------------------------------------------------
# ● 防具の所持数取得
# armor_id : 防具 ID
#--------------------------------------------------------------------------
def armor_number(armor_id)
# ハッシュに個数データがあればその数値を、なければ 0 を返す
return @armors.include?(armor_id) ? @armors[armor_id] : 0
end
#--------------------------------------------------------------------------
# ● アイテムの増加 (減少)
# item_id : アイテム ID
# n : 個数
#--------------------------------------------------------------------------
def gain_item(item_id, n)
# ハッシュの個数データを更新
if item_id > 0
@items[item_id] = [[item_number(item_id) + n, 0].max, 99].min
end
end
#--------------------------------------------------------------------------
# ● 武器の増加 (減少)
# weapon_id : 武器 ID
# n : 個数
#--------------------------------------------------------------------------
def gain_weapon(weapon_id, n)
# ハッシュの個数データを更新
if weapon_id > 0
@weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, 99].min
end
end
#--------------------------------------------------------------------------
# ● 防具の増加 (減少)
# armor_id : 防具 ID
# n : 個数
#--------------------------------------------------------------------------
def gain_armor(armor_id, n)
# ハッシュの個数データを更新
if armor_id > 0
@armors[armor_id] = [[armor_number(armor_id) + n, 0].max, 99].min
end
end
#--------------------------------------------------------------------------
# ● アイテムの減少
# item_id : アイテム ID
# n : 個数
#--------------------------------------------------------------------------
def lose_item(item_id, n)
# 数値を逆転して gain_item を呼ぶ
gain_item(item_id, -n)
end
#--------------------------------------------------------------------------
# ● 武器の減少
# weapon_id : 武器 ID
# n : 個数
#--------------------------------------------------------------------------
def lose_weapon(weapon_id, n)
# 数値を逆転して gain_weapon を呼ぶ
gain_weapon(weapon_id, -n)
end
#--------------------------------------------------------------------------
# ● 防具の減少
# armor_id : 防具 ID
# n : 個数
#--------------------------------------------------------------------------
def lose_armor(armor_id, n)
# 数値を逆転して gain_armor を呼ぶ
gain_armor(armor_id, -n)
end
#--------------------------------------------------------------------------
# ● アイテムの使用可能判定
# item_id : アイテム ID
#--------------------------------------------------------------------------
def item_can_use?(item_id)
# アイテムの個数が 0 個の場合
if item_number(item_id) == 0
# 使用不能
return false
end
# 使用可能時を取得
occasion = $data_items[item_id].occasion
# バトルの場合
if $game_temp.in_battle
# 使用可能時が 0 (常時) または 1 (バトルのみ) なら使用可能
return (occasion == 0 or occasion == 1)
end
# 使用可能時が 0 (常時) または 2 (メニューのみ) なら使用可能
return (occasion == 0 or occasion == 2)
end
#--------------------------------------------------------------------------
# ● 全員のアクションクリア
#--------------------------------------------------------------------------
def clear_actions
# パーティ全員のアクションをクリア
for actor in @actors
actor.current_action.clear
end
end
#--------------------------------------------------------------------------
# ● コマンド入力可能判定
#--------------------------------------------------------------------------
def inputable?
# 一人でもコマンド入力可能なら true を返す
for actor in @actors
if actor.inputable?
return true
end
end
return false
end
#--------------------------------------------------------------------------
# ● 全滅判定
#--------------------------------------------------------------------------
def all_dead?
# パーティ人数が 0 人の場合
if $game_party.actors.size == 0
return false
end
# HP 0 以上のアクターがパーティにいる場合
for actor in @actors
if actor.hp > 0
return false
end
end
# 全滅
return true
end
#--------------------------------------------------------------------------
# ● スリップダメージチェック (マップ用)
#--------------------------------------------------------------------------
def check_map_slip_damage
for actor in @actors
if actor.hp > 0 and actor.slip_damage?
actor.hp -= [actor.maxhp / 100, 1].max
if actor.hp == 0
$game_system.se_play($data_system.actor_collapse_se)
end
$game_screen.start_flash(Color.new(255,0,0,128), 4)
$game_temp.gameover = $game_party.all_dead?
end
end
end
#--------------------------------------------------------------------------
# ● 対象アクターのランダムな決定
# hp0 : HP 0 のアクターに限る
#--------------------------------------------------------------------------
def random_target_actor(hp0 = false)
# ルーレットを初期化
roulette = []
# ループ
for actor in @actors
# 条件に該当する場合
if (not hp0 and actor.exist?) or (hp0 and actor.hp0?)
# アクターのクラスの [位置] を取得
position = $data_classes[actor.class_id].position
# 前衛のとき n = 4、中衛のとき n = 3、後衛のとき n = 2
n = 4 - position
# ルーレットにアクターを n 回追加
n.times do
roulette.push(actor)
end
end
end
# ルーレットのサイズが 0 の場合
if roulette.size == 0
return nil
end
# ルーレットを回し、アクターを決定
return roulette[rand(roulette.size)]
end
#--------------------------------------------------------------------------
# ● 対象アクターのランダムな決定 (HP 0)
#--------------------------------------------------------------------------
def random_target_actor_hp0
return random_target_actor(true)
end
#--------------------------------------------------------------------------
# ● 対象アクターのスムーズな決定
# actor_index : アクターインデックス
#--------------------------------------------------------------------------
def smooth_target_actor(actor_index)
# アクターを取得
actor = @actors[actor_index]
# アクターが存在する場合
if actor != nil and actor.exist?
return actor
end
# ループ
for actor in @actors
# アクターが存在する場合
if actor.exist?
return actor
end
end
end
end
Poi create un'altra classe subito dopo e metteteci questo code:
# ■ Window_PTmember
#------------------------------------------------------------------------------
# PTチェンジ画面 メンバーウィンドウ
#==============================================================================
class Window_PTmember < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0, 320, 192)
self.contents = Bitmap.new(width - 32, height - 32)
@column_max = 4
refresh
self.active = true
self.index = 0
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if $game_party.member.size > 4
@item_max = [$game_party.actors.size + 1, 4].min
else
@item_max = [$game_party.actors.size + 1, $game_party.member.size].min
end
rect = Rect.new( 0, 34, 240, 1)
self.contents.fill_rect(rect, Color.new(255, 255, 255, 255))
self.contents.draw_text( 0, 0, 160, 32, "Gruppo attuale")
for i in 0...$game_party.actors.size
x = 40 + i * (70)
actor = $game_party.actors
draw_actor_graphic(actor, x, 150)
if actor.fixed_member == 1
self.contents.font.size = 16
self.contents.draw_text( x + 12, 134, 50, 28, "Mandatory")
self.contents.font.size = 22
end
end
self.contents.draw_text( 15, 40, 240, 32, "Cambia i membri del gruppo...")
end
#--------------------------------------------------------------------------
# ● カーソルの矩形更新
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set( 5 + @index * 70, 40, 70, 120)
end
end
end
#==============================================================================
# ■ Window_PTstatus
#------------------------------------------------------------------------------
# PTチェンジ画面 ステータスウィンドウ
#==============================================================================
class Window_PTstatus < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 192, 320, 192)
self.contents = Bitmap.new(width - 32, height - 32)
refresh( $game_party.actors[0].id )
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh(actor_id)
if actor_id != @a_id
self.contents.clear
if actor_id == nil
@a_id = actor_id
return
end
actor = $game_actors[actor_id]
draw_actor_name(actor, 0, 0)
draw_actor_level(actor, 220, 0)
draw_actor_state(actor, 0, 96)
draw_actor_exp(actor, 0, 128)
draw_actor_hp(actor, 0, 32)
draw_actor_sp(actor, 0, 64)
@a_id = actor_id
end
end
end
#==============================================================================
# ■ Window_Waitmember
#------------------------------------------------------------------------------
# PTチェンジ画面 待機メンバーウィンドウ
#==============================================================================
class Window_Waitmember < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(320, 0, 320, 480)
self.contents = Bitmap.new(width - 32, height - 32)
@column_max = 4
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.member.size
rect = Rect.new( 0, 34, 240, 1)
self.contents.fill_rect(rect, Color.new(255, 255, 255, 255))
self.contents.draw_text( 0, 0, 200, 32, "Membri esterni al gruppo")
for i in 0...$game_party.member.size
x = 40 + ( i % 4 ) * 70
y = 150 + ( i / 4 ) * 140
actor = $game_actors[$game_party.member]
draw_member_graphic(actor, x, y)
end
end
#--------------------------------------------------------------------------
# ● メンバーグラフィックの描画
#--------------------------------------------------------------------------
def draw_member_graphic(actor, x, y)
bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
cw = bitmap.width / 4
ch = bitmap.height / 4
src_rect = Rect.new(0, 0, cw, ch)
# PTにいる場合は半透明で表示
if $game_party.actors.include?(actor)
opacity = 120
else
opacity = 255
end
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
end
#--------------------------------------------------------------------------
# ● カーソルの矩形更新
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set( 5 + ( @index % 4 ) * 70, 40 + ( @index / 4 ) * 140, 70, 120)
end
end
end
#==============================================================================
# ■ Window_PThelp
#------------------------------------------------------------------------------
# PTチェンジ画面 操作ヘルプウィンドウ
#==============================================================================
class Window_PThelp < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super( 0, 384, 320, 96)
self.contents = Bitmap.new(width - 32, height - 32)
@type = 0
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(4, 0, 240, 32, "Scegli il membro che vuoi sostituire.")
if @type == 0
self.contents.draw_text(4, 32, 240, 32, "Premi X o Esc per uscire.")
else
self.contents.draw_text(4, 32, 240, 32, "Scegli il membro da inserire.")
end
end
#--------------------------------------------------------------------------
# ● タイプ変更
#--------------------------------------------------------------------------
def type_change
if @type == 0
@type = 1
else
@type = 0
end
refresh
end
end
#==============================================================================
# ■ Scene_PTchange
#------------------------------------------------------------------------------
# Lo script appartiene ad un sito JAP, la traduzione in inglese è stata fatta da Viskar Nogam'e
# La traduzione in italiano è stata fatta da Tio. Per qualsiasi problema o domanda visitate
# www.rpgshrine.altervista.org
#==============================================================================
class Scene_PTchange
#--------------------------------------------------------------------------
# ● メイン処理
#--------------------------------------------------------------------------
def main
# Informs which Windows to open
@pt_member = Window_PTmember.new
@pt_status = Window_PTstatus.new
@wait_member = Window_Waitmember.new
@pt_help = Window_PThelp.new
# トランジション実行
Graphics.transition
# メインループ
loop do
# ゲーム画面を更新
Graphics.update
# 入力情報を更新
Input.update
# フレーム更新
update
# 画面が切り替わったらループを中断
if $scene != self
break
end
end
# トランジション準備
Graphics.freeze
# ウィンドウを解放
@pt_member.dispose
@pt_status.dispose
@wait_member.dispose
@pt_help.dispose
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
# ステータスウィンドウが表示されてる間は、Bボタン押されるまで停止
if @status != nil
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
# ステータスウィンドウを削除
@status.dispose
@status = nil
end
return
end
# ウィンドウを更新
@pt_member.update
@wait_member.update
# メンバーウィンドウがアクティブの場合: update_pt を呼ぶ
if @pt_member.active
# カーソル位置が空白 ( メンバーの最大値と同じ ) の時ステータスを空白に
if @pt_member.index == $game_party.actors.size
@pt_status.refresh( nil )
else
@pt_status.refresh( $game_party.actors[@pt_member.index].id )
end
update_pt
return
end
# 待機メンバーウィンドウがアクティブの場合: update_member を呼ぶ
if @wait_member.active
@pt_status.refresh( $game_actors[$game_party.member[@wait_member.index]].id )
update_member
return
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メンバーウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_pt
# B ボタンが押された場合
if Input.trigger?(Input::B)
if $game_party.actors.size == 0
# ブザー SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
# メニュー画面に切り替え
$scene = Scene_Menu.new(4)
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# 選択アクターが固定の場合ブザーを鳴らす
if @pt_member.index != $game_party.actors.size
if $game_party.actors[@pt_member.index].fixed_member == 1
$game_system.se_play($data_system.buzzer_se)
return
end
end
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# 待機メンバーウィンドウをアクティブにする
@pt_member.active = false
@wait_member.active = true
@wait_member.index = 0
@pt_help.type_change
return
end
# X ボタンが押された場合
if Input.trigger?(Input::X)
# カーソル位置が空白 ( メンバーの最大値と同じ ) の時ブザーを鳴らす
if @pt_member.index == $game_party.actors.size
# ブザー SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# ステータスウィンドウを表示する
@status = Window_Status.new( $game_party.actors[@pt_member.index] )
@status.z += 50
return
end
# Y ボタンが押された場合
if Input.trigger?(Input::Y)
# 選択アクターが固定の場合ブザーを鳴らす
if @pt_member.index != $game_party.actors.size
if $game_party.actors[@pt_member.index].fixed_member == 1
$game_system.se_play($data_system.buzzer_se)
return
end
end
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
$game_party.wait_actor( $game_party.actors[@pt_member.index].id )
# メンバーウィンドウと待機ウィンドウを再描写
@pt_member.refresh
@wait_member.refresh
return
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (待機メンバーウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_member
# B ボタンが押された場合
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
# メンバーウィンドウをアクティブにする
@pt_member.active = true
@wait_member.active = false
@wait_member.index = -1
@pt_help.type_change
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# 待機メンバーウィンドウで選択されている アクターID を習得
actor_id = $game_actors[$game_party.member[@wait_member.index]].id
# メンバー選択位置が空白の場合は、普通に加える
if @pt_member.index == $game_party.actors.size
$game_party.add_actor( actor_id )
# メンバーウィンドウと待機ウィンドウを再描写
@pt_member.refresh
@wait_member.refresh
# メンバーウィンドウをアクティブにする
@pt_member.active = true
@wait_member.active = false
@wait_member.index = -1
@pt_help.type_change
return
end
# 既に選択されたメンバーがいる場合 そのキャラと交換
if $game_party.actors.include?( $game_actors[actor_id] )
a = $game_party.actors.index( $game_actors[actor_id] )
b = $game_party.actors[@pt_member.index].id
$game_party.change_actor( b, a)
end
# メンバー変更
$game_party.change_actor( actor_id, @pt_member.index )
# メンバーウィンドウと待機ウィンドウを再描写
@pt_member.refresh
@wait_member.refresh
# メンバーウィンドウをアクティブにする
@pt_member.active = true
@wait_member.active = false
@wait_member.index = -1
@pt_help.type_change
return
end
# X ボタンが押された場合
if Input.trigger?(Input::X)
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# ステータスウィンドウを表示する
@status = Window_Status.new( $game_actors[$game_party.member[@wait_member.index]] )
@status.z += 50
return
end
# Y ボタンが押された場合
if Input.trigger?(Input::Y)
# アクターをセット
actor = $game_actors[$game_party.member[@wait_member.index]]
# 装備固定の場合
if actor.equip_fix?(4)
# ブザー SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# 装備 SE を演奏
$game_system.se_play($data_system.equip_se)
# 装飾品を外す
actor.equip( 4, 0)
return
end
end
end
#Final Fantasy VII menu setup by AcedentProne
#*********************************************************
#To use:
#Create a new folder in the Characters folder, and call it Faces
#Adding faces: add a 80x80 picture with the same name as the characterset it
#corrosponds with in the Faces folder
#If text does not appear, right click and select Replace
#Put $defaultfonttype in the Search String box
#Put $fontface in the Replacement String box
#Hit replace all.
#Put $defaultfontsize in the Search String box
#Put $fontsize in the Replacement String box
#Hit replace all.
#
#If you do not want Faces, go to line 102
#and change delete the # of draw_actor_graphic
#and put a # infront of draw_actor_face
# NB TIO:Questo script non l'ho fatto io, ho solamente preso il menu stile FF7, la schermata
# per cambiare personaggio e ho messo l'opzione nel menu, niente di più.
# Se ci sono problemi visitate www.rpgshrine.altervista.org
#========================================
#■ Window_Base
#--------------------------------------------------------------------------
# Setting functions for the "Base"
#========================================
class Window_Base < Window
def draw_actor_face(actor, x, y)
face = RPG::Cache.character("Faces/" + actor.character_name, actor.character_hue)
fw = face.width
fh = face.height
src_rect = Rect.new(0, 0, fw, fh)
self.contents.blt(x - fw / 23, y - fh, face, src_rect)
end
end
def draw_actor_battler_graphic(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
#========================================
#■ Game_Map
#--------------------------------------------------------------------------
# Setting functions for the Map
#========================================
class Game_Map
def name
$map_infos[@map_id]
end
end
#========================================
#■ Window_Title
#--------------------------------------------------------------------------
# Setting functions for the Title
#========================================
class Scene_Title
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end
#========================================================
# ■ Window_MenuStatus
#------------------------------------------------------------------------
# Sets up the Choosing.
#========================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# Set up
#--------------------------------------------------------------------------
def initialize
super(0, 0, 560, 454)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 24
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# Drawing Info on Screen
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 94
y = i * 110
actor = $game_party.actors
draw_actor_face(actor, 12, y + 90) #To get rid of the Face, put a "#" before the draw_ of this line
#draw_actor_graphic(actor, 48, y + 65) #and delete the "#" infront of draw of this line
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 80, y)
draw_actor_level(actor, x, y + 18)
draw_actor_state(actor, x + 200, y)
draw_actor_exp(actor, x+ 144, y + 38)
draw_actor_hp(actor, x, y + 38)
draw_actor_sp(actor, x, y + 58)
end
end
#--------------------------------------------------------------------------
# Update of Cursor
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end
#=======================================#
# ■Window_GameStats #
# written by AcedentProne #
#-----------------------------------------------------------------------#
class Window_GameStats < Window_Base
def initialize
super(0, 0, 160, 80)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 22
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
# Draw "Time"
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 6, 120, 32, text, 2)
self.contents.font.color = system_color
self.contents.draw_text(4, -10, 120, 32, "Tempo di gioco")
#Drawing Gold
self.contents.font.color = normal_color
self.contents.draw_text(4, 22, 120, 32,$game_party.gold.to_s + " " +$data_system.words.gold, 2)
self.contents.font.color = system_color
self.contents.draw_text(4, 22, 120, 32, $data_system.words.gold, 2)
end
#--------------------------------------------------------------------------
# Update of The count
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#========================================================
# ■ Window_Mapname
#------------------------------------------------------------------------
# Draws the Map name
#========================================================
class Window_Mapname < Window_Base
#--------------------------------------------------------------------------
# Set up
#--------------------------------------------------------------------------
def initialize
super(0, 0, 320, 60)
self.contents = Bitmap.new(width - 52, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 24
refresh
end
#--------------------------------------------------------------------------
# Draws info on screen
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# Map Name
#map = $game_map.name
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 220, 32, "Luogo")
self.contents.font.color = normal_color
self.contents.draw_text(175, 0, 80, 32, $game_map.name)
end
end
#========================================================
# ■ Scene_Menu
#------------------------------------------------------------------------
# FF7 menu laytout as requested by AcedentProne.
#========================================================
class Scene_Menu
#--------------------------- edit-------------------------------
attr_reader :status_window
#/--------------------------- edit-------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "PHS" #Da qui potete cambiare il nome dell'opzione per cambiare gruppo
s6 = "Salva"
s7 = "Esci"
#--------------------------- edit-------------------------------
# Command menu
# Size = Screen height - border sizes -
# GameStatus menu - Spacing from GameStatus
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
@command_window.x = 640 - @command_window.width
@command_window.y = 0
@command_window.z = 110
@command_window.index = @menu_index
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled
@command_window.disable_item(4)
@command_window.disable_item(5)
end
@map = Window_Mapname.new
@map.x = 640 - @map.width
@map.y = 480 - @map.height - 1
@map.z = 110
# Lower right box
@game_stats_window = Window_GameStats.new
@game_stats_window.x = 640 - @game_stats_window.width
@game_stats_window.y = 640 - @command_window.height - @game_stats_window.height + 3
@game_stats_window.z =110
# Status window
@status_window = Window_MenuStatus.new
@status_window.x = 0
@status_window.y = 8
@status_window.z = 100
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@game_stats_window.dispose
@status_window.dispose
@map.dispose
end
#--------------------------------------------------------------------
# Updating
#--------------------------------------------------------------------
def update
@command_window.update
@game_stats_window.update
@status_window.update
@map.update
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------
# Updating the Command Selection
#--------------------------------------------------------------------
def update_command
# If B button is pused
if Input.trigger?(Input::B)
# Plays assigned SE
$game_system.se_play($data_system.cancel_se)
# Go to Map
$scene = Scene_Map.new
return
end
# If C button is pused
if Input.trigger?(Input::C)
# Checks actor size
if $game_party.actors.size == 0 and @command_window.index < 4
# plays SE
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_PTchange.new
when 5
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when 6
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------
# Updating Status Screen
#--------------------------------------------------------------------
def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
Cancellate le stringhe dove verranno visualizzate queste:
==========
-
Ciao a tutti vorrei un aiuto visto che sono impedito con ruby :D allora il mio problema è questo:
ho come menù FFVII + PHS, ora grazie a sleeping Leonhart sono riuscito a metterci la voce Summon dove posso adestrare le mie summon, ora però nel mio menù voglio aggiungere anke le limitr break, sono che come le aggingo mi va via il menùà e c'è ne uno nuovo se lo metto sopra FFVII vedo solo il menù FFVII con l'aggiunta summon, io invece voglio il menù ffVII + limit break ora vi do i vari script e spero possiate aiutarmi
Patch menù Script per vedere la scritta summun sul mio menù FFVII
class Scene_Menu
def main
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Summon"
s6 = "Party" #Da qui potete cambiare il nome dell'opzione per cambiare gruppo
s7 = "Salva"
s8 = "Esci"
#--------------------------- edit-------------------------------
# Command menu
# Size = Screen height - border sizes -
# GameStatus menu - Spacing from GameStatus
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7,s8])
@command_window.x = 640 - @command_window.width
@command_window.y = 0
@command_window.z = 110
@command_window.index = @menu_index
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
@command_window.disable_item(4)
end
if $game_system.save_disabled
@command_window.disable_item(5)
@command_window.disable_item(6)
end
unless $game_switches[1]
@command_window.disable_item(4)
end
@map = Window_Mapname.new
@map.x = 640 - @map.width
@map.y = 480 - @map.height - 1
@map.z = 110
# Lower right box
@game_stats_window = Window_GameStats.new
@game_stats_window.x = 640 - @game_stats_window.width
@game_stats_window.y = 640 - @command_window.height - @game_stats_window.height + 3
@game_stats_window.z =110
# Status window
@status_window = Window_MenuStatus.new
@status_window.x = 0
@status_window.y = 8
@status_window.z = 100
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@game_stats_window.dispose
@status_window.dispose
@map.dispose
end
def update_command
# If B button is pused
if Input.trigger?(Input::B)
# Plays assigned SE
$game_system.se_play($data_system.cancel_se)
# Go to Map
$scene = Scene_Map.new
return
end
# If C button is pused
if Input.trigger?(Input::C)
# Checks actor size
if $game_party.actors.size == 0 and @command_window.index < 4
# plays SE
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4
$game_system.se_play($data_system.decision_se)
$scene = Scene_SummonStatus.new
when 5
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_PTchange.new
when 6
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when 7
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end
end
end
class Scene_PTchange
alias tsl_summonstatus_ptchange_update_pt update_pt
def update_pt
if Input.trigger?(Input::B)
if $game_party.actors.size == 0
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(5)
return
end
tsl_summonstatus_ptchange_update_pt
end
end
class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# * Decision Processing
#--------------------------------------------------------------------------
def on_decision(filename)
# Play save SE
$game_system.se_play($data_system.save_se)
# Write save data
file = File.open(filename, "wb")
write_save_data(file)
file.close
# If called from event
if $game_temp.save_calling
# Clear save call flag
$game_temp.save_calling = false
# Switch to map screen
$scene = Scene_Map.new
return
end
# Switch to menu screen
$scene = Scene_Menu.new(6)
end
#--------------------------------------------------------------------------
# * Cancel Processing
#--------------------------------------------------------------------------
def on_cancel
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# If called from event
if $game_temp.save_calling
# Clear save call flag
$game_temp.save_calling = false
# Switch to map screen
$scene = Scene_Map.new
return
end
# Switch to menu screen
$scene = Scene_Menu.new(6)
end
end
class Scene_End
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias tsl_summonstatus_end_update update
def update
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(7)
return
end
tsl_summonstatus_end_update
end
end
Script Advanced Limit Break di SephirothSpawn
#======================================================================
========
# Advanced Limit Break Script
#==============================================================================
# SephirothSpawn
# Version 1
# 29.11.05
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log("Advanced Limit Break", "SephirothSpawn", 1, "12.17.05")
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state("Advanced Limit Break") == true
#==============================================================================
# ** Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :limit
attr_accessor :limit_type
#------------------------------------------------------------------------------
# * Alias Listings
#------------------------------------------------------------------------------
alias seph_limitbreak_gameactor_setup setup
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def setup(actor_id)
seph_limitbreak_gameactor_setup(actor_id)
@limit = 0
@limit_type = 0
end
#--------------------------------------------------------------------------
# * Set Limit
#--------------------------------------------------------------------------
def limit=(limit)
@limit = limit
@limit = 1000 if @limit > 1000
end
end
#==============================================================================
# ** Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# Alias Listings
#--------------------------------------------------------------------------
alias seph_limitbreak_windowbase_drawactorname draw_actor_name
#--------------------------------------------------------------------------
# Draw Actor Name
#--------------------------------------------------------------------------
def draw_actor_name(actor, x, y)
ox = $game_temp.in_battle ? 4 : 16
draw_slant_bar(x + ox, y + 32, actor.limit, 1000.0, 120)
seph_limitbreak_windowbase_drawactorname(actor, x, y)
end
#--------------------------------------------------------------------------
# Draw Slant Bar
#--------------------------------------------------------------------------
def draw_slant_bar(x, y, min, max, width = 152, height = 6, bar_color = Color.new(150, 0, 0, 255))
# Draw Border
for i in 0..height
self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
end
# Draw Background
for i in 1..(height - 1)
r = 100 * (height - i) / height + 0 * i / height
g = 100 * (height - i) / height + 0 * i / height
b = 100 * (height - i) / height + 0 * i / height
a = 255 * (height - i) / height + 255 * i / height
self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
end
# Color Values
if min == max
bar_color = Color.new(200, 0, 0, 255)
end
# Draws Bar
for i in 1..( (min / max) * width - 1)
for j in 1..(height - 1)
r = bar_color.red * (width - i) / width + 255 * i / width
g = bar_color.green * (width - i) / width + 255 * i / width
b = bar_color.blue * (width - i) / width + 60 * i / width
a = bar_color.alpha * (width - i) / width + 255 * i / width
self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
end
end
end
end
#==============================================================================
# Window Horizontal Command
#==============================================================================
class Window_HorizCommand < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(commands, width = 640, height = 64)
super(0, 0, width, height)
self.contents = Bitmap.new(width - 32, height - 32)
@commands = commands
@item_max = @commands.size
@column_max = @commands.size
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
x = width / @item_max * index
off = width / @item_max - 32
self.contents.draw_text(x, 0, off, 32, @commands[index], 1)
end
#--------------------------------------------------------------------------
# * Disable Item
# index : item number
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end
end
#==============================================================================
# ** Window_Skill
#==============================================================================
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh(seperation = true, overdrive_skills = false)
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
unless @actor == nil
for i in 0...@actor.skills.size
skill = $data_skills[@actor.skills]
unless skill == nil
if seperation
if overdrive_skills
@data.push(skill) if skill.element_set.include?(20)
else
@data.push(skill) unless skill.element_set.include?(20)
end
else
@data.push(skill)
end
end
end
end
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# * Check Data
#--------------------------------------------------------------------------
def data
return @data
end
end
#==============================================================================
# ** Window_Limit_Types
#==============================================================================
class Window_Limit_Types < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 128, 640, 288)
@column_max = 2
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Get Type
#--------------------------------------------------------------------------
def get_type
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Help Text
#--------------------------------------------------------------------------
def help_text
case index
when 0 ; text = 'Warrior - Gains When Hero Damages Enemy'
when 1 ; text = 'Stotic - Gains When Hero Recieves Damage'
when 2 ; text = 'Healer - Gains When Hero uses Restoriative Magic'
when 3 ; text = 'Comrade - Gains When Allies Hit'
when 4 ; text = 'Slayer - Gains When Hero Kills Enemy'
when 5 ; text = 'Victor - Gains When Party Wins Battle'
when 6 ; text = 'Tactician - Gains When Hero Inflicts Status Effect on Enemy'
when 7 ; text = 'Hero - Gains When Hero Destroys Enemy with more than 10,000 HP'
when 8 ; text = "Ally - Gains When Hero's Turn Comes"
when 9 ; text = "Daredevil - Gains When Hero's Turn Comes and in Critical Condition"
when 10 ; text = 'Solo - Gains When Hero Is Only Member in Party'
when 11 ; text = 'Coward - Gains When Hero Escapes Battle'
when 12 ; text = 'Dancer - Gains When Hero Evades Enemy Attack'
when 13 ; text = 'Rook - Gains When Hero Guards Enemy Elemental or Status Attack'
when 14 ; text = 'Sufferer - Gains When Hero is Inflicted with Status Effect'
when 15 ; text = "Victim - Gains When Hero's Turn comes, and is inflicted by Status"
when 16 ; text = 'Avenger - Gains When Ally is Killed By Enemy'
when 17 ; text = 'Defender - Gains When Hero Chooses to Guard'
end
return text
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = ['Warrior', 'Stotic', 'Healer', 'Comrade', 'Slayer', 'Victor',
'Tactician', 'Hero', 'Ally', 'Daredevil', 'Solo', 'Coward', 'Dancer',
'Rook', 'Sufferer', 'Victim', 'Avenger', 'Defender']
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
self.contents.draw_text(x, y, contents.width / 2 - 32, 32, @data[index], 1)
end
end
#==============================================================================
# ** Scene_Menu
#==============================================================================
class Scene_Menu
#------------------------------------------------------------------------------
# * Alias Listings
#------------------------------------------------------------------------------
alias seph_limitbreak_scenemenu_init initialize
alias seph_limitbreak_scenemenu_update_command_check update_command_check
alias seph_limitbreak_scenemenu_update_status_check update_status_check
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
seph_limitbreak_scenemenu_init(menu_index)
# Inserts 'Limit Break' Below Skill
@commands.insert(@commands.index($data_system.words.skill) + 1, 'Limit Break')
end
#--------------------------------------------------------------------------
# * Update Command Check
#--------------------------------------------------------------------------
def update_command_check
seph_limitbreak_scenemenu_update_command_check
# Loads Command
command = @commands[@command_window.index]
# Check If Command is Limit Break
if command == 'Limit Break'
command_start_limit
end
end
#--------------------------------------------------------------------------
# * Update Status Check
#--------------------------------------------------------------------------
def update_status_check
seph_limitbreak_scenemenu_update_status_check
# Loads Command
command = @commands[@command_window.index]
# Check If Command is Limit Break
if command == 'Limit Break'
command_limit
end
end
#--------------------------------------------------------------------------
# * Command Start Limit
#--------------------------------------------------------------------------
def command_start_limit
activate_status
end
#--------------------------------------------------------------------------
# * Command Limit
#--------------------------------------------------------------------------
def command_limit
# If this actor's action limit is 2 or more
if $game_party.actors[@status_window.index].restriction >= 2
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to skill screen
$scene = Scene_LimitBreak.new(@status_window.index)
end
end
#==============================================================================
# ** Scene_LimitBreak
#==============================================================================
class Scene_LimitBreak
#--------------------------------------------------------------------------
# * Object Initialization
# actor_index : actor index
#--------------------------------------------------------------------------
def initialize(actor_index = 0)
@actor_index = actor_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Get actor
@actor = $game_party.actors[@actor_index]
# Make Help Window
@help_window = Window_Help.new
# Command Window
@command_window = Window_HorizCommand.new(['View Skills', 'Set Overdrive Type'])
@command_window.y = 64
# Skill Window
@skill_window = Window_Skill.new(@actor)
@skill_window.height = 288
@skill_window.refresh(true, true)
@skill_window.active = false
# Skill Status Window
@status_window = Window_SkillStatus.new(@actor)
@status_window.y = 416
# Limit Break Types Window
@limit_break_type_window = Window_Limit_Types.new
@limit_break_type_window.index = @actor.limit_type
@limit_break_type_window.visible = @limit_break_type_window.active = false
# Associate help window
if @skill_window.help_window == nil
@help_window.set_text('No Limit Breaks Available', 1)
else
@skill_window.help_window = @help_window
end
# Scene Objects
@objects = [@help_window, @command_window, @skill_window, @limit_break_type_window, @status_window]
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Objects Update
@objects.each {|x| x.update}
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of Objects
@objects.each {|x| x.dispose}
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# If Main Command Active : call update_main
if @command_window.active
update_main
return
end
# If skill window is active: call update_skill
if @skill_window.active
update_skill
return
end
# If Limit Type is active: call update_type
if @limit_break_type_window.active
update_type
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (if main window is active)
#--------------------------------------------------------------------------
def update_main
# Toggles Windows Visiblity
@skill_window.visible = @command_window.index == 0 ? true : false
@limit_break_type_window.visible = @command_window.index == 1 ? true : false
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(2)
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch Point
case @command_window.index
when 0 # View Skills
if @skill_window.data.size == 0
$game_system.se_play($data_system.buzzer_se)
@help_window.set_text('No Limit Breaks Available', 1)
else
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@skill_window.active = true
end
when 1 # Set Limit Break Type
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@limit_break_type_window.active = true
@help_window.set_text(@limit_break_type_window.help_text, 1)
end
end
# If R button was pressed
if Input.trigger?(Input::R)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To next actor
@actor_index += 1
@actor_index %= $game_party.actors.size
# Switch to different skill screen
$scene = Scene_LimitBreak.new(@actor_index)
return
end
# If L button was pressed
if Input.trigger?(Input::L)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To previous actor
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# Switch to different skill screen
$scene = Scene_LimitBreak.new(@actor_index)
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (if main window is active)
#--------------------------------------------------------------------------
def update_skill
# Refreshes Help Window Text
@skill_window.help_window = @help_window
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to main menu
@command_window.active = true
@skill_window.active = false
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (if main window is active)
#--------------------------------------------------------------------------
def update_type
# Refreshes Help Window Text
if Input.trigger?(Input::UP) || Input.trigger?(Input::DOWN) || Input.trigger?(Input::RIGHT) || Input.trigger?(Input::LEFT)
@help_window.set_text(@limit_break_type_window.help_text, 1)
end
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to main menu
@command_window.active = true
@limit_break_type_window.active = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Play cancel SE
$game_system.se_play($data_system.decision_se)
# Set Actor Limit Type
@actor.limit_type = @limit_break_type_window.index
@help_window.set_text("#{@actor.name}'s Limit Type is Now #{@limit_break_type_window.get_type}", 1)
return
end
end
end
#==============================================================================
# ** Scene_Battle
#==============================================================================
class Scene_Battle
#------------------------------------------------------------------------------
# * Alias Listings
#------------------------------------------------------------------------------
alias seph_limitbreak_scenebattle_battleend battle_end
alias seph_limitbreak_scenebattle_updatephase1 update_phase1
alias seph_limitbreak_scenebattle_makebasicactionguard make_basic_action_result_guard
#------------------------------------------------------------------------------
# * Battle End Result
#------------------------------------------------------------------------------
def battle_end(result)
for actor in $game_party.actors
# Victor
if result == 0
if actor.limit_type == 5
actor.limit += 200
end
# Coward
elsif result == 1
if actor.limit_type == 11
actor.limit += 100
end
end
end
seph_limitbreak_scenebattle_battleend(result)
end
#------------------------------------------------------------------------------
# * Update Phase 1
#------------------------------------------------------------------------------
def update_phase1
for actor in $game_party.actors
# Ally
if actor.limit_type == 8
actor.limit += 40
end
# Daredevil
if actor.limit_type == 9 && actor.hp.quo(actor.maxhp) < 0.5
actor.limit += 160
end
# Solo
if actor.limit_type == 16 && $game_party.actors.size == 1
actor.limit += 160
end
# Victim
if actor.limit_type == 15 && actor.states.empty?
actor.limit += 160
end
end
seph_limitbreak_scenebattle_updatephase1
end
#--------------------------------------------------------------------------
# * Make Basic Action Results - Guard
#--------------------------------------------------------------------------
def make_basic_action_result_guard
# Defender
if @active_battler.is_a?(Game_Actor)
if @active_battler.limit_type == 17
@active_battler.limit += 80
end
end
seph_limitbreak_scenebattle_makebasicactionguard
end
end
#==============================================================================
# ** Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Applying Normal Attack Effects
# attacker : battler
#--------------------------------------------------------------------------
def attack_effect(attacker)
# Clear critical flag
self.critical = false
# First hit detection
hit_result = (rand(100) < attacker.hit)
# If hit occurs
if hit_result == true
# Calculate basic damage
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.str) / 20
# Element correction
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
# If damage value is strictly positive
if self.damage > 0
# Critical correction
if rand(100) < 4 * attacker.dex / self.agi
self.damage *= 2
self.critical = true
end
# Guard correction
if self.guarding?
self.damage /= 2
end
end
# Dispersion
if self.damage.abs > 0
amp = [self.damage.abs * 15 / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# Second hit detection
eva = 8 * self.agi / attacker.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
end
# If hit occurs
if hit_result == true
# State Removed by Shock
remove_states_shock
# Loads Current States
current_states = self.states
# Substract damage from HP
self.hp -= self.damage
# Slayer, Hero & Avenger
if self.dead?
if self.is_a?(Game_Actor)
# Avenger
for actor in $game_party.actors
unless actor == self
if actor.limit_type == 16
actor.limit += 300 unless actor.dead?
end
end
end
else
# Hero
if attacker.limit_type == 7 && self.maxhp >= 10000
attacker.limit += 250
end
# Slayer
if attacker.limit_type == 4
attacker.limit += 200
end
end
end
# State change
@state_changed = false
states_plus(attacker.plus_state_set)
states_minus(attacker.minus_state_set)
# Sufferer
if self.is_a?(Game_Actor)
if states.size > current_states.size
if self.limit_type == 14
self.limit += 160
end
end
end
# Warrior & Tactician
unless self.is_a?(Game_Actor)
# Warrior
if attacker.limit_type == 0
attacker.limit += [self.damage * 10, 160].min
end
# Tactician
if attacker.limit_type == 6
attacker.limit += 160
end
end
# Stotic
if self.is_a?(Game_Actor)
if self.limit_type == 1
self.limit += self.damage * 100 / self.maxhp
end
end
# Comrade
if self.is_a?(Game_Actor)
for actor in $game_party.actors
unless actor == self
if actor.limit_type == 3
actor.limit += self.damage * 20 / self.maxhp
end
end
end
end
# When missing
else
# Dancer & Rook
if self.is_a?(Game_Actor)
# Dancer
if self.limit_type == 12
self.limit += 160
end
# Rook
if self.limit_type == 13 && !attacker.plus_state_set.empty?
self.limit += 100
end
end
# Set damage to "Miss"
self.damage = "Miss"
# Clear critical flag
self.critical = false
end
# End Method
return true
end
#--------------------------------------------------------------------------
# * Apply Skill Effects
# user : the one using skills (battler)
# skill : skill
#--------------------------------------------------------------------------
def skill_effect(user, skill)
# Clear critical flag
self.critical = false
# If skill scope is for ally with 1 or more HP, and your own HP = 0,
# or skill scope is for ally with 0, and your own HP = 1 or more
if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
# End Method
return false
end
# Clear effective flag
effective = false
# Set effective flag if common ID is effective
effective |= skill.common_event_id > 0
# First hit detection
hit = skill.hit
if skill.atk_f > 0
hit *= user.hit / 100
end
hit_result = (rand(100) < hit)
# Set effective flag if skill is uncertain
effective |= hit < 100
# If hit occurs
if hit_result == true
# Calculate power
power = skill.power + user.atk * skill.atk_f / 100
if power > 0
power -= self.pdef * skill.pdef_f / 200
power -= self.mdef * skill.mdef_f / 200
power = [power, 0].max
end
# Calculate rate
rate = 20
rate += (user.str * skill.str_f / 100)
rate += (user.dex * skill.dex_f / 100)
rate += (user.agi * skill.agi_f / 100)
rate += (user.int * skill.int_f / 100)
# Calculate basic damage
self.damage = power * rate / 20
# Element correction
self.damage *= elements_correct(skill.element_set)
self.damage /= 100
# If damage value is strictly positive
if self.damage > 0
# Guard correction
if self.guarding?
self.damage /= 2
end
end
# Dispersion
if skill.variance > 0 and self.damage.abs > 0
amp = [self.damage.abs * skill.variance / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# Second hit detection
eva = 8 * self.agi / user.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
# Set effective flag if skill is uncertain
effective |= hit < 100
end
# If hit occurs
if hit_result == true
# If physical attack has power other than 0
if skill.power != 0 and skill.atk_f > 0
# State Removed by Shock
remove_states_shock
# Set to effective flag
effective = true
end
# Loads Current States
current_states = self.states
# Substract damage from HP
last_hp = self.hp
self.hp -= self.damage
# Healer
if self.damage < 0
if user.is_a?(Game_Actor)
if self.is_a?(Game_Actor) && self != user
if user.limit_type == 2
user.limit += 80
end
end
end
end
effective |= self.hp != last_hp
# Slayer, Hero & Avenger
if self.dead?
if self.is_a?(Game_Actor)
# Avenger
for actor in $game_party.actors
unless actor == self
if actor.limit_type == 16
actor.limit += 300 unless actor.dead?
end
end
end
else
# Hero
if user.limit_type == 7 && self.maxhp >= 10000
user.limit += 250
end
# Slayer
if user.limit_type == 4
user.limit += 200
end
end
end
@state_changed = false
effective |= states_plus(skill.plus_state_set)
effective |= states_minus(skill.minus_state_set)
# Sufferer
if self.is_a?(Game_Actor)
if states.size > current_states.size
if self.limit_type == 14
self.limit += 160
end
end
end
# Warrior & Tactician
if user.is_a?(Game_Actor)
# Warrior
if user.limit_type == 0
user.limit += [self.damage * 10, 160].min
end
# Tactician
if user.limit_type == 6
user.limit += 160
end
end
# Stotic
if self.is_a?(Game_Actor)
if self.limit_type == 1
self.limit += self.damage * 100 / self.maxhp
end
end
# Comrade
if self.is_a?(Game_Actor)
for actor in $game_party.actors
unless actor == self
if actor.limit_type == 3
actor.limit += self.damage * 20 / self.maxhp
end
end
end
end
# If power is 0
if skill.power == 0
# Set damage to an empty string
self.damage = ""
# If state is unchanged
unless @state_changed
# Set damage to "Miss"
self.damage = "Miss"
end
end
# When missing
else
# Dancer & Rook
if self.is_a?(Game_Actor)
# Dancer
if self.limit_type == 12
self.limit += 160
end
# Rook
if self.limit_type == 13 && user.plus_state_set.empty?
self.limit += 100
end
end
# Set damage to "Miss"
self.damage = "Miss"
# Clear critical flag
self.critical = false
end
# If not in battle
unless $game_temp.in_battle
# Set damage to nil
self.damage = nil
end
# End Method
return effective
end
end
#==============================================================================
# ** Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_limitbreak_scenebattle_commandsinit commands_init
alias seph_limitbreak_scenebattle_updatephase3 update_phase3
alias seph_limitbreak_scenebattle_checkcommands check_commands
alias seph_limitbreak_scenebattle_endenemyselect end_enemy_select
alias seph_limitbreak_scenebattle_endactorselect end_actor_select
#--------------------------------------------------------------------------
# * Set Commands
#--------------------------------------------------------------------------
def commands_init
seph_limitbreak_scenebattle_commandsinit
@commands.insert(@commands.index($data_system.words.skill) + 1, 'Limit Break')
end
#--------------------------------------------------------------------------
# * Frame Update (actor command phase)
#--------------------------------------------------------------------------
def update_phase3
seph_limitbreak_scenebattle_updatephase3
# If limit skill is enabled
if @limit_skill_window != nil
update_phase3_limit_select
end
end
#--------------------------------------------------------------------------
# * Check Commands
#--------------------------------------------------------------------------
def check_commands
seph_limitbreak_scenebattle_checkcommands
# Loads Current Command
command = @commands[@actor_command_window.index]
if command == 'Limit Break'
update_phase3_command_limit
end
end
#--------------------------------------------------------------------------
# * Command : Limit
#--------------------------------------------------------------------------
def update_phase3_command_limit
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Set action
@active_battler.current_action.kind = 1
# Start skill selection
start_limit_select
end
#--------------------------------------------------------------------------
# * Start Limit Selection
#--------------------------------------------------------------------------
def start_limit_select
# Skill Window
@limit_skill_window = Window_Skill.new(@active_battler)
@limit_skill_window.refresh(true, true)
# Associate help window
@limit_skill_window.help_window = @help_window
# Disable actor command window
@actor_command_window.active = false
@actor_command_window.visible = false
end
#--------------------------------------------------------------------------
# * Frame Update (actor command phase : limit selection)
#--------------------------------------------------------------------------
def update_phase3_limit_select
# Make skill window visible
@limit_skill_window.visible = true
# Update skill window
@limit_skill_window.update
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# End skill selection
end_limit_select
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Get currently selected data on the skill window
@skill = @limit_skill_window.skill
# If it can't be used
if @skill == nil or not @active_battler.skill_can_use?(@skill.id)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Checks Overdrive
if @active_battler.limit < 1000
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Set action
@active_battler.current_action.skill_id = @skill.id
# Make skill window invisible
@limit_skill_window.visible = false
# If effect scope is single enemy
if @skill.scope == 1
# Start enemy selection
start_enemy_select
# If effect scope is single ally
elsif @skill.scope == 3 or @skill.scope == 5
# Start actor selection
start_actor_select
# If effect scope is not single
else
# End skill selection
end_limit_select
# Go to command input for next actor
phase3_next_actor
end
# Resets Limit
@active_battler.limit = 0
return
end
end
#--------------------------------------------------------------------------
# * End Skill Selection
#--------------------------------------------------------------------------
def end_limit_select
# Dispose of skill window
@limit_skill_window.dispose
@limit_skill_window = nil
# Hide help window
@help_window.visible = false
# Enable actor command window
@actor_command_window.active = true
@actor_command_window.visible = true
end
#--------------------------------------------------------------------------
# * End Enemy Selection
#--------------------------------------------------------------------------
def end_enemy_select
seph_limitbreak_scenebattle_endenemyselect
unless @limit_skill_window == nil
end_limit_select
end
end
#--------------------------------------------------------------------------
# * End Actor Selection
#--------------------------------------------------------------------------
def end_actor_select
seph_limitbreak_scenebattle_endactorselect
unless @limit_skill_window == nil
end_limit_select
end
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
Spero mi aiutate ne ho un gran bisogno
-
Scusa se ti scasso :D ma ora ho un altro problema, ho appena messo l'aggiunbta di script solo che ora andando nel menù vedo la scritta summon grigi( che andrebbe bene) però mi ci fa cliccare e quindi genera un errore che mi fa uscire dal gioco, appena prendo la prima summon l'errore naturlmente nn viene più riscontrato
EDIT
ah dimenticavo... nel menù dove si allevano gli summun si possono mettere le faccine invece i character, tipo il menù FFVII, se si mi faresti uno script grazie in anticipo
-
Sleeping Leonhart un ultima cosa: vorrei che la voce summon nel meù possa comparire solamente quando sblocco il primo eone, nel frattempo vorrei rimanesse inattiva, come per esempio quando da evento sblocco il salvataggio e lo riattivo es in una salvosfera si puo fare anche per quastt script^??
-
Adesso mi ho un altro problema appena richiamo lo script tramite menù o evento mi da questo errore sullo script di statu e sviluppo evocazioni
anche togliendo gli script che mi hai dato poco fà ricevo lo stesso errore
http://linuxitalia.netsons.org/wp-content/immagine.jpg
EDIT:
Ho risolto
-
Thx...xD non so proprio come ringraziarti xD
-
Allora nel mio gioco vorrei utilizzare il menù stile FFVII+PHS ti posto quindi lo script, ti ringrazio inanzitutto di avere creato questo stupefacente script delle evocazioni, che ora tramite evento e anche modificando il menù base sono riuscito a visualizzare lo status degli eoni, come fai con calma a modificare il menù ffVII e grazie ancora
===============
# ■ Game_Actor
#------------------------------------------------------------------------------
# アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors)
# の内部で使用され、Game_Party クラス ($game_party) からも参照されます。
#===============================================================
===============
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :name # 名前
attr_reader :character_name # キャラクター ファイル名
attr_reader :character_hue # キャラクター 色相
attr_reader :class_id # クラス ID
attr_reader :weapon_id # 武器 ID
attr_reader :armor1_id # 盾 ID
attr_reader :armor2_id # 頭防具 ID
attr_reader :armor3_id # 体防具 ID
attr_reader :armor4_id # 装飾品 ID
attr_reader :level # レベル
attr_reader :exp # EXP
attr_reader :skills # スキル
attr_accessor :fixed_member # 固定メンバーフラグ
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# actor_id : アクター ID
#--------------------------------------------------------------------------
def initialize(actor_id)
super()
setup(actor_id)
end
#--------------------------------------------------------------------------
# ● セットアップ
# actor_id : アクター ID
#--------------------------------------------------------------------------
def setup(actor_id)
actor = $data_actors[actor_id]
@actor_id = actor_id
@name = actor.name
@character_name = actor.character_name
@character_hue = actor.character_hue
@battler_name = actor.battler_name
@battler_hue = actor.battler_hue
@class_id = actor.class_id
@weapon_id = actor.weapon_id
@armor1_id = actor.armor1_id
@armor2_id = actor.armor2_id
@armor3_id = actor.armor3_id
@armor4_id = actor.armor4_id
@level = actor.initial_level
@exp_list = Array.new(101)
make_exp_list
@exp = @exp_list[@level]
@skills = []
@hp = maxhp
@sp = maxsp
@states = []
@states_turn = {}
@maxhp_plus = 0
@maxsp_plus = 0
@str_plus = 0
@dex_plus = 0
@agi_plus = 0
@int_plus = 0
@fixed_member = 0
# スキル習得
for i in 1..@level
for j in $data_classes[@class_id].learnings
if j.level == i
learn_skill(j.skill_id)
end
end
end
# オートステートを更新
update_auto_state(nil, $data_armors[@armor1_id])
update_auto_state(nil, $data_armors[@armor2_id])
update_auto_state(nil, $data_armors[@armor3_id])
update_auto_state(nil, $data_armors[@armor4_id])
end
#--------------------------------------------------------------------------
# ● アクター ID 取得
#--------------------------------------------------------------------------
def id
return @actor_id
end
#--------------------------------------------------------------------------
# ● インデックス取得
#--------------------------------------------------------------------------
def index
return $game_party.actors.index(self)
end
#--------------------------------------------------------------------------
# ● EXP 計算
#--------------------------------------------------------------------------
def make_exp_list
actor = $data_actors[@actor_id]
@exp_list[1] = 0
pow_i = 2.4 + actor.exp_inflation / 100.0
for i in 2..100
if i > actor.final_level
@exp_list = 0
else
n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
@exp_list = @exp_list[i-1] + Integer(n)
end
end
end
#--------------------------------------------------------------------------
# ● 属性補正値の取得
# element_id : 属性 ID
#--------------------------------------------------------------------------
def element_rate(element_id)
# 属性有効度に対応する数値を取得
table = [0,200,150,100,50,0,-100]
result = table[$data_classes[@class_id].element_ranks[element_id]]
# 防具でこの属性が防御されている場合は半減
for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
armor = $data_armors
if armor != nil and armor.guard_element_set.include?(element_id)
result /= 2
end
end
# ステートでこの属性が防御されている場合は半減
for i in @states
if $data_states.guard_element_set.include?(element_id)
result /= 2
end
end
# メソッド終了
return result
end
#--------------------------------------------------------------------------
# ● ステート有効度の取得
#--------------------------------------------------------------------------
def state_ranks
return $data_classes[@class_id].state_ranks
end
#--------------------------------------------------------------------------
# ● ステート防御判定
# state_id : ステート ID
#--------------------------------------------------------------------------
def state_guard?(state_id)
for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
armor = $data_armors
if armor != nil
if armor.guard_state_set.include?(state_id)
return true
end
end
end
return false
end
#--------------------------------------------------------------------------
# ● 通常攻撃の属性取得
#--------------------------------------------------------------------------
def element_set
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.element_set : []
end
#--------------------------------------------------------------------------
# ● 通常攻撃のステート変化 (+) 取得
#--------------------------------------------------------------------------
def plus_state_set
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.plus_state_set : []
end
#--------------------------------------------------------------------------
# ● 通常攻撃のステート変化 (-) 取得
#--------------------------------------------------------------------------
def minus_state_set
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.minus_state_set : []
end
#--------------------------------------------------------------------------
# ● MaxHP の取得
#--------------------------------------------------------------------------
def maxhp
n = [[base_maxhp + @maxhp_plus, 1].max, 9999].min
for i in @states
n *= $data_states.maxhp_rate / 100.0
end
n = [[integer(n), 1].max, 9999].min
return n
end
#--------------------------------------------------------------------------
# ● 基本 MaxHP の取得
#--------------------------------------------------------------------------
def base_maxhp
return $data_actors[@actor_id].parameters[0, @level]
end
#--------------------------------------------------------------------------
# ● 基本 MaxSP の取得
#--------------------------------------------------------------------------
def base_maxsp
return $data_actors[@actor_id].parameters[1, @level]
end
#--------------------------------------------------------------------------
# ● 基本腕力の取得
#--------------------------------------------------------------------------
def base_str
n = $data_actors[@actor_id].parameters[2, @level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.str_plus : 0
n += armor1 != nil ? armor1.str_plus : 0
n += armor2 != nil ? armor2.str_plus : 0
n += armor3 != nil ? armor3.str_plus : 0
n += armor4 != nil ? armor4.str_plus : 0
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 基本器用さの取得
#--------------------------------------------------------------------------
def base_dex
n = $data_actors[@actor_id].parameters[3, @level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.dex_plus : 0
n += armor1 != nil ? armor1.dex_plus : 0
n += armor2 != nil ? armor2.dex_plus : 0
n += armor3 != nil ? armor3.dex_plus : 0
n += armor4 != nil ? armor4.dex_plus : 0
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 基本素早さの取得
#--------------------------------------------------------------------------
def base_agi
n = $data_actors[@actor_id].parameters[4, @level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.agi_plus : 0
n += armor1 != nil ? armor1.agi_plus : 0
n += armor2 != nil ? armor2.agi_plus : 0
n += armor3 != nil ? armor3.agi_plus : 0
n += armor4 != nil ? armor4.agi_plus : 0
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 基本魔力の取得
#--------------------------------------------------------------------------
def base_int
n = $data_actors[@actor_id].parameters[5, @level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.int_plus : 0
n += armor1 != nil ? armor1.int_plus : 0
n += armor2 != nil ? armor2.int_plus : 0
n += armor3 != nil ? armor3.int_plus : 0
n += armor4 != nil ? armor4.int_plus : 0
return [[n, 1].max, 999].min
end
#--------------------------------------------------------------------------
# ● 基本攻撃力の取得
#--------------------------------------------------------------------------
def base_atk
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.atk : 0
end
#--------------------------------------------------------------------------
# ● 基本物理防御の取得
#--------------------------------------------------------------------------
def base_pdef
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
pdef1 = weapon != nil ? weapon.pdef : 0
pdef2 = armor1 != nil ? armor1.pdef : 0
pdef3 = armor2 != nil ? armor2.pdef : 0
pdef4 = armor3 != nil ? armor3.pdef : 0
pdef5 = armor4 != nil ? armor4.pdef : 0
return pdef1 + pdef2 + pdef3 + pdef4 + pdef5
end
#--------------------------------------------------------------------------
# ● 基本魔法防御の取得
#--------------------------------------------------------------------------
def base_mdef
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
mdef1 = weapon != nil ? weapon.mdef : 0
mdef2 = armor1 != nil ? armor1.mdef : 0
mdef3 = armor2 != nil ? armor2.mdef : 0
mdef4 = armor3 != nil ? armor3.mdef : 0
mdef5 = armor4 != nil ? armor4.mdef : 0
return mdef1 + mdef2 + mdef3 + mdef4 + mdef5
end
#--------------------------------------------------------------------------
# ● 基本回避修正の取得
#--------------------------------------------------------------------------
def base_eva
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
eva1 = armor1 != nil ? armor1.eva : 0
eva2 = armor2 != nil ? armor2.eva : 0
eva3 = armor3 != nil ? armor3.eva : 0
eva4 = armor4 != nil ? armor4.eva : 0
return eva1 + eva2 + eva3 + eva4
end
#--------------------------------------------------------------------------
# ● 通常攻撃 攻撃側アニメーション ID の取得
#--------------------------------------------------------------------------
def animation1_id
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.animation1_id : 0
end
#--------------------------------------------------------------------------
# ● 通常攻撃 対象側アニメーション ID の取得
#--------------------------------------------------------------------------
def animation2_id
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.animation2_id : 0
end
#--------------------------------------------------------------------------
# ● クラス名の取得
#--------------------------------------------------------------------------
def class_name
return $data_classes[@class_id].name
end
#--------------------------------------------------------------------------
# ● EXP の文字列取得
#--------------------------------------------------------------------------
def exp_s
return @exp_list[@level+1] > 0 ? @exp.to_s : "-------"
end
#--------------------------------------------------------------------------
# ● 次のレベルの EXP の文字列取得
#--------------------------------------------------------------------------
def next_exp_s
return @exp_list[@level+1] > 0 ? @exp_list[@level+1].to_s : "-------"
end
#--------------------------------------------------------------------------
# ● 次のレベルまでの EXP の文字列取得
#--------------------------------------------------------------------------
def next_rest_exp_s
return @exp_list[@level+1] > 0 ?
(@exp_list[@level+1] - @exp).to_s : "-------"
end
#--------------------------------------------------------------------------
# ● オートステートの更新
# old_armor : 外した防具
# new_armor : 装備した防具
#--------------------------------------------------------------------------
def update_auto_state(old_armor, new_armor)
# 外した防具のオートステートを強制解除
if old_armor != nil and old_armor.auto_state_id != 0
remove_state(old_armor.auto_state_id, true)
end
# 装備した防具のオートステートを強制付加
if new_armor != nil and new_armor.auto_state_id != 0
add_state(new_armor.auto_state_id, true)
end
end
#--------------------------------------------------------------------------
# ● 装備固定判定
# equip_type : 装備タイプ
#--------------------------------------------------------------------------
def equip_fix?(equip_type)
case equip_type
when 0 # 武器
return $data_actors[@actor_id].weapon_fix
when 1 # 盾
return $data_actors[@actor_id].armor1_fix
when 2 # 頭
return $data_actors[@actor_id].armor2_fix
when 3 # 身体
return $data_actors[@actor_id].armor3_fix
when 4 # 装飾品
return $data_actors[@actor_id].armor4_fix
end
return false
end
#--------------------------------------------------------------------------
# ● 装備の変更
# equip_type : 装備タイプ
# id : 武器 or 防具 ID (0 なら装備解除)
#--------------------------------------------------------------------------
def equip(equip_type, id)
case equip_type
when 0 # 武器
if id == 0 or $game_party.weapon_number(id) > 0
$game_party.gain_weapon(@weapon_id, 1)
@weapon_id = id
$game_party.lose_weapon(id, 1)
end
when 1 # 盾
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor1_id], $data_armors[id])
$game_party.gain_armor(@armor1_id, 1)
@armor1_id = id
$game_party.lose_armor(id, 1)
end
when 2 # 頭
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor2_id], $data_armors[id])
$game_party.gain_armor(@armor2_id, 1)
@armor2_id = id
$game_party.lose_armor(id, 1)
end
when 3 # 身体
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor3_id], $data_armors[id])
$game_party.gain_armor(@armor3_id, 1)
@armor3_id = id
$game_party.lose_armor(id, 1)
end
when 4 # 装飾品
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor4_id], $data_armors[id])
$game_party.gain_armor(@armor4_id, 1)
@armor4_id = id
$game_party.lose_armor(id, 1)
end
end
end
#--------------------------------------------------------------------------
# ● 装備可能判定
# item : アイテム
#--------------------------------------------------------------------------
def equippable?(item)
# 武器の場合
if item.is_a?(RPG::Weapon)
# 現在のクラスの装備可能な武器に含まれている場合
if $data_classes[@class_id].weapon_set.include?(item.id)
return true
end
end
# 防具の場合
if item.is_a?(RPG::Armor)
# 現在のクラスの装備可能な防具に含まれている場合
if $data_classes[@class_id].armor_set.include?(item.id)
return true
end
end
return false
end
#--------------------------------------------------------------------------
# ● EXP の変更
# exp : 新しい EXP
#--------------------------------------------------------------------------
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
# レベルアップ
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
# スキル習得
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
# レベルダウン
while @exp < @exp_list[@level]
@level -= 1
end
# 現在の HP と SP が最大値を超えていたら修正
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
#--------------------------------------------------------------------------
# ● レベルの変更
# level : 新しいレベル
#--------------------------------------------------------------------------
def level=(level)
# 上下限チェック
level = [[level, $data_actors[@actor_id].final_level].min, 1].max
# EXP を変更
self.exp = @exp_list[level]
end
#--------------------------------------------------------------------------
# ● スキルを覚える
# skill_id : スキル ID
#--------------------------------------------------------------------------
def learn_skill(skill_id)
if skill_id > 0 and not skill_learn?(skill_id)
@skills.push(skill_id)
@skills.sort!
end
end
#--------------------------------------------------------------------------
# ● スキルを忘れる
# skill_id : スキル ID
#--------------------------------------------------------------------------
def forget_skill(skill_id)
@skills.delete(skill_id)
end
#--------------------------------------------------------------------------
# ● スキルの習得済み判定
# skill_id : スキル ID
#--------------------------------------------------------------------------
def skill_learn?(skill_id)
return @skills.include?(skill_id)
end
#--------------------------------------------------------------------------
# ● スキルの使用可能判定
# skill_id : スキル ID
#--------------------------------------------------------------------------
def skill_can_use?(skill_id)
if not skill_learn?(skill_id)
return false
end
return super
end
#--------------------------------------------------------------------------
# ● 名前の変更
# name : 新しい名前
#--------------------------------------------------------------------------
def name=(name)
@name = name
end
#--------------------------------------------------------------------------
# ● クラス ID の変更
# class_id : 新しいクラス ID
#--------------------------------------------------------------------------
def class_id=(class_id)
if $data_classes[class_id] != nil
@class_id = class_id
# 装備できなくなったアイテムを外す
unless equippable?($data_weapons[@weapon_id])
equip(0, 0)
end
unless equippable?($data_armors[@armor1_id])
equip(1, 0)
end
unless equippable?($data_armors[@armor2_id])
equip(2, 0)
end
unless equippable?($data_armors[@armor3_id])
equip(3, 0)
end
unless equippable?($data_armors[@armor4_id])
equip(4, 0)
end
end
end
#--------------------------------------------------------------------------
# ● グラフィックの変更
# character_name : 新しいキャラクター ファイル名
# character_hue : 新しいキャラクター 色相
# battler_name : 新しいバトラー ファイル名
# battler_hue : 新しいバトラー 色相
#--------------------------------------------------------------------------
def set_graphic(character_name, character_hue, battler_name, battler_hue)
@character_name = character_name
@character_hue = character_hue
@battler_name = battler_name
@battler_hue = battler_hue
end
#--------------------------------------------------------------------------
# ● バトル画面 X 座標の取得
#--------------------------------------------------------------------------
def screen_x
# パーティ内の並び順から X 座標を計算して返す
if self.index != nil
return self.index * 160 + 80
else
return 0
end
end
#--------------------------------------------------------------------------
# ● バトル画面 Y 座標の取得
#--------------------------------------------------------------------------
def screen_y
return 464
end
#--------------------------------------------------------------------------
# ● バトル画面 Z 座標の取得
#--------------------------------------------------------------------------
def screen_z
# パーティ内の並び順から Z 座標を計算して返す
if self.index != nil
return 4 - self.index
else
return 0
end
end
end
Game_Party
#===============================================================
===============
# ■ Game_Party
#------------------------------------------------------------------------------
# パーティを扱うクラスです。ゴールドやアイテムなどの惼br />?報が含まれます。このク
# ラスのインスタンスは $game_party で参照されます。
#===============================================================
===============
class Game_Party
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :actors # アクター
attr_reader :gold # ゴールド
attr_reader :steps # 歩数
attr_accessor :member # パーティーメンバー
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
# アクターの配列を作成
@actors = []
# ゴールドと歩数を初期化
@gold = 0
@steps = 0
# アイテム、武器、防具の所持数ハッシュを作成
@items = {}
@weapons = {}
@armors = {}
# PTメンバー用配列を作成
@member = []
end
#--------------------------------------------------------------------------
# ● 初期パーティのセットアップ
#--------------------------------------------------------------------------
def setup_starting_members
@actors = []
for i in $data_system.party_members
@actors.push($game_actors)
@member.push($game_actors.id)
end
@member.sort!
end
#--------------------------------------------------------------------------
# ● 戦闘テスト用パーティのセットアップ
#--------------------------------------------------------------------------
def setup_battle_test_members
@actors = []
for battler in $data_system.test_battlers
actor = $game_actors[battler.actor_id]
actor.level = battler.level
gain_weapon(battler.weapon_id, 1)
gain_armor(battler.armor1_id, 1)
gain_armor(battler.armor2_id, 1)
gain_armor(battler.armor3_id, 1)
gain_armor(battler.armor4_id, 1)
actor.equip(0, battler.weapon_id)
actor.equip(1, battler.armor1_id)
actor.equip(2, battler.armor2_id)
actor.equip(3, battler.armor3_id)
actor.equip(4, battler.armor4_id)
actor.recover_all
@actors.push(actor)
end
@items = {}
for i in 1...$data_items.size
if $data_items.name != ""
occasion = $data_items.occasion
if occasion == 0 or occasion == 1
@items = 99
end
end
end
end
#--------------------------------------------------------------------------
# ● パーティメンバーのリフレッシュ
#--------------------------------------------------------------------------
def refresh
# ゲームデータをロードした直後はアクターオブジェクトが
# $game_actors から分離してしまっている。
# ロードのたびにアクターを再設定することで問題を回避すゼbr />?。
new_actors = []
for i in 0...@actors.size
if $data_actors[@actors.id] != nil
new_actors.push($game_actors[@actors.id])
end
end
@actors = new_actors
end
#--------------------------------------------------------------------------
# ● 最大レベルの取得
#--------------------------------------------------------------------------
def max_level
# パーティ人数が 0 人の場合
if @actors.size == 0
return 0
end
# ローカル変数 level を初期化
level = 0
# パーティメンバーの最大レベルを求める
for actor in @actors
if level < actor.level
level = actor.level
end
end
return level
end
#--------------------------------------------------------------------------
# ● アクターを加える
# actor_id : アクター ID
#--------------------------------------------------------------------------
def add_actor(actor_id)
# アクターを取得
actor = $game_actors[actor_id]
# パーティ人数が 4 人未満で、このアクターがパーティにいない場合
if @actors.size < 4 and not @actors.include?(actor)
# アクターを追加
@actors.push(actor)
# プレイヤーをリフレッシュ
$game_player.refresh
end
# パーティーメンバー配列にアクターID追加
unless @member.include?(actor.id)
@member.push(actor.id)
@member.sort!
end
end
#--------------------------------------------------------------------------
# ● アクターを外す
# actor_id : アクター ID
#--------------------------------------------------------------------------
def remove_actor(actor_id)
# アクターを削除
@actors.delete($game_actors[actor_id])
# プレイヤーをリフレッシュ
$game_player.refresh
# パーティーメンバー配列からアクターID削除
@member.delete(actor_id)
end
#--------------------------------------------------------------------------
# ● アクターを外す : 待機メンバーに配置
# actor_id : アクター ID
#--------------------------------------------------------------------------
def wait_actor(actor_id)
# アクターを削除
@actors.delete($game_actors[actor_id])
# プレイヤーをリフレッシュ
$game_player.refresh
end
#--------------------------------------------------------------------------
# ● アクターを変更
# actor_id : アクター ID
# index : 交換を行う位置
#--------------------------------------------------------------------------
def change_actor(actor_id, index)
# アクターを変更
@actors[index] = $game_actors[actor_id]
# プレイヤーをリフレッシュ
$game_player.refresh
end
#--------------------------------------------------------------------------
# ● ゴールドの増加 (減少)
# n : 金額
#--------------------------------------------------------------------------
def gain_gold(n)
@gold = [[@gold + n, 0].max, 9999999].min
end
#--------------------------------------------------------------------------
# ● ゴールドの減少
# n : 金額
#--------------------------------------------------------------------------
def lose_gold(n)
# 数値を逆転して gain_gold を呼ぶ
gain_gold(-n)
end
#--------------------------------------------------------------------------
# ● 歩数増加
#--------------------------------------------------------------------------
def increase_steps
@steps = [@steps + 1, 9999999].min
end
#--------------------------------------------------------------------------
# ● アイテムの所持数取得
# item_id : アイテム ID
#--------------------------------------------------------------------------
def item_number(item_id)
# ハッシュに個数データがあればその数値を、なければ 0 を返す
return @items.include?(item_id) ? @items[item_id] : 0
end
#--------------------------------------------------------------------------
# ● 武器の所持数取得
# weapon_id : 武器 ID
#--------------------------------------------------------------------------
def weapon_number(weapon_id)
# ハッシュに個数データがあればその数値を、なければ 0 を返す
return @weapons.include?(weapon_id) ? @weapons[weapon_id] : 0
end
#--------------------------------------------------------------------------
# ● 防具の所持数取得
# armor_id : 防具 ID
#--------------------------------------------------------------------------
def armor_number(armor_id)
# ハッシュに個数データがあればその数値を、なければ 0 を返す
return @armors.include?(armor_id) ? @armors[armor_id] : 0
end
#--------------------------------------------------------------------------
# ● アイテムの増加 (減少)
# item_id : アイテム ID
# n : 個数
#--------------------------------------------------------------------------
def gain_item(item_id, n)
# ハッシュの個数データを更新
if item_id > 0
@items[item_id] = [[item_number(item_id) + n, 0].max, 99].min
end
end
#--------------------------------------------------------------------------
# ● 武器の増加 (減少)
# weapon_id : 武器 ID
# n : 個数
#--------------------------------------------------------------------------
def gain_weapon(weapon_id, n)
# ハッシュの個数データを更新
if weapon_id > 0
@weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, 99].min
end
end
#--------------------------------------------------------------------------
# ● 防具の増加 (減少)
# armor_id : 防具 ID
# n : 個数
#--------------------------------------------------------------------------
def gain_armor(armor_id, n)
# ハッシュの個数データを更新
if armor_id > 0
@armors[armor_id] = [[armor_number(armor_id) + n, 0].max, 99].min
end
end
#--------------------------------------------------------------------------
# ● アイテムの減少
# item_id : アイテム ID
# n : 個数
#--------------------------------------------------------------------------
def lose_item(item_id, n)
# 数値を逆転して gain_item を呼ぶ
gain_item(item_id, -n)
end
#--------------------------------------------------------------------------
# ● 武器の減少
# weapon_id : 武器 ID
# n : 個数
#--------------------------------------------------------------------------
def lose_weapon(weapon_id, n)
# 数値を逆転して gain_weapon を呼ぶ
gain_weapon(weapon_id, -n)
end
#--------------------------------------------------------------------------
# ● 防具の減少
# armor_id : 防具 ID
# n : 個数
#--------------------------------------------------------------------------
def lose_armor(armor_id, n)
# 数値を逆転して gain_armor を呼ぶ
gain_armor(armor_id, -n)
end
#--------------------------------------------------------------------------
# ● アイテムの使用可能判定
# item_id : アイテム ID
#--------------------------------------------------------------------------
def item_can_use?(item_id)
# アイテムの個数が 0 個の場合
if item_number(item_id) == 0
# 使用不能
return false
end
# 使用可能時を取得
occasion = $data_items[item_id].occasion
# バトルの場合
if $game_temp.in_battle
# 使用可能時が 0 (常時) または 1 (バトルのみ) なら使用可能
return (occasion == 0 or occasion == 1)
end
# 使用可能時が 0 (常時) または 2 (メニューのみ) なら使用可能
return (occasion == 0 or occasion == 2)
end
#--------------------------------------------------------------------------
# ● 全員のアクションクリア
#--------------------------------------------------------------------------
def clear_actions
# パーティ全員のアクションをクリア
for actor in @actors
actor.current_action.clear
end
end
#--------------------------------------------------------------------------
# ● コマンド入力可能判定
#--------------------------------------------------------------------------
def inputable?
# 一人でもコマンド入力可能なら true を返す
for actor in @actors
if actor.inputable?
return true
end
end
return false
end
#--------------------------------------------------------------------------
# ● 全滅判定
#--------------------------------------------------------------------------
def all_dead?
# パーティ人数が 0 人の場合
if $game_party.actors.size == 0
return false
end
# HP 0 以上のアクターがパーティにいる場合
for actor in @actors
if actor.hp > 0
return false
end
end
# 全滅
return true
end
#--------------------------------------------------------------------------
# ● スリップダメージチェック (マップ用)
#--------------------------------------------------------------------------
def check_map_slip_damage
for actor in @actors
if actor.hp > 0 and actor.slip_damage?
actor.hp -= [actor.maxhp / 100, 1].max
if actor.hp == 0
$game_system.se_play($data_system.actor_collapse_se)
end
$game_screen.start_flash(Color.new(255,0,0,128), 4)
$game_temp.gameover = $game_party.all_dead?
end
end
end
#--------------------------------------------------------------------------
# ● 対象アクターのランダムな決定
# hp0 : HP 0 のアクターに限る
#--------------------------------------------------------------------------
def random_target_actor(hp0 = false)
# ルーレットを初期化
roulette = []
# ループ
for actor in @actors
# 条件に該当する場合
if (not hp0 and actor.exist?) or (hp0 and actor.hp0?)
# アクターのクラスの [位置] を取得
position = $data_classes[actor.class_id].position
# 前衛のとき n = 4、中衛のとき n = 3、後衛のとき n = 2
n = 4 - position
# ルーレットにアクターを n 回追加
n.times do
roulette.push(actor)
end
end
end
# ルーレットのサイズが 0 の場合
if roulette.size == 0
return nil
end
# ルーレットを回し、アクターを決定
return roulette[rand(roulette.size)]
end
#--------------------------------------------------------------------------
# ● 対象アクターのランダムな決定 (HP 0)
#--------------------------------------------------------------------------
def random_target_actor_hp0
return random_target_actor(true)
end
#--------------------------------------------------------------------------
# ● 対象アクターのスムーズな決定
# actor_index : アクターインデックス
#--------------------------------------------------------------------------
def smooth_target_actor(actor_index)
# アクターを取得
actor = @actors[actor_index]
# アクターが存在する場合
if actor != nil and actor.exist?
return actor
end
# ループ
for actor in @actors
# アクターが存在する場合
if actor.exist?
return actor
end
end
end
end
questa è la seconda parte di script
# ■ Window_PTmember
#------------------------------------------------------------------------------
# PTチェンジ画面 メンバーウィンドウ
#==============================================================================
class Window_PTmember < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0, 320, 192)
self.contents = Bitmap.new(width - 32, height - 32)
@column_max = 4
refresh
self.active = true
self.index = 0
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if $game_party.member.size > 4
@item_max = [$game_party.actors.size + 1, 4].min
else
@item_max = [$game_party.actors.size + 1, $game_party.member.size].min
end
rect = Rect.new( 0, 34, 240, 1)
self.contents.fill_rect(rect, Color.new(255, 255, 255, 255))
self.contents.draw_text( 0, 0, 160, 32, "Gruppo attuale")
for i in 0...$game_party.actors.size
x = 40 + i * (70)
actor = $game_party.actors
draw_actor_graphic(actor, x, 150)
if actor.fixed_member == 1
self.contents.font.size = 16
self.contents.draw_text( x + 12, 134, 50, 28, "Mandatory")
self.contents.font.size = 22
end
end
self.contents.draw_text( 15, 40, 240, 32, "Cambia i membri del gruppo...")
end
#--------------------------------------------------------------------------
# ● カーソルの矩形更新
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set( 5 + @index * 70, 40, 70, 120)
end
end
end
#==============================================================================
# ■ Window_PTstatus
#------------------------------------------------------------------------------
# PTチェンジ画面 ステータスウィンドウ
#==============================================================================
class Window_PTstatus < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 192, 320, 192)
self.contents = Bitmap.new(width - 32, height - 32)
refresh( $game_party.actors[0].id )
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh(actor_id)
if actor_id != @a_id
self.contents.clear
if actor_id == nil
@a_id = actor_id
return
end
actor = $game_actors[actor_id]
draw_actor_name(actor, 0, 0)
draw_actor_level(actor, 220, 0)
draw_actor_state(actor, 0, 96)
draw_actor_exp(actor, 0, 128)
draw_actor_hp(actor, 0, 32)
draw_actor_sp(actor, 0, 64)
@a_id = actor_id
end
end
end
#==============================================================================
# ■ Window_Waitmember
#------------------------------------------------------------------------------
# PTチェンジ画面 待機メンバーウィンドウ
#==============================================================================
class Window_Waitmember < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(320, 0, 320, 480)
self.contents = Bitmap.new(width - 32, height - 32)
@column_max = 4
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.member.size
rect = Rect.new( 0, 34, 240, 1)
self.contents.fill_rect(rect, Color.new(255, 255, 255, 255))
self.contents.draw_text( 0, 0, 200, 32, "Membri esterni al gruppo")
for i in 0...$game_party.member.size
x = 40 + ( i % 4 ) * 70
y = 150 + ( i / 4 ) * 140
actor = $game_actors[$game_party.member]
draw_member_graphic(actor, x, y)
end
end
#--------------------------------------------------------------------------
# ● メンバーグラフィックの描画
#--------------------------------------------------------------------------
def draw_member_graphic(actor, x, y)
bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
cw = bitmap.width / 4
ch = bitmap.height / 4
src_rect = Rect.new(0, 0, cw, ch)
# PTにいる場合は半透明で表示
if $game_party.actors.include?(actor)
opacity = 120
else
opacity = 255
end
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
end
#--------------------------------------------------------------------------
# ● カーソルの矩形更新
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set( 5 + ( @index % 4 ) * 70, 40 + ( @index / 4 ) * 140, 70, 120)
end
end
end
#==============================================================================
# ■ Window_PThelp
#------------------------------------------------------------------------------
# PTチェンジ画面 操作ヘルプウィンドウ
#==============================================================================
class Window_PThelp < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super( 0, 384, 320, 96)
self.contents = Bitmap.new(width - 32, height - 32)
@type = 0
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(4, 0, 240, 32, "Scegli il membro che vuoi sostituire.")
if @type == 0
self.contents.draw_text(4, 32, 240, 32, "Premi X o Esc per uscire.")
else
self.contents.draw_text(4, 32, 240, 32, "Scegli il membro da inserire.")
end
end
#--------------------------------------------------------------------------
# ● タイプ変更
#--------------------------------------------------------------------------
def type_change
if @type == 0
@type = 1
else
@type = 0
end
refresh
end
end
#==============================================================================
# ■ Scene_PTchange
#------------------------------------------------------------------------------
# Lo script appartiene ad un sito JAP, la traduzione in inglese è stata fatta da Viskar Nogam'e
# La traduzione in italiano è stata fatta da Tio. Per qualsiasi problema o domanda visitate
# www.rpgshrine.altervista.org
#==============================================================================
class Scene_PTchange
#--------------------------------------------------------------------------
# ● メイン処理
#--------------------------------------------------------------------------
def main
# Informs which Windows to open
@pt_member = Window_PTmember.new
@pt_status = Window_PTstatus.new
@wait_member = Window_Waitmember.new
@pt_help = Window_PThelp.new
# トランジション実行
Graphics.transition
# メインループ
loop do
# ゲーム画面を更新
Graphics.update
# 入力情報を更新
Input.update
# フレーム更新
update
# 画面が切り替わったらループを中断
if $scene != self
break
end
end
# トランジション準備
Graphics.freeze
# ウィンドウを解放
@pt_member.dispose
@pt_status.dispose
@wait_member.dispose
@pt_help.dispose
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
# ステータスウィンドウが表示されてる間は、Bボタン押されるまで停止
if @status != nil
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
# ステータスウィンドウを削除
@status.dispose
@status = nil
end
return
end
# ウィンドウを更新
@pt_member.update
@wait_member.update
# メンバーウィンドウがアクティブの場合: update_pt を呼ぶ
if @pt_member.active
# カーソル位置が空白 ( メンバーの最大値と同じ ) の時ステータスを空白に
if @pt_member.index == $game_party.actors.size
@pt_status.refresh( nil )
else
@pt_status.refresh( $game_party.actors[@pt_member.index].id )
end
update_pt
return
end
# 待機メンバーウィンドウがアクティブの場合: update_member を呼ぶ
if @wait_member.active
@pt_status.refresh( $game_actors[$game_party.member[@wait_member.index]].id )
update_member
return
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メンバーウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_pt
# B ボタンが押された場合
if Input.trigger?(Input::B)
if $game_party.actors.size == 0
# ブザー SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
# メニュー画面に切り替え
$scene = Scene_Menu.new(4)
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# 選択アクターが固定の場合ブザーを鳴らす
if @pt_member.index != $game_party.actors.size
if $game_party.actors[@pt_member.index].fixed_member == 1
$game_system.se_play($data_system.buzzer_se)
return
end
end
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# 待機メンバーウィンドウをアクティブにする
@pt_member.active = false
@wait_member.active = true
@wait_member.index = 0
@pt_help.type_change
return
end
# X ボタンが押された場合
if Input.trigger?(Input::X)
# カーソル位置が空白 ( メンバーの最大値と同じ ) の時ブザーを鳴らす
if @pt_member.index == $game_party.actors.size
# ブザー SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# ステータスウィンドウを表示する
@status = Window_Status.new( $game_party.actors[@pt_member.index] )
@status.z += 50
return
end
# Y ボタンが押された場合
if Input.trigger?(Input::Y)
# 選択アクターが固定の場合ブザーを鳴らす
if @pt_member.index != $game_party.actors.size
if $game_party.actors[@pt_member.index].fixed_member == 1
$game_system.se_play($data_system.buzzer_se)
return
end
end
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
$game_party.wait_actor( $game_party.actors[@pt_member.index].id )
# メンバーウィンドウと待機ウィンドウを再描写
@pt_member.refresh
@wait_member.refresh
return
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (待機メンバーウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_member
# B ボタンが押された場合
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
# メンバーウィンドウをアクティブにする
@pt_member.active = true
@wait_member.active = false
@wait_member.index = -1
@pt_help.type_change
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# 待機メンバーウィンドウで選択されている アクターID を習得
actor_id = $game_actors[$game_party.member[@wait_member.index]].id
# メンバー選択位置が空白の場合は、普通に加える
if @pt_member.index == $game_party.actors.size
$game_party.add_actor( actor_id )
# メンバーウィンドウと待機ウィンドウを再描写
@pt_member.refresh
@wait_member.refresh
# メンバーウィンドウをアクティブにする
@pt_member.active = true
@wait_member.active = false
@wait_member.index = -1
@pt_help.type_change
return
end
# 既に選択されたメンバーがいる場合 そのキャラと交換
if $game_party.actors.include?( $game_actors[actor_id] )
a = $game_party.actors.index( $game_actors[actor_id] )
b = $game_party.actors[@pt_member.index].id
$game_party.change_actor( b, a)
end
# メンバー変更
$game_party.change_actor( actor_id, @pt_member.index )
# メンバーウィンドウと待機ウィンドウを再描写
@pt_member.refresh
@wait_member.refresh
# メンバーウィンドウをアクティブにする
@pt_member.active = true
@wait_member.active = false
@wait_member.index = -1
@pt_help.type_change
return
end
# X ボタンが押された場合
if Input.trigger?(Input::X)
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# ステータスウィンドウを表示する
@status = Window_Status.new( $game_actors[$game_party.member[@wait_member.index]] )
@status.z += 50
return
end
# Y ボタンが押された場合
if Input.trigger?(Input::Y)
# アクターをセット
actor = $game_actors[$game_party.member[@wait_member.index]]
# 装備固定の場合
if actor.equip_fix?(4)
# ブザー SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# 装備 SE を演奏
$game_system.se_play($data_system.equip_se)
# 装飾品を外す
actor.equip( 4, 0)
return
end
end
end
#Final Fantasy VII menu setup by AcedentProne
#*********************************************************
#To use:
#Create a new folder in the Characters folder, and call it Faces
#Adding faces: add a 80x80 picture with the same name as the characterset it
#corrosponds with in the Faces folder
#If text does not appear, right click and select Replace
#Put $defaultfonttype in the Search String box
#Put $fontface in the Replacement String box
#Hit replace all.
#Put $defaultfontsize in the Search String box
#Put $fontsize in the Replacement String box
#Hit replace all.
#
#If you do not want Faces, go to line 102
#and change delete the # of draw_actor_graphic
#and put a # infront of draw_actor_face
# NB TIO:Questo script non l'ho fatto io, ho solamente preso il menu stile FF7, la schermata
# per cambiare personaggio e ho messo l'opzione nel menu, niente di più.
# Se ci sono problemi visitate www.rpgshrine.altervista.org
#========================================
#■ Window_Base
#--------------------------------------------------------------------------
# Setting functions for the "Base"
#========================================
class Window_Base < Window
def draw_actor_face(actor, x, y)
face = RPG::Cache.character("Faces/" + actor.character_name, actor.character_hue)
fw = face.width
fh = face.height
src_rect = Rect.new(0, 0, fw, fh)
self.contents.blt(x - fw / 23, y - fh, face, src_rect)
end
end
def draw_actor_battler_graphic(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
#========================================
#■ Game_Map
#--------------------------------------------------------------------------
# Setting functions for the Map
#========================================
class Game_Map
def name
$map_infos[@map_id]
end
end
#========================================
#■ Window_Title
#--------------------------------------------------------------------------
# Setting functions for the Title
#========================================
class Scene_Title
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end
#========================================================
# ■ Window_MenuStatus
#------------------------------------------------------------------------
# Sets up the Choosing.
#========================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# Set up
#--------------------------------------------------------------------------
def initialize
super(0, 0, 560, 454)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 24
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# Drawing Info on Screen
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 94
y = i * 110
actor = $game_party.actors
draw_actor_face(actor, 12, y + 90) #To get rid of the Face, put a "#" before the draw_ of this line
#draw_actor_graphic(actor, 48, y + 65) #and delete the "#" infront of draw of this line
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 80, y)
draw_actor_level(actor, x, y + 18)
draw_actor_state(actor, x + 200, y)
draw_actor_exp(actor, x+ 144, y + 38)
draw_actor_hp(actor, x, y + 38)
draw_actor_sp(actor, x, y + 58)
end
end
#--------------------------------------------------------------------------
# Update of Cursor
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end
#=======================================#
# ■Window_GameStats #
# written by AcedentProne #
#-----------------------------------------------------------------------#
class Window_GameStats < Window_Base
def initialize
super(0, 0, 160, 80)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 22
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
# Draw "Time"
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 6, 120, 32, text, 2)
self.contents.font.color = system_color
self.contents.draw_text(4, -10, 120, 32, "Tempo di gioco")
#Drawing Gold
self.contents.font.color = normal_color
self.contents.draw_text(4, 22, 120, 32,$game_party.gold.to_s + " " +$data_system.words.gold, 2)
self.contents.font.color = system_color
self.contents.draw_text(4, 22, 120, 32, $data_system.words.gold, 2)
end
#--------------------------------------------------------------------------
# Update of The count
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#========================================================
# ■ Window_Mapname
#------------------------------------------------------------------------
# Draws the Map name
#========================================================
class Window_Mapname < Window_Base
#--------------------------------------------------------------------------
# Set up
#--------------------------------------------------------------------------
def initialize
super(0, 0, 320, 60)
self.contents = Bitmap.new(width - 52, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 24
refresh
end
#--------------------------------------------------------------------------
# Draws info on screen
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# Map Name
#map = $game_map.name
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 220, 32, "Luogo")
self.contents.font.color = normal_color
self.contents.draw_text(175, 0, 80, 32, $game_map.name)
end
end
#========================================================
# ■ Scene_Menu
#------------------------------------------------------------------------
# FF7 menu laytout as requested by AcedentProne.
#========================================================
class Scene_Menu
#--------------------------- edit-------------------------------
attr_reader :status_window
#/--------------------------- edit-------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "PHS" #Da qui potete cambiare il nome dell'opzione per cambiare gruppo
s6 = "Salva"
s7 = "Esci"
#--------------------------- edit-------------------------------
# Command menu
# Size = Screen height - border sizes -
# GameStatus menu - Spacing from GameStatus
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
@command_window.x = 640 - @command_window.width
@command_window.y = 0
@command_window.z = 110
@command_window.index = @menu_index
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled
@command_window.disable_item(4)
@command_window.disable_item(5)
end
@map = Window_Mapname.new
@map.x = 640 - @map.width
@map.y = 480 - @map.height - 1
@map.z = 110
# Lower right box
@game_stats_window = Window_GameStats.new
@game_stats_window.x = 640 - @game_stats_window.width
@game_stats_window.y = 640 - @command_window.height - @game_stats_window.height + 3
@game_stats_window.z =110
# Status window
@status_window = Window_MenuStatus.new
@status_window.x = 0
@status_window.y = 8
@status_window.z = 100
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@game_stats_window.dispose
@status_window.dispose
@map.dispose
end
#--------------------------------------------------------------------
# Updating
#--------------------------------------------------------------------
def update
@command_window.update
@game_stats_window.update
@status_window.update
@map.update
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------
# Updating the Command Selection
#--------------------------------------------------------------------
def update_command
# If B button is pused
if Input.trigger?(Input::B)
# Plays assigned SE
$game_system.se_play($data_system.cancel_se)
# Go to Map
$scene = Scene_Map.new
return
end
# If C button is pused
if Input.trigger?(Input::C)
# Checks actor size
if $game_party.actors.size == 0 and @command_window.index < 4
# plays SE
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_PTchange.new
when 5
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when 6
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------
# Updating Status Screen
#--------------------------------------------------------------------
def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
-
Volevo solamente sapaere una cosa, premetto che non ci capissco molto di ruby, cmq l'evocazioni funzionano a meraviglia, solo che non capisco perchè nel menù non mi appare lo status delle eoni, dopo anche avere messo il tuo 2 script, non è che devo richiamare l'evento in qualche maniere??

Topic dei Compleanni
in Off Topic
Posted
Grazie Buddy! :)