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
pkmn.ability2_index = secondary_ability_index
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
pkmn.gender = pkmn_data[:gender] || ((trainer.male?) ? 0 : 1)

View File

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

View File

@@ -61,6 +61,8 @@ class PokeBattle_Scene
# Ability splash bars
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
@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
# Player's and partner trainer's back sprite

View File

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

Binary file not shown.