赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 235 |
最后登录 | 2013-10-19 |
在线时间 | 2 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 2 小时
- 注册时间
- 2006-9-3
- 帖子
- 61
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
呵呵
问题很多,希望大家修改。
第一部分
- # Custom Menu System
- #============================================================
- 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
- 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)
- 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 = "Magic Defense"
- 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
- 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, "Load", 1)
- self.contents.draw_text(50, 35, 124, 32, "Save", 1)
- self.contents.draw_text(140, 35, 124, 32, "Exit", 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, "Playtime:")
- @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(-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, "Class:")
- 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, "Class:")
- 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("Which Character would you like to select?").width
- self.contents.draw_text(145, -6, cx, 32, "Which Character would you like to select?", 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, "Current State:")
- self.contents.draw_text(190, 114, 120, 32, "Experience:")
- self.contents.draw_text(0, -7, 120, 32, "Name:")
- 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, "Current State:")
- self.contents.draw_text(190, 114, 120, 32, "Experience:")
- self.contents.draw_text(0, -7, 120, 32, "Name:")
- 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("Which file would you like to load?")
- 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
复制代码
|
|