#==============================================================================
# ** Window_Command (imported from KGC)
#==============================================================================
class Window_Command < Window_Selectable
unless method_defined?(:add_command)
#--------------------------------------------------------------------------
# * Add Command
#--------------------------------------------------------------------------
def add_command(command)
@commands << command
@item_max = @commands.size
item_index = @item_max - 1
refresh_command
draw_item(item_index)
return item_index
end
#--------------------------------------------------------------------------
# * Refresh Command
#--------------------------------------------------------------------------
def refresh_command
buf = self.contents.clone
self.height = [self.height, row_max * WLH + 32].max
create_contents
self.contents.blt(0, 0, buf, buf.rect)
buf.dispose
end
#--------------------------------------------------------------------------
# * Insert Command
#--------------------------------------------------------------------------
def insert_command(index, command)
@commands.insert(index, command)
@item_max = @commands.size
refresh_command
refresh
end
#--------------------------------------------------------------------------
# * Remove Command
#--------------------------------------------------------------------------
def remove_command(command)
@commands.delete(command)
@item_max = @commands.size
refresh
end
end
end
#==============================================================================
# ** Window_Item
#==============================================================================
class Window_Item < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias :broken_dcweapons_windowitm_init :initialize
def initialize(x, y, width, height, buildup = false)
@buildup = buildup
if @buildup
super(x, y, width, height)
@column_max = 1
self.index = 0
self.active = false
refresh
else
broken_dcweapons_windowitm_init(x, y, width, height)
end
end
#--------------------------------------------------------------------------
# * Whether or not to display in enabled state
#--------------------------------------------------------------------------
alias :broken_dcweapons_windowitm_nbl :enable?
def enable?(item)
return true if @buildup
broken_dcweapons_windowitm_nbl(item)
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
alias :broken_dcweapons_windowitm_drwitm :draw_item
def draw_item(index)
item = @data[index]
if item.is_a?(RPG::Weapon) or item.is_a?(RPG::SynthSphere)
rect = item_rect(index)
self.contents.clear_rect(rect)
enabled = enable?(item)
rect.width -= 4
draw_item_name(item, rect.x, rect.y, enabled)
if item.is_a?(RPG::Weapon) and item.level != 0
self.contents.font.color = text_color(6)
add_x = self.contents.text_size(item.name).width + 28
t = "+#{item.level}"
self.contents.draw_text(rect.x + add_x, rect.y, 124, WLH, t)
end
else
broken_dcweapons_windowitm_drwitm(index)
end
end
end
#==============================================================================
# ** Window_Equip
#==============================================================================
class Window_Equip < Window_Selectable
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
alias :broken_dcweapons_windoweqp_rfrsh :refresh
def refresh
broken_dcweapons_windoweqp_rfrsh
self.contents.font.color = text_color(6)
if @actor.two_swords_style
unless @data[0].nil? or @data[0].level == 0
add_x = self.contents.text_size(@data[0].name).width + 24
t = "+#{@data[0].level}"
self.contents.draw_text(96 + add_x, WLH * 0, 92, WLH, t)
end
unless @data[1].nil? or @data[1].level == 0
add_x = self.contents.text_size(@data[1].name).width + 24
t = "+#{@data[1].level}"
self.contents.draw_text(96 + add_x, WLH * 1, 92, WLH, t)
end
else
unless @data[0].nil? or @data[0].level == 0
add_x = self.contents.text_size(@data[0].name).width + 24
t = "+#{@data[0].level}"
self.contents.draw_text(96 + add_x, WLH * 0, 92, WLH, t)
end
end
end
end
#==============================================================================
# ** Window_WeaponStatus
#==============================================================================
class Window_WeaponStatus < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(weapon, actor = nil)
super(0, 56, 272, 232)
@weapon = weapon
@actor = actor
self.z = 0
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh(bu_w = nil)
self.contents.clear
@buildup_weapon = bu_w
draw_item_name(@weapon, 4, 0)
draw_actor_graphic(@actor, 226, 32) unless @actor.nil?
add_x = self.contents.text_size(@weapon.name).width + 28
unless @weapon.level == 0
self.contents.font.color = text_color(6)
self.contents.draw_text(4 + add_x, WLH * 0, 124, WLH, "+#{@weapon.level}")
end
self.contents.font.color = system_color
expword = DarkCloud_Weapons::WEAPONEXP_WORD
self.contents.draw_text(0, WLH * 1, 124, WLH, expword)
self.contents.font.color = normal_color
self.contents.draw_text(70, WLH * 1, 124, WLH, @weapon.exp, 2)
c1 = text_color(17)
c2 = text_color(21)
draw_gauge(@weapon.exp, @weapon.exp_needed, 0, WLH * 1 + 2, 200, c1, c2)
self.contents.font.color = system_color
expneededword = DarkCloud_Weapons::WEAPONEXP_NEEDEDWORD
self.contents.draw_text(0, WLH * 2 + 4, 124, WLH, expneededword)
self.contents.font.color = normal_color
needed = @weapon.exp_needed - @weapon.exp
self.contents.draw_text(70, WLH * 2 + 4, 124, WLH, needed, 2)
#---------------------------------------------------------------------------
draw_icon(DarkCloud_Weapons::ATK_ICON, 0, WLH * 4 - 10)
self.contents.font.color = system_color
self.contents.draw_text(24, WLH * 4 - 10, 124, WLH, Vocab.atk)
nc = normal_color
kc = knockout_color
c = bu_w.nil? ? nc : bu_w.req_atk > @weapon.atk ? kc : nc
self.contents.font.color = c
self.contents.draw_text(-20, WLH * 4 - 10, 124, WLH, @weapon.atk, 2) #92
c1 = text_color(2)
c2 = text_color(18)
draw_gauge(@weapon.atk, @weapon.max_atk, 0, WLH * 4 - 6, 104, c1, c2)
#---------------------------------------------------------------------------
draw_icon(DarkCloud_Weapons::DEF_ICON, 136, WLH * 4 - 10)
self.contents.font.color = system_color
self.contents.draw_text(160, WLH * 4 - 10, 124, WLH, Vocab.def)
c = bu_w.nil? ? nc : bu_w.req_def > @weapon.def ? kc : nc
self.contents.font.color = c
self.contents.draw_text(110, WLH * 4 - 10, 124, WLH, @weapon.def, 2)
c1 = text_color(3)
c2 = text_color(11)
draw_gauge(@weapon.def, @weapon.max_def, 136, WLH * 4 - 6, 104, c1, c2)
#---------------------------------------------------------------------------
draw_icon(DarkCloud_Weapons::SPI_ICON, 0, WLH * 5)
self.contents.font.color = system_color
self.contents.draw_text(24, WLH * 5, 124, WLH, Vocab.spi)
c = bu_w.nil? ? nc : bu_w.req_spi > @weapon.spi ? kc : nc
self.contents.font.color = c
self.contents.draw_text(-20, WLH * 5, 124, WLH, @weapon.spi, 2)
c1 = text_color(9)
c2 = text_color(4)
draw_gauge(@weapon.spi, @weapon.max_spi, 0, WLH * 5 + 4, 104, c1, c2)
#---------------------------------------------------------------------------
draw_icon(DarkCloud_Weapons::AGI_ICON, 136, WLH * 5)
self.contents.font.color = system_color
self.contents.draw_text(160, WLH * 5, 124, WLH, Vocab.agi)
c = bu_w.nil? ? nc : bu_w.req_agi > @weapon.agi ? kc : nc
self.contents.font.color = c
self.contents.draw_text(110, WLH * 5, 124, WLH, @weapon.agi, 2)
c1 = text_color(5)
c2 = text_color(13)
draw_gauge(@weapon.agi, @weapon.max_agi, 136, WLH * 5 + 4, 104, c1, c2)
#---------------------------------------------------------------------------
draw_item_states(4, WLH * 6 + 12, @weapon)
#---------------------------------------------------------------------------
self.contents.font.color = system_color
weaponsp = DarkCloud_Weapons::WEAPONSP_NAME + ': '
self.contents.draw_text(4, WLH * 7 + 10, 124, WLH, weaponsp)
self.contents.font.color = normal_color
self.contents.draw_text(12, WLH * 7 + 10, 124, WLH, @weapon.sp, 2)
end
#--------------------------------------------------------------------------
# * Draw gauge
#--------------------------------------------------------------------------
def draw_gauge(current, max, x, y, width, color1, color2)
gw = max == 0 ? width : width * current / max
gc1 = color1
gc2 = color2
self.contents.fill_rect(x, y + WLH - 2, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 2, gw, 6, gc1, gc2)
end
#--------------------------------------------------------------------------
# * Build Up Possible
#--------------------------------------------------------------------------
def buildup_possible?
return false if @buildup_weapon.nil?
return false if @buildup_weapon.req_atk > @weapon.atk
return false if @buildup_weapon.req_def > @weapon.def
return false if @buildup_weapon.req_spi > @weapon.spi
return false if @buildup_weapon.req_agi > @weapon.agi
return true
end
end
#==============================================================================
# ** Window_BuildHelp
#==============================================================================
class Window_BuildHelp < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
case @menu_index
when 1, 2 # Upgrade, Break Down
unless @item.nil?
x2 = self.width / 2
draw_icon(DarkCloud_Weapons::ATK_ICON, 0, WLH * 0)
self.contents.font.color = system_color
self.contents.draw_text(28, WLH * 0, 124, WLH, Vocab.atk)
self.contents.font.color = normal_color
self.contents.draw_text(0, WLH * 0, 124, WLH, @item.upgrade_atk, 2)
draw_icon(DarkCloud_Weapons::DEF_ICON, x2, WLH * 0)
self.contents.font.color = system_color
self.contents.draw_text(x2 + 24, WLH * 0, 124, WLH, Vocab.def)
self.contents.font.color = normal_color
self.contents.draw_text(x2, WLH * 0, 124, WLH, @item.upgrade_def, 2)
draw_icon(DarkCloud_Weapons::SPI_ICON, 0, WLH * 1)
self.contents.font.color = system_color
self.contents.draw_text(28, WLH * 1, 124, WLH, Vocab.spi)
self.contents.font.color = normal_color
self.contents.draw_text(0, WLH * 1, 124, WLH, @item.upgrade_spi, 2)
draw_icon(DarkCloud_Weapons::AGI_ICON, x2, WLH * 1)
self.contents.font.color = system_color
self.contents.draw_text(x2 + 24, WLH * 1, 124, WLH, Vocab.agi)
self.contents.font.color = normal_color
self.contents.draw_text(x2, WLH * 1, 124, WLH, @item.upgrade_agi, 2)
draw_item_states(2, WLH * 2, @item)
if @item.is_a?(RPG::SynthSphere)
text = "#{DarkCloud_Weapons::WEAPONSP_NAME} Cost: "
self.contents.font.color = system_color
self.contents.draw_text(2, WLH * 3, self.width, WLH, text)
self.contents.font.color = normal_color
self.contents.draw_text(44, WLH * 3, 124, WLH, @item.sp_cost, 2)
end
end
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update(index, weapon = nil, item = nil)
super()
if @menu_index != index or @weapon != weapon or @item != item
@menu_index = index
@weapon = weapon
@item = item
refresh
end
end
end
#==============================================================================
# ** Window_BuildChoices
#==============================================================================
class Window_BuildChoices < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(weapon)
super(200, 288, 344, 128)
@weapon = weapon
self.index = 0
self.active = false
refresh
end
#--------------------------------------------------------------------------
# * Get Build Up Weapon
#--------------------------------------------------------------------------
def buildup_weapon
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@data = []
for id in @weapon.buildups.compact
next if id.nil?
weapon = $data_weapons[id].clone
weapon.scan
@data.push(weapon)
end
@item_max = @data.size
create_contents
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
weapon = @data[index]
if weapon != nil
rect.width -= 4
if $game_party.built_weapons.include?(weapon.id)
draw_item_name(weapon, rect.x, rect.y)
else
draw_icon(weapon.icon_index, rect.x, rect.y)
self.contents.draw_text(rect.x + 24, rect.y, 172, WLH, '???')
end
end
end
#--------------------------------------------------------------------------
# * Update Help Text
#--------------------------------------------------------------------------
def update_help
show = DarkCloud_Weapons::BUILDUP_BUILDUP_DESC
if show
wpn = buildup_weapon
@help_window.set_text(wpn.nil? ? "" : wpn.description)
end
end
end
#==============================================================================
# ** Window_SetNumber
#==============================================================================
class Window_SetNumber < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 108, 64)
@max = 1
@number = 1
end
#--------------------------------------------------------------------------
# * Set Max Quantity
#--------------------------------------------------------------------------
def set_max(max)
@max = max
@number = 1
refresh
end
#--------------------------------------------------------------------------
# * Set Inputted Quantity
#--------------------------------------------------------------------------
def number
return @number
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
y = 0
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, y, 20, WLH, "×")
self.contents.draw_text(36, y, 20, WLH, @number, 2)
self.cursor_rect.set(32, y, 28, WLH)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if self.active
last_number = @number
if Input.repeat?(Input::RIGHT) and @number < @max
@number += 1
end
if Input.repeat?(Input::LEFT) and @number > 1
@number -= 1
end
if Input.repeat?(Input::UP) and @number < @max
@number = [@number + 10, @max].min
end
if Input.repeat?(Input::DOWN) and @number > 1
@number = [@number - 10, 1].max
end
if @number != last_number
Sound.play_cursor
refresh
end
end
end
end
#==============================================================================
# ** Scene_Menu
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias :broken_dcweapons_scnmenu_int :initialize
def initialize(menu_index = 0, force = false)
broken_dcweapons_scnmenu_int(menu_index)
@switch = $game_switches[DarkCloud_Weapons::MENU_SWITCH]
if DarkCloud_Weapons::MENU_ACCESS and not @switch
if @menu_index >= DarkCloud_Weapons::MENU_INDEX and not force
@menu_index += 1
end
end
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
alias :broken_dcweapons_scnmenu_ccw :create_command_window
def create_command_window
broken_dcweapons_scnmenu_ccw
if DarkCloud_Weapons::MENU_ACCESS and not @switch
text = DarkCloud_Weapons::MENU_TITLE
@dcweapons_command = DarkCloud_Weapons::MENU_INDEX
@command_window.insert_command(@dcweapons_command, text)
if @command_window.oy > 0
@command_window.oy -= Window_Base::WLH
end
end
@command_window.index = @menu_index
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
alias :broken_dcweapons_scnmenu_ucs :update_command_selection
def update_command_selection
if DarkCloud_Weapons::MENU_ACCESS and not @switch
changed = false
if Input.trigger?(Input::C)
case @command_window.index
when @dcweapons_command
Sound.play_decision
start_actor_selection
return
end
end
if @command_window.index > @dcweapons_command
size = @command_window.commands.size
@command_window.index = (@command_window.index - 1) % size
changed = true
end
end
broken_dcweapons_scnmenu_ucs
if DarkCloud_Weapons::MENU_ACCESS and not @switch
size = @command_window.commands.size
@command_window.index = (@command_window.index + 1 ) % size if changed
end
end
#--------------------------------------------------------------------------
# * Update Actor Selection
#--------------------------------------------------------------------------
alias :broken_dcweapons_scnmenu_uas :update_actor_selection
def update_actor_selection
if Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
case @command_window.index
when @dcweapons_command
if $game_party.members[@status_window.index].weapon_1.nil?
Sound.play_buzzer
return
end
Sound.play_decision
$scene = Scene_BuildUp.new(@status_window.index)
return
end
end
broken_dcweapons_scnmenu_uas
end
end
#==============================================================================
# ** Scene_Equip
#==============================================================================
class Scene_Equip < Scene_Base
#--------------------------------------------------------------------------
# * Update Status Window
#--------------------------------------------------------------------------
alias :broken_dcweapons_scneqp_usw :update_status_window
def update_status_window
if not @item_window.nil? and @item_window.active
if @equip_window.index == 1 and @actor.two_swords_style
temp_actor = @actor.clone
temp_actor.change_equip(@equip_window.index,@item_window.item,true,true)
new_atk = temp_actor.atk
new_def = temp_actor.def
new_spi = temp_actor.spi
new_agi = temp_actor.agi
@status_window.set_new_parameters(new_atk, new_def, new_spi, new_agi)
@status_window.update
return
end
end
broken_dcweapons_scneqp_usw
end
#--------------------------------------------------------------------------
# * Update Item Selection
#--------------------------------------------------------------------------
alias :broken_dcweapons_scneqp_uis :update_item_selection
def update_item_selection
if Input.trigger?(Input::C)
if @equip_window.index == 1 and @actor.two_swords_style
Sound.play_equip
@actor.change_equip(@equip_window.index, @item_window.item, false, true)
@equip_window.active = true
@item_window.active = false
@item_window.index = -1
@equip_window.refresh
for item_window in @item_windows
item_window.refresh
end
return
end
end
broken_dcweapons_scneqp_uis
end
end
#==============================================================================
# ** Scene_BuildUp
#==============================================================================
class Scene_BuildUp < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(actor_index = 0)
@actor_index = actor_index
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
@actor = $game_party.members[@actor_index]
@weapon = @actor.weapon_1
@status_window = Window_WeaponStatus.new(@weapon, @actor)
@help2_window = Window_Help.new
h1 = DarkCloud_Weapons::BUILDUP_EQUIP_HELP
h2 = DarkCloud_Weapons::BUILDUP_UPGRADE_HELP
h3 = DarkCloud_Weapons::BUILDUP_BREAKDOWN_HELP
h4 = DarkCloud_Weapons::BUILDUP_BUILDUP_HELP
@help_choices = [h1, h2, h3, h4]
@help2_window.set_text(@help_choices[@command_window.index])
@question_window = Window_Help.new
@question_window.y = 120
@question_window.z = 9999
@question_window.visible = false
@yesno_window = Window_Command.new(100, [' Yes', ' No'])
@yesno_window.x = 218
@yesno_window.y = 176
@yesno_window.z = 9999
@yesno_window.active = false
@yesno_window.visible = false
@item_window = Window_Item.new(272, 56, 272, 232, true)
@item_window.help_window = @help2_window
@help_window = Window_BuildHelp.new(200, 288, 344, 128)
@number_window = Window_SetNumber.new(218, 176)
@number_window.visible = false
@buildup_window = Window_BuildChoices.new(@weapon)
@buildup_window.visible = false
@buildup_window.help_window = @help2_window
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@command_window.dispose
@status_window.dispose
@item_window.dispose
@help_window.dispose
@help2_window.dispose
@question_window.dispose
@yesno_window.dispose
@number_window.dispose
@buildup_window.dispose
end
#--------------------------------------------------------------------------
# * Return to Original Screen
#--------------------------------------------------------------------------
def return_scene
$scene = Scene_Menu.new(DarkCloud_Weapons::MENU_INDEX, true)
end
#--------------------------------------------------------------------------
# * Switch to Next Actor Screen
#--------------------------------------------------------------------------
def next_actor
@actor_index += 1
@actor_index %= $game_party.members.size
if $game_party.members[@actor_index].weapon_1.nil?
next_actor
return
end
$scene = Scene_BuildUp.new(@actor_index)
end
#--------------------------------------------------------------------------
# * Switch to Previous Actor Screen
#--------------------------------------------------------------------------
def prev_actor
@actor_index += $game_party.members.size - 1
@actor_index %= $game_party.members.size
if $game_party.members[@actor_index].weapon_1.nil?
prev_actor
return
end
$scene = Scene_BuildUp.new(@actor_index)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
@command_window.update
@item_window.update
@yesno_window.update
@number_window.update
@status_window.update
@question_window.update
@help2_window.update
@buildup_window.update
if @command_window.active
@help2_window.set_text(@help_choices[@command_window.index])
elsif @item_window.active
@help_window.update(@command_window.index, @weapon, @item_window.item)
elsif @buildup_window.active
if @rem_index != @buildup_window.index
@rem_index = @buildup_window.index
@status_window.refresh(@buildup_window.buildup_weapon)
end
end
if @yesno_window.active
update_confirm_selection
elsif @command_window.active
update_command_selection
elsif @item_window.active
update_item_selection
elsif @buildup_window.active
update_buildup_selection
elsif @number_window.active
update_number_selection
end
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
s1 = DarkCloud_Weapons::BUILDUP_EQUIPWORDS
s2 = DarkCloud_Weapons::BUILDUP_UPGRADEWORD
s3 = DarkCloud_Weapons::BUILDUP_BREAKDOWN
s4 = DarkCloud_Weapons::BUILDUP_BUILDUP
@command_window = Window_Command.new(200, [s1, s2, s3, s4])
@command_window.y = 288
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::R)
Sound.play_cursor
next_actor
elsif Input.trigger?(Input::L)
Sound.play_cursor
prev_actor
elsif Input.trigger?(Input::C)
Sound.play_decision
case @command_window.index
when 0, 1, 2 # Equip, Upgrade, Break Down
@command_window.active = false
@item_window.active = true
when 3 # Build Up
@buildup_window.active = true
@buildup_window.visible = true
@command_window.active = false
@help_window.visible = false
@rem_index = nil
end
end
end
#--------------------------------------------------------------------------
# * Update Item Selection
#--------------------------------------------------------------------------
def update_item_selection
if Input.trigger?(Input::B)
Sound.play_cancel
@item_window.active = false
@command_window.active = true
elsif Input.trigger?(Input::C)
Sound.play_decision
item = @item_window.item
se = RPG::SE.new(DarkCloud_Weapons::BREAKDOWN_SFX, 80)
case @command_window.index
when 0 # Equip
if item.nil? or not item.is_a?(RPG::Weapon) or not
@actor.equippable?(item) or @actor.fix_equipment
Sound.play_buzzer
return
end
Sound.play_equip
@actor.change_equip(0, item)
@weapon = item
@buildup_window.dispose
@buildup_window = Window_BuildChoices.new(@weapon)
@buildup_window.visible = false
@rem_index = nil
@status_window.dispose
@status_window = Window_WeaponStatus.new(@weapon, @actor)
@item_window.refresh
@item_window.active = false
@item_window.index = 0
@command_window.active = true
when 1 # Upgrade
if item.nil? or not item.is_a?(RPG::SynthSphere) or
item.sp_cost > @weapon.sp
Sound.play_buzzer
return
end
@item_window.active = false
@yesno_window.active = true
@yesno_window.visible = true
@question_window.visible = true
@question_window.set_text('Are you okay with this?')
when 2 # Break Down
if item.nil? or item.is_a?(RPG::SynthSphere) or item.no_synth
Sound.play_buzzer
return
end
if item.is_a?(RPG::Weapon)
@item_window.active = false
@yesno_window.active = true
@yesno_window.visible = true
@question_window.visible = true
@question_window.set_text('Are you okay with this?')
else
@item_window.active = false
@number_window.active = true
@number_window.visible = true
@number_window.set_max($game_party.item_number(item))
@question_window.visible = true
@question_window.set_text('How many?')
end
end
end
end
#--------------------------------------------------------------------------
# * Update Confirm Selection
#--------------------------------------------------------------------------
def update_confirm_selection
if Input.trigger?(Input::B)
Sound.play_cancel
@yesno_window.active = false
@yesno_window.visible = false
@question_window.visible = false
if @command_window.index == 3
@buildup_window.active = true
else
@item_window.active = true
end
elsif Input.trigger?(Input::C)
item = @item_window.item
se = RPG::SE.new(DarkCloud_Weapons::BREAKDOWN_SFX, 80)
case @yesno_window.index
when 0 # Yes
case @command_window.index
when 1 # Upgrade
se.play
@weapon.upgrade(item)
$game_party.lose_item(item, nil)
@item_window.index = [@item_window.index - 1, 0].max
@item_window.refresh
@status_window.refresh
@yesno_window.active = false
@yesno_window.visible = false
@item_window.active = true
@question_window.visible = false
when 2 # Break down
se.play
new_item = RPG::SynthSphere.new
new_item.set_sphere(item, nil)
$game_party.lose_item(item, 1)
$game_party.gain_item(new_item, nil)
@item_window.refresh
@yesno_window.active = false
@yesno_window.visible = false
@question_window.visible = false
@item_window.active = true
when 3 # Build Up
se.play
new_weapon = @buildup_window.buildup_weapon
new_weapon.synch(@weapon)
@actor.change_equip(0, new_weapon, true)
@weapon = new_weapon
unless $game_party.built_weapons.include?(@weapon.id)
$game_party.built_weapons.push(@weapon.id)
end
@status_window.dispose
@status_window = Window_WeaponStatus.new(@weapon, @actor)
@yesno_window.active = false
@yesno_window.visible = false
@question_window.visible = false
@buildup_window.dispose
@buildup_window = Window_BuildChoices.new(@weapon)
@buildup_window.visible = false
@rem_index = nil
@help_window.visible = true
@command_window.active = true
end
when 1 # No
@yesno_window.active = false
@yesno_window.visible = false
@question_window.visible = false
if @command_window.index == 3
@buildup_window.active = true
else
@item_window.active = true
end
end
end
end
#--------------------------------------------------------------------------
# * Update Build Up Selection
#--------------------------------------------------------------------------
def update_buildup_selection
if Input.trigger?(Input::B)
Sound.play_cancel
@buildup_window.visible = false
@buildup_window.active = false
@command_window.active = true
@help_window.visible = true
@status_window.refresh
elsif Input.trigger?(Input::C)
if @status_window.buildup_possible?
@buildup_window.active = false
@yesno_window.active = true
@yesno_window.visible = true
@question_window.visible = true
@question_window.set_text('Are you okay with this?')
else
Sound.play_buzzer
end
end
end
#--------------------------------------------------------------------------
# * Update Number Selection
#--------------------------------------------------------------------------
def update_number_selection
if Input.trigger?(Input::B)
Sound.play_cancel
@item_window.active = true
@number_window.active = false
@number_window.visible = false
@question_window.visible = false
elsif Input.trigger?(Input::C)
item = @item_window.item
amount = @number_window.number
case @command_window.index
when 2 # Break Down
se = RPG::SE.new(DarkCloud_Weapons::BREAKDOWN_SFX, 80)
se.play
new_item = RPG::SynthSphere.new
new_item.set_sphere(item, amount)
$game_party.lose_item(item, amount)
$game_party.gain_item(new_item, nil)
@item_window.refresh
@item_window.active = true
@number_window.active = false
@number_window.visible = false
@question_window.visible = false
end
end
end
end
#==============================================================================
# ** Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# * Wait Until Message Display has Finished
#--------------------------------------------------------------------------
alias :broken_dcweapons_scnbttl_wfm :wait_for_message
def wait_for_message
unless @broken_forceignore
broken_dcweapons_scnbttl_wfm
end
end
#--------------------------------------------------------------------------
# * Display Gained Experience and Gold
#--------------------------------------------------------------------------
alias :broken_dcweapons_scnbttl_deag :display_exp_and_gold
def display_exp_and_gold
@broken_forceignore = true
broken_dcweapons_scnbttl_deag
weapon_exp = 0
for enemy in $game_troop.dead_members
weapon_exp += enemy.wep_exp unless enemy.hidden
end
if weapon_exp > 0
text = sprintf(DarkCloud_Weapons::OBTAIN_WEPEXP, weapon_exp)
$game_message.texts.push('\.' + text)
end
@broken_forceignore = false
wait_for_message
for actor in $game_party.existing_members
for weapon in actor.weapons
unless weapon.nil?
old_level = weapon.level
weapon.gain_exp(weapon_exp)
if old_level < weapon.level
an = actor.name
wp = weapon.name
wl = weapon.level
text = sprintf(DarkCloud_Weapons::WEAPON_LEVELUP, an, wp, wl)
$game_message.texts.push('\.' + text)
end
end
end
end
wait_for_message
end
end