mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Double abilities
This commit is contained in:
Binary file not shown.
@@ -325,6 +325,16 @@ module GameData
|
|||||||
end
|
end
|
||||||
pkmn.ability_index = pkmn_data[:ability_index]
|
pkmn.ability_index = pkmn_data[:ability_index]
|
||||||
pkmn.ability = pkmn_data[:ability]
|
pkmn.ability = pkmn_data[:ability]
|
||||||
|
|
||||||
|
if $game_switches[SWITCH_DOUBLE_ABILITIES] && pkmn.isFusion?
|
||||||
|
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)
|
||||||
|
end
|
||||||
|
|
||||||
pkmn.gender = pkmn_data[:gender] || ((trainer.male?) ? 0 : 1)
|
pkmn.gender = pkmn_data[:gender] || ((trainer.male?) ? 0 : 1)
|
||||||
pkmn.shiny = (pkmn_data[:shininess]) ? true : false
|
pkmn.shiny = (pkmn_data[:shininess]) ? true : false
|
||||||
if pkmn_data[:nature]
|
if pkmn_data[:nature]
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class PokeBattle_Battler
|
|||||||
@hp = @totalhp = 0
|
@hp = @totalhp = 0
|
||||||
@type1 = @type2 = nil
|
@type1 = @type2 = nil
|
||||||
@ability_id = nil
|
@ability_id = nil
|
||||||
|
@ability2_id = nil
|
||||||
@item_id = nil
|
@item_id = nil
|
||||||
@gender = 0
|
@gender = 0
|
||||||
@attack = @defense = @spatk = @spdef = @speed = 0
|
@attack = @defense = @spatk = @spdef = @speed = 0
|
||||||
@@ -81,6 +82,7 @@ class PokeBattle_Battler
|
|||||||
@type1 = pkmn.type1
|
@type1 = pkmn.type1
|
||||||
@type2 = pkmn.type2
|
@type2 = pkmn.type2
|
||||||
@ability_id = pkmn.ability_id
|
@ability_id = pkmn.ability_id
|
||||||
|
@ability2_id = pkmn.ability2_id
|
||||||
@item_id = pkmn.item_id
|
@item_id = pkmn.item_id
|
||||||
@gender = pkmn.gender
|
@gender = pkmn.gender
|
||||||
@attack = pkmn.attack
|
@attack = pkmn.attack
|
||||||
|
|||||||
@@ -283,6 +283,7 @@ class PokeBattle_Battler
|
|||||||
@effects[PBEffects::TransformSpecies] = target.species
|
@effects[PBEffects::TransformSpecies] = target.species
|
||||||
pbChangeTypes(target)
|
pbChangeTypes(target)
|
||||||
self.ability = target.ability
|
self.ability = target.ability
|
||||||
|
self.ability2 = target.ability2 if target.ability2
|
||||||
@attack = target.attack
|
@attack = target.attack
|
||||||
@defense = target.defense
|
@defense = target.defense
|
||||||
@spatk = target.spatk
|
@spatk = target.spatk
|
||||||
|
|||||||
@@ -2,8 +2,9 @@ class PokeBattle_Battler
|
|||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Effect per hit
|
# Effect per hit
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
def pbEffectsOnMakingHit(move,user,target)
|
#
|
||||||
if target.damageState.calcDamage>0 && !target.damageState.substitute
|
|
||||||
|
def triggerAbilityEffectsOnHit(move,user,target)
|
||||||
# Target's ability
|
# Target's ability
|
||||||
if target.abilityActive?(true)
|
if target.abilityActive?(true)
|
||||||
oldHP = user.hp
|
oldHP = user.hp
|
||||||
@@ -15,6 +16,11 @@ class PokeBattle_Battler
|
|||||||
BattleHandlers.triggerUserAbilityOnHit(user.ability,user,target,move,@battle)
|
BattleHandlers.triggerUserAbilityOnHit(user.ability,user,target,move,@battle)
|
||||||
user.pbItemHPHealCheck
|
user.pbItemHPHealCheck
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def pbEffectsOnMakingHit(move,user,target)
|
||||||
|
if target.damageState.calcDamage>0 && !target.damageState.substitute
|
||||||
|
triggerAbilityEffectsOnHit(move,user,target)
|
||||||
# Target's item
|
# Target's item
|
||||||
if target.itemActive?(true)
|
if target.itemActive?(true)
|
||||||
oldHP = user.hp
|
oldHP = user.hp
|
||||||
@@ -92,6 +98,7 @@ class PokeBattle_Battler
|
|||||||
# User's ability
|
# User's ability
|
||||||
if user.abilityActive?
|
if user.abilityActive?
|
||||||
BattleHandlers.triggerUserAbilityEndOfMove(user.ability,user,targets,move,@battle)
|
BattleHandlers.triggerUserAbilityEndOfMove(user.ability,user,targets,move,@battle)
|
||||||
|
BattleHandlers.triggerUserAbilityEndOfMove(user.ability2,user,targets,move,@battle) if user.ability2
|
||||||
end
|
end
|
||||||
# Greninja - Battle Bond
|
# Greninja - Battle Bond
|
||||||
if !user.fainted? && !user.effects[PBEffects::Transform] &&
|
if !user.fainted? && !user.effects[PBEffects::Transform] &&
|
||||||
@@ -161,6 +168,7 @@ class PokeBattle_Battler
|
|||||||
next if b.damageState.unaffected || switchedBattlers.include?(b.index)
|
next if b.damageState.unaffected || switchedBattlers.include?(b.index)
|
||||||
next if !b.abilityActive?
|
next if !b.abilityActive?
|
||||||
BattleHandlers.triggerTargetAbilityAfterMoveUse(b.ability,b,user,move,switchedBattlers,@battle)
|
BattleHandlers.triggerTargetAbilityAfterMoveUse(b.ability,b,user,move,switchedBattlers,@battle)
|
||||||
|
BattleHandlers.triggerTargetAbilityAfterMoveUse(b.ability2,b,user,move,switchedBattlers,@battle) if b.ability2
|
||||||
if !switchedBattlers.include?(b.index) && move.damagingMove?
|
if !switchedBattlers.include?(b.index) && move.damagingMove?
|
||||||
if b.pbAbilitiesOnDamageTaken(b.damageState.initialHP) # Emergency Exit, Wimp Out
|
if b.pbAbilitiesOnDamageTaken(b.damageState.initialHP) # Emergency Exit, Wimp Out
|
||||||
switchWimpOut.push(b.index)
|
switchWimpOut.push(b.index)
|
||||||
|
|||||||
@@ -767,6 +767,8 @@ class PokeBattle_Battle
|
|||||||
@scene.pbCommonAnimation(name,user,targets) if @showAnims
|
@scene.pbCommonAnimation(name,user,targets) if @showAnims
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def pbShowAbilitySplash(battler,delay=false,logTrigger=true)
|
def pbShowAbilitySplash(battler,delay=false,logTrigger=true)
|
||||||
PBDebug.log("[Ability triggered] #{battler.pbThis}'s #{battler.abilityName}") if logTrigger
|
PBDebug.log("[Ability triggered] #{battler.pbThis}'s #{battler.abilityName}") if logTrigger
|
||||||
return if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
return if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||||
|
|||||||
@@ -18,15 +18,14 @@ class PokemonDataBox < SpriteWrapper
|
|||||||
# MALE_SHADOW_COLOR = NAME_SHADOW_COLOR
|
# MALE_SHADOW_COLOR = NAME_SHADOW_COLOR
|
||||||
# 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
|
||||||
NAME_BASE_COLOR = Color.new(255,255,255)
|
NAME_BASE_COLOR = Color.new(255, 255, 255)
|
||||||
NAME_SHADOW_COLOR = Color.new(32,32,32)
|
NAME_SHADOW_COLOR = Color.new(32, 32, 32)
|
||||||
MALE_BASE_COLOR = Color.new(48,96,216)
|
MALE_BASE_COLOR = Color.new(48, 96, 216)
|
||||||
MALE_SHADOW_COLOR = NAME_SHADOW_COLOR
|
MALE_SHADOW_COLOR = NAME_SHADOW_COLOR
|
||||||
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
|
||||||
@sprites = {}
|
@sprites = {}
|
||||||
@@ -46,18 +45,19 @@ class PokemonDataBox < SpriteWrapper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def initializeDataBoxGraphic(sideSize)
|
def initializeDataBoxGraphic(sideSize)
|
||||||
onPlayerSide = ((@battler.index%2)==0)
|
onPlayerSide = ((@battler.index % 2) == 0)
|
||||||
# Get the data box graphic and set whether the HP numbers/Exp bar are shown
|
# Get the data box graphic and set whether the HP numbers/Exp bar are shown
|
||||||
if sideSize==1 # One Pokémon on side, use the regular dara box BG
|
if sideSize == 1 # One Pokémon on side, use the regular dara box BG
|
||||||
bgFilename = ["Graphics/Pictures/Battle/databox_normal",
|
bgFilename = ["Graphics/Pictures/Battle/databox_normal",
|
||||||
"Graphics/Pictures/Battle/databox_normal_foe"][@battler.index%2]
|
"Graphics/Pictures/Battle/databox_normal_foe"][@battler.index % 2]
|
||||||
if onPlayerSide
|
if onPlayerSide
|
||||||
@showHP = true
|
@showHP = true
|
||||||
@showExp = true
|
@showExp = true
|
||||||
end
|
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",
|
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
|
||||||
@databoxBitmap = AnimatedBitmap.new(bgFilename)
|
@databoxBitmap = AnimatedBitmap.new(bgFilename)
|
||||||
# Determine the co-ordinates of the data box and the left edge padding width
|
# Determine the co-ordinates of the data box and the left edge padding width
|
||||||
@@ -86,23 +86,23 @@ class PokemonDataBox < SpriteWrapper
|
|||||||
@hpBarBitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Battle/overlay_hp"))
|
@hpBarBitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Battle/overlay_hp"))
|
||||||
@expBarBitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Battle/overlay_exp"))
|
@expBarBitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Battle/overlay_exp"))
|
||||||
# Create sprite to draw HP numbers on
|
# Create sprite to draw HP numbers on
|
||||||
@hpNumbers = BitmapSprite.new(124,16,viewport)
|
@hpNumbers = BitmapSprite.new(124, 16, viewport)
|
||||||
pbSetSmallFont(@hpNumbers.bitmap)
|
pbSetSmallFont(@hpNumbers.bitmap)
|
||||||
@sprites["hpNumbers"] = @hpNumbers
|
@sprites["hpNumbers"] = @hpNumbers
|
||||||
# Create sprite wrapper that displays HP bar
|
# Create sprite wrapper that displays HP bar
|
||||||
@hpBar = SpriteWrapper.new(viewport)
|
@hpBar = SpriteWrapper.new(viewport)
|
||||||
@hpBar.bitmap = @hpBarBitmap.bitmap
|
@hpBar.bitmap = @hpBarBitmap.bitmap
|
||||||
@hpBar.src_rect.height = @hpBarBitmap.height/3
|
@hpBar.src_rect.height = @hpBarBitmap.height / 3
|
||||||
@sprites["hpBar"] = @hpBar
|
@sprites["hpBar"] = @hpBar
|
||||||
# Create sprite wrapper that displays Exp bar
|
# Create sprite wrapper that displays Exp bar
|
||||||
@expBar = SpriteWrapper.new(viewport)
|
@expBar = SpriteWrapper.new(viewport)
|
||||||
@expBar.bitmap = @expBarBitmap.bitmap
|
@expBar.bitmap = @expBarBitmap.bitmap
|
||||||
@sprites["expBar"] = @expBar
|
@sprites["expBar"] = @expBar
|
||||||
# Create sprite wrapper that displays everything except the above
|
# Create sprite wrapper that displays everything except the above
|
||||||
@contents = BitmapWrapper.new(@databoxBitmap.width,@databoxBitmap.height)
|
@contents = BitmapWrapper.new(@databoxBitmap.width, @databoxBitmap.height)
|
||||||
self.bitmap = @contents
|
self.bitmap = @contents
|
||||||
self.visible = false
|
self.visible = false
|
||||||
self.z = 150+((@battler.index)/2)*5
|
self.z = 150 + ((@battler.index) / 2) * 5
|
||||||
pbSetSystemFont(self.bitmap)
|
pbSetSystemFont(self.bitmap)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -118,23 +118,23 @@ class PokemonDataBox < SpriteWrapper
|
|||||||
|
|
||||||
def x=(value)
|
def x=(value)
|
||||||
super
|
super
|
||||||
@hpBar.x = value+@spriteBaseX+12#102
|
@hpBar.x = value + @spriteBaseX + 12 #102
|
||||||
@expBar.x = value+@spriteBaseX+24
|
@expBar.x = value + @spriteBaseX + 24
|
||||||
@hpNumbers.x = value+@spriteBaseX+80
|
@hpNumbers.x = value + @spriteBaseX + 80
|
||||||
end
|
end
|
||||||
|
|
||||||
def y=(value)
|
def y=(value)
|
||||||
super
|
super
|
||||||
@hpBar.y = value+40
|
@hpBar.y = value + 40
|
||||||
@expBar.y = value+64
|
@expBar.y = value + 64
|
||||||
@hpNumbers.y = value+52
|
@hpNumbers.y = value + 52
|
||||||
end
|
end
|
||||||
|
|
||||||
def z=(value)
|
def z=(value)
|
||||||
super
|
super
|
||||||
@hpBar.z = value+1
|
@hpBar.z = value + 1
|
||||||
@expBar.z = value+1
|
@expBar.z = value + 1
|
||||||
@hpNumbers.z = value+2
|
@hpNumbers.z = value + 2
|
||||||
end
|
end
|
||||||
|
|
||||||
def opacity=(value)
|
def opacity=(value)
|
||||||
@@ -169,42 +169,42 @@ class PokemonDataBox < SpriteWrapper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def exp_fraction
|
def exp_fraction
|
||||||
return (@animatingExp) ? @currentExp.to_f/@rangeExp : @battler.pokemon.exp_fraction
|
return (@animatingExp) ? @currentExp.to_f / @rangeExp : @battler.pokemon.exp_fraction
|
||||||
end
|
end
|
||||||
|
|
||||||
def animateHP(oldHP,newHP,rangeHP)
|
def animateHP(oldHP, newHP, rangeHP)
|
||||||
@currentHP = oldHP
|
@currentHP = oldHP
|
||||||
@endHP = newHP
|
@endHP = newHP
|
||||||
@rangeHP = rangeHP
|
@rangeHP = rangeHP
|
||||||
# NOTE: A change in HP takes the same amount of time to animate, no matter
|
# NOTE: A change in HP takes the same amount of time to animate, no matter
|
||||||
# how big a change it is.
|
# how big a change it is.
|
||||||
@hpIncPerFrame = (newHP-oldHP).abs/(HP_BAR_CHANGE_TIME*Graphics.frame_rate)
|
@hpIncPerFrame = (newHP - oldHP).abs / (HP_BAR_CHANGE_TIME * Graphics.frame_rate)
|
||||||
# minInc is the smallest amount that HP is allowed to change per frame.
|
# minInc is the smallest amount that HP is allowed to change per frame.
|
||||||
# This avoids a tiny change in HP still taking HP_BAR_CHANGE_TIME seconds.
|
# This avoids a tiny change in HP still taking HP_BAR_CHANGE_TIME seconds.
|
||||||
minInc = (rangeHP*4)/(@hpBarBitmap.width*HP_BAR_CHANGE_TIME*Graphics.frame_rate)
|
minInc = (rangeHP * 4) / (@hpBarBitmap.width * HP_BAR_CHANGE_TIME * Graphics.frame_rate)
|
||||||
@hpIncPerFrame = minInc if @hpIncPerFrame<minInc
|
@hpIncPerFrame = minInc if @hpIncPerFrame < minInc
|
||||||
@animatingHP = true
|
@animatingHP = true
|
||||||
end
|
end
|
||||||
|
|
||||||
def animateExp(oldExp,newExp,rangeExp)
|
def animateExp(oldExp, newExp, rangeExp)
|
||||||
@currentExp = oldExp
|
@currentExp = oldExp
|
||||||
@endExp = newExp
|
@endExp = newExp
|
||||||
@rangeExp = rangeExp
|
@rangeExp = rangeExp
|
||||||
# NOTE: Filling the Exp bar from empty to full takes EXP_BAR_FILL_TIME
|
# NOTE: Filling the Exp bar from empty to full takes EXP_BAR_FILL_TIME
|
||||||
# seconds no matter what. Filling half of it takes half as long, etc.
|
# seconds no matter what. Filling half of it takes half as long, etc.
|
||||||
@expIncPerFrame = rangeExp/(EXP_BAR_FILL_TIME*Graphics.frame_rate)
|
@expIncPerFrame = rangeExp / (EXP_BAR_FILL_TIME * Graphics.frame_rate)
|
||||||
@animatingExp = true
|
@animatingExp = true
|
||||||
pbSEPlay("Pkmn exp gain") if @showExp
|
pbSEPlay("Pkmn exp gain") if @showExp
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbDrawNumber(number,btmp,startX,startY,align=0)
|
def pbDrawNumber(number, btmp, startX, startY, align = 0)
|
||||||
# -1 means draw the / character
|
# -1 means draw the / character
|
||||||
n = (number == -1) ? [10] : number.to_i.digits.reverse
|
n = (number == -1) ? [10] : number.to_i.digits.reverse
|
||||||
charWidth = @numbersBitmap.width/11
|
charWidth = @numbersBitmap.width / 11
|
||||||
charHeight = @numbersBitmap.height
|
charHeight = @numbersBitmap.height
|
||||||
startX -= charWidth*n.length if align==1
|
startX -= charWidth * n.length if align == 1
|
||||||
n.each do |i|
|
n.each do |i|
|
||||||
btmp.blt(startX,startY,@numbersBitmap.bitmap,Rect.new(i*charWidth,0,charWidth,charHeight))
|
btmp.blt(startX, startY, @numbersBitmap.bitmap, Rect.new(i * charWidth, 0, charWidth, charHeight))
|
||||||
startX += charWidth
|
startX += charWidth
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -215,44 +215,44 @@ class PokemonDataBox < SpriteWrapper
|
|||||||
textPos = []
|
textPos = []
|
||||||
imagePos = []
|
imagePos = []
|
||||||
# Draw background panel
|
# Draw background panel
|
||||||
self.bitmap.blt(0,0,@databoxBitmap.bitmap,Rect.new(0,0,@databoxBitmap.width,@databoxBitmap.height))
|
self.bitmap.blt(0, 0, @databoxBitmap.bitmap, Rect.new(0, 0, @databoxBitmap.width, @databoxBitmap.height))
|
||||||
# Draw Pokémon's name
|
# Draw Pokémon's name
|
||||||
nameWidth = self.bitmap.text_size(@battler.name).width
|
nameWidth = self.bitmap.text_size(@battler.name).width
|
||||||
nameOffset = 0
|
nameOffset = 0
|
||||||
nameOffset = nameWidth-116 if nameWidth>116
|
nameOffset = nameWidth - 116 if nameWidth > 116
|
||||||
textPos.push([@battler.name,@spriteBaseX+8-nameOffset,0,false,NAME_BASE_COLOR,NAME_SHADOW_COLOR])
|
textPos.push([@battler.name, @spriteBaseX + 8 - nameOffset, 0, false, NAME_BASE_COLOR, NAME_SHADOW_COLOR])
|
||||||
# Draw Pokémon's gender symbol
|
# Draw Pokémon's gender symbol
|
||||||
case @battler.displayGender
|
case @battler.displayGender
|
||||||
when 0 # Male
|
when 0 # Male
|
||||||
textPos.push([_INTL("♂"),@spriteBaseX+126,0,false,MALE_BASE_COLOR,MALE_SHADOW_COLOR])
|
textPos.push([_INTL("♂"), @spriteBaseX + 126, 0, false, MALE_BASE_COLOR, MALE_SHADOW_COLOR])
|
||||||
when 1 # Female
|
when 1 # Female
|
||||||
textPos.push([_INTL("♀"),@spriteBaseX+126,0,false,FEMALE_BASE_COLOR,FEMALE_SHADOW_COLOR])
|
textPos.push([_INTL("♀"), @spriteBaseX + 126, 0, false, FEMALE_BASE_COLOR, FEMALE_SHADOW_COLOR])
|
||||||
end
|
end
|
||||||
pbDrawTextPositions(self.bitmap,textPos)
|
pbDrawTextPositions(self.bitmap, textPos)
|
||||||
# Draw Pokémon's level
|
# Draw Pokémon's level
|
||||||
imagePos.push(["Graphics/Pictures/Battle/overlay_lv",@spriteBaseX+140,16]) if !$game_switches[SWITCH_NO_LEVELS_MODE]
|
imagePos.push(["Graphics/Pictures/Battle/overlay_lv", @spriteBaseX + 140, 16]) if !$game_switches[SWITCH_NO_LEVELS_MODE]
|
||||||
pbDrawNumber(@battler.level,self.bitmap,@spriteBaseX+162,16) if !$game_switches[SWITCH_NO_LEVELS_MODE]
|
pbDrawNumber(@battler.level, self.bitmap, @spriteBaseX + 162, 16) if !$game_switches[SWITCH_NO_LEVELS_MODE]
|
||||||
# Draw shiny icon
|
# Draw shiny icon
|
||||||
if @battler.shiny?
|
if @battler.shiny?
|
||||||
shinyX = (@battler.opposes?(0)) ? 206 : -6 # Foe's/player's
|
shinyX = (@battler.opposes?(0)) ? 206 : -6 # Foe's/player's
|
||||||
|
|
||||||
pokeRadarShiny= !@battler.pokemon.debugShiny? && !@battler.pokemon.naturalShiny?
|
pokeRadarShiny = !@battler.pokemon.debugShiny? && !@battler.pokemon.naturalShiny?
|
||||||
addShinyStarsToGraphicsArray(imagePos,@spriteBaseX+shinyX,35, @battler.pokemon.bodyShiny?,@battler.pokemon.headShiny?,@battler.pokemon.debugShiny?, pokeRadarShiny)
|
addShinyStarsToGraphicsArray(imagePos, @spriteBaseX + shinyX, 35, @battler.pokemon.bodyShiny?, @battler.pokemon.headShiny?, @battler.pokemon.debugShiny?, pokeRadarShiny)
|
||||||
end
|
end
|
||||||
# Draw Mega Evolution/Primal Reversion icon
|
# Draw Mega Evolution/Primal Reversion icon
|
||||||
if @battler.mega?
|
if @battler.mega?
|
||||||
imagePos.push(["Graphics/Pictures/Battle/icon_mega",@spriteBaseX+8,34])
|
imagePos.push(["Graphics/Pictures/Battle/icon_mega", @spriteBaseX + 8, 34])
|
||||||
elsif @battler.primal?
|
elsif @battler.primal?
|
||||||
primalX = (@battler.opposes?) ? 208 : -28 # Foe's/player's
|
primalX = (@battler.opposes?) ? 208 : -28 # Foe's/player's
|
||||||
if @battler.isSpecies?(:KYOGRE)
|
if @battler.isSpecies?(:KYOGRE)
|
||||||
imagePos.push(["Graphics/Pictures/Battle/icon_primal_Kyogre",@spriteBaseX+primalX,4])
|
imagePos.push(["Graphics/Pictures/Battle/icon_primal_Kyogre", @spriteBaseX + primalX, 4])
|
||||||
elsif @battler.isSpecies?(:GROUDON)
|
elsif @battler.isSpecies?(:GROUDON)
|
||||||
imagePos.push(["Graphics/Pictures/Battle/icon_primal_Groudon",@spriteBaseX+primalX,4])
|
imagePos.push(["Graphics/Pictures/Battle/icon_primal_Groudon", @spriteBaseX + primalX, 4])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Draw owned icon (foe Pokémon only)
|
# Draw owned icon (foe Pokémon only)
|
||||||
if @battler.owned? && @battler.opposes?(0)
|
if @battler.owned? && @battler.opposes?(0)
|
||||||
imagePos.push(["Graphics/Pictures/Battle/icon_own",@spriteBaseX-8,42])
|
imagePos.push(["Graphics/Pictures/Battle/icon_own", @spriteBaseX - 8, 42])
|
||||||
end
|
end
|
||||||
# Draw status icon
|
# Draw status icon
|
||||||
if @battler.status != :NONE
|
if @battler.status != :NONE
|
||||||
@@ -260,10 +260,10 @@ class PokemonDataBox < SpriteWrapper
|
|||||||
if s == :POISON && @battler.statusCount > 0 # Badly poisoned
|
if s == :POISON && @battler.statusCount > 0 # Badly poisoned
|
||||||
s = GameData::Status::DATA.keys.length / 2
|
s = GameData::Status::DATA.keys.length / 2
|
||||||
end
|
end
|
||||||
imagePos.push(["Graphics/Pictures/Battle/icon_statuses",@spriteBaseX+24,56,
|
imagePos.push(["Graphics/Pictures/Battle/icon_statuses", @spriteBaseX + 24, 56,
|
||||||
0,(s-1)*STATUS_ICON_HEIGHT,-1,STATUS_ICON_HEIGHT])
|
0, (s - 1) * STATUS_ICON_HEIGHT, -1, STATUS_ICON_HEIGHT])
|
||||||
end
|
end
|
||||||
pbDrawImagePositions(self.bitmap,imagePos)
|
pbDrawImagePositions(self.bitmap, imagePos)
|
||||||
refreshHP
|
refreshHP
|
||||||
refreshExp
|
refreshExp
|
||||||
end
|
end
|
||||||
@@ -273,24 +273,24 @@ class PokemonDataBox < SpriteWrapper
|
|||||||
return if !@battler.pokemon
|
return if !@battler.pokemon
|
||||||
# Show HP numbers
|
# Show HP numbers
|
||||||
if @showHP
|
if @showHP
|
||||||
pbDrawNumber(self.hp,@hpNumbers.bitmap,54,2,1)
|
pbDrawNumber(self.hp, @hpNumbers.bitmap, 54, 2, 1)
|
||||||
pbDrawNumber(-1,@hpNumbers.bitmap,54,2) # / char
|
pbDrawNumber(-1, @hpNumbers.bitmap, 54, 2) # / char
|
||||||
pbDrawNumber(@battler.totalhp,@hpNumbers.bitmap,70,2)
|
pbDrawNumber(@battler.totalhp, @hpNumbers.bitmap, 70, 2)
|
||||||
end
|
end
|
||||||
# Resize HP bar
|
# Resize HP bar
|
||||||
w = 0
|
w = 0
|
||||||
if self.hp>0
|
if self.hp > 0
|
||||||
w = @hpBarBitmap.width.to_f*self.hp/@battler.totalhp
|
w = @hpBarBitmap.width.to_f * self.hp / @battler.totalhp
|
||||||
w = 1 if w<1
|
w = 1 if w < 1
|
||||||
# NOTE: The line below snaps the bar's width to the nearest 2 pixels, to
|
# NOTE: The line below snaps the bar's width to the nearest 2 pixels, to
|
||||||
# fit in with the rest of the graphics which are doubled in size.
|
# fit in with the rest of the graphics which are doubled in size.
|
||||||
w = ((w/2.0).round)*2
|
w = ((w / 2.0).round) * 2
|
||||||
end
|
end
|
||||||
@hpBar.src_rect.width = w
|
@hpBar.src_rect.width = w
|
||||||
hpColor = 0 # Green bar
|
hpColor = 0 # Green bar
|
||||||
hpColor = 1 if self.hp<=@battler.totalhp/2 # Yellow bar
|
hpColor = 1 if self.hp <= @battler.totalhp / 2 # Yellow bar
|
||||||
hpColor = 2 if self.hp<=@battler.totalhp/4 # Red bar
|
hpColor = 2 if self.hp <= @battler.totalhp / 4 # Red bar
|
||||||
@hpBar.src_rect.y = hpColor*@hpBarBitmap.height/3
|
@hpBar.src_rect.y = hpColor * @hpBarBitmap.height / 3
|
||||||
end
|
end
|
||||||
|
|
||||||
def refreshExp
|
def refreshExp
|
||||||
@@ -299,22 +299,22 @@ class PokemonDataBox < SpriteWrapper
|
|||||||
w = exp_fraction * @expBarBitmap.width
|
w = exp_fraction * @expBarBitmap.width
|
||||||
# NOTE: The line below snaps the bar's width to the nearest 2 pixels, to
|
# NOTE: The line below snaps the bar's width to the nearest 2 pixels, to
|
||||||
# fit in with the rest of the graphics which are doubled in size.
|
# fit in with the rest of the graphics which are doubled in size.
|
||||||
w = ((w/2).round)*2
|
w = ((w / 2).round) * 2
|
||||||
@expBar.src_rect.width = w
|
@expBar.src_rect.width = w
|
||||||
end
|
end
|
||||||
|
|
||||||
def updateHPAnimation
|
def updateHPAnimation
|
||||||
return if !@animatingHP
|
return if !@animatingHP
|
||||||
if @currentHP<@endHP # Gaining HP
|
if @currentHP < @endHP # Gaining HP
|
||||||
@currentHP += @hpIncPerFrame
|
@currentHP += @hpIncPerFrame
|
||||||
@currentHP = @endHP if @currentHP>=@endHP
|
@currentHP = @endHP if @currentHP >= @endHP
|
||||||
elsif @currentHP>@endHP # Losing HP
|
elsif @currentHP > @endHP # Losing HP
|
||||||
@currentHP -= @hpIncPerFrame
|
@currentHP -= @hpIncPerFrame
|
||||||
@currentHP = @endHP if @currentHP<=@endHP
|
@currentHP = @endHP if @currentHP <= @endHP
|
||||||
end
|
end
|
||||||
# Refresh the HP bar/numbers
|
# Refresh the HP bar/numbers
|
||||||
refreshHP
|
refreshHP
|
||||||
@animatingHP = false if @currentHP==@endHP
|
@animatingHP = false if @currentHP == @endHP
|
||||||
end
|
end
|
||||||
|
|
||||||
def updateExpAnimation
|
def updateExpAnimation
|
||||||
@@ -324,29 +324,29 @@ class PokemonDataBox < SpriteWrapper
|
|||||||
@animatingExp = false
|
@animatingExp = false
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if @currentExp<@endExp # Gaining Exp
|
if @currentExp < @endExp # Gaining Exp
|
||||||
@currentExp += @expIncPerFrame
|
@currentExp += @expIncPerFrame
|
||||||
@currentExp = @endExp if @currentExp>=@endExp
|
@currentExp = @endExp if @currentExp >= @endExp
|
||||||
elsif @currentExp>@endExp # Losing Exp
|
elsif @currentExp > @endExp # Losing Exp
|
||||||
@currentExp -= @expIncPerFrame
|
@currentExp -= @expIncPerFrame
|
||||||
@currentExp = @endExp if @currentExp<=@endExp
|
@currentExp = @endExp if @currentExp <= @endExp
|
||||||
end
|
end
|
||||||
# Refresh the Exp bar
|
# Refresh the Exp bar
|
||||||
refreshExp
|
refreshExp
|
||||||
return if @currentExp!=@endExp # Exp bar still has more to animate
|
return if @currentExp != @endExp # Exp bar still has more to animate
|
||||||
# Exp bar is completely filled, level up with a flash and sound effect
|
# Exp bar is completely filled, level up with a flash and sound effect
|
||||||
if @currentExp>=@rangeExp
|
if @currentExp >= @rangeExp
|
||||||
if @expFlash==0
|
if @expFlash == 0
|
||||||
pbSEStop
|
pbSEStop
|
||||||
@expFlash = Graphics.frame_rate/5
|
@expFlash = Graphics.frame_rate / 5
|
||||||
pbSEPlay("Pkmn exp full")
|
pbSEPlay("Pkmn exp full")
|
||||||
self.flash(Color.new(64,200,248,192),@expFlash)
|
self.flash(Color.new(64, 200, 248, 192), @expFlash)
|
||||||
for i in @sprites
|
for i in @sprites
|
||||||
i[1].flash(Color.new(64,200,248,192),@expFlash) if !i[1].disposed?
|
i[1].flash(Color.new(64, 200, 248, 192), @expFlash) if !i[1].disposed?
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@expFlash -= 1
|
@expFlash -= 1
|
||||||
@animatingExp = false if @expFlash==0
|
@animatingExp = false if @expFlash == 0
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
pbSEStop
|
pbSEStop
|
||||||
@@ -355,21 +355,23 @@ class PokemonDataBox < SpriteWrapper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
QUARTER_ANIM_PERIOD = Graphics.frame_rate*3/20
|
QUARTER_ANIM_PERIOD = Graphics.frame_rate * 3 / 20
|
||||||
|
|
||||||
def updatePositions(frameCounter)
|
def updatePositions(frameCounter)
|
||||||
self.x = @spriteX
|
self.x = @spriteX
|
||||||
self.y = @spriteY
|
self.y = @spriteY
|
||||||
# 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 self.y = @spriteY-2
|
when 1 then
|
||||||
when 3 then self.y = @spriteY+2
|
self.y = @spriteY - 2
|
||||||
|
when 3 then
|
||||||
|
self.y = @spriteY + 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def update(frameCounter=0)
|
def update(frameCounter = 0)
|
||||||
super()
|
super()
|
||||||
# Animate HP bar
|
# Animate HP bar
|
||||||
updateHPAnimation
|
updateHPAnimation
|
||||||
@@ -381,18 +383,16 @@ class PokemonDataBox < SpriteWrapper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Splash bar to announce a triggered ability
|
# Splash bar to announce a triggered ability
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class AbilitySplashBar < SpriteWrapper
|
class AbilitySplashBar < SpriteWrapper
|
||||||
attr_reader :battler
|
attr_reader :battler
|
||||||
|
|
||||||
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)
|
||||||
super(viewport)
|
super(viewport)
|
||||||
@side = side
|
@side = side
|
||||||
@battler = nil
|
@battler = nil
|
||||||
@@ -400,15 +400,15 @@ class AbilitySplashBar < SpriteWrapper
|
|||||||
@bgBitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Battle/ability_bar"))
|
@bgBitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Battle/ability_bar"))
|
||||||
@bgSprite = SpriteWrapper.new(viewport)
|
@bgSprite = SpriteWrapper.new(viewport)
|
||||||
@bgSprite.bitmap = @bgBitmap.bitmap
|
@bgSprite.bitmap = @bgBitmap.bitmap
|
||||||
@bgSprite.src_rect.y = (side==0) ? 0 : @bgBitmap.height/2
|
@bgSprite.src_rect.y = (side == 0) ? 0 : @bgBitmap.height / 2
|
||||||
@bgSprite.src_rect.height = @bgBitmap.height/2
|
@bgSprite.src_rect.height = @bgBitmap.height / 2
|
||||||
# Create bitmap that displays the text
|
# Create bitmap that displays the text
|
||||||
@contents = BitmapWrapper.new(@bgBitmap.width,@bgBitmap.height/2)
|
@contents = BitmapWrapper.new(@bgBitmap.width, @bgBitmap.height / 2)
|
||||||
self.bitmap = @contents
|
self.bitmap = @contents
|
||||||
pbSetSystemFont(self.bitmap)
|
pbSetSystemFont(self.bitmap)
|
||||||
# Position the bar
|
# Position the bar
|
||||||
self.x = (side==0) ? -Graphics.width/2 : Graphics.width
|
self.x = (side == 0) ? -Graphics.width / 2 : Graphics.width
|
||||||
self.y = (side==0) ? 180 : 80
|
self.y = (side == 0) ? 180 : 80
|
||||||
self.z = 120
|
self.z = 120
|
||||||
self.visible = false
|
self.visible = false
|
||||||
end
|
end
|
||||||
@@ -432,7 +432,7 @@ class AbilitySplashBar < SpriteWrapper
|
|||||||
|
|
||||||
def z=(value)
|
def z=(value)
|
||||||
super
|
super
|
||||||
@bgSprite.z = value-1
|
@bgSprite.z = value - 1
|
||||||
end
|
end
|
||||||
|
|
||||||
def opacity=(value)
|
def opacity=(value)
|
||||||
@@ -459,14 +459,19 @@ class AbilitySplashBar < SpriteWrapper
|
|||||||
self.bitmap.clear
|
self.bitmap.clear
|
||||||
return if !@battler
|
return if !@battler
|
||||||
textPos = []
|
textPos = []
|
||||||
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])
|
||||||
# Draw Pokémon's ability
|
# Draw Pokémon's ability
|
||||||
textPos.push([@battler.abilityName,textX,26,@side==1,
|
text = @battler.abilityName
|
||||||
TEXT_BASE_COLOR,TEXT_SHADOW_COLOR,true])
|
if $game_switches[SWITCH_DOUBLE_ABILITIES]
|
||||||
pbDrawTextPositions(self.bitmap,textPos)
|
text = _INTL("{1},{2}", @battler.abilityName, @battler.ability2Name)
|
||||||
|
end
|
||||||
|
|
||||||
|
textPos.push([text, textX, 26, @side == 1,
|
||||||
|
TEXT_BASE_COLOR, TEXT_SHADOW_COLOR, true])
|
||||||
|
pbDrawTextPositions(self.bitmap, textPos)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@@ -475,8 +480,6 @@ class AbilitySplashBar < SpriteWrapper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Pokémon sprite (used in battle)
|
# Pokémon sprite (used in battle)
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
@@ -486,7 +489,7 @@ class PokemonBattlerSprite < RPG::Sprite
|
|||||||
attr_accessor :selected
|
attr_accessor :selected
|
||||||
attr_reader :sideSize
|
attr_reader :sideSize
|
||||||
|
|
||||||
def initialize(viewport,sideSize,index,battleAnimations)
|
def initialize(viewport, sideSize, index, battleAnimations)
|
||||||
super(viewport)
|
super(viewport)
|
||||||
@pkmn = nil
|
@pkmn = nil
|
||||||
@sideSize = sideSize
|
@sideSize = sideSize
|
||||||
@@ -503,7 +506,7 @@ class PokemonBattlerSprite < RPG::Sprite
|
|||||||
@spriteYExtra = 0 # Offset due to "bobbing" animation
|
@spriteYExtra = 0 # Offset due to "bobbing" animation
|
||||||
@_iconBitmap = nil
|
@_iconBitmap = nil
|
||||||
self.visible = false
|
self.visible = false
|
||||||
@back=false
|
@back = false
|
||||||
end
|
end
|
||||||
|
|
||||||
def dispose
|
def dispose
|
||||||
@@ -513,23 +516,33 @@ class PokemonBattlerSprite < RPG::Sprite
|
|||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
def x; return @spriteX; end
|
def x
|
||||||
def y; return @spriteY; end
|
return @spriteX;
|
||||||
|
end
|
||||||
|
|
||||||
|
def y
|
||||||
|
return @spriteY;
|
||||||
|
end
|
||||||
|
|
||||||
def x=(value)
|
def x=(value)
|
||||||
@spriteX = value
|
@spriteX = value
|
||||||
self.mirror=true if @back
|
self.mirror = true if @back
|
||||||
super(value+@spriteXExtra)
|
super(value + @spriteXExtra)
|
||||||
end
|
end
|
||||||
|
|
||||||
def y=(value)
|
def y=(value)
|
||||||
@spriteY = value
|
@spriteY = value
|
||||||
self.mirror=true if @back
|
self.mirror = true if @back
|
||||||
super(value+@spriteYExtra)
|
super(value + @spriteYExtra)
|
||||||
end
|
end
|
||||||
|
|
||||||
def width; return (self.bitmap) ? self.bitmap.width : 0; end
|
def width
|
||||||
def height; return (self.bitmap) ? self.bitmap.height : 0; end
|
return (self.bitmap) ? self.bitmap.width : 0;
|
||||||
|
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
|
||||||
@@ -539,30 +552,30 @@ class PokemonBattlerSprite < RPG::Sprite
|
|||||||
# Set sprite's origin to bottom middle
|
# Set sprite's origin to bottom middle
|
||||||
def pbSetOrigin
|
def pbSetOrigin
|
||||||
return if !@_iconBitmap
|
return if !@_iconBitmap
|
||||||
self.mirror=true if @back
|
self.mirror = true if @back
|
||||||
self.ox = @_iconBitmap.width/2
|
self.ox = @_iconBitmap.width / 2
|
||||||
self.oy = @_iconBitmap.height
|
self.oy = @_iconBitmap.height
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbSetPosition
|
def pbSetPosition
|
||||||
return if !@_iconBitmap
|
return if !@_iconBitmap
|
||||||
pbSetOrigin
|
pbSetOrigin
|
||||||
if (@index%2)==0
|
if (@index % 2) == 0
|
||||||
self.z = 50+5*@index/2
|
self.z = 50 + 5 * @index / 2
|
||||||
else
|
else
|
||||||
self.z = 50-5*(@index+1)/2
|
self.z = 50 - 5 * (@index + 1) / 2
|
||||||
end
|
end
|
||||||
# Set original position
|
# Set original position
|
||||||
p = PokeBattle_SceneConstants.pbBattlerPosition(@index,@sideSize)
|
p = PokeBattle_SceneConstants.pbBattlerPosition(@index, @sideSize)
|
||||||
@spriteX = p[0]
|
@spriteX = p[0]
|
||||||
@spriteY = p[1]
|
@spriteY = p[1]
|
||||||
# Apply metrics
|
# Apply metrics
|
||||||
@pkmn.species_data.apply_metrics_to_sprite(self, @index)
|
@pkmn.species_data.apply_metrics_to_sprite(self, @index)
|
||||||
end
|
end
|
||||||
|
|
||||||
def setPokemonBitmap(pkmn,back=false)
|
def setPokemonBitmap(pkmn, back = false)
|
||||||
@back = back
|
@back = back
|
||||||
self.mirror=true if @back
|
self.mirror = true if @back
|
||||||
@pkmn = pkmn
|
@pkmn = pkmn
|
||||||
@_iconBitmap.dispose if @_iconBitmap
|
@_iconBitmap.dispose if @_iconBitmap
|
||||||
@_iconBitmap = GameData::Species.sprite_bitmap_from_pokemon(@pkmn, back)
|
@_iconBitmap = GameData::Species.sprite_bitmap_from_pokemon(@pkmn, back)
|
||||||
@@ -580,14 +593,14 @@ class PokemonBattlerSprite < RPG::Sprite
|
|||||||
# this is just playing the Pokémon's cry, but you can expand on it. The
|
# this is just playing the Pokémon's cry, but you can expand on it. The
|
||||||
# recommendation is to create a PictureEx animation and push it into
|
# recommendation is to create a PictureEx animation and push it into
|
||||||
# the @battleAnimations array.
|
# the @battleAnimations array.
|
||||||
def pbPlayIntroAnimation(pictureEx=nil)
|
def pbPlayIntroAnimation(pictureEx = nil)
|
||||||
@pkmn.play_cry if @pkmn
|
@pkmn.play_cry if @pkmn
|
||||||
end
|
end
|
||||||
|
|
||||||
QUARTER_ANIM_PERIOD = Graphics.frame_rate*3/20
|
QUARTER_ANIM_PERIOD = Graphics.frame_rate * 3 / 20
|
||||||
SIXTH_ANIM_PERIOD = Graphics.frame_rate*2/20
|
SIXTH_ANIM_PERIOD = Graphics.frame_rate * 2 / 20
|
||||||
|
|
||||||
def update(frameCounter=0)
|
def update(frameCounter = 0)
|
||||||
return if !@_iconBitmap
|
return if !@_iconBitmap
|
||||||
@updating = true
|
@updating = true
|
||||||
# Update bitmap
|
# Update bitmap
|
||||||
@@ -595,28 +608,30 @@ class PokemonBattlerSprite < RPG::Sprite
|
|||||||
self.bitmap = @_iconBitmap.bitmap
|
self.bitmap = @_iconBitmap.bitmap
|
||||||
# Pokémon sprite bobbing while Pokémon is selected
|
# Pokémon sprite bobbing while Pokémon is selected
|
||||||
@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 @spriteYExtra = 2
|
when 1 then
|
||||||
when 3 then @spriteYExtra = -2
|
@spriteYExtra = 2
|
||||||
|
when 3 then
|
||||||
|
@spriteYExtra = -2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.x = self.x
|
self.x = self.x
|
||||||
self.y = self.y
|
self.y = self.y
|
||||||
self.visible = @spriteVisible
|
self.visible = @spriteVisible
|
||||||
# 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 self.visible = false
|
when 2, 5 then
|
||||||
else self.visible = true
|
self.visible = false
|
||||||
|
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)
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
@@ -625,7 +640,7 @@ class PokemonBattlerShadowSprite < RPG::Sprite
|
|||||||
attr_accessor :index
|
attr_accessor :index
|
||||||
attr_accessor :selected
|
attr_accessor :selected
|
||||||
|
|
||||||
def initialize(viewport,sideSize,index)
|
def initialize(viewport, sideSize, index)
|
||||||
super(viewport)
|
super(viewport)
|
||||||
@pkmn = nil
|
@pkmn = nil
|
||||||
@sideSize = sideSize
|
@sideSize = sideSize
|
||||||
@@ -641,14 +656,19 @@ class PokemonBattlerShadowSprite < RPG::Sprite
|
|||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
def width; return (self.bitmap) ? self.bitmap.width : 0; end
|
def width
|
||||||
def height; return (self.bitmap) ? self.bitmap.height : 0; end
|
return (self.bitmap) ? self.bitmap.width : 0;
|
||||||
|
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
|
||||||
return if !@_iconBitmap
|
return if !@_iconBitmap
|
||||||
self.ox = @_iconBitmap.width/2
|
self.ox = @_iconBitmap.width / 2
|
||||||
self.oy = @_iconBitmap.height/2
|
self.oy = @_iconBitmap.height / 2
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbSetPosition
|
def pbSetPosition
|
||||||
@@ -656,7 +676,7 @@ class PokemonBattlerShadowSprite < RPG::Sprite
|
|||||||
pbSetOrigin
|
pbSetOrigin
|
||||||
self.z = 3
|
self.z = 3
|
||||||
# Set original position
|
# Set original position
|
||||||
p = PokeBattle_SceneConstants.pbBattlerPosition(@index,@sideSize)
|
p = PokeBattle_SceneConstants.pbBattlerPosition(@index, @sideSize)
|
||||||
self.x = p[0]
|
self.x = p[0]
|
||||||
self.y = p[1]
|
self.y = p[1]
|
||||||
# Apply metrics
|
# Apply metrics
|
||||||
@@ -671,7 +691,7 @@ class PokemonBattlerShadowSprite < RPG::Sprite
|
|||||||
pbSetPosition
|
pbSetPosition
|
||||||
end
|
end
|
||||||
|
|
||||||
def update(frameCounter=0)
|
def update(frameCounter = 0)
|
||||||
return if !@_iconBitmap
|
return if !@_iconBitmap
|
||||||
# Update bitmap
|
# Update bitmap
|
||||||
@_iconBitmap.update
|
@_iconBitmap.update
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ class PokeBattle_Scene
|
|||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Ability splash bar animations
|
# Ability splash bar animations
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
def pbShowAbilitySplash(battler)
|
def pbShowAbilitySplash(battler,ability_name=nil)
|
||||||
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
|
||||||
@@ -187,6 +187,7 @@ class PokeBattle_Scene
|
|||||||
abilitySplashAnim.dispose
|
abilitySplashAnim.dispose
|
||||||
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
|
||||||
|
|||||||
@@ -674,10 +674,22 @@ class PokemonSummary_Scene
|
|||||||
]
|
]
|
||||||
# Draw ability name and description
|
# Draw ability name and description
|
||||||
ability = @pokemon.ability
|
ability = @pokemon.ability
|
||||||
|
ability2 = @pokemon.ability2
|
||||||
|
|
||||||
|
# if ability
|
||||||
|
# textpos.push([ability.name, 362, 278, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)])
|
||||||
|
# drawTextEx(overlay, 224, 320, 282, 2, ability.description, Color.new(64, 64, 64), Color.new(176, 176, 176))
|
||||||
|
# end
|
||||||
|
|
||||||
|
#fixme temp
|
||||||
if ability
|
if ability
|
||||||
textpos.push([ability.name, 362, 278, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)])
|
textpos.push([ability.name, 362, 278, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)])
|
||||||
drawTextEx(overlay, 224, 320, 282, 2, ability.description, Color.new(64, 64, 64), Color.new(176, 176, 176))
|
if ability2
|
||||||
|
drawTextEx(overlay, 224, 320, 282, 2, ability2.name, Color.new(64, 64, 64), Color.new(176, 176, 176))
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
# Draw all text
|
# Draw all text
|
||||||
pbDrawTextPositions(overlay, textpos)
|
pbDrawTextPositions(overlay, textpos)
|
||||||
# Draw HP bar
|
# Draw HP bar
|
||||||
|
|||||||
@@ -659,7 +659,7 @@ PokemonDebugMenuCommands.register("setitem", {
|
|||||||
|
|
||||||
PokemonDebugMenuCommands.register("setability", {
|
PokemonDebugMenuCommands.register("setability", {
|
||||||
"parent" => "main",
|
"parent" => "main",
|
||||||
"name" => _INTL("Set ability"),
|
"name" => _INTL("Set primary ability"),
|
||||||
"always_show" => true,
|
"always_show" => true,
|
||||||
"effect" => proc { |pkmn, pkmnid, heldpoke, settingUpBattle, screen|
|
"effect" => proc { |pkmn, pkmnid, heldpoke, settingUpBattle, screen|
|
||||||
cmd = 0
|
cmd = 0
|
||||||
@@ -706,6 +706,56 @@ PokemonDebugMenuCommands.register("setability", {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
PokemonDebugMenuCommands.register("setability2", {
|
||||||
|
"parent" => "main",
|
||||||
|
"name" => _INTL("Set secondary ability"),
|
||||||
|
"always_show" => true,
|
||||||
|
"effect" => proc { |pkmn, pkmnid, heldpoke, settingUpBattle, screen|
|
||||||
|
cmd = 0
|
||||||
|
commands = [
|
||||||
|
_INTL("Set possible ability"),
|
||||||
|
_INTL("Set any ability"),
|
||||||
|
_INTL("Reset")
|
||||||
|
]
|
||||||
|
loop do
|
||||||
|
if pkmn.ability
|
||||||
|
msg = _INTL("Ability 2 is {1} (index {2}).", pkmn.ability2.name, pkmn.ability2_index)
|
||||||
|
else
|
||||||
|
msg = _INTL("No ability (index {1}).", pkmn.ability2_index)
|
||||||
|
end
|
||||||
|
cmd = screen.pbShowCommands(msg, commands, cmd)
|
||||||
|
break if cmd < 0
|
||||||
|
case cmd
|
||||||
|
when 0 # Set possible ability
|
||||||
|
abils = pkmn.getAbilityList
|
||||||
|
ability_commands = []
|
||||||
|
abil_cmd = 0
|
||||||
|
for i in abils
|
||||||
|
ability_commands.push(((i[1] < 2) ? "" : "(H) ") + GameData::Ability.get(i[0]).name)
|
||||||
|
abil_cmd = ability_commands.length - 1 if pkmn.ability2_id == i[0]
|
||||||
|
end
|
||||||
|
abil_cmd = screen.pbShowCommands(_INTL("Choose an ability."), ability_commands, abil_cmd)
|
||||||
|
next if abil_cmd < 0
|
||||||
|
pkmn.ability2_index = abils[abil_cmd][1]
|
||||||
|
pkmn.ability2 = nil
|
||||||
|
screen.pbRefreshSingle(pkmnid)
|
||||||
|
when 1 # Set any ability
|
||||||
|
new_ability = pbChooseAbilityList(pkmn.ability2_id)
|
||||||
|
if new_ability && new_ability != pkmn.ability2_id
|
||||||
|
pkmn.ability2 = new_ability
|
||||||
|
screen.pbRefreshSingle(pkmnid)
|
||||||
|
end
|
||||||
|
when 2 # Reset
|
||||||
|
pkmn.ability2_index = nil
|
||||||
|
pkmn.ability2 = nil
|
||||||
|
screen.pbRefreshSingle(pkmnid)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
next false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
PokemonDebugMenuCommands.register("setnature", {
|
PokemonDebugMenuCommands.register("setnature", {
|
||||||
"parent" => "main",
|
"parent" => "main",
|
||||||
"name" => _INTL("Set nature"),
|
"name" => _INTL("Set nature"),
|
||||||
|
|||||||
@@ -103,13 +103,9 @@ class FusionSelectOptionsScene < PokemonOption_Scene
|
|||||||
@selectedNature=@natureList[value]
|
@selectedNature=@natureList[value]
|
||||||
}, [getNatureDescription(@natureList[0]), getNatureDescription(@natureList[1])]
|
}, [getNatureDescription(@natureList[0]), getNatureDescription(@natureList[1])]
|
||||||
)
|
)
|
||||||
addOptionsExtension(options)
|
|
||||||
return options
|
return options
|
||||||
end
|
end
|
||||||
|
|
||||||
def addOptionsExtension(options)
|
|
||||||
return options
|
|
||||||
end
|
|
||||||
|
|
||||||
def isConfirmedOnKeyPress
|
def isConfirmedOnKeyPress
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ SWITCH_GAME_DIFFICULTY_HARD = 666
|
|||||||
SWITCH_MODERN_MODE=974
|
SWITCH_MODERN_MODE=974
|
||||||
SWITCH_V5_1=825
|
SWITCH_V5_1=825
|
||||||
SWITCH_NO_LEVELS_MODE=774
|
SWITCH_NO_LEVELS_MODE=774
|
||||||
|
SWITCH_DOUBLE_ABILITIES=773
|
||||||
|
|
||||||
#Game progression switches
|
#Game progression switches
|
||||||
SWITCH_DURING_INTRO = 917
|
SWITCH_DURING_INTRO = 917
|
||||||
|
|||||||
@@ -1517,6 +1517,11 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
|
|||||||
pokemon.ability_index = pokemon.body_original_ability_index if pokemon.body_original_ability_index
|
pokemon.ability_index = pokemon.body_original_ability_index if pokemon.body_original_ability_index
|
||||||
poke2.ability_index = pokemon.head_original_ability_index if pokemon.head_original_ability_index
|
poke2.ability_index = pokemon.head_original_ability_index if pokemon.head_original_ability_index
|
||||||
|
|
||||||
|
pokemon.ability2_index=nil
|
||||||
|
pokemon.ability2=nil
|
||||||
|
poke2.ability2_index=nil
|
||||||
|
poke2.ability2=nil
|
||||||
|
|
||||||
pokemon.debug_shiny = true if pokemon.debug_shiny && pokemon.body_shiny
|
pokemon.debug_shiny = true if pokemon.debug_shiny && pokemon.body_shiny
|
||||||
poke2.debug_shiny = true if pokemon.debug_shiny && poke2.head_shiny
|
poke2.debug_shiny = true if pokemon.debug_shiny && poke2.head_shiny
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user