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
Question
Evil_Jack
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
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now