赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 18684 |
最后登录 | 2020-5-5 |
在线时间 | 9 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 60
- 在线时间
- 9 小时
- 注册时间
- 2006-9-7
- 帖子
- 303
|
我现在把脚本发给你,希望对你有所帮助.
战斗中显示坐标图和状态图
- #==============================================================================
- # ■ Window_BattleStatus
- #------------------------------------------------------------------------------
- # 显示战斗画面同伴状态的窗口。
- #==============================================================================
- class Window_BattleStatus < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 640, 480)
- self.contents = Bitmap.new(width - 32, height - 32)
- @level_up_flags = [false, false, false, false]
-
- self.opacity = 0
- @sta_back = []
- @sta_output = []
-
- @hp_bitmap = RPG::Cache.picture("HP_Meter.png")
- @mp_bitmap = RPG::Cache.picture("SP_Meter.png")
-
- @xy_window = Window_xy.new
- @xy_window.x = -16
- @xy_window.y = -16
- @xy_window.opacity = 0
- @xy_window.back_opacity = 0
- @xy_window.contents_opacity = 255
-
- for actor_index in 1..$game_party.actors.size
- @sta_back[actor_index] = Sprite.new
- @sta_back[actor_index].bitmap = Bitmap.new("Graphics/Pictures/" + $game_party.actors[actor_index - 1].name + "战斗.png")
- @sta_back[actor_index].x = 510-(actor_index - 1) * 130
- @sta_back[actor_index].y = 0
- @sta_back[actor_index].z = self.z + 1
- @sta_output[actor_index] = Sprite.new
- @sta_output[actor_index].bitmap = Bitmap.new(180, 120)
- @sta_output[actor_index].x = 476-(actor_index - 1) * 130
- @sta_output[actor_index].y = -29 #(actor_index - 1) * 80 - 29
- @sta_output[actor_index].z = self.z + 200
- @sta_output[actor_index].bitmap.clear
- @sta_output[actor_index].bitmap.font.size = 10
- @sta_output[actor_index].bitmap.font.name = "黑体"
- hp_width = $game_party.actors[actor_index - 1].hp * @hp_bitmap.width/$game_party.actors[actor_index - 1].maxhp
- hp_rect = Rect.new(0, 0, hp_width, 12)
- mp_width = $game_party.actors[actor_index - 1].sp * @mp_bitmap.width/$game_party.actors[actor_index - 1].maxsp
- mp_rect = Rect.new(0, 0, mp_width, 12)
- end
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 释放
- #--------------------------------------------------------------------------
- def dispose
- super
- for actor_index in 1..$game_party.actors.size
- @sta_back[actor_index].bitmap.dispose
- @sta_back[actor_index].dispose
- @sta_output[actor_index].bitmap.dispose
- @sta_output[actor_index].dispose
- end
- end
- #--------------------------------------------------------------------------
- # ● 设置升级标志
- # actor_index : 角色索引
- #--------------------------------------------------------------------------
- def level_up(actor_index)
- @level_up_flags[actor_index] = true
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.actors.size
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- #......................................................................
- actor_x = 480#i * 160 + 145
- actor_y = 0#i * 80 + 220
- @sta_output[i + 1].bitmap.clear
-
- hp_width = $game_party.actors[i].hp * @hp_bitmap.width/$game_party.actors[i].maxhp
- hp_rect = Rect.new(0, 0, hp_width, 12)
-
- mp_width = $game_party.actors[i].sp * @mp_bitmap.width/$game_party.actors[i].maxsp
- mp_rect = Rect.new(0, 0, mp_width, 12)
-
- @sta_output[i + 1].bitmap.blt(80, 44, @hp_bitmap, hp_rect)
- #间距
- @sta_output[i + 1].bitmap.blt(80, 56, @mp_bitmap, mp_rect)
-
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- # 主界面的不透明度下降
- if $game_temp.battle_main_phase
- self.contents_opacity = 255 #if self.contents_opacity > 1
- else
- self.contents_opacity = 255 #if self.contents_opacity < 255
- end
- end
- end
复制代码
地图坐标
- #-----------------------------------------------------------------------------
- # ■class map_XY
- #-----------------------------------------------------------------------------
- class Window_xy < Window_Base
- def initialize
- super(0, 0, 680, 560) #175, 100
- self.contents = Bitmap.new(width - 32, height - 22)
- self.opacity = 0
- self.back_opacity = 0
- self.contents_opacity = 255
- self.visible = true
- refresh
- @x = $game_player.x
- @y = $game_player.y
- @id = $game_map.map_id
- end
- def refresh
- @x = $game_player.x
- @y = $game_player.y
- @id = $game_map.map_id
- self.contents.clear
- a = "001"
- bitmap=Bitmap.new("Graphics/Pictures/#{a}")
- src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
- self.contents.blt(0, 0, bitmap, src_rect)
- $mapnames = load_data("Data/MapInfos.rxdata")
- map_name = $mapnames[@id].name
- self.contents.font.color = Color.new(255, 255, 255, 255)
- self.contents.font.size = 16
- self.contents.draw_text(2, 4, 80, 18, map_name,2)
- self.contents.font.color = Color.new(255, 255, 255, 255)
- self.contents.font.size = 16
- self.contents.draw_text(2, 4, 80, 18, map_name,2)
- self.contents.font.color = Color.new(255, 255, 255, 255)
- self.contents.font.size = 16
- self.contents.draw_text(2, 4, 80, 18, map_name,2)
- self.contents.font.color = Color.new(255, 255, 255, 255)
- self.contents.font.size = 12
- self.contents.draw_text(10, 24, 120, 15, "X:")
- self.contents.font.color = normal_color
- self.contents.font.size = 12
- self.contents.draw_text(0, 15, 45, 32, @x.to_s,2)
- self.contents.font.color = Color.new(255, 255, 255, 255)
- self.contents.font.size = 12
- self.contents.draw_text(60, 15, 90, 32, "Y:")
- self.contents.font.color = Color.new(255, 255, 255, 255)
- self.contents.font.size = 12
- self.contents.draw_text(0, 15, 95, 32, @y.to_s,2)
- end
-
- def judge
- return true if @x != $game_player.x
- return true if @y != $game_player.y
- return true if @id != $game_map.map_id
- return false
- end
- end
- class Scene_Map
- alias xy_66rpg_main main
- def main
- @xy_window = Window_xy.new
- @xy_window.x = - 16
- @xy_window.y = - 16
- xy_66rpg_main
- @xy_window.dispose
- end
- alias xy_66rpg_update update
- def update
- xy_66rpg_update
-
- @xy_window.visible = false
- @xy_window.refresh if @xy_window.judge
- else
- @xy_window.visible = true
- end
- end
复制代码
在地图上显示坐标图和人物框
- #_______________________________________________________________________________
- # MOG_MPW HUD Elena V2.0
- #_______________________________________________________________________________
- # By Moghunter
- # http://www.atelier-rgss.com
- #_______________________________________________________________________________
- module MOG
- #HUD Position.
- STMAPX = 476 # X Pos
- STMAPY = - 16 # Y Pos
- #Disable HUD Switch ID.
- STMAPVIS = 1
- #Windowskin name.
- STMAPSKIN = ""
- #Window Opacity.
- STMAPOPA = 0
- end
- $mogscript = {} if $mogscript == nil
- $mogscript["mpstelen"] = true
- ###############
- # Window_Base #
- ###############
- class Window_Base < Window
- def draw_maphp2(actor, x, y)
-
- text = RPG::Cache.picture("HP_Tx")
- cw = text.width
- ch = text.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt( 20, 0, text, src_rect)
- meter = RPG::Cache.picture("HP_Meter")
- cw = meter.width * actor.hp / actor.maxhp
- ch = meter.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt( 66 ,16 , meter, src_rect)
- end
- def draw_mapsp2(actor, x, y)
- meter = RPG::Cache.picture("SP_Meter")
- cw = meter.width * actor.sp / actor.maxsp
- ch = meter.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt( 66, 29, meter, src_rect)
- end
- def draw_mexp(actor, x, y)
- actor = $game_party.actors[0]
- if actor.next_exp != 0
- rate = actor.now_exp.to_f / actor.next_exp
- else
- rate = 1
- end
- bitmap = RPG::Cache.picture("Exp_Meter")
- if actor.level < 99
- cw = bitmap.width * rate
- else
- cw = bitmap.width
- end
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(66 , 3, bitmap, src_rect)
- end
- def nada
- face = RPG::Cache.picture("")
- end
- def draw_heroface(actor,x,y)
- face = RPG::Cache.picture(actor.name + "_face") rescue nada
- cw = face.width
- ch = face.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(23 , 2, face, src_rect)
- 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
- #####################
- # Window_Status_Map #
- #####################
- class Window_Sthero < Window_Base
- def initialize
- super(0, 0, 310, 120)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.windowskin = RPG::Cache.windowskin(MOG::STMAPSKIN)
- self.contents.font.bold = true
- self.contents.font.size = 20
- self.contents.font.name = "Georgia"
- self.opacity = MOG::STMAPOPA
- refresh
- end
- def refresh
- self.contents.clear
- actor = $game_party.actors[0]
- draw_maphp2(actor, 35, 35)
- draw_mapsp2(actor, - 40, 60)
- draw_heroface(actor, 0, 70)
- # draw_actor_statemap(actor, 200, 60, 70)
- # draw_actor_levelmap(actor, 80, 10)
- draw_mexp(actor, 100, 10)
- end
- end
- ###############
- # Game_Player #
- ###############
- class Game_Player < Game_Character
- attr_accessor :wref
- end
- #############
- # Scene_Map #
- #############
- class Scene_Map
- alias mog11_main main
- def main
- @sthero = Window_Sthero.new
- @sthero.x = MOG::STMAPX
- @sthero.y = MOG::STMAPY
- if $game_switches[MOG::STMAPVIS] == false
- @sthero.visible = true
- else
- @sthero.visible = false
- end
- mog11_main
- @sthero.dispose
- end
- alias mog11_update update
- def update
- if $game_switches[MOG::STMAPVIS] == false
- @sthero.visible = true
- else
- @sthero.visible = false
- end
- if $game_player.wref == true
- @sthero.refresh
- $game_player.wref = false
- end
- mog11_update
- end
- end
- ##############
- # Game_Party #
- ###############
- class Game_Party
- alias mog11_check_map_slip_damage check_map_slip_damage
- def check_map_slip_damage
- for actor in @actors
- if actor.hp > 0 and actor.slip_damage?
- $game_player.wref = true
- end
- end
- mog11_check_map_slip_damage
- end
- end
- ###############
- # Interpreter #
- ###############
- class Interpreter
- alias mog11_command_311 command_311
- def command_311
- mog11_command_311
- $game_player.wref = true
- end
- alias mog11_command_312 command_312
- def command_312
- mog11_command_312
- $game_player.wref = true
- end
- alias mog11_command_313 command_313
- def command_313
- mog11_command_313
- $game_player.wref = true
- end
- alias mog11_command_314 command_314
- def command_314
- mog11_command_314
- $game_player.wref = true
- end
- alias mog11_command_315 command_315
- def command_315
- mog11_command_315
- $game_player.wref = true
- end
- end
- ################
- # Game_Battler #
- ################
- class Game_Battler
- alias mog11_attack_effect attack_effect
- def attack_effect(attacker)
- mog11_attack_effect(attacker)
- $game_player.wref = true
- end
- alias mog11_skill_effect skill_effect
- def skill_effect(user, skill)
- mog11_skill_effect(user, skill)
- $game_player.wref = true
- end
- alias mog11_item_effect item_effect
- def item_effect(item)
- mog11_item_effect(item)
- $game_player.wref = true
- end
- alias mog11_add_state add_state
- def add_state(state_id, force = false)
- mog11_add_state(state_id, force = false)
- $game_player.wref = true
- end
- end
复制代码
你看看吧
战斗中显示坐标图和状态图这个脚本要调用 地图坐标脚本. 系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |
|