Fixed event movement checks ignoring ledges if they're not on the top layer, fixed Sketch not working, fixed a couple of other minor bugs, Rubocop-suggested tweaks

This commit is contained in:
Maruno17
2021-05-09 16:48:47 +01:00
parent 326e2e7929
commit 05d3627015
21 changed files with 21 additions and 50 deletions

View File

@@ -24,8 +24,6 @@ class Game_Temp
attr_accessor :to_title # return to title screen flag
attr_accessor :fadestate # for sprite hashes
attr_accessor :background_bitmap
attr_accessor :message_window_showing
attr_accessor :transition_processing
attr_accessor :mart_prices
#-----------------------------------------------------------------------------
# * Object Initialization

View File

@@ -205,8 +205,9 @@ class Game_Map
for j in [2, 1, 0]
facing_tile_id = data[newx, newy, j]
return false if facing_tile_id == nil
return false if GameData::TerrainTag.try_get(@terrain_tags[facing_tile_id]).ledge
break
facing_terrain = GameData::TerrainTag.try_get(@terrain_tags[facing_tile_id])
return false if facing_terrain.ledge
break if facing_terrain.id != :None && !facing_terrain.ignore_passability
end
end
# Regular passability checks

View File

@@ -30,13 +30,11 @@ class PokemonMapFactory
@mapIndex = 0 if !@mapIndex || @mapIndex<0
return @maps[@mapIndex] if @maps[@mapIndex]
raise "No maps in save file... (mapIndex=#{@mapIndex})" if @maps.length==0
for i in 0...@maps.length
if @maps[i]
echoln("Using next map, may be incorrect (mapIndex=#{@mapIndex}, length=#{@maps.length})")
return @maps[i]
end
raise "No maps in save file... (all maps empty; mapIndex=#{@mapIndex})"
if @maps[0]
echoln("Using next map, may be incorrect (mapIndex=#{@mapIndex}, length=#{@maps.length})")
return @maps[0]
end
raise "No maps in save file... (all maps empty; mapIndex=#{@mapIndex})"
end
def hasMap?(id)
@@ -256,7 +254,7 @@ class PokemonMapFactory
posX = thisX + conn[1] - conn[4] + otherX
posY = thisY + conn[2] - conn[5] + otherY
return [posX, posY]
else
elsif conn[1] == otherMapID
posX = thisX + conn[4] - conn[1] + otherX
posY = thisY + conn[5] - conn[2] + otherY
return [posX, posY]

View File

@@ -303,8 +303,6 @@ class DependentEvents
newFollower.moveto(mapTile[1],mapTile[2])
newEventData[3]=mapTile[1]
newEventData[4]=mapTile[2]
if mapTile[0]==leader.map.map_id
end
end
end
end

View File

@@ -66,10 +66,10 @@ class Sprite_Shadow < RPG::Sprite
sy = (@character.direction - 2) / 2 * @ch
if self.angle > 90 || angle < -90
case @character.direction
when 2 then sy = (8- 2) / 2 * @ch
when 4 then sy = (6- 2) / 2 * @ch
when 6 then sy = (4- 2) / 2 * @ch
when 8 then sy = (2- 2) / 2 * @ch
when 2 then sy = @ch * 3
when 4 then sy = @ch * 2
when 6 then sy = @ch
when 8 then sy = 0
end
end
self.src_rect.set(sx, sy, @cw, @ch)

View File

@@ -226,9 +226,9 @@ class GifBitmap
@gifbitmaps = [bitmap]
@gifdelays = [1]
else
=begin
tmpBase = File.basename(full_path) + "_tmp_"
filestring = pbGetFileString(filestrName) if filestring
=begin
Dir.chdir(ENV["TEMP"]) { # navigate to temp folder since game might be on a CD-ROM
if filestring && filestring[0] == 0x47 && GifLibrary::PngDll
result = GifLibrary::GifToPngFilesInMemory.call(filestring,

View File

@@ -174,8 +174,6 @@ class ColoredPlane < LargePlane
super
end
def update; super; end
def setPlaneColor(value)
self.bitmap.fill_rect(0,0,self.bitmap.width,self.bitmap.height,value)
self.refresh

View File

@@ -4,7 +4,6 @@
class Scene_Map
def updatemini
oldmws=$game_temp.message_window_showing
oldvis=false
$game_temp.message_window_showing=true
loop do
$game_map.update
@@ -619,7 +618,6 @@ def pbMessageDisplay(msgwindow,message,letterbyletter=true,commandProc=nil)
controls[i][2] = textlen
end
text = textchunks.join("")
unformattedText = toUnformattedText(text)
signWaitCount = 0
signWaitTime = Graphics.frame_rate/2
haveSpecialClose = false

View File

@@ -38,9 +38,6 @@ def oggfiletime(file)
fgetdw = proc { |file|
(file.eof? ? 0 : (file.read(4).unpack("V")[0] || 0))
}
fgetw = proc { |file|
(file.eof? ? 0 : (file.read(2).unpack("v")[0] || 0))
}
pages = []
page = nil
loop do

View File

@@ -1752,7 +1752,7 @@ class PokeBattle_Move_05D < PokeBattle_Move
if !lastMoveData ||
user.pbHasMove?(target.lastRegularMoveUsed) ||
@moveBlacklist.include?(lastMoveData.function_code) ||
lastMoveData.type = :SHADOW
lastMoveData.type == :SHADOW
@battle.pbDisplay(_INTL("But it failed!"))
return true
end

View File

@@ -88,7 +88,6 @@ class PokeBattle_Battle
def pbChoseMoveFunctionCode?(idxBattler,code)
return false if @battlers[idxBattler].fainted?
idxMove = @choices[idxBattler][1]
if @choices[idxBattler][0]==:UseMove && @choices[idxBattler][1]
return @choices[idxBattler][2].function == code
end

View File

@@ -322,10 +322,6 @@ module RPG
def update_tile_position(sprite, index)
return if !sprite || !sprite.bitmap || !sprite.visible
weather_type = @type
if @fading && @fade_time >= [FADE_OLD_TONE_END - @time_shift, 0].max
weather_type = @target_type
end
sprite.x = (@ox + @tile_x + (index % @tiles_wide) * sprite.bitmap.width).round
sprite.y = (@oy + @tile_y + (index / @tiles_wide) * sprite.bitmap.height).round
sprite.x += @tiles_wide * sprite.bitmap.width if sprite.x - @ox < -sprite.bitmap.width

View File

@@ -485,7 +485,6 @@ def pbTrainerBattle(trainerID, trainerName, endSpeech=nil,
setBattleRule("double") if doubleBattle || $PokemonTemp.waitingTrainer
# Perform the battle
if $PokemonTemp.waitingTrainer
waitingTrainer = $PokemonTemp.waitingTrainer
decision = pbTrainerBattleCore($PokemonTemp.waitingTrainer,
[trainerID,trainerName,trainerPartyID,endSpeech]
)

View File

@@ -346,8 +346,7 @@ class Maze
end
end
def generateWallGrowthMaze(minWall = nil, maxWall = nil)
minWall = 0 if !minWall
def generateWallGrowthMaze(minWall = 0, maxWall = nil)
maxWall = cellWidth if !maxWall
nlist = buildNodeList()
return if nlist.length == 0

View File

@@ -135,7 +135,6 @@ def pbPokeRadarGetEncounter(rarity = 0)
# If there are any exclusives, first have a chance of encountering those
if array.length > 0
rnd = rand(100)
chance = 0
array.each do |enc|
rnd -= enc[1]
next if rnd >= 0

View File

@@ -413,9 +413,9 @@ class PokemonMart_Scene
itemprice = @adapter.getPrice(item, !@buying)
itemprice /= 2 if !@buying
pbDisplay(helptext, true)
using (numwindow = Window_AdvancedTextPokemon.new("")) { # Showing number of items
using(numwindow = Window_AdvancedTextPokemon.new("")) { # Showing number of items
qty = @adapter.getQuantity(item)
using (inbagwindow = Window_AdvancedTextPokemon.new("")) { # Showing quantity in bag
using(inbagwindow = Window_AdvancedTextPokemon.new("")) { # Showing quantity in bag
pbPrepareWindow(numwindow)
pbPrepareWindow(inbagwindow)
numwindow.viewport = @viewport

View File

@@ -84,7 +84,6 @@ end
#===============================================================================
class PurifyChamberSet
attr_reader :shadow # The Shadow Pokémon in the middle
attr_reader :list # The other Pokémon placed around
attr_reader :facing # Index in list of Pokémon the Shadow Pokémon is facing
def partialSum(x)
@@ -596,8 +595,8 @@ class PurifyChamberScreen
if @chamber.isPurifiable?(set) # if ready for purification
purifiables.push(set)
end
return purifiables.length>0
end
return purifiables.length>0
end
def pbDoPurify

View File

@@ -250,7 +250,6 @@ def pbGenerateChallenge(rule, tag)
yield(nil)
if gameCount / teams.length >= 12
for team in teams
games = team.games
team.updateRating
end
break

View File

@@ -340,7 +340,7 @@ def pbRandomPokemonFromRule(rules, trainer)
break
end
end
if item == :LIGHTCLAY && !moves.any? { |m| m == :LIGHTSCREEN || m = :REFLECT }
if item == :LIGHTCLAY && !moves.any? { |m| m == :LIGHTSCREEN || m == :REFLECT }
item = :LEFTOVERS
end
if item == :BLACKSLUDGE

View File

@@ -141,7 +141,7 @@ def pbTrackPopupMenu(commands)
menuwindow.update
hit=menuwindow.hittest
menuwindow.index=hit if hit>=0
if Input.trigger?(Input::MOUSELEFT) || Input.trigger?(Input::MOUSELEFT) # Left or right button
if Input.trigger?(Input::MOUSELEFT) || Input.trigger?(Input::MOUSERIGHT) # Left or right button
menuwindow.dispose
return hit
end
@@ -349,13 +349,6 @@ class InvalidatableSprite < Sprite
# the sprite is invalid, to allow it to be explicitly called.
def refresh
end
# Updates the logic on the sprite, for example, in response
# to user input, and invalidates it if necessary. This should
# be called only once per frame.
def update
super
end
end

View File

@@ -140,7 +140,7 @@ module Compiler
f.write("\#-------------------------------\r\n")
f.write("[#{type.id_number}]\r\n")
f.write("Name = #{type.real_name}\r\n")
f.write("InternalName = #{type.id.to_s}\r\n")
f.write("InternalName = #{type.id}\r\n")
f.write("IsPseudoType = true\r\n") if type.pseudo_type
f.write("IsSpecialType = true\r\n") if type.special?
f.write("Weaknesses = #{type.weaknesses.join(",")}\r\n") if type.weaknesses.length > 0