#--------------------------------------------------------------------------
# ● 判定事件是否與玩家相鄰 #這是新增部分 非預設內容
#--------------------------------------------------------------------------
def contact_the_player?
sx = distance_x_from($game_player.x).abs
sy = distance_y_from($game_player.y).abs
sx + sy == 1
end
#--------------------------------------------------------------------------
# ● 判定事件是否與玩家相鄰 #這是新增部分 非預設內容
#--------------------------------------------------------------------------
def contact_the_player?
sx = distance_x_from($game_player.x).abs
sy = distance_y_from($game_player.y).abs
sx + sy == 1
end
#--------------------------------------------------------------------------
# ● 判定玩家是否朝向事件 #這是新增部分 非預設內容
#--------------------------------------------------------------------------
def face_the_event?
sx = distance_x_from($game_player.x)
sy = distance_y_from($game_player.y)
return true if (sy > 0 && $game_player.direction == 2)
return true if (sx < 0 && $game_player.direction == 4)
return true if (sx > 0 && $game_player.direction == 6)
return true if (sy < 0 && $game_player.direction == 8)
end
#--------------------------------------------------------------------------
# ● 判定玩家是否朝向事件 #這是新增部分 非預設內容
#--------------------------------------------------------------------------
def face_the_event?
sx = distance_x_from($game_player.x)
sy = distance_y_from($game_player.y)
return true if (sy > 0 && $game_player.direction == 2)
return true if (sx < 0 && $game_player.direction == 4)
return true if (sx > 0 && $game_player.direction == 6)
return true if (sy < 0 && $game_player.direction == 8)
end