Applied most Rubocop-suggested layout fixes

This commit is contained in:
Maruno17
2021-12-18 01:56:10 +00:00
parent 5dc64f1709
commit 2480ab0f9e
88 changed files with 839 additions and 783 deletions

View File

@@ -7,6 +7,7 @@ module RPG
attr_reader :max
attr_reader :ox
attr_reader :oy
MAX_SPRITES = 60
FADE_OLD_TILES_START = 0
FADE_OLD_TILES_END = 1

View File

@@ -72,7 +72,7 @@ def pbBattleAnimation(bgm=nil,battletype=0,foe=nil)
if $PokemonGlobal.surfing || $PokemonGlobal.diving
location = 3
elsif $game_temp.encounter_type &&
GameData::EncounterType.get($game_temp.encounter_type).type == :fishing
GameData::EncounterType.get($game_temp.encounter_type).type == :fishing
location = 3
elsif $PokemonEncounters.has_cave_encounters?
location = 2
@@ -284,9 +284,9 @@ SpecialBattleIntroAnimations.register("vs_animation", 50, # Priority 50
trainername = foe[0].name
textpos = [
[$player.name, Graphics.width / 4, (Graphics.height / 1.5) + 4, 2,
Color.new(248, 248, 248), Color.new(72, 72, 72)],
Color.new(248, 248, 248), Color.new(72, 72, 72)],
[trainername, (Graphics.width / 4) + (Graphics.width / 2), (Graphics.height / 1.5) + 4, 2,
Color.new(248, 248, 248), Color.new(72, 72, 72)]
Color.new(248, 248, 248), Color.new(72, 72, 72)]
]
pbDrawTextPositions(overlay.bitmap, textpos)
# Fade out flash, shudder Vs logo and expand it, and then fade to black

View File

@@ -469,7 +469,7 @@ def pbEncounter(enc_type)
else
pbWildBattle(encounter1[0], encounter1[1])
end
$game_temp.encounter_type = nil
$game_temp.encounter_type = nil
$game_temp.force_single_battle = false
EncounterModifier.triggerEncounterEnd
return true

View File

@@ -98,7 +98,7 @@ Events.onMapChange += proc { |_sender,e|
# Get and compare map names
mapInfos = pbLoadMapInfos
next if mapInfos && oldMapID>0 && mapInfos[oldMapID] &&
mapInfos[oldMapID].name && $game_map.name==mapInfos[oldMapID].name
mapInfos[oldMapID].name && $game_map.name==mapInfos[oldMapID].name
# Make roaming Pokémon roam
pbRoamPokemon
$PokemonGlobal.roamedAlready = false

View File

@@ -147,7 +147,8 @@ def moonphase(time=nil) # in UTC
16.6109562298125,
20.3022798364375,
23.9936034430625,
27.6849270496875]
27.6849270496875
]
yy = time.year-((12-time.mon)/10.0).floor
j = (365.25*(4712+yy)).floor + (((time.mon+9)%12)*30.6+0.5).floor + time.day+59
j -= (((yy/100.0)+49).floor*0.75).floor-38 if j>2299160
@@ -219,7 +220,8 @@ def pbIsWeekday(wdayVariable,*arg)
_INTL("Wednesday"),
_INTL("Thursday"),
_INTL("Friday"),
_INTL("Saturday")][wday]
_INTL("Saturday")
][wday]
$game_map.need_refresh = true if $game_map
end
return ret
@@ -291,7 +293,8 @@ def pbIsSeason(seasonVariable,*arg)
_INTL("Spring"),
_INTL("Summer"),
_INTL("Autumn"),
_INTL("Winter")][thisseason]
_INTL("Winter")
][thisseason]
$game_map.need_refresh = true if $game_map
end
return ret

View File

@@ -312,17 +312,17 @@ def pbDive
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
pbHiddenMoveAnimation(movefinder)
pbFadeOutIn {
$game_temp.player_new_map_id = map_metadata.dive_map_id
$game_temp.player_new_x = $game_player.x
$game_temp.player_new_y = $game_player.y
$game_temp.player_new_direction = $game_player.direction
$PokemonGlobal.surfing = false
$PokemonGlobal.diving = true
$stats.dive_count += 1
pbUpdateVehicle
$scene.transfer_player(false)
$game_map.autoplay
$game_map.refresh
$game_temp.player_new_map_id = map_metadata.dive_map_id
$game_temp.player_new_x = $game_player.x
$game_temp.player_new_y = $game_player.y
$game_temp.player_new_direction = $game_player.direction
$PokemonGlobal.surfing = false
$PokemonGlobal.diving = true
$stats.dive_count += 1
pbUpdateVehicle
$scene.transfer_player(false)
$game_map.autoplay
$game_map.refresh
}
return true
end
@@ -350,17 +350,17 @@ def pbSurfacing
pbMessage(_INTL("{1} used {2}!",speciesname,GameData::Move.get(move).name))
pbHiddenMoveAnimation(movefinder)
pbFadeOutIn {
$game_temp.player_new_map_id = surface_map_id
$game_temp.player_new_x = $game_player.x
$game_temp.player_new_y = $game_player.y
$game_temp.player_new_direction = $game_player.direction
$PokemonGlobal.surfing = true
$PokemonGlobal.diving = false
pbUpdateVehicle
$scene.transfer_player(false)
surfbgm = GameData::Metadata.get.surf_BGM
(surfbgm) ? pbBGMPlay(surfbgm) : $game_map.autoplayAsCue
$game_map.refresh
$game_temp.player_new_map_id = surface_map_id
$game_temp.player_new_x = $game_player.x
$game_temp.player_new_y = $game_player.y
$game_temp.player_new_direction = $game_player.direction
$PokemonGlobal.surfing = true
$PokemonGlobal.diving = false
pbUpdateVehicle
$scene.transfer_player(false)
surfbgm = GameData::Metadata.get.surf_BGM
(surfbgm) ? pbBGMPlay(surfbgm) : $game_map.autoplayAsCue
$game_map.refresh
}
return true
end

View File

@@ -375,8 +375,8 @@ def pbBerryPlant
if berry_plant.mulch_id
pbMessage(_INTL("{1} has been laid down.\1", GameData::Item.get(berry_plant.mulch_id).name))
else
case pbMessage(_INTL("It's soft, earthy soil."), [
_INTL("Fertilize"), _INTL("Plant Berry"), _INTL("Exit")], -1)
case pbMessage(_INTL("It's soft, earthy soil."),
[_INTL("Fertilize"), _INTL("Plant Berry"), _INTL("Exit")], -1)
when 0 # Fertilize
mulch = nil
pbFadeOutIn {

View File

@@ -154,7 +154,7 @@ module RandomDungeonGenerator
end
# Draws a cell's contents, which is an underlying pattern based on tile
#_layout and a rotation (the corridors), and possibly a room on top of that.
# _layout and a rotation (the corridors), and possibly a room on top of that.
def paint_cell_contents(dungeon, xDst, yDst, tile_layout, rotation)
return false if !tile_layout
# Draw the corridors
@@ -224,6 +224,7 @@ module RandomDungeonGenerator
#=============================================================================
class Maze
attr_accessor :cellWidth, :cellHeight, :nodeWidth, :nodeHeight
DIRECTIONS = [EdgeMasks::North, EdgeMasks::South, EdgeMasks::East, EdgeMasks::West]
def initialize(cw, ch)
@@ -438,7 +439,7 @@ module RandomDungeonGenerator
class Dungeon
class DungeonTable
def initialize(dungeon)
@dungeon = dungeon
@dungeon = dungeon
end
def xsize; @dungeon.width; end
@@ -452,6 +453,7 @@ module RandomDungeonGenerator
end
attr_accessor :width, :height
BUFFER_X = 8
BUFFER_Y = 6
@@ -501,15 +503,15 @@ module RandomDungeonGenerator
# Unused
def intersects?(r1, r2)
return !(((r2[0] + r2[2] <= r1[0]) ||
(r2[0] >= r1[0] + r1[2]) ||
(r2[1] + r2[3] <= r1[1]) ||
(r2[1] >= r1[1] + r1[3])) &&
((r1[0] <= r2[0] + r2[2])||
(r1[0] >= r2[0] + r2[2]) ||
(r1[1] + r1[3] <= r2[1]) ||
(r1[1] >= r2[1] + r2[3]))
)
return !(((r2[0] + r2[2] <= r1[0]) ||
(r2[0] >= r1[0] + r1[2]) ||
(r2[1] + r2[3] <= r1[1]) ||
(r2[1] >= r1[1] + r1[3])) &&
((r1[0] <= r2[0] + r2[2])||
(r1[0] >= r2[0] + r2[2]) ||
(r1[1] + r1[3] <= r2[1]) ||
(r1[1] >= r2[1] + r2[3]))
)
end
# Returns whether the given coordinates are a room floor that isn't too close
@@ -532,10 +534,10 @@ module RandomDungeonGenerator
def isWall?(x, y)
if value(x, y) == DungeonTile::VOID
v1 = value(x, y + 1)
return true if v1 == DungeonTile::ROOM || v1 == DungeonTile::CORRIDOR
return true if [DungeonTile::ROOM, DungeonTile::CORRIDOR].include?(v1)
if v1 == DungeonTile::VOID # The tile below is void
v1 = value(x, y + 2)
return true if v1 == DungeonTile::ROOM || v1 == DungeonTile::CORRIDOR
return true if [DungeonTile::ROOM, DungeonTile::CORRIDOR].include?(v1)
end
end
return false