Fixed previous commit always causing recompiling if shadow_pokemon.dat doesn't exist, also rubocopping

This commit is contained in:
Maruno17
2023-01-23 22:27:04 +00:00
parent f6213057d8
commit b0b6e675c3
103 changed files with 1099 additions and 1302 deletions

View File

@@ -38,8 +38,6 @@ class LocationWindow
end
end
#===============================================================================
# Visibility circle in dark maps
#===============================================================================
@@ -85,8 +83,6 @@ class DarknessSprite < Sprite
end
end
#===============================================================================
# Light effects
#===============================================================================
@@ -120,8 +116,9 @@ class LightEffect
end
end
#===============================================================================
#
#===============================================================================
class LightEffect_Lamp < LightEffect
def initialize(event, viewport = nil, map = nil)
lamp = AnimatedBitmap.new("Graphics/Pictures/LE")
@@ -138,8 +135,9 @@ class LightEffect_Lamp < LightEffect
end
end
#===============================================================================
#
#===============================================================================
class LightEffect_Basic < LightEffect
def initialize(event, viewport = nil, map = nil, filename = nil)
super
@@ -164,8 +162,9 @@ class LightEffect_Basic < LightEffect
end
end
#===============================================================================
#
#===============================================================================
class LightEffect_DayNight < LightEffect
def initialize(event, viewport = nil, map = nil, filename = nil)
super
@@ -203,8 +202,9 @@ class LightEffect_DayNight < LightEffect
end
end
#===============================================================================
#
#===============================================================================
EventHandlers.add(:on_new_spriteset_map, :add_light_effects,
proc { |spriteset, viewport|
map = spriteset.map # Map associated with the spriteset (not necessarily the current map)

View File

@@ -76,8 +76,6 @@ def pbCaveExit
pbCaveEntranceEx(true)
end
#===============================================================================
# Blacking out animation
#===============================================================================

View File

@@ -25,16 +25,12 @@ def pbPokerus?
return false
end
class Game_Temp
attr_accessor :warned_low_battery
attr_accessor :cue_bgm
attr_accessor :cue_bgm_frame_delay
end
def pbBatteryLow?
pstate = System.power_state
# If it's not discharging, it doesn't matter if it's low
@@ -220,8 +216,6 @@ def pbBattleOnStepTaken(repel_active)
$game_temp.force_single_battle = false
end
#===============================================================================
# Checks when moving between maps
#===============================================================================
@@ -331,8 +325,6 @@ EventHandlers.add(:on_map_or_spriteset_change, :show_location_window,
}
)
#===============================================================================
# Event locations, terrain tags
#===============================================================================
@@ -416,8 +408,6 @@ def pbFacingEachOther(event1, event2)
return pbEventFacesPlayer?(event1, event2, 1) && pbEventFacesPlayer?(event2, event1, 1)
end
#===============================================================================
# Audio playing
#===============================================================================
@@ -454,8 +444,6 @@ def pbAutoplayOnSave
end
end
#===============================================================================
# Event movement
#===============================================================================
@@ -473,8 +461,8 @@ module PBMoveRoute
AwayFromPlayer = 11
Forward = 12
Backward = 13
Jump = 14 # xoffset, yoffset
Wait = 15 # frames
Jump = 14 # xoffset, yoffset
Wait = 15 # frames
TurnDown = 16
TurnLeft = 17
TurnRight = 18
@@ -486,10 +474,10 @@ module PBMoveRoute
TurnRandom = 24
TurnTowardPlayer = 25
TurnAwayFromPlayer = 26
SwitchOn = 27 # 1 param
SwitchOff = 28 # 1 param
ChangeSpeed = 29 # 1 param
ChangeFreq = 30 # 1 param
SwitchOn = 27 # 1 param
SwitchOff = 28 # 1 param
ChangeSpeed = 29 # 1 param
ChangeFreq = 30 # 1 param
WalkAnimeOn = 31
WalkAnimeOff = 32
StepAnimeOn = 33
@@ -500,16 +488,14 @@ module PBMoveRoute
ThroughOff = 38
AlwaysOnTopOn = 39
AlwaysOnTopOff = 40
Graphic = 41 # Name, hue, direction, pattern
Opacity = 42 # 1 param
Blending = 43 # 1 param
PlaySE = 44 # 1 param
Script = 45 # 1 param
ScriptAsync = 101 # 1 param
Graphic = 41 # Name, hue, direction, pattern
Opacity = 42 # 1 param
Blending = 43 # 1 param
PlaySE = 44 # 1 param
Script = 45 # 1 param
ScriptAsync = 101 # 1 param
end
def pbMoveRoute(event, commands, waitComplete = false)
route = RPG::MoveRoute.new
route.repeat = false
@@ -555,8 +541,6 @@ def pbWait(numFrames)
end
end
#===============================================================================
# Player/event movement in the field
#===============================================================================
@@ -644,8 +628,6 @@ def pbJumpToward(dist = 1, playSound = false, cancelSurf = false)
return false
end
#===============================================================================
# Bridges, cave escape points, and setting the heal point
#===============================================================================
@@ -689,8 +671,6 @@ def pbSetPokemonCenter
$PokemonGlobal.pokecenterDirection = $game_player.direction
end
#===============================================================================
# Partner trainer
#===============================================================================
@@ -710,8 +690,6 @@ def pbDeregisterPartner
$PokemonGlobal.partner = nil
end
#===============================================================================
# Picking up an item found on the ground
#===============================================================================
@@ -752,8 +730,6 @@ def pbItemBall(item, quantity = 1)
return false
end
#===============================================================================
# Being given an item
#===============================================================================

View File

@@ -8,8 +8,9 @@ class PokemonGlobalMetadata
attr_accessor :nextBattleBack
end
#===============================================================================
#
#===============================================================================
class Game_Temp
attr_accessor :encounter_triggered
attr_accessor :encounter_type
@@ -61,8 +62,9 @@ class Game_Temp
end
end
#===============================================================================
#
#===============================================================================
def setBattleRule(*args)
r = nil
args.each do |arg|

View File

@@ -26,7 +26,7 @@ class PokemonEncounters
@chance_accumulator = 0
end
#=============================================================================
#-----------------------------------------------------------------------------
# Returns whether encounters for the given encounter type have been defined
# for the current map.
@@ -84,7 +84,7 @@ class PokemonEncounters
return false
end
#=============================================================================
#-----------------------------------------------------------------------------
# Returns whether the player's current location allows wild encounters to
# trigger upon taking a step.
@@ -262,7 +262,7 @@ class PokemonEncounters
return ret
end
#=============================================================================
#-----------------------------------------------------------------------------
# For the current map, randomly chooses a species and level from the encounter
# list for the given encounter type. Returns nil if there are none defined.
@@ -375,8 +375,6 @@ class PokemonEncounters
end
end
#===============================================================================
#
#===============================================================================

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class PokemonGlobalMetadata
attr_accessor :roamPosition
attr_accessor :roamedAlready # Whether a roamer has been encountered on current map
@@ -11,8 +14,6 @@ class PokemonGlobalMetadata
end
end
#===============================================================================
# Making roaming Pokémon roam around.
#===============================================================================
@@ -101,8 +102,6 @@ EventHandlers.add(:on_enter_map, :move_roaming_pokemon,
}
)
#===============================================================================
# Encountering a roaming Pokémon in a wild battle.
#===============================================================================
@@ -110,8 +109,9 @@ class Game_Temp
attr_accessor :roamer_index_for_encounter # Index of roaming Pokémon to encounter next
end
#===============================================================================
#
#===============================================================================
# Returns whether the given category of encounter contains the actual encounter
# method that will occur in the player's current position.
def pbRoamingMethodAllowed(roamer_method)

View File

@@ -115,8 +115,6 @@ class PokemonGlobalMetadata
end
end
#===============================================================================
# This class keeps track of erased and moved events so their position
# can remain after a game is saved and loaded. This class also includes

View File

@@ -5,8 +5,9 @@ def pbGetTimeNow
return Time.now
end
#===============================================================================
#
#===============================================================================
module PBDayNight
HOURLY_TONES = [
Tone.new(-70, -90, 15, 55), # Night # Midnight
@@ -109,8 +110,9 @@ module PBDayNight
end
end
#===============================================================================
#
#===============================================================================
def pbDayNightTint(object)
return if !$scene.is_a?(Scene_Map)
if Settings::TIME_SHADING && $game_map.metadata&.outdoor_map
@@ -121,85 +123,6 @@ def pbDayNightTint(object)
end
end
#===============================================================================
# Moon phases and Zodiac
#===============================================================================
# Calculates the phase of the moon.
# 0 - New Moon
# 1 - Waxing Crescent
# 2 - First Quarter
# 3 - Waxing Gibbous
# 4 - Full Moon
# 5 - Waning Gibbous
# 6 - Last Quarter
# 7 - Waning Crescent
def moonphase(time = nil) # in UTC
time = pbGetTimeNow if !time
transitions = [
1.8456618033125,
5.5369854099375,
9.2283090165625,
12.9196326231875,
16.6109562298125,
20.3022798364375,
23.9936034430625,
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 > 2_299_160
j += (((time.hour * 60) + (time.min * 60)) + time.sec) / 86_400.0
v = (j - 2_451_550.1) / 29.530588853
v = ((v - v.floor) + (v < 0 ? 1 : 0))
ag = v * 29.53
transitions.length.times do |i|
return i if ag <= transitions[i]
end
return 0
end
# Calculates the zodiac sign based on the given month and day:
# 0 is Aries, 11 is Pisces. Month is 1 if January, and so on.
def zodiac(month, day)
time = [
3, 21, 4, 19, # Aries
4, 20, 5, 20, # Taurus
5, 21, 6, 20, # Gemini
6, 21, 7, 20, # Cancer
7, 23, 8, 22, # Leo
8, 23, 9, 22, # Virgo
9, 23, 10, 22, # Libra
10, 23, 11, 21, # Scorpio
11, 22, 12, 21, # Sagittarius
12, 22, 1, 19, # Capricorn
1, 20, 2, 18, # Aquarius
2, 19, 3, 20 # Pisces
]
(time.length / 4).times do |i|
return i if month == time[i * 4] && day >= time[(i * 4) + 1]
return i if month == time[(i * 4) + 2] && day <= time[(i * 4) + 3]
end
return 0
end
# Returns the opposite of the given zodiac sign.
# 0 is Aries, 11 is Pisces.
def zodiacOpposite(sign)
return (sign + 6) % 12
end
# 0 is Aries, 11 is Pisces.
def zodiacPartners(sign)
return [(sign + 4) % 12, (sign + 8) % 12]
end
# 0 is Aries, 11 is Pisces.
def zodiacComplements(sign)
return [(sign + 1) % 12, (sign + 11) % 12]
end
#===============================================================================
# Days of the week
#===============================================================================
@@ -307,3 +230,80 @@ def pbGetSeasonName(season)
_INTL("Autumn"),
_INTL("Winter")][season]
end
#===============================================================================
# Moon phases and Zodiac
#===============================================================================
# Calculates the phase of the moon.
# 0 - New Moon
# 1 - Waxing Crescent
# 2 - First Quarter
# 3 - Waxing Gibbous
# 4 - Full Moon
# 5 - Waning Gibbous
# 6 - Last Quarter
# 7 - Waning Crescent
def moonphase(time = nil) # in UTC
time = pbGetTimeNow if !time
transitions = [
1.8456618033125,
5.5369854099375,
9.2283090165625,
12.9196326231875,
16.6109562298125,
20.3022798364375,
23.9936034430625,
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 > 2_299_160
j += (((time.hour * 60) + (time.min * 60)) + time.sec) / 86_400.0
v = (j - 2_451_550.1) / 29.530588853
v = ((v - v.floor) + (v < 0 ? 1 : 0))
ag = v * 29.53
transitions.length.times do |i|
return i if ag <= transitions[i]
end
return 0
end
# Calculates the zodiac sign based on the given month and day:
# 0 is Aries, 11 is Pisces. Month is 1 if January, and so on.
def zodiac(month, day)
time = [
3, 21, 4, 19, # Aries
4, 20, 5, 20, # Taurus
5, 21, 6, 20, # Gemini
6, 21, 7, 20, # Cancer
7, 23, 8, 22, # Leo
8, 23, 9, 22, # Virgo
9, 23, 10, 22, # Libra
10, 23, 11, 21, # Scorpio
11, 22, 12, 21, # Sagittarius
12, 22, 1, 19, # Capricorn
1, 20, 2, 18, # Aquarius
2, 19, 3, 20 # Pisces
]
(time.length / 4).times do |i|
return i if month == time[i * 4] && day >= time[(i * 4) + 1]
return i if month == time[(i * 4) + 2] && day <= time[(i * 4) + 3]
end
return 0
end
# Returns the opposite of the given zodiac sign.
# 0 is Aries, 11 is Pisces.
def zodiacOpposite(sign)
return (sign + 6) % 12
end
# 0 is Aries, 11 is Pisces.
def zodiacPartners(sign)
return [(sign + 4) % 12, (sign + 8) % 12]
end
# 0 is Aries, 11 is Pisces.
def zodiacComplements(sign)
return [(sign + 1) % 12, (sign + 11) % 12]
end

View File

@@ -33,8 +33,9 @@ module HiddenMoveHandlers
end
end
#===============================================================================
#
#===============================================================================
def pbCanUseHiddenMove?(pkmn, move, showmsg = true)
return HiddenMoveHandlers.triggerCanUseMove(move, pkmn, showmsg)
end
@@ -62,8 +63,6 @@ def pbCheckHiddenMoveBadge(badge = -1, showmsg = true)
return false
end
#===============================================================================
# Hidden move animation
#===============================================================================
@@ -184,8 +183,6 @@ def pbHiddenMoveAnimation(pokemon)
return true
end
#===============================================================================
# Cut
#===============================================================================
@@ -247,8 +244,6 @@ def pbSmashEvent(event)
$PokemonMap&.addErasedEvent(event.id)
end
#===============================================================================
# Dig
#===============================================================================
@@ -294,8 +289,6 @@ HiddenMoveHandlers::UseMove.add(:DIG, proc { |move, pokemon|
next false
})
#===============================================================================
# Dive
#===============================================================================
@@ -460,8 +453,6 @@ HiddenMoveHandlers::UseMove.add(:DIVE, proc { |move, pokemon|
next true
})
#===============================================================================
# Flash
#===============================================================================
@@ -497,8 +488,6 @@ HiddenMoveHandlers::UseMove.add(:FLASH, proc { |move, pokemon|
next true
})
#===============================================================================
# Fly
#===============================================================================
@@ -560,8 +549,6 @@ HiddenMoveHandlers::UseMove.add(:FLY, proc { |move, pkmn|
next true
})
#===============================================================================
# Headbutt
#===============================================================================
@@ -626,8 +613,6 @@ HiddenMoveHandlers::UseMove.add(:HEADBUTT, proc { |move, pokemon|
pbHeadbuttEffect(facingEvent)
})
#===============================================================================
# Rock Smash
#===============================================================================
@@ -678,8 +663,6 @@ HiddenMoveHandlers::UseMove.add(:ROCKSMASH, proc { |move, pokemon|
next true
})
#===============================================================================
# Strength
#===============================================================================
@@ -731,8 +714,6 @@ HiddenMoveHandlers::UseMove.add(:STRENGTH, proc { |move, pokemon|
next true
})
#===============================================================================
# Surf
#===============================================================================
@@ -845,8 +826,6 @@ HiddenMoveHandlers::UseMove.add(:SURF, proc { |move, pokemon|
next true
})
#===============================================================================
# Sweet Scent
#===============================================================================
@@ -896,8 +875,6 @@ HiddenMoveHandlers::UseMove.add(:SWEETSCENT, proc { |move, pokemon|
next true
})
#===============================================================================
# Teleport
#===============================================================================
@@ -951,8 +928,6 @@ HiddenMoveHandlers::UseMove.add(:TELEPORT, proc { |move, pokemon|
next true
})
#===============================================================================
# Waterfall
#===============================================================================

View File

@@ -50,7 +50,7 @@ module RandomDungeon
def initialize(cw, ch, parameters)
raise ArgumentError.new if cw == 0 || ch == 0
@node_count_x = cw
@node_count_x = cw
@node_count_y = ch
@parameters = parameters
@nodes = Array.new(@node_count_x * @node_count_y) { MazeNode.new }
@@ -257,7 +257,7 @@ module RandomDungeon
:upper_wall_in_1 => Console.markup_style("~", bg: :gray),
:upper_wall_in_3 => Console.markup_style("~", bg: :gray),
:upper_wall_in_7 => Console.markup_style("~", bg: :gray),
:upper_wall_in_9 => Console.markup_style("~", bg: :gray),
:upper_wall_in_9 => Console.markup_style("~", bg: :gray)
}
def initialize(width, height)
@@ -352,7 +352,7 @@ module RandomDungeon
@buffer_x += 1 if @buffer_x.odd?
@buffer_y += 1 if @buffer_x.odd?
end
@parameters = parameters || GameData::DungeonParameters.new({})
@parameters = parameters || GameData::DungeonParameters.new({})
if @tileset.snap_to_large_grid
@parameters.cell_width -= 1 if @parameters.cell_width.odd?
@parameters.cell_height -= 1 if @parameters.cell_height.odd?
@@ -443,7 +443,7 @@ module RandomDungeon
paint_decorations(maxWidth, maxHeight)
# Draw wall top tiles
paint_wall_top_tiles(maxWidth, maxHeight)
break #if !@need_redraw
break # if !@need_redraw
end
end
@@ -801,8 +801,8 @@ module RandomDungeon
x += 1 if x.odd?
y += 1 if y.odd?
end
x = x.clamp(@buffer_x, @usable_width - @buffer_x - width )
y = y.clamp(@buffer_y, @usable_height - @buffer_y - height )
x = x.clamp(@buffer_x, @usable_width - @buffer_x - width)
y = y.clamp(@buffer_y, @usable_height - @buffer_y - height)
paint_ground_rect(x, y, width, height, :room)
end
@@ -927,7 +927,7 @@ module RandomDungeon
end
end
# 1x1 floor decoration
if @tileset.has_decoration?(:floor_decoration)
if @tileset.has_decoration?(:floor_decoration)
((@usable_width * @usable_height) / @parameters.floor_decoration_density).times do
x = rand(@usable_width)
y = rand(@usable_height)