Bem vindo, Visitante
Faça
Login
ou
Registre-se
por favor.
Ou forneça o usuario e senha para fazer o login rapido!
[-]
home
|
arquivo
|
envie o seu
|
quem somos
|
portal
|
Menu Violento
Inicio
Scripts
Imagens
Outros
Scene Title
[
Selecionar
] [
-
]
#============================================================================== # ■ Scene_Title #============================================================================== class Scene_Title def main # edit # #============================================================================== #-------------------------------------------------------------------------- # Item ID numbers $basic_items_ids = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22] $quest_items_ids = [23,24,25,26,27,28,29,30,31,32] #-------------------------------------------------------------------------- # Weapon ID numbers $weapon_ids = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18, 19,20,21,22,23,24,25,26,27,28,29,30,31,32] #-------------------------------------------------------------------------- # Shield ID numbers $armor_ids = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24] $accessory_ids = [25,26,27,28,29,30,31,32] #============================================================================== # end edit # if $BTEST battle_test return end $data_actors = load_data("Data/Actors.rxdata") $data_classes = load_data("Data/Classes.rxdata") $data_skills = load_data("Data/Skills.rxdata") $data_items = load_data("Data/Items.rxdata") $data_weapons = load_data("Data/Weapons.rxdata") $data_armors = load_data("Data/Armors.rxdata") $data_enemies = load_data("Data/Enemies.rxdata") $data_troops = load_data("Data/Troops.rxdata") $data_states = load_data("Data/States.rxdata") $data_animations = load_data("Data/Animations.rxdata") $data_tilesets = load_data("Data/Tilesets.rxdata") $data_common_events = load_data("Data/CommonEvents.rxdata") $data_system = load_data("Data/System.rxdata") # edit # #============================================================================== $map_infos = load_data("Data/MapInfos.rxdata") for key in $map_infos.keys $map_infos[key] = $map_infos[key].name end $game_time = Game_Time.new #============================================================================== # end edit # $game_system = Game_System.new @sprite = Sprite.new @sprite.bitmap = RPG::Cache.title($data_system.title_name) s1 = "Novo Jogo" s2 = "Continuar" s3 = "Sair" @command_window = Window_Command.new(192, [s1, s2, s3]) @command_window.back_opacity = 160 @command_window.x = 320 - @command_window.width / 2 @command_window.y = 288 @continue_enabled = false for i in 0..3 if FileTest.exist?("Save#{i+1}.rxdata") @continue_enabled = true end end if @continue_enabled @command_window.index = 1 else @command_window.disable_item(1) end $game_system.bgm_play($data_system.title_bgm) Audio.me_stop Audio.bgs_stop # トランジション実行 Graphics.transition # メインループ loop do # ゲーム画面を更新 Graphics.update # 入力情報を更新 Input.update # フレーム更新 update # 画面が切り替わったらループを中断 if $scene != self break end end # トランジション準備 Graphics.freeze # コマンドウィンドウを解放 @command_window.dispose # タイトルグラフィックを解放 @sprite.bitmap.dispose @sprite.dispose end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update # コマンドウィンドウを更新 @command_window.update # C ボタンが押された場合 if Input.trigger?(Input::C) # コマンドウィンドウのカーソル位置で分岐 case @command_window.index when 0 # ニューゲーム command_new_game when 1 # コンティニュー command_continue when 2 # シャットダウン command_shutdown end end end #-------------------------------------------------------------------------- # ● コマンド : ニューゲーム #-------------------------------------------------------------------------- def command_new_game # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # BGM を停止 Audio.bgm_stop # プレイ時間計測用のフレームカウントをリセット Graphics.frame_count = 0 # 各種ゲームオブジェクトを作成 $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new # 初期パーティをセットアップ $game_party.setup_starting_members # 初期位置のマップをセットアップ $game_map.setup($data_system.start_map_id) # プレイヤーを初期位置に移動 $game_player.moveto($data_system.start_x, $data_system.start_y) # プレイヤーをリフレッシュ $game_player.refresh # マップに設定されている BGM と BGS の自動切り替えを実行 $game_map.autoplay # マップを更新 (並列イベント実行) $game_map.update # マップ画面に切り替え $scene = Scene_Map.new end #-------------------------------------------------------------------------- # ● コマンド : コンティニュー #-------------------------------------------------------------------------- def command_continue # コンティニューが無効の場合 unless @continue_enabled # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) return end # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # ロード画面に切り替え $scene = Scene_Load.new end #-------------------------------------------------------------------------- # ● コマンド : シャットダウン #-------------------------------------------------------------------------- def command_shutdown # 決定 SE を演奏 $game_system.se_play($data_system.decision_se) # BGM、BGS、ME をフェードアウト Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) # シャットダウン $scene = nil end #-------------------------------------------------------------------------- # ● 戦闘テスト #-------------------------------------------------------------------------- def battle_test # データベース (戦闘テスト用) をロード $data_actors = load_data("Data/BT_Actors.rxdata") $data_classes = load_data("Data/BT_Classes.rxdata") $data_skills = load_data("Data/BT_Skills.rxdata") $data_items = load_data("Data/BT_Items.rxdata") $data_weapons = load_data("Data/BT_Weapons.rxdata") $data_armors = load_data("Data/BT_Armors.rxdata") $data_enemies = load_data("Data/BT_Enemies.rxdata") $data_troops = load_data("Data/BT_Troops.rxdata") $data_states = load_data("Data/BT_States.rxdata") $data_animations = load_data("Data/BT_Animations.rxdata") $data_tilesets = load_data("Data/BT_Tilesets.rxdata") $data_common_events = load_data("Data/BT_CommonEvents.rxdata") $data_system = load_data("Data/BT_System.rxdata") # プレイ時間計測用のフレームカウントをリセット Graphics.frame_count = 0 # 各種ゲームオブジェクトを作成 $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new # 戦闘テスト用のパーティをセットアップ $game_party.setup_battle_test_members # トループ ID、逃走可能フラグ、バトルバックを設定 $game_temp.battle_troop_id = $data_system.test_troop_id $game_temp.battle_can_escape = true $game_map.battleback_name = $data_system.battleback_name # バトル開始 SE を演奏 $game_system.se_play($data_system.battle_start_se) # バトル BGM を演奏 $game_system.bgm_play($game_system.battle_bgm) # バトル画面に切り替え $scene = Scene_Battle.new end end
Scene Save
[
Selecionar
] [
-
]
#============================================================================== # ■ Scene_Save #------------------------------------------------------------------------------ #  セーブ画面の処理を行うクラスです。 #============================================================================== class Scene_Save < Scene_File #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super("Em qual lugar você deseja salvar?") end #-------------------------------------------------------------------------- # ● 決定時の処理 #-------------------------------------------------------------------------- def on_decision(filename) # セーブ SE を演奏 $game_system.se_play($data_system.save_se) # セーブデータの書き込み file = File.open(filename, "wb") write_save_data(file) file.close # イベントから呼び出されている場合 if $game_temp.save_calling # セーブ呼び出しフラグをクリア $game_temp.save_calling = false # マップ画面に切り替え $scene = Scene_Map.new return end # メニュー画面に切り替え $scene = Scene_Menu.new(9) end #-------------------------------------------------------------------------- # ● キャンセル時の処理 #-------------------------------------------------------------------------- def on_cancel # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # イベントから呼び出されている場合 if $game_temp.save_calling # セーブ呼び出しフラグをクリア $game_temp.save_calling = false # マップ画面に切り替え $scene = Scene_Map.new return end # メニュー画面に切り替え $scene = Scene_Menu.new(9) end #-------------------------------------------------------------------------- # ● セーブデータの書き込み # file : 書き込み用ファイルオブジェクト (オープン済み) #-------------------------------------------------------------------------- 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) # セーブ回数を 1 増やす $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) # edit # #============================================================================== Marshal.dump($game_time,file) #============================================================================== # end edit # end end
Scene Load
[
Selecionar
] [
-
]
#============================================================================== # ■ Scene_Load #------------------------------------------------------------------------------ #  ロード画面の処理を行うクラスです。 #============================================================================== class Scene_Load < 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("Qual jogo você deseja carregar?") end #-------------------------------------------------------------------------- # ● 決定時の処理 #-------------------------------------------------------------------------- def on_decision(filename) # ファイルが存在しない場合 unless FileTest.exist?(filename) # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) return end # ロード SE を演奏 $game_system.se_play($data_system.load_se) # セーブデータの書き込み file = File.open(filename, "rb") read_save_data(file) file.close # BGM、BGS を復帰 $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 # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # タイトル画面に切り替え $scene = Scene_Title.new end #-------------------------------------------------------------------------- # ● セーブデータの読み込み # file : 読み込み用ファイルオブジェクト (オープン済み) #-------------------------------------------------------------------------- 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) # edit # #============================================================================== $game_time = Marshal.load(file) #============================================================================== # end edit # # マジックナンバーがセーブ時と異なる場合 # (エディタで編集が加えられている場合) 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
Menu Violento
[
Selecionar
] [
-
]
#============================================================================== # Menu Violento v1.1 (nome não original) # Feito por Deke # Tradução ao portugues e bugs corrigidos por NicholasRg # # NOTA:Este menu altera grande parte do sistema do jogo, e aconselhavél # que usem poucos scripts adicionais se forem usar este. #============================================================================== # Game_System #============================================================================== class Game_System attr_reader :map_interpreter attr_reader :battle_interpreter attr_accessor :timer attr_accessor :timer_working attr_accessor :save_disabled attr_accessor :menu_disabled attr_accessor :encounter_disabled attr_accessor :message_position attr_accessor :message_frame attr_accessor :save_count attr_accessor :magic_number attr_accessor :bgm_volume attr_accessor :se_volume def initialize @map_interpreter = Interpreter.new(0, true) @battle_interpreter = Interpreter.new(0, false) @timer = 0 @timer_working = false @save_disabled = false @menu_disabled = false @encounter_disabled = false @message_position = 2 @message_frame = 0 @save_count = 0 @magic_number = 0 @bgm_volume = 100 @se_volume = 100 end def bgm_play(bgm) @playing_bgm = bgm if bgm != nil and bgm.name != "" Audio.bgm_play("Audio/BGM/" + bgm.name , bgm.volume * bgm_volume / 100, bgm.pitch) else Audio.bgm_stop end Graphics.frame_reset end def bgs_play(bgs) @playing_bgs = bgs if bgs != nil and bgs.name != "" Audio.bgs_play("Audio/BGS/" + bgs.name, bgs.volume * se_volume / 100, bgs.pitch) else Audio.bgs_stop end Graphics.frame_reset end def me_play(me) if me != nil and me.name != "" Audio.me_play("Audio/ME/" + me.name, me.volume * se_volume / 100, me.pitch) else Audio.me_stop end Graphics.frame_reset end def se_play(se) if se != nil and se.name != "" Audio.se_play("Audio/SE/" + se.name, se.volume * se_volume / 100, se.pitch) end end end #============================================================================== # ■ Game_Actor #============================================================================== 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 #============================================================================== # ■ Game_Map #============================================================================== class Game_Map def name $map_infos[@map_id] end end #============================================================================== # ■ class Game_Time # written by Deke #-------------------------------------------------------------------------------------------------------------------------------------------- #============================================================================== class Game_Time attr_accessor :minute_length def initialize @minute_length=2.0 #length of game minute in real seconds @hour_length= 60.0 #minute in an hour @day_length=24.0 #hours in a day @month_length=30.0 #days in a month @year_length=12.0 #months in a year @minutes=0 #starting minute count start_minute=0 add_minutes(start_minute) start_hour=23 #starting hour count add_hours(start_hour) start_day=13 #starting day count add_days(start_day) start_month=4 #starting month count add_months(start_month-1) start_year=1207 #starting year count add_years(start_year) end def add_minutes(minutes) @minutes +=minutes end def add_hours(hours) @minutes +=hours*@hour_length end def add_days(days) @minutes += days*@hour_length*@day_length end def add_months(months) @minutes +=months * @hour_length*@day_length*@month_length end def add_years(years) @minutes += years * @hour_length*@day_length*@month_length * @year_length end def get_year minutes=get_total_minutes year=minutes / @hour_length / @day_length / @month_length / @year_length return year end def get_month minutes=get_total_minutes month=minutes / @hour_length / @day_length / @month_length % @year_length + 1 return month end def get_day minutes=get_total_minutes day=minutes / @hour_length / @day_length % @month_length return day end def get_hour minutes=get_total_minutes hour=minutes / @hour_length % @day_length return hour end def get_total_minutes total_sec=Graphics.frame_count / Graphics.frame_rate minute=(total_sec/@minute_length+@minutes) return minute end def get_minute minutes=get_total_minutes % @hour_length return minutes end def get_tone period_length=Math::PI*(get_hour / @day_length) red_shift= -100+ 115*Math.sin(period_length) green_shift= -140+ 155*Math.sin(period_length) blue_shift= -150+ 165*Math.sin(period_length) return Tone.new(red_shift, green_shift, blue_shift, 0) end end #============================================================================== # ■ Window_Base #============================================================================== 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) self.contents.blt(x - fw / 23, y - fh, face, src_rect) 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 FONT_SIZE = 16 NUMBER_OF_ELEMENTS = 8 ELEMENT_ORDER = [1,2,3,4,5,6, 7, 8] GRAPH_SCALINE_COLOR = Color.new(255, 255, 255, 128) GRAPH_SCALINE_COLOR_SHADOW = Color.new( 0, 0, 0, 192) GRAPH_LINE_COLOR = Color.new(255, 255, 64, 255) GRAPH_LINE_COLOR_MINUS = Color.new( 64, 255, 255, 255) GRAPH_LINE_COLOR_PLUS = Color.new(255, 64, 64, 255) def draw_actor_element_radar_graph(actor, x, y, radius = 43) cx = x + radius + FONT_SIZE + 48 cy = y + radius + FONT_SIZE + 32 for loop_i in 0..NUMBER_OF_ELEMENTS if loop_i == 0 else @pre_x = @now_x @pre_y = @now_y @pre_ex = @now_ex @pre_ey = @now_ey @color1 = @color2 end if loop_i == NUMBER_OF_ELEMENTS eo = ELEMENT_ORDER[0] else eo = ELEMENT_ORDER[loop_i] end er = actor.element_rate(eo) estr = $data_system.elements[eo] @color2 = er < 0 ? GRAPH_LINE_COLOR_MINUS : er > 100 ? GRAPH_LINE_COLOR_PLUS : GRAPH_LINE_COLOR er = er.abs th = Math::PI * (0.5 - 2.0 * loop_i / NUMBER_OF_ELEMENTS) @now_x = cx + (radius * Math.cos(th)).floor @now_y = cy - (radius * Math.sin(th)).floor @now_wx = cx - 6 + ((radius + FONT_SIZE * 3 / 2) * Math.cos(th)).floor - FONT_SIZE @now_wy = cy - ((radius + FONT_SIZE * 1 / 2) * Math.sin(th)).floor - FONT_SIZE/2 @now_vx = cx + ((radius + FONT_SIZE * 8 / 2) * Math.cos(th)).floor - FONT_SIZE @now_vy = cy - ((radius + FONT_SIZE * 3 / 2) * Math.sin(th)).floor - FONT_SIZE/2 @now_ex = cx + (er*radius/100 * Math.cos(th)).floor @now_ey = cy - (er*radius/100 * Math.sin(th)).floor if loop_i == 0 @pre_x = @now_x @pre_y = @now_y @pre_ex = @now_ex @pre_ey = @now_ey @color1 = @color2 else end next if loop_i == 0 self.contents.draw_line(cx+1,cy+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW) self.contents.draw_line(@pre_x+1,@pre_y+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW) self.contents.draw_line(cx,cy, @now_x,@now_y, GRAPH_SCALINE_COLOR) self.contents.draw_line(@pre_x,@pre_y, @now_x,@now_y, GRAPH_SCALINE_COLOR) self.contents.draw_line(@pre_ex,@pre_ey, @now_ex,@now_ey, @color1, 2, @color2) self.contents.font.color = system_color self.contents.draw_text(@now_wx,@now_wy, FONT_SIZE*3.1, FONT_SIZE, estr, 1) self.contents.font.color = Color.new(255,255,255,128) self.contents.draw_text(@now_vx,@now_vy, FONT_SIZE*2, FONT_SIZE, er.to_s + "%", 2) self.contents.font.color = normal_color end end alias :draw_actor_hp_original :draw_actor_hp def draw_actor_hp(actor, x, y, width = 144) if actor.maxhp != 0 rate = actor.hp.to_f / actor.maxhp else rate = 0 end plus_x = 0 rate_x = 0 plus_y = 31 plus_width = 0 rate_width = 100 height = 10 align1 = 1 align2 = 2 align3 = 0 grade1 = 1 grade2 = 0 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) if actor.maxhp != 0 hp = (width + plus_width) * actor.hp * rate_width / 100 / actor.maxhp else hp = 0 end 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) draw_actor_hp_original(actor, x, y, width) end alias :draw_actor_sp_original :draw_actor_sp def draw_actor_sp(actor, x, y, width = 144) if actor.maxsp != 0 rate = actor.sp.to_f / actor.maxsp else rate = 1 end plus_x = 0 rate_x = 0 plus_y = 31 plus_width = 0 rate_width = 100 height = 10 align1 = 1 align2 = 2 align3 = 0 grade1 = 1 grade2 = 0 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) if actor.maxsp != 0 sp = (width + plus_width) * actor.sp * rate_width / 100 / actor.maxsp else sp = (width + plus_width) * rate_width / 100 end 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) draw_actor_sp_original(actor, x, y, width) end alias :draw_actor_exp_original :draw_actor_exp def draw_actor_exp(actor, x, y, width = 204) if actor.next_exp != 0 rate = actor.now_exp.to_f / actor.next_exp else rate = 1 end plus_x = 0 rate_x = 0 plus_y = 31 plus_width = 0 rate_width = 100 height = 10 align1 = 1 align2 = 2 align3 = 0 grade1 = 1 grade2 = 0 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) 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 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) draw_actor_exp_original(actor, x, y) end 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 self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4, color3, color4, grade1) if align3 == 1 x += width - gauge end self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4, color5, color6, grade2) end def up_color return Color.new(74, 210, 74) end def down_color return Color.new(210, 74, 74) end def draw_actor_parameter(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 = $data_system.words.mdef 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 when 7 parameter_name = "Evasão" parameter_value = actor.eva end self.contents.font.color = system_color 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 end #============================================================================== # ■ Bitmap #============================================================================== class Bitmap 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.set_pixel(x, y, start_color) else self.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 * (distance-i)/distance + end_color.alpha * i/distance if width == 1 self.set_pixel(x, y, Color.new(r, g, b, a)) else self.fill_rect(x, y, width, width, Color.new(r, g, b, a)) end end end end 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 #============================================================================== 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 #============================================================================== # ■ Window_MenuCommand #============================================================================== class Window_MenuCommand < Window_Selectable def initialize(width, commands) super(0, 0, width, commands.size * 32 + 32) @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * 32) self.contents.font.name = $fontface self.contents.font.size = 20 refresh self.index = 0 end def refresh self.contents.clear self.contents.font.name = $fontface self.contents.font.size = 20 for i in 0...@item_max draw_item(i, normal_color) end end def draw_item(index, color) self.contents.font.color = color rect = Rect.new(24, 32 * index, self.contents.width - 8, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon("menu" + index.to_s) self.contents.blt(x + 3, index * 32 +4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(rect, @commands[index]) end def disable_item(index) draw_item(index, normal_color) end end #============================================================================== # ■ Window_ItemMenuCommand #============================================================================== class Window_ItemMenuCommand < Window_Selectable def initialize(width, commands) super(0, 0, width, commands.size * 32 + 32) @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * 32) self.contents.font.name = $fontface self.contents.font.size = 20 refresh self.index = 0 end def refresh self.contents.clear for i in 0...@item_max draw_item(i, normal_color) end end def draw_item(index, color) self.contents.font.color = color rect = Rect.new(12, 32 * index, self.contents.width - 8, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon("submenu" + index.to_s) self.contents.blt(x + 3, index * 32 +4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(rect, @commands[index]) end def disable_item(index) draw_item(index, disabled_color) end end #============================================================================== # ■ Window_NewMenuStatus #============================================================================== class Window_NewMenuStatus < Window_Selectable def initialize super(0, 0, 480, $game_party.actors.size * 88 + 32) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 20 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 x = 64 y = i * 90 actor = $game_party.actors[i] draw_actor_face(actor, 40, y + 80) #To get rid of the Face, put a "#" before the draw_ of this line #draw_actor_graphic(actor, x, y + 80) draw_actor_name(actor, x + 55, y) draw_actor_class(actor, x + 215, y) draw_actor_level(actor, x + 140, y) draw_actor_state(actor, x + 295, y) draw_actor_hp(actor, x + 70, y + 32) draw_actor_sp(actor, x + 240, y + 32) end end def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(0, @index * 88, self.width - 32, 92) end end end #============================================================================== # ■ Window_Basic_Item #============================================================================== class Window_Basic_Item < Window_Selectable def initialize super(0, 84, 384, 352) @column_max = 1 refresh self.index = 0 if $game_temp.in_battle self.y = 64 self.height = 272 self.back_opacity = 160 end end def item return @data[self.index] end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 1...$data_items.size if $game_party.item_number(i) > 0 for x in 0...$basic_items_ids.size if i == $basic_items_ids[x] @data.push($data_items [i] ) end end end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) self.contents.font.name = $fontface self.contents.font.size = 20 for i in 0...@item_max draw_item(i) end end end def draw_item(index) item = @data[index] case item when RPG::Item number = $game_party.item_number(item.id) end if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end x = 4 + index % 1 * (240 + 32) y = index / 1 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 212, 32, item.name, 0) self.contents.draw_text(x + 304, y, 16, 32, ":", 1) self.contents.draw_text(x + 320, y, 24, 32, number.to_s, 2) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.description) end end #============================================================================== # ■ Window_NewTarget #============================================================================== class Window_NewTarget < Window_Selectable def initialize super(0, 0, 192, 352) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 20 self.z += 10 @item_max = $game_party.actors.size refresh end def refresh self.contents.clear for i in 0...$game_party.actors.size x = 4 y = i * 80 actor = $game_party.actors[i] draw_actor_name(actor, x, y) draw_actor_state(actor, x + 80, y) draw_actor_hp(actor, x, y + 24) draw_actor_sp(actor, x, y + 48) end end def update_cursor_rect if self.active == false self.cursor_rect.empty end if self.index >= 0 and self.active self.cursor_rect.set(0, @index * 80, self.width - 32, 80) elsif self.index >= -1 and self.active self.cursor_rect.set(0, 0, self.width - 32, self.height - 32) end end end #============================================================================== # ■ Window_NewHelp #============================================================================== class Window_NewHelp < Window_Base def initialize super(0, 0, 576, 64) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 20 end def set_text(text, align = 0) if text != @text or align != @align self.contents.clear self.contents.font.name = $fontface self.contents.font.size = 20 self.contents.font.color = normal_color self.contents.draw_text(4, 0, self.width - 40, 32, text, align) @text = text @align = align @actor = nil end self.visible = true end def set_actor(actor) if actor != @actor self.contents.clear self.contents.font.name = $fontface self.contents.font.size = 20 draw_actor_name(actor, 4, 0) draw_actor_state(actor, 140, 0) draw_actor_hp(actor, 284, 0) draw_actor_sp(actor, 460, 0) @actor = actor @text = nil self.visible = true end end def set_enemy(enemy) self.contents.clear self.contents.font.name = $fontface self.contents.font.size = 20 text = enemy.name state_text = make_battler_state_text(enemy, 112, false) if state_text != "" text += " " + state_text end set_text(text, 1) end end #============================================================================== # ■ Window_Quest_Item #============================================================================== class Window_Quest_Item < Window_Selectable def initialize super(0, 64, 576, 128) @column_max = 3 refresh self.index = 0 if $game_temp.in_battle self.y = 64 self.height = 256 self.back_opacity = 160 end end def item return @data[self.index] end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 1...$data_items.size if $game_party.item_number(i) > 0 for x in 0...$quest_items_ids.size if i == $quest_items_ids[x] @data.push($data_items [i] ) end end end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) self.contents.font.name = $fontface self.contents.font.size = 20 for i in 0...@item_max draw_item(i) end end end def draw_item(index) item = @data[index] case item when RPG::Item number = $game_party.item_number(item.id) when RPG::Weapon number = $game_party.weapon_number(item.id) when RPG::Armor number = $game_party.armor_number(item.id) end if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end x = 4 + index % 3 * (160 + 32) y = index / 3 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 212, 32, item.name, 0) self.contents.draw_text(x + 112, y, 16, 32, ":", 1) self.contents.draw_text(x + 128, y, 24, 32, number.to_s, 2) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.description) end end #============================================================================== # ■ Window_Weapons #============================================================================== class Window_Weapons < Window_Selectable def initialize super(0, 64, 224, 352) @column_max = 1 refresh self.index = 0 if $game_temp.in_battle self.y = 64 self.height = 256 self.back_opacity = 160 end end def item return @data[self.index] end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 1...$data_weapons.size if $game_party.weapon_number(i) > 0 for x in 0...$weapon_ids.size if i == $weapon_ids[x] @data.push($data_weapons [i] ) end end end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) self.contents.font.name = $fontface self.contents.font.size = 20 for i in 0...@item_max draw_item(i) end end end def draw_item(index) item = @data[index] case item when RPG::Item number = $game_party.item_number(item.id) when RPG::Weapon number = $game_party.weapon_number(item.id) when RPG::Armor number = $game_party.armor_number(item.id) end if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end x = 4 + index % 1 * (288 + 32) y = index / 1 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 212, 32, item.name, 0) self.contents.draw_text(x + 144, y, 16, 32, ":", 1) self.contents.draw_text(x + 160, y, 24, 32, number.to_s, 2) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.description) end end #============================================================================== # ■ Window_Weapon_Stats #============================================================================== class Window_Weapon_Stats < Window_Base def initialize super(0, 0, 352, 352) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 20 @item = nil refresh end def refresh self.contents.clear if @item == nil return end case @item when RPG::Item number = $game_party.item_number(@item.id) when RPG::Weapon number = $game_party.weapon_number(@item.id) when RPG::Armor number = $game_party.armor_number(@item.id) end if @item.is_a?(RPG::Item) return end for i in 0...$game_party.actors.size actor = $game_party.actors[i] if @item.is_a?(RPG::Weapon) item1 = $data_weapons[actor.weapon_id] elsif @item.kind == 0 item1 = $data_armors[actor.armor1_id] elsif @item.kind == 1 item1 = $data_armors[actor.armor2_id] elsif @item.kind == 2 item1 = $data_armors[actor.armor3_id] else item1 = $data_armors[actor.armor4_id] end if not actor.equippable?(@item) draw_actor_graphic(actor, 16, 68 + (84 * i)) draw_actor_name(actor, 0, -6 + (84 * i)) draw_actor_level(actor, 86, -6 + (84 * i)) draw_actor_class(actor, 150, -6 + (84 * i)) draw_actor_state(actor, 230, -6 + (84 * i)) self.contents.draw_text(150, 44 + (84 * i), 150, 32, @item.name) self.contents.font.name = $fontface self.contents.font.size = 20 self.contents.font.color = normal_color self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Não pode Equipar") end if actor.equippable?(@item) draw_actor_graphic(actor, 16, 68 + (84 * i)) draw_actor_name(actor, 0, -6 + (84 * i)) draw_actor_level(actor, 86, -6 + (84 * i)) draw_actor_class(actor, 150, -6 + (84 * i)) draw_actor_state(actor, 230, -6 + (84 * i)) self.contents.draw_text(150, 44 + (84 * i), 150, 32, @item.name) atk1 = 0 atk2 = 0 eva1 = 0 eva2 = 0 str1 = 0 str2 = 0 dex1 = 0 dex2 = 0 agi1 = 0 agi2 = 0 int1 = 0 int2 = 0 pdf1 = 0 pdf2 = 0 mdf1 = 0 mdf2 = 0 eva1 = 0 eva2 = 0 str1 = item1 != nil ? item1.str_plus : 0 str2 = @item != nil ? @item.str_plus : 0 dex1 = item1 != nil ? item1.dex_plus : 0 dex2 = @item != nil ? @item.dex_plus : 0 agi1 = item1 != nil ? item1.agi_plus : 0 agi2 = @item != nil ? @item.agi_plus : 0 int1 = item1 != nil ? item1.int_plus : 0 int2 = @item != nil ? @item.int_plus : 0 pdf1 = item1 != nil ? item1.pdef : 0 pdf2 = @item != nil ? @item.pdef : 0 mdf1 = item1 != nil ? item1.mdef : 0 mdf2 = @item != nil ? @item.mdef : 0 if @item.is_a?(RPG::Weapon) atk1 = item1 != nil ? item1.atk : 0 atk2 = @item != nil ? @item.atk : 0 end if @item.is_a?(RPG::Armor) eva1 = item1 != nil ? item1.eva : 0 eva2 = @item != nil ? @item.eva : 0 end str_change = str2 - str1 dex_change = dex2 - dex1 agi_change = agi2 - agi1 int_change = int2 - int1 pdf_change = pdf2 - pdf1 mdf_change = mdf2 - mdf1 atk_change = atk2 - atk1 eva_change = eva2 - eva1 if item1 == nil name1 = "" else name1 = item1.name end if @item == nil name2 = "" else name2 = @item.name end if str_change == 0 && dex_change == 0 && agi_change == 0 && pdf_change == 0 && mdf_change == 0 && atk_change == 0 && eva_change == 0 && name1 != name2 self.contents.font.name = $fontface self.contents.font.size = 20 self.contents.draw_text(48, 18 + (84 * i), 288, 32, "Sem Mudanças") end if name1 == name2 self.contents.font.name = $fontface self.contents.font.size = 20 self.contents.draw_text(48, 18 + (84 * i), 288, 32, "Equipado") end self.contents.font.name = $fontface self.contents.font.size = 20 self.contents.font.color = normal_color if @item.is_a?(RPG::Weapon) && atk_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if @item.is_a?(RPG::Armor) && eva_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if pdf_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if mdf_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if str_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if dex_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if agi_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if str_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end end end end def item=(item) if @item != item @item = item refresh end end def draw_actor_graphic(actor, x, y) bitmap = RPG::Cache.character(actor.character_name, actor.character_hue) cw = bitmap.width / 4 ch = bitmap.height / 4 src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect) end end #============================================================================== # ■ Window_Armor #============================================================================== class Window_Armor < Window_Selectable def initialize super(0, 64, 224, 352) @column_max = 1 refresh self.index = 0 if $game_temp.in_battle self.y = 64 self.height = 256 self.back_opacity = 160 end end def item return @data[self.index] end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 1...$data_armors.size if $game_party.armor_number(i) > 0 for x in 0...$armor_ids.size if i == $armor_ids[x] @data.push($data_armors [i] ) end end end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) self.contents.font.name = $fontface self.contents.font.size = 20 for i in 0...@item_max draw_item(i) end end end def draw_item(index) item = @data[index] case item when RPG::Item number = $game_party.item_number(item.id) when RPG::Weapon number = $game_party.weapon_number(item.id) when RPG::Armor number = $game_party.armor_number(item.id) end if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end x = 4 + index % 1 * (288 + 32) y = index / 1 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 212, 32, item.name, 0) self.contents.draw_text(x + 144, y, 16, 32, ":", 1) self.contents.draw_text(x + 160, y, 24, 32, number.to_s, 2) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.description) end end #============================================================================== # ■ Window_Armor_Stats #============================================================================== class Window_Armor_Stats < Window_Base def initialize super(0, 0, 352, 352) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 20 @item = nil refresh end def refresh self.contents.clear if @item == nil return end case @item when RPG::Item number = $game_party.item_number(@item.id) when RPG::Weapon number = $game_party.weapon_number(@item.id) when RPG::Armor number = $game_party.armor_number(@item.id) end if @item.is_a?(RPG::Item) return end for i in 0...$game_party.actors.size actor = $game_party.actors[i] if @item.is_a?(RPG::Weapon) item1 = $data_weapons[actor.weapon_id] elsif @item.kind == 0 item1 = $data_armors[actor.armor1_id] elsif @item.kind == 1 item1 = $data_armors[actor.armor2_id] elsif @item.kind == 2 item1 = $data_armors[actor.armor3_id] else item1 = $data_armors[actor.armor4_id] end if not actor.equippable?(@item) draw_actor_graphic(actor, 16, 68 + (84 * i)) draw_actor_name(actor, 0, -6 + (84 * i)) draw_actor_level(actor, 86, -6 + (84 * i)) draw_actor_class(actor, 150, -6 + (84 * i)) draw_actor_state(actor, 230, -6 + (84 * i)) self.contents.draw_text(150, 44 + (84 * i), 150, 32, @item.name) self.contents.font.name = $fontface self.contents.font.size = 20 self.contents.font.color = normal_color self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Não pode Equipar") end if actor.equippable?(@item) draw_actor_graphic(actor, 16, 68 + (84 * i)) draw_actor_name(actor, 0, -6 + (84 * i)) draw_actor_level(actor, 86, -6 + (84 * i)) draw_actor_class(actor, 150, -6 + (84 * i)) draw_actor_state(actor, 230, -6 + (84 * i)) self.contents.draw_text(150, 44 + (84 * i), 150, 32, @item.name) atk1 = 0 atk2 = 0 eva1 = 0 eva2 = 0 str1 = 0 str2 = 0 dex1 = 0 dex2 = 0 agi1 = 0 agi2 = 0 int1 = 0 int2 = 0 pdf1 = 0 pdf2 = 0 mdf1 = 0 mdf2 = 0 eva1 = 0 eva2 = 0 str1 = item1 != nil ? item1.str_plus : 0 str2 = @item != nil ? @item.str_plus : 0 dex1 = item1 != nil ? item1.dex_plus : 0 dex2 = @item != nil ? @item.dex_plus : 0 agi1 = item1 != nil ? item1.agi_plus : 0 agi2 = @item != nil ? @item.agi_plus : 0 int1 = item1 != nil ? item1.int_plus : 0 int2 = @item != nil ? @item.int_plus : 0 pdf1 = item1 != nil ? item1.pdef : 0 pdf2 = @item != nil ? @item.pdef : 0 mdf1 = item1 != nil ? item1.mdef : 0 mdf2 = @item != nil ? @item.mdef : 0 if @item.is_a?(RPG::Weapon) atk1 = item1 != nil ? item1.atk : 0 atk2 = @item != nil ? @item.atk : 0 end if @item.is_a?(RPG::Armor) eva1 = item1 != nil ? item1.eva : 0 eva2 = @item != nil ? @item.eva : 0 end str_change = str2 - str1 dex_change = dex2 - dex1 agi_change = agi2 - agi1 int_change = int2 - int1 pdf_change = pdf2 - pdf1 mdf_change = mdf2 - mdf1 atk_change = atk2 - atk1 eva_change = eva2 - eva1 if item1 == nil name1 = "" else name1 = item1.name end if @item == nil name2 = "" else name2 = @item.name end if str_change == 0 && dex_change == 0 && agi_change == 0 && pdf_change == 0 && mdf_change == 0 && atk_change == 0 && eva_change == 0 && name1 != name2 self.contents.font.name = $fontface self.contents.font.size = 20 self.contents.draw_text(48, 18 + (84 * i), 288, 32, "Sem Mudanças") end if name1 == name2 self.contents.font.name = $fontface self.contents.font.size = 20 self.contents.draw_text(48, 18 + (84 * i), 288, 32, "Equipado") end self.contents.font.name = $fontface self.contents.font.size = 20 self.contents.font.color = normal_color if @item.is_a?(RPG::Weapon) && atk_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if @item.is_a?(RPG::Armor) && eva_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if pdf_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if mdf_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if str_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if dex_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if agi_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if str_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end end end end def item=(item) if @item != item @item = item refresh end end def draw_actor_graphic(actor, x, y) bitmap = RPG::Cache.character(actor.character_name, actor.character_hue) cw = bitmap.width / 4 ch = bitmap.height / 4 src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect) end end #============================================================================== # ■ Window_Accessory #============================================================================== class Window_Accessory < Window_Selectable def initialize super(0, 64, 224, 352) @column_max = 1 refresh self.index = 0 if $game_temp.in_battle self.y = 64 self.height = 256 self.back_opacity = 160 end end def item return @data[self.index] end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 1...$data_armors.size if $game_party.armor_number(i) > 0 for x in 0...$accessory_ids.size if i == $accessory_ids[x] @data.push($data_armors [i] ) end end end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) self.contents.font.name = $fontface self.contents.font.size = 20 for i in 0...@item_max draw_item(i) end end end def draw_item(index) item = @data[index] case item when RPG::Item number = $game_party.item_number(item.id) when RPG::Weapon number = $game_party.weapon_number(item.id) when RPG::Armor number = $game_party.armor_number(item.id) end if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end x = 4 + index % 1 * (288 + 32) y = index / 1 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 212, 32, item.name, 0) self.contents.draw_text(x + 144, y, 16, 32, ":", 1) self.contents.draw_text(x + 160, y, 24, 32, number.to_s, 2) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.description) end end #============================================================================== # ■ Window_Accessory_Stats #============================================================================== class Window_Accessory_Stats < Window_Base def initialize super(0, 0, 352, 352) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 20 @item = nil refresh end def refresh self.contents.clear if @item == nil return end case @item when RPG::Item number = $game_party.item_number(@item.id) when RPG::Weapon number = $game_party.weapon_number(@item.id) when RPG::Armor number = $game_party.armor_number(@item.id) end if @item.is_a?(RPG::Item) return end for i in 0...$game_party.actors.size actor = $game_party.actors[i] if @item.is_a?(RPG::Weapon) item1 = $data_weapons[actor.weapon_id] elsif @item.kind == 0 item1 = $data_armors[actor.armor1_id] elsif @item.kind == 1 item1 = $data_armors[actor.armor2_id] elsif @item.kind == 2 item1 = $data_armors[actor.armor3_id] else item1 = $data_armors[actor.armor4_id] end if not actor.equippable?(@item) draw_actor_graphic(actor, 16, 68 + (84 * i)) draw_actor_name(actor, 0, -6 + (84 * i)) draw_actor_level(actor, 86, -6 + (84 * i)) draw_actor_class(actor, 150, -6 + (84 * i)) draw_actor_state(actor, 230, -6 + (84 * i)) self.contents.draw_text(150, 44 + (84 * i), 150, 32, @item.name) self.contents.font.name = $fontface self.contents.font.size = 20 self.contents.font.color = normal_color self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Não pode Equipar") end if actor.equippable?(@item) draw_actor_graphic(actor, 16, 68 + (84 * i)) draw_actor_name(actor, 0, -6 + (84 * i)) draw_actor_level(actor, 86, -6 + (84 * i)) draw_actor_class(actor, 150, -6 + (84 * i)) draw_actor_state(actor, 230, -6 + (84 * i)) self.contents.draw_text(150, 44 + (84 * i), 150, 32, @item.name) atk1 = 0 atk2 = 0 eva1 = 0 eva2 = 0 str1 = 0 str2 = 0 dex1 = 0 dex2 = 0 agi1 = 0 agi2 = 0 int1 = 0 int2 = 0 pdf1 = 0 pdf2 = 0 mdf1 = 0 mdf2 = 0 eva1 = 0 eva2 = 0 str1 = item1 != nil ? item1.str_plus : 0 str2 = @item != nil ? @item.str_plus : 0 dex1 = item1 != nil ? item1.dex_plus : 0 dex2 = @item != nil ? @item.dex_plus : 0 agi1 = item1 != nil ? item1.agi_plus : 0 agi2 = @item != nil ? @item.agi_plus : 0 int1 = item1 != nil ? item1.int_plus : 0 int2 = @item != nil ? @item.int_plus : 0 pdf1 = item1 != nil ? item1.pdef : 0 pdf2 = @item != nil ? @item.pdef : 0 mdf1 = item1 != nil ? item1.mdef : 0 mdf2 = @item != nil ? @item.mdef : 0 if @item.is_a?(RPG::Weapon) atk1 = item1 != nil ? item1.atk : 0 atk2 = @item != nil ? @item.atk : 0 end if @item.is_a?(RPG::Armor) eva1 = item1 != nil ? item1.eva : 0 eva2 = @item != nil ? @item.eva : 0 end str_change = str2 - str1 dex_change = dex2 - dex1 agi_change = agi2 - agi1 int_change = int2 - int1 pdf_change = pdf2 - pdf1 mdf_change = mdf2 - mdf1 atk_change = atk2 - atk1 eva_change = eva2 - eva1 if item1 == nil name1 = "" else name1 = item1.name end if @item == nil name2 = "" else name2 = @item.name end if str_change == 0 && dex_change == 0 && agi_change == 0 && pdf_change == 0 && mdf_change == 0 && atk_change == 0 && eva_change == 0 && name1 != name2 self.contents.font.name = $fontface self.contents.font.size = 20 self.contents.draw_text(48, 18 + (84 * i), 288, 32, "Equipável") end if name1 == name2 self.contents.font.name = $fontface self.contents.font.size = 20 self.contents.draw_text(48, 18 + (84 * i), 288, 32, "Equipado") end self.contents.font.name = $fontface self.contents.font.size = 20 self.contents.font.color = normal_color if @item.is_a?(RPG::Weapon) && atk_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if @item.is_a?(RPG::Armor) && eva_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if pdf_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if mdf_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if str_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if dex_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if agi_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end if str_change != 0 self.contents.draw_text(48, 18 + (84 * i), 256, 32, "Equipável") end end end end def item=(item) if @item != item @item = item refresh end end def draw_actor_graphic(actor, x, y) bitmap = RPG::Cache.character(actor.character_name, actor.character_hue) cw = bitmap.width / 4 ch = bitmap.height / 4 src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect) end end #============================================================================== # ■ Window_NewSkill #============================================================================== class Window_NewSkill < Window_Selectable def initialize(actor) super(0, 64, 384, 352) @actor = actor @column_max = 1 refresh self.index = 0 if $game_temp.in_battle self.y = 64 self.height = 256 self.back_opacity = 160 end end def skill return @data[self.index] end def update_actor(actor) @actor = actor refresh end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 0...@actor.skills.size skill = $data_skills[@actor.skills[i]] if skill != nil @data.push(skill) end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) self.contents.font.name = $fontface self.contents.font.size = 20 for i in 0...@item_max draw_item(i) end end end def draw_item(index) skill = @data[index] if @actor.skill_can_use?(skill.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end x = 4 + index % 1 * (240 + 32) y = index / 1 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(skill.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0) self.contents.draw_text(x + 288, y, 48, 32, skill.sp_cost.to_s, 2) end def update_help @help_window.set_text(self.skill == nil ? "" : self.skill.description) end end #============================================================================== # ■ Window_NewEquipLeft #============================================================================== class Window_NewEquipLeft < Window_Base attr_accessor :mode attr_accessor :changes def initialize(actor) super(32, 96, 272, 352) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 20 self.z += 100 @actor = actor @mode = 0 @changes = [0, 0, 0, 0, 0, 0, 0, 0] @elem_text = "" @stat_text = "" refresh end def update_actor(actor) @actor = actor refresh end def refresh self.contents.clear draw_actor_name(@actor, 4, 0) draw_actor_level(@actor, 180, 0) draw_actor_parameter(@actor, 4, 24, 0) draw_actor_parameter(@actor, 4, 48, 1) draw_actor_parameter(@actor, 4, 72, 2) draw_actor_parameter(@actor, 4, 96, 3) draw_actor_parameter(@actor, 4, 120, 4) draw_actor_parameter(@actor, 4, 144, 5) draw_actor_parameter(@actor, 4, 168, 6) if @mode == 0 self.contents.font.color = up_color self.contents.draw_text(4, 216, 200, 32, "Ataque Elemental:") self.contents.draw_text(4, 264, 200, 32, "Ataque de Status:") end if @mode == 1 self.contents.font.color = up_color self.contents.draw_text(4, 216, 200, 32, "Defesa Elemental:") self.contents.draw_text(4, 264, 200, 32, "Defesa de Status:") end self.contents.font.color = normal_color self.contents.draw_text(24, 240, 220, 32, @elem_text) self.contents.draw_text(24, 288, 220, 32, @stat_text) if @new_atk != nil self.contents.font.color = system_color self.contents.draw_text(168, 24, 40, 32, "»»", 1) if @changes[0] == 0 self.contents.font.color = normal_color elsif @changes[0] == -1 self.contents.font.color = down_color else self.contents.font.color = up_color end self.contents.draw_text(200, 24, 36, 32, @new_atk.to_s, 2) end if @new_pdef != nil self.contents.font.color = system_color self.contents.draw_text(168, 48, 40, 32, "»»", 1) if @changes[1] == 0 self.contents.font.color = normal_color elsif @changes[1] == -1 self.contents.font.color = down_color else self.contents.font.color = up_color end self.contents.draw_text(200, 48, 36, 32, @new_pdef.to_s, 2) end if @new_mdef != nil self.contents.font.color = system_color self.contents.draw_text(168, 72, 40, 32, "»»", 1) if @changes[2] == 0 self.contents.font.color = normal_color elsif @changes[2] == -1 self.contents.font.color = down_color else self.contents.font.color = up_color end self.contents.draw_text(200, 72, 36, 32, @new_mdef.to_s, 2) end if @new_str != nil self.contents.font.color = system_color self.contents.draw_text(168, 96, 40, 32, "»»", 1) if @changes[3] == 0 self.contents.font.color = normal_color elsif @changes[3] == -1 self.contents.font.color = down_color else self.contents.font.color = up_color end self.contents.draw_text(200, 96, 36, 32, @new_str.to_s, 2) end if @new_dex != nil self.contents.font.color = system_color self.contents.draw_text(168, 120, 40, 32, "»»", 1) if @changes[4] == 0 self.contents.font.color = normal_color elsif @changes[4] == -1 self.contents.font.color = down_color else self.contents.font.color = up_color end self.contents.draw_text(200, 120, 36, 32, @new_dex.to_s, 2) end if @new_agi != nil self.contents.font.color = system_color self.contents.draw_text(168, 144, 40, 32, "»»", 1) if @changes[5] == 0 self.contents.font.color = normal_color elsif @changes[5] == -1 self.contents.font.color = down_color else self.contents.font.color = up_color end self.contents.draw_text(200, 144, 36, 32, @new_agi.to_s, 2) end if @new_int != nil self.contents.font.color = system_color self.contents.draw_text(168, 168, 40, 32, "»»", 1) if @changes[6] == 0 self.contents.font.color = normal_color elsif @changes[6] == -1 self.contents.font.color = down_color else self.contents.font.color = up_color end self.contents.draw_text(200, 168, 36, 32, @new_int.to_s, 2) end end def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int, new_eva, elem_text, stat_text) flag = false if new_atk != @new_atk || new_pdef != @new_pdef || new_mdef != @new_mdef flag = true end if new_str != @new_str || new_dex != @new_dex || new_agi != @new_agi flag = true end if new_eva != @new_eva || elem_text != @elem_text || stat_text != @stat_text flag = true end @new_atk = new_atk @new_pdef = new_pdef @new_mdef = new_mdef @new_str = new_str @new_dex = new_dex @new_agi = new_agi @new_int = new_int @new_eva = new_eva @elem_text = elem_text @stat_text = stat_text if flag refresh end end end #============================================================================== # ■ Window_NewEquipRight #============================================================================== class Window_NewEquipRight < Window_Selectable def initialize(actor) super(304, 96, 304, 192) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 20 @actor = actor refresh self.index = 0 end def item return @data[self.index] end def update_actor(actor) @actor = actor refresh 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 #============================================================================== # ■ Window_NewEquipItem #============================================================================== class Window_NewEquipItem < Window_Selectable def initialize(actor, equip_type) super(304, 288, 304, 160) @actor = actor @equip_type = equip_type @column_max = 1 refresh self.active = false self.index = -1 end def item return @data[self.index] end def update_actor(actor, equip_type) @actor = actor @equip_type = equip_type refresh end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] if @equip_type == 0 weapon_set = $data_classes[@actor.class_id].weapon_set for i in 1...$data_weapons.size if $game_party.weapon_number(i) > 0 and weapon_set.include?(i) @data.push($data_weapons[i]) end end end if @equip_type != 0 armor_set = $data_classes[@actor.class_id].armor_set for i in 1...$data_armors.size if $game_party.armor_number(i) > 0 and armor_set.include?(i) if $data_armors[i].kind == @equip_type-1 @data.push($data_armors[i]) end end end end @data.push(nil) @item_max = @data.size self.contents = Bitmap.new(width - 32, row_max * 32) self.contents.font.name = $fontface self.contents.font.size = 20 for i in 0...@item_max-1 draw_item(i) end s = @data.size-1 self.contents.draw_text(4, s*32, 100, 32, "[Remover]") end def draw_item(index) item = @data[index] x = 4 y = index * 32 case item when RPG::Weapon number = $game_party.weapon_number(item.id) when RPG::Armor number = $game_party.armor_number(item.id) end bitmap = RPG::Cache.icon(item.icon_name) self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24)) self.contents.font.color = normal_color self.contents.draw_text(x + 28, y, 212, 32, item.name, 0) self.contents.draw_text(x + 208, y, 16, 32, ":", 1) self.contents.draw_text(x + 224, y, 24, 32, number.to_s, 2) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.description) end end #============================================================================== # ■ Window_NewStatus #============================================================================== class Window_NewStatus < Window_Base def initialize(actor) super(0, 0, 576, 416) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 20 @actor = actor refresh end def refresh self.contents.clear draw_actor_name(@actor, 54, 0) draw_actor_battler(@actor, 80, 200) draw_actor_class(@actor, 254, 0) draw_actor_level(@actor, 184, 0) draw_actor_state(@actor, 184, 40) draw_actor_hp(@actor, 184, 80, 172) draw_actor_sp(@actor, 184, 120, 172) draw_actor_exp(@actor, 184, 160, 172) draw_actor_parameter(@actor, 386, 0, 0) draw_actor_parameter(@actor, 386, 24, 1) draw_actor_parameter(@actor, 386, 48, 2) draw_actor_parameter(@actor, 386, 72, 3) draw_actor_parameter(@actor, 386, 96, 4) draw_actor_parameter(@actor, 386, 120, 5) draw_actor_parameter(@actor, 386, 144, 6) draw_actor_parameter(@actor, 386, 168, 7) self.contents.font.color = system_color self.contents.draw_text(45, 196, 180, 32, "Vulnerabilidade Elemental" ) self.contents.font.size = 16 draw_actor_element_radar_graph(@actor, 14, 204) self.contents.font.size = 20 self.contents.font.color = system_color self.contents.draw_text(360, 200, 96, 32, "Equipamento") self.contents.draw_text(280, 228, 96, 32, "Arma") self.contents.draw_text(280, 256, 96, 32, "Braço") self.contents.draw_text(280, 284, 96, 32, "Cabeça") self.contents.draw_text(280, 312, 96, 32, "Corpo") self.contents.draw_text(280, 340, 96, 32, "Accessório") equip = $data_weapons[@actor.weapon_id] if @actor.equippable?(equip) draw_item_name($data_weapons[@actor.weapon_id], 386, 228) else self.contents.font.color = knockout_color self.contents.draw_text(386, 228, 192, 32, "Nada Equipado") end equip1 = $data_armors[@actor.armor1_id] if @actor.equippable?(equip1) draw_item_name($data_armors[@actor.armor1_id], 386, 256) else self.contents.font.color = crisis_color self.contents.draw_text(386, 256, 192, 32, "Nada Equipado") end equip2 = $data_armors[@actor.armor2_id] if @actor.equippable?(equip2) draw_item_name($data_armors[@actor.armor2_id], 386, 284) else self.contents.font.color = crisis_color self.contents.draw_text(386, 284, 192, 32, "Nada Equipado") end equip3 = $data_armors[@actor.armor3_id] if @actor.equippable?(equip3) draw_item_name($data_armors[@actor.armor3_id], 386, 312) else self.contents.font.color = crisis_color self.contents.draw_text(386, 312, 192, 32, "Nada Equipado") end equip4 = $data_armors[@actor.armor4_id] if @actor.equippable?(equip4) draw_item_name($data_armors[@actor.armor4_id], 386, 340) else self.contents.font.color = crisis_color self.contents.draw_text(386, 340, 192, 32, "Nada Equipado") end end def update_actor(actor) @actor = actor refresh end def dummy self.contents.font.color = system_color self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon) self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1) self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2) self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3) self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4) draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144) draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208) draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272) draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336) draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400) end end #============================================================================== # ■ Window_NewGold #============================================================================== class Window_NewGold < Window_Base def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 20 refresh end def refresh self.contents.clear cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s + " ", 2) self.contents.font.color = system_color self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2) end end #============================================================================== # ■ class Window_NewTime # written by Deke #------------------------------------------------------------------------------- #============================================================================== class Window_NewTime < Window_Base def initialize super(0, 0, 160, 96) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 20 refresh end def refresh self.contents.clear self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name) self.contents.font.name = $fontface self.contents.font.size = 20 @total_sec = Graphics.frame_count / Graphics.frame_rate @minute=$game_time.get_minute.floor hour = $game_time.get_hour pm_flag= hour >=12 ? true : false hour= hour >= 12 ? hour-12 : hour day=$game_time.get_day month=$game_time.get_month year=$game_time.get_year if hour.floor==0 text=sprintf("%02d:%02d",12,@minute) else text=sprintf("%02d:%02d",hour,@minute) end if pm_flag text += " PM" else text += " AM" end self.contents.font.color = normal_color self.contents.draw_text(16, 32, 110, 32, text, 2) text = sprintf("%02d - %02d - %02d", day, month, year) self.contents.font.color = system_color self.contents.draw_text(4,0,120,32,text) end def update if $game_time.get_minute.floor != @minute refresh end end end #============================================================================== # ■ Window_NewLocation #============================================================================== class Window_NewLocation < Window_Base def initialize super(0, 0, 160, 96) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 20 refresh end def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, 0, 120, 32, "Localidade") self.contents.font.color = normal_color self.contents.draw_text(4, 32, 120, 32, $game_map.name.to_s, 2) end end #============================================================================== # ■ Window_OptionMenuCommand #============================================================================== class Window_OptionMenuCommand < Window_Selectable def initialize(width, commands) super(0, 0, width, commands.size * 32 + 32) @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * 32) self.contents.font.name = $fontface self.contents.font.size = 20 refresh self.index = 0 end def refresh self.contents.clear for i in 0...@item_max draw_item(i, normal_color) end end def draw_item(index, color) self.contents.font.color = color rect = Rect.new(12, 32 * index, self.contents.width - 8, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon("optionmenu" + index.to_s) self.contents.blt(x + 3, index * 32 +4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(rect, @commands[index]) end def disable_item(index) draw_item(index, disabled_color) end end #============================================================================== # ■ Window_CurrentWindowSkin #============================================================================== class Window_CurrentWindowSkin < Window_Base def initialize super(0, 0, 192, 96) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 20 end def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, 0, 120, 32, "Aparência Escolhida") self.contents.font.color = normal_color self.contents.draw_text(4, 32, 120, 32, $game_system.windowskin_name.to_s, 2.9) end end #============================================================================== # ■ Window_WindowSkin #============================================================================== class Window_WindowSkin < Window_Selectable def initialize(width, commands) super(0, 0, width, commands.size * 32 + 32) @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * 32) self.contents.font.name = $fontface self.contents.font.size = 20 refresh self.index = 0 end def refresh self.contents.clear for i in 0...@item_max draw_item(i, normal_color) end end def draw_item(index, color) self.contents.font.color = color rect = Rect.new(12, 32 * index, self.contents.width - 8, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon("skin" + index.to_s) self.contents.blt(x + 3, index * 32 +4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(rect, @commands[index]) end def disable_item(index) draw_item(index, disabled_color) end end #============================================================================== # ■ Window_CurrentFontType #============================================================================== class Window_CurrentFontType < Window_Base def initialize super(0, 0, 192, 96) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 20 end def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, 0, 120, 32, "Fonte Escolhida") self.contents.font.color = normal_color self.contents.draw_text(4, 32, 120, 32, $fontface.to_s, 2.9) end end #============================================================================== # ■ Window_FontType #============================================================================== class Window_FontType < Window_Selectable def initialize(width, commands) super(0, 0, width, commands.size * 32 + 32) @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * 32) self.contents.font.name = $fontface self.contents.font.size = 20 refresh self.index = 0 end def refresh self.contents.clear for i in 0...@item_max draw_item(i, normal_color) end end def draw_item(index, color) self.contents.font.color = color rect = Rect.new(4, 32 * index, self.contents.width - 8, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index]) end def disable_item(index) draw_item(index, disabled_color) end end #============================================================================== # ■ Window_CurrentBGM_Volume #============================================================================== class Window_CurrentBGM_Volume < Window_Base def initialize super(0, 0, 192, 96) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 20 end def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, 0, 160, 32, "Volume BGM Selecionado") self.contents.font.color = normal_color self.contents.draw_text(4, 32, 120, 32, $game_system.bgm_volume.to_s + "%", 2.9) end end #============================================================================== # ■ Window_BGM_Volume #============================================================================== class Window_BGM_Volume < Window_Selectable def initialize(width, commands) super(0, 0, width, commands.size * 32 + 32) @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * 32) self.contents.font.name = $fontface self.contents.font.size = 20 refresh self.index = 0 end def refresh self.contents.clear self.contents.font.name = $fontface self.contents.font.size = 20 for i in 0...@item_max draw_item(i, normal_color) end end def draw_item(index, color) self.contents.font.color = color rect = Rect.new(4, 32 * index, self.contents.width - 8, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index]) end def disable_item(index) draw_item(index, disabled_color) end end #============================================================================== # ■ Window_CurrentSFX_Volume #============================================================================== class Window_CurrentSFX_Volume < Window_Base def initialize super(0, 0, 192, 96) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = 20 end def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, 0, 160, 32, "Volume SFX Selecionado") self.contents.font.color = normal_color self.contents.draw_text(4, 32, 120, 32, $game_system.se_volume.to_s + "%", 2.9) end end #============================================================================== # ■ Window_SFX_Volume #============================================================================== class Window_SFX_Volume < Window_Selectable def initialize(width, commands) super(0, 0, width, commands.size * 32 + 32) @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * 32) self.contents.font.name = $fontface self.contents.font.size = 20 refresh self.index = 0 end def refresh self.contents.clear self.contents.font.