赞 | 0 |
VIP | 23 |
好人卡 | 30 |
积分 | 0 |
经验 | 85978 |
最后登录 | 2017-6-19 |
在线时间 | 1165 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 38
- 在线时间
- 1165 小时
- 注册时间
- 2012-3-16
- 帖子
- 5336
|
7楼
楼主 |
发表于 2012-9-26 21:51:42
|
只看该作者
真滴不是连贴QAQ
之前给我滴改成这样了- -米有滴100行=_=- #==========================================================================
- # ■ P叔的范例,两军团群殴的接触条件
- #==========================================================================
- # 说明:
- # 1、两个军团的事件ID必须连续,比如1、2、3为一个军团,4、5、6为另一个军团。
- # 不允许1、3、4为一个军团,2,5,6为另一个军团。
- # 2、for i in a..b中的a、b分别为军团乙的成员的最大和最小的事件ID。事件ID为
- # 1至a(不包括a)为军团甲的事件ID。比如for i in 4..6,那么军团甲就是1、
- # 2、3,军团乙就是4、5、6。
- # 3、函数fight(event)的返回值是一个包含2个元素的数组,利用该数组第零个元素
- # 判定是否接触,true为接触,false为不接触。利用该数组第一个元素判断接触
- # 的事件是哪一个事件,并可以以此确定与军团甲中本事件战斗的另一个敌人。
- # 为HP等计算提供依据。这里没有写HP计算,留给你写了。嗷呜,P叔真坏。
- #==========================================================================
-
- def fight1(event)
- #敌人攻击
- for i in 11..20
- #左
- if event.x - $game_map.events[i].x == 1 and event.y == $game_map.events[i].y
- $game_variables[$game_map.events[i].id * 4 +2] =$game_variables[$game_map.events[i].id * 4 +2]-10
- $game_map.events[i].animation_id=90
- return [4,[$game_map.events[i].id] ]
- end
- #右
- if event.x - $game_map.events[i].x == -1 and event.y == $game_map.events[i].y
- $game_variables[$game_map.events[i].id * 4 +2] =$game_variables[$game_map.events[i].id * 4 +2]-10
- $game_map.events[i].animation_id=90
- return [6, [$game_map.events[i].id]]
- end
- #上
- if event.y - $game_map.events[i].y == 1 and event.x == $game_map.events[i].x
- $game_variables[$game_map.events[i].id * 4 +2] =$game_variables[$game_map.events[i].id * 4 +2]-10
- $game_map.events[i].animation_id=90
- return [8, [$game_map.events[i].id]]
- end
- #下
- if event.y - $game_map.events[i].y == -1 and event.x == $game_map.events[i].x
- $game_variables[$game_map.events[i].id * 4 +2] =$game_variables[$game_map.events[i].id * 4 +2]-10
- $game_map.events[i].animation_id=90
- return [2, [$game_map.events[i].id]]
- end
- end
- return [1, [$game_map.events[i].id]]
- end
-
- def fight2(event)
- #我方攻击
- for i in 1..10
- #左
- if event.x - $game_map.events[i].x == 1 and event.y == $game_map.events[i].y
- $game_variables[$game_map.events[i].id * 4 +2] =$game_variables[$game_map.events[i].id * 4 +2]-10
- $game_map.events[i].animation_id=90
- return [4, [$game_map.events[i].id]]
- end
- #右
- if event.x - $game_map.events[i].x == -1 and event.y == $game_map.events[i].y
- $game_variables[$game_map.events[i].id * 4 +2] =$game_variables[$game_map.events[i].id * 4 +2]-10
- $game_map.events[i].animation_id=90
- return [6, [$game_map.events[i].id]]
- end
- #上
- if event.y - $game_map.events[i].y == 1 and event.x == $game_map.events[i].x
- $game_variables[$game_map.events[i].id * 4 +2] =$game_variables[$game_map.events[i].id * 4 +2]-10
- $game_map.events[i].animation_id=90
- return [8, [$game_map.events[i].id]]
- end
- #下
- if event.y - $game_map.events[i].y == -1 and event.x == $game_map.events[i].x
- $game_variables[$game_map.events[i].id * 4 +2] =$game_variables[$game_map.events[i].id * 4 +2]-10
- $game_map.events[i].animation_id=90
- return [2, [$game_map.events[i].id]]
- end
- end
- return [1, [$game_map.events[i].id]]
- end
复制代码 @protosssonny @protosssonny @protosssonny |
|