Jump to content
Rpg²S Forum

Spike92

Utenti
  • Posts

    63
  • Joined

  • Last visited

Posts posted by Spike92

  1. Beh cosa dire un progetto veramente carino.

    Come prima cosa non mi piace il titolo del gioco e ti consiglierei di cambiarlo ;)

    Da ammirare lo sforzo per l'enorme quantità di grafica fatta da 0.

    Bello lo stile cartoon anche se dopo aver visto lo screen c'è un particolare piccolo che non mi piace. Renderei l'acqua un pò più cartoon altrimenti a lungo andare potrebbe stonare parecchio con il resto ;)

    Cmq forza e speriamo di vedere un gioco diverso da quelli creati fin'ora!!!!

     

     

    PS Ma Shadow Battle che fine fa?

  2. Radio Program *Deluxe*

    Descrizione

    Ecco un simpatico script per sentire la radio

    Autore

    GoldenShadow

    Allegati

    Screen: 1

    Istruzioni per l'uso

    Create una nuova classe sopra il main e incollate al suo interno questo:


    <div style="margin:20px;margin-top:5px" "="">

    Spoiler


    #================================================
    # <> Radio Program *Deluxe*
    # ==> You can delete all the comments except the copyright and creator info. Thanks.
    # ==> Do not rip, repost or any other way of reproducing without proper credit. Thanks.
    # ==> What? Those names of radio networks? They're just testings.
    # ShadowClan Technologies © 2003-2005 - All rights reserved. X-RPG/RMXP rules :-)
    #-----------------------------------------------------------------------------------------------
    #
    # * BEFORE YOU THINK OF USING THIS SCRIPT ==> READ THIS FIRST!!!!!!!!!
    # This is NO internet radio like Window Media Player's radio. That would beat all :-P
    # No, this is, just like you are making a FAKE story, a FAKE radio program.
    # You cannot hear the channels LIVE or even search REAL channels.
    # !! THIS IS JUST A SCRIPT !!
    # Why do I tell this? There are smart-asses around here that just don't get it.
    # ONE MORE THING:
    # When using this, in the scene before the Radio, you MUST use
    # $game_system.bgm_memorize before calling the Scene_Radio.new
    # OR ELSE YOU WON'T HEAR YOUR BGM OF THE PREVIOUS SCENE!!!
    # So when you exit radio, your bgm of the previous scene will be restored.
    # Thanks for readin'. Ciao~
    #
    # * Can I make my own channels?
    # Yes. Scroll down to the 'def search' and
    # put in another 'elsif hz == (your hertz nr)' and
    # define your channel like in the examples.
    # That should play it when searching.
    #
    # * How to search channels on my radio?
    # Hold your LEFT or RIGHT button pressed and the little pointer
    # goes from one end to another. While you search, just
    # see if the channel name appears in the window next to it.
    #
    # * It looks so empty! Just two windows?
    # Well, you're allowed to fill it up, there is nothing against that you know.
    # You may even change the colors used by the radio display.
    # As long as people know I made it. Don't be ripping my stuff okay?
    #
    # * Something added:
    # - You can see the map instead of a black screen. It also updates the events
    # like when using events that walk, that they also keep walking.
    # Screen update is also needed when used with tinting or flashing.
    #
    # That would end the little explaining for now. I -really- hope you like this script.
    #----------------------------------------------------------------------------------------------
    # * Suggestions? ==> Post a message on the RPGXP catagory in the Radio Program topic
    # * Created by: GoldenShadow a.k.a ????
    # * Credits: Use of names :-P => X-RPG, RMXP.net, Dubealex, Ryughen, Torama, Vash and Deke
    # * Bugs: Actually none... try and find one huh, I double dare ya!
    #=====================================================
    
    
    module SC
    RXSC_RADI = "Radio Program: Version 1 DX"
    end
    
    class Radio
    
    def play(channel) # Plays a song as if its a channel
    if channel == "none"
    $chan_name = "No radio channel"
    else
    Audio.bgm_play("Audio/BGM/" + channel, 100, 100)
    end
    end
    
    def search(hz) # identifies the channels + plays assigned songs
    if hz == 1
    $chan_name = "X-RPG Radio Network" # Name of channel
    Audio.bgm_stop # Stops any active music
    play("001-Battle01") # Plays channel file
    elsif hz == 5
    $chan_name = "RMXP.net Radio Network"
    Audio.bgm_stop
    play("002-Battle02")
    elsif hz == 10
    $chan_name = "Dubealex Radio Network"
    Audio.bgm_stop
    play("003-Battle03")
    elsif hz == 15
    $chan_name = "Ryughen Radio Network"
    Audio.bgm_stop
    play("004-Battle04")
    elsif hz == 20
    $chan_name = "Deke's Radio Network"
    Audio.bgm_stop
    play("005-Boss01")
    elsif hz == 25
    $chan_name = "Torama's Radio Network"
    Audio.bgm_stop
    play("006-Boss02")
    elsif hz == 30
    $chan_name = "Vash's Radio Network"
    Audio.bgm_stop
    play("007-Boss03")
    elsif hz == 101
    $chan_name = "ShadowClan 101 FM"
    Audio.bgm_stop
    play("009-LastBoss01")
    # elsif hz == (your Hertz number)
    # $chan_name = "Your channel name"
    # Audio.bgm_stop
    # play("Your file in the BGM directory to play")
    else
    Audio.bgm_stop
    play("none")
    end
    end
    end
    
    class Window_RadioScreen < Window_Base
    
    def initialize
    super(0, 0, 320, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    refresh
    end
    
    def refresh
    self.contents.clear
    rect1 = Rect.new(0, 0, 304, 64)
    rect2 = Rect.new(0, 16, 304, 1)
    rect3 = Rect.new($x, 8, 1, 16)
    self.contents.fill_rect(rect1, Color.new(0, 0, 0))
    self.contents.fill_rect(rect2, Color.new(255, 0, 0))
    self.contents.fill_rect(rect3, Color.new(0, 0, 255))
    self.contents.draw_text(0, 0, self.width - 40, 32, $x.to_s + " FM", 1)
    end
    end
    
    class Window_RadioName < Window_Base
    
    def initialize
    super(320, 0, 320, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    refresh
    end
    
    def refresh
    self.contents.clear
    if $chan_name != nil
    self.contents.draw_text(0, 0, self.width - 40, 32, $chan_name, 1)
    else
    self.contents.draw_text(0, 0, self.width - 40, 32, "No radio channel", 1)
    end
    end
    end
    
    class Scene_Radio
    
    def main
    $x = 0
    @sprite = Spriteset_Map.new
    @radio_window = Window_RadioScreen.new
    @name_window = Window_RadioName.new
    Graphics.transition
    loop do
    Graphics.update
    Input.update
    update
    if $scene != self
    break
    end
    end
    Graphics.freeze
    @radio_window.dispose
    @name_window.dispose
    @sprite.dispose
    end
    
    def update
    $game_map.update
    $game_system.map_interpreter.update
    # if you want to be able to move while you search,
    # remove the '#' sign before $game_player.update
    # When doing that, change stuff marked with ##^
    #$game_player.update
    $game_system.update
    $game_screen.update
    @sprite.update
    if Input.repeat?(Input::RIGHT) ##^ (This would be changed to R instead of RIGHT)
    if $x == 287
    $x = 0
    else
    $x += 1
    end
    $radio.search($x)
    end
    if Input.repeat?(Input::LEFT) ##^ (This would be changed to L instead of Left)
    if $x < 1
    $x = 287
    else
    $x -= 1
    end
    $radio.search($x)
    end
    if Input.trigger?(Input::B)
    #$scene = Scene_Map.new
    $game_system.bgm_restore
    end
    @radio_window.refresh
    @radio_window.update
    @name_window.refresh
    @name_window.update
    end
    end
    
    class Scene_Title
    alias ra_title_command_new_game command_new_game
    def command_new_game
    ra_title_command_new_game
    $radio = Radio.new
    end
    end
    
    class Scene_Save
    
    def write_save_data(file)
    characters = []
    for i in 0...$game_party.actors.size
    actor = $game_party.actors[i]
    characters.push([actor.character_name, actor.character_hue])
    end
    Marshal.dump(characters, file)
    Marshal.dump(Graphics.frame_count, file)
    $game_system.save_count += 1
    $game_system.magic_number = $data_system.magic_number
    Marshal.dump($game_system, file)
    Marshal.dump($game_switches, file)
    Marshal.dump($game_variables, file)
    Marshal.dump($game_self_switches, file)
    Marshal.dump($game_screen, file)
    Marshal.dump($game_actors, file)
    Marshal.dump($game_party, file)
    Marshal.dump($game_troop, file)
    Marshal.dump($game_map, file)
    Marshal.dump($game_player, file)
    Marshal.dump($radio, file)
    end
    end
    
    class Scene_Load
    def read_save_data(file)
    characters = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    $game_system = Marshal.load(file)
    $game_switches = Marshal.load(file)
    $game_variables = Marshal.load(file)
    $game_self_switches = Marshal.load(file)
    $game_screen = Marshal.load(file)
    $game_actors = Marshal.load(file)
    $game_party = Marshal.load(file)
    $game_troop = Marshal.load(file)
    $game_map = Marshal.load(file)
    $game_player = Marshal.load(file)
    $radio = Marshal.load(file)
    if $game_system.magic_number != $data_system.magic_number
    $game_map.setup($game_map.map_id)
    $game_player.center($game_player.x, $game_player.y)
    end
    $game_party.refresh
    end
    end
    
    #=====================================================
    # FINAL UPDATE: 17:44, May 20th 2005 [Please leave this unchanged and undeleted] (SID:002) 

     

    Potete inserire altre stazioni, così:

    Scroll down to the 'def search' and put in another 'elsif hz == (your hertz nr)' and define your channel like in the examples. That should play it when searching.

    Per chiamare lo script, per esempio quando si preme "Azione" su un evento radio, si fa Chiama Script e si mette:

    $scene = Scene_Radio.new
  3. CMS Menu

    Descrizione

    Eccovi un nuovo menù personalizzato creato da Krazplay e segnalatomi dal mitico Ally. :rulezza:

     

    Autore

    Krazplay

     

    Screen:
    http://imageshack.us/scaled/landing/488/menu9zs1ep.png


     

    Script:

    Create una nuova classe sopra main ed inserite questo codice:

     

     

    class Window_Base < Window
        #---------------------------------
        # By Krazplay
        #---------------------------------
        def draw_actor_battler(actor, x, y)
            bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
            cw = bitmap.width
            ch = bitmap.height
            src_rect = Rect.new(0, 0, cw, ch)
            self.contents.blt(x - cw/2, y - ch/2, bitmap, src_rect)
        end
    
    
        #---------------------------------
        # Def Draw line
        #---------------------------------
        def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
            # ???????????????????
            distance = (start_x - end_x).abs + (start_y - end_y).abs
            # ????
            if end_color == start_color
                for i in 1..distance
                    x = (start_x + 1.0 * (end_x - start_x) * i/distance).to_i
                    y = (start_y + 1.0 * (end_y - start_y) * i/distance).to_i
                    if width == 1
                        self.contents.set_pixel(x, y, start_color)
                    else
                        self.contents.fill_rect(x, y, width, width, start_color)
                    end
                end
            else
                for i in 1..distance
                    x = (start_x + 1.0 * (end_x - start_x) * I/distance).to_i
                    y = (start_y + 1.0 * (end_y - start_y) * I/distance).to_i
                    r = start_color.red * (distance-i)/distance + end_color.red * i/distance
                    g = start_color.green * (distance-i)/distance + end_color.green * i/distance
                    b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
                    a = start_color.alpha has * (distance-i)/distance + end_color.alpha * i/distance
                    if width == 1
                        self.contents.set_pixel(x, y, Color.new(r, g, b, a))
                    else
                        self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
                    end
                end
            end
        end
    
    
        #---------------------------------
        # Def Draw polygon (to make contours of the faces)
        #---------------------------------
        def draw_polygon(peaks, color, width = 1)
            # ?(=??)??????????
            for i in 0... (peaks.size - 1)
                # ?????????
                draw_line(peaks[i][0 ], peaks[i][1 ], peaks[i+1][0 ], peaks[i+1][1 ], color, width)
            end
            # ??????????????
            draw_line(peaks[peaks.size - 1][0 ], peaks[peaks.size - 1][1 ], peaks[0][0 ], peaks[0][1 ], color, width)
        end
    
    
        #---------------------------------
        # def Draw face (faces to be strictly accurate ^^)
        #---------------------------------
        def draw_facesquare(character_name, character_hue, x, y, size = 24)
            bitmap = RPG::Cache.character(character_name, character_hue)
            src_rect = Rect.new((bitmap.width/4 - size)/2, 0, size, size)
            self.contents.blt(x, y, bitmap, src_rect)
            self.draw_polygon([[x, y], [x+size, y], [x+size, y+size], [x, y+size ] ], Color.new(255,255,255,128))
        end
    end
    

     

     

     

    Poi create un'altra classe sopra main, chiamatela Bars here e incollateci questo:

     

     

    # HP/SP/EXPƒQ?[ƒW•\' ¦ƒXƒNƒ¦ƒvƒg Worm 1.00
    # "z•z¼³?EƒTƒ|?[ƒgURL
    # http://members.jcom.home.ne.jp/cogwheel/
    
    #==============================================================================
    #? ¡ Game_Actor
    #------------------------------------------------------------------------------
    #?@ƒAƒNƒ^?[' ðˆµ' ¤ƒNƒ‰ƒX' Å'·?B' ±' ̃Nƒ‰ƒX' Í Game_Actors ƒNƒ‰ƒX ($$game_actors)
    # ' Ì"à•"' Å' G -- p' ³' ê?AGame_Party ƒNƒ‰ƒX ($$game_party) ' ©' ç' à' Q?Æ' ³' ê' Ü'·?B
    #==============================================================================
    
    class Game_Actor < Game_Battler
        def now_exp
            return @exp - @exp_list[@level ]
        end
        def next_exp
            return @exp_list[@level+1 ] > 0? @exp_list[@level+1 ] - @exp_list[@level ]: 0
        end
    end
    
    #==============================================================================
    #? ¡ Window_Base
    #------------------------------------------------------------------------------
    #?@ƒQ?[ƒ¤' †' Ì'·' ×' Ä' ̃EƒBƒ"ƒhƒE' ̃X?[ƒp?[ƒNƒ‰ƒX' Å'·?B
    #==============================================================================
    
    class Window_Base < Window
        #--------------------------------------------------------------------------
        #? ½ hp ƒQ?[ƒW' Ì•`‰æ
        #--------------------------------------------------------------------------
        # ƒIƒ¦ƒWƒiƒ‹' ÌHP•`‰æ' ð draw_actor_hp_original ' Æ-¼' O•Ï?x
        alias:draw_actor_hp_original:draw_actor_hp
        def draw_actor_hp(actor, x, y, width = 144)
            # •Ï?"rate' 3rd ¼"?Ý' ÌHP/MHP' ð' ã"ü
            if actor.maxhp != 0
                miss = actor.hp.to_f/actor.maxhp
            else
                miss = 0
            end
            # plus_x:x?À•W' ̈Ê' u•â?³ rate_x:x?À•W' ̈Ê' u•â?³(%) plus_y:y?À•W' ̈Ê' u•â?³
            # plus_width:•?' Ì•â?³ rate_width:•?' Ì•â?³(%) height:?c•?
            # align1:•`‰æƒ^ƒCƒv1 0:?¶‹l' ss 1:' †‰›' µ' ¦ 2:‰E‹l' ss
            # align2:•`‰æƒ^ƒCƒv2 0:?ã‹l' ss 1:' †‰›' µ' ¦ 2:‰º‹l' ss
            # align3:ƒQ?[ƒWƒ^ƒCƒv 0:?¶‹l' ss 1:‰E‹l' ss
            plus_x = 0
            rate_x = 0
            plus_y = 25
            plus_width = 0
            rate_width = 100
            height = 10
            align1 = 1
            align2 = 2
            align3 = 0
            # ƒOƒ‰ƒf?[ƒVƒ‡ƒ"?Ý' 2nd grade1:‹óƒQ?[ƒW grade2:' ÀƒQ?[ƒW
            # (0:‰¡' ɃOƒ‰ƒf?[ƒVƒ‡ƒ "1:?c' ɃOƒ‰ƒf?[ƒVƒ‡ƒ" 2:' Î' ss' ɃOƒ‰ƒf?[ƒVƒ‡ƒ"(¼ƒ?d)?j
            grade1 = 1
            grade2 = 0
            #?F?Ý' è?Bcolor1:¦O˜g?Ccolor2:' †˜g
            # color3:‹óƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor4:‹óƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[
            # color5:' ÀƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor6:' ÀƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[
            color1 = Color.new(0, 0, 0, 192)
            color2 = Color.new(255, 255, 192, 192)
            color3 = Color.new(0, 0, 0, 192)
            color4 = Color.new(64, 0, 0, 192)
            color5 = Color.new(80 - 24 * miss, 80 * miss, 14 * miss, 192)
            color6 = Color.new(240 - 72 * miss, 240 * miss, 62 * miss, 192)
            # •Ï?"sp' É•`‰æ '·' éƒQ?[ƒW' Ì•?' ð' ã"ü
            if actor.maxhp != 0
                hp = (width + plus_width) * actor.hp * rate_width/100/actor.maxhp
            else
                hp = 0
            end
            # ƒQ?[ƒW' Ì•`‰æ
            gauge_rect(x + plus_x + width * rate_x/100, y + plus_y,
            width, plus_width + width * rate_width/100,
            height, hp, align1, align2, align3,
            color1, color2, color3, color4, color5, color6, grade1, grade2)
            # ƒIƒ¦ƒWƒiƒ‹' ÌHP•`‰æ?ˆ --?' ð¼Ä' Ñ?o' µ
            draw_actor_hp_original(actor, x, y, width)
        end
        #--------------------------------------------------------------------------
        #? ½ SP ƒQ?[ƒW' Ì•`‰æ
        #--------------------------------------------------------------------------
        # ƒIƒ¦ƒWƒiƒ‹' ÌSP•`‰æ' ð draw_actor_sp_original ' Æ-¼' O•Ï?x
        alias:draw_actor_sp_original:draw_actor_sp
        def draw_actor_sp(actor, x, y, width = 144)
            # •Ï?"rate' 3rd ¼"?Ý' ÌSP/MSP' ð' ã"ü
            if actor.maxsp != 0
                miss = actor.sp.to_f/actor.maxsp
            else
                miss = 1
            end
            # plus_x:x?À•W' ̈Ê' u•â?³ rate_x:x?À•W' ̈Ê' u•â?³(%) plus_y:y?À•W' ̈Ê' u•â?³
            # plus_width:•?' Ì•â?³ rate_width:•?' Ì•â?³(%) height:?c•?
            # align1:•`‰æƒ^ƒCƒv1 0:?¶‹l' ss 1:' †‰›' µ' ¦ 2:‰E‹l' ss
            # align2:•`‰æƒ^ƒCƒv2 0:?ã‹l' ss 1:' †‰›' µ' ¦ 2:‰º‹l' ss
            # align3:ƒQ?[ƒWƒ^ƒCƒv 0:?¶‹l' ss 1:‰E‹l' ss
            plus_x = 0
            rate_x = 0
            plus_y = 25
            plus_width = 0
            rate_width = 100
            height = 10
            align1 = 1
            align2 = 2
            align3 = 0
            # ƒOƒ‰ƒf?[ƒVƒ‡ƒ"?Ý' 2nd grade1:‹óƒQ?[ƒW grade2:' ÀƒQ?[ƒW
            # (0:‰¡' ɃOƒ‰ƒf?[ƒVƒ‡ƒ "1:?c' ɃOƒ‰ƒf?[ƒVƒ‡ƒ" 2:' Î' ss' ɃOƒ‰ƒf?[ƒVƒ‡ƒ"(¼ƒ?d)?j
            grade1 = 1
            grade2 = 0
            #?F?Ý' è?Bcolor1:¦O˜g?Ccolor2:' †˜g
            # color3:‹óƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor4:‹óƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[
            # color5:' ÀƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor6:' ÀƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[
            color1 = Color.new(0, 0, 0, 192)
            color2 = Color.new(255, 255, 192, 192)
            color3 = Color.new(0, 0, 0, 192)
            color4 = Color.new(0, 64, 0, 192)
            color5 = Color.new(14 * miss, 80 - 24 * miss, 80 * miss, 192)
            color6 = Color.new(62 * miss, 240 - 72 * miss, 240 * miss, 192)
            # •Ï?"sp' É•`‰æ '·' éƒQ?[ƒW' Ì•?' ð' ã"ü
            if actor.maxsp != 0
                sp = (width + plus_width) * actor.sp * rate_width/100/actor.maxsp
            else
                sp = (width + plus_width) * rate_width/100
            end
            # ƒQ?[ƒW' Ì•`‰æ
            gauge_rect(x + plus_x + width * rate_x/100, y + plus_y,
            width, plus_width + width * rate_width/100,
            height, sp, align1, align2, align3,
            color1, color2, color3, color4, color5, color6, grade1, grade2)
            # ƒIƒ¦ƒWƒiƒ‹' ÌSP•`‰æ?ˆ --?' ð¼Ä' Ñ?o' µ
            draw_actor_sp_original(actor, x, y, width)
        end
        #--------------------------------------------------------------------------
        #? ½ EXP ƒQ?[ƒW' Ì•`‰æ
        #--------------------------------------------------------------------------
        # ƒIƒ¦ƒWƒiƒ‹' ÌEXP•`‰æ' ð draw_actor_sp_original ' Æ-¼' O•Ï?x
        alias:draw_actor_exp_original:draw_actor_exp
        def draw_actor_exp(actor, x, y, width = 204)
            # •Ï?"rate' 3rd ¼"?Ý' Ìexp/nextexp' ð' ã"ü
            if actor.next_exp != 0
                miss = actor.now_exp.to_f/actor.next_exp
            else
                miss = 1
            end
            # plus_x:x?À•W' ̈Ê' u•â?³ rate_x:x?À•W' ̈Ê' u•â?³(%) plus_y:y?À•W' ̈Ê' u•â?³
            # plus_width:•?' Ì•â?³ rate_width:•?' Ì•â?³(%) height:?c•?
            # align1:•`‰æƒ^ƒCƒv1 0:?¶‹l' ss 1:' †‰›' µ' ¦ 2:‰E‹l' ss
            # align2:•`‰æƒ^ƒCƒv2 0:?ã‹l' ss 1:' †‰›' µ' ¦ 2:‰º‹l' ss
            # align3:ƒQ?[ƒWƒ^ƒCƒv 0:?¶‹l' ss 1:‰E‹l' ss
            plus_x = 0
            rate_x = 0
            plus_y = 25
            plus_width = 0
            rate_width = 100
            height = 10
            align1 = 1
            align2 = 2
            align3 = 0
            # ƒOƒ‰ƒf?[ƒVƒ‡ƒ"?Ý' 2nd grade1:‹óƒQ?[ƒW grade2:' ÀƒQ?[ƒW
            # (0:‰¡' ɃOƒ‰ƒf?[ƒVƒ‡ƒ "1:?c' ɃOƒ‰ƒf?[ƒVƒ‡ƒ" 2:' Î' ss' ɃOƒ‰ƒf?[ƒVƒ‡ƒ"(¼ƒ?d)?j
            grade1 = 1
            grade2 = 0
            #?F?Ý' è?Bcolor1:¦O˜g?Ccolor2:' †˜g
            # color3:‹óƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor4:‹óƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[
            # color5:' ÀƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor6:' ÀƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[
            color1 = Color.new(0, 0, 0, 192)
            color2 = Color.new(255, 255, 192, 192)
            color3 = Color.new(0, 0, 0, 192)
            color4 = Color.new(64, 0, 0, 192)
            color5 = Color.new(80 * misses, 80 - 80 * misses ** 2, 80 - 80 * misses, 192)
            color6 = Color.new(240 * misses, 240 - 240 * misses ** 2, 240 - 240 * misses, 192)
            # •Ï?"exp' É•`‰æ '·' éƒQ?[ƒW' Ì•?' ð' ã"ü
            if actor.next_exp != 0
                exp = (width + plus_width) * actor.now_exp * rate_width/
                100/actor.next_exp
            else
                exp = (width + plus_width) * rate_width/100
            end
            # ƒQ?[ƒW' Ì•`‰æ
            gauge_rect(x + plus_x + width * rate_x/100, y + plus_y,
            width, plus_width + width * rate_width/100,
            height, exp, align1, align2, align3,
            color1, color2, color3, color4, color5, color6, grade1, grade2)
            # ƒIƒ¦ƒWƒiƒ‹' ÌEXP•`‰æ?ˆ --?' ð¼Ä' Ñ?o' µ
            draw_actor_exp_original(actor, x, y)
        end
        #--------------------------------------------------------------------------
        #? ½ ƒQ?[ƒW' Ì•`‰æ
        #--------------------------------------------------------------------------
        def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3,
            color1, color2, color3, color4, color5, color6, grade1, grade2)
            case align1
        when 1
            x += (rect_width - width)/2
        when 2
            x += rect_width - width
        end
        case align2
    when 1
        y -= height/2
    when 2
        y -= height
    end
    # ˜g•`‰æ
    self.contents.fill_rect(x, y, width, height, color1)
    self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2)
    if align3 == 0
        if grade1 == 2
            grade1 = 3
        end
        if grade2 == 2
            grade2 = 3
        end
    end
    if (align3 == 1 and grade1 == 0) or grade1 > 0
        color = color3
        color3 = color4
        color4 = color
    end
    if (align3 == 1 and grade2 == 0) or grade2 > 0
        color = color5
        color5 = color6
        color6 = color
    end
    # ‹óƒQ?[ƒW' Ì•`‰æ
    self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4,
    color3, color4, grade1)
    if align3 == 1
        x += width - gauge
    end
    # ' ÀƒQ?[ƒW' Ì•`‰æ
    self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4,
    color5, color6, grade2)
    end
    end
    #------------------------------------------------------------------------------
    #?@BitmapƒNƒ‰ƒX' É?V' ½' È‹@"\' ð' ljÁ' µ' Ü'·?B
    #==============================================================================
    
    class Bitmap
    #--------------------------------------------------------------------------
    #? ½ ‹é¼`' ðƒOƒ‰ƒf?[ƒVƒ‡ƒ"•\' ¦
    # color1: ƒXƒ^?[ƒgƒJƒ‰?[
    # color2: ƒGƒ"ƒhƒJƒ‰?[
    # align: 0:‰¡' ɃOƒ‰ƒf?[ƒVƒ‡ƒ "
    # 1:?c' ɃOƒ‰ƒf?[ƒVƒ‡ƒ "
    # 2:' Î' ss' ɃOƒ‰ƒf?[ƒVƒ‡ƒ"?i¼ƒ?d' É' Â' "'?ˆÓ?j
    #--------------------------------------------------------------------------
        def gradation_rect(x, y, width, height, color1, color2, align = 0)
            if align == 0
                for i in x... x + width
                    red = color1.red + (color2.red - color1.red) * (i - x)/(width - 1)
                    green = color1.green +
                    (color2.green - color1.green) * (i - x)/(width - 1)
                    blue = color1.blue +
                    (color2.blue - color1.blue) * (i - x)/(width - 1)
                    alpha = color1.alpha +
                    (color2.alpha - color1.alpha) * (i - x)/(width - 1)
                    color = Color.new(red, green, blue, alpha)
                    fill_rect(i, y, 1, height, color)
                end
            elsif align == 1
                for i in y... y + height
                    red = color1.red +
                    (color2.red - color1.red) * (i - y)/(height - 1)
                    green = color1.green +
                    (color2.green - color1.green) * (i - y)/(height - 1)
                    blue = color1.blue +
                    (color2.blue - color1.blue) * (i - y)/(height - 1)
                    alpha = color1.alpha +
                    (color2.alpha - color1.alpha) * (i - y) / (height - 1)
                    color = Color.new(red, green, blue, alpha)
                    fill_rect(x, i, width, 1, color)
                end
            elsif align == 2
                for i in x...x + width
                    for j in y...y + height
                        red = color1.red + (color2.red - color1.red) *
                        ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
                        green = color1.green + (color2.green - color1.green) *
                        ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
                        blue = color1.blue + (color2.blue - color1.blue) *
                        ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
                        alpha = color1.alpha + (color2.alpha - color1.alpha) *
                        ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
                        color = Color.new(red, green, blue, alpha)
                        set_pixel(i, j, color)
                    end
                end
            elsif align == 3
                for i in x...x + width
                    for j in y...y + height
                        red = color1.red + (color2.red - color1.red) *
                        ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
                        green = color1.green + (color2.green - color1.green) *
                        ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
                        blue = color1.blue + (color2.blue - color1.blue) *
                        ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
                        alpha = color1.alpha + (color2.alpha - color1.alpha) *
                        ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
                        color = Color.new(red, green, blue, alpha)
                        set_pixel(i, j, color)
                    end
                end
            end
        end
    end
    
    #==============================================================================
    # ?¡ Spriteƒ‚ƒWƒ…?[ƒ‹
    #------------------------------------------------------------------------------
    # ?@ƒAƒjƒ??[ƒVƒ‡ƒ“‚̦Ǘ?‚ð?s‚¤ƒ‚ƒWƒ…?[ƒ‹‚Å‚·?B
    #==============================================================================
    
    module RPG
        class Sprite < ::Sprite
            def damage(value, critical)
                dispose_damage
                if value.is_a?(Numeric)
                    damage_string = value.abs.to_s
                else
                    damage_string = value.to_s
                end
                bitmap = Bitmap.new(160, 48)
                bitmap.font.name = "Arial Black"
                bitmap.font.size = 32
                bitmap.font.color.set(0, 0, 0)
                bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
                bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
                bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
                bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
                if value.is_a?(Numeric) and value < 0
                    bitmap.font.color.set(176, 255, 144)
                else
                    bitmap.font.color.set(255, 255, 255)
                end
                bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
                if critical
                    bitmap.font.size = 20
                    bitmap.font.color.set(0, 0, 0)
                    bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
                    bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
                    bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
                    bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
                    bitmap.font.color.set(255, 255, 255)
                    bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
                end
                @_damage_sprite = ::Sprite.new
                @_damage_sprite.bitmap = bitmap
                @_damage_sprite.ox = 80 + self.viewport.ox
                @_damage_sprite.oy = 20 + self.viewport.oy
                @_damage_sprite.x = self.x + self.viewport.rect.x
                @_damage_sprite.y = self.y - self.oy / 2 + self.viewport.rect.y
                @_damage_sprite.z = 3000
                @_damage_duration = 40
            end
            def animation(animation, hit)
                dispose_animation
                @_animation = animation
                return if @_animation == nil
                @_animation_hit = hit
                @_animation_duration = @_animation.frame_max
                animation_name = @_animation.animation_name
                animation_hue = @_animation.animation_hue
                bitmap = RPG::Cache.animation(animation_name, animation_hue)
                if @@_reference_count.include?(bitmap)
                    @@_reference_count[bitmap] += 1
                else
                    @@_reference_count[bitmap] = 1
                end
                @_animation_sprites = []
                if @_animation.position != 3 or not @@_animations.include?(animation)
                    for i in 0..15
                        sprite = ::Sprite.new
                        sprite.bitmap = bitmap
                        sprite.visible = false
                        @_animation_sprites.push(sprite)
                    end
                    unless @@_animations.include?(animation)
                        @@_animations.push(animation)
                    end
                end
                update_animation
            end
            def loop_animation(animation)
                return if animation == @_loop_animation
                dispose_loop_animation
                @_loop_animation = animation
                return if @_loop_animation == nil
                @_loop_animation_index = 0
                animation_name = @_loop_animation.animation_name
                animation_hue = @_loop_animation.animation_hue
                bitmap = RPG::Cache.animation(animation_name, animation_hue)
                if @@_reference_count.include?(bitmap)
                    @@_reference_count[bitmap] += 1
                else
                    @@_reference_count[bitmap] = 1
                end
                @_loop_animation_sprites = []
                for i in 0..15
                    sprite = ::Sprite.new
                    sprite.bitmap = bitmap
                    sprite.visible = false
                    @_loop_animation_sprites.push(sprite)
                end
                update_loop_animation
            end
            def animation_set_sprites(sprites, cell_data, position)
                for i in 0..15
                    sprite = sprites[i]
                    pattern = cell_data[i, 0]
                    if sprite == nil or pattern == nil or pattern == -1
                        sprite.visible = false if sprite != nil
                        next
                    end
                    sprite.visible = true
                    sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
                    if position == 3
                        if self.viewport != nil
                            sprite.x = self.viewport.rect.width / 2
                            sprite.y = self.viewport.rect.height - 160
                        else
                            sprite.x = 320
                            sprite.y = 240
                        end
                    else
                        sprite.x = self.x + self.viewport.rect.x -
                        self.ox + self.src_rect.width / 2
                        sprite.y = self.y + self.viewport.rect.y -
                        self.oy + self.src_rect.height / 2
                        sprite.y -= self.src_rect.height / 4 if position == 0
                        sprite.y += self.src_rect.height / 4 if position == 2
                    end
                    sprite.x += cell_data[i, 1]
                    sprite.y += cell_data[i, 2]
                    sprite.z = 2000
                    sprite.ox = 96
                    sprite.oy = 96
                    sprite.zoom_x = cell_data[i, 3] / 100.0
                    sprite.zoom_y = cell_data[i, 3] / 100.0
                    sprite.angle = cell_data[i, 4]
                    sprite.mirror = (cell_data[i, 5] == 1)
                    sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
                    sprite.blend_type = cell_data[i, 7]
                end
            end
        end
    end
    

     

     

     

    Sostituiamo poi Window_Menustatus con questo:

     

     

    #==============================================================================
    # ■ Window_MenuStatus
    #------------------------------------------------------------------------------
    # Menu spécial de Silversun
    #==============================================================================
    
    class Window_MenuStatus < Window_Selectable
        #--------------------------------------------------------------------------
        # ● オブジェクト初期化
        #--------------------------------------------------------------------------
        def initialize
            super(0, 0, 480, 480)
            self.contents = Bitmap.new(width - 32, height - 32)
            self.contents.font.name = $fontface
            self.contents.font.size = $fontsize
            refresh
            self.active = false
            self.index = -1
        end
        #--------------------------------------------------------------------------
        # ● リフレッシュ
        #--------------------------------------------------------------------------
        def refresh
            self.contents.clear
            @item_max = $game_party.actors.size
            for i in 0...$game_party.actors.size
                y = 270
                x = 220
                actor = $game_party.actors[i]
                actor1 = $game_party.actors[0]
                actor2 = $game_party.actors[1]
                actor3 = $game_party.actors[2]
                actor4 = $game_party.actors[3]
                self.draw_facesquare(actor.character_name, actor.character_hue,10+32*i, 5 )
                if @item_max >= 4
                    #variables
                    cnw = contents.text_size(actor4.name).width
                    cnh = contents.text_size(actor4.name).height
                    ccw = contents.text_size(actor4.class_name).width
                    cch = contents.text_size(actor4.class_name).height
                    chpw = contents.text_size(actor4.hp.to_s).width
                    cspw = contents.text_size(actor4.sp.to_s).width
                    #draw
                    draw_actor_battler(actor4,x, y-100)
                    draw_actor_name(actor4, x-cnw/2, y-275)
                    draw_actor_class(actor4, x-ccw/2, y-275+cnh)
                    draw_actor_level(actor4, x-130, y - 275+cnh+cch/2)
                    draw_actor_state(actor4, x +80, y - 275+cnh+cch/2)
                    draw_actor_hp(actor4, x-chpw*2, y - 275+cnh*2)
                    draw_actor_sp(actor4, x -cspw*2, y - 275+cnh*3)
                end
                if @item_max >= 3
                    #variables
                    cnw = contents.text_size(actor3.name).width
                    cnh = contents.text_size(actor3.name).height
                    ccw = contents.text_size(actor3.class_name).width
                    cch = contents.text_size(actor3.class_name).height
                    clw = contents.text_size(actor3.level.to_s).width
                    chpw = contents.text_size(actor3.hp.to_s).width
                    cspw = contents.text_size(actor3.sp.to_s).width
                    #draw
                    draw_actor_battler(actor3, x+70, y - 70)
                    draw_actor_name(actor3, x+180-cnw/2+10, y-140)
                    draw_actor_class(actor3, x+180-cch/2-35, y-140+cnh)
                    draw_actor_level(actor3, x+180-clw, y -140+cnh+cch)
                    draw_actor_state(actor3, x+180-35, y -140+cnh*3)
                    draw_actor_hp(actor3, x+180-100, y-140+cnh*4)
                    draw_actor_sp(actor3, x+180-100, y-140+cnh*5)
                end
                if @item_max >= 2
                    #variables
                    cnw = contents.text_size(actor2.name).width
                    cnh = contents.text_size(actor2.name).height
                    ccw = contents.text_size(actor2.class_name).width
                    cch = contents.text_size(actor2.class_name).height
                    #draw
                    draw_actor_battler(actor2, x-70,y-70)
                    draw_actor_name(actor2, x-220, y-140)
                    draw_actor_class(actor2, x-220, y-140+cnh)
                    draw_actor_level(actor2, x-220, y -140+cnh+cch)
                    draw_actor_state(actor2, x-220, y -140+cnh*3)
                    draw_actor_hp(actor2, x-220, y-140+cnh*4)
                    draw_actor_sp(actor2, x-220, y-140+cnh*5)
                end
                if @item_max >= 1
                    #variables
                    cnw = contents.text_size(actor1.name).width
                    cnh = contents.text_size(actor1.name).height
                    ccw = contents.text_size(actor1.class_name).width
                    cch = contents.text_size(actor1.class_name).height
                    chpw = contents.text_size(actor1.hp.to_s).width
                    cspw = contents.text_size(actor1.sp.to_s).width
                    #draw
                    draw_actor_battler(actor1, x,y)
                    draw_actor_name(actor1, x-cnw/2, y+80)
                    draw_actor_class(actor1, x-ccw/2, y+80+cnh)
                    draw_actor_level(actor1, x-130, y + 80+cnh+cch/2)
                    draw_actor_state(actor1, x +80, y + 80+cnh+cch/2)
                    draw_actor_hp(actor1, x-chpw*2, y + 80+cnh*2)
                    draw_actor_sp(actor1, x -cspw*2, y + 80+cnh*3)
                end
            end
        end
        #--------------------------------------------------------------------------
        # ● カーソルの矩形更新
        #--------------------------------------------------------------------------
        def update_cursor_rect
            if @index < 0
                self.cursor_rect.empty
            else
                self.cursor_rect.set(7+@index*32, 2, 31, 31)
            end
        end
    end
    

     

     

     

    Bugs e Conflitti Noti

    Bug Corretti

    :rulezza:

  4. Minigame Puzzle

    Descrizione


    Uno script che permette di inserire un puzzle nel vostro progetto.


    Autore


    DarkRog



    Allegati


    Screen: 1


    Istruzioni per l'uso


    Create una classe sopra il main e incollate questo al suo interno:

     

    #==============================================================================
    # ¦ Scene_Puzle - By DarkRog - Versión Pase automático de piezas.
    =begin
    You need a picture with size 420px x 420px, in Graphics/Pictures.
    You have to call a script from an event and write:
    $scene = Scene_Puzle.new(piece size , "picture", variable id (this variable will be the result of the game), time, background)
    *The size has to be dividing of 420.
    *The picture need to be in Graphics/Picture.
    *The variable id:
    1:You won, 2:Time up.
    *Seconds, or false for unlimited time.
    *A background image in Graphics/Picture, or false for any picture.
    Example:
    $scene = Scene_Puzle.new(140, "Puzle1", 3, 30, "Back")
    Size:140, Picture:"Puzle1", Variable:3, Seconds:30 Background:"Back".
    =end
    #------------------------------------------------------------------------------
    
    class Scene_Puzle
        def initialize(size, img, vid, tim, back)
            @pu = Window_Puzle.new(size, img, vid, tim, back)
        end
        def main
            Graphics.transition
            loop do
                Graphics.update
                Input.update
                update
                if $scene != self
                    break
                end
            end
            Graphics.freeze
            @pu.dispose
            if $scene.is_a?(Scene_Title)
                Graphics.transition
                Graphics.freeze
            end
        end
        def update
            @pu.refresh
        end
    end
    
    class Window_Puzle < Window_Base
        def initialize(size, img, vid, tim, back)
            super(-16, -16, 640+32, 480+32)
            self.contents = Bitmap.new(width - 32, height - 32)
            self.contents.font.name = $fontface
            self.contents.font.size = $fontsize
            @back = back
            @vid = vid
            @piezasi = size
            @img = img
            @winb = Window_PBrillo.new
            if tim == false
                @timeh = false
            else
                @time = tim*25
                @timeh = true
            end
            @pieza = []
            piezas = []
            num = 0
            for i in 0..420/@piezasi-1
                for a in 0..420/@piezasi-1
                    @pieza[num] = Pieza_Puzle.new(a, i)
                    piezas[num] = num
                    num += 1
                end
            end
            @op = []
            for i in 0..420/@piezasi*420/@piezasi-1
                loop do
                    ra = rand(420/@piezasi*420/@piezasi)
                    if piezas[ra] != nil
                        @op[i] = ra
                        piezas[ra] = nil
                        break
                    end
                end
            end
            @cursor = num-1
            @o = 100
            @re = false
            refresh
        end
        def refresh
            self.contents.clear
            if @back != false
                self.contents.blt(0, 0, RPG::Cache.picture(@back), Rect.new(0, 0, 640, 480), 255)
            end
            if @timeh == true
                @time -= 1
                if @time == 0
                    $game_variables[@vid] = 2
                    $game_system.se_play($data_system.buzzer_se)
                    $scene = Scene_Map.new
                end
            end
            if @o <= 100
                @re = false
            elsif @o >= 255
                @re = true
            end
            if @re == false
                @o += 5
            elsif @re == true
                @o -= 5
            end
            self.contents.draw_text(26, 0, 640, 32, "Pieces")
            self.contents.draw_text(300, 0, 640, 32, "Panel")
            if @timeh != false
                if @time/25%60 > 9
                    self.contents.draw_text(460, 0, 640, 32, "Time: #{@time/25/60}:#{@time/25%60}")
                else
                    self.contents.draw_text(460, 0, 640, 32, "Time: #{@time/25/60}:0#{@time/25%60}")
                end
            else
                self.contents.draw_text(460, 0, 640, 32, "Unlimited time")
            end
            self.contents.fill_rect(70-@piezasi/2+@piezasi/100, 240-@piezasi/2, @piezasi+2, @piezasi+2, Color.new(0, 0, 0, 200))
            self.contents.fill_rect(175, 35, 422, 422, Color.new(0, 0, 0, 200))
            self.contents.blt(176, 36, RPG::Cache.picture(@img), Rect.new(0, 0, 420, 420), 10)
            pieza = 0
            for i in 0..420/@piezasi-1
                for a in 0..420/@piezasi-1
                    if @pieza[pieza].d == true
                        self.contents.blt(176+a*@piezasi, 36+i*@piezasi, RPG::Cache.picture(@img), Rect.new(@piezasi*a, @piezasi*i, @piezasi, @piezasi), 255)
                    end
                    pieza += 1
                end
            end
            for a in -1..1
                i = @cursor-a
                if @op[i] != nil
                    if i >= 0 and a != 0
                        if @pieza[@op[i]].d == false
                        elsif @pieza[@op[i]].d == true
                        end
                    end
                    if a == 0
                        if @pieza[@op[i]].d == false
                            self.contents.blt(70-@piezasi/2+@piezasi/100+1, 240-@piezasi*3/2+@piezasi*(a+1), RPG::Cache.picture(@img), Rect.new(@pieza[@op[i]].x*@piezasi, @pieza[@op[i]].y*@piezasi, @piezasi, @piezasi), @o)
                        elsif @pieza[@op[i]].d == true
                            self.contents.blt(70-@piezasi/2+@piezasi/100+1, 240-@piezasi*3/2+@piezasi*(a+1), RPG::Cache.picture(@img), Rect.new(@pieza[@op[i]].x*@piezasi, @pieza[@op[i]].y*@piezasi, @piezasi, @piezasi), 20+@o/10)
                        end
                    end
                end
            end
            if @fase == 1
                f1_up
                return
            elsif @fase == nil
                @fase = 1
                @cursorx = 0
                @cursory = 0
            end
        end
        def f1_up
            self.contents.blt(@piezasi*@cursorx+176, 36+@piezasi*@cursory, RPG::Cache.picture(@img), Rect.new(@pieza[@op[@cursor]].x*@piezasi, @pieza[@op[@cursor]].y*@piezasi, @piezasi, @piezasi), @o)
            if Input.repeat?(Input::RIGHT) and @cursorx < 420/@piezasi-1
                @cursorx += 1
                $game_system.se_play($data_system.cursor_se)
            elsif Input.repeat?(Input::RIGHT) and @cursorx == 420/@piezasi-1
                $game_system.se_play($data_system.cursor_se)
                @cursorx = 0
            end
            if Input.repeat?(Input::LEFT) and @cursorx > 0
                @cursorx -= 1
                $game_system.se_play($data_system.cursor_se)
            elsif Input.repeat?(Input::LEFT) and @cursorx == 0
                $game_system.se_play($data_system.cursor_se)
                @cursorx = 420/@piezasi-1
            end
            if Input.repeat?(Input::DOWN) and @cursory < 420/@piezasi-1
                @cursory += 1
                $game_system.se_play($data_system.cursor_se)
            elsif Input.repeat?(Input::DOWN) and @cursory == 420/@piezasi-1
                @cursory = 0
                $game_system.se_play($data_system.cursor_se)
            end
            if Input.repeat?(Input::UP) and @cursory >0
                @cursory -= 1
                $game_system.se_play($data_system.cursor_se)
            elsif Input.repeat?(Input::UP) and @cursory == 0
                @cursory = 420/@piezasi-1
                $game_system.se_play($data_system.cursor_se)
            end
            if Input.trigger?(Input::C)
                if @pieza[@op[@cursor]].x == @cursorx and @pieza[@op[@cursor]].y == @cursory
                    $game_system.se_play($data_system.load_se)
                    @pieza[@op[@cursor]].d = true
                    piezac = 0
                    for i in 0...420/@piezasi*420/@piezasi
                        if @pieza[i].d == true
                            piezac +=1
                        end
                    end
                    if piezac == 420/@piezasi*420/@piezasi
                        $game_variables[@vid] = 1
                        @o2 = 0
                        @re2 = false
                        @t2 = 0
                        Audio.se_play("Audio/SE/056-Right02.ogg", 100, 50)
                        loop do
                            Graphics.update
                            @t2 += 1
                            if @re2 == true
                                @o2 -= 5
                            elsif @re2 == false
                                @o2 += 5
                            end
                            if @o2 >= 255
                                @re2 = true
                            elsif @o2 <= 0
                                @re2 = false
                            end
                            @winb.refresh(@o2)
                            if @t2 == 102
                                @winb.dispose
                                break
                            end
                        end
                        $game_system.se_play($data_system.shop_se)
                        $scene = Scene_Map.new
                    else
                        @cursor -= 1
                    end
                else
                    $game_system.se_play($data_system.buzzer_se)
                end
                return
            end
        end
    end
    
    class Pieza_Puzle
        attr_accessor :x
        attr_accessor :y
        attr_accessor :d
        def initialize(x, y)
            @x = x
            @y = y
            @d = false
        end
    end
    
    class Window_PBrillo < Window_Base
        def initialize
            super(-16, -16, 640+32, 480+32)
            self.contents = Bitmap.new(width - 32, height - 32)
            self.contents.font.name = $fontface
            self.contents.font.size = $fontsize
            self.opacity = 0
            refresh(0)
        end
        def refresh(o)
            self.contents.clear
            self.contents.fill_rect(175, 35, 422, 422, Color.new(255, 255, 255, o))
        end
    end
    

     

     


    L'immagine del puzzle deve essere 420x420 pixels.

    Per chiamare l'evento inserite sto codice di esempio:


    $scene = Scene_Puzle.new(140, "Puzle1", 3, 30, "Back")
    

     

    Dove:

    1) 140 è la misura dei pezzi;
    2) Puzle1 è l'immagine del puzzle che va messa in Graphics\Pictures;
    3) 30 sono i secondi che avete per risolverlo, mettere "false" per tempo illimitato;
    4) Back è l'immagine che volete mettere come sfondo al vostro puzzle, sempre 420 x 420 pixel, cartella Graphics\Pictures.

  5. Custom Menu System - Breath of Fire

    Descrizione

    Un menu personalizzato che ricalca quello di Breath of Fire.

    Autore

    Squall789


    Allegati

    Screen: 1
    Face: 1234 Skin: 1

    Istruzioni per l'uso

    Create all'interno della cartella "Character" del progetto una cartella chiamata "Faces" e incollate al suo interno i 4 face allegati in alto. Fatto ciò date ad ogni file il nome di uno dei personaggi del party, lasciando ovviamente inalterata l'estensione.

    Ora inserite come skin quella allegata in alto

    Infine create una classe sopra main e incollate questo:

     

     

    # Breath Of Fire Dragon Quarter Menu  Version 2 By Squall789 (me) 
    #------------------------------------------------------------------------------ 
    #It is the Menu From Capcoms Breath Of Fire Dragon Quarter by Squall789 (me) 
    #============================================================================== 
     
    #------------------------------------------------------------------------------- 
    # - This Menu has been ccreated by me (Squall 789) 
    # - Sorry didnt include "Trap or the use of the Party Exp but was too hard atm. 
    # - I will try with the trap system soon but at the moment im working on the party Exp 
    # - Some features were added that I did not make. 
    # - The Hp/Sp/Xp bars were created by cogwheel and I just changed their size an location. 
    # - The Faces Function was not mine it was snipped from Acedentprone's FF7 Menu (Great menu). 
    # - The Mapname Window was created by Dubealex (Scripting Legend lol) i think. 
    # - If you need the menu Custom edited then mail me with what you want and I'll tell you if I can do it. 
    # - If you want to add more characters to your team then ul have to make face sets for them. 
    # - Actually the Mapname Function might have been created by Maki for the Ring Menu. 
    # - You will have to delete your "Window_Menustatus" class from your script list otherwise this menu will error like hell. 
    # - I havent finished making the Battle Stats Window But Will be Done in a Few days But u can just delete it from the menu. 
    # - If anyone wants this customed especially I may do so depending on when it is and what they want changed. 
    # -  Anyways. . . . Let the Scripting Begin lol. 
     
    #-------------------------Version 2 Edits--------------------------------------- 
     
    # - Now accounts for any number of party members (will have to make smaller boxes for over 4 chracter tho) 
    # - Completely rewrote the show Character section (hell of a lot longer lol) 
    # - Created seperate windows for: Hp, Ap bars, Character Graphic, Character face. 
    # - Animated other Windows "mainly the Location help window" 
    # - Added twice as many comments to the script to help any customization 
     
    # - - - - - - - - - - - - -  -  Version 2 Notes -  - - - - - - -  - - -  - - - - 
    # - Customization of this is all a bit tricky so just email me and I will try and do it for you 
    # - BEFORE THIS SCRIPT CAN WORKS PROPERLY YOU "MUST DELETE WINDOW_MENU_STATUS" from the class on the left (they conflict) 
    # - Feel free to re-edit any of the script, if you wnant to repost this on any forums plz ask me first. 
    # - If you custom it then Please could you refer to me as the creator of the menu. 
    # - Also could any edits be sent to me so I can check them over (helps improve my scripting) 
    # - Email me the edited scripts + instruction or just a working demo 
    # - I would love to see what people more advanced at scripting than me or even see what newbiew can DO. 
    class Scene_Menu 
      #-------------------------------------------------------------------------- 
      # - Object initialization 
      #	 menu_index : Cursor initial position of command 
      #-------------------------------------------------------------------------- 
     
      def initialize(menu_index = 0) 
    	@menu_index = menu_index 
      end 
      #-------------------------------------------------------------------------- 
      # - Main processing 
      #-------------------------------------------------------------------------- 
      def main 
    	# Drawing up the command window 
    	s1 = $data_system.words.item 
    	s2 = $data_system.words.skill 
    	s3 = $data_system.words.equip 
    	s4 = "Party" 
    	s5 = "Save" 
    	s6 = "Battle Stats" # Sorry The function still hasnt been included (will do real soon) 
    	s7 = "Quit"	
      #--------------------------- edit-------------------------------  
      # Command menu 
      # Size = Screen height - border sizes - 
      #   GameStatus menu - Spacing from GameStatus 
      @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7]) # 160 
      @command_window.x = - 20 - @command_window.width # 180 default 
      @command_window.y = 210 
      @command_window.z = 630 # 110 at at default 
      @command_window.index = @menu_index 
      @command_window.windowskin = RPG::Cache.windowskin("Dragon skin") 
    	# When party number of people 0 is 
    	if $game_party.actors.size == 0 
    	  # Nullifying the item, skill, equipment and status 
    	  @command_window.disable_item(0) 
    	  @command_window.disable_item(1) 
    	  @command_window.disable_item(2) 
    	  @command_window.disable_item(3) 
    	end 
    	# In case of saving prohibition 
    	if $game_system.save_disabled 
    	  # Saving is made invalid 
    	  @command_window.disable_item(4) 
    	end 
     
    	 # Drawing up the play time window 
    	@playtime_window = Window_PlayTime.new 
    	@playtime_window.x = 890 
    	@playtime_window.y = 394 
    	@playtime_window.z = 640 
    	@playtime_window.opacity = 0 
    	@playtime_window.windowskin = RPG::Cache.windowskin("Dragon skin") 
    	
    	# Drawing up the Gold window 
    	@gold_window = Window_Gold.new 
    	@gold_window.x = 890 
    	@gold_window.y = 264 
    	@gold_window.z = 640 
    	@gold_window.height =  199 
    	@gold_window.opacity = 0 
    	@gold_window.windowskin = RPG::Cache.windowskin("Dragon skin")	
    	
    	#drawing up the map_name Window 
    	@map = Window_Mapname.new 
    	@map.x = 890 
    	@map.y = 180 # 180 deafault 
    	@map.z = 640 # decides wether window is on top of others or below 
    	@map.height = 50 
    	@map.width = 290 
    	@map.windowskin = RPG::Cache.windowskin("Dragon skin") 
    	
    	#Drawing up the Contents for the Party XP Window 
    	@party_exp_window = Window_party_exp.new 
    	@party_exp_window.x = 890 
    	@party_exp_window.y = 262 
    	@party_exp_window.z = 640 
    	@party_exp_window.opacity = 255 
    	@party_exp_window.height = 214 # must be over 221 to look right! 
    	@party_exp_window.windowskin = RPG::Cache.windowskin("Dragon skin")	
    	
    #------------------------------------------------------------------------------- 
    #- Help Windows Show Begin - Begin Customization Here 
    #------------------------------------------------------------------------------- 
    # - Before editing this section I wud advise you to create a bakup of the script so you can repast it in to correct any errors you make 
     
    	#Drawing up the "location" Text Window 1 
    	@Window_location_text = Window_location_text.new 
    	@Window_location_text.x = 890 # 532 default 
    	@Window_location_text.y = 152 #152 # must be 28 below map location 
    	@Window_location_text.z = 640 
    	@Window_location_text.height = 44 
    	@Window_location_text.windowskin = RPG::Cache.windowskin("Dragon skin")	
     
    	#Drawing up the Data_text Window 
    	@Window_data_text = Window_data_text.new 
    	@Window_data_text.x = 900 # 890 a sec 
    	@Window_data_text.y = 248 #248 must be 38 above 
    	@Window_data_text.z = 640 
    	@Window_data_text.width = 70 
    	@Window_data_text.height = 44 
    	@Window_data_text.windowskin = RPG::Cache.windowskin("Dragon skin")  
    	
    	#Drawing up the Command_Text Window 
    	@Window_command_text = Window_command_text.new 
    	@Window_command_text.x = -120 # 86 default 
    	@Window_command_text.y = 182 #182 
    	@Window_command_text.z = 640 
    	@Window_command_text.windowskin = RPG::Cache.windowskin("Dragon skin") 
    	
    	#Drawing up the Background Window 
    	@Background_window = Background_window.new 
    	@Background_window.x = 0 
    	@Background_window.y = 0 
    	@Background_window.z = 0 
    	@Background_window.opacity = 255 
    	@Background_window.windowskin = RPG::Cache.windowskin("BackgroundSkin")  
    	
    	#Drawing up the actor Windows !!!Be careful when editing this section!!!! 
    	@Window_exp_box = Window_exp_box.new 
    	@Window_exp_box.x = - 10 
    	@Window_exp_box.y = - 200 
    	@Window_exp_box.z = 640 
    	@Window_exp_box.opacity = 0 
    	
    	#Drawing up the Exp And Ap bars 
    	@Window_party_box = Window_party_box.new 
    	@Window_party_box.x = - 10 
    	@Window_party_box.y = - 200 
    	@Window_party_box.z = 650 
    	@Window_party_box.opacity = 0 
    	
    #------------------------------------------------------------------------------- 
    #- Help Windows  Show End - End Of Customization 
    #------------------------------------------------------------------------------- 
    	
    	# Drawing up the status window 
    	@status_window = Window_MenuStatus.new 
    	@status_window.x = - 10 #160 default 
    	@status_window.y = - 200 #  - 120 
    	@status_window.z = 600 
    	#@status_window.width = 450 
    	# Transition execution 
    	Graphics.transition 
    	# Main loop 
    	loop do 
    	  # Renewing the game picture 
    	  Graphics.update 
    	  # Updating the information of input 
    	  Input.update 
    	  # フレーム更新 
    	  update 
    	  # When the picture changes, discontinuing the loop 
    	  if $scene != self 
    		break 
    	  end 
    	end 
    	# Transition preparation 
    	Graphics.freeze 
    	# Releasing the window 
    	@command_window.dispose 
    	@playtime_window.dispose 
    	@gold_window.dispose 
    	@status_window.dispose 
    	@party_exp_window.dispose 
    	@map.dispose 
    	@Window_command_text.dispose 
    	@Window_data_text.dispose 
    	@Window_location_text.dispose 
    	@Window_exp_box.dispose 
    	@Window_party_box.dispose 
    	@Background_window.dispose 
      end 
    #-------------------------------------------------------------------------- 
    #Defining the delay 
    #-------------------------------------------------------------------------- 
    def delay(seconds) 
     for i in 0...(seconds * 1) 
       sleep 0.01 
       Graphics.update 
     end 
    end 
      #-------------------------------------------------------------------------- 
      # - Frame renewal 
      #-------------------------------------------------------------------------- 
      def update 
    	# Renewing the window 
    	@command_window.update 
    	@status_window.update 
    	@playtime_window.update 
    	@gold_window.update 
    	@party_exp_window.update 
    	@map.update 
    	@Window_exp_box.update 
    	@Window_party_box.update 
    	
    #Moving Windows inplace (only when open Menu not when Exit) 
     
      #Moving Status Window 
     if @status_window.y < 0 # 60 before ok 
    	@status_window.y += 16 # 16 
      end 
      #Moving the Window_exp_box 
      if @Window_exp_box.y < 0 # 50 
    	 @Window_exp_box.y +=16 
       end 
      #Moving the Ap, Hp bars 
      if @Window_party_box.y < 0 # 50 
    	 @Window_party_box.y +=16 
       end 
     #Moving command Window 
      if @command_window.x < - 9 
    	 @command_window.x += 34 #= 60 
    end 
    #Moving Party Exp Window 
      if @party_exp_window.x > 460 
    	 @party_exp_window.x -= 20 
      end 
    #Moving Gold Window 
     if @gold_window.x > 460 
    	@gold_window.x -= 20 
      end 
    #Moving Playtime Window 
     if @playtime_window.x > 460 
    	@playtime_window.x -= 20 
      end 
      #Moving the "location" window 
      if @Window_location_text.x > 534 
    	 @Window_location_text.x -= 20 
       end 
    #Moving Map Window 
     if @map.x > 349 
    	@map.x -= 20 
      end 
    #Moving the Data_Help Window  
      if @Window_data_text.x > 540 # 560 
    	 @Window_data_text.x -= 20 
       end 
    #Moving the Command Help Window 
      if @Window_command_text.x < - 14 
    	 @Window_command_text.x += 208 
       end 
    	# When the command window is active,: Update_command is called 
    	if @command_window.active 
    	  update_command 
    	  return 
    	end 
    	# When the status window is active,: Update_status is called 
    	if @status_window.active 
    	  update_status 
    	  return 
    	end 
      end 
      #-------------------------------------------------------------------------- 
      # - When frame renewal (the command window is active) 
      #-------------------------------------------------------------------------- 
      def update_command 
    	# The B when button is pushed 
    	if Input.trigger?(Input::B) 
    	  # Performing cancellation SE 
    	  $game_system.se_play($data_system.cancel_se) 
    	  # Change to map picture 
    	  $scene = Scene_Map.new 
    	  return 
    	end 
    # When C button is pushed 
    	if Input.trigger?(Input::C) 
    # When party number of people with 0,its command other than saving and game end 
    	  if $game_party.actors.size == 0 and @command_window.index < 4 
    		# Performing buzzer SE 
    		$game_system.se_play($data_system.buzzer_se) 
    		return 
    	  end 
    	  # It diverges at cursor position of the command window 
    	  case @command_window.index 
    	  when 0  # Item 
    		# Performing decision SE 
    		$game_system.se_play($data_system.decision_se) 
    		# Change to item picture 
    		$scene = Scene_Item.new 
    	  when 1  # Skill 
    		# Performing decision SE 
    		$game_system.se_play($data_system.decision_se) 
    		# The status window is made active 
    		@command_window.active = false 
    		@status_window.active = true 
    		@status_window.index = 0 
    	  when 2  # Equipment 
    		# Performing decision SE 
    		$game_system.se_play($data_system.decision_se) 
    		# The status window is made active 
    		@command_window.active = false 
    		@status_window.active = true 
    		@status_window.index = 0 
    	  when 3  # Status 
    		# Performing decision SE 
    		$game_system.se_play($data_system.decision_se) 
    		# The status window is made active 
    		@command_window.active = false 
    		@status_window.active = true 
    		@status_window.index = 0 
    	 when 4  # Saving 
    		# In case of saving prohibition 
    		if $game_system.save_disabled 
    		  # Performing buzzer SE 
    		  $game_system.se_play($data_system.buzzer_se) 
    		  return 
    		end 
    		# Performing decision SE 
    		$game_system.se_play($data_system.decision_se) 
    		# Change to saving picture 
    		$scene = Scene_Save.new 
    	  when 5  # Battle Stats 
    		# Performing decision SE 
    		$game_system.se_play($data_system.decision_se) 
    		# Change to Battle Stats Info screen 
    		# Havent actually gotten round to adding this particular option yet!!!!!! 
    	  when 6  # Game end 
    		# Performing decision SE 
    		$game_system.se_play($data_system.decision_se) 
    		# Change to game end picture 
    		$scene = Scene_End.new 
    	  end 
    	  return 
    	end 
      end 
      #-------------------------------------------------------------------------- 
      # - When frame renewal (the status window is active) 
      #-------------------------------------------------------------------------- 
      def update_status 
    	# The B when button is pushed 
    	if Input.trigger?(Input::B) 
    	  # Performing cancellation SE 
    	  $game_system.se_play($data_system.cancel_se) 
    	  # The command window is made active 
    	  @command_window.active = true 
    	  @status_window.active = false 
    	  @status_window.index = -1 
    	  return 
    	end 
    	# When C button is pushed 
    	if Input.trigger?(Input::C) 
    	  # It diverges at cursor position of the command window 
    	  case @command_window.index 
    	  when 1  # Skill 
    		# When conduct restriction of this actor is 2 or more 
    		if $game_party.actors[@status_window.index].restriction >= 2 
    		  # Performing buzzer SE 
    		  $game_system.se_play($data_system.buzzer_se) 
    		  return 
    		end 
    		# Performing decision SE 
    		$game_system.se_play($data_system.decision_se) 
    		# Change to skill picture 
    		$scene = Scene_Skill.new(@status_window.index) 
    	  when 2  # Equipment 
    		# Performing decision SE 
    		$game_system.se_play($data_system.decision_se) 
    		# Change to equipment picture 
    		$scene = Scene_Equip.new(@status_window.index) 
    	  when 3  # Status 
    		# Performing decision SE 
    		$game_system.se_play($data_system.decision_se) 
    		# Change to status picture 
    		$scene = Scene_Status.new(@status_window.index) 
    	  end 
    	  return 
    	end 
      end 
    end 
     
    #------------------------------------------------------------------------------- 
    # - This is the Class that Handles the Creation of character Faces 
     
    #Create a new folder in the Characters folder, and call it Faces 
    #Adding faces: add a 80x80 picture with the same name as the characterset it 
    #corrosponds with in the Faces folder 
    #- ie: Arshes is 001-Fighter01 ect. 
    #If you do not want Faces, go to line 102 
    #and change delete the # of draw_actor_graphic 
    #and put a # infront of draw_actor_face 
     
     
    class Window_Base < Window 
     
     def draw_actor_face(actor, x, y) 
     face = RPG::Cache.character("Faces/" + actor.character_name, actor.character_hue) 
     fw = face.width 
     fh = face.height 
     src_rect = Rect.new(0, 0, fw, fh) #0, 0 
     self.contents.blt(x - fw / 133, y - fh, face, src_rect) # 23 
    end 
    end 
    def draw_actor_battler_graphic(actor, x, y) 
       bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue) 
       cw = bitmap.width 
       ch = bitmap.height 
       src_rect = Rect.new(0, 0, cw, ch) 
       self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)# 2 
     end 
     
     
    #------------------------------------------------------------------------------- 
    # - This is the class that creates and calculates the Total party Exp 
    #------------------------------------------------------------------------------- 
     
     
    class Window_party_exp < Window_Base # Begins 
     
    #-------------------------------------------------------------------------- 
    # - Object initialization 
    #-------------------------------------------------------------------------- 
      def initialize 
    	super(0, 0, 160, 200) #0, 0, 160, 200 
    	self.contents = Bitmap.new(width - 32, height - 32) 
    	self.contents.font.name = $fontface 
    	self.contents.font.size = $fontsize 
    	refresh 
      end 
     
    #-------------------------------------------------------------------------- 
    # - Refreshment 
    #--------------------------------------------------------------------------  
    	def refresh 
    	self.contents.clear 
    	self.contents.font.color = black_color 
    	self.contents.draw_text(- 36, 56, 120, 32, "Party XP", 2) # 62 
    	self.contents.font.color = black_color 
    	$game_variables[12] = $game_actors[1].exp + $game_actors[2].exp + $game_actors[3].exp 
    	self.contents.draw_text(8, 98, 120, 32,$game_variables[12].to_s, 2)	
      end 
    end	# End of Window_party_exp 
     
    #======================================== 
    #■ Game_Map 
    #-------------------------------------------------------------------------------- 
    # Setting functions for the Map # needed to create Location bar in menu 
    #======================================== 
    class Game_Map 
     
    def name 
     $map_infos[@map_id] 
    end 
    end 
     
    #======================================== 
    #■ Window_Title 
    #-------------------------------------------------------------------------------- 
    # Setting functions for the Title 
    #======================================== 
    class Scene_Title 
    $map_infos = load_data("Data/MapInfos.rxdata") 
    for key in $map_infos.keys 
     $map_infos[key] = $map_infos[key].name 
    end 
    end 
     
     
    #============================================================================== 
    # ■ Window_Mapname 
    #------------------------------------------------------------------------------ 
    #  Draws the Map name 
    #============================================================================== 
     
    class Window_Mapname < Window_Base 
    #-------------------------------------------------------------------------- 
    # Set up 
    #-------------------------------------------------------------------------- 
    def initialize 
     super(0, 0, 280, 50) # 360, 60 
     self.contents = Bitmap.new(width - 52, height - 32) 
     self.contents.font.name = $fontface 
     self.contents.font.size = $fontsize 
     refresh 
    end 
     
    #-------------------------------------------------------------------------- 
    # Draws info on screen 
    #-------------------------------------------------------------------------- 
    def refresh 
     self.contents.clear 
     # Map Name 
     #map = $game_map.name 
     self.contents.font.color = black_color 
     self.contents.draw_text(0, - 8, 210, 32, $game_map.name) #120, 0, 170, 32 
    end 
    end 
     
    #-------------------------------------------------------------------------- 
    # This creates the description windows delete if unwanted 
    # - ▼ -  Window "Location" text Begins 
    #-------------------------------------------------------------------------- 
    # Makes the Extra Window holding the text "location" 
     class Window_location_text < Window_Base 
    	
     def initialize 
     super(0, 0, 89, 42) #92 & 42 
     self.contents = Bitmap.new(width - 32, height - 32) 
     self.contents.font.name = "Arial Rounded MT Bold" 
     self.contents.font.color = black_color 
     self.contents.font.size = 16 
     self.contents.draw_text(0, - 11, 160, 32, "Location") 
    end 
    end 
     
    #-------------------------------------------------------------------------- 
    # # - ▼ -  Window_data_text Begins 
    #-------------------------------------------------------------------------- 
    # Makes the Extra Window holding the text "Data" 
     class Window_data_text < Window_Base 
    	
     def initialize 
     super(0, 0, 62, 42) # 360, 60 
     self.contents = Bitmap.new(width - 32, height - 32) 
     self.contents.font.name = "Arial Rounded MT Bold" 
     self.contents.font.color = black_color 
     self.contents.font.size = 16 
     self.contents.draw_text(0, - 11, 160, 32, "Data") 
    end 
    end 
     
    #-------------------------------------------------------------------------- 
    # # - ▼ -  Window_command_text Begins 
    #-------------------------------------------------------------------------- 
    # Makes the Extra Window holding the text "Command" 
     class Window_command_text < Window_Base 
    	
     def initialize 
     super(0, 0, 98, 42) 
     self.contents = Bitmap.new(width - 32, height - 32) 
     self.contents.font.name = "Arial Rounded MT Bold" 
     self.contents.font.color = black_color 
     self.contents.font.size = 16 
     self.contents.draw_text(0, - 11, 160, 32, "Command") 
    end 
    end 
     
    #------------------------------------------------------------------------------- 
    # - ▲-  Window_help_text Ends !.!All the Help Text Windows End Here!.! 
    #------------------------------------------------------------------------------- 
     
    #------------------------------------------------------------------------------- 
    # - This creates the Party Exp boxes - IMPORTANT DONT DELETE! 
    #------------------------------------------------------------------------------- 
     
     class Window_party_box < Window_Base 
     
      def initialize 
      super (0, 0, 880, 880) 
      self.contents = Bitmap.new(width - 32, height - 32) 
      self.contents.font.name = "Arial" 
      self.contents.font.color = black_color 
      self.contents.font.size = 16 
    	  @item_max = $game_party.actors.size 
    	for i in 0...$game_party.actors.size 
    	 x = 0 
    	 x =  i * 160 
    	  actor = $game_party.actors[i] 
    	  draw_actor_hp(actor, x +  8, y + 6) 
    	  draw_actor_sp(actor, x + 18, y + 36) 
    	 # draw_actor_name(actor, x + 20, - 14) 
    	end 
      end 
    end 
     
    #------------------------------------------------------------------------------- 
    # -  Refreshing the window - IMPORTANT DONT DELETE! 
    #------------------------------------------------------------------------------- 
      def refresh 
    	self.contents.clear 
    	  @item_max = $game_party.actors.size 
    	for i in 0...$game_party.actors.size 
    	 x = 0 
    	 x =  i * 160 
    	  actor = $game_party.actors[i] 
    	  draw_actor_hp(actor, x + 8, y + 6) 
    	  draw_actor_sp(actor, x + 18, y + 36) 
    	  self.contents.font.size = 18 
    	end 
      end 
     
    #------------------------------------------------------------------------------- 
    # - This creates the actor Graphic !IMPORTANT DONT DELETE! 
    #------------------------------------------------------------------------------- 
     class Window_exp_box < Window_Base 
     
      def initialize 
      super (0, 0, 880, 680) 
      self.contents = Bitmap.new(width - 32, height - 32) 
      self.contents.font.name = "Arial" 
      self.contents.font.color = black_color 
      self.contents.font.size = 16 
    	  @item_max = $game_party.actors.size 
    	for i in 0...$game_party.actors.size 
    	 x = 10 
    	 x =  i * 160 
    	  actor = $game_party.actors[i] 
    	  draw_actor_graphic(actor, x + 12, y + 56) 
    	end 
      end 
    end 
     
    #------------------------------------------------------------------------------- 
    # -  Refreshing the window !IMPORTANT DONT DELETE! 
    #------------------------------------------------------------------------------- 
      def refresh 
    	self.contents.clear 
    	  @item_max = $game_party.actors.size 
    	for i in 0...$game_party.actors.size 
    	 x = 10 
    	 x =  i * 160 
    	  actor = $game_party.actors[i] 
    	  draw_actor_graphic(actor, x + 12, y + 56) 
    	end 
      end 
     
    #------------------------------------------------------------------------------- 
    # - Background_Window - This creates the background window 
    #------------------------------------------------------------------------------- 
     
    #This creates the Background Window (You can chose your own Windowskin for this) 
     class Background_window < Window_Base 
     
      def initialize 
    	super(0, 0, 640, 680) 
    	#@windowname.windowskin
     = RPG::Cache.windowskin(@"001-Blue01") 
    	self.contents = Bitmap.new(width - 32, height - 32) 
    	self.contents.font.name = "Arial Rounded MT Bold" 
    	self.contents.font.color = system_color 
    	self.contents.font.size = 16 
      end 
    end 
     
     
    # HP/SP/EXP bars Ver 1.00 
    # by Cogwheel. 
    # Custom edited by Squall789 
    # http by p://members.jcom.home.ne.jp/cogwheel/ 
     
    #============================================================================== 
    # ¡ Game_Actor (most of this stuff is hard to change but I will try) 
    #------------------------------------------------------------------------------ 
    # Although most of the comments are in JP it is still not that difficult 
    # I have labled the stuff that you may want to customize. 
    #============================================================================== 
     
     
     
    #============================================================================== 
    # ¡ Window_Base 
    #------------------------------------------------------------------------------ 
    # I think this adds a new function to the Window_Base Class 
    #============================================================================== 
     
    class Game_Actor < Game_Battler 
     def now_exp 
       return @exp - @exp_list[@level] 
     end 
     def next_exp 
       return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0 
     end 
    end 
     
    class Window_Base < Window 
     #-------------------------------------------------------------------------- 
     #  HP bar Setup 
     #-------------------------------------------------------------------------- 
     # ƒIƒŠƒWƒiƒ‹‚ÌHP•`‰æ‚ð draw_actor_hp_original ‚Æ–¼‘O•ÏX 
     alias :draw_actor_hp_original :draw_actor_hp 
     def draw_actor_hp(actor, x, y, width = 145) 
       # •Ï”rate‚É Œ»Ý‚ÌHP/MHP‚ð‘ã“ü 
       if actor.maxhp != 0 
    	 rate = actor.hp.to_f / actor.maxhp 
       else 
    	 rate = 0 
       end 
       # plus_x:XÀ•W‚̈ʒu•â³ rate_x:XÀ•W‚̈ʒu•â³(%) plus_y:YÀ•W‚̈ʒu•â³ 
       # plus_width:•‚̕Ⳡrate_width:•‚Ì•â³(%) height:c• 
       # align1:•`‰æƒ^ƒCƒv1 0:¶‹l‚ß 1:’†‰›‘µ‚¦ 2:‰E‹l‚ß 
       # align2:•`‰æƒ^ƒCƒv2 0:ã‹l‚ß 1:’†‰›‘µ‚¦ 2:‰º‹l‚ß 
       # align3:ƒQ[ƒWƒ^ƒCƒv 0:¶‹l‚ß 1:‰E‹l‚ß 
       plus_x = 32 
       rate_x = 0 
       plus_y = 30 # 25 default, change to make look better 
       plus_width = 0 # never changed this but i dont think you really need to 
       rate_width = 65 #change to make bar longer or shorter 
       height = 8 # 7 was default, change to make bar thiner or thicker 
       align1 = 0 
       align2 = 1 
       align3 = 0 
       # ƒOƒ‰ƒf[ƒVƒ‡ƒ“Ý’è grade1:‹óƒQ[ƒW grade2:ŽÀƒQ[ƒW 
       # (0:‰¡‚ɃOƒ‰ƒf[ƒVƒ‡ƒ“ 1:c‚ɃOƒ‰ƒf[ƒVƒ‡ƒ“ 2:ŽÎ‚߂ɃOƒ‰ƒf[ƒVƒ‡ƒ“(Œƒd)j 
       grade1 = 1 # grade 1 default 
       grade2 = 0 
       # FÝ’èBcolor1:ŠO˜gCcolor2:’†˜g 
       # color3:‹óƒQ[ƒWƒ_[ƒNƒJƒ‰[Ccolor4:‹óƒQ[ƒWƒ‰ƒCƒgƒJƒ‰[ 
       # color5:ŽÀƒQ[ƒWƒ_[ƒNƒJƒ‰[Ccolor6:ŽÀƒQ[ƒWƒ‰ƒCƒgƒJƒ‰[ 
       color1 = Color.new(0, 0, 0, 192) 
       color2 = Color.new(255, 255, 192, 192) 
       color3 = Color.new(0, 0, 0, 192) 
       color4 = Color.new(64, 0, 0, 192) 
       color5 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192) 
       color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192) 
       # •Ï”sp‚É•`‰æ‚·‚éƒQ[ƒW‚Ì•‚ð‘ã“ü 
       if actor.maxhp != 0 
    	 hp = (width + plus_width) * actor.hp * rate_width / 100 / actor.maxhp 
       else 
    	 hp = 0 
       end 
       # ƒQ[ƒW‚Ì•`‰æ 
       gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y, 
    			   width, plus_width + width * rate_width / 100, 
    			   height, hp, align1, align2, align3, 
    			   color1, color2, color3, color4, color5, color6, grade1, grade2) 
       # ƒIƒŠƒWƒiƒ‹‚ÌHP•`‰æˆ—‚ðŒÄ‚Ño‚µ 
       draw_actor_hp_original(actor, x, y, width) 
     end 
     #-------------------------------------------------------------------------- 
     #  SP Bar Setup 
     #-------------------------------------------------------------------------- 
     # ƒIƒŠƒWƒiƒ‹‚ÌSP•`‰æ‚ð draw_actor_sp_original ‚Æ–¼‘O•ÏX 
     alias :draw_actor_sp_original :draw_actor_sp 
     def draw_actor_sp(actor, x, y, width = 144) 
       # •Ï”rate‚É Œ»Ý‚ÌSP/MSP‚ð‘ã“ü 
       if actor.maxsp != 0 
    	 rate = actor.sp.to_f / actor.maxsp 
       else 
    	 rate = 1 
       end 
       # plus_x:XÀ•W‚̈ʒu•â³ rate_x:XÀ•W‚̈ʒu•â³(%) plus_y:YÀ•W‚̈ʒu•â³ 
       # plus_width:•‚̕Ⳡrate_width:•‚Ì•â³(%) height:c• 
       # align1:•`‰æƒ^ƒCƒv1 0:¶‹l‚ß 1:’†‰›‘µ‚¦ 2:‰E‹l‚ß 
       # align2:•`‰æƒ^ƒCƒv2 0:ã‹l‚ß 1:’†‰›‘µ‚¦ 2:‰º‹l‚ß 
       # align3:ƒQ[ƒWƒ^ƒCƒv 0:¶‹l‚ß 1:‰E‹l‚ß 
       plus_x = 32 
       rate_x = 0 
       plus_y = 30 
       plus_width = 0 # change to needs 
       rate_width = 65 # change to your preferences 
       height = 8 # bigger number make bar thicker 
       align1 = 0 
       align2 = 1 
       align3 = 0 
       # ƒOƒ‰ƒf[ƒVƒ‡ƒ“Ý’è grade1:‹óƒQ[ƒW grade2:ŽÀƒQ[ƒW 
       # (0:‰¡‚ɃOƒ‰ƒf[ƒVƒ‡ƒ“ 1:c‚ɃOƒ‰ƒf[ƒVƒ‡ƒ“ 2:ŽÎ‚߂ɃOƒ‰ƒf[ƒVƒ‡ƒ“(Œƒd)j 
       grade1 = 1 
       grade2 = 0 
       # FÝ’èBcolor1:ŠO˜gCcolor2:’†˜g 
       # color3:‹óƒQ[ƒWƒ_[ƒNƒJƒ‰[Ccolor4:‹óƒQ[ƒWƒ‰ƒCƒgƒJƒ‰[ 
       # color5:ŽÀƒQ[ƒWƒ_[ƒNƒJƒ‰[Ccolor6:ŽÀƒQ[ƒWƒ‰ƒCƒgƒJƒ‰[ 
       color1 = Color.new(0, 0, 0, 192) 
       color2 = Color.new(255, 255, 192, 192) 
       color3 = Color.new(0, 0, 0, 192) 
       color4 = Color.new(0, 64, 0, 192) 
       color5 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192) 
       color6 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192) 
       # •Ï”sp‚É•`‰æ‚·‚éƒQ[ƒW‚Ì•‚ð‘ã“ü 
       if actor.maxsp != 0 
    	 sp = (width + plus_width) * actor.sp * rate_width / 100 / actor.maxsp 
       else 
    	 sp = (width + plus_width) * rate_width / 100 
       end 
       # ƒQ[ƒW‚Ì•`‰æ 
       gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y, 
    			   width, plus_width + width * rate_width / 100, 
    			   height, sp, align1, align2, align3, 
    			   color1, color2, color3, color4, color5, color6, grade1, grade2) 
       # ƒIƒŠƒWƒiƒ‹‚ÌSP•`‰æˆ—‚ðŒÄ‚Ño‚µ 
       draw_actor_sp_original(actor, x, y, width) 
     end 
     #-------------------------------------------------------------------------- 
     # EXP Bar setup (I didnt actually use this but I thought others might want to 
     #-------------------------------------------------------------------------- 
     # ƒIƒŠƒWƒiƒ‹‚ÌEXP•`‰æ‚ð draw_actor_sp_original ‚Æ–¼‘O•ÏX 
     alias :draw_actor_exp_original :draw_actor_exp 
     def draw_actor_exp(actor, x, y, width = 204) 
       # •Ï”rate‚É Œ»Ý‚Ìexp/nextexp‚ð‘ã“ü 
       if actor.next_exp != 0 
    	 rate = actor.now_exp.to_f / actor.next_exp 
       else 
    	 rate = 1 
       end 
       # plus_x:XÀ•W‚̈ʒu•â³ rate_x:XÀ•W‚̈ʒu•â³(%) plus_y:YÀ•W‚̈ʒu•â³ 
       # plus_width:•‚̕Ⳡrate_width:•‚Ì•â³(%) height:c• 
       # align1:•`‰æƒ^ƒCƒv1 0:¶‹l‚ß 1:’†‰›‘µ‚¦ 2:‰E‹l‚ß 
       # align2:•`‰æƒ^ƒCƒv2 0:ã‹l‚ß 1:’†‰›‘µ‚¦ 2:‰º‹l‚ß 
       # align3:ƒQ[ƒWƒ^ƒCƒv 0:¶‹l‚ß 1:‰E‹l‚ß 
       plus_x = 0 
       rate_x = 0 
       plus_y = 25 
       plus_width = 0 # edit to suite your needs 
       rate_width = 50 # edit to suite your needs 
       height = 7 #larger numbers make the box bigger 
       align1 = 0 
       align2 = 1 
       align3 = 0 
       # ƒOƒ‰ƒf[ƒVƒ‡ƒ“Ý’è grade1:‹óƒQ[ƒW grade2:ŽÀƒQ[ƒW 
       # (0:‰¡‚ɃOƒ‰ƒf[ƒVƒ‡ƒ“ 1:c‚ɃOƒ‰ƒf[ƒVƒ‡ƒ“ 2:ŽÎ‚߂ɃOƒ‰ƒf[ƒVƒ‡ƒ“(Œƒd)j 
       grade1 = 1 
       grade2 = 0 
       # FÝ’èBcolor1:ŠO˜gCcolor2:’†˜g 
       # color3:‹óƒQ[ƒWƒ_[ƒNƒJƒ‰[Ccolor4:‹óƒQ[ƒWƒ‰ƒCƒgƒJƒ‰[ 
       # color5:ŽÀƒQ[ƒWƒ_[ƒNƒJƒ‰[Ccolor6:ŽÀƒQ[ƒWƒ‰ƒCƒgƒJƒ‰[ 
       color1 = Color.new(0, 0, 0, 192) 
       color2 = Color.new(255, 255, 192, 192) 
       color3 = Color.new(0, 0, 0, 192) 
       color4 = Color.new(64, 0, 0, 192) 
       color5 = Color.new(80 * rate, 80 - 80 * rate ** 2, 80 - 80 * rate, 192) 
       color6 = Color.new(240 * rate, 240 - 240 * rate ** 2, 240 - 240 * rate, 192) 
       # •Ï”exp‚É•`‰æ‚·‚éƒQ[ƒW‚Ì•‚ð‘ã“ü 
       if actor.next_exp != 0 
    	 exp = (width + plus_width) * actor.now_exp * rate_width / 
    														 100 / actor.next_exp 
       else 
    	 exp = (width + plus_width) * rate_width / 100 
       end 
       # ƒQ[ƒW‚Ì•`‰æ 
       gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y, 
    			   width, plus_width + width * rate_width / 100, 
    			   height, exp, align1, align2, align3, 
    			   color1, color2, color3, color4, color5, color6, grade1, grade2) 
       # ƒIƒŠƒWƒiƒ‹‚ÌEXP•`‰æˆ—‚ðŒÄ‚Ño‚µ 
       draw_actor_exp_original(actor, x, y) 
     end 
     #-------------------------------------------------------------------------- 
     # œ ƒQ[ƒW‚Ì•`‰æ 
     #-------------------------------------------------------------------------- 
     def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3, 
    			   color1, color2, color3, color4, color5, color6, grade1, grade2) 
       case align1 
       when 1 
    	 x += (rect_width - width) / 2 
       when 2 
    	 x += rect_width - width 
       end 
       case align2 
       when 1 
    	 y -= height / 2 
       when 2 
    	 y -= height 
       end 
       # ˜g•`‰æ 
       self.contents.fill_rect(x, y, width, height, color1) 
       self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2) 
       if align3 == 0 
    	 if grade1 == 2 
    	   grade1 = 3 
    	 end 
    	 if grade2 == 2 
    	   grade2 = 3 
    	 end 
       end 
       if (align3 == 1 and grade1 == 0) or grade1 > 0 
    	 color = color3 
    	 color3 = color4 
    	 color4 = color 
       end 
       if (align3 == 1 and grade2 == 0) or grade2 > 0 
    	 color = color5 
    	 color5 = color6 
    	 color6 = color 
       end 
       # ‹óƒQ[ƒW‚Ì•`‰æ 
       self.contents.gradation_rect(x + 2, y + 2, width - 5, height - 5, 
    								 color3, color4, grade1) 
       if align3 == 1 
    	 x += width - gauge 
       end 
       # ŽÀƒQ[ƒW‚Ì•`‰æ 
       self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4, 
    								 color5, color6, grade2) 
     end 
    end 
     
    #------------------------------------------------------------------------------ 
    # @BitmapƒNƒ‰ƒX‚ÉV‚½‚È‹@”\‚ð’ljÁ‚µ‚Ü‚·B 
    #============================================================================== 
     
    class Bitmap 
     #-------------------------------------------------------------------------- 
     # œ ‹éŒ`‚ðƒOƒ‰ƒf[ƒVƒ‡ƒ“•\ަ 
     #	 color1 : ƒXƒ^[ƒgƒJƒ‰[ 
     #	 color2 : ƒGƒ“ƒhƒJƒ‰[ 
     #	 align  :  0:‰¡‚ɃOƒ‰ƒf[ƒVƒ‡ƒ“ 
     #			   1:c‚ɃOƒ‰ƒf[ƒVƒ‡ƒ“ 
     #			   2:ŽÎ‚߂ɃOƒ‰ƒf[ƒVƒ‡ƒ“iŒƒd‚ɂ‚«’ˆÓj 
     #-------------------------------------------------------------------------- 
     def gradation_rect(x, y, width, height, color1, color2, align = 0) 
       if align == 0 
    	 for i in x...x + width 
    	   red   = color1.red + (color2.red - color1.red) * (i - x) / (width - 1) 
    	   green = color1.green + 
    			   (color2.green - color1.green) * (i - x) / (width - 1) 
    	   blue  = color1.blue + 
    			   (color2.blue - color1.blue) * (i - x) / (width - 1) 
    	   alpha = color1.alpha + 
    			   (color2.alpha - color1.alpha) * (i - x) / (width - 1) 
    	   color = Color.new(red, green, blue, alpha) 
    	   fill_rect(i, y, 1, height, color) 
    	 end 
       elsif align == 1 
    	 for i in y...y + height 
    	   red   = color1.red + 
    			   (color2.red - color1.red) * (i - y) / (height - 1) 
    	   green = color1.green + 
    			   (color2.green - color1.green) * (i - y) / (height - 1) 
    	   blue  = color1.blue + 
    			   (color2.blue - color1.blue) * (i - y) / (height - 1) 
    	   alpha = color1.alpha + 
    			   (color2.alpha - color1.alpha) * (i - y) / (height - 1) 
    	   color = Color.new(red, green, blue, alpha) 
    	   fill_rect(x, i, width, 1, color) 
    	 end 
       elsif align == 2 
    	 for i in x...x + width 
    	   for j in y...y + height 
    		 red   = color1.red + (color2.red - color1.red) * 
    				 ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 
    		 green = color1.green + (color2.green - color1.green) * 
    				 ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 
    		 blue  = color1.blue + (color2.blue - color1.blue) * 
    				 ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 
    		 alpha = color1.alpha + (color2.alpha - color1.alpha) * 
    				 ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 
    		 color = Color.new(red, green, blue, alpha) 
    		 set_pixel(i, j, color) 
    	   end 
    	 end 
       elsif align == 3 
    	 for i in x...x + width 
    	   for j in y...y + height 
    		 red   = color1.red + (color2.red - color1.red) * 
    			   ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 
    		 green = color1.green + (color2.green - color1.green) * 
    			   ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 
    		 blue  = color1.blue + (color2.blue - color1.blue) * 
    			   ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 
    		 alpha = color1.alpha + (color2.alpha - color1.alpha) * 
    			   ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 
    		 color = Color.new(red, green, blue, alpha) 
    		 set_pixel(i, j, color) 
    	   end 
    	 end 
       end 
     end 
    end 
     
    #============================================================================== 
    # ¡ Spriteƒ‚ƒWƒ…[ƒ‹ im not really sure on this as the description wasn't english 
    #------------------------------------------------------------------------------ 
    # I think it the setup for the different colors for different stats (js a guess) 
    #============================================================================== 
     
    module RPG 
     class Sprite < ::Sprite 
       def damage(value, critical) 
    	 dispose_damage 
    	 if value.is_a?(Numeric) 
    	   damage_string = value.abs.to_s 
    	 else 
    	   damage_string = value.to_s 
    	 end 
    	 bitmap = Bitmap.new(160, 48) 
    	 bitmap.font.name = "Arial Black" 
    	 bitmap.font.size = 32 
    	 bitmap.font.color.set(0, 0, 0) 
    	 bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1) 
    	 bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1) 
    	 bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1) 
    	 bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1) 
    	 if value.is_a?(Numeric) and value < 0 
       &
    

     

     

     

     

  6. HUD di Kingdom Hearts


    Descrizione



    Questo script riprende l'HUD di Kingdom Hearts.


    Autore



    Skive



    Allegati



    Screen: 1


    Istruzioni per l'uso


    Prima di tutto dovete prendere quest' immagine e metterla in picture:
    http://membres.lycos...parodie/hud.png
    poi scrivete questa roba in una sezione sopra Main


     

     

    #==============================================================================
    # ■ Kingdom Hearts HUD
    #------------------------------------------------------------------------------
    # by Skive
    # skivedaft@yahoo.com
    #
    # --
    #
    # released on 5th March 2006
    #==============================================================================
    
    #==============================================================================
    # ■ Sprite_HP
    #------------------------------------------------------------------------------
    #  the HUD's hp bar
    #==============================================================================
    
    class Sprite_HP < Sprite
    	#--------------------------------------------------------------------------
    	# ● instances
    	#--------------------------------------------------------------------------
    	attr_writer :actor
    	#--------------------------------------------------------------------------
    	# ● initialize
    	#--------------------------------------------------------------------------
    	def initialize(actor = nil)
    		super(nil)
    		self.z = 202
    		self.bitmap = Bitmap.new(60, 26)
    		@actor = actor
    		if !@actor.nil?
    			@hp = @actor.hp
    			@maxhp = @actor.maxhp
    		end
    		refresh
    	end
    	#--------------------------------------------------------------------------
    	# ● refresh
    	#--------------------------------------------------------------------------
    	def refresh
    		self.bitmap.clear
    		return if @actor.nil?
    		@hp = @actor.hp
    		@maxhp = @actor.maxhp
    		draw_bar(20, 6)
    		self.angle = 270
    	end
    	#--------------------------------------------------------------------------
    	# ● update
    	#--------------------------------------------------------------------------
    	def update
    		super
    		if @actor.nil?
    			self.bitmap.clear
    			return
    		end
    		if @hp != @actor.hp or @maxhp != @actor.maxhp
    			refresh
    		end
    	end
    	#--------------------------------------------------------------------------
    	# ● draw_bar
    	#--------------------------------------------------------------------------
    	def draw_bar(radius, width)
    		max = (@actor.hp * 360) / @actor.maxhp
    		for j in 1..width
    			for i in 0..max
    				bx = Math.cos( (i * Math::PI) / 360) * (radius + j)
    				by = Math.sin( (i * Math::PI) / 360) * (radius + j)
    				case j
    				when 1
    					color = Color.new(74, 112, 29)
    				when 2
    					color = Color.new(77, 120, 29)
    				when 3
    					color = Color.new(80, 131, 28)
    				when 4
    					color = Color.new(85, 144, 27)
    				when 5
    					color = Color.new(89, 156, 26)
    				when 6
    					color = Color.new(93, 167, 26)
    				end
    				self.bitmap.set_pixel(30 + bx, by, color)
    			end
    		end
    	end
    end
    
    #==============================================================================
    # ■ Sprite_SP
    #------------------------------------------------------------------------------
    #  the HUD's sp bar
    #==============================================================================
    
    class Sprite_SP < Sprite
    	#--------------------------------------------------------------------------
    	# ● instances
    	#--------------------------------------------------------------------------
    	attr_writer :actor
    	#--------------------------------------------------------------------------
    	# ● initialize
    	#--------------------------------------------------------------------------
    	def initialize(actor = nil)
    		super(nil)
    		self.z = 202
    		self.bitmap = Bitmap.new(60, 26)
    		@actor = actor
    		if !@actor.nil?
    			@sp = @actor.sp
    			@maxsp = @actor.maxsp
    		end
    		refresh
    	end
    	#--------------------------------------------------------------------------
    	# ● refresh
    	#--------------------------------------------------------------------------
    	def refresh
    		self.bitmap.clear
    		return if @actor.nil?
    		@sp = @actor.sp
    		@maxsp = @actor.maxsp
    		draw_bar(20, 6)
    		self.angle = 90
    		self.mirror = true
    	end
    	#--------------------------------------------------------------------------
    	# ● update
    	#--------------------------------------------------------------------------
    	def update
    		super
    		if @actor.nil?
    			self.bitmap.clear
    			return
    		end
    		if @sp != @actor.sp or @maxsp != @actor.maxsp
    			refresh
    		end
    	end
    	#--------------------------------------------------------------------------
    	# ● draw_bar
    	#--------------------------------------------------------------------------
    	def draw_bar(radius, width)
    		max = (@actor.sp * 360) / @actor.maxsp
    		for j in 1..width
    			for i in 0..max
    				bx = Math.cos( (i * Math::PI) / 360) * (radius + j)
    				by = Math.sin( (i * Math::PI) / 360) * (radius + j)
    				case j
    				when 1
    					color = Color.new(29, 82, 112)
    				when 2
    					color = Color.new(29, 86, 120)
    				when 3
    					color = Color.new(28, 90, 131)
    				when 4
    					color = Color.new(27, 96, 144)
    				when 5
    					color = Color.new(26, 102, 156)
    				when 6
    					color = Color.new(26, 106, 167)
    				end
    				self.bitmap.set_pixel(30 + bx, by, color)
    			end
    		end
    	end
    end
    
    #==============================================================================
    # ■ Sprite_HUD
    #------------------------------------------------------------------------------
    #  draws the HUD on the map
    #==============================================================================
    
    class Sprite_HUD < Sprite
    	#--------------------------------------------------------------------------
    	# ● initialize
    	#--------------------------------------------------------------------------
    	def initialize(corner = 4)
    		super(nil)
    		self.z = 200
    		for actor in $game_party.actors
    			next if actor.dead?
    			@actor = actor
    			@actor_index = $game_party.actors.index(@actor)
    			break
    		end
    		@hp_sprite = Sprite_HP.new(@actor)
    		@sp_sprite = Sprite_SP.new(@actor)
    		self.bitmap = Bitmap.new(60, 60)
    		case corner
    		when 1
    			x = 16
    			y = 16
    		when 2
    			x = 640 - 52 - 16
    			y = 16
    		when 3
    			x = 16
    			y = 480 - 52 - 16
    		when 4
    			x = 640 - 52 - 16
    			y = 480 - 52 - 16
    		end
    		self.x = x
    		self.y = y
    		@hp_sprite.x = x + 27
    		@hp_sprite.y = y - 3
    		@sp_sprite.x = x + 27 - 1
    		@sp_sprite.y = y - 3 - 1 + 60
    		refresh
    	end
    	#--------------------------------------------------------------------------
    	# ● refresh
    	#--------------------------------------------------------------------------
    	def refresh
    		self.bitmap.clear
    		return if @actor.nil?
    		bmp = RPG::Cache.character(@actor.character_name, @actor.character_hue)
    		rect = Rect.new(0, 0, bmp.width / 4, (bmp.height / 4))
    		self.bitmap.blt(27 - bmp.width / 8, 5, bmp, rect)
    		self.bitmap.blt(0, 0, RPG::Cache.picture("hud"), Rect.new(0, 0, 60, 60))
    	end
    	#--------------------------------------------------------------------------
    	# ● update
    	#--------------------------------------------------------------------------
    	def update
    		super
    		@hp_sprite.update
    		@sp_sprite.update
    		if @actor != $game_party.actors[@actor_index]
    			@actor = $game_party.actors[@actor_index]
    			@hp_sprite.actor = @actor
    			@sp_sprite.actor = @actor
    			@hp_sprite.refresh
    			@sp_sprite.refresh
    			refresh
    		end
    	end
    end
    
    #==============================================================================
    # ■ Scene_Map
    #------------------------------------------------------------------------------
    #  draws the hud on the map screen
    # @khhud_corner is the corner you want the hud to be displayed in.
    # 1 is upper left, 2 is upper right, 3 is bottom left and 4 is bottom right
    #==============================================================================
    
    class Scene_Map
    	alias main_khhud main
    	alias update_khhud update
    	alias transfer_khhud transfer_player
    	#--------------------------------------------------------------------------
    	# ● initialize
    	#--------------------------------------------------------------------------
    	def initialize
    		@khhud_corner = 4 # 1 or 2 or 3 or 4
    	end
    	#--------------------------------------------------------------------------
    	# ● main
    	#--------------------------------------------------------------------------
    	def main
    		@hud = Sprite_HUD.new(@khhud_corner)
    		main_khhud
    		@hud.dispose
    	end
    	#--------------------------------------------------------------------------
    	# ● update
    	#--------------------------------------------------------------------------
    	def update
    		@hud.update
    		update_khhud
    	end
    end
    
    

     

     

     

     

  7. Custom Menu System

    Descrizione

    Un menu personalizzato.

    Autore

    Mewsterus (traduzione e modifiche: Alex'94)

    Istruzioni per l'uso

    Create una nuova classe sopra il main e incollate:

     

     

     

    # * Menù personalizzato: by mewsterus modificato da: Alex'94
    # * Fate una nuova classe e chiamatela Custom_Menù
    # * Dopodicchè avviate il gioco e...divertitevi!! :-)
    #===============================================================================
    # ¦ Window_Base
    #-------------------------------------------------------------------------------
    # Creato by mewsterus e tradotto e modificato da Alex'94
    #===============================================================================
    
    class Window_Base
        #-----------------------------------------------------------------------------
        # \\\\\\
        #-----------------------------------------------------------------------------
        def draw_actor_state(actor, x, y, width = 120)
            text = make_battler_state_text(actor, width, true)
            self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
            self.contents.draw_text(x, y, width, 32, text, 2)
        end
        #-----------------------------------------------------------------------------
        # \\\\\\\\\
        #-----------------------------------------------------------------------------
        def draw_actor_battler(actor, x, y)
            if $game_party.actors.size != 0
                bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
                src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
                self.contents.blt(x-(bitmap.width/2), y-bitmap.height, bitmap, src_rect)
            end
        end
        #-----------------------------------------------------------------------------
        # @ \\\\\\\\\
        #-----------------------------------------------------------------------------
        def draw_actor_exp(actor, x, y, width = 144)
            self.contents.font.color = system_color
            self.contents.draw_text(x, y, 48, 32, "Exp")
            self.contents.font.color = normal_color
            self.contents.draw_text(x + width - 48, y, 48, 32, actor.exp_s, 2)
        end
    end
    
    #===============================================================================
    # ¦ Window_MenuStatus
    #-------------------------------------------------------------------------------
    # Creato by mewsterus modificato by Alex'94
    #===============================================================================
    
    class Window_MenuStatus < Window_Selectable
        #-----------------------------------------------------------------------------
        # @ Make the window
        #-----------------------------------------------------------------------------
        def initialize
            super(0, 240, 640, 0)
            self.z -= 30
            @column_max = 2
            self.active = false
            self.index = -1
        end
        #-----------------------------------------------------------------------------
        # @ Refresh the window
        #-----------------------------------------------------------------------------
        def refresh
            self.contents = Bitmap.new(608, 448)
            self.contents.clear
            @item_max = $game_party.actors.size
            for i in 0...$game_party.actors.size
                x = i % 2 * 400
                y = i / 2 * 232
                actor = $game_party.actors[i]
                draw_actor_battler(actor, x + 104, y + 208)
                draw_actor_name(actor, x, y)
                draw_actor_state(actor, x + 88, y)
                draw_actor_exp(actor, x, y + 20, 208)
                draw_actor_level(actor, x, y + 40)
                draw_actor_hp(actor, x, y + 168, 208)
                draw_actor_sp(actor, x, y + 188, 208)
                self.contents.draw_text(x + 64, y + 40, 144, 32, actor.class_name, 2)
            end
        end
        #-----------------------------------------------------------------------------
        # @ Update the cursor
        #-----------------------------------------------------------------------------
        def update_cursor_rect
            if @index < 0
                self.cursor_rect.empty
            else
                self.cursor_rect.set(@index%2*400-8, @index/2*232-8, 224, 232)
            end
        end
    end
    
    #===============================================================================
    # ¦ Window_Play
    #-------------------------------------------------------------------------------
    # Written by mewsterus modificato da: Alex'94
    #===============================================================================
    
    class Window_Play < Window_Selectable
        #-----------------------------------------------------------------------------
        # @ Make the window
        #-----------------------------------------------------------------------------
        def initialize
            super(240, 240, 160, 0)
            self.z -= 20
            self.active = false
            self.index = -1
            self.back_opacity = 100
        end
        #-----------------------------------------------------------------------------
        # @ Refresh the window
        #-----------------------------------------------------------------------------
        def refresh
            self.contents = Bitmap.new(128, 448)
            #self.contents.font.name = $fontface
            #self.contents.font.size = $fontsize
            self.contents.clear
            cx = contents.text_size($data_system.words.gold).width
            self.contents.font.color = system_color
            self.contents.draw_text(0, 0, 128, 32, "Tempo: ")
            self.contents.draw_text(128 - cx, 64, cx, 32, $data_system.words.gold, 2)
            self.contents.draw_text(0, 384, 128, 32, "Passi: ")
            @total_sec = Graphics.frame_count / Graphics.frame_rate
            hour = @total_sec / 60 / 60
            min = @total_sec / 60 % 60
            sec = @total_sec % 60
            text = sprintf("%02d:%02d:%02d", hour, min, sec)
            self.contents.font.color = normal_color
            self.contents.draw_text(0, 32, 128, 32, text, 2)
            self.contents.draw_text(0, 64, 126 - cx, 32, $game_party.gold.to_s, 2)
            self.contents.font.color = normal_color
            self.contents.draw_text(0, 416, 128, 32, $game_party.steps.to_s, 2)
            if $location_enabled
                self.contents.draw_text(0,352,128,32,$game_map.name.delete("*").to_s,2)
                self.contents.font.color = system_color
                self.contents.draw_text(0,320,128,32,"Location")
            end
        end
        #-----------------------------------------------------------------------------
        # @ Update the cursor
        #-----------------------------------------------------------------------------
        def update_cursor_rect
            if @index < 0
                self.cursor_rect.empty
            else
                self.cursor_rect.set(@index%2*400-8, @index/2*232-8, 224, 232)
            end
        end
    end
    
    #===============================================================================
    # ¦ Scene_Menu
    #-------------------------------------------------------------------------------
    # Creato by mewsterus Modificato by Alex'94
    #===============================================================================
    
    class Scene_Menu
        #-----------------------------------------------------------------------------
        # @ Accept index
        #-----------------------------------------------------------------------------
        def initialize(menu_index = 0, equip_index = 0)
            @menu_index = menu_index
            @equip_index = equip_index
        end
        #-----------------------------------------------------------------------------
        # @ Main loop
        #-----------------------------------------------------------------------------
        def main
            # @sprite = Spriteset_Map.new
            @bg_window = Window_Base.new(320, 0, 0, 480)
            s1 = $data_system.words.item
            s2 = $data_system.words.skill
            s3 = $data_system.words.equip
            s4 = "Stato"
            s5 = "Salva"
            s6 = "Esci Dal Gioco"
            @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
            @command_window.index = @menu_index
            @command_window.opacity = 0
            @command_window.x = 240
            @command_window.y = 96
            @command_window.z -= 10
            @command_window.visible = false
            if $game_party.actors.size == 0
                @command_window.disable_item(0)
                @command_window.disable_item(1)
                @command_window.disable_item(2)
                @command_window.disable_item(3)
            end
            if $game_system.save_disabled
                @command_window.disable_item(4)
            end
            @help_window = Window_Help.new
            @help_window.visible = false
            @help_window.back_opacity = 100
            @status_window = Window_MenuStatus.new
            @play_window = Window_Play.new
            if $itemdrop_enabled
                @itemdrop = Window_Command.new(160, ["Basilare", "Equipaggiamento", "Cerca"])
            else
                @itemdrop = Window_Base.new(240, 144, 160, 128)
            end
            @itemdrop.x = 240
            @itemdrop.y = 144
            @itemdrop.z -= 5
            @itemdrop.active = false
            @itemdrop.opacity = 0
            @itemdrop.contents_opacity = 0
            Graphics.transition
            loop do
                Graphics.update
                Input.update
                if @status_window.y > 0
                    @status_window.y -= 16
                    @status_window.height += 32
                    @play_window.y -= 16
                    @play_window.height += 32
                else
                    @command_window.visible = true
                    unless @refreshed
                        @status_window.refresh
                        @refreshed = true
                    end
                    update
                    if @resize_item
                        if @bg_window.width < 640
                            @bg_window.x -= 16
                            @bg_window.width += 32
                        else
                            @resize_item = false
                            if $itemdrop_enabled
                                @item_window = Window_Item.new(@itemdrop.index + 20)
                            else
                                @item_window = Window_Item.new
                            end
                            @item_window.help_window = @help_window
                            @item_window.active = true
                            @item_window.x = 0
                            @item_window.contents_opacity = 255
                            @item_window.back_opacity = 100
                            @item_window.opacity = 255
                            @target_window = Window_Target.new
                            @target_window.active = false
                            @target_window.x = 320
                            @target_window.contents_opacity = 255
                            @target_window.opacity = 255
                            unless $ipm_enabled
                                @target_window.visible = false
                            end
                            if $itemdrop_enabled
                                if @itemdrop.index + 20 > 20
                                    @item_window.width = 640
                                    @item_window.column_max = 2
                                    @target_window.visible = false
                                end
                            end
                            @help_window.visible = true
                            @itemdrop.opacity = 0
                            @itemdrop.contents_opacity = 0
                        end
                    end
                    if @resize_skill
                        if @bg_window.width < 640
                            @bg_window.x -= 16
                            @bg_window.width += 32
                        else
                            @resize_skill = false
                            @actor = $game_party.actors[@status_window.index]
                            @skillstatus_window = Window_SkillStatus.new(@actor)
                            @skillstatus_window.contents_opacity = 255
                            @skillstatus_window.back_opacity = 100
                            @skillstatus_window.opacity = 255
                            @skillstatus_window.x = 0
                            @skill_window = Window_Skill.new(@actor)
                            @skill_window.help_window = @help_window
                            @skill_window.contents_opacity = 255
                            @skill_window.back_opacity = 100
                            @skill_window.opacity = 255
                            if $ipm_enabled
                                @skill_window.y = 184
                                @skilltarget_window = Window_Target.new(@status_window.index)
                            else
                                @skill_window.y = 128
                                @skilltarget_window = Window_Target.new
                            end
                            @skilltarget_window.active = false
                            @skilltarget_window.contents_opacity = 255
                            @skilltarget_window.opacity = 255
                            @skilltarget_window.x = 320
                            @help_window.visible = true
                            unless $ipm_enabled
                                @skilltarget_window.visible = false
                            end
                        end
                    end
                    if @resize_equip
                        if @bg_window.width < 640
                            @bg_window.x -= 16
                            @bg_window.width += 32
                        else
                            @resize_equip = false
                            @actor = $game_party.actors[@status_window.index]
                            @equiphelp_window = Window_Help.new
                            @equiphelp_window.back_opacity = 100
                            @left_window = Window_EquipLeft.new(@actor)
                            @left_window.contents_opacity = 255
                            @left_window.back_opacity = 100
                            @left_window.opacity = 255
                            @left_window.x = 0
                            @right_window = Window_EquipRight.new(@actor)
                            @right_window.help_window = @equiphelp_window
                            @right_window.index = @equip_index
                            @right_window.contents_opacity = 255
                            @right_window.back_opacity = 100
                            @right_window.opacity = 255
                            @right_window.y = 64
                            @item_window1 = Window_EquipItem.new(@actor, 0)
                            @item_window2 = Window_EquipItem.new(@actor, 1)
                            @item_window3 = Window_EquipItem.new(@actor, 2)
                            @item_window4 = Window_EquipItem.new(@actor, 3)
                            @item_window5 = Window_EquipItem.new(@actor, 4)
                            @item_window1.help_window = @equiphelp_window
                            @item_window2.help_window = @equiphelp_window
                            @item_window3.help_window = @equiphelp_window
                            @item_window4.help_window = @equiphelp_window
                            @item_window5.help_window = @equiphelp_window
                            @item_window1.back_opacity = 100
                            @item_window2.back_opacity = 100
                            @item_window3.back_opacity = 100
                            @item_window4.back_opacity = 100
                            @item_window5.back_opacity = 100
                            if $ipm_enabled
                                @commands = ["Equippaggia", "Opzionale", "Rimuovi", "Svuota", "Annulla"]
                                @equip_window = Window_SideCommand.new(@commands)
                                @equip_window.back_opacity = 100
                                @equip_window.height = 64
                                @equiphelp_window.y = 416
                                @right_window.index = -1
                                @blank_window = Window_Base.new(272, 256, 368, 160)
                                @blank_window.active = false
                                @blank_window.back_opacity = 100
                            end
                            equip_refresh
                        end
                    end
                    if @resize_status
                        if @bg_window.width < 448
                            @bg_window.x -= 16
                            @bg_window.width += 32
                        elsif @bg_window.width < 640 and not $ipm_enabled
                            @bg_window.x -= 16
                            @bg_window.width += 32
                        else
                            @resize_status = false
                            @actor = $game_party.actors[@status_window.index]
                            @playerstatus_window = Window_Status.new(@actor)
                            @playerstatus_window.contents_opacity = 255
                            @playerstatus_window.opacity = 255
                            @playerstatus_window.y = 0
                        end
                    end
                    if @resize_save
                        if @help_window.x < 0
                            @help_window.x += 64
                            @savefile_windows[0].x -= 64
                            @savefile_windows[1].x += 64
                            @savefile_windows[2].x -= 64
                            @savefile_windows[3].x += 64
                        else
                            @resize_save = false
                            @savefile_windows_active = true
                        end
                    end
                    if @resize_back
                        @status_window.index = -1
                        if @bg_window.width > 0
                            @bg_window.x += 16
                            @bg_window.width -= 32
                        else
                            @resize_back = false
                            @command_window.active = true
                        end
                    end
                end
                if $scene != self
                    break
                end
            end
            @bg_window.dispose
            @command_window.dispose
            @help_window.dispose
            @status_window.cursor_rect.empty
            @status_window.contents.clear
            @status_window.contents = nil
            @play_window.contents.clear
            @play_window.contents = nil
            for i in 0..20
                @status_window.y += 16
                @status_window.height -= 32
                @play_window.y += 16
                @play_window.height -= 32
                @itemdrop.opacity -= 25
                @itemdrop.contents_opacity -= 25
                Graphics.update
            end
            Graphics.freeze
            # @sprite.dispose
            @status_window.dispose
            @itemdrop.dispose
        end
        #-----------------------------------------------------------------------------
        # @ Update the scene
        #-----------------------------------------------------------------------------
        def update
            @help_window.update
            @command_window.update
            @status_window.update
            @play_window.update
            @play_window.refresh
            @itemdrop.update
            if @command_window.active
                update_command
                return
            end
            if @status_window.active
                update_status
                return
            end
            if @itemdrop.active
                update_itemdrop
                return
            end
            if @item_window != nil
                @item_window.update
                @target_window.update
                if @item_window.active
                    update_item
                    return
                end
                if @target_window.active
                    update_target
                    return
                end
            end
            if @skill_window != nil
                @skill_window.update
                @skillstatus_window.update
                @skilltarget_window.update
                if @skill_window.active
                    update_skill
                    return
                end
                if @skilltarget_window.active
                    update_skilltarget
                    return
                end
                if @skillstatus_window.active
                    update_skillstatus
                    return
                end
            end
            if @left_window != nil
                @equiphelp_window.update
                @left_window.update
                @right_window.update
                @eitem_window.update
                equip_refresh
                if $ipm_enabled
                    @equip_window.update
                    if @equip_window.active
                        update_equip
                        return
                    end
                end
                if @right_window.active
                    update_right
                    return
                end
                if @eitem_window.active
                    update_eitem
                    return
                end
            end
            if @playerstatus_window != nil
                @playerstatus_window.update
                update_playerstatus
            end
            if @savefile_windows != nil
                @help_window.update
                for i in @savefile_windows
                    i.update
                end
                if @savefile_windows_active
                    update_save
                end
            end
        end
        #-----------------------------------------------------------------------------
        # @ Update the command window
        #-----------------------------------------------------------------------------
        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 $game_party.actors.size == 0 and @command_window.index < 4
                    $game_system.se_play($data_system.buzzer_se)
                    return
                end
                case @command_window.index
                when 0
                    $game_system.se_play($data_system.decision_se)
                    if $itemdrop_enabled
                        loop do
                            if @itemdrop.opacity < 250
                                @itemdrop.opacity += 25
                                @itemdrop.contents_opacity += 25
                            else
                                break
                            end
                            Graphics.update
                        end
                        @command_window.active = false
                        @itemdrop.active = true
                        return
                    end
                    @command_window.active = false
                    @resize_item = true
                when 1
                    $game_system.se_play($data_system.decision_se)
                    @command_window.active = false
                    @status_window.active = true
                    @status_window.index = 0
                when 2
                    $game_system.se_play($data_system.decision_se)
                    @command_window.active = false
                    @status_window.active = true
                    @status_window.index = 0
                when 3
                    $game_system.se_play($data_system.decision_se)
                    @command_window.active = false
                    @status_window.active = true
                    @status_window.index = 0
                when 4
                    if $game_system.save_disabled
                        $game_system.se_play($data_system.buzzer_se)
                        return
                    end
                    $game_system.se_play($data_system.decision_se)
                    @help_window.set_text("Dove vuoi salvare??", 1)
                    @help_window.back_opacity = 255
                    @help_window.x = -640
                    @savefile_windows = []
                    for i in 0..3
                        if $ipm_enabled
                            @savefile_windows.push(Window_Save.new(i))
                        else
                            @savefile_windows.push(Window_SaveFile.new(i, nil))
                        end
                        @savefile_windows[i].back_opacity = 255
                        @savefile_windows[i].opacity = 255
                    end
                    @file_index = $game_temp.last_file_index
                    @savefile_windows[@file_index].selected = true
                    @savefile_windows[0].x = 640
                    @savefile_windows[1].x = -640
                    @savefile_windows[2].x = 640
                    @savefile_windows[3].x = -640
                    @command_window.active = false
                    @resize_save = true
                when 5
                    $game_system.se_play($data_system.decision_se)
                    $scene = Scene_End.new
                end
                return
            end
        end
        #-----------------------------------------------------------------------------
        # @ Update the status window
        #-----------------------------------------------------------------------------
        def update_status
            if Input.trigger?(Input::B)
                $game_system.se_play($data_system.cancel_se)
                @command_window.active = true
                @status_window.active = false
                @status_window.index = -1
                return
            end
            if Input.trigger?(Input::C)
                @actor_index = @status_window.index
                case @command_window.index
                when 1
                    if $game_party.actors[@status_window.index].restriction >= 2
                        $game_system.se_play($data_system.buzzer_se)
                        return
                    end
                    $game_system.se_play($data_system.decision_se)
                    @status_window.active = false
                    @resize_skill = true
                when 2
                    $game_system.se_play($data_system.decision_se)
                    @status_window.active = false
                    @resize_equip = true
                when 3
                    $game_system.se_play($data_system.decision_se)
                    @status_window.active = false
                    @resize_status = true
                end
                return
            end
        end
        #-----------------------------------------------------------------------------
        # @ Update the itemdrop window
        #-----------------------------------------------------------------------------
        def update_itemdrop
            if Input.trigger?(Input::B)
                $game_system.se_play($data_system.cancel_se)
                loop do
                    if @itemdrop.opacity > 0
                        @itemdrop.opacity -= 25
                        @itemdrop.contents_opacity -= 25
                    else
                        break
                    end
                    Graphics.update
                end
                @itemdrop.active = false
                @command_window.active = true
                return
            end
            if Input.trigger?(Input::C)
                $game_system.se_play($data_system.decision_se)
                @itemdrop.active = false
                @resize_item = true
            end
        end
        #-----------------------------------------------------------------------------
        # @ Update the item window
        #-----------------------------------------------------------------------------
        def update_item
            if Input.trigger?(Input::B)
                $game_system.se_play($data_system.cancel_se)
                @item_window.dispose
                @target_window.dispose
                @item_window = nil
                @target_window = nil
                @help_window.visible = false
                @resize_back = true
                return
            end
            if Input.trigger?(Input::C)
                @item = @item_window.item
                unless @item.is_a?(RPG::Item)
                    $game_system.se_play($data_system.buzzer_se)
                    return
                end
                unless $game_party.item_can_use?(@item.id)
                    $game_system.se_play($data_system.buzzer_se)
                    return
                end
                $game_system.se_play($data_system.decision_se)
                if @item.scope >= 3
                    @item_window.active = false
                    unless $ipm_enabled
                        @target_window.x = (@item_window.index + 1) % 2 * 304
                        @target_window.visible = true
                    end
                    @target_window.active = true
                    if @item.scope == 4 || @item.scope == 6
                        @target_window.index = -1
                    else
                        @target_window.index = 0
                    end
                else
                    if @item.common_event_id > 0
                        $game_temp.common_event_id = @item.common_event_id
                        $game_system.se_play(@item.menu_se)
                        if @item.consumable
                            $game_party.lose_item(@item.id, 1)
                            @item_window.draw_item(@item_window.index)
                        end
                        $scene = Scene_Map.new
                        return
                    end
                end
                return
            end
            if Input.trigger?(Input::R) and $itemdrop_enabled
                $game_system.se_play($data_system.cursor_se)
                @itemdrop.index = (@itemdrop.index + 1) % 3
                @item_window.dispose
                @target_window.dispose
                @resize_item = true
                return
            end
            if Input.trigger?(Input::L) and $itemdrop_enabled
                $game_system.se_play($data_system.cursor_se)
                @itemdrop.index = (@itemdrop.index + 2) % 3
                @item_window.dispose
                @target_window.dispose
                @resize_item = true
                return
            end
        end
        #-----------------------------------------------------------------------------
        # @ Update the target window
        #-----------------------------------------------------------------------------
        def update_target
            if $game_party.item_number(@item.id) == 0
                @target_window.active = false
                @item_window.refresh
                @item_window.active = true
                unless $ipm_enabled
                    @target_window.visible = false
                end
                return
            end
            if Input.trigger?(Input::B)
                $game_system.se_play($data_system.cancel_se)
                unless $game_party.item_can_use?(@item.id)
                    @item_window.refresh
                end
                @item_window.active = true
                unless $ipm_enabled
                    @target_window.visible = false
                end
                @target_window.active = false
                return
            end
            if Input.trigger?(Input::C)
                if $game_party.item_number(@item.id) == 0
                    $game_system.se_play($data_system.buzzer_se)
                    return
                end
                if @target_window.index == -1
                    used = false
                    for i in $game_party.actors
                        used |= i.item_effect(@item)
                    end
                end
                if @target_window.index >= 0
                    target = $game_party.actors[@target_window.index]
                    used = target.item_effect(@item)
                end
                if used
                    $game_system.se_play(@item.menu_se)
                    if @item.consumable
                        $game_party.lose_item(@item.id, 1)
                        @item_window.draw_item(@item_window.index)
                    end
                    @target_window.refresh
                    if $game_party.all_dead?
                        $scene = Scene_Gameover.new
                        return
                    end
                    if @item.common_event_id > 0
                        $game_temp.common_event_id = @item.common_event_id
                        $scene = Scene_Map.new
                        return
                    end
                end
                unless used
                    $game_system.se_play($data_system.buzzer_se)
                end
                return
            end
        end
        #-----------------------------------------------------------------------------
        # @ Update the skill window
        #-----------------------------------------------------------------------------
        def update_skill
            if Input.trigger?(Input::B)
                $game_system.se_play($data_system.cancel_se)
                @skill_window.dispose
                @skillstatus_window.dispose
                @skilltarget_window.dispose
                @skill_window = nil
                @skillstatus_window = nil
                @skilltarget_window = nil
                @help_window.visible = false
                @resize_back = true
                return
            end
            if Input.trigger?(Input::C)
                @skill = @skill_window.skill
                if @skill == nil or not @actor.skill_can_use?(@skill.id)
                    $game_system.se_play($data_system.buzzer_se)
                    return
                end
                $game_system.se_play($data_system.decision_se)
                if @skill.scope >= 3
                    @skill_window.active = false
                    unless $ipm_enabled
                        @skilltarget_window.x = (@skill_window.index + 1) % 2 * 304
                        @skilltarget_window.visible = true
                    end
                    @skilltarget_window.active = true
                    if @skill.scope == 4 || @skill.scope == 6
                        @skilltarget_window.index = -1
                        if $ipm_enabled
                            @skillstatus_window.selected = true
                            @skillstatus_window.active = true
                        end
                    elsif @skill.scope == 7
                        if $ipm_enabled
                            @skillstatus_window.selected = true
                            @skillstatus_window.active = true
                        else
                            @skilltarget_window.index = @actor_index - 10
                        end
                    else
                        @skilltarget_window.index = 0
                    end
                else
                    if @skill.common_event_id > 0
                        $game_temp.common_event_id = @skill.common_event_id
                        $game_system.se_play(@skill.menu_se)
                        @actor.sp -= @skill.sp_cost
                        @skillstatus_window.refresh
                        @skill_window.refresh
                        @skilltarget_window.refresh
                        $scene = Scene_Map.new
                        return
                    end
                end
                return
            end
            if Input.trigger?(Input::R)
                $game_system.se_play($data_system.cursor_se)
                @status_window.index = (@status_window.index+1)%$game_party.actors.size
                @skill_window.dispose
                @skillstatus_window.dispose
                @skilltarget_window.dispose
                @resize_skill = true
                return
            end
            if Input.trigger?(Input::L)
                $game_system.se_play($data_system.cursor_se)
                @status_window.index = (@status_window.index-1)%$game_party.actors.size
                @skill_window.dispose
                @skillstatus_window.dispose
                @skilltarget_window.dispose
                @resize_skill = true
                return
            end
        end
        #-----------------------------------------------------------------------------
        # @ Update the skill target window
        #-----------------------------------------------------------------------------
        def update_skilltarget
            if Input.trigger?(Input::B)
                $game_system.se_play($data_system.cancel_se)
                @skill_window.active = true
                @skilltarget_window.active = false
                if $ipm_enabled
                    @skillstatus_window.selected = false
                    @skillstatus_window.active = false
                else
                    @skilltarget_window.visible = false
                end
                return
            end
            if Input.trigger?(Input::C)
                unless @actor.skill_can_use?(@skill.id)
                    $game_system.se_play($data_system.buzzer_se)
                    return
                end
                if @skilltarget_window.index == -1
                    used = false
                    for i in $game_party.actors
                        used |= i.skill_effect(@actor, @skill)
                    end
                end
                if @skilltarget_window.index <= -2
                    target = $game_party.actors[@skilltarget_window.index + 10]
                    used = target.skill_effect(@actor, @skill)
                end
                if @skilltarget_window.index >= 0
                    if @skilltarget_window.index >= @actor_index and $ipm_enabled
                        target = $game_party.actors[@skilltarget_window.index + 1]
                    else
                        target = $game_party.actors[@skilltarget_window.index]
                    end
                    used = target.skill_effect(@actor, @skill)
                end
                if used
                    $game_system.se_play(@skill.menu_se)
                    @actor.sp -= @skill.sp_cost
                    @skillstatus_window.refresh
                    @skill_window.refresh
                    @skilltarget_window.refresh
                    if $game_party.all_dead?
                        $scene = Scene_Gameover.new
                        return
                    end
                    if @skill.common_event_id > 0
                        $game_temp.common_event_id = @skill.common_event_id
                        $scene = Scene_Map.new
                        return
                    end
                end
                unless used
                    $game_system.se_play($data_system.buzzer_se)
                end
                return
            end
            if $ipm_enabled
                if Input.repeat?(Input::RIGHT) or Input.repeat?(Input::LEFT)
                    $game_system.se_play($data_system.cursor_se)
                    @skilltarget_window.active = false
                    @skillstatus_window.active = true
                    @skillstatus_window.selected = true
                    return
                end
            end
        end
        #-----------------------------------------------------------------------------
        # @ Update the skill status window
        #-----------------------------------------------------------------------------
        def update_skillstatus
            if Input.trigger?(Input::B)
                $game_system.se_play($data_system.cancel_se)
                @skill_window.active = true
                @skilltarget_window.active = false
                @skillstatus_window.selected = false
                return
            end
            if Input.trigger?(Input::C)
                unless @actor.skill_can_use?(@skill.id)
                    $game_system.se_play($data_system.buzzer_se)
                    return
                end
                if @skilltarget_window.index == -1
                    used = false
                    for i in $game_party.actors
                        used |= i.skill_effect(@actor, @skill)
                    end
                end
                if @skilltarget_window.index <= -2
                    target = @actor
                    used = target.skill_effect(@actor, @skill)
                end
                if @skilltarget_window.index >= 0
                    target = @actor
                    used = target.skill_effect(@actor, @skill)
                end
                if used
                    $game_system.se_play(@skill.menu_se)
                    @actor.sp -= @skill.sp_cost
                    @skillstatus_window.refresh
                    @skill_window.refresh
                    @skilltarget_window.refresh
                    if $game_party.all_dead?
                        $scene = Scene_Gameover.new
                        return
                    end
                    if @skill.common_event_id > 0
                        $game_temp.common_event_id = @skill.common_event_id
                        $scene = Scene_Map.new
                        return
                    end
                end
                unless used
                    $game_system.se_play($data_system.buzzer_se)
                end
                return
            end
            if Input.repeat?(Input::RIGHT) or Input.repeat?(Input::LEFT)
                if @skill.scope == 7
                    $game_system.se_play($data_system.buzzer_se)
                    return
                end
                $game_system.se_play($data_system.cursor_se)
                @skillstatus_window.active = false
                @skillstatus_window.selected = false
                @skilltarget_window.active = true
                return
            end
        end
        #-----------------------------------------------------------------------------
        # @ Refresh the equip screen
        #-----------------------------------------------------------------------------
        def equip_refresh
            unless @remove
                @item_window1.visible = (@right_window.index == 0)
                @item_window2.visible = (@right_window.index == 1)
                @item_window3.visible = (@right_window.index == 2)
                @item_window4.visible = (@right_window.index == 3)
                @item_window5.visible = (@right_window.index == 4)
            end
            item1 = @right_window.item
            case @right_window.index
            when -2
                @eitem_window = @blank_window
            when -1
                @eitem_window = @blank_window
            when 0
                @eitem_window = @item_window1
                newmode = 0
            when 1
                @eitem_window = @item_window2
                newmode = 1
            when 2
                @eitem_window = @item_window3
                newmode = 1
            when 3
                @eitem_window = @item_window4
                newmode = 1
            when 4
                @eitem_window = @item_window5
                newmode = 1
            end
            if @remove
                @eitem_window = @blank_window
            end
            if $ipm_enabled
                if newmode != @left_window.mode
                    @left_window.mode = newmode
                    @left_window.refresh
                end
                if @eitem_window.active or @remove
                    if @eitem_window.active
                        item2 = @eitem_window.item
                    end
                    last_hp = @actor.hp
                    last_sp = @actor.sp
                    old_atk = @actor.atk
                    old_pdef = @actor.pdef
                    old_mdef = @actor.mdef
                    old_str = @actor.str
                    old_dex = @actor.dex
                    old_agi = @actor.agi
                    old_int = @actor.int
                    old_eva = @actor.eva
                    @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
                    new_atk = @actor.atk
                    new_pdef = @actor.pdef
                    new_mdef = @actor.mdef
                    new_str = @actor.str
                    new_dex = @actor.dex
                    new_agi = @actor.agi
                    new_int = @actor.int
                    new_eva = @actor.eva
                    @left_window.changes = [0, 0, 0, 0, 0, 0, 0, 0]
                    @left_window.changes[0] = new_atk - old_atk
                    @left_window.changes[1] = new_pdef - old_pdef
                    @left_window.changes[2] = new_mdef - old_mdef
                    @left_window.changes[3] = new_str - old_str
                    @left_window.changes[4] = new_dex - old_dex
                    @left_window.changes[5] = new_agi - old_agi
                    @left_window.changes[6] = new_int - old_int
                    @left_window.changes[7] = new_eva - old_eva
                    @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
                    @actor.hp = last_hp
                    @actor.sp = last_sp
                    @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str,
                    new_dex, new_agi, new_int, new_eva)
                else
                    @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil)
                end
            else
                if @eitem_window.active
                    item2 = @eitem_window.item
                    last_hp = @actor.hp
                    last_sp = @actor.sp
                    @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
                    new_atk = @actor.atk
                    new_pdef = @actor.pdef
                    new_mdef = @actor.mdef
                    @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
                    @actor.hp = last_hp
                    @actor.sp = last_sp
                    @left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
                else
                    @left_window.set_new_parameters(nil, nil, nil)
                end
            end
        end
        #-----------------------------------------------------------------------------
        # @ Update the equip command window
        #-----------------------------------------------------------------------------
        def update_equip
            if Input.trigger?(Input::B)
                $game_system.se_play($data_system.cancel_se)
                @equiphelp_window.dispose
                @equip_window.dispose
                @left_window.dispose
                @right_window.dispose
                @blank_window.dispose
                @item_window1.dispose
                @item_window2.dispose
                @item_window3.dispose
                @item_window4.dispose
                @item_window5.dispose
                @equiphelp_window = nil
                @equip_window = nil
                @left_window = nil
                @right_window = nil
                @blank_window = nil
                @item_window1 = nil
                @item_window2 = nil
                @item_window3 = nil
                @item_window4 = nil
                @item_window5 = nil
                @resize_back = true
                return
            end
            if Input.trigger?(Input::C)
                $game_system.se_play($data_system.decision_se)
                case @equip_window.index
                when 0
                    @equip_window.active = false
                    @right_window.active = true
                    @right_window.index = @equip_index
                when 1
                    optimize
                    @left_window.refresh
                    @right_window.refresh
                    @item_window1.refresh
                    @item_window2.refresh
                    @item_window3.refresh
                    @item_window4.refresh
                    @item_window5.refresh
                when 2
                    @remove = true
                    @equip_window.active = false
                    @right_window.active = true
                    @right_window.index = @equip_index
                when 3
                    for i in 0..4
                        @actor.equip(i, 0)
                    end
                    @left_window.refresh
                    @right_window.refresh
                    @item_window1.refresh
                    @item_window2.refresh
                    @item_window3.refresh
                    @item_window4.refresh
                    @item_window5.refresh
                when 4
                    @equiphelp_window.dispose
                    @equip_window.dispose
                    @left_window.dispose
                    @right_window.dispose
                    @blank_window.dispose
                    @item_window1.dispose
                    @item_window2.dispose
                    @item_window3.dispose
                    @item_window4.dispose
                    @item_window5.dispose
                    @equiphelp_window = nil
                    @equip_window = nil
                    @left_window = nil
                    @right_window = nil
                    @blank_window = nil
                    @item_window1 = nil
                    @item_window2 = nil
                    @item_window3 = nil
                    @item_window4 = nil
                    @item_window5 = nil
                    @resize_back = true
                end
                return
            end
            if Input.trigger?(Input::R)
                $game_system.se_play($data_system.cursor_se)
                @status_window.index = (@status_window.index+1) % $game_party.actors.size
                @equiphelp_window.dispose
                @equip_window.dispose
                @left_window.dispose
                @right_window.dispose
                @blank_window.dispose
                @item_window1.dispose
                @item_window2.dispose
                @item_window3.dispose
                @item_window4.dispose
                @item_window5.dispose
                @resize_equip = true
                return
            end
            if Input.trigger?(Input::L)
                $game_system.se_play($data_system.cursor_se)
                @status_window.index = (@status_window.index-1) % $game_party.actors.size
                @equiphelp_window.dispose
                @equip_window.dispose
                @left_window.dispose
                @right_window.dispose
                @blank_window.dispose
                @item_window1.dispose
                @item_window2.dispose
                @item_window3.dispose
                @item_window4.dispose
                @item_window5.dispose
                @resize_equip = true
                return
            end
        end
        #-----------------------------------------------------------------------------
        # @ Update the right window
        #-----------------------------------------------------------------------------
        def update_right
            if Input.trigger?(Input::B)
                $game_system.se_play($data_system.cancel_se)
                if $ipm_enabled
                    @right_window.active = false
                    @equip_window.active = true
                    if @right_window.index >= 0
                        @equip_index = @right_window.index
                    end
                    @right_window.index = -1
                    @remove = false
                    @equiphelp_window.set_text("")
                    @left_window.refresh
                    return
                end
                @equiphelp_window.dispose
                @left_window.dispose
                @right_window.dispose
                @item_window1.dispose
                @item_window2.dispose
                @item_window3.dispose
                @item_window4.dispose
                @item_window5.dispose
                @equiphelp_window = nil
                @left_window = nil
                @right_window = nil
                @item_window1 = nil
                @item_window2 = nil
                @item_window3 = nil
                @item_window4 = nil
                @item_window5 = nil
                @resize_back = true
                return
            end
            if Input.trigger?(Input::C)
                if @remove
                    $game_system.se_play($data_system.decision_se)
                    @actor.equip(@right_window.index, 0)
                    @left_window.refresh
                    @right_window.refresh
                    return
                end
                if @actor.equip_fix?(@right_window.index)
                    $game_system.se_play($data_system.buzzer_se)
                    return
                end
                if $ipm_enabled
                    if @eitem_window.data.size == 0
                        $game_system.se_play($data_system.buzzer_se)
                        return
                    end
                end
                $game_system.se_play($data_system.decision_se)
                @right_window.active = false
                @eitem_window.active = true
                @eitem_window.index = 0
                return
            end
            if Input.trigger?(Input::R) and not $ipm_enabled
                $game_system.se_play($data_system.cursor_se)
                @status_window.index = (@status_window.index+1) % $game_party.actors.size
                @equiphelp_window.dispose
                @equip_window.dispose
                @left_window.dispose
                @right_window.dispose
                @blank_window.dispose
                @item_window1.dispose
                @item_window2.dispose
                @item_window3.dispose
                @item_window4.dispose
                @item_window5.dispose
                @resize_equip = true
                return
            end
            if Input.trigger?(Input::L) and not $ipm_enabled
                $game_system.se_play($data_system.cursor_se)
                @status_window.index = (@status_window.index-1) % $game_party.actors.size
                @equiphelp_window.dispose
                @equip_window.dispose
                @left_window.dispose
                @right_window.dispose
                @blank_window.dispose
                @item_window1.dispose
                @item_window2.dispose
                @item_window3.dispose
                @item_window4.dispose
                @item_window5.dispose
                @resize_equip = true
                return
            end
        end
        #-----------------------------------------------------------------------------
        # @ Update the equip item window
        #-----------------------------------------------------------------------------
        def update_eitem
            if Input.trigger?(Input::B)
                $game_system.se_play($data_system.cancel_se)
                @right_window.active = true
                @eitem_window.active = false
                @eitem_window.index = -1
                return
            end
            if Input.trigger?(Input::C)
                $game_system.se_play($data_system.equip_se)
                item = @eitem_window.item
                @actor.equip(@right_window.index, item.id)
                @right_window.active = true
                @eitem_window.active = false
                @eitem_window.index = -1
                @right_window.refresh
                @eitem_window.refresh
                return
            end
        end
        #-----------------------------------------------------------------------------
        # @ Optimize equipment (by RPGAdvocate)
        #-----------------------------------------------------------------------------
        def optimize
            object = $data_weapons[@actor.weapon_id]
            optimal = object.id
            current = 0.00
            if @actor.weapon_id != 0
                current = object.atk
            else
                optimal = 0
            end
            max_eval = current
            @actor.equip(0, 0)
            flag = false
            zero_flag = true
            for weapon in $data_weapons
                if !flag
                    flag = true
                    next
                end
                evaluation = weapon.atk
                if evaluation > 0
                    zero_flag = false
                end
                if @actor.equippable?(weapon) &&
                    $game_party.weapon_number(weapon.id) > 0 && evaluation > max_eval
                    max_eval = evaluation
                    optimal = weapon.id
                end
            end
            if zero_flag
                optimal = 0
            end
            @actor.equip(0, optimal)
            not_equipped = false
            for i in 1..4
                case i
                when 1
                    if @actor.armor1_id == 0
                        not_equipped = true
                    else
                        object = $data_armors[@actor.armor1_id]
                    end
                when 2
                    if @actor.armor2_id == 0
                        not_equipped = true
                    else
                        object = $data_armors[@actor.armor2_id]
                    end
                when 3
                    if @actor.armor3_id == 0
                        not_equipped = true
                    else
                        object = $data_armors[@actor.armor3_id]
                    end
                when 4
                    if @actor.armor4_id == 0
                        not_equipped = true
                    else
                        object = $data_armors[@actor.armor4_id]
                    end
                end
                optimal = object.id
                current = 0.00
                if not_equipped = false
                    current = object.pdef * 0.75 + object.mdef * 0.25
                else
                    optimal = 0
                end
                max_eval = current
                @actor.equip(i, 0)
                flag = false
                zero_flag = true
                for armor in $data_armors
                    if !flag
                        flag = true
                        next
                    end
                    if armor.kind != i-1
                        next
                    end
                    evaluation = armor.pdef * 0.75 + armor.mdef * 0.25
                    if evaluation > 0
                        zero_flag = false
                    end
                    if @actor.equippable?(armor) &&
                        $game_party.armor_number(armor.id) > 0 && evaluation > max_eval
                        max_eval = evaluation
                        optimal = armor.id
                    end
                end
                if zero_flag
                    optimal = 0
                end
                @actor.equip(i, optimal)
            end
        end
        #----------------------------------------------------------------------------
        # @ Update the large status window
        #----------------------------------------------------------------------------
        def update_playerstatus
            if Input.trigger?(Input::B)
                $game_system.se_play($data_system.cancel_se)
                @playerstatus_window.dispose
                @playerstatus_window = nil
                @resize_back = true
                return
            end
            if Input.trigger?(Input::R)
                $game_system.se_play($data_system.cursor_se)
                @status_window.index = (@status_window.index+1) % $game_party.actors.size
                @playerstatus_window.dispose
                @resize_status = true
                return
            end
            if Input.trigger?(Input::L)
                $game_system.se_play($data_system.cursor_se)
                @status_window.index = (@status_window.index-1) % $game_party.actors.size
                @playerstatus_window.dispose
                @resize_status = true
                return
            end
        end
        #-----------------------------------------------------------------------------
        # @ Update the save screen
        #-----------------------------------------------------------------------------
        def update_save
            if Input.trigger?(Input::C)
                $game_system.se_play($data_system.save_se)
                file = File.open("Save#{@file_index + 1}.rxdata", "wb")
                characters = []
                for i in 0...$game_party.actors.size
                    actor = $game_party.actors[i]
                    characters.push([actor.character_name, actor.character_hue])
                end
                Marshal.dump(characters, file)
                Marshal.dump(Graphics.frame_count, file)
                $game_system.save_count += 1
                $game_system.magic_number = $data_system.magic_number
                Marshal.dump($game_system, file)
                Marshal.dump($game_switches, file)
                Marshal.dump($game_variables, file)
                Marshal.dump($game_self_switches, file)
                Marshal.dump($game_screen, file)
                Marshal.dump($game_actors, file)
                Marshal.dump($game_party, file)
                Marshal.dump($game_troop, file)
                Marshal.dump($game_map, file)
                Marshal.dump($game_player, file)
                file.close
                @savefile_windows[@file_index].refresh
                $game_temp.last_file_index = @file_index
                for i in 0..10
                    @help_window.x += 64
                    @savefile_windows[0].x -= 64
                    @savefile_windows[1].x += 64
                    @savefile_windows[2].x -= 64
                    @savefile_windows[3].x += 64
                    Graphics.update
                end
                @savefile_windows_active = false
                @command_window.active = true
                @help_window.back_opacity = 100
                @help_window.visible = false
                @help_window.x = 0
                return
            end
            if Input.trigger?(Input::B)
                $game_system.se_play($data_system.cancel_se)
                for i in 0..10
                    @help_window.x += 64
                    @savefile_windows[0].x -= 64
                    @savefile_windows[1].x += 64
                    @savefile_windows[2].x -= 64
                    @savefile_windows[3].x += 64
                    Graphics.update
                end
                @savefile_windows_active = false
                @command_window.active = true
                @help_window.back_opacity = 100
                @help_window.visible = false
                @help_window.x = 0
                return
            end
            if Input.repeat?(Input::DOWN)
                if Input.trigger?(Input::DOWN) or @file_index < 3
                    $game_system.se_play($data_system.cursor_se)
                    @savefile_windows[@file_index].selected = false
                    @file_index = (@file_index + 1) % 4
                    @savefile_windows[@file_index].selected = true
                    return
                end
            end
            if Input.repeat?(Input::UP)
                if Input.trigger?(Input::UP) or @file_index > 0
                    $game_system.se_play($data_system.cursor_se)
                    @savefile_windows[@file_index].selected = false
                    @file_index = (@file_index + 3) % 4
                    @savefile_windows[@file_index].selected = true
                    return
                end
            end
        end
    end
    

     

     

     

  8. Custom Menu System

    Descrizione

     

    Un menù personalizzato. Funziona solo con due personaggi.

    Autore

     

    Constance

    Allegati

     

    Screen 1

    Istruzioni per l'uso

     

    Create una classe sopra a main e incollate

     

     

    #============================================================
    # Custom Menu System
    # created by: Constance
    # created on: Dec. 26, 2005
    # version: 2.1
    # credits: Acedent Prone, Diego, Dubealex
    # special thanks credits goes to: SephirothSpawn, couldn't have done it without you
    # RMXP - Underground - The Underground Gaming Zone
    #============================================================
    class Window_Base < Window
    	
    	def draw_actor_level(actor, x, y)
    		self.contents.font.color = normal_color
    		self.contents.draw_text(x + 4, y + 20, 24, 32, actor.level.to_s, 2)
    	end
    	
    	def draw_actor_battler(actor, x, y)
    		bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
    		cw = bitmap.width
    		ch = bitmap.height
    		src_rect = Rect.new(0, 0, cw, ch)
    		self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
    	end
    	
    	def draw_sprite(x, y, name, hue, pose, frame)
    		bitmap = RPG::Cache.character(name, hue)
    		cw = bitmap.width / 4
    		ch = bitmap.height / 4
    		case pose
    		when 0;a = 0
    		when 1;a = ch
    		when 2;a = ch * 3
    		when 3;a = ch * 2
    		end
    		
    		case frame
    		when 0;b = 0
    		when 1;b = cw
    		when 2;b = cw * 2
    		when 3;b = cw * 3
    		end
    		src_rect = Rect.new(b, a, cw, ch)
    		self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
    	end
    	
    	self.contents.font.color = system_color
    	self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
    	if width - 32 >= 108
    		hp_x = x + width - 108
    		flag = true
    	elsif width - 32 >= 48
    		hp_x = x + width - 48
    		flag = false
    	end
    	self.contents.font.color = actor.hp == 0 ? knockout_color :
    	actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
    	self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
    	if flag
    		self.contents.font.color = normal_color
    		self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
    		self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
    	end
    end
    
    def draw_actor_sp2(actor, x, y, width = 144)
    	self.contents.font.color = system_color
    	self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
    	if width - 32 >= 108
    		sp_x = x + width - 108
    		flag = true
    	elsif width - 32 >= 48
    		sp_x = x + width - 48
    		flag = false
    	end
    	self.contents.font.color = actor.sp == 0 ? knockout_color :
    	actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
    	self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
    	if flag
    		self.contents.font.color = normal_color
    		self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
    		self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
    	end
    end
    
    def draw_actor_name(actor, x, y)
    	self.contents.font.color = normal_color
    	self.contents.draw_text(x, y, 144, 32, actor.name)
    end
    
    def draw_actor_parameter2(actor, x, y, type)
    	case type
    	when 0
    		parameter_name = $data_system.words.atk
    		parameter_value = actor.atk
    	when 1
    		parameter_name = $data_system.words.pdef
    		parameter_value = actor.pdef
    	when 2
    		parameter_name = "Déf. magique"
    		parameter_value = actor.mdef
    	when 3
    		parameter_name = $data_system.words.str
    		parameter_value = actor.str
    	when 4
    		parameter_name = $data_system.words.dex
    		parameter_value = actor.dex
    	when 5
    		parameter_name = $data_system.words.agi
    		parameter_value = actor.agi
    	when 6
    		parameter_name = $data_system.words.int
    		parameter_value = actor.int
    	end
    	self.contents.font.color = system_color
    	self.contents.font.size = 20
    	self.contents.draw_text(x, y, 120, 32, parameter_name)
    	self.contents.font.color = normal_color
    	self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
    end
    
    def draw_actor_barz(actor,x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255))
    	if type == "horizontal"
    		width = length
    		height = thick
    		self.contents.fill_rect(x-1, y - 1, width + 1, height + 3, Color.new(0, 0, 0, 255))
    		self.contents.fill_rect(x, y, width + 1, height + 1, Color.new(0, 0, 0, 255))
    		w = width * e1.to_f / e2.to_f
    		for i in 0..height
    			r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
    			g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
    			b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
    			a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
    			self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
    		end
    	end
    end
    end
    
    class Window_Selectable2 < Window_Base
    
    attr_reader :index
    attr_reader :help_window
    
    def initialize(x, y, width, height)
    	super(x, y, width, height)
    	@item_max = 1
    	@column_max = 1
    	@index = -1
    end
    
    def index=(index)
    	@index = index
    	if self.active and @help_window != nil
    		update_help
    	end
    	update_cursor_rect
    end
    
    def row_max
    	return (@item_max + @column_max - 1) / @column_max
    end
    
    def top_row
    	return self.oy / 32
    end
    
    def top_row=(row)
    	if row < 0
    		row = 0
    	end
    	if row > row_max - 1
    		row = row_max - 1
    	end
    	self.oy = row * 32
    end
    
    def page_row_max
    	return (self.height - 32) / 32
    end
    def page_item_max
    	return page_row_max * @column_max
    end
    
    def help_window=(help_window)
    	@help_window = help_window
    	if self.active and @help_window != nil
    		update_help
    	end
    end
    
    def update_cursor_rect
    	if @index < 0
    		self.cursor_rect.empty
    		return
    	end
    	row = @index / @column_max
    	if row < self.top_row
    		self.top_row = row
    	end
    	
    	if row > self.top_row + (self.page_row_max - 1)
    		self.top_row = row - (self.page_row_max - 1)
    	end
    	cursor_width = self.width / @column_max - 32
    	x = @index % @column_max * (cursor_width + 32)
    	y = @index / @column_max * 32 - self.oy
    	self.cursor_rect.set(x, y, 65, 32)
    end
    
    def update
    	super
    	if self.active and @item_max > 0 and @index >= 0
    		if Input.repeat?(Input::DOWN)
    			if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
    				@index < @item_max - @column_max
    				$game_system.se_play($data_system.cursor_se)
    				@index = (@index + @column_max) % @item_max
    			end
    		end
    		if Input.repeat?(Input::UP)
    			if (@column_max == 1 and Input.trigger?(Input::UP)) or
    				@index >= @column_max
    				$game_system.se_play($data_system.cursor_se)
    				@index = (@index - @column_max + @item_max) % @item_max
    			end
    		end
    		if Input.repeat?(Input::RIGHT)
    			if @column_max >= 2 and @index < @item_max - 1
    				$game_system.se_play($data_system.cursor_se)
    				@index += 1
    			end
    		end
    		
    		if Input.repeat?(Input::LEFT)
    			if @column_max >= 2 and @index > 0
    				$game_system.se_play($data_system.cursor_se)
    				@index -= 1
    			end
    		end
    		if Input.repeat?(Input::R)
    			if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
    				$game_system.se_play($data_system.cursor_se)
    				@index = [@index + self.page_item_max, @item_max - 1].min
    				self.top_row += self.page_row_max
    				def draw_actor_hp(actor, x, y, width = 144)
    					self.contents.font.name = "Tahoma"
    					self.contents.font.size = 20
    					self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
    					if width - 32 >= 108
    						hp_x = x + width - 108
    						flag = true
    					elsif width - 32 >= 48
    						hp_x = x + width - 48
    						flag = false
    					end
    					self.contents.font.color = actor.hp == 0 ? knockout_color :
    					actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
    					self.contents.draw_text(hp_x + 30, y, 48, 32, actor.hp.to_s, 2)
    					if flag
    						self.contents.font.color = normal_color
    						self.contents.draw_text(hp_x + 30 + 48, y, 12, 32, "/", 1)
    						self.contents.draw_text(hp_x + 30 + 60, y, 48, 32, actor.maxhp.to_s)
    					end
    				end
    				#============================================
    				def draw_actor_sp(actor, x, y, width = 144)
    					self.contents.font.name = "Tahoma"
    					self.contents.font.size = 20
    					self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
    					self.contents.font.color = Color.new(74, 230, 51, 225)
    					if width - 32 >= 108
    						sp_x = x + width - 108
    						flag = true
    					elsif width - 32 >= 48
    						sp_x = x + width - 48
    						flag = false
    					end
    					self.contents.font.color = actor.sp == 0 ? knockout_color :
    					actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
    					self.contents.draw_text(sp_x + 30, y, 48, 32, actor.sp.to_s, 2)
    					if flag
    						self.contents.font.color = normal_color
    						self.contents.draw_text(sp_x + 30 + 48, y, 12, 32, "/", 1)
    						self.contents.draw_text(sp_x + 30 + 60, y, 48, 32, actor.maxsp.to_s)
    					end
    				end
    				
    				def draw_actor_level3(actor, x, y)
    					self.contents.font.color = system_color
    					self.contents.draw_text(x, y, 32, 32, "Lv")
    					self.contents.font.color = normal_color
    					self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2)
    				end
    				
    				def draw_actor_hp2(actor, x, y, width = 144)
    				end
    			end
    			
    			if Input.repeat?(Input::L)
    				if self.top_row > 0
    					$game_system.se_play($data_system.cursor_se)
    					@index = [@index - self.page_item_max, 0].max
    					self.top_row -= self.page_row_max
    				end
    			end
    		end
    		if self.active and @help_window != nil
    			update_help
    		end
    		update_cursor_rect
    	end
    end
    
    class Window_Command2 < Window_Selectable2
    	
    	attr_accessor :commands
    	
    	def initialize(commands)
    		super(0, 0, 270, 101)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		@commands = commands
    		@width = width
    		@item_max = 6
    		@column_max = 3
    		@commands = commands
    		self.index = 0
    	end
    end
    
    class Dummy_Window_Command < Window_Base
    	
    	def initialize
    		super(0, 0, 270, 101)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		self.contents.font.name = "Tahoma"
    		self.contents.font.size = 22
    		refresh
    	end
    	
    	def refresh
    		self.contents.clear
    		self.contents.draw_text(-35, 0, 124, 32, $data_system.words.item, 1)
    		self.contents.draw_text(50, 0, 124, 32, $data_system.words.skill, 1)
    		self.contents.draw_text(145, 0, 124, 32, $data_system.words.equip, 1)
    		self.contents.draw_text(-35, 35, 124, 32, "Charger", 1)
    		self.contents.draw_text(50, 35, 124, 32, "Sauver", 1)
    		self.contents.draw_text(140, 35, 124, 32, "Quitter", 1)
    	end
    end
    
    
    class Dummy_Window_Command2 < Window_Base
    	
    	def initialize
    		super(0, 0, 270, 101)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		self.contents.font.name = "Tahoma"
    		self.contents.font.size = 22
    		refresh
    	end
    	
    	def refresh
    		self.contents.clear
    		bitmap = RPG::Cache.icon("034-Item03")
    		self.contents.blt(35, 4, bitmap, Rect.new(0, 0, 24, 24))
    		
    		bitmap = RPG::Cache.icon("050-Skill07")
    		self.contents.blt(115, 4, bitmap, Rect.new(0, 0, 24, 24))
    		
    		bitmap = RPG::Cache.icon("013-Body01")
    		self.contents.blt(205, 4, bitmap, Rect.new(0, 0, 24, 24))
    		
    		bitmap = RPG::Cache.icon("033-Item02")
    		self.contents.blt(35, 39, bitmap, Rect.new(0, 0, 24, 24))
    		
    		bitmap = RPG::Cache.icon("037-Item06")
    		self.contents.blt(115, 39, bitmap, Rect.new(0, 0, 24, 24))
    		
    		bitmap = RPG::Cache.icon("039-Item08")
    		self.contents.blt(205, 39, bitmap, Rect.new(0, 0, 24, 24))
    	end
    end
    
    class Scene_Title
    	$map_infos = load_data("Data/MapInfos.rxdata")
    	for key in $map_infos.keys
    		$map_infos[key] = $map_infos[key].name
    	end
    end
    
    class Game_Actor < Game_Battler
    	def now_exp
    		return @exp - @exp_list[@level]
    	end
    	def next_exp
    		return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
    	end
    	
    end
    
    class Game_Map
    	
    	def name
    		$map_infos[@map_id]
    	end
    	
    end
    
    class Window_PlayTime < Window_Base
    	
    	def initialize
    		super(0, 0, 150, 101)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		refresh
    	end
    	
    	def refresh
    		self.contents.clear
    		self.contents.font.color = system_color
    		self.contents.font.size = 20
    		self.contents.draw_text(4, 0, 120, 32, "Temps:")
    		@total_sec = Graphics.frame_count / Graphics.frame_rate
    		hour = @total_sec / 60 / 60
    		min = @total_sec / 60 % 60
    		sec = @total_sec % 60
    		text = sprintf("d:d:d", hour, min, sec)
    		self.contents.font.color = normal_color
    		self.contents.draw_text(-15, 32, 120, 32, text, 2)
    	end
    	
    	def update
    		super
    		if Graphics.frame_count / Graphics.frame_rate != @total_sec
    			refresh
    		end
    	end
    end
    
    class Window_Location < Window_Base
    	def initialize
    		super(0, 0, 220,101)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		self.contents.font.name = "Tahoma"
    		self.contents.font.size = 22
    		refresh
    	end
    	
    	def refresh
    		bitmap = RPG::Cache.icon("032-Item01")
    		self.contents.blt(165, y + 40, bitmap, Rect.new(0, 0, 24, 24))
    		cx = contents.text_size($data_system.words.gold).width
    		self.contents.font.color = normal_color
    		self.contents.font.size = 20
    		self.contents.draw_text(44, 40, 120-cx-2, 32, $game_party.gold.to_s, 2)
    		self.contents.font.color = system_color
    		self.contents.draw_text(164-cx, 40, cx, 32, $data_system.words.gold, 2)
    		lx = contents.text_size("Location:").width
    		self.contents.draw_text(4, -55, lx, 144, "Location:", 1)
    		self.contents.font.color = normal_color
    		self.contents.font.size = 20
    		self.contents.draw_text(10 + lx, 1, lx + 40, 32, $game_map.name.to_s, 1)
    	end
    	
    end
    
    class Window_GraphicCharacter1 < Window_Base
    	def initialize
    		super(0, 0, 200,180)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		self.contents.font.name = "Tahoma"
    		self.contents.font.size = 22
    		@pose, @frame = 0, 0
    		refresh
    	end
    	
    	def refresh
    		self.contents.clear
    		actor = $game_party.actors[0]
    		draw_sprite(25, 55, actor.character_name, actor.character_hue , @pose, @frame)
    	end
    	
    	def frame_update
    		@frame == 3 ? @frame = 0 : @frame += 1
    		refresh
    	end
    	
    	def update_pose(direction)
    		if direction == 0
    			@pose == 0 ? @pose = 3 : @pose -= 1
    		else
    			@pose == 3 ? @pose = 0 : @pose += 1
    		end
    		refresh
    	end
    end
    class Window_GraphicCharacter2 < Window_Base
    	def initialize
    		super(0, 0, 200,180)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		self.contents.font.name = "Tahoma"
    		self.contents.font.size = 22
    		@pose, @frame = 0, 0
    		refresh
    	end
    	
    	def refresh
    		self.contents.clear
    		if $game_party.actors.size < 2
    			self.contents.draw_text(25, 55, 50, 28, "Empty")
    		else
    			actor = $game_party.actors[1]
    			draw_sprite(25, 55, actor.character_name, actor.character_hue , @pose, @frame)
    		end
    	end
    	
    	def frame_update
    		@frame == 3 ? @frame = 0 : @frame += 1
    		refresh
    	end
    	
    	def update_pose(direction)
    		if direction == 0
    			@pose == 0 ? @pose = 3 : @pose -= 1
    		else
    			@pose == 3 ? @pose = 0 : @pose += 1
    		end
    		refresh
    	end
    end
    
    class Window_Character1 < Window_Base
    	
    	def initialize
    		super(0, 0, 200,180)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		self.contents.font.name = "Tahoma"
    		self.contents.font.size = 22
    		@pose, @frame = 0, 0
    		refresh
    	end
    	
    	def refresh
    		self.contents.clear
    		actor = $game_party.actors[0]
    		draw_actor_hp(actor, x + 4, y + 55, 144)
    		draw_actor_barz(actor, x + 4, y + 81, "horizontal", 160, 4, actor.hp, actor.maxhp, Color.new(102, --200, 160, 0), Color.new(0, 0, 0, 0))
    		draw_actor_sp(actor, x + 4, y + 110, 144)
    		draw_actor_barz(actor, x + 4, y + 136, "horizontal", 160, 4, actor.sp, actor.maxsp, Color.new(0, 0, 0, 0), Color.new(-102, 160, -200, 0))
    		self.contents.font.size = 20
    		self.contents.draw_text(x + 50, y - 55, 144, 144, "Classe:")
    		draw_actor_class(actor, x + 100, y + 1)
    		self.contents.draw_text(x + 50, y - 62, 144, 170, "_____________________")
    		self.contents.draw_text(x + 80, y - 30, 144, 144, "Lv:")
    		draw_actor_level(actor, x + 95, y + 6)
    	end
    	
    end
    
    class Window_Character2 < Window_Base
    	
    	def initialize
    		super(0, 0, 200,200)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		self.contents.font.name = "Tahoma"
    		self.contents.font.size = 22
    		refresh
    	end
    	
    	def refresh
    		self.contents.clear
    		if $game_party.actors.size < 2
    			self.contents.draw_text(25, 55, 50, 28, "Empty")
    		else
    			actor = $game_party.actors[1]
    			draw_actor_hp(actor, x + 4, y + 55, 144)
    			draw_actor_barz(actor, x + 4, y + 81, "horizontal", 160, 4, actor.hp, actor.maxhp, Color.new(102, --200, 160, 0), Color.new(0, 0, 0, 0))
    			draw_actor_sp(actor, x + 4, y + 110, 144)
    			draw_actor_barz(actor, x + 4, y + 136, "horizontal", 160, 4, actor.sp, actor.maxsp, Color.new(0, 0, 0, 0), Color.new(-102, 160, -200, 0))
    			self.contents.font.size = 20
    			self.contents.draw_text(x + 50, y - 55, 144, 144, "Classe:")
    			draw_actor_class(actor, x + 100, y + 1)
    			self.contents.draw_text(x + 50, y - 62, 144, 170, "_____________________")
    			self.contents.draw_text(x + 80, y - 30, 144, 144, "Lv:")
    			draw_actor_level(actor, x + 95, y + 6)
    		end
    	end
    	
    end
    
    class Window_Character_Selection2 < Window_Base
    	
    	def initialize
    		super(0, 0, 640, 51)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		self.visible = false
    		self.z = 2000
    		refresh
    	end
    	
    	def refresh
    		self.contents.clear
    		self.contents.font.color = system_color
    		cx = contents.text_size("Sélectionnez un personnage.").width
    		self.contents.draw_text(145, -6, cx, 32, "Sélectionnez un personnage.", 2)
    	end
    end
    
    #==============================================================================
    # ** Window_Selectable
    #------------------------------------------------------------------------------
    # This window class contains cursor movement and scroll functions.
    #==============================================================================
    
    class Window_Selectable3 < Window_Base
    	#--------------------------------------------------------------------------
    	# * Public Instance Variables
    	#--------------------------------------------------------------------------
    	attr_reader :index # cursor position
    	attr_reader :help_window # help window
    	#--------------------------------------------------------------------------
    	# * Object Initialization
    	# x : window x-coordinate
    	# y : window y-coordinate
    	# width : window width
    	# height : window height
    	#--------------------------------------------------------------------------
    	def initialize(x, y, width, height)
    		super(x, y, width, height)
    		@item_max = 1
    		@column_max = 1
    		@index = -1
    	end
    	#--------------------------------------------------------------------------
    	# * Set Cursor Position
    	# index : new cursor position
    	#--------------------------------------------------------------------------
    	def index=(index)
    		@index = index
    		# Update Help Text (update_help is defined by the subclasses)
    		if self.active and @help_window != nil
    			update_help
    		end
    		# Update cursor rectangle
    		update_cursor_rect
    	end
    	#--------------------------------------------------------------------------
    	# * Get Row Count
    	#--------------------------------------------------------------------------
    	def row_max
    		# Compute rows from number of items and columns
    		return (@item_max + @column_max - 1) / @column_max
    	end
    	#--------------------------------------------------------------------------
    	# * Get Top Row
    	#--------------------------------------------------------------------------
    	def top_row
    		# Divide y-coordinate of window contents transfer origin by 1 row
    		# height of 32
    		return self.oy / 32
    	end
    	#--------------------------------------------------------------------------
    	# * Set Top Row
    	# row : row shown on top
    	#--------------------------------------------------------------------------
    	def top_row=(row)
    		# If row is less than 0, change it to 0
    		if row < 0
    			row = 0
    		end
    		# If row exceeds row_max - 1, change it to row_max - 1
    		if row > row_max - 1
    			row = row_max - 1
    		end
    		# Multiply 1 row height by 32 for y-coordinate of window contents
    		# transfer origin
    		self.oy = row * 32
    	end
    	#--------------------------------------------------------------------------
    	# * Get Number of Rows Displayable on 1 Page
    	#--------------------------------------------------------------------------
    	def page_row_max
    		# Subtract a frame height of 32 from the window height, and divide it by
    		# 1 row height of 32
    		return (self.height - 32) / 32
    	end
    	#--------------------------------------------------------------------------
    	# * Get Number of Items Displayable on 1 Page
    	#--------------------------------------------------------------------------
    	def page_item_max
    		# Multiply row count (page_row_max) times column count (@column_max)
    		return page_row_max * @column_max
    	end
    	#--------------------------------------------------------------------------
    	# * Set Help Window
    	# help_window : new help window
    	#--------------------------------------------------------------------------
    	def help_window=(help_window)
    		@help_window = help_window
    		# Update help text (update_help is defined by the subclasses)
    		if self.active and @help_window != nil
    			update_help
    		end
    	end
    	#--------------------------------------------------------------------------
    	# * Update Cursor Rectangle
    	#--------------------------------------------------------------------------
    	def update_cursor_rect
    		# If cursor position is less than 0
    		if @index < 0
    			self.cursor_rect.empty
    			return
    		end
    		# Get current row
    		row = @index / @column_max
    		# If current row is before top row
    		if row < self.top_row
    			# Scroll so that current row becomes top row
    			self.top_row = row
    		end
    		# If current row is more to back than back row
    		if row > self.top_row + (self.page_row_max - 1)
    			# Scroll so that current row becomes back row
    			self.top_row = row - (self.page_row_max - 1)
    		end
    		# Calculate cursor width
    		cursor_width = self.width / @column_max - 32
    		# Calculate cursor coordinates
    		x = @index % @column_max * (cursor_width + 32)
    		y = @index / @column_max * 32 - self.oy
    		# Update cursor rectangle
    		if $game_party.actors.size < 2
    			self.cursor_rect.set(250 + @index * 140, y, 100, 20)
    		else
    			self.cursor_rect.set(160 + @index * 140, y, 150, 20)
    		end
    	end
    	#--------------------------------------------------------------------------
    	# * Frame Update
    	#--------------------------------------------------------------------------
    	def update
    		super
    		# If cursor is movable
    		if self.active and @item_max > 0 and @index >= 0
    			# If pressing down on the directional buttons
    			if Input.repeat?(Input::DOWN)
    				# If column count is 1 and directional button was pressed down with no
    				# repeat, or if cursor position is more to the front than
    				# (item count - column count)
    				if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
    					@index < @item_max - @column_max
    					# Move cursor down
    					$game_system.se_play($data_system.cursor_se)
    					@index = (@index + @column_max) % @item_max
    				end
    			end
    			# If the up directional button was pressed
    			if Input.repeat?(Input::UP)
    				# If column count is 1 and directional button was pressed up with no
    				# repeat, or if cursor position is more to the back than column count
    				if (@column_max == 1 and Input.trigger?(Input::UP)) or
    					@index >= @column_max
    					# Move cursor up
    					$game_system.se_play($data_system.cursor_se)
    					@index = (@index - @column_max + @item_max) % @item_max
    				end
    			end
    			# If the right directional button was pressed
    			if Input.repeat?(Input::RIGHT)
    				# If column count is 2 or more, and cursor position is closer to front
    				# than (item count -1)
    				if @column_max >= 2 and @index < @item_max - 1
    					# Move cursor right
    					$game_system.se_play($data_system.cursor_se)
    					@index += 1
    				end
    			end
    			# If the left directional button was pressed
    			if Input.repeat?(Input::LEFT)
    				# If column count is 2 or more, and cursor position is more back than 0
    				if @column_max >= 2 and @index > 0
    					# Move cursor left
    					$game_system.se_play($data_system.cursor_se)
    					@index -= 1
    				end
    			end
    			# If R button was pressed
    			if Input.repeat?(Input::R)
    				# If bottom row being displayed is more to front than bottom data row
    				if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
    					# Move cursor 1 page back
    					$game_system.se_play($data_system.cursor_se)
    					@index = [@index + self.page_item_max, @item_max - 1].min
    					self.top_row += self.page_row_max
    				end
    			end
    			# If L button was pressed
    			if Input.repeat?(Input::L)
    				# If top row being displayed is more to back than 0
    				if self.top_row > 0
    					# Move cursor 1 page forward
    					$game_system.se_play($data_system.cursor_se)
    					@index = [@index - self.page_item_max, 0].max
    					self.top_row -= self.page_row_max
    				end
    			end
    		end
    		# Update help text (update_help is defined by the subclasses)
    		if self.active and @help_window != nil
    			update_help
    		end
    		# Update cursor rectangle
    		update_cursor_rect
    	end
    end
    
    class Window_StatusCharacter1 < Window_Base
    	
    	def initialize
    		super(0, 0, 440,180)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		self.contents.font.name = "Tahoma"
    		self.contents.font.size = 22
    		refresh
    	end
    	
    	def refresh
    		self.contents.clear
    		self.contents.font.color = system_color
    		self.contents.font.size = 20
    		self.contents.draw_text(215, -63, 144, 144, "Statut:")
    		self.contents.draw_text(190, 114, 120, 32, "Expérience:")
    		self.contents.draw_text(0, -7, 120, 32, "Nom:")
    		actor = @actor
    		@actor = $game_party.actors[0]
    		draw_actor_name(@actor, x + 55, y - 7)
    		draw_actor_state(@actor, 325, -8, 144)
    		draw_actor_parameter2(@actor, 0, 15 + 10, 0)
    		draw_actor_parameter2(@actor, 0, 15 + 40, 1)
    		draw_actor_parameter2(@actor, 0, 15 + 70, 2)
    		draw_actor_parameter2(@actor, 0, 15 + 100, 3)
    		draw_actor_parameter2(@actor, 190, 15 + 10, 4)
    		draw_actor_parameter2(@actor, 190, 15 + 40, 5)
    		draw_actor_parameter2(@actor, 190, 15 + 70, 6)
    		draw_actor_barz(@actor, 0, 15 + 37, "horizontal", 168, 1, @actor.atk, 999, Color.new(242, 2, 6, 255), Color.new(253, 53, 56, 255))
    		draw_actor_barz(@actor, 0, 15 + 67, "horizontal", 168, 1, @actor.pdef, 999, Color.new(228, 253, 48, 255), Color.new(238, 254, 124, 255))
    		draw_actor_barz(@actor, 0, 15 + 97, "horizontal", 168, 1, @actor.mdef, 999, Color.new(229, 78, 253, 255), Color.new(237, 134, 254, 255))
    		draw_actor_barz(@actor, 0, 15 + 127, "horizontal", 168, 1, @actor.str, 999, Color.new(254, 209, 154, 255), Color.new(253, 163, 53, 255))
    		draw_actor_barz(@actor, 190, 15 + 37, "horizontal", 168, 1, @actor.dex, 999, Color.new(222, 222, 222, 255), Color.new(255, 255, 255, 255))
    		draw_actor_barz(@actor, 190, 15 + 67, "horizontal", 168, 1, @actor.agi, 999, Color.new(8, 160, 253, 255), Color.new(119, 203, 254, 255))
    		draw_actor_barz(@actor, 190, 15 + 97, "horizontal", 168, 1, @actor.int, 999, Color.new(33, 253, 86, 255), Color.new(124, 254, 155, 255))
    		draw_actor_barz(@actor, 190, 15 + 127, "horizontal", 168, 1, @actor.now_exp.to_f, @actor.next_exp, Color.new(-255, 200, -86, 255), Color.new(-168, -157, 184, 255))
    	end
    	
    end
    
    class Window_StatusCharacter2 < Window_Base
    	
    	def initialize
    		super(0, 0, 440,200)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		self.contents.font.name = "Tahoma"
    		self.contents.font.size = 22
    		refresh
    	end
    	
    	def refresh
    		self.contents.clear
    		if $game_party.actors.size < 2
    			self.contents.draw_text(25, 55, 50, 28, "Empty")
    		else
    			self.contents.font.color = system_color
    			self.contents.font.size = 20
    			self.contents.draw_text(215, -63, 144, 144, "Statut:")
    			self.contents.draw_text(190, 114, 120, 32, "Expérience:")
    			self.contents.draw_text(0, -7, 120, 32, "Nom:")
    			actor = @actor
    			@actor = $game_party.actors[1]
    			draw_actor_name(@actor, x + 55, y - 7)
    			draw_actor_state(@actor, 325, -8, 144)
    			draw_actor_parameter2(@actor, 0, 15 + 10, 0)
    			draw_actor_parameter2(@actor, 0, 15 + 40, 1)
    			draw_actor_parameter2(@actor, 0, 15 + 70, 2)
    			draw_actor_parameter2(@actor, 0, 15 + 100, 3)
    			draw_actor_parameter2(@actor, 190, 15 + 10, 4)
    			draw_actor_parameter2(@actor, 190, 15 + 40, 5)
    			draw_actor_parameter2(@actor, 190, 15 + 70, 6)
    			draw_actor_barz(@actor, 0, 15 + 37, "horizontal", 168, 1, @actor.atk, 999, Color.new(242, 2, 6, 255), Color.new(253, 53, 56, 255))
    			draw_actor_barz(@actor, 0, 15 + 67, "horizontal", 168, 1, @actor.pdef, 999, Color.new(228, 253, 48, 255), Color.new(238, 254, 124, 255))
    			draw_actor_barz(@actor, 0, 15 + 97, "horizontal", 168, 1, @actor.mdef, 999, Color.new(229, 78, 253, 255), Color.new(237, 134, 254, 255))
    			draw_actor_barz(@actor, 0, 15 + 127, "horizontal", 168, 1, @actor.str, 999, Color.new(254, 209, 154, 255), Color.new(253, 163, 53, 255))
    			draw_actor_barz(@actor, 190, 15 + 37, "horizontal", 168, 1, @actor.dex, 999, Color.new(222, 222, 222, 255), Color.new(255, 255, 255, 255))
    			draw_actor_barz(@actor, 190, 15 + 67, "horizontal", 168, 1, @actor.agi, 999, Color.new(8, 160, 253, 255), Color.new(119, 203, 254, 255))
    			draw_actor_barz(@actor, 190, 15 + 97, "horizontal", 168, 1, @actor.int, 999, Color.new(33, 253, 86, 255), Color.new(124, 254, 155, 255))
    			draw_actor_barz(@actor, 190, 15 + 127, "horizontal", 168, 1, @actor.now_exp.to_f, @actor.next_exp, Color.new(-255, 200, -86, 255), Color.new(-168, -157, 184, 255))
    		end
    	end
    	
    end
    
    class Scene_Load2 < Scene_File
    	
    	def initialize
    		$game_temp = Game_Temp.new
    		$game_temp.last_file_index = 0
    		latest_time = Time.at(0)
    		for i in 0..3
    			filename = make_filename(i)
    			if FileTest.exist?(filename)
    				file = File.open(filename, "r")
    				if file.mtime > latest_time
    					latest_time = file.mtime
    					$game_temp.last_file_index = i
    				end
    				file.close
    			end
    		end
    		super("Choisissez un bloc.")
    	end
    	
    	def on_decision(filename)
    		unless FileTest.exist?(filename)
    			$game_system.se_play($data_system.buzzer_se)
    			return
    		end
    		$game_system.se_play($data_system.load_se)
    		file = File.open(filename, "rb")
    		read_save_data(file)
    		file.close
    		$game_system.bgm_play($game_system.playing_bgm)
    		$game_system.bgs_play($game_system.playing_bgs)
    		$game_map.update
    		$scene = Scene_Map.new
    	end
    	
    	def on_cancel
    		$game_system.se_play($data_system.cancel_se)
    		$scene = Scene_Menu.new(3)
    	end
    	
    	def read_save_data(file)
    		characters = Marshal.load(file)
    		Graphics.frame_count = Marshal.load(file)
    		$game_system = Marshal.load(file)
    		$game_switches = Marshal.load(file)
    		$game_variables = Marshal.load(file)
    		$game_self_switches = Marshal.load(file)
    		$game_screen = Marshal.load(file)
    		$game_actors = Marshal.load(file)
    		$game_party = Marshal.load(file)
    		$game_troop = Marshal.load(file)
    		$game_map = Marshal.load(file)
    		$game_player = Marshal.load(file)
    		
    		if $game_system.magic_number != $data_system.magic_number
    			$game_map.setup($game_map.map_id)
    			$game_player.center($game_player.x, $game_player.y)
    		end
    		$game_party.refresh
    	end
    end
    
    class Window_EquipLeft2 < Window_Base
    	
    	def initialize(actor)
    		super(0, 64, 272, 192)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		@actor = actor
    		refresh
    	end
    	
    	def refresh
    		self.contents.clear
    		draw_actor_name(@actor, 4, 0)
    		draw_actor_level3(@actor, 4, 32)
    		draw_actor_parameter(@actor, 4, 64, 0)
    		draw_actor_parameter(@actor, 4, 96, 1)
    		draw_actor_parameter(@actor, 4, 128, 2)
    		if @new_atk != nil
    			self.contents.font.color = system_color
    			self.contents.draw_text(160, 64, 40, 32, "->", 1)
    			self.contents.font.color = normal_color
    			self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
    		end
    		if @new_pdef != nil
    			self.contents.font.color = system_color
    			self.contents.draw_text(160, 96, 40, 32, "->", 1)
    			self.contents.font.color = normal_color
    			self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
    		end
    		if @new_mdef != nil
    			self.contents.font.color = system_color
    			self.contents.draw_text(160, 128, 40, 32, "->", 1)
    			self.contents.font.color = normal_color
    			self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
    		end
    	end
    	
    	def set_new_parameters(new_atk, new_pdef, new_mdef)
    		if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef
    			@new_atk = new_atk
    			@new_pdef = new_pdef
    			@new_mdef = new_mdef
    			refresh
    		end
    	end
    end
    
    class Window_EquipRight2 < Window_Selectable
    	
    	def initialize(actor)
    		super(272, 64, 368, 192)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		@actor = actor
    		refresh
    		self.index = 0
    	end
    	
    	def item
    		return @data[self.index]
    	end
    	
    	def refresh
    		self.contents.clear
    		@data = []
    		@data.push($data_weapons[@actor.weapon_id])
    		@data.push($data_armors[@actor.armor1_id])
    		@data.push($data_armors[@actor.armor2_id])
    		@data.push($data_armors[@actor.armor3_id])
    		@data.push($data_armors[@actor.armor4_id])
    		@item_max = @data.size
    		self.contents.font.color = system_color
    		self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
    		self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
    		self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
    		self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
    		self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)
    		draw_item_name(@data[0], 92, 32 * 0)
    		draw_item_name(@data[1], 92, 32 * 1)
    		draw_item_name(@data[2], 92, 32 * 2)
    		draw_item_name(@data[3], 92, 32 * 3)
    		draw_item_name(@data[4], 92, 32 * 4)
    	end
    	
    	def update_help
    		@help_window.set_text(self.item == nil ? "" : self.item.description)
    	end
    end
    
    class Window_Character_Selection1 < Window_Selectable3
    	
    	attr_accessor :commands
    	
    	def initialize(commands)
    		super(0, 50, 640, 50)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		@commands = commands
    		@width = width
    		if $game_party.actors.size < 2
    			@item_max = 1
    			@column_max = 1
    		else
    			@item_max = 2
    			@column_max =2
    		end
    		@commands = 2
    		self.visible = false
    		self.active = false
    		self.index = -1
    		self.z = 2000
    		refresh
    	end
    	
    	
    	def refresh
    		self.contents.clear
    		self.contents.font.color = system_color
    		if $game_party.actors.size < 2
    			self.contents.draw_text(180, -6, 144, 32, $game_party.actors[0].name, 2)
    		else
    			self.contents.draw_text(120, -6, 144, 32, $game_party.actors[0].name, 2)
    			self.contents.draw_text(240, -6, 144, 32, $game_party.actors[1].name, 2)
    		end
    	end
    end
    
    class Scene_Equip2
    	
    	def initialize(actor_index = 0, equip_index = 0)
    		@actor_index = actor_index
    		@equip_index = equip_index
    	end
    	
    	def main
    		@actor = $game_party.actors[@actor_index]
    		@help_window = Window_Help.new
    		@left_window = Window_EquipLeft2.new(@actor)
    		@right_window = Window_EquipRight2.new(@actor)
    		@item_window1 = Window_EquipItem.new(@actor, 0)
    		@item_window2 = Window_EquipItem.new(@actor, 1)
    		@item_window3 = Window_EquipItem.new(@actor, 2)
    		@item_window4 = Window_EquipItem.new(@actor, 3)
    		@item_window5 = Window_EquipItem.new(@actor, 4)
    		@right_window.help_window = @help_window
    		@item_window1.help_window = @help_window
    		@item_window2.help_window = @help_window
    		@item_window3.help_window = @help_window
    		@item_window4.help_window = @help_window
    		@item_window5.help_window = @help_window
    		@right_window.index = @equip_index
    		refresh
    		Graphics.transition
    		loop do
    			Graphics.update
    			Input.update
    			update
    			if $scene != self
    				break
    			end
    		end
    		Graphics.freeze
    		@help_window.dispose
    		@left_window.dispose
    		@right_window.dispose
    		@item_window1.dispose
    		@item_window2.dispose
    		@item_window3.dispose
    		@item_window4.dispose
    		@item_window5.dispose
    	end
    	
    	def refresh
    		@item_window1.visible = (@right_window.index == 0)
    		@item_window2.visible = (@right_window.index == 1)
    		@item_window3.visible = (@right_window.index == 2)
    		@item_window4.visible = (@right_window.index == 3)
    		@item_window5.visible = (@right_window.index == 4)
    		item1 = @right_window.item
    		case @right_window.index
    		when 0
    			@item_window = @item_window1
    		when 1
    			@item_window = @item_window2
    		when 2
    			@item_window = @item_window3
    		when 3
    			@item_window = @item_window4
    		when 4
    			@item_window = @item_window5
    		end
    		
    		if @right_window.active
    			@left_window.set_new_parameters(nil, nil, nil)
    		end
    		if @item_window.active
    			item2 = @item_window.item
    			last_hp = @actor.hp
    			last_sp = @actor.sp
    			@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
    			new_atk = @actor.atk
    			new_pdef = @actor.pdef
    			new_mdef = @actor.mdef
    			@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
    			@actor.hp = last_hp
    			@actor.sp = last_sp
    			@left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
    		end
    	end
    	
    	def update
    		@left_window.update
    		@right_window.update
    		@item_window.update
    		refresh
    		if @right_window.active
    			update_right
    			return
    		end
    		
    		if @item_window.active
    			update_item
    			return
    		end
    	end
    	
    	def update_right
    		if Input.trigger?(Input::B)
    			$game_system.se_play($data_system.cancel_se)
    			$scene = Scene_Menu.new(2)
    			return
    		end
    		
    		if Input.trigger?(Input::C)
    			if @actor.equip_fix?(@right_window.index)
    				$game_system.se_play($data_system.buzzer_se)
    				return
    			end
    			
    			$game_system.se_play($data_system.decision_se)
    			@right_window.active = false
    			@item_window.active = true
    			@item_window.index = 0
    			return
    		end
    		
    		if Input.trigger?(Input::R)
    			$game_system.se_play($data_system.cursor_se)
    			@actor_index += 1
    			@actor_index %= $game_party.actors.size
    			$scene = Scene_Equip2.new(@actor_index, @right_window.index)
    			return
    		end
    		
    		if Input.trigger?(Input::L)
    			$game_system.se_play($data_system.cursor_se)
    			@actor_index += $game_party.actors.size - 1
    			@actor_index %= $game_party.actors.size
    			$scene = Scene_Equip2.new(@actor_index, @right_window.index)
    			return
    		end
    	end
    	
    	def update_item
    		if Input.trigger?(Input::B)
    			$game_system.se_play($data_system.cancel_se)
    			@right_window.active = true
    			@item_window.active = false
    			@item_window.index = -1
    			return
    		end
    		
    		if Input.trigger?(Input::C)
    			$game_system.se_play($data_system.equip_se)
    			item = @item_window.item
    			@actor.equip(@right_window.index, item == nil ? 0 : item.id)
    			@right_window.active = true
    			@item_window.active = false
    			@item_window.index = -1
    			@right_window.refresh
    			@item_window.refresh
    			return
    		end
    	end
    end
    
    class Window_Graphic1 < Window_Base
    	
    	def initialize
    		super(0, 0, 280, 200)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		refresh
    	end
    	
    	def refresh
    		self.contents.clear
    		actor = $game_party.actors[0]
    		draw_actor_battler(actor, x + 130, y + 200)
    	end
    end
    
    class Window_Graphic2 < Window_Base
    	
    	def initialize
    		super(0, 0, 280, 220)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		refresh
    	end
    	
    	def refresh
    		self.contents.clear
    		if $game_party.actors.size < 2
    			self.contents.clear
    		else
    			actor = $game_party.actors[1]
    			draw_actor_battler(actor, x + 130, y + 200)
    		end
    	end
    end
    
    class Window_SkillStatus < Window_Base
    	
    	def initialize(actor)
    		super(0, 64, 640, 64)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		@actor = actor
    		refresh
    	end
    	
    	def refresh
    		self.contents.clear
    		draw_actor_name(@actor, 0, 0)
    		draw_actor_state(@actor, 150, 0)
    		draw_actor_hp2(@actor, 270, 0)
    		draw_actor_sp2(@actor, 440, 0)
    	end
    end
    
    class Scene_Skill2
    	
    	def initialize(actor_index = 0, equip_index = 0)
    		@actor_index = actor_index
    	end
    	
    	def main
    		@actor = $game_party.actors[@actor_index]
    		@help_window = Window_Help.new
    		@status_window = Window_SkillStatus.new(@actor)
    		@skill_window = Window_Skill.new(@actor)
    		@skill_window.help_window = @help_window
    		@target_window = Window_Target.new
    		@target_window.visible = false
    		@target_window.active = false
    		Graphics.transition
    		loop do
    			Graphics.update
    			Input.update
    			update
    			if $scene != self
    				break
    			end
    		end
    		Graphics.freeze
    		@help_window.dispose
    		@status_window.dispose
    		@skill_window.dispose
    		@target_window.dispose
    	end
    	
    	def update
    		@help_window.update
    		@status_window.update
    		@skill_window.update
    		@target_window.update
    		if @skill_window.active
    			update_skill
    			return
    		end
    		
    		if @target_window.active
    			update_target
    			return
    		end
    	end
    	
    	def update_skill
    		if Input.trigger?(Input::B)
    			$game_system.se_play($data_system.cancel_se)
    			$scene = Scene_Menu.new(1)
    			return
    		end
    		
    		if Input.trigger?(Input::C)
    			@skill = @skill_window.skill
    			if @skill == nil or not @actor.skill_can_use?(@skill.id)
    				$game_system.se_play($data_system.buzzer_se)
    				return
    			end
    			$game_system.se_play($data_system.decision_se)
    			
    			if @skill.scope >= 3
    				@skill_window.active = false
    				@target_window.x = (@skill_window.index + 1) % 2 * 304
    				@target_window.visible = true
    				@target_window.active = true
    				if @skill.scope == 4 || @skill.scope == 6
    					@target_window.index = -1
    				elsif @skill.scope == 7
    					@target_window.index = @actor_index - 10
    				else
    					@target_window.index = 0
    				end
    			else
    				if @skill.common_event_id > 0
    					$game_temp.common_event_id = @skill.common_event_id
    					$game_system.se_play(@skill.menu_se)
    					@actor.sp -= @skill.sp_cost
    					@status_window.refresh
    					@skill_window.refresh
    					@target_window.refresh
    					$scene = Scene_Map.new
    					return
    				end
    			end
    			return
    		end
    		if Input.trigger?(Input::R)
    			$game_system.se_play($data_system.cursor_se)
    			@actor_index += 1
    			@actor_index %= $game_party.actors.size
    			$scene = Scene_Skill.new(@actor_index)
    			return
    		end
    		
    		if Input.trigger?(Input::L)
    			$game_system.se_play($data_system.cursor_se)
    			@actor_index += $game_party.actors.size - 1
    			@actor_index %= $game_party.actors.size
    			$scene = Scene_Skill.new(@actor_index)
    			return
    		end
    	end
    	
    	def update_target
    		if Input.trigger?(Input::B)
    			$game_system.se_play($data_system.cancel_se)
    			@skill_window.active = true
    			@target_window.visible = false
    			@target_window.active = false
    			return
    		end
    		
    		if Input.trigger?(Input::C)
    			unless @actor.skill_can_use?(@skill.id)
    				$game_system.se_play($data_system.buzzer_se)
    				return
    			end
    			
    			if @target_window.index == -1
    				used = false
    				for i in $game_party.actors
    					used |= i.skill_effect(@actor, @skill)
    				end
    			end
    			
    			if @target_window.index <= -2
    				target = $game_party.actors[@target_window.index + 10]
    				used = target.skill_effect(@actor, @skill)
    			end
    			
    			if @target_window.index >= 0
    				target = $game_party.actors[@target_window.index]
    				used = target.skill_effect(@actor, @skill)
    			end
    			
    			if used
    				$game_system.se_play(@skill.menu_se)
    				@actor.sp -= @skill.sp_cost
    				@status_window.refresh
    				@skill_window.refresh
    				@target_window.refresh
    				if $game_party.all_dead?
    					$scene = Scene_Gameover.new
    					return
    				end
    				if @skill.common_event_id > 0
    					$game_temp.common_event_id = @skill.common_event_id
    					$scene = Scene_Map.new
    					return
    				end
    			end
    			unless used
    				$game_system.se_play($data_system.buzzer_se)
    			end
    			return
    		end
    	end
    end
    
    
    class Scene_Menu
    	
    	def initialize(menu_index = 0)
    		@menu_index = menu_index
    	end
    	
    	def main
    		@update_frame = 0
    		
    		@window_location = Window_Location.new
    		@window_location.x =420
    		
    		@window_character_selection1 = Window_Character_Selection1.new(@commands)
    		@window_character_selection1.y = 50
    		
    		@window_character_selection2 = Window_Character_Selection2 .new
    		
    		
    		@window_character1_graphic = Window_GraphicCharacter1.new
    		@window_character1_graphic.y =100
    		@window_character1_graphic.frame_update
    		@window_character1_graphic.opacity = 0
    		@window_character1_graphic.back_opacity = 0
    		
    		@window_character2_graphic = Window_GraphicCharacter2.new
    		@window_character2_graphic.y =280
    		@window_character2_graphic.frame_update
    		@window_character2_graphic.opacity = 0
    		@window_character2_graphic.back_opacity = 0
    		
    		@window_character1 = Window_Character1.new
    		@window_character1.y =100
    		
    		@window_character2 = Window_Character2.new
    		@window_character2.y =280
    		
    		@window_status_character1 = Window_StatusCharacter1.new
    		@window_status_character1.x =200
    		@window_status_character1.y =100
    		
    		@window_status_character2 = Window_StatusCharacter2.new
    		@window_status_character2.x =200
    		@window_status_character2.y =280
    		
    		@playtime_window = Window_PlayTime.new
    		@playtime_window.x = 270
    		
    		@graphic1 = Window_Graphic1.new
    		@graphic1.x = 240
    		@graphic1.y = 92
    		@graphic1.z = 501
    		@graphic1.opacity = 0
    		@graphic1.back_opacity = 0
    		@graphic1.contents_opacity = 100
    		
    		@graphic2 = Window_Graphic2.new
    		@graphic2.x = 240
    		@graphic2.y = 272
    		@graphic2.z = 501
    		@graphic2.opacity = 0
    		@graphic2.back_opacity = 0
    		@graphic2.contents_opacity = 100
    		
    		@command_window = Window_Command2.new(["Objets", "Compétences", "Equiper", "Charger", "Sauver", "Quitter"])
    		@command_window.index = @menu_index
    		
    		@dummy_window = Dummy_Window_Command.new
    		@dummy_window.z = 500
    		@dummy_window.opacity = 0
    		@dummy_window.back_opacity = 0
    		
    		@dummy_window_icons = Dummy_Window_Command2.new
    		@dummy_window_icons.opacity = 0
    		@dummy_window_icons.back_opacity = 0
    		@dummy_window_icons.contents_opacity = 100
    		
    		Graphics.transition
    		loop do
    			Graphics.update
    			Input.update
    			@update_frame += 1
    			if @update_frame == 5
    				@update_frame = 0
    				@window_character2_graphic.frame_update
    				@window_character1_graphic.frame_update
    			end
    			
    			update
    			if $scene != self
    				break
    			end
    		end
    		
    		Graphics.freeze
    		@window_location.dispose
    		@window_character1.dispose
    		@window_status_character1.dispose
    		@window_character2.dispose
    		@window_status_character2.dispose
    		@playtime_window.dispose
    		@command_window.dispose
    		@graphic1.dispose
    		@graphic2.dispose
    		@dummy_window.dispose
    		@dummy_window_icons.dispose
    		@window_character1_graphic.dispose
    		@window_character2_graphic.dispose
    		@window_character_selection1.dispose
    		@window_character_selection2.dispose
    	end
    	
    	def update
    		@playtime_window.update
    		@command_window.update
    		@window_character_selection1.update
    		
    		if @command_window.active
    			update_command
    			return
    		end
    		
    		if @window_character_selection1.active
    			update_character
    			return
    		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 $game_party.actors.size == 0 and @command_window.index < 4
    				$game_system.se_play($data_system.buzzer_se)
    				return
    			end
    			case @command_window.index
    			when 0
    				$game_system.se_play($data_system.decision_se)
    				$scene = Scene_Item.new
    			when 1
    				$game_system.se_play($data_system.decision_se)
    				@window_character_selection1.visible = true
    				@window_character_selection2.visible = true
    				@window_character_selection1.active = true
    				@window_character_selection1.index = 0
    				@command_window.active = false
    			when 2
    				$game_system.se_play($data_system.decision_se)
    				@window_character_selection1.visible = true
    				@window_character_selection1.active = true
    				@window_character_selection2.visible = true
    				@window_character_selection1.index = 0
    				@command_window.active = false
    			when 3
    				$game_system.se_play($data_system.decision_se)
    				$scene = Scene_Load2.new
    			when 4
    				if $game_system.save_disabled
    					$game_system.se_play($data_system.buzzer_se)
    					return
    				end
    				$game_system.se_play($data_system.decision_se)
    				$scene = Scene_Save.new
    			when 5
    				$game_system.se_play($data_system.decision_se)
    				$scene = Scene_End.new
    			end
    			return
    		end
    	end
    	
    	def update_character
    		if Input.trigger?(Input::B)
    			$game_system.se_play($data_system.cancel_se)
    			@command_window.active = true
    			@window_character_selection1.visible = false
    			@window_character_selection1.active = false
    			@window_character_selection2.visible = false
    			@window_character_selection1.index = -1
    			return
    		end
    		
    		if Input.trigger?(Input::C)
    			if $game_party.actors.size == 0 and @command_window.index < 4
    				$game_system.se_play($data_system.buzzer_se)
    				return
    			end
    			case @command_window.index
    			when 1
    				$game_system.se_play($data_system.decision_se)
    				case @window_character_selection1.index
    				when 0
    					$scene = Scene_Skill2.new(@window_character_selection1.index)
    				when 1
    					$scene = Scene_Skill2.new(@window_character_selection1.index)
    				end
    			when 2
    				$game_system.se_play($data_system.decision_se)
    				case @window_character_selection1.index
    				when 0
    					$scene = Scene_Equip2.new(@window_character_selection1.index)
    				when 1
    					$scene = Scene_Equip2.new(@window_character_selection1.index)
    				end
    			end
    			return
    		end
    	end
    end
    

     

     

×
×
  • Create New...