Refactored some code relating to colours, trivially simplified some calculations

This commit is contained in:
Maruno17
2022-08-13 23:59:24 +01:00
parent aa9b1a9e23
commit b1cde2db42
42 changed files with 294 additions and 250 deletions

View File

@@ -69,7 +69,7 @@ class DarknessSprite < Sprite
end
def refresh
@darkness.fill_rect(0, 0, Graphics.width, Graphics.height, Color.new(0, 0, 0, 255))
@darkness.fill_rect(0, 0, Graphics.width, Graphics.height, Color.black)
cx = Graphics.width / 2
cy = Graphics.height / 2
cradius = @radius

View File

@@ -138,7 +138,7 @@ def pbBattleAnimation(bgm = nil, battletype = 0, foe = nil)
$PokemonGlobal.nextBattleBack = nil
$PokemonEncounters.reset_step_count
# Fade back to the overworld in 0.4 seconds
viewport.color = Color.new(0, 0, 0, 255)
viewport.color = Color.black
timer = 0.0
loop do
Graphics.update
@@ -179,7 +179,7 @@ def pbBattleAnimationCore(anim, viewport, location, num_flashes = 2)
$game_temp.background_bitmap = Graphics.snap_to_bitmap
# Play main animation
Graphics.freeze
viewport.color = Color.new(0, 0, 0, 255) # Ensure screen is black
viewport.color = Color.black # Ensure screen is black
Graphics.transition(25, "Graphics/Transitions/" + anim)
# Slight pause after animation before starting up the battle scene
pbWait(Graphics.frame_rate / 10)
@@ -421,7 +421,7 @@ SpecialBattleIntroAnimations.register("alternate_vs_trainer_animation", 50, #
viewvs.dispose
viewopp.dispose
viewplayer.dispose
viewport.color = Color.new(0, 0, 0, 255) # Ensure screen is black
viewport.color = Color.black # Ensure screen is black
}
)

View File

@@ -81,8 +81,8 @@ def pbHiddenMoveAnimation(pokemon)
strobebitmap = AnimatedBitmap.new("Graphics/Pictures/hiddenMoveStrobes")
strobes = []
15.times do |i|
strobe = BitmapSprite.new(26 * 2, 8 * 2, viewport)
strobe.bitmap.blt(0, 0, strobebitmap.bitmap, Rect.new(0, (i % 2) * 8 * 2, 26 * 2, 8 * 2))
strobe = BitmapSprite.new(52, 16, viewport)
strobe.bitmap.blt(0, 0, strobebitmap.bitmap, Rect.new(0, (i % 2) * 16, 52, 16))
strobe.z = (i.even? ? 2 : 0)
strobe.visible = false
strobes.push(strobe)