Danke fürs drüber schaun.
Ganz unten, letzte def:
Code:
class Scene_waffen
def main
@actor= $game_party.actors[0]
$data_weapons[@actor.weapon_id]
@data= []
@icon_name = []
@name= []
@description=[]
get_equip
@status = Window_status_ausrüstung.new(@actor)
# @status.active=false
@command_window = Window_Ring_Command.new(1,$game_player.screen_x-30, $game_player.screen_y-50, @icon_name, 60)
@beschreibung_window = Window_beschreibung.new(@name,@description)
@beschreibung_window.z = 400
@spriteset = Spriteset_Map.new
# Main loop
Graphics.transition
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
Graphics.freeze
# Dispose of command window
@command_window.dispose
@beschreibung_window.dispose
@spriteset.dispose
@status.dispose
end
def update
@command_window.update
@beschreibung_window.update
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
ausrüsten(0)
if Input.repeat?(Input:: LEFT )
@command_window.move_left
$game_system.se_play($data_system.cursor_se)
unless @command_window.index == 0
equip
end
end
if @command_window.index == 0
@status.set_new_parameters(nil, nil, nil)
end
if Input.repeat?(Input::RIGHT)
@command_window.move_right
$game_system.se_play($data_system.cursor_se)
unless @command_window.index == 0
equip
end
end
if Input.trigger? (Input::UP)
$scene = Scene_ausrüstung_body.new
end
if Input.trigger? (Input::DOWN)
$scene = Scene_Menu.new
end
# case Input.dir4
# when 4 then @command_window.move_left
# $game_system.se_play($data_system.cancel_se)
# when 6 then @command_window.move_right
# $game_system.se_play($data_system.cancel_se)
#end
#@index = 0
#while @command_window.index != @index and @command_window.index !=0
# @index= @command_window.index
end
def equip
item1=@data[0]
item2 = @data[@command_window.index]
@actor.equip(0, @data[@command_window.index].id)
# Get parameters for after equipment change
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
# Return equipment
if @data[0] == "nix"
@actor.equip(2,0)
else
@actor.equip(2,item1.id)
end
# Draw in left window
@status.set_new_parameters(new_atk, new_pdef, new_mdef)
#@item1=$data_weapons[@actor.weapon_id]
#
#@actor.equip(0, @data[@command_window.index].id)
# end
end
def update_icons
@data.clear
@icon_name.clear
@name.clear
@description.clear
get_equip
@command_window.update_icons(@icon_name)
end
def get_equip
if $data_weapons[@actor.weapon_id] == nil
@data.push("nix")
@icon_name.push("nix")
@name.push("")
@description.push("")
else
@data.push($data_weapons[@actor.weapon_id])
@icon_name.push($data_weapons[@actor.weapon_id].icon_name)
@name.push($data_weapons[@actor.weapon_id].name)
@description.push($data_weapons[@actor.weapon_id].description)
end
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 and weapon_set.include?(i) and $data_weapons[i] != $data_weapons[@actor.weapon_id]
@data.push($data_weapons[i])
@icon_name.push($data_weapons[i].icon_name)
@name.push($data_weapons[i].name)
@description.push($data_weapons[i].description)
end
end
end
def ausrüsten(type)
if Input.trigger?(Input::C)
$MSS.change_weapon(1)
$game_system.se_play($data_system.equip_se)
@actor.equip(type, @data[@command_window.index].id)
update_icons
@status.refresh
end
end
end
Im Endeffekt möchte ich abhängig von der ausgerüsteten Waffe $MSS.change_weapon(ausgerüstete Waffe) aufrufen.
Ginge also auch über ein Common Event, nicht nur über dieses Menü.