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=="_Var"
self._var[i]=wert
elsif typ=="v2"
self._var2[i]=wert
elsif typ=="_Switch"
self._switch[i]=wert
elsif typ=="_Time"
self._time[i]=wert
elsif typ=="_Outcome"
self._outcome[i]=wert
elsif typ=="_ID"
self._alch_id[i]=wert
elsif typ=="_Text"
self._text[i]=wert
elsif typ=="_Text2"
self._text2[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=="Var"
return _var[i]
elsif typ=="v2"
return _var2[i]
elsif typ=="Switch"
return _switch[i]
elsif typ=="Time"
return _time[i]
elsif typ=="Outcome"
return _outcome[i]
elsif typ=="ID"
return _alch_id[i]
elsif typ=="Text"
return _text[i]
elsif typ=="Text2"
return _text2[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],_text[i],_text2[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,alch_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) && (_alch_id[i] == 0 || _alch_id == alch_num)
idid=_id[i]
over=0
else
if (r2==0 || a2==0) && over > (a1-@_amo1[i]) && (_alch_id[i] == 0 || _alch_id == alch_num)
idid=@_id[i]
over=a1-@_amo1[i]
else
if (r3==0 || a3==0) && over > (a1 - self._amo1[i] + a2 - self._amo2[i]) && (_alch_id[i] == 0 || _alch_id == alch_num)
idid=@_id[i]
over=a1 - @_amo1[i] + a2 - @_amo2[i]
else
if (r4==0 || a4==0) && over>(a1-_amo1[i]+a2-_amo2+a3-_amo3[i]) && (_alch_id[i] == 0 || _alch_id == alch_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]) && (_alch_id[i] == 0 || _alch_id == alch_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 _switch[i] = 0 || $game_switches.[](_switch[i])
if _var[i] == 0 || $game_variables.[](_var[i]) >= _var2[i]
if _cost[i] == 0 || $game_party.gold >= _cost[i]
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) || _amo1[i]==0 || _res1[i]==0
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) || _amo1[i]==0 || _res1[i]==0 || _amo2[i]==0 || _res2[i]==0
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) || _amo1[i]==0 || _res1[i]==0 || _amo2[i]==0 || _res2[i]==0 || _amo3[i]==0 || _res3[i]==0
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) || _amo1[i]==0 || _res1[i]==0 || _amo2[i]==0 || _res2[i]==0 || _amo3[i]==0 || _res3[i]==0 || _amo4[i]==0 || _res4[i]==0
return true
else
return false
end
else
return false
end
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_Alch
attr_accessor :alch
attr_accessor :daten
def initialize(alch_num=0, version=0,version2=0)
$game_system.menu_disabled = true
@daten = []
@alch = ""
@alch1 = []
@alch2 = Alch.new
@x=0
@y=0
@z=0
@temp=0
@temp2=0
@text=""
@alch_num=alch_num
@version=version
@version2=version2
end
def main
$game_temp_tidloc_alch.alch_script = 1
if $DEBUG
@alch = ""
File.open('Data\tidloc.ini','r') do |f1|
while line=f1.gets
@alch += line
end
end
temp=@alch.index('{Alchemy}')
for z in 0..(temp+8)
@alch[z]=" "
end
@x=0
@y=0
@z=0
@alch=@alch.lstrip
@alch1=@alch
@alch1=@alch1.scan(/\w+/)
while @alch1[0]!='endAlchemy'
@y=@alch1.shift
if(@y[0].chr=='n')
@y[0] = ' '
@y.lstrip
@y = -(@y.to_i)
else
@y = @y.to_i
end
@alch2.init(@y)
if @y==0
@alch2.add(@y,"Res1",1)
end
@text+=@y.to_s
a=0
while @alch1[0]!='end'
a+=1
@temp=@alch1.shift
if @temp=='_Name'
@alch2.add(@y,@temp,@alch1.shift)
while @alch1[0]!="_Result" && @alch1[0]!="_Prop" && @alch1[0]!="_Cost" && @alch1[0]!="_Res1" && @alch1[0]!="_Res2" && @alch1[0]!="_Res3" && @alch1[0]!="_Res4" && @alch1[0]!="_Outcome" && @alch1[0]!="_Time" && @alch1[0]!="end" && @alch1[0]!="_ID" && @alch1[0]!="_Var" && @alch1[0]!="_Switch" && @alch1[0]!="_Text" && @alch1[0]!="_Text2"
@alch2.add(@y,@temp,@alch2.ausgabe(@y,"Name") + " " + @alch1.shift)
end
elsif @temp=='_Text'
@alch2.add(@y,@temp,@alch1.shift)
while @alch1[0]!="_Result" && @alch1[0]!="_Prop" && @alch1[0]!="_Cost" && @alch1[0]!="_Res1" && @alch1[0]!="_Res2" && @alch1[0]!="_Res3" && @alch1[0]!="_Res4" && @alch1[0]!="_Outcome" && @alch1[0]!="_Time" && @alch1[0]!="end" && @alch1[0]!="_ID" && @alch1[0]!="_Var" && @alch1[0]!="_Switch" && @alch1[0]!="_Name" && @alch1[0]!="_Text2"
@alch2.add(@y,@temp,@alch2.ausgabe(@y,"Text") + " " + @alch1.shift)
end
elsif @temp=='_Text2'
@alch2.add(@y,@temp,@alch1.shift)
while @alch1[0]!="_Result" && @alch1[0]!="_Prop" && @alch1[0]!="_Cost" && @alch1[0]!="_Res1" && @alch1[0]!="_Res2" && @alch1[0]!="_Res3" && @alch1[0]!="_Res4" && @alch1[0]!="_Outcome" && @alch1[0]!="_Time" && @alch1[0]!="end" && @alch1[0]!="_ID" && @alch1[0]!="_Var" && @alch1[0]!="_Switch" && @alch1[0]!="_Name" && @alch1[0]!="_Text"
@alch2.add(@y,@temp,@alch2.ausgabe(@y,"Text2") + " " + @alch1.shift)
end
elsif @temp=='_Result'
@alch2.add(@y,@temp,@alch1.shift.to_i)
elsif @temp=='_Prop'
@alch2.add(@y,@temp,@alch1.shift.to_i)
elsif @temp=='_Cost'
@alch2.add(@y,@temp,@alch1.shift.to_i)
elsif @temp=='_Res1'
@alch2.add(@y,@temp,@alch1.shift.to_i)
@alch2.add(@y,"c1",@alch1.shift.to_i)
@alch2.add(@y,"a1",@alch1.shift.to_i)
elsif @temp=='_Res2'
@alch2.add(@y,@temp,@alch1.shift.to_i)
@alch2.add(@y,"c2",@alch1.shift.to_i)
@alch2.add(@y,"a2",@alch1.shift.to_i)
elsif @temp=='_Res3'
@alch2.add(@y,@temp,@alch1.shift.to_i)
@alch2.add(@y,"c3",@alch1.shift.to_i)
@alch2.add(@y,"a3",@alch1.shift.to_i)
elsif @temp=='_Res4'
@alch2.add(@y,@temp,@alch1.shift.to_i)
@alch2.add(@y,"c4",@alch1.shift.to_i)
@alch2.add(@y,"a4",@alch1.shift.to_i)
elsif @temp=='_Outcome'
@alch2.add(@y,@temp,@alch1.shift.to_i)
elsif @temp=='_Var'
@alch2.add(@y,@temp,@alch1.shift.to_i)
@alch2.add(@y,"v2",@alch1.shift.to_i)
elsif @temp=='_Switch'
@alch2.add(@y,@temp,@alch1.shift.to_i)
elsif @temp=='_ID'
@alch2.add(@y,@temp,@alch1.shift.to_i)
elsif @temp=='_Time'
if ((@alch1[0])[0]).chr=='p'
(@alch1[0])[0]=' '
@alch1[0].lstrip
@alch2.add(@y,@temp,-(@alch1.shift.to_i))
else
@alch2.add(@y,@temp,@alch1.shift.to_i)
end
end
end
@alch1.shift
end
save_data(@alch2,"Data\\tidloc_alch.rxdata")
else
@alch2 = load_data("Data\\tidloc_alch.rxdata")
end
@help_window = Window_Help.new
kommando = []
if @version==0 || @version==1
kommando.push "Mix after recipe"
end
if @version==0 || @version==2
kommando.push "Mix without recipe"
end
kommando.push "Stop mixing"
@message_window = Window_Message.new
@command_window = Window_Command.new(250, kommando, 0, 1)
@command_window.y = 64
if $game_temp_tidloc_alch.alch_busy[@alch_num] == 1
@command_window.disable_item(0)
@command_window.disable_item(1)
end
@require_window = Window_Require.new
@require_window.y = 64
@require_window.x = 250
@require_window.width = 390
@require_window.need_refresh = true
if @version != 1
@itemwahl_window = Window_Alch_choose.new
@itemwahl_window.active = false
@itemwahl_window.visible = false
@foralch_window = Window_Require2.new
@foralch_window.y = 64
@foralch_window.x = 320
@foralch_window.width = 320
@foralch_window.active = false
@foralch_window.visible = false
end
@gold_window = Window_Require3.new
@gold_window.active = false
@gold_window.visible = false
@itemwahl=[]
@itemname=[]
@itempass=[]
a=0
@text=""
for i in 0...@alch2.count
if @alch2._id[i] > 0
if $game_party.item_number(@alch2._id[i])>0
@itemwahl.push @alch2._id[i]
@itemname.push @alch2._name[i]
@itempass.push @alch2.canmake(@alch2._id[i])
a+=1
end
end
end
@item_window = Window_Command2.new(250, @itemname)
@item_window.y = 225
@item_window.active = false
@item_window.index = -1
@item_window._usable = @itempass
@item_window.refresh
Graphics.transition
if $game_temp_tidloc_alch.alch_busy[@alch_num]==1 && $game_temp_tidloc_alch.alch_time[@alch_num] == 0
@command_window.active = false
$game_temp_tidloc_alch.alch_busy[@alch_num] = 0
temp = rand(100)
if temp > @alch2.ausgabe(i,"Prop").to_i
$game_temp_tidloc_alch.alch_id[@alch_num] = 0
end
@alch2.reward($game_temp_tidloc_alch.alch_id[@alch_num])
text=@alch2.ausgabe($game_temp_tidloc_alch.alch_id[@alch_num],"Name")
$game_temp.message_proc = Proc.new { @message_waiting = false;$scene = Scene_Map.new }
@message_waiting = true
if $game_temp_tidloc_alch.alch_id[@alch_num] != 0
$game_temp.message_text = "The Alchemist has finished your request!\nYou receive: "+text+"!"
else
$game_temp.message_text = "Unfortunately the Alchemist wasn't successful\nYou 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
@foralch_window.dispose
end
$game_system.menu_disabled = false
end
def update
if @item_window.active
if @require_window.need_refresh
@require_window.newvalues(@alch2.ausgabe(@itemwahl[@item_window.index],"window"))
@require_window.refresh
end
end
if @command_window.active && $game_temp_tidloc_alch.alch_busy[@alch_num] == 1
temp=@alch2.ausgabe($game_temp_tidloc_alch.alch_id[@alch_num],"window")
temp[2]=$game_temp_tidloc_alch.alch_time[@alch_num]
if $game_temp_tidloc_alch.alch_scem[@alch_num] ==0
temp[0]=" "
end
@require_window.newvalues(temp)
@require_window.refresh if @require_window.need_refresh
end
if @itemwahl_window.active || @foralch_window.active
@itemwahl_window.update
if @foralch_window.need_update
@foralch_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 @foralch_window.active
update_foralch
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_tidloc_alch.alch_busy[@alch_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_tidloc_alch.alch_busy[@alch_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)
$game_temp_tidloc_alch.alch_choose_cost = 0
@itemwahl_window.visible = true
@itemwahl_window.active = true
@foralch_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_tidloc_alch.alch_busy[@alch_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_tidloc_alch.alch_busy[@alch_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
@foralch_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(@alch2.canmake(@itemwahl[@item_window.index]))
$game_system.se_play($data_system.decision_se)
a=@itemwahl[@item_window.index]
@alch2.start(@itemwahl[@item_window.index])
if @alch2._time[@itemwahl[@item_window.index]] == 0
@alch2.reward(@itemwahl[@item_window.index])
else
$game_temp_tidloc_alch.alch_busy[@alch_num] = 1
$game_temp_tidloc_alch.alch_time[@alch_num] = @alch2.ausgabe(@itemwahl[@item_window.index],"Time")
$game_temp_tidloc_alch.alch_id[@alch_num] = @itemwahl[@item_window.index]
$game_temp_tidloc_alch.alch_scem[@alch_num] = 1
@command_window.disable_item(0)
@command_window.disable_item(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
elsif Input.repeat?(Input::UP)
@require_window.need_refresh = true
elsif Input.repeat?(Input::DOWN)
@require_window.need_refresh = true
end
end
def update_itemwahl
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$game_temp_tidloc_alch.alch_empty
@foralch_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
@foralch_window.active = false
@foralch_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_tidloc_alch.add_alchemy_item(@itemwahl_window.item.id,1,cla)
$game_system.se_play($data_system.decision_se)
@foralch_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
@foralch_window.active = true
@foralch_window.add_text = "ready to mix?"
@foralch_window.need_update = true
else
@itemwahl_window.active = true
@foralch_window.active = false
@foralch_window.add_text = " "
@foralch_window.need_update = true
end
elsif Input.repeat?(Input::LEFT)
if @itemwahl_window.active
@itemwahl_window.active = false
@foralch_window.active = true
@foralch_window.add_text = "ready to mix?"
@foralch_window.need_update = true
else
@itemwahl_window.active = true
@foralch_window.active = false
@foralch_window.add_text = " "
@foralch_window.need_update = true
end
end
end
def update_foralch
if Input.trigger?(Input::B)
$game_temp_tidloc_alch.alch_empty
@foralch_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
@foralch_window.active = false
@foralch_window.visible = false
return
elsif Input.trigger?(Input::C)
if $game_temp_tidloc_alch.alch_choose_item[0] != 0
temp=@alch2.outcome($game_temp_tidloc_alch.alch_choose_cost,$game_temp_tidloc_alch.alch_choose_item[0],$game_temp_tidloc_alch.alch_choose_number[0],$game_temp_tidloc_alch.alch_choose_class[0],$game_temp_tidloc_alch.alch_choose_item[1],$game_temp_tidloc_alch.alch_choose_number[1],$game_temp_tidloc_alch.alch_choose_class[1],$game_temp_tidloc_alch.alch_choose_item[2],$game_temp_tidloc_alch.alch_choose_number[2],$game_temp_tidloc_alch.alch_choose_class[2],$game_temp_tidloc_alch.alch_choose_item[3],$game_temp_tidloc_alch.alch_choose_number[3],$game_temp_tidloc_alch.alch_choose_class[3],@alch_num)
@alch2.start_wo_scem(temp,$game_temp_tidloc_alch.alch_choose_cost,$game_temp_tidloc_alch.alch_choose_item[0],$game_temp_tidloc_alch.alch_choose_number[0],$game_temp_tidloc_alch.alch_choose_class[0],$game_temp_tidloc_alch.alch_choose_item[1],$game_temp_tidloc_alch.alch_choose_number[1],$game_temp_tidloc_alch.alch_choose_class[1],$game_temp_tidloc_alch.alch_choose_item[2],$game_temp_tidloc_alch.alch_choose_number[2],$game_temp_tidloc_alch.alch_choose_class[2],$game_temp_tidloc_alch.alch_choose_item[3],$game_temp_tidloc_alch.alch_choose_number[3],$game_temp_tidloc_alch.alch_choose_class[3])
$game_temp_tidloc_alch.alch_busy[@alch_num] = 1
$game_temp_tidloc_alch.alch_time[@alch_num] = @alch2.ausgabe(temp,"Time")
$game_temp_tidloc_alch.alch_id[@alch_num] = temp
$game_temp_tidloc_alch.alch_scem[@alch_num] = 0
$game_temp_tidloc_alch.alch_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
@foralch_window.active = false
@foralch_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
@foralch_window.active = true
@foralch_window.add_text = "ready to mix?"
@foralch_window.need_update = true
else
@itemwahl_window.active = true
@foralch_window.active = false
@foralch_window.add_text = " "
@foralch_window.need_update = true
end
elsif Input.repeat?(Input::LEFT)
if @itemwahl_window.active
@itemwahl_window.active = false
@foralch_window.active = true
@foralch_window.add_text = "ready to mix?"
@foralch_window.need_update = true
else
@itemwahl_window.active = true
@foralch_window.active = false
@foralch_window.add_text = " "
@foralch_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_tidloc_alch.alch_choose_cost = @gold_window._gold
@gold_window._gold = 0
@itemwahl_window.visible = true
@itemwahl_window.active = true
@foralch_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=@alch2.outcome($game_temp_tidloc_alch.alch_choose_cost,$game_temp_tidloc_alch.alch_choose_item[0],$game_temp_tidloc_alch.alch_choose_number[0],$game_temp_tidloc_alch.alch_choose_class[0],$game_temp_tidloc_alch.alch_choose_item[1],$game_temp_tidloc_alch.alch_choose_number[1],$game_temp_tidloc_alch.alch_choose_class[1],$game_temp_tidloc_alch.alch_choose_item[2],$game_temp_tidloc_alch.alch_choose_number[2],$game_temp_tidloc_alch.alch_choose_class[2],$game_temp_tidloc_alch.alch_choose_item[3],$game_temp_tidloc_alch.alch_choose_number[3],$game_temp_tidloc_alch.alch_choose_class[3],@alch_num)
@alch2.start_wo_scem(temp,$game_temp_tidloc_alch.alch_choose_cost,$game_temp_tidloc_alch.alch_choose_item[0],$game_temp_tidloc_alch.alch_choose_number[0],$game_temp_tidloc_alch.alch_choose_class[0],$game_temp_tidloc_alch.alch_choose_item[1],$game_temp_tidloc_alch.alch_choose_number[1],$game_temp_tidloc_alch.alch_choose_class[1],$game_temp_tidloc_alch.alch_choose_item[2],$game_temp_tidloc_alch.alch_choose_number[2],$game_temp_tidloc_alch.alch_choose_class[2],$game_temp_tidloc_alch.alch_choose_item[3],$game_temp_tidloc_alch.alch_choose_number[3],$game_temp_tidloc_alch.alch_choose_class[3])
$game_temp_tidloc_alch.alch_busy[@alch_num] = 1
$game_temp_tidloc_alch.alch_time[@alch_num] = @alch2.ausgabe(temp,"Time")
$game_temp_tidloc_alch.alch_id[@alch_num] = temp
$game_temp_tidloc_alch.alch_scem[@alch_num] = 0
$game_temp_tidloc_alch.alch_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