#============================================================================== # ★ StairRegion ver1.0 by USK #------------------------------------------------------------------------------ # ・右上がり、右下がりの階段・坂をリージョンで表現します #============================================================================== =begin ・17行目のRightUpRegionに設定した番号のリージョンは右上がり、LeftUpRegionに  設定した番号のリージョンは右下がりの坂として扱われます。 ・すり抜けオンのキャラクターはこの効果が無効になります。 ・現在地のリージョンと進行方向(右・左)にあるリージョンが設定したものである  場合に斜めに移動する仕様です。 =end #============================================================================== # ■ Game_Character #============================================================================== class Game_Character RightUpRegion = 1 #右上がりの坂に対応するリージョンID LeftUpRegion = 2 #右下がりの坂に対応するリージョンID #-------------------------------------------------------------------------- # ● まっすぐに移動 #-------------------------------------------------------------------------- alias :stair_move_straight :move_straight def move_straight(d, turn_ok = true) return stair_move_straight(d, turn_ok) if non_stair_flag case region_id when RightUpRegion if [2, 4].include?(d) if $game_map.region_id(@x - 1, @y) == RightUpRegion stair_passable?(4, 2) ? move_diagonal(4, 2) : stair_move_straight(d, turn_ok) else stair_move_straight(4, turn_ok) end else if $game_map.region_id(@x + 1, @y) == RightUpRegion stair_passable?(6, 8) ? move_diagonal(6, 8) : stair_move_straight(d, turn_ok) else stair_move_straight(6, turn_ok) end end when LeftUpRegion if [2, 4].include?(d) if $game_map.region_id(@x - 1, @y) == LeftUpRegion stair_passable?(4, 8) ? move_diagonal(4, 8) : stair_move_straight(d, turn_ok) else stair_move_straight(4, turn_ok) end else if $game_map.region_id(@x + 1, @y) == LeftUpRegion stair_passable?(6, 2) ? move_diagonal(6, 2) : stair_move_straight(d, turn_ok) else stair_move_straight(6, turn_ok) end end else stair_move_straight(d, turn_ok) end end #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def non_stair_flag @through end #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def stair_passable?(horz, vert) diagonal_passable?(x, y, horz, vert) end end #============================================================================== # ■ Game_Follower #============================================================================== class Game_Follower #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def non_stair_flag $game_player.non_stair_flag end #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def stair_passable?(horz, vert) temp = @through @through = false ret = diagonal_passable?(x, y, horz, vert) @through = temp ret end end