mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
41 lines
691 B
Ruby
41 lines
691 B
Ruby
class Game_FastTravel
|
|
attr_reader :zone
|
|
attr_accessor :enabled
|
|
alias :enabled? :enabled
|
|
|
|
class Map
|
|
attr_reader :id
|
|
attr_reader :x
|
|
attr_reader :y
|
|
attr_reader :dir
|
|
|
|
def initialize(id, x, y, dir)
|
|
@id = id
|
|
@x = x
|
|
@y = y
|
|
@dir = dir
|
|
end
|
|
end
|
|
|
|
def initialize
|
|
@unlocked = {}
|
|
@zone = nil
|
|
@enabled = false
|
|
RPG::Mod.exec_hooks("hooks/Game_FastTravel/init", binding)
|
|
end
|
|
|
|
def unlock(map, id, x, y, dir)
|
|
@unlocked[@zone][map] = Map.new(id, x, y, dir)
|
|
end
|
|
|
|
def zone=(zone)
|
|
@zone = zone
|
|
unless @unlocked.include? zone
|
|
@unlocked[zone] = {}
|
|
end
|
|
end
|
|
|
|
def unlocked_maps
|
|
@unlocked[@zone]
|
|
end
|
|
end
|