Code:
################################################################################
# Easy-Item crafting script #
# changeable over .ini-files #
# by Tidloc #
#==============================================================================#
# Feel free to use it in your own RPG-Maker game. #
# But please give me credits for this hell of work ^_^ #
#------------------------------------------------------------------------------#
# for using this script write the script-command #
# $scene=Scene_Plan_Smith.new(*smith-number*,*version*,*version2*) #
# Each Smith in zour game should get an own number, because when he's busy #
# smithing something for you, the other are also busy when not use different #
# numbers! But you're free to leave out version2 and version or even the #
# Blacksmiths number. #
# Available Versions: #
# 0 ... everything available at smith (initialized value, you may leave #
# the version out of the brackets) #
# 1 ... only smithery after scematics allowed at smith #
# 2 ... only smithery without scematic allowed at smith #
# Available Version2s: (only when smithing without scematic!) #
# 0 ... Res and Gold #
# 1 ... only Res (standartisized) #
# 2 ... only Gold #
#==============================================================================#
# If any questions appear feel free to contact me! #
# tidloc@g.ho.st #
# 149436915 (ICQ) #
################################################################################
class Game_Temp
attr_accessor :smith_busy
attr_accessor :smith_id
attr_accessor :smith_time
attr_accessor :smith_scem
attr_accessor :smith_script
attr_accessor :smith_choose_cost
attr_accessor :smith_choose_item
attr_accessor :smith_choose_number
attr_accessor :smith_choose_class
alias wo_smithery_initialize initialize
def initialize
wo_smithery_initialize
@smith_busy = []
@smith_id = []
@smith_time = []
@smith_scem = []
@smith_choose_cost = 0
@smith_choose_item = [0,0,0,0]
@smith_choose_number = [0,0,0,0]
@smith_choose_class = [0,0,0,0]
@smith_script = 1
end
def smith_empty
for i in 0..3
if @smith_choose_item[i] != 0
if @smith_choose_class[i] == 0
$game_party.gain_item(@smith_choose_item[i],@smith_choose_number[i])
elsif @smith_choose_class[i] == 1
$game_party.gain_weapon(@smith_choose_item[i],@smith_choose_number[i])
else
$game_party.gain_armor(@smith_choose_item[i],@smith_choose_number[i])
end
end
end
@smith_choose_cost = 0
@smith_choose_item = [0,0,0,0]
@smith_choose_number = [0,0,0,0]
@smith_choose_class = [0,0,0,0]
end
def add_smithery_item(id,amount,cla)
if @smith_choose_item[0] == 0 || (@smith_choose_item[0] == id && @smith_choose_class[0] == cla)
@smith_choose_item[0] = id
@smith_choose_number[0] += amount
@smith_choose_class[0] = cla
if cla==0
$game_party.gain_item(id,-amount)
elsif cla==1
$game_party.gain_weapon(id,-amount)
else
$game_party.gain_armor(id,-amount)
end
return true
elsif @smith_choose_item[1] == 0 || (@smith_choose_item[1] == id && @smith_choose_class[1] == cla)
@smith_choose_item[1] = id
@smith_choose_number[1] += amount
@smith_choose_class[1] = cla
if cla==0
$game_party.gain_item(id,-amount)
elsif cla==1
$game_party.gain_weapon(id,-amount)
else
$game_party.gain_armor(id,-amount)
end
return true
elsif @smith_choose_item[2] == 0 || (@smith_choose_item[2] == id && @smith_choose_class[2] == cla)
@smith_choose_item[2] = id
@smith_choose_number[2] += amount
@smith_choose_class[2] = cla
if cla==0
$game_party.gain_item(id,-amount)
elsif cla==1
$game_party.gain_weapon(id,-amount)
else
$game_party.gain_armor(id,-amount)
end
return true
elsif @smith_choose_item[3] == 0 || (@smith_choose_item[3] == id && @smith_choose_class[3] == cla)
@smith_choose_item[3] = id
@smith_choose_number[3] += amount
@smith_choose_class[3] = cla
if cla==0
$game_party.gain_item(id,-amount)
elsif cla==1
$game_party.gain_weapon(id,-amount)
else
$game_party.gain_armor(id,-amount)
end
return true
end
return false
end
def rem_smithery_item(id,amount,cla)
if @smith_choose_item[0] == id && @smith_choose_class[0] == cla
@smith_choose_amount[0] -= amount
if @smith_choose_amount[0] == 0
@smith_choose_item[0] = @smith_choose_item[1]
@smith_choose_amount[0] = @smith_choose_amount[1]
@smith_choose_class[0] = @smith_choose_class[1]
@smith_choose_item[1] = @smith_choose_item[2]
@smith_choose_amount[1] = @smith_choose_amount[2]
@smith_choose_class[1] = @smith_choose_class[2]
@smith_choose_item[2] = @smith_choose_item[3]
@smith_choose_amount[2] = @smith_choose_amount[3]
@smith_choose_class[2] = @smith_choose_class[3]
@smith_choose_item[3] = 0
@smith_choose_amount[3] = 0
@smith_choose_class[3] = 0
end
elsif @smith_choose_item[1] == id && @smith_choose_class[1] == cla
@smith_choose_amount[1] -= amount
if @smith_choose_amount[1] == 0
@smith_choose_item[1] = @smith_choose_item[2]
@smith_choose_amount[1] = @smith_choose_amount[2]
@smith_choose_class[1] = @smith_choose_class[2]
@smith_choose_item[2] = @smith_choose_item[3]
@smith_choose_amount[2] = @smith_choose_amount[3]
@smith_choose_class[2] = @smith_choose_class[3]
@smith_choose_item[3] = 0
@smith_choose_amount[3] = 0
@smith_choose_class[3] = 0
end
elsif @smith_choose_item[2] == id && @smith_choose_class[2] == cla
@smith_choose_amount[2] -= amount
if @smith_choose_amount[2] == 0
@smith_choose_item[2] = @smith_choose_item[3]
@smith_choose_amount[2] = @smith_choose_amount[3]
@smith_choose_class[2] = @smith_choose_class[3]
@smith_choose_item[3] = 0
@smith_choose_amount[3] = 0
@smith_choose_class[3] = 0
end
elsif @smith_choose_item[3] == id && @smith_choose_class[3] == cla
@smith_choose_amount[3] -= amount
if @smith_choose_amount[3] == 0
@smith_choose_item[3] = 0
@smith_choose_class[3] = 0
end
end
end
end
class Scene_Map
alias wo_smithery_map_update update
def update
wo_smithery_map_update
if (Graphics.frame_count * 3 / Graphics.frame_rate) != @total_seconds
@total_seconds = Graphics.frame_count * 3 / Graphics.frame_rate
if $game_temp.smith_script && $game_variables.[](22)%3 == 0
for i in 0...$game_temp.smith_busy.length
if $game_temp.smith_busy[i] && $game_temp.smith_time[i] > 0
$game_temp.smith_time[i] -= 1
end
end
end
end
end
end
class Window_Command < Window_Selectable
attr_reader :title
def initialize(width, commands, klein = 0, finger = 0, title = 0, items = 0)
@klein = klein
@finger = finger
@title = title
@items = items
@titel_dis = 0
width-=2
if @klein == 0
super(0, 0, width, commands.size * 32 + 32)
elsif @klein == 2
super(0, 0, width, commands.size * 25 + 26, 1)
elsif @klein == 3
super(0, 0, width, commands.size * 25 + 32)
elsif @items == 1
super(0, 0, width, 210, 1)
else
super(0, 0, width, commands.size * 25 + 25)
end
@item_max = commands.size
@commands = commands
if @klein == 0 || @klein == 3
self.contents = Bitmap.new(width - 32, @item_max * 32)
else
self.contents = Bitmap.new(width - 32, @item_max * 25)
end
self.contents.font.name = $defaultfonttype
if klein == 0
self.contents.font.size = $defaultfontsize
else
self.contents.font.size = 20
end
self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name)
refresh
self.index = 0
end
def refresh
self.contents.clear
if @items == 1
@commands = []
@command = []
@item_max = 0
for i in 0...17
if $game_party.item_number(i+45) > 0
@command.push($data_items[i+45])
@item_max = @item_max + 1
end
end
for i in 0...@item_max
item = @command[i]
number = $game_party.item_number(item.id)
if number < 10
@commands[i] = "0" + number.to_s + "* " + item.name
else
@commands[i] = number.to_s + "* " + item.name
end
end
elsif @items == 2
@commands = []
@command = []
@item_max = 0
for i in 0...25
if $game_party.item_number(i+81) > 0
@command.push($data_items[i+81])
@item_max = @item_max + 1
end
end
for i in 0...@item_max
item = @command[i]
number = $game_party.item_number(item.id)
if number < 10
@commands[i] = "0" + number.to_s + "* " + item.name
else
@commands[i] = number.to_s + "* " + item.name
end
end
end
for i in 0...@item_max
if title == 0
draw_item(i, normal_color)
else
draw_item(i, knockout_color)
end
end
end
def draw_item(index, color)
self.contents.font.color = color
if @klein != 0 || width == 180 || @items != 0
rect = Rect.new(4, 24 * index, self.contents.width - 8, 24)
else
rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
end
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index])
end
def returnid(index)
return @command[index]
end
def disable_item(index)
@titel_dis = 1
draw_item(index, disabled_color)
end
end
class Window_Require < Window_Selectable
attr_accessor :title
attr_accessor :cost
attr_accessor :time
attr_accessor :res1
attr_accessor :res2
attr_accessor :res3
attr_accessor :res4
attr_accessor :amo1
attr_accessor :amo2
attr_accessor :amo3
attr_accessor :amo4
attr_accessor :cla1
attr_accessor :cla2
attr_accessor :cla3
attr_accessor :cla4
def initialize
super(0, 0, 480, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
self.title=""
self.cost=0
self.time=0
self.res1=0
self.amo1=0
self.res2=0
self.amo2=0
self.res3=0
self.amo3=0
self.res4=0
self.amo4=0
self.cla1=0
self.cla2=0
self.cla3=0
self.cla4=0
refresh
self.active = false
self.index = -1
@counter2 = 0
end
def newvalues(werte=["",0,0,0,0,0,0,0,0,0,0,0,0,0,0])
self.title=werte[0]
self.cost=werte[1]
self.time=werte[2]
self.res1=werte[3]
self.amo1=werte[4]
self.res2=werte[5]
self.amo2=werte[6]
self.res3=werte[7]
self.amo3=werte[8]
self.res4=werte[9]
self.amo4=werte[10]
self.cla1=werte[11]
self.cla2=werte[12]
self.cla3=werte[13]
self.cla4=werte[14]
end
def refresh
self.contents.clear
if res1 != 0
rect = Rect.new(20, 10, 300, 32)
self.contents.font.size = 32
self.contents.font.color=system_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
if self.title==" "
self.contents.draw_text(rect, "???")
else
self.contents.draw_text(rect, self.title)
end
if self.time > 0
rect = Rect.new(10, 65, 300, 32)
self.contents.font.size = 24
self.contents.font.color=normal_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
text=(self.time/3600).to_s + ":"
if ((self.time%3600)/60)<10
text+= "0"+((self.time%3600)/60).to_s
else
text+=((self.time%3600)/60).to_s
end
if (self.time%60)<10
text+= ":0"+(self.time%60).to_s
else
text+= ":"+(self.time%60).to_s
end
self.contents.draw_text(rect, "Dauer: "+text)
end
if self.time < 0
rect = Rect.new(10, 65, 300, 32)
self.contents.font.size = 24
self.contents.font.color=normal_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
if self.time == -1
self.contents.draw_text(rect, "Duration: "+(-self.time).to_s+" Phase")
else
self.contents.draw_text(rect, "Duration: "+(-self.time).to_s+" Phases")
end
end
if self.title != " "
rect = Rect.new(10, 100, 300, 32)
self.contents.font.size = 24
self.contents.font.color=normal_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, "Costs:")
text=""
if self.cost>0
text += $data_system.words.gold + ": " + $game_party.gold.to_s + " (" + self.cost.to_s + ")"
rect = Rect.new(30, 130, 300, 32)
self.contents.font.size = 24
self.contents.font.color=normal_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, text)
end
if res1>0 && amo1>0
if cla1==0
text = $data_items[res1].name + ": " + $game_party.item_number(res1).to_s + " (" + amo1.to_s + ")"
elsif cla1==1
text = $data_weapons[res1].name + ": " + $game_party.weapon_number(res1).to_s + " (" + amo1.to_s + ")"
else
text = $data_armors[res1].name + ": " + $game_party.armor_number(res1).to_s + " (" + amo1.to_s + ")"
end
rect = Rect.new(30, 160, 300, 32)
self.contents.font.size = 24
self.contents.font.color=normal_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, text)
if res2>0 && amo2>0
if cla2==0
text = $data_items[res2].name + ": " + $game_party.item_number(res2).to_s + " (" + amo2.to_s + ")"
elsif cla2==1
text = $data_weapons[res2].name + ": " + $game_party.weapon_number(res2).to_s + " (" + amo2.to_s + ")"
else
text = $data_armors[res2].name + ": " + $game_party.armor_number(res2).to_s + " (" + amo2.to_s + ")"
end
rect = Rect.new(30, 190, 300, 32)
self.contents.font.size = 24
self.contents.font.color=normal_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, text)
if res3>0 && amo3>0
if cla3==0
text = $data_items[res3].name + ": " + $game_party.item_number(res3).to_s + " (" + amo3.to_s + ")"
elsif cla3==1
text = $data_weapons[res3].name + ": " + $game_party.weapon_number(res3).to_s + " (" + amo3.to_s + ")"
else
text = $data_armors[res3].name + ": " + $game_party.armor_number(res3).to_s + " (" + amo3.to_s + ")"
end
rect = Rect.new(30, 220, 300, 32)
self.contents.font.size = 24
self.contents.font.color=normal_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, text)
if res4>0 && amo4>0
if cla4==0
text = $data_items[res4].name + ": " + $game_party.item_number(res4).to_s + " (" + amo4.to_s + ")"
elsif cla4==0
text = $data_weapons[res4].name + ": " + $game_party.weapon_number(res4).to_s + " (" + amo4.to_s + ")"
else
text = $data_armors[res4].name + ": " + $game_party.armor_number(res4).to_s + " (" + amo4.to_s + ")"
end
rect = Rect.new(30, 250, 300, 32)
self.contents.font.size = 24
self.contents.font.color=normal_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, text)
end
end
end
end
end
end
end
end
class Window_Require4 < Window_Selectable
attr_accessor :title
attr_accessor :cost
attr_accessor :res1
attr_accessor :res2
attr_accessor :res3
attr_accessor :res4
attr_accessor :amo1
attr_accessor :amo2
attr_accessor :amo3
attr_accessor :amo4
attr_accessor :cla1
attr_accessor :cla2
attr_accessor :cla3
attr_accessor :cla4
attr_accessor :need_update
attr_accessor :add_text
def initialize
super(0, 0, 480, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype # "Main" window font
self.contents.font.size = $defaultfontsize
self.title=""
self.cost=0
self.res1=0
self.amo1=0
self.res2=0
self.amo2=0
self.res3=0
self.amo3=0
self.res4=0
self.amo4=0
self.cla1=0
self.cla2=0
self.cla3=0
self.cla4=0
self.add_text=" "
refresh
self.active = false
self.index = -1
self.need_update = false
@counter2 = 0
end
def newvalues(werte=["",0,0,0,0,0,0,0,0,0,0,0,0,0,0])
self.title=werte[0]
self.cost=werte[1]
self.time=werte[2]
self.res1=werte[3]
self.amo1=werte[4]
self.res2=werte[5]
self.amo2=werte[6]
self.res3=werte[7]
self.amo3=werte[8]
self.res4=werte[9]
self.amo4=werte[10]
self.cla1=werte[11]
self.cla2=werte[12]
self.cla3=werte[13]
self.cla4=werte[14]
end
def refresh()
self.title = "to forge:"
self.res1=$game_temp.smith_choose_item[0]
self.amo1=$game_temp.smith_choose_number[0]
self.res2=$game_temp.smith_choose_item[1]
self.amo2=$game_temp.smith_choose_number[1]
self.res3=$game_temp.smith_choose_item[2]
self.amo3=$game_temp.smith_choose_number[2]
self.res4=$game_temp.smith_choose_item[3]
self.amo4=$game_temp.smith_choose_number[3]
self.cla1=$game_temp.smith_choose_class[0]
self.cla2=$game_temp.smith_choose_class[1]
self.cla3=$game_temp.smith_choose_class[2]
self.cla4=$game_temp.smith_choose_class[3]
self.contents.clear
rect = Rect.new(20, 10, 300, 32)
self.contents.font.size = 24
self.contents.font.color=system_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, self.title)
if $game_temp.smith_choose_item[0] != 0
if self.title != " "
text=""
if $game_temp.smith_choose_cost > 0
text += $data_system.words.gold + ": " + $game_temp.smith_choose_cost.to_s
rect = Rect.new(30, 130, 300, 32)
self.contents.font.size = 24
self.contents.font.color=normal_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, text)
end
if $game_temp.smith_choose_item[0] > 0 && amo1>0
if cla1==0
text = $data_items[$game_temp.smith_choose_item[0]].name + ": " + $game_party.item_number(res1).to_s + " (" + amo1.to_s + ")"
elsif cla1==1
text = $data_weapons[$game_temp.smith_choose_item[0]].name + ": " + $game_party.weapon_number(res1).to_s + " (" + amo1.to_s + ")"
else
text = $data_armors[$game_temp.smith_choose_item[0]].name + ": " + $game_party.armor_number(res1).to_s + " (" + amo1.to_s + ")"
end
rect = Rect.new(30, 160, 300, 32)
self.contents.font.size = 24
self.contents.font.color=normal_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, text)
if res2>0 && amo2>0
if cla2==0
text = $data_items[res2].name + ": " + $game_party.item_number(res2).to_s + " (" + amo2.to_s + ")"
elsif cla2==1
text = $data_weapons[res2].name + ": " + $game_party.weapon_number(res2).to_s + " (" + amo2.to_s + ")"
else
text = $data_armors[res2].name + ": " + $game_party.armor_number(res2).to_s + " (" + amo2.to_s + ")"
end
rect = Rect.new(30, 190, 300, 32)
self.contents.font.size = 24
self.contents.font.color=normal_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, text)
if res3>0 && amo3>0
if cla3==0
text = $data_items[res3].name + ": " + $game_party.item_number(res3).to_s + " (" + amo3.to_s + ")"
elsif cla3==1
text = $data_weapons[res3].name + ": " + $game_party.weapon_number(res3).to_s + " (" + amo3.to_s + ")"
else
text = $data_armors[res3].name + ": " + $game_party.armor_number(res3).to_s + " (" + amo3.to_s + ")"
end
rect = Rect.new(30, 220, 300, 32)
self.contents.font.size = 24
self.contents.font.color=normal_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, text)
if res4>0 && amo4>0
if cla4==0
text = $data_items[res4].name + ": " + $game_party.item_number(res4).to_s + " (" + amo4.to_s + ")"
elsif cla4==0
text = $data_weapons[res4].name + ": " + $game_party.weapon_number(res4).to_s + " (" + amo4.to_s + ")"
else
text = $data_armors[res4].name + ": " + $game_party.armor_number(res4).to_s + " (" + amo4.to_s + ")"
end
rect = Rect.new(30, 250, 300, 32)
self.contents.font.size = 24
self.contents.font.color=normal_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, text)
end
end
end
end
end
end
if self.add_text != " "
rect = Rect.new(20, 300, 300, 32)
self.contents.font.size = 26
self.contents.font.color=normal_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, self.add_text)
end
self.need_update = false
end
end
class Window_Require3 < Window_Selectable
attr_accessor :_gold
def initialize
super(100, 200, 440, 80)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype # "Main" window font
self.contents.font.size = $defaultfontsize
self._gold=0
end
def refresh()
self.contents.clear
rect = Rect.new(20, 10, 300, 32)
text = $data_system.words.gold + ": " + $game_party.gold.to_s + ' >> ' + self._gold.to_s
self.contents.font.size = 24
self.contents.font.color=system_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, text)
end
end
class Window_Smith_choose < Window_Selectable
attr_reader :klein
def initialize(klein = 0)
@klein = klein
super(0, 64, 320, 418)
@column_max = 1
refresh
self.index = 0
end
def item
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
@data.push($data_items[i])
end
end
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
@data.push($data_weapons[i])
end
end
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.price > 0
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4
y = index * 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(item.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, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
def update_help
return self.item == nil ? "" : self.item.description
end
end
class Smith
attr_accessor :_id
attr_accessor :_name
attr_accessor :_result
attr_accessor :_outcome
attr_accessor :_probability
attr_accessor :_time
attr_accessor :_cost
attr_accessor :_res1
attr_accessor :_res2
attr_accessor :_res3
attr_accessor :_res4
attr_accessor :_amo1
attr_accessor :_amo2
attr_accessor :_amo3
attr_accessor :_amo4
attr_accessor :_cla1
attr_accessor :_cla2
attr_accessor :_cla3
attr_accessor :_cla4
attr_accessor :count
attr_accessor :_id0
attr_accessor :_smith_id
def initialize()
self._id = []
self._name = []
self._result = []
self._probability = []
self._cost = []
self._res1 = []
self._res2 = []
self._res3 = []
self._res4 = []
self._amo1 = []
self._amo2 = []
self._amo3 = []
self._amo4 = []
self._cla1 = []
self._cla2 = []
self._cla3 = []
self._cla4 = []
self._time = []
self._outcome = []
self._smith_id = []
self.count = 0
self._id0 = 0
end
def init(id)
if self.count > 0
for i in 0...self.count
return false if self._id[i]==id
end
end
if id==0
self._id0 = 1
end
self._id[self.count] = id
self._probability[self.count] = 100
self._cost[self.count] = 0
self._res1[self.count] = 0
self._res2[self.count] = 0
self._res3[self.count] = 0
self._res4[self.count] = 0
self._amo1[self.count] = 0
self._amo2[self.count] = 0
self._amo3[self.count] = 0
self._amo4[self.count] = 0
self._cla1[self.count] = 0
self._cla2[self.count] = 0
self._cla3[self.count] = 0
self._cla4[self.count] = 0
self._time[self.count] = 0
self._outcome[self.count] = 0
self._smith_id[self.count] = 0
self.count += 1
return true
end
def add(id, typ, wert)
for i in 0...self.count
if self._id[i]==id
if typ=="Name"
self._name[i]=wert
elsif typ=="Result"
self._result[i]=wert
elsif typ=="Prop"
self._probability[i]=wert
elsif typ=="Cost"
self._cost[i]=wert
elsif typ=="Res1"
self._res1[i]=wert
elsif typ=="Res2"
self._res2[i]=wert
elsif typ=="Res3"
self._res3[i]=wert
elsif typ=="Res4"
self._res4[i]=wert
elsif typ=="a1"
self._amo1[i]=wert
elsif typ=="a2"
self._amo2[i]=wert
elsif typ=="a3"
self._amo3[i]=wert
elsif typ=="a4"
self._amo4[i]=wert
elsif typ=="c1"
self._cla1[i]=wert
elsif typ=="c2"
self._cla2[i]=wert
elsif typ=="c3"
self._cla3[i]=wert
elsif typ=="c4"
self._cla4[i]=wert
elsif typ=="Time"
self._time[i]=wert
elsif typ=="Outcome"
self._outcome[i]=wert
elsif typ=="ID"
self._smith_id[i]=wert
end
return true
end
end
return false
end
def ausgabe(id, typ)
for i in 0...self.count
if self._id[i]==id
if typ=="Name"
return _name[i]
elsif typ=="Result"
return _result[i]
elsif typ=="Prop"
return _probability[i]
elsif typ=="Cost"
return _cost[i]
elsif typ=="Res1"
return _res1[i]
elsif typ=="Res2"
return _res2[i]
elsif typ=="Res3"
return _res3[i]
elsif typ=="Res4"
return _res4[i]
elsif typ=="a1"
return _amo1[i]
elsif typ=="a2"
return _amo2[i]
elsif typ=="a3"
return _amo3[i]
elsif typ=="a4"
return _amo4[i]
elsif typ=="c1"
return _cla1[i]
elsif typ=="c2"
return _cla2[i]
elsif typ=="c3"
return _cla3[i]
elsif typ=="c4"
return _cla4[i]
elsif typ=="Time"
return _time[i]
elsif typ=="Outcome"
return _outcome[i]
elsif typ=="ID"
return _smith_id[i]
elsif typ=="window"
return [_name[i],_cost[i],_time[i],_res1[i],_amo1[i],_res2[i],_amo2[i],_res3[i],_amo3[i],_res4[i],_amo4[i],_cla1[i],_cla2[i],_cla3[i],_cla4[i]]
end
end
end
return " "
end
def enough(id,cost,r1=0,a1=0,c1=0,r2=0,a2=0,c2=0,r3=0,a3=0,c3=0,r4=0,a4=0,c4=0,instanz=0)
temp2=[]
for i in 0...self.count
if self._id[i]==id
if(r2==0 || a2==0) && (_res2[i]==0 || _amo2[i]==0)
if (r1==_res1[i] && a1>=_amo1[i] && c1>=_cla1[i]) && (cost<=0 || cost<$game_party.gold)
return true
else
return false
end
elsif(r3==0 || a3==0) && (_res3[i]==0 || _amo3[i]==0)
for a in 0..1
if (r1==_res1[i] && a1>=_amo1[i] && c1>=_cla1[i]) && (r2==_res2[i] && a2>=_amo2[i] && c2>=_cla2[i]) && (cost<=0 || cost<$game_party.gold)
return true
else
temp2=[r2,a2,c2,r1,a1,c1]
r1=temp2[0]
a1=temp2[1]
c1=temp2[2]
r2=temp2[3]
a2=temp2[4]
c2=temp2[5]
end
end
return false
elsif(r4==0 || a4==0) && (_res4[i]==0 || _amo4[i]==0)
for a in 0..6
if (r1==_res1[i] && a1>=_amo1[i] && c1>=_cla1[i]) && (r2==_res2[i] && a2>=_amo2[i] && c2>=_cla2[i]) && (r3==_res3[i] && a3>=_amo3[i] && c3>=_cla3[i]) && (cost<=0 || cost<$game_party.gold)
return true
else
if a%2==1
temp2=[r2,a2,c2,r1,a1,c1]
r1=temp2[0]
a1=temp2[1]
c1=temp2[2]
r2=temp2[3]
a2=temp2[4]
c2=temp2[5]
else
temp2=[r3,a3,c3,r1,a1,c1]
r1=temp2[0]
a1=temp2[1]
c1=temp2[2]
r3=temp2[3]
a3=temp2[4]
c3=temp2[5]
end
end
end
return false
else
for a in 1..24
if (r1==_res1[i] && a1>=_amo1[i] && c1>=_cla1[i]) && (r2==_res2[i] && a2>=_amo2[i] && c2>=_cla2[i]) && (r3==_res3[i] && a3>=_amo3[i] && c3>=_cla3[i]) && (r4==_res4[i] && a4>=_amo4[i] && c4>=_cla4[i]) && (cost<=0 || cost<$game_party.gold)
return true
else
if i%2==1
temp2=[r2,a2,c2,r1,a1,c1]
r1=temp2[0]
a1=temp2[1]
c1=temp2[2]
r2=temp2[3]
a2=temp2[4]
c2=temp2[5]
elsif i%4==2
temp2=[r3,a3,c3,r1,a1,c1]
r1=temp2[0]
a1=temp2[1]
c1=temp2[2]
r3=temp2[3]
a3=temp2[4]
c3=temp2[5]
else
temp2=[r4,a4,c4,r3,a3,c3]
r3=temp2[0]
a3=temp2[1]
c3=temp2[2]
r4=temp2[3]
a4=temp2[4]
c4=temp2[5]
end
end
end
return false
end
end
end
end
def outcome(cost=0,r1=0,a1=0,c1=0,r2=0,a2=0,c2=0,r3=0,a3=0,c3=0,r4=0,a4=0,c4=0,smith_num=0)
over=100
idid=0
for i in 0...@count
if(enough(_id[i],cost,r1,a1,c1,r2,a2,c2,r3,a3,c2,r4,a4,c4))
if (r1==0 || a1==0) && (_smith_id[i] == 0 || _smith_id == smith_num)
idid=_id[i]
over=0
else
if (r2==0 || a2==0) && over > (a1-@_amo1[i]) && (_smith_id[i] == 0 || _smith_id == smith_num)
idid=@_id[i]
over=a1-@_amo1[i]
else
if (r3==0 || a3==0) && over > (a1 - self._amo1[i] + a2 - self._amo2[i]) && (_smith_id[i] == 0 || _smith_id == smith_num)
idid=@_id[i]
over=a1 - @_amo1[i] + a2 - @_amo2[i]
else
if (r4==0 || a4==0) && over > (a1 - _amo1[i] + a2 - _amo2[i] + a3-_amo3[i]) && (_smith_id[i] == 0 || _smith_id == smith_num)
idid=_id[i]
over=a1-_amo1[i]+a2-_amo2[i]+a3-_amo3[i]
else
if over>(a1-_amo1[i]+a2-_amo2[i]+a3-_amo3[i]+a4-_amo4[i]) && (_smith_id[i] == 0 || _smith_id == smith_num)
idid=_id[i]
over=a1-_amo1[i]+a2-_amo2[i]+a3-_amo3[i]+a4-_amo4[i]
end
end
end
end
end
end
end
return idid
end
def canmake(id)
for i in 0...self.count
if self._id[i]==id
if $game_party.gold >= _cost[i] || _cost == 0
if ($game_party.item_number(_res1[i]) >= _amo1[i] && _cla1[i]==0) || ($game_party.weapon_number(_res1[i]) >= _amo1[i] && _cla1[i]==1) || ($game_party.armor_number(_res1[i]) >= _amo1[i] && _cla1[i]==2)
return true if _res2[i]==0 || _amo2[i] == 0
if ($game_party.item_number(_res2[i]) >= _amo2[i] && _cla2[i]==0) || ($game_party.weapon_number(_res2[i]) >= _amo2[i] && _cla2[i]==1) || ($game_party.armor_number(_res2[i]) >= _amo2[i] && _cla2[i]==2)
return true if _res3[i]==0 || _amo3[i] == 0
if ($game_party.item_number(_res3[i]) >= _amo3[i] && _cla3[i]==0) || ($game_party.weapon_number(_res3[i]) >= _amo3[i] && _cla3[i]==1) || ($game_party.armor_number(_res3[i]) >= _amo3[i] && _cla3[i]==2)
return true if _res4[i]==0 || _amo4[i] == 0
if ($game_party.item_number(_res4[i]) >= _amo4[i] && _cla4[i]==0) || ($game_party.weapon_number(_res4[i]) >= _amo4[i] && _cla4[i]==1) || ($game_party.armor_number(_res4[i]) >= _amo4[i] && _cla4[i]==2)
return true
else
return false
end
else
return false
end
else
return false
end
else
return false
end
else
return false
end
end
end
return false
end
def start_wo_scem(id,cost,r1,a1,c1,r2,a2,c2,r3,a3,c3,r4,a4,c4)
for i in 0...self.count
if self._id[i]==id
$game_party.gain_gold(-cost)
if r1>0 && a1>0
if c1==0
$game_party.gain_item(r1,-a1)
elsif c1==1
$game_party.gain_weapon(r1,-a1)
else
$game_party.gain_armor(r1,-a1)
end
if r2>0 && a2>0
if c2==0
$game_party.gain_item(r2,-a2)
elsif c2==1
$game_party.gain_weapon(r2,-a2)
else
$game_party.gain_armor(r2,-a2)
end
if r3>0 && a3>0
if c3==0
$game_party.gain_item(r3,-a3)
elsif c3==1
$game_party.gain_weapon(r3,-a3)
else
$game_party.gain_armor(r3,-a3)
end
if r4>0 && a4>0
if c4==0
$game_party.gain_item(r4,-a4)
elsif c4==1
$game_party.gain_weapon(r4,-a4)
else
$game_party.gain_armor(r4,-a4)
end
end
end
end
end
end
end
end
def start(id)
for i in 0...self.count
if self._id[i]==id
if _cost[i]>0
$game_party.gain_gold(-_cost[i])
end
if _res1[i]>0 && _amo1[i]>0
if _cla1[i]==0
$game_party.gain_item(_res1[i],-_amo1[i])
elsif _cla1[i]==1
$game_party.gain_weapon(_res1[i],-_amo1[i])
else
$game_party.gain_armor(_res1[i],-_amo1[i])
end
if _res2[i]>0 && _amo2[i]>0
if _cla2[i]==0
$game_party.gain_item(_res2[i],-_amo2[i])
elsif _cla2[i]==1
$game_party.gain_weapon(_res2[i],-_amo2[i])
else
$game_party.gain_armor(_res2[i],-_amo2[i])
end
if _res3[i]>0 && _amo3[i]>0
if _cla3[i]==0
$game_party.gain_item(_res3[i],-_amo3[i])
elsif _cla3[i]==1
$game_party.gain_weapon(_res3[i],-_amo3[i])
else
$game_party.gain_armor(_res3[i],-_amo3[i])
end
if _res4[i]>0 && _amo4[i]>0
if _cla4[i]==0
$game_party.gain_item(_res4[i],-_amo4[i])
elsif _cla4[i]==1
$game_party.gain_weapon(_res4[i],-_amo4[i])
else
$game_party.gain_armor(_res4[i],-_amo4[i])
end
end
end
end
end
end
end
end
def reward(id)
for i in 0...self.count
if self._id[i]==id
if _outcome[i]==0
$game_party.gain_item(_result[i],1)
elsif _outcome[i]==1
$game_party.gain_weapon(_result[i],1)
else
$game_party.gain_armor(_result[i],1)
end
end
end
end
end
class Scene_Plan_Smith
attr_accessor :smith
attr_accessor :daten
def initialize(smith_num=0, version=0,version2=1)
$game_system.menu_disabled = true
@daten = []
@smith = ""
@smith1 = []
@smith2 = Smith.new
@x=0
@y=0
@z=0
@temp=0
@temp2=0
@text=""
@smith_num=smith_num
@version=version
@version2=version2
end
def main
$game_temp.smith_script = 1
if $DEBUG
@smith = ""
File.open('Data\tidloc.ini','r') do |f1|
while line=f1.gets
@smith += line
end
end
temp=@smith.index('{smithery}')
for z in 0..(temp+9)
@smith[z]=" "
end
@x=0
@y=0
@z=0
@smith=@smith.lstrip
@smith1=@smith
@smith1=@smith1.scan(/\w+/)
while @smith1[0]!='endsmithery'
@y=@smith1.shift
if(@y[0].chr=='n')
@y[0] = ' '
@y.lstrip
@y = -(@y.to_i)
else
@y = @y.to_i
end
@smith2.init(@y)
if @y==0
@smith2.add(@y,"Res1",1)
end
@text+=@y.to_s
a=0
while @smith1[0]!='end'
a+=1
@temp=@smith1.shift
if @temp=='Name'
@smith2.add(@y,@temp,@smith1.shift)
while @smith1[0]!="Result" && @smith1[0]!="Prop" && @smith1[0]!="Cost" && @smith1[0]!="Res1" && @smith1[0]!="Res2" && @smith1[0]!="Res3" && @smith1[0]!="Res4" && @smith1[0]!="Outcome" && @smith1[0]!="Time" && @smith1[0]!="end"
@smith2.add(@y,@temp,@smith2.ausgabe(@y,"Name") + " " + @smith1.shift)
end
elsif @temp=='Result'
@smith2.add(@y,@temp,@smith1.shift.to_i)
elsif @temp=='Prop'
@smith2.add(@y,@temp,@smith1.shift.to_i)
elsif @temp=='Cost'
@smith2.add(@y,@temp,@smith1.shift.to_i)
elsif @temp=='Res1'
@smith2.add(@y,@temp,@smith1.shift.to_i)
@smith2.add(@y,"c1",@smith1.shift.to_i)
@smith2.add(@y,"a1",@smith1.shift.to_i)
elsif @temp=='Res2'
@smith2.add(@y,@temp,@smith1.shift.to_i)
@smith2.add(@y,"c2",@smith1.shift.to_i)
@smith2.add(@y,"a2",@smith1.shift.to_i)
elsif @temp=='Res3'
@smith2.add(@y,@temp,@smith1.shift.to_i)
@smith2.add(@y,"c3",@smith1.shift.to_i)
@smith2.add(@y,"a3",@smith1.shift.to_i)
elsif @temp=='Res4'
@smith2.add(@y,@temp,@smith1.shift.to_i)
@smith2.add(@y,"c4",@smith1.shift.to_i)
@smith2.add(@y,"a4",@smith1.shift.to_i)
elsif @temp=='Outcome'
@smith2.add(@y,@temp,@smith1.shift.to_i)
elsif @temp=='Time'
if ((@smith1[0])[0]).chr=='p'
(@smith1[0])[0]=' '
@smith1[0].lstrip
@smith2.add(@y,@temp,-(@smith1.shift.to_i))
else
@smith2.add(@y,@temp,@smith1.shift.to_i)
end
end
end
@smith1.shift
end
save_data(@smith2,"Data\\tidloc_smith.rxdata")
else
@smith2 = load_data("Data\\tidloc_smith.rxdata")
end
@help_window = Window_Help.new
kommando = []
if @version==0 || @version==1
kommando.push "Forge after scematic"
end
if @version==0 || @version==2
kommando.push "Forge without scematic"
end
kommando.push "leave Blacksmith"
@message_window = Window_Message.new
@command_window = Window_Command.new(250, kommando, 0, 1)
@command_window.y = 64
@require_window = Window_Require.new
@require_window.y = 64
@require_window.x = 250
@require_window.width = 390
if @version != 1
@itemwahl_window = Window_Smith_choose.new
@itemwahl_window.active = false
@itemwahl_window.visible = false
@forsmith_window = Window_Require4.new
@forsmith_window.y = 64
@forsmith_window.x = 320
@forsmith_window.width = 320
@forsmith_window.active = false
@forsmith_window.visible = false
end
@gold_window = Window_Require3.new
@gold_window.active = false
@gold_window.visible = false
@itemwahl=[]
@itemname=[]
a=0
@text=""
for i in 0...@smith2.count
if @smith2._id[i] > 0
if $game_party.item_number(@smith2._id[i])>0
@itemwahl.push @smith2._id[i]
@itemname.push @smith2._name[i]
a+=1
end
end
end
#$game_temp.message_proc = Proc.new { @message_waiting = false }
#@message_waiting = true
#$game_temp.message_text = @text
@item_window = Window_Command2.new(250, @itemname)
@item_window.y = 225
@item_window.active = false
@item_window.index = -1
Graphics.transition
if $game_temp.smith_busy[@smith_num]==1 && $game_temp.smith_time[@smith_num] == 0
@command_window.active = false
$game_temp.smith_busy[@smith_num] = 0
temp = rand(100)
if temp < @smith2.ausgabe(i,"Prop").to_i
$game_temp.smith_id[@smith_num] = 0
end
@smith2.reward($game_temp.smith_id[@smith_num])
text=@smith2.ausgabe($game_temp.smith_id[@smith_num],"Name")
$game_temp.message_proc = Proc.new { @message_waiting = false;$scene = Scene_Map.new }
@message_waiting = true
if $game_temp.smith_id[@smith_num] != 0
$game_temp.message_text = "The Blacksmith has finished your Request!\nYou receive: "+text+"!"
else
$game_temp.message_text = "Unfortunately the Blacksmith wasn't successful\nYour receive: "+text+"..."
end
end
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@help_window.dispose
@require_window.dispose
@item_window.dispose
@message_window.dispose
if @version != 1
@itemwahl_window.dispose
@forsmith_window.dispose
end
$game_system.menu_disabled = false
end
def update
if @item_window.active
@require_window.newvalues(@smith2.ausgabe(@itemwahl[@item_window.index],"window"))
@require_window.refresh
end
if @command_window.active && $game_temp.smith_busy[@smith_num] == 1
temp=@smith2.ausgabe($game_temp.smith_id[@smith_num],"window")
temp[2]=$game_temp.smith_time[@smith_num]
if $game_temp.smith_scem[@smith_num] ==0
temp[0]=" "
end
@require_window.newvalues(temp)
@require_window.refresh
end
if @itemwahl_window.active || @forsmith_window.active
@itemwahl_window.update
if @forsmith_window.need_update
@forsmith_window.refresh
@itemwahl_window.refresh
end
else
@command_window.update
@require_window.update
@item_window.update
@message_window.update
end
@help_window.update
@gold_window.update
if @gold_window.active
update_gold
return
end
if @command_window.active
update_command
return
end
if @item_window.active
update_item
return
end
if @itemwahl_window.active
@help_window.set_text(@itemwahl_window.update_help)
update_itemwahl
return
end
if @forsmith_window.active
update_forsmith
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if @version==0
case @command_window.index
when 0
if $game_temp.smith_busy[@smith_num] == 1
$game_system.se_play($data_system.cancel_se)
elsif @item_window.item_max < 1
$game_system.se_play($data_system.cancel_se)
else
$game_system.se_play($data_system.decision_se)
@item_window.active = true
@item_window.index = 0
@command_window.active = false
end
when 1
if $game_temp.smith_busy[@smith_num] == 1
$game_system.se_play($data_system.cancel_se)
else
if @version2 != 1
$game_system.se_play($data_system.decision_se)
@gold_window._gold = 0
@gold_window.visible = true
@gold_window.active = true
@command_window.active = false
@command_window.active = false
@command_window.visible = false
@item_window.visible = false
@require_window.visible = false
return
end
if @version2 == 1
$game_system.se_play($data_system.decision_se)
@itemwahl_window.visible = true
@itemwahl_window.active = true
@forsmith_window.visible = true
@item_window.index = 0
@command_window.active = false
@command_window.visible = false
@item_window.visible = false
@require_window.visible = false
return
end
end
when 2
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
end
elsif @version==1
case @command_window.index
when 0
if $game_temp.smith_busy[@smith_num] == 1
$game_system.se_play($data_system.cancel_se)
elsif @item_window.item_max<1
$game_system.se_play($data_system.cancel_se)
else
$game_system.se_play($data_system.decision_se)
@item_window.active = true
@item_window.index = 0
@command_window.active = false
end
when 1
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
end
elsif @version==2
case @command_window.index
when 0
if $game_temp.smith_busy[@smith_num] == 1
$game_system.se_play($data_system.cancel_se)
else
if @version2 != 1
$game_system.se_play($data_system.decision_se)
@gold_window._gold = 0
@gold_window.visible = true
@gold_window.active = true
@command_window.active = false
@command_window.active = false
@command_window.visible = false
@item_window.visible = false
@require_window.visible = false
return
end
if @version2 == 1
$game_system.se_play($data_system.decision_se)
@itemwahl_window.visible = true
@itemwahl_window.active = true
@forsmith_window.visible = true
@item_window.index = 0
@command_window.active = false
@command_window.visible = false
@item_window.visible = false
@require_window.visible = false
return
end
end
when 1
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
end
end
return
end
end
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@require_window.newvalues()
@require_window.refresh
@command_window.active = true
@item_window.active = false
@item_window.index = -1
return
end
if Input.trigger?(Input::C)
if(@smith2.canmake(@itemwahl[@item_window.index]))
$game_system.se_play($data_system.decision_se)
a=@itemwahl[@item_window.index]
@smith2.start(@itemwahl[@item_window.index])
if @smith2._time[@itemwahl[@item_window.index]] == 0
@smith2.reward(@itemwahl[@item_window.index])
else
$game_temp.smith_busy[@smith_num] = 1
$game_temp.smith_time[@smith_num] = @smith2.ausgabe(@itemwahl[@item_window.index],"Time")
$game_temp.smith_id[@smith_num] = @itemwahl[@item_window.index]
$game_temp.smith_scem[@smith_num] = 1
end
@require_window.newvalues()
@require_window.refresh
@command_window.active = true
@item_window.active = false
@item_window.index = -1
return
else
$game_system.se_play($data_system.cancel_se)
end
end
end
def update_itemwahl
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$game_temp.smith_empty
@forsmith_window.refresh
@itemwahl_window.refresh
@command_window.active = true
@command_window.visible = true
@item_window.visible = true
@require_window.visible = true
@itemwahl_window.active = false
@itemwahl_window.visible = false
@forsmith_window.active = false
@forsmith_window.visible = false
return
elsif Input.trigger?(Input::C)
case @itemwahl_window.item
when RPG::Item
cla = 0
when RPG::Weapon
cla = 1
when RPG::Armor
cla = 2
end
if $game_temp.add_smithery_item(@itemwahl_window.item.id,1,cla)
$game_system.se_play($data_system.decision_se)
@forsmith_window.need_update = true
else
$game_system.se_play($data_system.cancel_se)
end
return
elsif Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
if @itemwahl_window.active
@itemwahl_window.active = false
@forsmith_window.active = true
@forsmith_window.add_text = "ready to start?"
@forsmith_window.need_update = true
else
@itemwahl_window.active = true
@forsmith_window.active = false
@forsmith_window.add_text = " "
@forsmith_window.need_update = true
end
elsif Input.repeat?(Input::LEFT)
if @itemwahl_window.active
@itemwahl_window.active = false
@forsmith_window.active = true
@forsmith_window.add_text = "ready to start?"
@forsmith_window.need_update = true
else
@itemwahl_window.active = true
@forsmith_window.active = false
@forsmith_window.add_text = " "
@forsmith_window.need_update = true
end
end
end
def update_forsmith
if Input.trigger?(Input::B)
$game_temp.smith_empty
@forsmith_window.refresh
@itemwahl_window.refresh
@command_window.active = true
@command_window.visible = true
@item_window.visible = true
@require_window.visible = true
@itemwahl_window.active = false
@itemwahl_window.visible = false
@forsmith_window.active = false
@forsmith_window.visible = false
return
elsif Input.trigger?(Input::C)
if $game_temp.smith_choose_item[0] != 0
temp=@smith2.outcome($game_temp.smith_choose_cost,$game_temp.smith_choose_item[0],$game_temp.smith_choose_number[0],$game_temp.smith_choose_class[0],$game_temp.smith_choose_item[1],$game_temp.smith_choose_number[1],$game_temp.smith_choose_class[1],$game_temp.smith_choose_item[2],$game_temp.smith_choose_number[2],$game_temp.smith_choose_class[2],$game_temp.smith_choose_item[3],$game_temp.smith_choose_number[3],$game_temp.smith_choose_class[3],@smith_num)
@smith2.start_wo_scem(temp,$game_temp.smith_choose_cost,$game_temp.smith_choose_item[0],$game_temp.smith_choose_number[0],$game_temp.smith_choose_class[0],$game_temp.smith_choose_item[1],$game_temp.smith_choose_number[1],$game_temp.smith_choose_class[1],$game_temp.smith_choose_item[2],$game_temp.smith_choose_number[2],$game_temp.smith_choose_class[2],$game_temp.smith_choose_item[3],$game_temp.smith_choose_number[3],$game_temp.smith_choose_class[3])
$game_temp.smith_busy[@smith_num] = 1
$game_temp.smith_time[@smith_num] = @smith2.ausgabe(temp,"Time")
$game_temp.smith_id[@smith_num] = temp
$game_temp.smith_scem[@smith_num] = 0
$game_temp.smith_empty
@command_window.active = true
@command_window.visible = true
@item_window.visible = true
@require_window.visible = true
@itemwahl_window.active = false
@itemwahl_window.visible = false
@forsmith_window.active = false
@forsmith_window.visible = false
end
return
elsif Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
if @itemwahl_window.active
@itemwahl_window.active = false
@forsmith_window.active = true
@forsmith_window.add_text = "ready to start?"
@forsmith_window.need_update = true
else
@itemwahl_window.active = true
@forsmith_window.active = false
@forsmith_window.add_text = " "
@forsmith_window.need_update = true
end
elsif Input.repeat?(Input::LEFT)
if @itemwahl_window.active
@itemwahl_window.active = false
@forsmith_window.active = true
@forsmith_window.add_text = "ready to start?"
@forsmith_window.need_update = true
else
@itemwahl_window.active = true
@forsmith_window.active = false
@forsmith_window.add_text = " "
@forsmith_window.need_update = true
end
end
end
def update_gold
@gold_window.refresh
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@gold_window._gold = 0
@command_window.active = true
@gold_window.visible = false
@gold_window.active = false
elsif Input.trigger?(Input::C)
if @version2 == 0
$game_system.se_play($data_system.decision_se)
$game_temp.smith_choose_cost = @gold_window._gold
@gold_window._gold = 0
@itemwahl_window.visible = true
@itemwahl_window.active = true
@forsmith_window.visible = true
@item_window.index = 0
@gold_window.visible = false
@gold_window.active = false
@command_window.visible = false
@item_window.visible = false
@require_window.visible = false
return
else
temp=@smith2.outcome($game_temp.smith_choose_cost,$game_temp.smith_choose_item[0],$game_temp.smith_choose_number[0],$game_temp.smith_choose_class[0],$game_temp.smith_choose_item[1],$game_temp.smith_choose_number[1],$game_temp.smith_choose_class[1],$game_temp.smith_choose_item[2],$game_temp.smith_choose_number[2],$game_temp.smith_choose_class[2],$game_temp.smith_choose_item[3],$game_temp.smith_choose_number[3],$game_temp.smith_choose_class[3],@smith_num)
@smith2.start_wo_scem(temp,$game_temp.smith_choose_cost,$game_temp.smith_choose_item[0],$game_temp.smith_choose_number[0],$game_temp.smith_choose_class[0],$game_temp.smith_choose_item[1],$game_temp.smith_choose_number[1],$game_temp.smith_choose_class[1],$game_temp.smith_choose_item[2],$game_temp.smith_choose_number[2],$game_temp.smith_choose_class[2],$game_temp.smith_choose_item[3],$game_temp.smith_choose_number[3],$game_temp.smith_choose_class[3])
$game_temp.smith_busy[@smith_num] = 1
$game_temp.smith_time[@smith_num] = @smith2.ausgabe(temp,"Time")
$game_temp.smith_id[@smith_num] = temp
$game_temp.smith_scem[@smith_num] = 0
$game_temp.smith_empty
@command_window.active = true
@command_window.visible = true
@item_window.visible = true
@require_window.visible = true
@gold_window.visible = false
@gold_window.active = false
return
end
elsif Input.repeat?(Input::RIGHT)
@gold_window._gold += 1
elsif Input.repeat?(Input::LEFT)
@gold_window._gold -= 1
elsif Input.repeat?(Input::UP)
@gold_window._gold += 100
elsif Input.repeat?(Input::DOWN)
@gold_window._gold -= 100
end
if @gold_window._gold < 0
@gold_window._gold = 0
return
elsif @gold_window._gold > $game_party.gold
@gold_window._gold = $game_party.gold
return
end
end
end