Class: Game_Map

Inherits:
Object show all
Defined in:
docs/4_Systems_003_Map_Engine.rb

Overview

Describe the Map processing

Constant Summary collapse

MACH_BIKE_BGM =

Audiofile to play when the player is on mach bike

Returns:

RPG::AudioFile.new('09 Bicycle', 100, 100)
ACRO_BIKE_BGM =

Audiofile to play when the player is on acro bike

Returns:

MACH_BIKE_BGM.clone
PATH_FINDING_ENABLED =

If the Path Finding system is enabled

true
CenterPlayer =

If the player is always on the center of the screen

Configs.display.is_player_always_centered
NUM_TILE_VIEW_Y =

Number of tiles the player can see in x

15
NUM_TILE_VIEW_X =

Number of tiles the player can see in y

20
FOLLOWER_ID_REGEXP =

Regular expression catching follower id

/\[follow=([0-9]+)\]/
TERRAIN_TAGS_TABLE =

Convert terrain tag to location symbol

Returns:

  • (Hash<Integer, Symbol>)
{GameData::SystemTags::TGrass => :grass, GameData::SystemTags::TTallGrass => :grass, GameData::SystemTags::HeadButt => :grass, GameData::SystemTags::TSnow => :snow, GameData::SystemTags::TPond => :shallow_water, GameData::SystemTags::TWetSand => :shallow_water, GameData::SystemTags::SwampBorder => :shallow_water, GameData::SystemTags::DeepSwamp => :shallow_water, GameData::SystemTags::TSand => :desert, GameData::SystemTags::TCave => :cave, GameData::SystemTags::TMount => :cave, GameData::SystemTags::TIce => :icy_cave, GameData::SystemTags::TSea => :water, GameData::SystemTags::WaterFall => :water, GameData::SystemTags::RapidsL => :water, GameData::SystemTags::RapidsD => :water, GameData::SystemTags::RapidsU => :water, GameData::SystemTags::RapidsR => :water, GameData::SystemTags::Whirlpool => :water}
IVAR_TO_REMOVE_FROM_SAVE_FILE =

List of variable to remove in order to keep the map data safe

%i[@map @tileset_name @autotile_names @panorama_name @panorama_hue @fog_name @fog_hue @fog_opacity @fog_blend_type @fog_zoom @fog_sx @fog_sy @battleback_name @passages @priorities @terrain_tags @events @common_events @system_tags]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGame_Map

Initialize the default Game_Map object



3237
3238
# File 'docs/4_Systems_003_Map_Engine.rb', line 3237

def initialize
end

Instance Attribute Details

#autotile_names

タイルセット ファイル名



3189
3190
3191
# File 'docs/4_Systems_003_Map_Engine.rb', line 3189

def autotile_names
  @autotile_names
end

#battleback_name

フォグ SY



3209
3210
3211
# File 'docs/4_Systems_003_Map_Engine.rb', line 3209

def battleback_name
  @battleback_name
end

#display_x

バトルバック ファイル名



3211
3212
3213
# File 'docs/4_Systems_003_Map_Engine.rb', line 3211

def display_x
  @display_x
end

#display_y

表示 X 座標 * 128



3213
3214
3215
# File 'docs/4_Systems_003_Map_Engine.rb', line 3213

def display_y
  @display_y
end

#event_erasedBoolean

If an event has been erased (helps removing it)

Returns:

  • (Boolean)


3376
3377
3378
# File 'docs/4_Systems_003_Map_Engine.rb', line 3376

def event_erased
  @event_erased
end

#eventsHash{Integer => Game_Event} (readonly)

地形タグ テーブル

Returns:

  • (Hash{Integer => Game_Event})

    all the living events



3224
3225
3226
# File 'docs/4_Systems_003_Map_Engine.rb', line 3224

def events
  @events
end

#events_sym_to_idHash<Symbol, Integer>

Return the hash of symbol associate to event id

Returns:

  • (Hash<Symbol, Integer>)


3227
3228
3229
# File 'docs/4_Systems_003_Map_Engine.rb', line 3227

def events_sym_to_id
  @events_sym_to_id
end

#fog_blend_type

フォグ 不透明度



3201
3202
3203
# File 'docs/4_Systems_003_Map_Engine.rb', line 3201

def fog_blend_type
  @fog_blend_type
end

#fog_hue

フォグ ファイル名



3197
3198
3199
# File 'docs/4_Systems_003_Map_Engine.rb', line 3197

def fog_hue
  @fog_hue
end

#fog_name

パノラマ 色相



3195
3196
3197
# File 'docs/4_Systems_003_Map_Engine.rb', line 3195

def fog_name
  @fog_name
end

#fog_opacity

フォグ 色相



3199
3200
3201
# File 'docs/4_Systems_003_Map_Engine.rb', line 3199

def fog_opacity
  @fog_opacity
end

#fog_ox (readonly)

Returns the value of attribute fog_ox.



3228
3229
3230
# File 'docs/4_Systems_003_Map_Engine.rb', line 3228

def fog_ox
  @fog_ox
end

#fog_oy (readonly)

フォグ 原点 X 座標



3230
3231
3232
# File 'docs/4_Systems_003_Map_Engine.rb', line 3230

def fog_oy
  @fog_oy
end

#fog_sx

フォグ 拡大率



3205
3206
3207
# File 'docs/4_Systems_003_Map_Engine.rb', line 3205

def fog_sx
  @fog_sx
end

#fog_sy

フォグ SX



3207
3208
3209
# File 'docs/4_Systems_003_Map_Engine.rb', line 3207

def fog_sy
  @fog_sy
end

#fog_tone (readonly)

フォグ 原点 Y 座標



3232
3233
3234
# File 'docs/4_Systems_003_Map_Engine.rb', line 3232

def fog_tone
  @fog_tone
end

#fog_zoom

フォグ ブレンド方法



3203
3204
3205
# File 'docs/4_Systems_003_Map_Engine.rb', line 3203

def fog_zoom
  @fog_zoom
end

#maplinker_disabledBoolean (readonly)

フォグ 色調

Returns:

  • (Boolean)

    if the maplinker was disabled when the map was setup



3235
3236
3237
# File 'docs/4_Systems_003_Map_Engine.rb', line 3235

def maplinker_disabled
  @maplinker_disabled
end

#need_refresh

表示 Y 座標 * 128



3215
3216
3217
# File 'docs/4_Systems_003_Map_Engine.rb', line 3215

def need_refresh
  @need_refresh
end

#panorama_hue

パノラマ ファイル名



3193
3194
3195
# File 'docs/4_Systems_003_Map_Engine.rb', line 3193

def panorama_hue
  @panorama_hue
end

#panorama_name

オートタイル ファイル名



3191
3192
3193
# File 'docs/4_Systems_003_Map_Engine.rb', line 3191

def panorama_name
  @panorama_name
end

#passages (readonly)

リフレッシュ要求フラグ



3217
3218
3219
# File 'docs/4_Systems_003_Map_Engine.rb', line 3217

def passages
  @passages
end

#priorities (readonly)

通行 テーブル



3219
3220
3221
# File 'docs/4_Systems_003_Map_Engine.rb', line 3219

def priorities
  @priorities
end

#system_tagsTable (readonly)

The system_tags linked to each tiles of the tileset

Returns:



3379
3380
3381
# File 'docs/4_Systems_003_Map_Engine.rb', line 3379

def system_tags
  @system_tags
end

#terrain_tags (readonly)

プライオリティ テーブル



3221
3222
3223
# File 'docs/4_Systems_003_Map_Engine.rb', line 3221

def terrain_tags
  @terrain_tags
end

#tileset_name

Returns the value of attribute tileset_name.



3187
3188
3189
# File 'docs/4_Systems_003_Map_Engine.rb', line 3187

def tileset_name
  @tileset_name
end

Instance Method Details

#autoplay

Auto play bgm and bgs of the map if defined



3268
3269
# File 'docs/4_Systems_003_Map_Engine.rb', line 3268

def autoplay
end

#begin_save

Method that prevent non wanted data save of the Game_Map object

Author:

  • Nuri Yuri



3425
3426
# File 'docs/4_Systems_003_Map_Engine.rb', line 3425

def begin_save
end

#bush?(x, y) ⇒ Boolean

Tells if the tile is a bush tile

Parameters:

  • x (Integer)

    x coordinate of the tile

  • y (Integer)

    y coordinate of the tile

Returns:

  • (Boolean)


3311
3312
# File 'docs/4_Systems_003_Map_Engine.rb', line 3311

def bush?(x, y)
end

#counter?(x, y) ⇒ Boolean

カウンター判定 (no idea, need GTranslate)

Parameters:

  • x (Integer)

    x coordinate of the tile

  • y (Integer)

    y coordinate of the tile

Returns:

  • (Boolean)


3317
3318
# File 'docs/4_Systems_003_Map_Engine.rb', line 3317

def counter?(x, y)
end

#dataTable

Returns the tile matrix of the Map

Returns:

  • (Table)

    a 3D table containing ids of tile



3265
3266
# File 'docs/4_Systems_003_Map_Engine.rb', line 3265

def data
end

#encounter_list

Deprecated.

Not used by the Core of PSDK because not precise enough to be used

Returns the encounter list



3257
3258
# File 'docs/4_Systems_003_Map_Engine.rb', line 3257

def encounter_list
end

#end_save

Method that end the save state of the Game_Map object

Author:

  • Nuri Yuri



3429
3430
# File 'docs/4_Systems_003_Map_Engine.rb', line 3429

def end_save
end

#get_tile(x, y) ⇒ Integer

Retrieve the id of a specific tile

Parameters:

  • x (Integer)

    x position of the tile

  • y (Integer)

    y position of the tile

Returns:

  • (Integer)

    id of the tile

Author:

  • Nuri Yuri



3404
3405
# File 'docs/4_Systems_003_Map_Engine.rb', line 3404

def get_tile(x, y)
end

#heightInteger

Returns the height of the map

Returns:

  • (Integer)


3253
3254
# File 'docs/4_Systems_003_Map_Engine.rb', line 3253

def height
end

#jump_passable?(x, y, d) ⇒ Boolean

Check if the player can jump a case with the acro bike

Parameters:

  • x (Integer)

    x position of the tile

  • y (Integer)

    y position of the tile

  • d (Integer)

    the direction of the player

Returns:

  • (Boolean)

Author:

  • Nuri Yuri



3412
3413
# File 'docs/4_Systems_003_Map_Engine.rb', line 3412

def jump_passable?(x, y, d)
end

#load_systemtags

Loads the SystemTags of the map

Author:

  • Nuri Yuri



3397
3398
# File 'docs/4_Systems_003_Map_Engine.rb', line 3397

def load_systemtags
end

#location_type(x, y) ⇒ Symbol

Return the current location type

Returns:

  • (Symbol)


3416
3417
# File 'docs/4_Systems_003_Map_Engine.rb', line 3416

def location_type(x, y)
end

#map_idInteger

Returns the ID of the Map

Returns:

  • (Integer)


3245
3246
# File 'docs/4_Systems_003_Map_Engine.rb', line 3245

def map_id
end

#passable?(x, y, d, self_event = nil) ⇒ Boolean

Tells if the tile front/current tile is passsable or not

Parameters:

  • x (Integer)

    x position on the Map

  • y (Integer)

    y position on the Map

  • d (Integer)

    direction : 2, 4, 6, 8, 0. 0 = current position

  • self_event (Game_Event, nil) (defaults to: nil)

    the “tile” event to ignore

Returns:

  • (Boolean)

    if the front/current tile is passable



3305
3306
# File 'docs/4_Systems_003_Map_Engine.rb', line 3305

def passable?(x, y, d, self_event = nil)
end

#refresh

Refresh events and common events of the map



3271
3272
# File 'docs/4_Systems_003_Map_Engine.rb', line 3271

def refresh
end

#rmxp_encounter_stepsInteger

Returns the encounter steps from RMXP data

Returns:

  • (Integer)


3261
3262
# File 'docs/4_Systems_003_Map_Engine.rb', line 3261

def rmxp_encounter_steps
end

#scroll_down(distance, is_priority = false)

Scrolls the map down

Parameters:

  • distance (Integer)

    distance in y to scroll

  • is_priority (Boolean) (defaults to: false)

    used if there is a prioratary scroll running



3276
3277
# File 'docs/4_Systems_003_Map_Engine.rb', line 3276

def scroll_down(distance, is_priority = false)
end

#scroll_left(distance, is_priority = false)

Scrolls the map left

Parameters:

  • distance (Integer)

    distance in -x to scroll

  • is_priority (Boolean) (defaults to: false)

    used if there is a prioratary scroll running



3281
3282
# File 'docs/4_Systems_003_Map_Engine.rb', line 3281

def scroll_left(distance, is_priority = false)
end

#scroll_right(distance, is_priority = false)

Scrolls the map right

Parameters:

  • distance (Integer)

    distance in x to scroll

  • is_priority (Boolean) (defaults to: false)

    used if there is a prioratary scroll running



3286
3287
# File 'docs/4_Systems_003_Map_Engine.rb', line 3286

def scroll_right(distance, is_priority = false)
end

#scroll_up(distance, is_priority = false)

Scrolls the map up

Parameters:

  • distance (Integer)

    distance in -y to scroll

  • is_priority (Boolean) (defaults to: false)

    used if there is a prioratary scroll running



3291
3292
# File 'docs/4_Systems_003_Map_Engine.rb', line 3291

def scroll_up(distance, is_priority = false)
end

#scrolling?Boolean

is the map scrolling ?

Returns:

  • (Boolean)


3335
3336
# File 'docs/4_Systems_003_Map_Engine.rb', line 3335

def scrolling?
end

#setup(map_id)

setup the Game_Map object with the right Map data

Parameters:

  • map_id (Integer)

    the ID of the map



3241
3242
# File 'docs/4_Systems_003_Map_Engine.rb', line 3241

def setup(map_id)
end

#start_fog_opacity_change(opacity, duration)

Starts a fog opacity change process

Parameters:

  • opacity (Integer)

    the new opacity of the fog

  • duration (Integer)

    the number of frame the opacity change will take



3345
3346
# File 'docs/4_Systems_003_Map_Engine.rb', line 3345

def start_fog_opacity_change(opacity, duration)
end

#start_fog_tone_change(tone, duration)

Starts a fog tone change process

Parameters:

  • tone (Tone)

    the new tone of the fog

  • duration (Integer)

    the number of frame the tone change will take



3340
3341
# File 'docs/4_Systems_003_Map_Engine.rb', line 3340

def start_fog_tone_change(tone, duration)
end

#start_scroll(direction, distance, speed, x_priority = false, y_priority = false)

Starts a scroll processing

Parameters:

  • direction (Integer)

    the direction to scroll

  • distance (Integer)

    the distance to scroll

  • speed (Integer)

    the speed of the scroll processing

  • x_priority (Boolean) (defaults to: false)

    true if the scroll is prioritary in x axis, be careful using this

  • y_priority (Boolean) (defaults to: false)

    true if the scroll is prioritary in y axis, be careful using this



3331
3332
# File 'docs/4_Systems_003_Map_Engine.rb', line 3331

def start_scroll(direction, distance, speed, x_priority = false, y_priority = false)
end

#system_tag(x, y) ⇒ Integer

Retrieve the ID of the SystemTag on a specific tile

Parameters:

  • x (Integer)

    x position of the tile

  • y (Integer)

    y position of the tile

Returns:

  • (Integer)

Author:

  • Nuri Yuri



3385
3386
# File 'docs/4_Systems_003_Map_Engine.rb', line 3385

def system_tag(x, y)
end

#system_tag_here?(x, y, tag) ⇒ Boolean

Check if a specific SystemTag is present on a specific tile

Parameters:

  • x (Integer)

    x position of the tile

  • y (Integer)

    y position of the tile

  • tag (Integer)

    ID of the SystemTag

Returns:

  • (Boolean)

Author:

  • Nuri Yuri



3393
3394
# File 'docs/4_Systems_003_Map_Engine.rb', line 3393

def system_tag_here?(x, y, tag)
end

#terrain_tag(x, y) ⇒ Integer?

Returns the tag of the tile

Parameters:

  • x (Integer)

    x coordinate of the tile

  • y (Integer)

    y coordinate of the tile

Returns:

  • (Integer, nil)

    Tag of the tile



3323
3324
# File 'docs/4_Systems_003_Map_Engine.rb', line 3323

def terrain_tag(x, y)
end

#update

Update the Map processing



3348
3349
# File 'docs/4_Systems_003_Map_Engine.rb', line 3348

def update
end

#valid?(x, y) ⇒ Boolean

Tells if the x,y coordinate is valid or not (inside of bounds)

Parameters:

  • x (Integer)

    the x coordinate

  • y (Integer)

    the y coordinate

Returns:

  • (Boolean)

    if it’s valid or not



3297
3298
# File 'docs/4_Systems_003_Map_Engine.rb', line 3297

def valid?(x, y)
end

#widthInteger

Returns the width of the map

Returns:

  • (Integer)


3249
3250
# File 'docs/4_Systems_003_Map_Engine.rb', line 3249

def width
end