| 赞 | 153 |
| VIP | |
| 好人卡 | |
| 积分 | 93 |
| 经验 | |
| 最后登录 | 2024-5-6 |
| 在线时间 | 2504 小时 |
- 梦石
- 0
- 星屑
- 9292
- 在线时间
- 2504 小时
- 注册时间
- 2011-5-20
- 回帖
- 14521

|
发表于 2017-11-21 15:00:01
|
显示全部楼层
这样的话你队伍里的2个人都能显示出来了
但是有点问题
首先这里面加的新能力似乎只有领队有,即使2个人都显示出来,答对题以后也只有一个人会加经念
然后就是你不改显示内容和窗口大小的话会挡掉半个屏幕
- ###############################################################################
- #==============================================================================
- class Window_MapStatus < Window_Base
- #--------------------------------------------------------------------------
- def initialize#x0,y-132
- super(0, 0, 640, 128*$game_party.actors.size)
- self.contents = Bitmap.new(width - 32, height - 32)
- # 定义 升级标志 为 false
- $level_up_flags = false
- refresh
- end
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- # 定义角色,队伍 1 号
-
- =begin
- for i in 0...$game_party.actors.size
- x = 64
- y = i * 116
- actor = $game_party.actors[i]
- draw_actor_graphic(actor, x - 40, y + 80)
- draw_actor_name(actor, x, y)
- draw_actor_class(actor, x + 144, y)
- draw_actor_level(actor, x, y + 32)
- draw_actor_state(actor, x + 90, y + 32)
- draw_actor_exp(actor, x, y + 64)
- draw_actor_hp(actor, x + 236, y + 32)
- draw_actor_sp(actor, x + 236, y + 64)
- end
- =end
-
- for i in 0...$game_party.actors.size
- x = 4
- y = i*116#0
- actor = $game_party.actors[i]
- # 如果 升级 。(也就是上面那个升级标志为 true)
- if $level_up_flags
- # 定义显示头像的 bitmap 为 微笑头像
- bitmap = RPG::Cache.character(actor.name + "_fl", 0)
- # 显示升级图标图片
- self.contents.blt(x + 330, y, RPG::Cache.icon("level_up"), Rect.new(0, 0, 183, 36))
- # 其他情况(也就是升级标志为 false)
- else
- # 定义显示头像的 bitmap 为 一般头像
- bitmap = RPG::Cache.character(actor.name + "_f", 0)
- # 显示角色等级。
- draw_actor_level(actor, x + 364, y + 3)
- end
- # 显示上面所定义的头像。
- src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
- self.contents.blt(x - 4, y, bitmap, src_rect) #<-(括号里面可改头像坐标)
- # 描绘角色名
- draw_actor_name(actor, x + 144, y)
- # 描绘角色最大HP 和 最大 SP。
- self.contents.font.color = system_color
- txta = "最大" + $data_system.words.hp + ":"
- txtb = "最大" + $data_system.words.sp + ":"
- self.contents.draw_text(x + 144, y + 34, 96, 32, txta)
- self.contents.draw_text(x + 144, y + 58, 96, 32, txtb)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 246, y + 34, 48, 32, actor.maxhp.to_s)
- self.contents.draw_text(x + 246, y + 58, 48, 32, actor.maxsp.to_s)
- # 描绘角色当前经念 和 升级经念。
- self.contents.font.color = system_color
- self.contents.draw_text(x + 360, y + 38, 96, 32, "当前经念:")
- self.contents.draw_text(x + 360, y + 60, 144, 32, "升级所需经念:")
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 514, y + 38, 84, 32, actor.exp_s)
- self.contents.draw_text(x + 514, y + 60, 84, 32, actor.next_exp_s)
- end
- end
- end
- ###############################################################################
- #==============================================================================
- class Scene_Map
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- # 生成活动块
- @spriteset = Spriteset_Map.new
- # 生成信息窗口
- @message_window = Window_Message.new
- # 生成地图状态栏
- @mapstatus_window = Window_MapStatus.new ####################
- # 执行过渡
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果画面切换的话就中断循环
- if $scene != self
- break
- end
- end
- # 准备过渡
- Graphics.freeze
- # 释放活动块
- @spriteset.dispose
- # 释放信息窗口
- @message_window.dispose
- @mapstatus_window.dispose ########################
- if $scene.is_a?(Scene_Title)
- Graphics.transition
- Graphics.freeze
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- # 循环
- loop do
- #########################################################################
- # 状态窗口滑出
- if @mapstatus_window.y < 0 and $game_switches[1] == true
- for i in 1..10
- @mapstatus_window.y += 13
- Graphics.update
- end
- @mapstatus_window.y = 0
- end
- # 如果动态增加经念打开(也就是事件—>脚本:$game_raise_exp = true)
- if $game_raise_exp
- # 定义角色
- actor = $game_party_raise_exp[0]
- # 获取经念
- exp = $game_party_raise_exp[1]
- # 如果经念为负值,改为正数,其他情况不变,并代入 n
- if exp < 0
- # 经念减少 SE,可仿照修改
- Audio.se_play("Audio/SE/012-system12", 80, 100)
- n = -exp
- else
- # 经念增加 SE
- Audio.se_play("Audio/SE/109-heal05", 80, 100)
- n = exp
- end
- # 1 到 n 的循环
- for i in 1..n
- # 记录角色等级(旧的等级)
- last_level = actor.level
- # 如果角色经念小于 0
- if actor.exp < 0
- # 跳出循环
- break
- end
- # 如果经念小于 0 ,角色经念就递减 1 ,反之就递增 1 。
- if exp < 0
- actor.exp -= 1
- else
- actor.exp += 1
- # 如果角色等级(当前等级) 大于 旧的等级
- if actor.level > last_level
- # 打开升级标志
- $level_up_flags = true
- # 升级 SE
- Audio.se_play("Audio/SE/level_up", 80, 100)
- # 1 到 40 的循环
- for j in 1..40
- # 刷新地图状态窗口
- @mapstatus_window.refresh
- # 刷新游戏画面
- Graphics.update
- end
- # 关闭升级标志
- $level_up_flags = false
- end
- end
- # 刷新地图状态窗口
- @mapstatus_window.refresh
- # 刷新游戏画面
- Graphics.update
- end
- # 关闭动态增加经念。
- $game_raise_exp = false
- end
- # 状态窗口滑入
- =begin
- if @mapstatus_window.y == 0 and $game_switches[1] == false
- for i in 1..10
- @mapstatus_window.y -= 13
- Graphics.update
- end
- @mapstatus_window.y = -132
- end
- =end
- ##########################################################################
- # 按照地图、实例、主角的顺序刷新
- # (本更新顺序不会在满足事件的执行条件下成为给予角色瞬间移动
- # 的机会的重要因素)
- $game_map.update
- $game_system.map_interpreter.update
- $game_player.update
- # 系统 (计时器)、画面刷新
- $game_system.update
- $game_screen.update
- # 如果主角在场所移动中就中断循环
- unless $game_temp.player_transferring
- break
- end
- # 执行场所移动
- transfer_player
- # 处理过渡中的情况下、中断循环
- if $game_temp.transition_processing
- break
- end
- end
- # 刷新活动块
- @spriteset.update
- # 刷新信息窗口
- @message_window.update
- # 游戏结束的情况下
- if $game_temp.gameover
- # 切换的游戏结束画面
- $scene = Scene_Gameover.new
- return
- end
- # 返回标题画面的情况下
- if $game_temp.to_title
- # 切换到标题画面
- $scene = Scene_Title.new
- return
- end
- # 处理过渡中的情况下
- if $game_temp.transition_processing
- # 清除过渡处理中标志
- $game_temp.transition_processing = false
- # 执行过渡
- if $game_temp.transition_name == ""
- Graphics.transition(20)
- else
- Graphics.transition(40, "Graphics/Transitions/" +
- $game_temp.transition_name)
- end
- end
- # 显示信息窗口中的情况下
- if $game_temp.message_window_showing
- return
- end
- # 遇敌计数为 0 且、且遇敌列表不为空的情况下
- if $game_player.encounter_count == 0 and $game_map.encounter_list != []
- # 不是在事件执行中或者禁止遇敌中
- unless $game_system.map_interpreter.running? or
- $game_system.encounter_disabled
- # 确定队伍
- n = rand($game_map.encounter_list.size)
- troop_id = $game_map.encounter_list[n]
- # 队伍有效的话
- if $data_troops[troop_id] != nil
- # 设置调用战斗标志
- $game_temp.battle_calling = true
- $game_temp.battle_troop_id = troop_id
- $game_temp.battle_can_escape = true
- $game_temp.battle_can_lose = false
- $game_temp.battle_proc = nil
- end
- end
- end
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 不是在事件执行中或菜单禁止中
- unless $game_system.map_interpreter.running? or
- $game_system.menu_disabled
- # 设置菜单调用标志以及 SE 演奏
- $game_temp.menu_calling = true
- $game_temp.menu_beep = true
- end
- end
- # 调试模式为 ON 并且按下 F9 键的情况下
- if $DEBUG and Input.press?(Input::F9)
- # 设置调用调试标志
- $game_temp.debug_calling = true
- end
- # 不在主角移动中的情况下
- unless $game_player.moving?
- # 执行各种画面的调用
- if $game_temp.battle_calling
- call_battle
- elsif $game_temp.shop_calling
- call_shop
- elsif $game_temp.name_calling
- call_name
- elsif $game_temp.menu_calling
- call_menu
- elsif $game_temp.save_calling
- call_save
- elsif $game_temp.debug_calling
- call_debug
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 调用战斗
- #--------------------------------------------------------------------------
- def call_battle
- # 清除战斗调用标志
- $game_temp.battle_calling = false
- # 清除菜单调用标志
- $game_temp.menu_calling = false
- $game_temp.menu_beep = false
- # 生成遇敌计数
- $game_player.make_encounter_count
- # 记忆地图 BGM 、停止 BGM
- $game_temp.map_bgm = $game_system.playing_bgm
- $game_system.bgm_stop
- # 演奏战斗开始 SE
- $game_system.se_play($data_system.battle_start_se)
- # 演奏战斗 BGM
- $game_system.bgm_play($game_system.battle_bgm)
- # 矫正主角姿势
- $game_player.straighten
- # 切换到战斗画面
- $scene = Scene_Battle.new
- end
- #--------------------------------------------------------------------------
- # ● 调用商店
- #--------------------------------------------------------------------------
- def call_shop
- # 清除商店调用标志
- $game_temp.shop_calling = false
- # 矫正主角姿势
- $game_player.straighten
- # 切换到商店画面
- $scene = Scene_Shop.new
- end
- #--------------------------------------------------------------------------
- # ● 调用名称输入
- #--------------------------------------------------------------------------
- def call_name
- # 清除调用名称输入标志
- $game_temp.name_calling = false
- # 矫正主角姿势
- $game_player.straighten
- # 切换到名称输入画面
- $scene = Scene_Name.new
- end
- #--------------------------------------------------------------------------
- # ● 调用菜单
- #--------------------------------------------------------------------------
- def call_menu
- # 清除菜单调用标志
- $game_temp.menu_calling = false
- # 已经设置了菜单 SE 演奏标志的情况下
- if $game_temp.menu_beep
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 清除菜单演奏 SE 标志
- $game_temp.menu_beep = false
- end
- # 矫正主角姿势
- $game_player.straighten
- # 切换到菜单画面
- $scene = Scene_Menu.new
- end
- #--------------------------------------------------------------------------
- # ● 调用存档
- #--------------------------------------------------------------------------
- def call_save
- # 矫正主角姿势
- $game_player.straighten
- # 切换到存档画面
- $scene = Scene_Save.new
- end
- #--------------------------------------------------------------------------
- # ● 调用调试
- #--------------------------------------------------------------------------
- def call_debug
- # 清除调用调试标志
- $game_temp.debug_calling = false
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 矫正主角姿势
- $game_player.straighten
- # 切换到调试画面
- $scene = Scene_Debug.new
- end
- #--------------------------------------------------------------------------
- # ● 主角的场所移动
- #--------------------------------------------------------------------------
- def transfer_player
- # 清除主角场所移动调试标志
- $game_temp.player_transferring = false
- # 移动目标与现在的地图有差异的情况下
- if $game_map.map_id != $game_temp.player_new_map_id
- # 设置新地图
- $game_map.setup($game_temp.player_new_map_id)
- end
- # 设置主角位置
- $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
- # 设置主角朝向
- case $game_temp.player_new_direction
- when 2 # 下
- $game_player.turn_down
- when 4 # 左
- $game_player.turn_left
- when 6 # 右
- $game_player.turn_right
- when 8 # 上
- $game_player.turn_up
- end
- # 矫正主角姿势
- $game_player.straighten
- # 刷新地图 (执行并行事件)
- $game_map.update
- # 在生成活动块
- @spriteset.dispose
- @spriteset = Spriteset_Map.new
- # 处理过渡中的情况下
- if $game_temp.transition_processing
- # 清除过渡处理中标志
- $game_temp.transition_processing = false
- # 执行过渡
- Graphics.transition(20)
- end
- # 执行地图设置的 BGM、BGS 的自动切换
- $game_map.autoplay
- # 设置画面
- Graphics.frame_reset
- # 刷新输入信息
- Input.update
- end
- end
复制代码 |
评分
-
查看全部评分
|