double abilities splash

This commit is contained in:
infinitefusion
2023-05-27 12:37:08 -04:00
parent 39f9bc5472
commit 1182afbea3
10 changed files with 227 additions and 233 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -330,9 +330,7 @@ module GameData
secondary_ability_index = pkmn.ability_index == 0 ? 1 : 0 secondary_ability_index = pkmn.ability_index == 0 ? 1 : 0
pkmn.ability2_index = secondary_ability_index pkmn.ability2_index = secondary_ability_index
pkmn.ability2 = pkmn.getAbilityList[secondary_ability_index][0] pkmn.ability2 = pkmn.getAbilityList[secondary_ability_index][0]
#print _INTL("Primary: {1}, Secondary: {2}",pkmn.ability.id, pkmn.ability2.id)
print _INTL("Primary: {1}, Secondary: {2}",pkmn.ability.id, pkmn.ability2.id)
end end
pkmn.gender = pkmn_data[:gender] || ((trainer.male?) ? 0 : 1) pkmn.gender = pkmn_data[:gender] || ((trainer.male?) ? 0 : 1)

View File

@@ -228,14 +228,21 @@ end
# Makes a Pokémon's ability bar appear # Makes a Pokémon's ability bar appear
#=============================================================================== #===============================================================================
class AbilitySplashAppearAnimation < PokeBattle_Animation class AbilitySplashAppearAnimation < PokeBattle_Animation
def initialize(sprites,viewport,side) def initialize(sprites,viewport,side,secondAbility=false)
@secondAbility=secondAbility
@side = side @side = side
super(sprites,viewport) super(sprites,viewport)
end end
def createProcesses def createProcesses
if @secondAbility
return if !@sprites["ability2Bar_#{@side}"]
bar = addSprite(@sprites["ability2Bar_#{@side}"])
else
return if !@sprites["abilityBar_#{@side}"] return if !@sprites["abilityBar_#{@side}"]
bar = addSprite(@sprites["abilityBar_#{@side}"]) bar = addSprite(@sprites["abilityBar_#{@side}"])
end
bar.setVisible(0,true) bar.setVisible(0,true)
dir = (@side==0) ? 1 : -1 dir = (@side==0) ? 1 : -1
bar.moveDelta(0,8,dir*Graphics.width/2,0) bar.moveDelta(0,8,dir*Graphics.width/2,0)

View File

@@ -25,6 +25,7 @@ class PokemonDataBox < SpriteWrapper
FEMALE_BASE_COLOR = Color.new(248,88,40) FEMALE_BASE_COLOR = Color.new(248,88,40)
FEMALE_SHADOW_COLOR = NAME_SHADOW_COLOR FEMALE_SHADOW_COLOR = NAME_SHADOW_COLOR
def initialize(battler,sideSize,viewport=nil) def initialize(battler,sideSize,viewport=nil)
super(viewport) super(viewport)
@battler = battler @battler = battler
@@ -54,8 +55,7 @@ class PokemonDataBox < SpriteWrapper
@showHP = true @showHP = true
@showExp = true @showExp = true
end end
else else # Multiple Pokémon on side, use the thin dara box BG
# Multiple Pokémon on side, use the thin dara box BG
bgFilename = ["Graphics/Pictures/Battle/databox_thin", bgFilename = ["Graphics/Pictures/Battle/databox_thin",
"Graphics/Pictures/Battle/databox_thin_foe"][@battler.index%2] "Graphics/Pictures/Battle/databox_thin_foe"][@battler.index%2]
end end
@@ -363,10 +363,8 @@ class PokemonDataBox < SpriteWrapper
# Data box bobbing while Pokémon is selected # Data box bobbing while Pokémon is selected
if @selected==1 || @selected==2 # Choosing commands/targeted or damaged if @selected==1 || @selected==2 # Choosing commands/targeted or damaged
case (frameCounter/QUARTER_ANIM_PERIOD).floor case (frameCounter/QUARTER_ANIM_PERIOD).floor
when 1 then when 1 then self.y = @spriteY-2
self.y = @spriteY - 2 when 3 then self.y = @spriteY+2
when 3 then
self.y = @spriteY + 2
end end
end end
end end
@@ -383,6 +381,8 @@ class PokemonDataBox < SpriteWrapper
end end
end end
#=============================================================================== #===============================================================================
# Splash bar to announce a triggered ability # Splash bar to announce a triggered ability
#=============================================================================== #===============================================================================
@@ -392,8 +392,9 @@ class AbilitySplashBar < SpriteWrapper
TEXT_BASE_COLOR = Color.new(0,0,0) TEXT_BASE_COLOR = Color.new(0,0,0)
TEXT_SHADOW_COLOR = Color.new(248,248,248) TEXT_SHADOW_COLOR = Color.new(248,248,248)
def initialize(side, viewport = nil) def initialize(side,viewport=nil, secondAbility=false)
super(viewport) super(viewport)
@secondAbility=secondAbility
@side = side @side = side
@battler = nil @battler = nil
# Create sprite wrapper that displays background graphic # Create sprite wrapper that displays background graphic
@@ -455,6 +456,9 @@ class AbilitySplashBar < SpriteWrapper
refresh refresh
end end
def secondAbility=(value)
@secondAbility = value
end
def refresh def refresh
self.bitmap.clear self.bitmap.clear
return if !@battler return if !@battler
@@ -462,14 +466,11 @@ class AbilitySplashBar < SpriteWrapper
textX = (@side==0) ? 10 : self.bitmap.width-8 textX = (@side==0) ? 10 : self.bitmap.width-8
# Draw Pokémon's name # Draw Pokémon's name
textPos.push([_INTL("{1}'s",@battler.name),textX,-4,@side==1, textPos.push([_INTL("{1}'s",@battler.name),textX,-4,@side==1,
TEXT_BASE_COLOR, TEXT_SHADOW_COLOR, true]) TEXT_BASE_COLOR,TEXT_SHADOW_COLOR,true]) if !@secondAbility
# Draw Pokémon's ability # Draw Pokémon's ability
text = @battler.abilityName abilityName = @secondAbility ? @battler.ability2Name : @battler.abilityName
if $game_switches[SWITCH_DOUBLE_ABILITIES] #return if abilityName ==""
text = _INTL("{1},{2}", @battler.abilityName, @battler.ability2Name) textPos.push([abilityName,textX,26,@side==1,
end
textPos.push([text, textX, 26, @side == 1,
TEXT_BASE_COLOR,TEXT_SHADOW_COLOR,true]) TEXT_BASE_COLOR,TEXT_SHADOW_COLOR,true])
pbDrawTextPositions(self.bitmap,textPos) pbDrawTextPositions(self.bitmap,textPos)
end end
@@ -480,6 +481,8 @@ class AbilitySplashBar < SpriteWrapper
end end
end end
#=============================================================================== #===============================================================================
# Pokémon sprite (used in battle) # Pokémon sprite (used in battle)
#=============================================================================== #===============================================================================
@@ -516,13 +519,8 @@ class PokemonBattlerSprite < RPG::Sprite
super super
end end
def x def x; return @spriteX; end
return @spriteX; def y; return @spriteY; end
end
def y
return @spriteY;
end
def x=(value) def x=(value)
@spriteX = value @spriteX = value
@@ -536,13 +534,8 @@ class PokemonBattlerSprite < RPG::Sprite
super(value+@spriteYExtra) super(value+@spriteYExtra)
end end
def width def width; return (self.bitmap) ? self.bitmap.width : 0; end
return (self.bitmap) ? self.bitmap.width : 0; def height; return (self.bitmap) ? self.bitmap.height : 0; end
end
def height
return (self.bitmap) ? self.bitmap.height : 0;
end
def visible=(value) def visible=(value)
@spriteVisible = value if !@updating # For selection/targeting flashing @spriteVisible = value if !@updating # For selection/targeting flashing
@@ -610,10 +603,8 @@ class PokemonBattlerSprite < RPG::Sprite
@spriteYExtra = 0 @spriteYExtra = 0
if @selected==1 # When choosing commands for this Pokémon if @selected==1 # When choosing commands for this Pokémon
case (frameCounter/QUARTER_ANIM_PERIOD).floor case (frameCounter/QUARTER_ANIM_PERIOD).floor
when 1 then when 1 then @spriteYExtra = 2
@spriteYExtra = 2 when 3 then @spriteYExtra = -2
when 3 then
@spriteYExtra = -2
end end
end end
self.x = self.x self.x = self.x
@@ -622,16 +613,16 @@ class PokemonBattlerSprite < RPG::Sprite
# Pokémon sprite blinking when targeted # Pokémon sprite blinking when targeted
if @selected==2 && @spriteVisible if @selected==2 && @spriteVisible
case (frameCounter/SIXTH_ANIM_PERIOD).floor case (frameCounter/SIXTH_ANIM_PERIOD).floor
when 2, 5 then when 2, 5 then self.visible = false
self.visible = false else self.visible = true
else
self.visible = true
end end
end end
@updating = false @updating = false
end end
end end
#=============================================================================== #===============================================================================
# Shadow sprite for Pokémon (used in battle) # Shadow sprite for Pokémon (used in battle)
#=============================================================================== #===============================================================================
@@ -656,13 +647,8 @@ class PokemonBattlerShadowSprite < RPG::Sprite
super super
end end
def width def width; return (self.bitmap) ? self.bitmap.width : 0; end
return (self.bitmap) ? self.bitmap.width : 0; def height; return (self.bitmap) ? self.bitmap.height : 0; end
end
def height
return (self.bitmap) ? self.bitmap.height : 0;
end
# Set sprite's origin to centre # Set sprite's origin to centre
def pbSetOrigin def pbSetOrigin

View File

@@ -61,6 +61,8 @@ class PokeBattle_Scene
# Ability splash bars # Ability splash bars
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
@sprites["abilityBar_#{side}"] = AbilitySplashBar.new(side,@viewport) @sprites["abilityBar_#{side}"] = AbilitySplashBar.new(side,@viewport)
@sprites["ability2Bar_#{side}"] = AbilitySplashBar.new(side,@viewport,true) if $game_switches[SWITCH_DOUBLE_ABILITIES]
@sprites["ability2Bar_#{side}"].y = @sprites["ability2Bar_#{side}"].y+30
end end
end end
# Player's and partner trainer's back sprite # Player's and partner trainer's back sprite

View File

@@ -173,7 +173,7 @@ class PokeBattle_Scene
#============================================================================= #=============================================================================
# Ability splash bar animations # Ability splash bar animations
#============================================================================= #=============================================================================
def pbShowAbilitySplash(battler,ability_name=nil) def pbShowAbilitySplash(battler)
return if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH return if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
side = battler.index%2 side = battler.index%2
pbHideAbilitySplash(battler) if @sprites["abilityBar_#{side}"].visible pbHideAbilitySplash(battler) if @sprites["abilityBar_#{side}"].visible
@@ -188,6 +188,7 @@ class PokeBattle_Scene
end end
def pbHideAbilitySplash(battler) def pbHideAbilitySplash(battler)
return if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH return if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
side = battler.index%2 side = battler.index%2

Binary file not shown.