加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
#-------------------------------------------------------------------------- # * Scope Range#技能范围 #Scope Range #-------------------------------------------------------------------------- def scope_range?(user,target) t_r2 = [user.screen_x, user.screen_y] rescue nil t_r3 = [target.screen_x, target.screen_y] rescue nil return false if t_r2 == nil or t_r3 == nil s_r = [0,0,0,0] ; s_p = [0,0] s_r = [$1.to_i,$2.to_i,$3.to_i,$4.to_i,$5.to_i] if @item.object.note =~ /<SR:(\d+):(\d+)-(\d+)-(\d+)-(\d+)>/ #if SCOPE_TYPE > 0 s_p = [target.sprite_size[0] / 2, target.sprite_size[1]] s_p[0] = s_p[0] * SPRITE_SIZE_RANGE[0] / 100 s_p[1] = s_p[1] * SPRITE_SIZE_RANGE[1] / 100 #end case s_r[0] when 1#矩形 return false if !t_r3[0].between?(t_r2[0] - (s_r[1] + s_p[0]), t_r2[0] + (s_r[2] + s_p[0])) return false if !t_r3[1].between?(t_r2[1] - s_r[3], t_r2[1] + s_r[4] + s_p[1]) when 2#菱形 # <Scope Range = X1 - X2 - Y1 - Y2> # # Y1 # # X1 X2 # # Y2 # # Ex -> <Scope Range = (100 - 32 - 64 - 32> return false if !t_r3[0].between?(t_r2[0] - (s_r[1] + s_p[0]), t_r2[0] + (s_r[2] + s_p[0])) if t_r3[0]<t_r2[0]#在横坐标负半轴上 return false if !t_r3[1].between?(-s_r[3]/s_r[1]*t_r3[0]-s_r[3],s_r[4]+s_r[4]/s_r[1]*t_r3[0]) else return false if !t_r3[1].between?(s_r[3]/s_r[2]*t_r3[0]-s_r[3],s_r[4]-s_r[4]/s_r[2]*t_r3[0]) end when 3#圆形 end return true end end
#--------------------------------------------------------------------------
# * Scope Range#技能范围
#Scope Range
#--------------------------------------------------------------------------
def scope_range?(user,target)
t_r2 = [user.screen_x, user.screen_y] rescue nil
t_r3 = [target.screen_x, target.screen_y] rescue nil
return false if t_r2 == nil or t_r3 == nil
s_r = [0,0,0,0] ; s_p = [0,0]
s_r = [$1.to_i,$2.to_i,$3.to_i,$4.to_i,$5.to_i] if @item.object.note =~ /<SR:(\d+):(\d+)-(\d+)-(\d+)-(\d+)>/
#if SCOPE_TYPE > 0
s_p = [target.sprite_size[0] / 2, target.sprite_size[1]]
s_p[0] = s_p[0] * SPRITE_SIZE_RANGE[0] / 100
s_p[1] = s_p[1] * SPRITE_SIZE_RANGE[1] / 100
#end
case s_r[0]
when 1#矩形
return false if !t_r3[0].between?(t_r2[0] - (s_r[1] + s_p[0]), t_r2[0] + (s_r[2] + s_p[0]))
return false if !t_r3[1].between?(t_r2[1] - s_r[3], t_r2[1] + s_r[4] + s_p[1])
when 2#菱形
# <Scope Range = X1 - X2 - Y1 - Y2>
#
# Y1
#
# X1 X2
#
# Y2
#
# Ex -> <Scope Range = (100 - 32 - 64 - 32>
return false if !t_r3[0].between?(t_r2[0] - (s_r[1] + s_p[0]), t_r2[0] + (s_r[2] + s_p[0]))
if t_r3[0]<t_r2[0]#在横坐标负半轴上
return false if !t_r3[1].between?(-s_r[3]/s_r[1]*t_r3[0]-s_r[3],s_r[4]+s_r[4]/s_r[1]*t_r3[0])
else
return false if !t_r3[1].between?(s_r[3]/s_r[2]*t_r3[0]-s_r[3],s_r[4]-s_r[4]/s_r[2]*t_r3[0])
end
when 3#圆形
end
return true
end
end
我在SideView里面插入了技能范围,然后加了一个菱形的技能范围···但是实际应用感觉不太对可又看不出来···- ACTOR_POSITION = [[415,160, 0],[435,185, 0],[455,210, 0]]
复制代码 分别对应队伍里1-3号角色的位置,1号角色用<SR:2:150-150-150-150>备注的治疗技能,给1号角色用则只有1号角色恢复,给2号角色用1、2号角色恢复,给3号角色用1、2、3号角色恢复···问题出在哪里呢···
@三途亚梦 @VIPArcher (@Taroxd准备高考就不@了···) |