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

Project1

 找回密码
 注册会员
搜索
查看: 4304|回复: 5
打印 上一主题 下一主题

[已经解决] 求《即时遇敌系统》的VA移植

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
12 小时
注册时间
2012-2-12
帖子
12
跳转到指定楼层
1
发表于 2012-2-17 19:06:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
5星屑
首先感谢原版作者:小玖
脚本里有一处BUG后来改掉了,不过在这个范例里仍然存在,在哪一行就忘了,总之冲进怪物堆里遇敌会弹出。

希望能有一版相对完美的移植

即时遇敌系统.rar (243.03 KB, 下载次数: 154)

最佳答案

查看完整内容

我來試試看 ------------------------------------------------------------------------------ 完成....部分: http://rpg.blue/forum.php?mod=viewthread&tid=224644

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

2
发表于 2012-2-17 19:06:50 | 只看该作者
本帖最后由 雪流星 于 2012-3-7 22:58 编辑

我來試試看
------------------------------------------------------------------------------
完成....部分:
http://rpg.blue/forum.php?mod=viewthread&tid=224644
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2012-2-17
帖子
9
3
发表于 2012-2-17 20:11:27 | 只看该作者
加载失败了= =
请重新上传
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
12 小时
注册时间
2012-2-12
帖子
12
4
 楼主| 发表于 2012-2-17 20:37:00 | 只看该作者
本帖最后由 芥末菌 于 2012-2-20 21:42 编辑

好的,没问题






‘‘──芥末菌于2012-2-20 21:43补充以下内容

是很难吗?还是我开价太低了{:4_132:}
’’

即时遇敌系统.rar

243.03 KB, 下载次数: 3505

回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
66
在线时间
140 小时
注册时间
2012-2-6
帖子
384
5
发表于 2012-3-8 15:41:35 | 只看该作者
雪流星 发表于 2012-3-8 13:40
我來試試看
------------------------------------------------------------------------------
...
  1. #===============================================================
  2. # ■ 即时遇敌,
  3. #---------------------------------------------------------------
  4. #    碰到什么怪物,周围是什么怪物战斗中就是什么怪物
  5. #    与雪流星版本简直是完全不同的一个版本
  6. #===============================================================
  7. $win_common_event_id = 1    # 战胜时的公共事件
  8. $lose_common_event_id = 2   # 战败时的公共事件
  9. $escape_common_event_id = 3 # 逃跑时的公共事件
  10. class Game_Event < Game_Character
  11.   alias old_initialize initialize
  12.   def initialize(map_id, event)
  13.     old_initialize(map_id, event)
  14.     name = event.name
  15.     @enemy_id = 0
  16.     if name =~ /(?:敌人),(?:\s)(\d+)/
  17.       @enemy_id = $1.to_i
  18.       setup_as_enemy
  19.     end
  20.   end
  21.   def setup_as_enemy
  22.     command = RPG::EventCommand.new(301, 0, [0, 1, true, true])
  23.     @list.push(command)
  24.     command = RPG::EventCommand.new(601, 0, [])
  25.     @list.push(command)
  26.     command = RPG::EventCommand.new(117, 1, [$win_common_event_id])
  27.     @list.push(command)
  28.     command = RPG::EventCommand.new(602, 0, [])
  29.     @list.push(command)
  30.     command = RPG::EventCommand.new(117, 1, [$escape_common_event_id])
  31.     @list.push(command)
  32.     command = RPG::EventCommand.new(603, 0, [])
  33.     @list.push(command)
  34.     command = RPG::EventCommand.new(117, 1, [$lose_common_event_id])
  35.     @list.push(command)
  36.     command = RPG::EventCommand.new(604, 0, [])
  37.     @list.push(command)
  38.     command = RPG::EventCommand.new
  39.     @list.push(command)
  40.   end
  41.   def exist?
  42.     return !@erased
  43.   end
  44.   def isEnemy?
  45.     return @enemy_id > 0
  46.   end
  47.   attr_reader :enemy_id # 指定的敌人ID
  48. end
  49. class Game_Map
  50.   ENCOUNTER_RANGE = 3 #这个代表遇到敌人的范围大小
  51.   def scope_event
  52.     scope_event = []
  53.     x = $game_player.x
  54.     y = $game_player.y
  55.     for event in $game_map.events.values
  56.       next unless event.isEnemy?
  57.       if (event.x - x).abs + (event.y - y).abs <=ENCOUNTER_RANGE and event.exist?
  58.         scope_event.push(event.id)
  59.         break if scope_event.size >= 8
  60.       end
  61.     end
  62.     return scope_event
  63.   end
  64. end
  65. module BattleManager
  66.   class << self
  67.     alias instant_encounter_battle_end battle_end
  68.     def battle_end(result)
  69.       if result == 0
  70.         scope_event = $game_map.scope_event
  71.         $game_troop.members.size.times{ |i|
  72.           $game_map.events[scope_event[i]].erase
  73.         }
  74.       end
  75.       instant_encounter_battle_end(result)
  76.     end
  77.     alias instant_encounter_setup setup
  78.     def setup(troop_id, can_escape = true, can_lose = false)
  79.       if troop_id == 1
  80.         $data_troops[1].members = []
  81.         scope_event = $game_map.scope_event
  82.         for i in 1..scope_event.size
  83.           temp = RPG::Troop::Member.new
  84.           temp.enemy_id = $game_map.events[scope_event[i-1]].enemy_id
  85.           temp.x = Graphics.width * (i - 0.5) / scope_event.size
  86.           temp.y = 288
  87.           $data_troops[1].members.push(temp)
  88.         end
  89.       end
  90.       instant_encounter_setup(troop_id, can_escape, can_lose)
  91.     end
  92.   end
  93. end
复制代码
与您的脚本结构不一样的脚本。已经实现战斗后消除事件

点评

此版本不需要设置1到10号队伍,但一定要把1号队伍留空。  发表于 2012-3-8 15:42
签名是什么?可以吃么?
回复

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

6
发表于 2012-3-8 21:56:48 | 只看该作者
杂兵天下 发表于 2012-3-8 01:41
与您的脚本结构不一样的脚本。已经实现战斗后消除事件

本来想睡醒了再继续制作....现在不用了
还有设置1-10号是能手动设置座标的
你确定8个敌人排一排好看吗...

点评

的确不好看 不过我做这个东西的时候本来就没考虑过好不好看。。。。。。。。  发表于 2012-3-9 11:29
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-12 07:30

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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