#===============================================================================
# *Item Crafter
# *Item Crafter scene created by TheKrazyGamer/kcgcrazy/TheKraazyGamer
# *Please Give Credit if used
#
# *to add an item of your own just add it to the RECIPES array.
# Add The ITEMID,AMOUNT to be crafted,required MATERIALS and COSTS
# and also BOOLEAN values for it being unlocked or not.
# If a Second Material is not being used, enter nil.
#
# Here is an example!
#
# RECIPES=[
# [:ITEMID,CRAFT_AMOUNT,[:MATERIAL1,COST],[:MATERIAL2,COST],IS_UNLOCKED?]
# ]
############################################################
# RECIPES=[
# [:POKEBALL,1,[:WHTAPRICORN,5],nil,false],
# [:GREATBALL,1,[:WHTAPRICORN,15],[:BLKAPRICORN,5],false],
# [:ULTRABALL,1,[:WHTAPRICORN,15],[:GRNAPRICORN,15],false],
# [:DIVEBALL,1,[:WHTAPRICORN,3],[:PNKAPRICORN,3],false]
# ]
#
############################################################
#
# *To call put ItemCrafterScene.new in an event
# or create an item like this
#
# #Item Crafter
# ItemHandlers::UseFromBag.add(:ITEMCRAFTER,proc{|item|
# Kernel.pbMessage(_INTL("{1} used the {2}.",$Trainer.name,PBItems.getName(item)))
# ItemCrafterScene.new
# next 1
# })
#
# and add this to the Items.txt
# XXX,ITEMCRAFTER,Item Crafter,8,0,"Lets you craft items.",2,0,6,
# XXX - This is the number you can use in items.txt
# Create an item in icons folder with that number.
#
# To unlock an item that was set as false, just add the following after an event:
# $game_variables[CRAFTVAR][x]=true # x being the item index (count from 0 for the first etc)
#
# And Finally...
#
# Add setupCraftUnlocks to an event in the Intro Event to initialize
# The $game_variables.
#
#
#===============================================================================
CRAFTVAR = 32 # number used for available $game_variable.
$exit = 0
$isUnlocked = []
###############################################################################
# This is your Items, Material etc.
###############################################################################
RECIPES=[
[:POKEBALL,3,
[:REDAPRICORN,2],nil,nil,nil,nil,nil, false],
[:GREATBALL,3,
[:REDAPRICORN,2],[:BLUAPRICORN,2],[:PNKAPRICORN,2],[:BLKAPRICORN,2],[:WHTAPRICORN,2],[:YLWAPRICORN,2], false],
[:ULTRABALL,3,
[:BLKAPRICORN,2],[:YLWAPRICORN,2],nil,nil,nil,nil, false],
[:DIVEBALL,3,
[:PNKAPRICORN,2],[:BLUAPRICORN,2],nil,nil,nil,nil, false],
[:DUSKBALL,3,
[:BLKAPRICORN,2],[:BLUAPRICORN,2],nil,nil,nil,nil, false],
[:FASTBALL,3,
[:REDAPRICORN,2],[:YLWAPRICORN,2],nil,nil,nil,nil, false],
[:FRIENDBALL,3,
[:GRNAPRICORN,2],[:YLWAPRICORN,2],nil,nil,nil,nil, false],
[:HEALBALL,3,
[:PNKAPRICORN,2],[:WHTAPRICORN,2],nil,nil,nil,nil, false],
[:HEAVYBALL,3,
[:BLUAPRICORN,2],nil,nil,nil,nil,nil, false],
[:LEVELBALL,3,
[:BLKAPRICORN,2],[:REDAPRICORN,2],nil,nil,nil,nil, false],
[:LOVEBALL,3,
[:WHTAPRICORN,2],nil,nil,nil,nil,nil, false],
[:LUXURYBALL,3,
[:REDAPRICORN,2],[:WHTAPRICORN,2],nil,nil,nil,nil, false],
[:MOONBALL,3,
[:BLKAPRICORN,2],[:BLUAPRICORN,2],nil,nil,nil,nil, false],
[:NESTBALL,3,
[:GRNAPRICORN,2],[:YLWAPRICORN,2],nil,nil,nil,nil, false],
[:NETBALL,3,
[:BLKAPRICORN,2],[:BLUAPRICORN,2],nil,nil,nil,nil, false],
[:PREMIERBALL,3,
[:REDAPRICORN,2],[:WHTAPRICORN,2],nil,nil,nil,nil, false],
[:REPEATBALL,3,
[:REDAPRICORN,2],[:BLKAPRICORN,2],nil,nil,nil,nil, false],
[:TIMERBALL,3,
[:WHTAPRICORN,2],[:BLKAPRICORN,2],nil,nil,nil,nil, false]
]
###############################################################################
# This goes through the RECIPES array and adds the true or false value from it
# to the $game_variables[CRAFTVAR] array
for i in 0...RECIPES.length
$isUnlocked = RECIPES[8]
end
def setupCraftUnlocks
$game_variables[CRAFTVAR] = $isUnlocked
end
#From here onwards you DO NOT change anything.
class ItemCrafterScene
def initialize
@close = $exit
@select=3
@item=0
@mat, @cost = [], []
for i in 1..6
a=i+1
@mat=RECIPES[@item][a]? RECIPES[@item][a][0] : -1
@cost=RECIPES[@item][a]? RECIPES[@item][a][1] : 0 # the amount for first item
# end
# @mat1=RECIPES[@item][2]? RECIPES[@item][2][0] : -1 # the amount for first item
# @mat2=RECIPES[@item][3]? RECIPES[@item][3][0] : -1 # the amount for first item
# @mat3=RECIPES[@item][4]? RECIPES[@item][4][0] : -1 # the amount for first item
# @mat4=RECIPES[@item][5]? RECIPES[@item][5][0] : -1 # the amount for first item
# @mat5=RECIPES[@item][6]? RECIPES[@item][6][0] : -1 # the amount for first item
# @mat6=RECIPES[@item][7]? RECIPES[@item][7][0] : -1 # the amount for first item
# @cost1=RECIPES[@item][2]? RECIPES[@item][2][1] : 0 # the amount for first item
# @cost2=RECIPES[@item][3]? RECIPES[@item][3][1] : 0 # the amount for first item
# @cost3=RECIPES[@item][4]? RECIPES[@item][4][1] : 0 # the amount for first item
# @cost4=RECIPES[@item][5]? RECIPES[@item][5][1] : 0 # the amount for first item
# @cost5=RECIPES[@item][6]? RECIPES[@item][6][1] : 0 # the amount for first item
# @cost6=RECIPES[@item][7]? RECIPES[@item][7][1] : 0 # the amount for first item
@amount=RECIPES[@item][1] # the amount for the first item made
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=99999
@sprites={}
@sprites["bg"]=IconSprite.new(0,0,@viewport)
@sprites["bg"].setBitmap("Graphics/Pictures/ItemCrafter/BG")
@sprites["Item"]=IconSprite.new(0,0,@viewport)
@sprites["Item"].setBitmap("Graphics/Pictures/ItemCrafter/Item_BG")
@sprites["Item"].x=418
@sprites["Item"].y=9
@sprites["Item_Hov"]=IconSprite.new(0,0,@viewport)
@sprites["Item_Hov"].setBitmap("Graphics/Pictures/ItemCrafter/ItemHov_BG")
@sprites["Item_Hov"].x=418
@sprites["Item_Hov"].y=9
@sprites["Item_Hov"].opacity=0
@sprites["Item_icon"]=IconSprite.new(0,0,@viewport)
@sprites["Item_icon"].setBitmap(pbItemIconFile(getID(PBItems,RECIPES[@item][0])))
@sprites["Item_icon"].x=418+11
@sprites["Item_icon"].y=9+13
@sprites["Item_icon"].opacity=0
@sprites["unknown"]=IconSprite.new(0,0,@viewport)
@sprites["unknown"].setBitmap("Graphics/Pictures/ItemCrafter/unknown")
@sprites["unknown"].x=408
@sprites["unknown"].y=18
r=[1,2,3]
f=[1,3,5]
g=[2,4,6]
if (i == f)
@sprites["Item_{i}"]=IconSprite.new(0,0,@viewport)
@sprites["Item_{i}"].setBitmap("Graphics/Pictures/ItemCrafter/ItemR_BG")
@sprites["Item_{i}"].x=15
@sprites["Item_{i}"].y=109+((i-r)*75)
@sprites["Item_{i}_icon"]=IconSprite.new(0,0,@viewport)
@sprites["Item_{i}_icon"].setBitmap((((@mat).to_i) != -1) ? pbItemIconFile(getID(PBItems,((@mat).to_i))) : "")
@sprites["Item_{i}_icon"].x=15+11
@sprites["Item_{i}_icon"].y=109+13+((i-r)*75)
@sprites["Item_{i}_icon"].opacity=0
@sprites["Item_{i}_name"]=IconSprite.new(0,0,@viewport)
@sprites["Item_{i}_name"].setBitmap("Graphics/Pictures/ItemCrafter/Item_NameB")
@sprites["Item_{i}_name"].x=85
@sprites["Item_{i}_name"].y=134+((i-r)*75)
elsif (i == g)
@sprites["Item_{i}"]=IconSprite.new(0,0,@viewport)
@sprites["Item_{i}"].setBitmap("Graphics/Pictures/ItemCrafter/ItemR_BG")
@sprites["Item_{i}"].x=15+
@sprites["Item_{i}"].y=109+((i-(r+1))*75)
@sprites["Item_{i}_icon"]=IconSprite.new(0,0,@viewport)
@sprites["Item_{i}_icon"].setBitmap((((@mat).to_i) != -1) ? pbItemIconFile(getID(PBItems,((@mat).to_i))) : "")
@sprites["Item_{i}_icon"].x=15+11+412
@sprites["Item_{i}_icon"].y=109+13+((i-(r+1))*75)
@sprites["Item_{i}_icon"].opacity=0
end
end
# @sprites["Item_1"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_1"].setBitmap("Graphics/Pictures/ItemCrafter/ItemR_BG")
# @sprites["Item_1"].x=15
# @sprites["Item_1"].y=109
#
# @sprites["Item_1_icon"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_1_icon"].setBitmap((@mat1!=-1) ? pbItemIconFile(getID(PBItems,@mat1)) : "")
# @sprites["Item_1_icon"].x=15+11
# @sprites["Item_1_icon"].y=109+13
# @sprites["Item_1_icon"].opacity=0
#
## @sprites["Item_1_name"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_1_name"].setBitmap("Graphics/Pictures/ItemCrafter/Item_NameB")
# @sprites["Item_1_name"].x=85
# @sprites["Item_1_name"].y=134
#
# @sprites["Item_2"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_2"].setBitmap("Graphics/Pictures/ItemCrafter/ItemR_BG")
# @sprites["Item_2"].x=412+15
# @sprites["Item_2"].y=109
#
# @sprites["Item_2_icon"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_2_icon"].setBitmap((@mat2!=-1) ? pbItemIconFile(getID(PBItems,@mat2)) : "")
# @sprites["Item_2_icon"].x=412+15+11
# @sprites["Item_2_icon"].y=109+13
# @sprites["Item_2_icon"].opacity=0
#
# @sprites["Item_2_name"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_2_name"].setBitmap("Graphics/Pictures/ItemCrafter/Item_NameB")
# @sprites["Item_2_name"].x=85
# @sprites["Item_2_name"].y=134+75
# @sprites["Item_3"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_3"].setBitmap("Graphics/Pictures/ItemCrafter/ItemR_BG")
# @sprites["Item_3"].x=15
# @sprites["Item_3"].y=109+75
#
# @sprites["Item_3_icon"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_3_icon"].setBitmap((@mat3!=-1) ? pbItemIconFile(getID(PBItems,@mat3)) : "")
# @sprites["Item_3_icon"].x=15+11
# @sprites["Item_3_icon"].y=109+75+13
# @sprites["Item_3_icon"].opacity=0
# @sprites["Item_3_name"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_3_name"].setBitmap("Graphics/Pictures/ItemCrafter/Item_NameB")
# @sprites["Item_3_name"].x=85
# @sprites["Item_3_name"].y=134+(75*2)
#
# @sprites["Item_4"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_4"].setBitmap("Graphics/Pictures/ItemCrafter/ItemR_BG")
# @sprites["Item_4"].x=412+15
# @sprites["Item_4"].y=109+75
#
# @sprites["Item_4_icon"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_4_icon"].setBitmap((@mat4!=-1) ? pbItemIconFile(getID(PBItems,@mat4)) : "")
# @sprites["Item_4_icon"].x=412+15+11
# @sprites["Item_4_icon"].y=109+75+13
# @sprites["Item_4_icon"].opacity=0
# @sprites["Item_4_name"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_4_name"].setBitmap("Graphics/Pictures/ItemCrafter/Item_Name")
# @sprites["Item_4_name"].x=340
# @sprites["Item_4_name"].y=110
# @sprites["Item_5"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_5"].setBitmap("Graphics/Pictures/ItemCrafter/ItemR_BG")
# @sprites["Item_5"].x=15
# @sprites["Item_5"].y=109+(75*2)
# @sprites["Item_5_icon"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_5_icon"].setBitmap((@mat5!=-1) ? pbItemIconFile(getID(PBItems,@mat5)) : "")
# @sprites["Item_5_icon"].x=15+11
# @sprites["Item_5_icon"].y=109+(75*2)+13
# @sprites["Item_5_icon"].opacity=0
# @sprites["Item_5_name"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_5_name"].setBitmap("Graphics/Pictures/ItemCrafter/Item_Name")
# @sprites["Item_5_name"].x=340
# @sprites["Item_5_name"].y=140
# @sprites["Item_6"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_6"].setBitmap("Graphics/Pictures/ItemCrafter/ItemR_BG")
# @sprites["Item_6"].x=412+15
# @sprites["Item_6"].y=109+(75*2)
# @sprites["Item_6_icon"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_6_icon"].setBitmap((@mat6!=-1) ? pbItemIconFile(getID(PBItems,@mat6)) : "")
# @sprites["Item_6_icon"].x=412+15+11
# @sprites["Item_6_icon"].y=109+(75*2)+13
# @sprites["Item_6_icon"].opacity=0
# @sprites["Item_6_name"]=IconSprite.new(0,0,@viewport)
# @sprites["Item_6_name"].setBitmap("Graphics/Pictures/ItemCrafter/Item_Name")
# @sprites["Item_6_name"].x=340
# @sprites["Item_6_name"].y=170
@sprites["Confirm"]=IconSprite.new(0,0,@viewport)
@sprites["Confirm"].setBitmap("Graphics/Pictures/ItemCrafter/buttom")
@sprites["Confirm"].x=10
@sprites["Confirm"].y=332
@sprites["Confirm_Hov"]=IconSprite.new(0,0,@viewport)
@sprites["Confirm_Hov"].setBitmap("Graphics/Pictures/ItemCrafter/buttom_1")
@sprites["Confirm_Hov"].x=10
@sprites["Confirm_Hov"].y=332
@sprites["Confirm_Hov"].opacity=0
@sprites["Cancel"]=IconSprite.new(0,0,@viewport)
@sprites["Cancel"].setBitmap("Graphics/Pictures/ItemCrafter/buttom")
@sprites["Cancel"].x=332
@sprites["Cancel"].y=332
@sprites["Cancel_Hov"]=IconSprite.new(0,0,@viewport)
@sprites["Cancel_Hov"].setBitmap("Graphics/Pictures/ItemCrafter/buttom_1")
@sprites["Cancel_Hov"].x=332
@sprites["Cancel_Hov"].y=332
@sprites["overlay"]=BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
self.openItemCrafterscene
end
def openItemCrafterscene
self.CheckAbleToCraft
pbFadeInAndShow(@sprites) {self.text}
self.input
self.action
end
def closeItemCrafterscene
pbFadeOutAndHide(@sprites)
end
def input
case @select
when 1
@sprites["Confirm"].opacity=255
@sprites["Confirm_Hov"].opacity=0
@sprites["Cancel"].opacity=0
@sprites["Cancel_Hov"].opacity=255
@sprites["Item"].opacity=255
@sprites["Item_Hov"].opacity=0
when 2
@sprites["Confirm"].opacity=0
@sprites["Confirm_Hov"].opacity=255
@sprites["Cancel"].opacity=255
@sprites["Cancel_Hov"].opacity=0
@sprites["Item"].opacity=255
@sprites["Item_Hov"].opacity=0
when 3
@sprites["Confirm"].opacity=255
@sprites["Confirm_Hov"].opacity=0
@sprites["Cancel"].opacity=255
@sprites["Cancel_Hov"].opacity=0
@sprites["Item"].opacity=0
@sprites["Item_Hov"].opacity=255
@sprites["Item_icon"].setBitmap(pbItemIconFile(getID(PBItems,RECIPES[@item][0])))
for i in 1..6
if $game_variables[CRAFTVAR][@item]
@sprites["unknown"].opacity=0
@sprites["Item_icon"].opacity=255
# @sprites["Item_1_icon"].setBitmap(RECIPES[@item][2]? pbItemIconFile(getID(PBItems,RECIPES[@item][2][0])) : "") # Vendily
# @sprites["Item_2_icon"].setBitmap(RECIPES[@item][3]? pbItemIconFile(getID(PBItems,RECIPES[@item][3][0])) : "") # Vendily
# @sprites["Item_3_icon"].setBitmap(RECIPES[@item][4]? pbItemIconFile(getID(PBItems,RECIPES[@item][4][0])) : "") # Vendily
# @sprites["Item_4_icon"].setBitmap(RECIPES[@item][5]? pbItemIconFile(getID(PBItems,RECIPES[@item][5][0])) : "") # Vendily
# @sprites["Item_5_icon"].setBitmap(RECIPES[@item][6]? pbItemIconFile(getID(PBItems,RECIPES[@item][6][0])) : "") # Vendily
# @sprites["Item_6_icon"].setBitmap(RECIPES[@item][7]? pbItemIconFile(getID(PBItems,RECIPES[@item][7][0])) : "") # Vendily
# @sprites["Item_1_icon"].opacity= RECIPES[@item][2] ? 255 : 0
# @sprites["Item_2_icon"].opacity=RECIPES[@item][3] ? 255 : 0
# @sprites["Item_3_icon"].opacity= RECIPES[@item][4] ? 255 : 0
# @sprites["Item_4_icon"].opacity=RECIPES[@item][5] ? 255 : 0
# @sprites["Item_5_icon"].opacity= RECIPES[@item][6] ? 255 : 0
# @sprites["Item_6_icon"].opacity=RECIPES[@item][7] ? 255 : 0
@sprites["Item_{i}_icon"].setBitmap(RECIPES[@item][i+1]? pbItemIconFile(getID(PBItems,RECIPES[@item][i+1][0])) : "") # Vendily
@sprites["Item_{i}_icon"].opacity= RECIPES[@item][i+1] ? 255 : 0
@mat=RECIPES[@item][i+1]? RECIPES[@item][i+1][0] : -1
@cost=RECIPES[@item][i+1]? RECIPES[@item][i+1][1] : 0
# @mat1=RECIPES[@item][2]? RECIPES[@item][2][0] : -1
# @mat2=RECIPES[@item][3]? RECIPES[@item][3][0] : -1
# @mat3=RECIPES[@item][4]? RECIPES[@item][4][0] : -1
# @mat4=RECIPES[@item][5]? RECIPES[@item][5][0] : -1
# @mat5=RECIPES[@item][6]? RECIPES[@item][6][0] : -1
# @mat6=RECIPES[@item][7]? RECIPES[@item][7][0] : -1
# @cost1=RECIPES[@item][2]? RECIPES[@item][2][1] : 0
# @cost2=RECIPES[@item][3]? RECIPES[@item][3][1] : 0
# @cost3=RECIPES[@item][4]? RECIPES[@item][4][1] : 0
# @cost4=RECIPES[@item][5]? RECIPES[@item][5][1] : 0
# @cost5=RECIPES[@item][6]? RECIPES[@item][6][1] : 0
# @cost6=RECIPES[@item][7]? RECIPES[@item][7][1] : 0
@amount=RECIPES[@item][1]
else
@sprites["unknown"].opacity=255
@sprites["Item_icon"].opacity=0
@sprites["Item_{i}_icon"].opacity=0
# @sprites["Item_1_icon"].opacity=0
# @sprites["Item_2_icon"].opacity=0
# @sprites["Item_3_icon"].opacity=0
# @sprites["Item_4_icon"].opacity=0
# @sprites["Item_5_icon"].opacity=0
# @sprites["Item_6_icon"].opacity=0
end
end
self.text
# When pressing Right
if Input.trigger?(Input::RIGHT) && @item < RECIPES.length-1
@item+=1
elsif Input.trigger?(Input::RIGHT) && @item ==RECIPES.length-1 # Make it run though the selection after last item.
@item = 0
end
if Input.trigger?(Input::LEFT) && @item >0
@item-=1
elsif Input.trigger?(Input::LEFT) && @item ==0 # Make it run though the selection after first item.
@item = RECIPES.length-1
end
end
# When pressing Left.
if Input.trigger?(Input::UP) && @select <3
@select+=1
end
if Input.trigger?(Input::DOWN) && @select >2
@select-=1
end
if Input.trigger?(Input::RIGHT) && @select==2
@select-=1
end
if Input.trigger?(Input::LEFT) && @select==1
@select+=1
end
if Input.trigger?(Input::C)
case @select
when 2
for i in 1..6
if $game_variables[CRAFTVAR][@item]
if (((@mat).to_i)!=-1 && $PokemonBag.pbQuantity((@mat).to_i))<(((@cost).to_i))
# if $PokemonBag.pbQuantity(@mat1)<@cost1 || (@mat2!=-1 && $PokemonBag.pbQuantity(@mat2) <@cost2) || #Seth Edited
# (@mat3!=-1 && $PokemonBag.pbQuantity(@mat3) <@cost3) || (@mat4!=-1 && $PokemonBag.pbQuantity(@mat4) <@cost4) ||
# (@mat5!=-1 && $PokemonBag.pbQuantity(@mat5) <@cost5) || (@mat6!=-1 && $PokemonBag.pbQuantity(@mat6) <@cost6)
Kernel.pbMessage(_INTL("No puedes crear el objeto, no tienes los materiales necesarios."))
else
$PokemonBag.pbStoreItem(RECIPES[@item][0],@amount)
if ((@mat).to_i)!=-1
$PokemonBag.pbDeleteItem(((@mat).to_i),((@cost).to_i))
end
# else
# $PokemonBag.pbStoreItem(RECIPES[@item][0],@amount)
# $PokemonBag.pbDeleteItem(@mat1,@cost1)
# if @mat2!=-1
# $PokemonBag.pbDeleteItem(@mat2,@cost2)
# end
# if @mat3!=-1
# $PokemonBag.pbDeleteItem(@mat3,@cost3)
# end
# if @mat4!=-1
# $PokemonBag.pbDeleteItem(@mat4,@cost4)
# end
# if @mat5!=-1
# $PokemonBag.pbDeleteItem(@mat5,@cost5)
# end
# if @mat6!=-1
# $PokemonBag.pbDeleteItem(@mat6,@cost6)
# end
self.text
Kernel.pbMessage(_INTL("{1} {2} fueron creadas", @amount, PBItems.getName(getID(PBItems,RECIPES[@item][0]))))
end
else
Kernel.pbMessage(_INTL("No conoces esta receta."))
end
end
when 1
@close=@select
self.closeItemCrafterscene
end
end
if Input.trigger?(Input::B)
@close=@select
self.closeItemCrafterscene
end
end
def action
while @close==0
Graphics.update
Input.update
self.input
end
end
def text
overlay= @sprites["overlay"].bitmap
overlay.clear
baseColor=Color.new(255, 255, 255)
shadowColor=Color.new(0,0,0)
pbSetSystemFont(@sprites["overlay"].bitmap)
textos=[]
@mat, @cost, @text, @cant= [], [], [], []
for i in 1..6
if $game_variables[CRAFTVAR][@item]
if i==1
@text=_INTL("{1}", PBItems.getName(getID(PBItems,(@mat).to_i)))
@cant=_INTL("{1}/{2}", ($PokemonBag.pbQuantity((@mat).to_i)),((@cost).to_i))
elsif i!=1 && ((@mat).to_i)==-1
@text=_INTL("")
@cant=_INTL("")
else
@text=_INTL("{1}", PBItems.getName(getID(PBItems,(@mat).to_i)))
@cant=_INTL("{1}/{2}", ($PokemonBag.pbQuantity((@mat).to_i)),((@cost).to_i))
end
# @text1=_INTL("{1}", PBItems.getName(getID(PBItems,@mat1)))
# @cant1=_INTL("{1}/{2}", $PokemonBag.pbQuantity(@mat1),@cost1)
# if @mat2==-1
# @text2=_INTL("")
# @cant2=_INTL("")
# else
# @text2=_INTL("{1}", PBItems.getName(getID(PBItems,@mat2)))
# @cant2=_INTL("{1}/{2}", $PokemonBag.pbQuantity(@mat2),@cost2)
# end
# if @mat3==-1
# @text3=_INTL("")
# @cant3=_INTL("")
# else
# @text3=_INTL("{1}", PBItems.getName(getID(PBItems,@mat3)))
# @cant3=_INTL("{1}/{2}", $PokemonBag.pbQuantity(@mat3),@cost3)
# end
# if @mat4==-1
# @text4=_INTL("")
# @cant4=_INTL("")
# else
# @text4=_INTL("{1}", PBItems.getName(getID(PBItems,@mat4)))
# @cant4=_INTL("{1}/{2}", $PokemonBag.pbQuantity(@mat4),@cost4)
# end
# if @mat5==-1
# @text5=_INTL("")
# @cant5=_INTL("")
# else
# @text5=_INTL("{1}", PBItems.getName(getID(PBItems,@mat5)))
# @cant5=_INTL("{1}/{2}", $PokemonBag.pbQuantity(@mat5),@cost5)
# end
# if @mat6==-1
# @text6=_INTL("")
# @cant6=_INTL("")
# else
# @text6=_INTL("{1}", PBItems.getName(getID(PBItems,@mat6)))
# @cant6=_INTL("{1}/{2}", $PokemonBag.pbQuantity(@mat6),@cost6)
# end
else
@text=_INTL("UNKOWN")
@cant=_INTL("?")
# @text1=_INTL("UNKOWN")
# @text2=_INTL("UNKOWN")
# @text3=_INTL("UNKOWN")
# @text4=_INTL("UNKOWN")
# @text5=_INTL("UNKOWN")
# @text6=_INTL("UNKOWN")
# @cant1=_INTL("?")
# @cant2=_INTL("?")
# @cant3=_INTL("?")
# @cant4=_INTL("?")
# @cant5=_INTL("?")
# @cant6=_INTL("?")
end
@text7=_INTL("{1} / {2}", @item + 1, RECIPES.length)
@text8=_INTL("{1}x", @amount, RECIPES.length)
#pbSetSmallFont(overlay)
# textos.push([@text1,15+74,109+34,false,baseColor,shadowColor])
# textos.push([@text2,412-100,109+34,false,baseColor,shadowColor])
# textos.push([@text3,15,109+75+34,false,baseColor,shadowColor])
# textos.push([@text4,412,109+75+34,false,baseColor,shadowColor])
# textos.push([@text5,15,109+(75*2)+34,false,baseColor,shadowColor])
# textos.push([@text6,412,109+(75*2)+34,false,baseColor,shadowColor])
# textos.push([@cant1,15+74,109+14,false,baseColor,shadowColor])
# textos.push([@cant2,412-100,109+14,false,baseColor,shadowColor])
# textos.push([@cant3,15,109+75+14,false,baseColor,shadowColor])
# textos.push([@cant4,412,109+75+14,false,baseColor,shadowColor])
# textos.push([@cant5,15,109+(75*2)+14,false,baseColor,shadowColor])
# textos.push([@cant6,412,109+(75*2)+14,false,baseColor,shadowColor])
colorD=Color.new(245,105,105)
colorS=Color.new(74,24,24)
if (($PokemonBag.pbQuantity((@mat).to_i))>=((@cost).to_i))
colorD=Color.new(105,245,165)
colorS=Color.new(24,74,44)
end
r=[1,2,3]
f=[1,3,5]
g=[2,4,6]
if (i==f)
ingre1 = sprintf("%s\n%s",@cant,@text)
elsif (i==g)
ingre2 = sprintf("<ar>%s\n%s</ar>",@cant,@text)
end
drawFormattedTextEx(overlay,15+74,109+34+((i-r)*75),200,ingre1,colorD,colorS)
drawFormattedTextEx(overlay,412-200,109+34+((i-r)*75),200,ingre2,colorD,colorS)
textos.push([@text7,75,30,false,baseColor,shadowColor])
textos.push([@text8,392,30,false,baseColor,shadowColor])
textos.push(["Fabricar",46,344,false,baseColor,shadowColor])
textos.push(["Cancelar",410,344,false,baseColor,shadowColor])
pbDrawTextPositions(overlay,textos)
end
end
def CheckAbleToCraft
# for i in 1..6
if $game_variables[CRAFTVAR][0]
@sprites["Item_icon"].opacity=255
# if i == 1
# @sprites["Item_{i}_icon"].opacity=255
# end
@sprites["unknown"].opacity=0
else
@sprites["Item_icon"].opacity=0
# if i == 1
# @sprites["Item_{i}_icon"].opacity=0
# end
@sprites["unknown"].opacity=255
end
# end
end
end