查看: 1374|回复: 3

[已经解决] 给这个地图显示血条脚本加个开关控制

[复制链接]
梦石
0
星屑
201
在线时间
835 小时
注册时间
2012-9-16
回帖
1598
发表于 2014-3-1 17:28:39 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
希望能够在只有开关XX打开时,这个地图上才会显示以下脚本的功能……@丿梁丶小柒 @Password @protosssonny
[pre lang="ruby" line="1"]#============================================================================
#  〇 地图显示血条魔条
#              By.冰舞蝶恋
#----------------------------------------------------------------------------
#     说明:显示的文字可自由更动来达到游戏需要的效果。
#----------------------------------------------------------------------------
#     以下是作者的白痴留言,尽管无视吧!
#     啊哈哈!这可是咱第一个独立完成的脚本吖!!
#     一时无聊做的……兴许可以用在ARPG之类的地方吧。偶然看到有不少人在拿RM做
#     ARPG,又发现似乎没有(除了邪恶的fux2字眼的那个- -||b),做了个比较完善
#     的……排版不是很好看,坐标可以自己调整。
#============================================================================
#==============================================================================
# ■ Scene_Map
#------------------------------------------------------------------------------
#  处理地图画面的类。
#==============================================================================

class Scene_Map < Scene_Base
  #--------------------------------------------------------------------------
  # ● 开始处理
  #--------------------------------------------------------------------------
  def start
    super
    $game_map.refresh
    @spriteset = Spriteset_Map.new
    @message_window = Window_Message.new
    @mapz_window = Window_MapZ.new(0, 0)
  end
  #--------------------------------------------------------------------------
  # ● 结束处理
  #--------------------------------------------------------------------------
  def terminate
    super
    @mapz_window.dispose
    if $scene.is_a?(Scene_Battle)     # 切换至战斗场景的场合
      @spriteset.dispose_characters   # 隐藏角色来生成战斗背景
    end
    snapshot_for_background
    @spriteset.dispose
    @message_window.dispose
    if $scene.is_a?(Scene_Battle)     # 切换至战斗场景的场合
      perform_battle_transition       # 执行战斗渐变
    end
  end
  #--------------------------------------------------------------------------
  # ● 基本更新处理
  #--------------------------------------------------------------------------
  def update_basic
    Graphics.update                   # 更新游戏画面
    Input.update                      # 更新输入信息
    $game_map.update                  # 更新地图
    @spriteset.update                 # 更新活动块组
  end
  #--------------------------------------------------------------------------
  # ● 更新画面
  #--------------------------------------------------------------------------
  def update
    super
    $game_map.interpreter.update      # 更新解释器
    $game_map.update                  # 更新地图
    $game_player.update               # 更新主角
    $game_system.update               # 更新计时器
    @mapz_window.update
    @spriteset.update                 # 更新活动块组
    @message_window.update            # 更新信息窗口
    unless $game_message.visible      # 信息窗口显示中除外
      update_transfer_player
      update_encounter
      update_call_menu
      update_call_debug
      update_scene_change
    end
  end
end
class Window_MapZ < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #--------------------------------------------------------------------------
  def initialize(x,y)
    super(-12, -12, 544+16,416+16)
    self.opacity = 0
    update
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def update
    self.contents.clear
#~     $game_map.screen.pictures[1].show("头像", 0, 0, 0, 100, 100, 255, 0)
    draw_actor_hp($game_actors[1], 80+12, 0, 160)
    draw_actor_mp($game_actors[1], 80+12, 32, 160)
    self.contents.font.color = normal_color
    self.contents.draw_text(84+12, 52+8, 544, WLH, "#{$game_actors[1].name}  Lv.#{$game_actors[1].level}")
    self.contents.font.color = system_color
    self.contents.draw_text(0+96+120+40, 0-4, 544, WLH, "攻:")
    self.contents.draw_text(0+96+120+40, 22-4, 544, WLH, "防:")
    self.contents.draw_text(0+96+120+40, 44-4, 544, WLH, "法:")
    self.contents.draw_text(0+96+120+40, 66-4, 544, WLH, "敏:")
    self.contents.draw_text(0+96+120+96+40, 0-4, 544, WLH, "所持金钱:")
    self.contents.draw_text(-18, 22-4, 544, WLH, "G", 2)
    self.contents.font.color = normal_color
    self.contents.draw_text(-456+96+120+40, 0-4, 544, WLH, $game_actors[1].atk, 2)
    self.contents.draw_text(-456+96+120+40, 22-4, 544, WLH, $game_actors[1].def, 2)
    self.contents.draw_text(-456+96+120+40, 44-4, 544, WLH, $game_actors[1].spi, 2)
    self.contents.draw_text(-456+96+120+40, 66-4, 544, WLH, $game_actors[1].cri, 2)
    self.contents.draw_text(-36, 22-4, 544, WLH, $game_party.gold, 2)   
  end
end[/pre]

——旧坑欢迎戳

狂気の月兔

梦石
0
星屑
421
在线时间
1245 小时
注册时间
2009-4-7
回帖
866

贵宾

发表于 2014-3-1 17:48:43 | 显示全部楼层
64行添加一句:
  1. @mapz_window.visible = $game_switches[ID]
复制代码
ID 自己改一个数字.

评分

参与人数 2星屑 +170 收起 理由
丿梁丶小柒 + 70 认可答案
yangjunyin2002 + 100 认可答案

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部