赞 | 0 |
VIP | 0 |
好人卡 | 9 |
积分 | 1 |
经验 | 13328 |
最后登录 | 2023-2-12 |
在线时间 | 278 小时 |
Lv1.梦旅人 尽头
- 梦石
- 0
- 星屑
- 119
- 在线时间
- 278 小时
- 注册时间
- 2010-6-20
- 帖子
- 1280
|
- #==============================================================================
- # ■ Scene_Map From : DIYRPG 修改 : bbaugle
- #------------------------------------------------------------------------------
- # 处理地图画面的类。
- #==============================================================================
- class Scene_Map
- #--------------------------------------------------------------------------
- # ● 在这里控制脚本的属性
- #--------------------------------------------------------------------------
- SWITCH_ID = 6 #在这里设定开关的编号……
- $center_hud = false #这里决定是否将HUD(状态窗口)居中显示……
- #--------------------------------------------------------------------------
- # ● 初始化别名
- #--------------------------------------------------------------------------
- alias raz_hud_main main
- alias raz_hud_update update
- #--------------------------------------------------------------------------
- # ● 主进程
- #--------------------------------------------------------------------------
- def main
- @size = $game_party.actors.size
- raz_hud_main
- @hud_window.dispose
- @hud2_window.dispose
- for i in 0...$game_party.actors.size
- @hud_dummy[i].dispose
- end #for
- end #def
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- if @size != $game_party.actors.size
- @hud_window.refresh
- show_window
- end #if
- if @hud != true
- main_window
- end #if
- turn_hud_on_off
- @hud_window.update
- @hud2_window.update
- raz_hud_update
- end #def
- #--------------------------------------------------------------------------
- # ● 与状态窗口的显示行为相关的语句
- #--------------------------------------------------------------------------
- def show_window
- @size = $game_party.actors.size
- for i in 0..3
- @hud_dummy[i].visible = ($game_party.actors[i] != nil)
- end #for
- end #def
- #--------------------------------------------------------------------------
- # ● 与状态窗口的创建相关的语句
- #--------------------------------------------------------------------------
- def main_window
- @opacity = 0
- @hud_dummy = []
- for i in 0...4
- y = $game_party.actors.size - 1
- x = 240 - (y * 80)
- if $center_hud == true
- @hud_dummy[i] = Window_Base.new(160 * i + x, 372,160, 108)
- else
- @hud_dummy[i] = Window_Base.new(160 * i, 100,160, 108)
- end #if
- @hud_dummy[i].opacity = @opacity
- @hud_dummy[i].visible = false
- end #for
- @hud_window = Window_HUD.new
- @hud2_window = Window_HUD2.new
- for i in 0...$game_party.actors.size
- @hud_dummy[i].visible = $game_party.actors[i] != nil
- end #for
- @hud = true
- end #def
- #--------------------------------------------------------------------------
- # ● 与状态窗口的开关相关的语句
- #--------------------------------------------------------------------------
- def turn_hud_on_off
- if $game_switches[SWITCH_ID] == false #关掉开关
- $game_temp.common_event_id =11
- @hud_window.visible = false
- @hud2_window.visible = false
- for i in 0...$game_party.actors.size
- @hud_dummy[i].visible = false
- end #for
- end #if
- if $game_switches[SWITCH_ID] == true #打开开关
- $game_temp.common_event_id =11
- @hud_window.visible = true
- @hud2_window.visible = true
- for i in 0...$game_party.actors.size
- @hud_dummy[i].visible = true
- end #for
- end #if
- end #def
- end #class
- #==============================================================================
- # ■ Window_HUD
- #------------------------------------------------------------------------------
- # 地图画面中显示的状态窗口。
- #==============================================================================
- class Window_HUD < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- #--------------------------------------------------------------------------
- def initialize
- super(-100, -100, 800, 600)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.opacity = 0
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- eval("@old_hp#{i+1} = actor.hp; @old_sp#{i+1} = actor.sp")#; @old_exp#{i+1} = actor.now_exp")
- end #for
- refresh
- end #def
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in 0...$game_party.actors.size
- a = $game_party.actors.size - 1
- actor = $game_party.actors[i]
- if $center_hud == true
- x = (i * 160 + 25) + (240 - (a * 80))
- else
- x = i * 160 + 25
- end #if
-
-
-
- self.contents.font.name = (["黑体"])
- self.contents.font.size = 14
- self.contents.font.bold = false
- self.contents.draw_text(182, 80, 100,32, actor.name)
- draw_actor_face(actor, 115, 160)
- draw_actor_lvp(actor, 100, 108)
- draw_actor_hpp(actor, 150, 124,1000)
- draw_actor_spp(actor, 150, 140,1000)
- draw_actor_expp(actor, 102, 569,1000)
- draw_gold(actor, 600, 555-26)
- draw_mission(actor, 160, 530)
-
- #draw_actor_exp(actor, 90, 220, 204)
-
-
-
-
- width = 100
- height = 6
- draw_slant_bar(150, 110,actor.hp, actor.maxhp, width, height, Color.new(150, 0, 0), Color.new(155, 155, 60))
- draw_slant_bar(150, 125,actor.sp, actor.maxsp, width, height, Color.new(0, 0, 150), Color.new(60, 155, 155))
- # draw_slant_bar(150, 140, actor.now_exp, actor.next_exp, width, height, Color.new(0, 150, 0), Color.new(60, 255, 60))
- $game_temp.common_event_id =11
-
- self.contents.font.name = (["黑体"])#(["911 Porscha"])#(["DigifaceWide"])#(["256 Bytes"])
- self.contents.font.size = 14
- self.contents.font.bold = true
- self.contents.draw_text(153, 97, 100, 32, "#{actor.hp}/#{actor.maxhp}", 1)
- self.contents.draw_text(153, 97 + 16, 100, 32, "#{actor.sp}/#{actor.maxsp}", 1)
- #self.contents.draw_text(153, 97 + 32, 100, 32, "#{actor.now_exp}/#{actor.next_exp}", 1)
- self.contents.font.size = 18
- self.contents.draw_text(80+10, 80-3, 100, 32, "#{actor.level}", 1)
- end #for
- end #def
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- if (eval("@old_hp#{i+1}") != actor.hp or eval("@old_sp#{i+1}") != actor.sp)# or
- #eval("@old_exp#{i+1}") != actor.now_exp)
- refresh
- eval("@old_hp#{i+1} = actor.hp; @old_sp#{i+1} = actor.sp")#; @old_exp#{i+1} = actor.now_exp")
- end #if
- end #super
- end #def
- end #class
- #==============================================================================
- # ■ Window_HUD 2
- #------------------------------------------------------------------------------
- # 地图画面中显示的金钱窗口。
- #==============================================================================
- class Window_HUD2 < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- #--------------------------------------------------------------------------
- def initialize
- super(-100, -100, 800, 600)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.opacity = 0
- refresh
- end #def
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.name = (["DigifaceWide"])#(["256 Bytes"])
- self.contents.font.size = 16
- self.contents.font.bold = true
-
- cxg = contents.text_size($data_system.words.gold).width
- self.contents.font.color = normal_color
- self.contents.draw_text(580, 526-26, 120-cxg-2, 32, $game_party.gold.to_s, 2)
- end #def
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- refresh
- #end #super
- end #def
- end
- =begin
- #==============================================================================
- # ■ Window_HUD 3
- #------------------------------------------------------------------------------
- # 地图画面中显示的经验窗口。
- #==============================================================================
- class Window_HUD3 < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- #--------------------------------------------------------------------------
- def initialize
- super(-100, -100, 800, 600)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.opacity = 0
- refresh
- end #def
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- self.contents.font.name = (["黑体"])#(["911 Porscha"])#(["DigifaceWide"])#(["256 Bytes"])
- self.contents.font.size = 14
- self.contents.font.bold = true
- self.contents.draw_text(-125, 97 + 45, 640, 48, "#{actor.now_exp}/#{actor.next_exp}", 1)
- end
- end #def
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- if (eval("@old_exp#{i+1}") != actor.now_exp)
- refresh
- eval("@old_exp#{i+1} = actor.now_exp")
- end #if
- end #super
- end #def
- end #class
- =end
- #==============================================================================
- # ■ Window_Base
- #------------------------------------------------------------------------------
- # 游戏中全部窗口的超级类。
- #==============================================================================
- class Window_Base < Window
- #状态条的绘制
- def draw_slant_bar(x, y, min, max, width = 152, height = 6,
- bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
- for i in 0..height
- self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
- end #for
- for i in 1..(height - 1)
- r = 100 * (height - i) / height + 0 * i / height
- g = 100 * (height - i) / height + 0 * i / height
- b = 100 * (height - i) / height + 0 * i / height
- a = 255 * (height - i) / height + 255 * i / height
- self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
- end #for
- for i in 1..( (min / max.to_f) * width - 1)
- for j in 1..(height - 1)
- r = bar_color.red * (width - i) / width + end_color.red * i / width
- g = bar_color.green * (width - i) / width + end_color.green * i / width
- b = bar_color.blue * (width - i) / width + end_color.blue * i / width
- a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
- self.contents.fill_rect(x + i + j, y + height - j,1, 1, Color.new(r, g, b, a))
- end #for
- end #for
- end #def
- end #class
- #==============================================================================
- # ■ Game_Actor
- #------------------------------------------------------------------------------
- # 处理角色的类。本类在 Game_Actors 类 ($game_actors)
- # 的内部使用、Game_Party 类请参考 ($game_party) 。
- #==============================================================================
- class Game_Actor
- #获取当前EXP
- def now_exp
- return @exp - @exp_list[@level]
- end #def
-
-
- #获取下一级需要EXP的数值
- def next_exp
- return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
- end #def
-
- def exp=(exp)
- @exp = [[exp, 9999999].min, 0].max
- # 升级
- while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
- @level += 1
- @hp = @maxhp
- @sp = @maxsp
- $game_temp.common_event_id =22
- $game_variables[50] += 5
-
-
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- end #for
- $game_variables[42] == actor.level
- #changeTitle("Candy's Tour [Game]Name:Candy Level:#{actor.level} \000")
-
- end
- # 修正当前的 HP 与 SP 超过最大值
- @hp = [@hp, self.maxhp].min
- @sp = [@sp, self.maxsp].min
- end
- end
复制代码 如果出错就把出错的地方删掉。免得太麻烦 |
|