Project1
标题:
夜想曲角色攻击范围
[打印本页]
作者:
小马无敌
时间:
2010-7-22 21:42
标题:
夜想曲角色攻击范围
#--------------------------------------------------------------------------
# ● 刷新角色普通攻击行为
#--------------------------------------------------------------------------
def update_actor_attk
# C按下时
if ((Kboard.trigger?($R_Key_SPACE) or Kboard.trigger?($R_Key_RETURN)) or S[1])and @actor_atktime <= 0
if @actor.weapon_id.between?(50, 65) # and $data_weapons[@actor.weapon_id].rang >= 1
new_x = @x + (@d == 6 ? 1 : @d == 4 ? -1 : 0)
new_y = @y + (@d == 2 ? 1 : @d == 8 ? -1 : 0)
event = $game_map.events[$game_map.check_event(new_x,new_y)]
return if !event.nil? and !event.is_enemy?
rang_atk#(@actor.animation1_id)
return
end
new_x = @x + (@d == 6 ? 1 : @d == 4 ? -1 : 0)
new_y = @y + (@d == 2 ? 1 : @d == 8 ? -1 : 0)
event = $game_map.events[$game_map.check_event(new_x,new_y)]
if !event.nil? and event.maxhp > 0 and @actor_atktime <= 0
@attev = event
dagame_acon(event,event_damage(@actor, event),@actor.animation2_id)
end
end
end
如何改为攻击面对的方向的前两格
作者:
火ZHI意志
时间:
2010-7-24 17:58
原系统是往那个方向?
作者:
逸豫
时间:
2010-7-24 19:09
new_x = @x + (@d == 6 ? 1 : @d == 4 ? -1 : 0)
new_y = @y + (@d == 2 ? 1 : @d == 8 ? -1 : 0)
把这里面的1 -1改为2 -2
作者:
小马无敌
时间:
2010-7-25 15:52
回复
逸豫
的帖子
试过,不过变成只能打面前的第二格了……
作者:
逸豫
时间:
2010-7-25 20:48
new_x = @x + (@d == 6 ? 1 : @d == 4 ? -1 : 0)
new_y = @y + (@d == 2 ? 1 : @d == 8 ? -1 : 0)
new_x2 = @x + (@d == 6 ? 2 : @d == 4 ? -2 : 0)
new_y2 = @y + (@d == 2 ? 2 : @d == 8 ? -2 : 0)
event = $game_map.events[$game_map.check_event(new_x,new_y)]
event = $game_map.events[$game_map.check_event(new_x2,new_y2)] if event == nil
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1