设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 18746|回复: 35

[RMVX发布] 猜拳系统、钓鱼系统、符文系统、银行系统以及迷你地图

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-6-16
帖子
113
发表于 2008-9-9 05:20:33 | 显示全部楼层 |阅读模式

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

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

x
《流浪猎人》猜拳系统、钓鱼系统、符文系统、银行系统以及迷你地图
把《流浪猎人》的内置各比较有特色的系统单独放出来给大家共享使用。

简介:

猜拳系统--实现全部猜拳功能,附带下赌注、扣减手续费等功能。
该猜拳系统小游戏会在《流浪猎人》的后续版本中出现。
http://rpg.blue/upload_program/f ... ��统_101336853.rar
钓鱼系统--《流浪猎人》原有钓鱼系统直接搬来使用,比赛部分仍然没有更新放出(作者懒啊555~)
http://rpg.blue/upload_program/f ... ��统_101339909.rar
符文系统--取材于排行榜系统,把它很另类的用于单机游戏。
http://rpg.blue/upload_program/f ... ��统_101339733.rar
银行系统--在原6R发布的银行系统基础上,做了计算公式的核心改变以及选项显示方式。
http://rpg.blue/upload_program/f ... ��统_101336992.rar

现在从《流浪猎人》里分割出来后,各个系统可单独或组合使用。

迷你地图脚本浪使者汉化版。。该迷你地图已经在《流浪猎人》的后续版本中使用了。
(可能该迷你地图脚本已经被6R发布使用了,我只是发个汉化的版)

  1. #===============================================================
  2. # ● [VX] ◦迷你地图 ◦ □
  3. # * 无须图片的迷你地图脚本,浪使者倾情汉化 *
  4. #--------------------------------------------------------------
  5. # ◦ by Woratana [原作者]
  6. # ◦ 用于 RPG Maker VX  
  7. # ◦ 最近更新: 09/06/2008
  8. # ◦ 版本: 1.0 Beta
  9. #--------------------------------------------------------------
  10. # ◦ 特别感谢: KGC 的 XP 迷你地图脚本,
  11. # 没有他的迷你地图脚本,这个就不会被做出来.
  12. #--------------------------------------------------------------

  13. module MiniMap
  14.   #===========================================================================
  15.   # [START]迷你地图脚本设置部分 地图名前+[NOMAP] 不显示
  16.   #---------------------------------------------------------------------------
  17.   SWITCH_NO_MINIMAP = 10 #  打开这个开关的话就不显示迷你地图
  18.    
  19.   MAP_RECT = [410, 20, 100, 100] # 迷你地图的大小和位置
  20.   # [X, Y, Width, Height]
  21.   # 你可以用调用脚本的方法任意改变他:
  22.   # $game_system.minimap = [X, Y, Width, Height]

  23.   MAP_Z = 0 # 迷你地图的Z轴
  24.   # 增加这个数值,如果迷你地图显示在某些物体下面的话(被覆盖)。

  25.   GRID_SIZE = 5 # 引导大小,建议数值大于3.
  26.   
  27.   MINIMAP_BORDER_COLOR = Color.new(0, 0, 255, 160) # 色彩设定
  28.   # Color.new(Red, Green, Blue, Opacity)
  29.   MINIMAP_BORDER_SIZE = 2
  30.   
  31.   FOREGROUND_COLOR = Color.new(224, 224, 255, 160) # 可通过物颜色
  32.   BACKGROUND_COLOR = Color.new(0, 0, 0, 160) # 不可通过物颜色

  33.   USE_OUTLINE_PLAYER = true # 是否描绘的角色?
  34.   PLAYER_OUTLINE_COLOR = Color.new(0, 0, 0, 192) # 角色颜色
  35.   USE_OUTLINE_EVENT = true # 是否描绘特殊事件?(如商人、敌人NPC等)
  36.   EVENT_OUTLINE_COLOR = Color.new(255, 255, 255, 192) # 特殊事件颜色
  37.   
  38.   PLAYER_COLOR = Color.new(255, 0, 0, 192) # 角色颜色设定
  39.   #---------------------------------------------------------------------------

  40.   OBJECT_COLOR = {} # 不要改变或删除这一行!
  41.   #===============================================================
  42.   # * 设置关键字和颜色
  43.   #---------------------------------------------------------------
  44.   # ** 例如:
  45.   # OBJECT_COLOR['keyword'] = Color.new(Red, Green, Blue, Opacity)
  46.   #-------------------------------------------------------------
  47.   # * 'keyword': 你想放到公共事件里来显示的颜色
  48.   # ** 标记: 'keyword' 是很关键的!
  49.   # * Color.new(...): 你需要的颜色
  50.   # 你可输入 0 - 255 的可选色彩范围 (Red, Green, Blue, Opacity)
  51.   #-------------------------------------------------------------
  52.   OBJECT_COLOR['npc'] = Color.new(30,144,255,160)
  53.   OBJECT_COLOR['treasure'] = Color.new(0,255,255,160)
  54.   OBJECT_COLOR['enemy'] = Color.new(139,35,35,160)
  55.   OBJECT_COLOR['merchant'] = Color.new(255,255,0,160)
  56.   
  57.   #===========================================================================
  58.   # * [说明] 标签:
  59.   #---------------------------------------------------------------------------
  60.   # 改变这些关闭迷你地图 & 或设置显示迷你地图~
  61.   #-----------------------------------------------------------------------
  62.   TAG_NO_MINIMAP = '[NOMAP]'
  63.   TAG_EVENT = 'MMEV'
  64.   #---------------------------------------------------------------------------

  65.   #---------------------------------------------------------------------------
  66.   # [END] 迷你地图脚本设置部分
  67.   #===========================================================================
  68.   
  69.   def self.refresh
  70.     if $scene.is_a?(Scene_Map)
  71.       $scene.spriteset.minimap.refresh
  72.     end
  73.   end
  74.   
  75.   def self.update_object
  76.     if $scene.is_a?(Scene_Map)
  77.       $scene.spriteset.minimap.update_object_list
  78.     end
  79.   end
  80. end

  81. #==============================================================================
  82. # ■ RPG::MapInfo
  83. #==============================================================================
  84. class RPG::MapInfo
  85.   def name
  86.     return @name.gsub(/\[.*\]/) { }
  87.   end

  88.   def original_name
  89.     return @name
  90.   end

  91.   def show_minimap?
  92.     return [email protected]?(MiniMap::TAG_NO_MINIMAP)
  93.   end
  94. end
  95. #==============================================================================
  96. # ■ Game_System
  97. #==============================================================================
  98. class Game_System
  99.   attr_accessor :minimap
  100.   alias wora_minimap_gamsys_ini initialize
  101.   
  102.   def initialize
  103.     wora_minimap_gamsys_ini
  104.     @minimap = MiniMap::MAP_RECT
  105.   end
  106.   
  107.   def show_minimap
  108.     return !$game_switches[MiniMap::SWITCH_NO_MINIMAP]
  109.   end
  110. end
  111. #==============================================================================
  112. # ■ Game_Map
  113. #==============================================================================
  114. class Game_Map
  115.   alias wora_minimap_gammap_setup setup
  116.   def setup(map_id)
  117.     wora_minimap_gammap_setup(map_id)
  118.     @db_info = load_data('Data/MapInfos.rvdata') if @db_info.nil?
  119.     @map_info = @db_info[map_id]
  120.   end
  121.   
  122.   def show_minimap?
  123.     return @map_info.show_minimap?
  124.   end
  125. end
  126. #==============================================================================
  127. # ■ Game_Event
  128. #==============================================================================
  129. class Game_Event < Game_Character
  130.   def mm_comment?(comment, return_comment = false )
  131.     if [email protected]?
  132.       for i in [email protected] - 1
  133.         next if @list[i].code != 108
  134.         if @list[i].parameters[0].include?(comment)
  135.           return @list[i].parameters[0] if return_comment
  136.           return true
  137.         end
  138.       end
  139.     end
  140.     return '' if return_comment
  141.     return false
  142.   end
  143. end
  144. #==============================================================================
  145. # ■ Game_MiniMap
  146. #------------------------------------------------------------------------------
  147. class Game_MiniMap
  148.   def initialize(tilemap)
  149.     @tilemap = tilemap
  150.     refresh
  151.   end

  152.   def dispose
  153.     @border.bitmap.dispose
  154.     @border.dispose
  155.     @map_sprite.bitmap.dispose
  156.     @map_sprite.dispose
  157.     @object_sprite.bitmap.dispose
  158.     @object_sprite.dispose
  159.     @position_sprite.bitmap.dispose
  160.     @position_sprite.dispose
  161.   end

  162.   def visible
  163.     return @map_sprite.visible
  164.   end

  165.   def visible=(value)
  166.     @map_sprite.visible = value
  167.     @object_sprite.visible = value
  168.     @position_sprite.visible = value
  169.     @border.visible = value
  170.   end

  171.   def refresh
  172.     @mmr = $game_system.minimap
  173.     map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
  174.     grid_size = [MiniMap::GRID_SIZE, 1].max

  175.     @x = 0
  176.     @y = 0
  177.     @size = [map_rect.width / grid_size, map_rect.height / grid_size]

  178.     @border = Sprite.new
  179.     @border.x = map_rect.x - MiniMap::MINIMAP_BORDER_SIZE
  180.     @border.y = map_rect.y - MiniMap::MINIMAP_BORDER_SIZE
  181.     b_width = map_rect.width + (MiniMap::MINIMAP_BORDER_SIZE * 2)
  182.     b_height = map_rect.height + (MiniMap::MINIMAP_BORDER_SIZE * 2)
  183.     @border.bitmap = Bitmap.new(b_width, b_height)
  184.     @border.bitmap.fill_rect(@border.bitmap.rect, MiniMap::MINIMAP_BORDER_COLOR)
  185.     @border.bitmap.clear_rect(MiniMap::MINIMAP_BORDER_SIZE, MiniMap::MINIMAP_BORDER_SIZE,
  186.     @border.bitmap.width - (MiniMap::MINIMAP_BORDER_SIZE * 2),
  187.     @border.bitmap.height - (MiniMap::MINIMAP_BORDER_SIZE * 2))
  188.    
  189.     @map_sprite = Sprite.new
  190.     @map_sprite.x = map_rect.x
  191.     @map_sprite.y = map_rect.y
  192.     @map_sprite.z = MiniMap::MAP_Z
  193.     bitmap_width = $game_map.width * grid_size + map_rect.width
  194.     bitmap_height = $game_map.height * grid_size + map_rect.height
  195.     @map_sprite.bitmap = Bitmap.new(bitmap_width, bitmap_height)
  196.     @map_sprite.src_rect = map_rect

  197.     @object_sprite = Sprite.new
  198.     @object_sprite.x = map_rect.x
  199.     @object_sprite.y = map_rect.y
  200.     @object_sprite.z = MiniMap::MAP_Z + 1
  201.     @object_sprite.bitmap = Bitmap.new(bitmap_width, bitmap_height)
  202.     @object_sprite.src_rect = map_rect

  203.     @position_sprite = Sprite_Base.new
  204.     @position_sprite.x = map_rect.x + @size[0] / 2 * grid_size
  205.     @position_sprite.y = map_rect.y + @size[1] / 2 * grid_size
  206.     @position_sprite.z = MiniMap::MAP_Z + 2
  207.    
  208.     bitmap = Bitmap.new(grid_size, grid_size)
  209.     # Player's Outline
  210.     if MiniMap::USE_OUTLINE_PLAYER and MiniMap::GRID_SIZE >= 3
  211.       bitmap.fill_rect(bitmap.rect, MiniMap::PLAYER_OUTLINE_COLOR)
  212.       brect = Rect.new(bitmap.rect.x + 1, bitmap.rect.y + 1, bitmap.rect.width - 2,
  213.         bitmap.rect.height - 2)
  214.       bitmap.clear_rect(brect)
  215.     else
  216.       brect = bitmap.rect
  217.     end
  218.    
  219.     bitmap.fill_rect(brect, MiniMap::PLAYER_COLOR)
  220.     @position_sprite.bitmap = bitmap

  221.     draw_map
  222.     update_object_list
  223.     draw_object
  224.     update_position
  225.   end

  226.   def draw_map
  227.     bitmap = @map_sprite.bitmap
  228.     bitmap.fill_rect(bitmap.rect, MiniMap::BACKGROUND_COLOR)
  229.     map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
  230.     grid_size = [MiniMap::GRID_SIZE, 1].max
  231.    
  232.     $game_map.width.times do |i|
  233.       $game_map.height.times do |j|
  234.         if !$game_map.passable?(i, j)
  235.           next
  236.         end
  237.         rect = Rect.new(map_rect.width / 2 + grid_size * i,
  238.           map_rect.height / 2 + grid_size * j,
  239.           grid_size, grid_size)
  240.         if grid_size >= 3
  241.           if !$game_map.passable?(i, j)
  242.             rect.height -= 1
  243.             rect.x += 1
  244.             rect.width -= 1
  245.             rect.width -= 1
  246.             rect.y += 1
  247.             rect.height -= 1
  248.           end
  249.         end
  250.         bitmap.fill_rect(rect, MiniMap::FOREGROUND_COLOR)
  251.       end
  252.     end
  253.   end

  254.   def update_object_list
  255.     @object_list = {}
  256.     $game_map.events.values.each do |e|
  257.       comment = e.mm_comment?(MiniMap::TAG_EVENT, true)
  258.       if comment != ''
  259.         type = comment.gsub(/#{MiniMap::TAG_EVENT}/){}.gsub(/\s+/){}
  260.         @object_list[type] = [] if @object_list[type].nil?
  261.         @object_list[type] << e
  262.       end
  263.     end
  264.   end

  265.   def draw_object
  266.     bitmap = @object_sprite.bitmap
  267.     bitmap.clear
  268.     map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
  269.     grid_size = [MiniMap::GRID_SIZE, 1].max
  270.     rect = Rect.new(0, 0, grid_size, grid_size)
  271.     mw = map_rect.width / 2
  272.     mh = map_rect.height / 2

  273.     @object_list.each do |key, events|
  274.       color = MiniMap::OBJECT_COLOR[key]
  275.       next if events.nil? or color.nil?
  276.       events.each do |obj|
  277.         if !obj.character_name.empty?
  278.           rect.x = mw + obj.real_x * grid_size / 256
  279.           rect.y = mh + obj.real_y * grid_size / 256
  280.           # Event's Outline
  281.           if MiniMap::USE_OUTLINE_EVENT and MiniMap::GRID_SIZE >= 3
  282.             bitmap.fill_rect(rect, MiniMap::EVENT_OUTLINE_COLOR)
  283.             brect = Rect.new(rect.x + 1, rect.y + 1, rect.width - 2,
  284.             rect.height - 2)
  285.             bitmap.clear_rect(brect)
  286.           else
  287.             brect = bitmap.rect
  288.           end
  289.           bitmap.fill_rect(brect, color)
  290.         end
  291.       end
  292.     end
  293.   end

  294.   def update
  295.     if @mmr != $game_system.minimap
  296.       dispose
  297.       refresh
  298.     end
  299.     draw_object
  300.     update_position
  301.     if @map_sprite.visible
  302.       @map_sprite.update
  303.       @object_sprite.update
  304.       @position_sprite.update
  305.     end
  306.   end

  307.   def update_position
  308.     map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
  309.     grid_size = [MiniMap::GRID_SIZE, 1].max
  310.     sx = $game_player.real_x * grid_size / 256
  311.     sy = $game_player.real_y * grid_size / 256
  312.     @map_sprite.src_rect.x = sx
  313.     @map_sprite.src_rect.y = sy
  314.     @object_sprite.src_rect.x = sx
  315.     @object_sprite.src_rect.y = sy
  316.   end
  317. end
  318. #==============================================================================
  319. # ■ Spriteset_Map
  320. #------------------------------------------------------------------------------
  321. class Spriteset_Map
  322.   attr_reader :minimap
  323.   alias wora_minimap_sprsetmap_ini initialize
  324.   alias wora_minimap_sprsetmap_dis dispose
  325.   alias wora_minimap_sprsetmap_upd update
  326.   
  327.   def initialize
  328.     wora_minimap_sprsetmap_ini
  329.     if $game_map.show_minimap?
  330.       @minimap = Game_MiniMap.new(@tilemap)
  331.       $game_system.show_minimap = true if $game_system.show_minimap.nil?
  332.       @minimap.visible = $game_system.show_minimap
  333.     end
  334.   end
  335.   
  336.   def dispose
  337.     @minimap.dispose if [email protected]?
  338.     wora_minimap_sprsetmap_dis
  339.   end

  340.   def update
  341.     if [email protected]?
  342.       if $game_system.show_minimap
  343.         @minimap.visible = true
  344.         @minimap.update
  345.       else
  346.         @minimap.visible = false
  347.       end
  348.     end
  349.     wora_minimap_sprsetmap_upd
  350.   end
  351. end
  352. #==============================================================================
  353. # ■ Scene_Map
  354. #------------------------------------------------------------------------------
  355. class Scene_Map < Scene_Base
  356.   attr_reader :spriteset
  357. end
复制代码
补充:迷你地图标识显示

标记:MMEV merchant     (标识商人)
标记:MMEV npc          (标识一般的NPC)
标记:MMEV enemy        (标识敌人)

在人物事件的第一行插入以上的分类标识就ok了。。

精灵更新的地图脚本:

  1. #===============================================================
  2. # ● [VX] ◦迷你地图 ◦ □
  3. # * 无须图片的迷你地图脚本,浪使者倾情汉化 *
  4. #--------------------------------------------------------------
  5. # ◦ by Woratana [原作者]
  6. # ◦ 用于 RPG Maker VX  
  7. # ◦ 最近更新: 09/09/2008
  8. # ◦ 版本: 1.1 Beta
  9. #--------------------------------------------------------------
  10. # ◦ 特别感谢: KGC 的 XP 迷你地图脚本,
  11. # 没有他的迷你地图脚本,这个就不会被做出来.
  12. # 精灵使者更新:请在注释的第一行写入关键字,关键字可以在下面添加。
  13. #--------------------------------------------------------------

  14. module MiniMap
  15.   #===========================================================================
  16.   # [START]迷你地图脚本设置部分 地图名前+[NOMAP] 不显示
  17.   #---------------------------------------------------------------------------
  18.   SWITCH_NO_MINIMAP = 10 #  打开这个开关的话就不显示迷你地图
  19.    
  20.   MAP_RECT = [410, 20, 100, 100] # 迷你地图的大小和位置
  21.   # [X, Y, Width, Height]
  22.   # 你可以用调用脚本的方法任意改变他:
  23.   # $game_system.minimap = [X, Y, Width, Height]

  24.   MAP_Z = 0 # 迷你地图的Z轴
  25.   # 增加这个数值,如果迷你地图显示在某些物体下面的话(被覆盖)。

  26.   GRID_SIZE = 8 # 引导大小,建议数值大于3.
  27.   
  28.   MINIMAP_BORDER_COLOR = Color.new(0, 0, 255, 160) # 色彩设定
  29.   # Color.new(Red, Green, Blue, Opacity)
  30.   MINIMAP_BORDER_SIZE = 2
  31.   
  32.   FOREGROUND_COLOR = Color.new(224, 224, 255, 160) # 可通过物颜色
  33.   BACKGROUND_COLOR = Color.new(0, 0, 0, 160) # 不可通过物颜色

  34.   USE_OUTLINE_PLAYER = true # 是否描绘的角色?
  35.   PLAYER_OUTLINE_COLOR = Color.new(0, 0, 0, 192) # 角色颜色
  36.   USE_OUTLINE_EVENT = true # 是否描绘特殊事件?(如商人、敌人NPC等)
  37.   EVENT_OUTLINE_COLOR = Color.new(255, 255, 255, 192) # 特殊事件颜色
  38.   
  39.   PLAYER_COLOR = Color.new(255, 0, 0, 192) # 角色颜色设定
  40.   #---------------------------------------------------------------------------

  41.   OBJECT_COLOR = {} # 不要改变或删除这一行!
  42.   #===============================================================
  43.   # * 设置关键字和颜色
  44.   #---------------------------------------------------------------
  45.   # ** 例如:
  46.   # OBJECT_COLOR['keyword'] = Color.new(Red, Green, Blue, Opacity)
  47.   #-------------------------------------------------------------
  48.   # * 'keyword': 你想放到公共事件里来显示的颜色
  49.   # ** 标记: 'keyword' 是很关键的!
  50.   # * Color.new(...): 你需要的颜色
  51.   # 你可输入 0 - 255 的可选色彩范围 (Red, Green, Blue, Opacity)
  52.   #-------------------------------------------------------------
  53.   OBJECT_COLOR['npc'] = Color.new(30,144,255,160)
  54.   OBJECT_COLOR['treasure'] = Color.new(0,255,255,160)
  55.   OBJECT_COLOR['enemy'] = Color.new(139,35,35,160)
  56.   OBJECT_COLOR['merchant'] = Color.new(255,255,0,160)
  57.   OBJECT_COLOR['teleport'] = Color.new(255,128,0,160)
  58.   OBJECT_COLOR['door'] = Color.new(0,255,128,160)
  59.   
  60.   
  61.   #===========================================================================
  62.   # * [说明] 标签:
  63.   #---------------------------------------------------------------------------
  64.   # 改变这些关闭迷你地图 & 或设置显示迷你地图~
  65.   # TAG_EVENT的关键字和OBJECT_COLOR关键字要对应。
  66.   #-----------------------------------------------------------------------
  67.   TAG_NO_MINIMAP = '[NOMAP]'
  68.   TAG_EVENT = ["npc","enemy","treasure","merchant","teleport","door"]
  69.   #---------------------------------------------------------------------------

  70.   #---------------------------------------------------------------------------
  71.   # [END] 迷你地图脚本设置部分
  72.   #===========================================================================
  73.   
  74.   def self.refresh
  75.     if $scene.is_a?(Scene_Map)
  76.       $scene.spriteset.minimap.refresh
  77.     end
  78.   end
  79.   
  80.   def self.update_object
  81.     if $scene.is_a?(Scene_Map)
  82.       $scene.spriteset.minimap.update_object_list
  83.     end
  84.   end
  85. end

  86. #==============================================================================
  87. # ■ RPG::MapInfo
  88. #==============================================================================
  89. class RPG::MapInfo
  90.   def name
  91.     return @name.gsub(/\[.*\]/) { }
  92.   end

  93.   def original_name
  94.     return @name
  95.   end

  96.   def show_minimap?
  97.     return [email protected]?(MiniMap::TAG_NO_MINIMAP)
  98.   end
  99. end
  100. #==============================================================================
  101. # ■ Game_System
  102. #==============================================================================
  103. class Game_System
  104.   attr_accessor :minimap
  105.   alias wora_minimap_gamsys_ini initialize
  106.   
  107.   def initialize
  108.     wora_minimap_gamsys_ini
  109.     @minimap = MiniMap::MAP_RECT
  110.   end
  111.   
  112.   def show_minimap
  113.     return !$game_switches[MiniMap::SWITCH_NO_MINIMAP]
  114.   end
  115. end
  116. #==============================================================================
  117. # ■ Game_Map
  118. #==============================================================================
  119. class Game_Map
  120.   alias wora_minimap_gammap_setup setup
  121.   def setup(map_id)
  122.     wora_minimap_gammap_setup(map_id)
  123.     @db_info = load_data('Data/MapInfos.rvdata') if @db_info.nil?
  124.     @map_info = @db_info[map_id]
  125.   end
  126.   
  127.   def show_minimap?
  128.     return @map_info.show_minimap?
  129.   end
  130. end
  131. #==============================================================================
  132. # ■ Game_Event
  133. #==============================================================================
  134. class Game_Event < Game_Character
  135.   def mm_comment?(comment, return_comment = false )
  136.     if [email protected]?
  137.       for i in [email protected] - 1
  138.         next if @list[i].code != 108
  139.         if comment.include?(@list[i].parameters[0])
  140.           return @list[i].parameters[0] if return_comment
  141.           return true
  142.         end
  143.       end
  144.     end
  145.     return '' if return_comment
  146.     return false
  147.   end
  148. end

  149. #==============================================================================
  150. # ■ Game_MiniMap
  151. #------------------------------------------------------------------------------
  152. class Game_MiniMap
  153.   def initialize(tilemap)
  154.     @tilemap = tilemap
  155.     refresh
  156.   end

  157.   def dispose
  158.     @border.bitmap.dispose
  159.     @border.dispose
  160.     @map_sprite.bitmap.dispose
  161.     @map_sprite.dispose
  162.     @object_sprite.bitmap.dispose
  163.     @object_sprite.dispose
  164.     @position_sprite.bitmap.dispose
  165.     @position_sprite.dispose
  166.   end

  167.   def visible
  168.     return @map_sprite.visible
  169.   end

  170.   def visible=(value)
  171.     @map_sprite.visible = value
  172.     @object_sprite.visible = value
  173.     @position_sprite.visible = value
  174.     @border.visible = value
  175.   end

  176.   def refresh
  177.     @mmr = $game_system.minimap
  178.     map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
  179.     grid_size = [MiniMap::GRID_SIZE, 1].max

  180.     @x = 0
  181.     @y = 0
  182.     @size = [map_rect.width / grid_size, map_rect.height / grid_size]

  183.     @border = Sprite.new
  184.     @border.x = map_rect.x - MiniMap::MINIMAP_BORDER_SIZE
  185.     @border.y = map_rect.y - MiniMap::MINIMAP_BORDER_SIZE
  186.     b_width = map_rect.width + (MiniMap::MINIMAP_BORDER_SIZE * 2)
  187.     b_height = map_rect.height + (MiniMap::MINIMAP_BORDER_SIZE * 2)
  188.     @border.bitmap = Bitmap.new(b_width, b_height)
  189.     @border.bitmap.fill_rect(@border.bitmap.rect, MiniMap::MINIMAP_BORDER_COLOR)
  190.     @border.bitmap.clear_rect(MiniMap::MINIMAP_BORDER_SIZE, MiniMap::MINIMAP_BORDER_SIZE,
  191.     @border.bitmap.width - (MiniMap::MINIMAP_BORDER_SIZE * 2),
  192.     @border.bitmap.height - (MiniMap::MINIMAP_BORDER_SIZE * 2))
  193.    
  194.     @map_sprite = Sprite.new
  195.     @map_sprite.x = map_rect.x
  196.     @map_sprite.y = map_rect.y
  197.     @map_sprite.z = MiniMap::MAP_Z
  198.     bitmap_width = $game_map.width * grid_size + map_rect.width
  199.     bitmap_height = $game_map.height * grid_size + map_rect.height
  200.     @map_sprite.bitmap = Bitmap.new(bitmap_width, bitmap_height)
  201.     @map_sprite.src_rect = map_rect

  202.     @object_sprite = Sprite.new
  203.     @object_sprite.x = map_rect.x
  204.     @object_sprite.y = map_rect.y
  205.     @object_sprite.z = MiniMap::MAP_Z + 1
  206.     @object_sprite.bitmap = Bitmap.new(bitmap_width, bitmap_height)
  207.     @object_sprite.src_rect = map_rect

  208.     @position_sprite = Sprite_Base.new
  209.     @position_sprite.x = map_rect.x + @size[0] / 2 * grid_size
  210.     @position_sprite.y = map_rect.y + @size[1] / 2 * grid_size
  211.     @position_sprite.z = MiniMap::MAP_Z + 2
  212.    
  213.     bitmap = Bitmap.new(grid_size, grid_size)
  214.     # Player's Outline
  215.     if MiniMap::USE_OUTLINE_PLAYER and MiniMap::GRID_SIZE >= 3
  216.       bitmap.fill_rect(bitmap.rect, MiniMap::PLAYER_OUTLINE_COLOR)
  217.       brect = Rect.new(bitmap.rect.x + 1, bitmap.rect.y + 1, bitmap.rect.width - 2,
  218.         bitmap.rect.height - 2)
  219.       bitmap.clear_rect(brect)
  220.     else
  221.       brect = bitmap.rect
  222.     end
  223.    
  224.     bitmap.fill_rect(brect, MiniMap::PLAYER_COLOR)
  225.     @position_sprite.bitmap = bitmap

  226.     draw_map
  227.     update_object_list
  228.     draw_object
  229.     update_position
  230.   end

  231.   def draw_map
  232.     bitmap = @map_sprite.bitmap
  233.     bitmap.fill_rect(bitmap.rect, MiniMap::BACKGROUND_COLOR)
  234.     map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
  235.     grid_size = [MiniMap::GRID_SIZE, 1].max
  236.    
  237.     $game_map.width.times do |i|
  238.       $game_map.height.times do |j|
  239.         if !$game_map.passable?(i, j)
  240.           next
  241.         end
  242.         rect = Rect.new(map_rect.width / 2 + grid_size * i,
  243.           map_rect.height / 2 + grid_size * j,
  244.           grid_size, grid_size)
  245.         if grid_size >= 3
  246.           if !$game_map.passable?(i, j)
  247.             rect.height -= 1
  248.             rect.x += 1
  249.             rect.width -= 1
  250.             rect.width -= 1
  251.             rect.y += 1
  252.             rect.height -= 1
  253.           end
  254.         end
  255.         bitmap.fill_rect(rect, MiniMap::FOREGROUND_COLOR)
  256.       end
  257.     end
  258.   end

  259.     def update_object_list
  260.     @object_list = {}
  261.     $game_map.events.values.each do |e|
  262.       comment = e.mm_comment?(MiniMap::TAG_EVENT, true)
  263.       if comment != ''
  264.         #type = comment.gsub(/#{MiniMap::TAG_EVENT}/){}.gsub(/\s+/){}
  265.         type = comment
  266.         @object_list[type] = [] if @object_list[type].nil?
  267.         @object_list[type] << e
  268.       end
  269.     end
  270.   end

  271.   def draw_object
  272.     bitmap = @object_sprite.bitmap
  273.     bitmap.clear
  274.     map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
  275.     grid_size = [MiniMap::GRID_SIZE, 1].max
  276.     rect = Rect.new(0, 0, grid_size, grid_size)
  277.     mw = map_rect.width / 2
  278.     mh = map_rect.height / 2

  279.     @object_list.each do |key, events|
  280.       color = MiniMap::OBJECT_COLOR[key]
  281.       next if events.nil? or color.nil?
  282.       events.each do |obj|
  283.         #if !obj.character_name.empty?
  284.           rect.x = mw + obj.real_x * grid_size / 256
  285.           rect.y = mh + obj.real_y * grid_size / 256
  286.           # Event's Outline
  287.           if MiniMap::USE_OUTLINE_EVENT and MiniMap::GRID_SIZE >= 3
  288.             bitmap.fill_rect(rect, MiniMap::EVENT_OUTLINE_COLOR)
  289.             brect = Rect.new(rect.x + 1, rect.y + 1, rect.width - 2,
  290.             rect.height - 2)
  291.             bitmap.clear_rect(brect)
  292.           else
  293.             brect = bitmap.rect
  294.           end
  295.           bitmap.fill_rect(brect, color)
  296.         #end
  297.       end
  298.     end
  299.   end

  300.   def update
  301.     if @mmr != $game_system.minimap
  302.       dispose
  303.       refresh
  304.     end
  305.     update_object_list
  306.     draw_object
  307.     update_position
  308.     if @map_sprite.visible
  309.       @map_sprite.update
  310.       @object_sprite.update
  311.       @position_sprite.update
  312.     end
  313.   end

  314.   def update_position
  315.     map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
  316.     grid_size = [MiniMap::GRID_SIZE, 1].max
  317.     sx = $game_player.real_x * grid_size / 256
  318.     sy = $game_player.real_y * grid_size / 256
  319.     @map_sprite.src_rect.x = sx
  320.     @map_sprite.src_rect.y = sy
  321.     @object_sprite.src_rect.x = sx
  322.     @object_sprite.src_rect.y = sy
  323.   end
  324. end
  325. #==============================================================================
  326. # ■ Spriteset_Map
  327. #------------------------------------------------------------------------------
  328. class Spriteset_Map
  329.   attr_reader :minimap
  330.   alias wora_minimap_sprsetmap_ini initialize
  331.   alias wora_minimap_sprsetmap_dis dispose
  332.   alias wora_minimap_sprsetmap_upd update
  333.   
  334.   def initialize
  335.     wora_minimap_sprsetmap_ini
  336.     if $game_map.show_minimap?
  337.       @minimap = Game_MiniMap.new(@tilemap)
  338.       $game_system.show_minimap = true if $game_system.show_minimap.nil?
  339.       @minimap.visible = $game_system.show_minimap
  340.     end
  341.   end
  342.   
  343.   def dispose
  344.     @minimap.dispose if [email protected]?
  345.     wora_minimap_sprsetmap_dis
  346.   end

  347.   def update
  348.     if [email protected]?
  349.       if $game_system.show_minimap
  350.         @minimap.visible = true
  351.         @minimap.update_object_list
  352.         @minimap.update
  353.       else
  354.         @minimap.visible = false
  355.       end
  356.     end
  357.     wora_minimap_sprsetmap_upd
  358.   end
  359. end
  360. #==============================================================================
  361. # ■ Scene_Map
  362. #------------------------------------------------------------------------------
  363. class Scene_Map < Scene_Base
  364.   attr_reader :spriteset
  365. end
复制代码
更新:
稍微扩大了地图的大小。
更新了:可以用非行走图的图块显示事件(例如传送等)
新添关键字teleport(传送点) 和door(门)
再度更新:
修正了VX事件更新(例如人物消失)以后小地图没有及时刷新的问题。
用法只要在需要显示的事件页里的第一行加注释,填写关键字就可以了。
流浪猎人 最新进展: 人物设定:11% 场景界面:3% 剧情构思:11% 物品装备技能:21% 怪物设定:15% 下载地址: http://www.tq27.cn/game/流浪猎人0251.exe 发布游戏:0.251版本

Lv1.梦旅人

梦石
0
星屑
50
在线时间
4 小时
注册时间
2008-9-4
帖子
32
发表于 2008-9-9 06:59:24 | 显示全部楼层
是事件的?是的就无视…
小柯的手机马甲…… = = 邪恶的形象。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
4 小时
注册时间
2008-9-4
帖子
32
发表于 2008-9-9 07:03:13 | 显示全部楼层
是事件的?是的就无视…
小柯的手机马甲…… = = 邪恶的形象。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

风雪夜不归人

梦石
0
星屑
50
在线时间
276 小时
注册时间
2006-3-7
帖子
6721

贵宾

发表于 2008-9-9 07:14:30 | 显示全部楼层
即便是事件的也有参考价值嘛
有些人,到了七八月份就会诈尸。
宫斗,是女生永远的爱。
冷门,是本人不变的欲。
作弊,是玩家自由的痛。
练级,是橙光割舍的情。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
15 小时
注册时间
2008-9-5
帖子
55
发表于 2008-9-9 09:26:24 | 显示全部楼层
顶··我支持你LZ!
希望再接再厉
回复 支持 反对

使用道具 举报

Lv1.梦旅人

欠扁头像持有者

梦石
0
星屑
114
在线时间
16 小时
注册时间
2005-10-22
帖子
423
发表于 2009-6-12 08:00:00 | 显示全部楼层
迷你地图中的那个描绘特殊事件好象不能用吧~
USE_OUTLINE_EVENT = true这样没错吧~可是不能显示哟~
水兵土星--死亡之星!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
4 小时
注册时间
2008-9-4
帖子
32
发表于 2008-9-10 02:08:13 | 显示全部楼层
因为比较火星,而且比较简单,才54= =
小柯的手机马甲…… = = 邪恶的形象。
回复 支持 反对

使用道具 举报

Lv4.逐梦者

醉啸 长风万里

梦石
0
星屑
6047
在线时间
6586 小时
注册时间
2007-12-16
帖子
4501

贵宾

发表于 2008-9-10 03:53:27 | 显示全部楼层
不错
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
41 小时
注册时间
2008-3-5
帖子
2072
发表于 2008-9-10 21:03:55 | 显示全部楼层
太牛B了 ,支持一個{/hx}
你它囧一字母君谁记得……
当时那把剑离我的喉咙只有0.01工分。可是一柱香之后,这个女主人会深深的爱上我,虽然本人平生说了无数的谎话,可是这句最有效:“你应该这么做,我也应该死。
曾经有一取ID的机会放在我面前,我没有珍惜,等我失去的时候我才后悔莫及,人世间最痛苦的事莫过于此。你的剑在我的咽喉上割下去吧!不用再犹豫了!如果上天能够给我一个再来一次的机会,我绝对会取个汉字君。如果非要给这ID加点修饰的话,我希望是……红色加粗……

回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
46
在线时间
10 小时
注册时间
2007-5-27
帖子
2558

第1届Title华丽大赛新人奖

发表于 2008-9-11 23:19:26 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-3-29 18:58

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表