######## Module #######
module Kombos
Rezepte = {
"Pike Pole" => [[4,5],[3]],
"Sword" => [[11,12],[10]],
"Grappling Hook" => [[4,24],[23]],
"Fishing Rod" => [[7,8,9],[6]],
"Letter" => [[17,18,19],[19,16]],
"Billard Cue" => [[5,12,26],[25]],
"Poisoned Wine" => [[14,15],[13]]
}
end
######## Windows #######
class Quest_Items < Window_ItemList
def initialize
super(0, 0, Graphics.width, 250)
self.category = :weapon
end
def draw_item(index)
item = @data[index]
if item
rect = item_rect(index)
rect.width -= 4
draw_item_name(item, rect.x, rect.y, true)
end
end
def current_item_enabled?
true
end
end
class Item_Kommandos < Window_HorzCommand
def initialize
super(0,320)
self.x = (Graphics.width/2) - (500/2)
end
def window_width
return 500
end
def make_command_list
add_command("Examine", :examine)
add_command("Equip", :equip)
add_command("Combine", :combine)
add_command("Separate", :separate)
end
end
######## Scenes ###########
class Scene_Adventure < Scene_Base
def start
super
create_background
createhelpwindow
createlistwindow
end
def create_background
@background_sprite = Sprite.new
@background_sprite.bitmap = SceneManager.background_bitmap
@background_sprite.color.set(16, 16, 16, 128)
end
def dispose_background
@background_sprite.dispose
end
def createhelpwindow
@itemdescription = Window_Help.new(3)
@itemdescription.y = 250
end
def createlistwindow
@listwindow = Quest_Items.new
@listwindow.viewport = @viewport
@listwindow.help_window = @itemdescription
@listwindow.set_handler(:ok, method(:on_ok))
@listwindow.set_handler(:cancel, method(:return))
@listwindow.activate
@listwindow.select(0)
end
def createkommandoswindow
@kommandowindow = Item_Kommandos.new
@kommandowindow.viewport = @viewport
@kommandowindow.set_handler(:ok, method(:on_ok2))
@kommandowindow.set_handler(:cancel, method(:return2))
@kommandowindow.set_handler(:examine, method(:on_examine))
@kommandowindow.set_handler(:equip, method(:on_equip))
@kommandowindow.set_handler(:combine, method(:on_combine))
@kommandowindow.set_handler(:separate, method(:on_separate))
@kommandowindow.activate
@kommandowindow.select(0)
end
def on_ok
@listwindow.deactivate
createkommandoswindow
end
def return
dispose_background
SceneManager.return
end
def on_ok2
@kommandowindow.activate
end
def on_examine
@kommandowindow.activate
end
def on_equip
Sound.play_equip
@actor = $game_actors[1]
@actor.change_equip(0, @listwindow.item)
@listwindow.unselect
@listwindow.refresh
@kommandowindow.close
@listwindow.activate
end
def on_combine
@kommandowindow.activate
end
def on_separate
item = @listwindow.item
for key in Kombos::Rezepte.keys
if item.id == Kombos::Rezepte[key][1][0]
for gefunden in Kombos::Rezepte[key][0]
$game_party.gain_item($data_weapons[gefunden], 1)
end
RPG::SE.new("Equip1", 80, 100).play
$game_party.lose_item($data_weapons[item.id], 1)
@listwindow.unselect
@listwindow.refresh
@kommandowindow.close
@listwindow.activate
else
@kommandowindow.close
@listwindow.activate
end
end
end
def return2
@kommandowindow.close
@listwindow.activate
end
end