#########################################################################
# Delta Pokemon/Alolan Form code
# This is compatible with Essentials v16.2
# Also compatible with Luka's Elite Battle System (EBS),
# Klien's BW Essentials kit,
# and mej's Following Pokemon script
# Note that this code adds the Alolan forms as code within the game
# It does not automatically create the Alolan forms as possible
# encounters.
# You as the game developer need to decide how you want players to
# encounter the Alolan Pokemon.
#########################################################################
# To use
# 1.) place in a new script section below "PSystem_Utilities" but
# above "Main"
# - if using the EBS or Following Pokemon scripts, place below those
# scripts as well as "PSystem_Utilities"
# - if using the BW Essentials kit, paste directly above "Main"
# 2.) Decide how you want the player to encounter Delta/Alolan Pokemon
# - see the bottom of this script for an example that makes Alolan
# Exeggutor appear on a certain map
#########################################################################
# Battlers
class PokeBattle_Battler
def isDelta?
return (@pokemon) ? @pokemon.isDelta? : false
end
def isAlolan?
return (@pokemon) ? @pokemon.isDelta? : false
end
def isAlolaForm?
return (@pokemon) ? @pokemon.isDelta? : false
end
end
class PokeBattle_FakeBattler
def isDelta?; return @pokemon.isDelta?; end
def isAlolan?; return @pokemon.isDelta?; end
def isAlolaForm?; return @pokemon.isDelta?; end
end
# Pokemon
class PokeBattle_Pokemon
attr_accessor(:deltaflag) # Forces the deltaness (true/false)
def isDelta?
return @deltaflag if @deltaflag != nil
end
def isAlolan?
return @deltaflag if @deltaflag != nil
end
def isAlolaForm?
return @deltaflag if @deltaflag != nil
end
end
##############################################################
# Appearance change
##############################################################
class PokemonSprite < SpriteWrapper
def setSpeciesBitmap(species,female=false,form=0,shiny=false,shadow=false,back=false,egg=false,delta=false)
@_iconbitmap.dispose if @_iconbitmap
@_iconbitmap=species>0 ? pbLoadSpeciesBitmap(species,female,form,shiny,shadow,back,egg,delta) : nil
self.bitmap=@_iconbitmap ? @_iconbitmap.bitmap : nil
end
end
class PokemonEggHatchScene
def pbStartScene(pokemon)
@sprites={}
@pokemon=pokemon
@nicknamed=false
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=99999
addBackgroundOrColoredPlane(@sprites,"background","hatchbg",
Color.new(248,248,248),@viewport)
@sprites["pokemon"]=PokemonSprite.new(@viewport)
@sprites["pokemon"].setSpeciesBitmap(@pokemon.species,@pokemon.isFemale?,
(@pokemon.form rescue 0),@pokemon.isShiny?,
false,false,true,(@pokemon.isDelta? rescue false)) # Egg sprite
@sprites["pokemon"].x=Graphics.width/2-@sprites["pokemon"].bitmap.width/2
@sprites["pokemon"].y=48+(Graphics.height-@sprites["pokemon"].bitmap.height)/2
@sprites["hatch"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
@sprites["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
@sprites["overlay"].z=200
@sprites["overlay"].bitmap=Bitmap.new(Graphics.width,Graphics.height)
@sprites["overlay"].bitmap.fill_rect(0,0,Graphics.width,Graphics.height,
Color.new(255,255,255))
@sprites["overlay"].opacity=0
pbFadeInAndShow(@sprites)
end
end
def pbLoadPokemonBitmap(pokemon, back=false, scale=nil)
return pbLoadPokemonBitmapSpecies(pokemon,pokemon.species,back,scale)
end
# Note: Returns an AnimatedBitmap, not a Bitmap
def pbLoadPokemonBitmapSpecies(pokemon, species, back=false, scale=nil)
ret=nil
if scale==nil
scale=1
scale=POKEMONSPRITESCALE if POKEMONSPRITESCALE != nil
end
if pokemon.isEgg?
bitmapFileName=sprintf("Graphics/Battlers/%segg",getConstantName(PBSpecies,species)) rescue nil
if !pbResolveBitmap(bitmapFileName)
bitmapFileName=sprintf("Graphics/Battlers/%03degg",species)
if !pbResolveBitmap(bitmapFileName)
bitmapFileName=sprintf("Graphics/Battlers/egg")
end
end
bitmapFileName=pbResolveBitmap(bitmapFileName)
else
bitmapFileName=pbCheckPokemonBitmapFiles([species,back,
(pokemon.isFemale?),
pokemon.isShiny?,
(pokemon.form rescue 0),
(pokemon.isShadow? rescue false),
(pokemon.isDelta? rescue false)])
# Alter bitmap if supported
alterBitmap=(MultipleForms.getFunction(species,"alterBitmap") rescue nil)
end
if bitmapFileName && alterBitmap
animatedBitmap=AnimatedBitmap.new(bitmapFileName)
copiedBitmap=animatedBitmap.copy
animatedBitmap.dispose
copiedBitmap.each {|bitmap|
alterBitmap.call(pokemon,bitmap)
}
ret=copiedBitmap
if defined?(DynamicPokemonSprite) # if EBS code exists
animatedBitmap=AnimatedBitmapWrapper.new(bitmapFileName,scale)
animatedBitmap.prepareStrip
for i in 0...animatedBitmap.totalFrames
alterBitmap.call(pokemon,animatedBitmap.alterBitmap(i))
end
animatedBitmap.compileStrip
ret=animatedBitmap
end
elsif bitmapFileName
ret=AnimatedBitmap.new(bitmapFileName)
ret=AnimatedBitmapWrapper.new(bitmapFileName,scale) if defined?(DynamicPokemonSprite) # if EBS code exists
end
return ret
end
# Note: Returns an AnimatedBitmap, not a Bitmap
def pbLoadSpeciesBitmap(species,female=false,form=0,shiny=false,shadow=false,back=false,egg=false,delta=false)
ret=nil
if egg
bitmapFileName=sprintf("Graphics/Battlers/%segg",getConstantName(PBSpecies,species)) rescue nil
if !pbResolveBitmap(bitmapFileName)
bitmapFileName=sprintf("Graphics/Battlers/%03degg",species)
if !pbResolveBitmap(bitmapFileName)
bitmapFileName=sprintf("Graphics/Battlers/egg")
end
end
bitmapFileName=pbResolveBitmap(bitmapFileName)
else
bitmapFileName=pbCheckPokemonBitmapFiles([species,back,female,shiny,form,shadow,delta])
end
if bitmapFileName
ret=AnimatedBitmap.new(bitmapFileName)
end
return ret
end
def pbCheckPokemonBitmapFiles(params)
species=params[0]
back=params[1]
factors=[]
factors.push([5,params[5],false]) if params[5] && params[5]!=false # shadow
factors.push([2,params[2],false]) if params[2] && params[2]!=false # gender
factors.push([3,params[3],false]) if params[3] && params[3]!=false # shiny
factors.push([4,params[4].to_s,""]) if params[4] && params[4].to_s!="" &&
params[4].to_s!="0" # form
factors.push([6,params[6],false]) if params[6] && params[6]!=false # shiny
tshadow=false
tgender=false
tshiny=false
tdelta=false
tform=""
for i in 0...2**factors.length
for j in 0...factors.length
case factors[j][0]
when 2 # gender
tgender=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
when 3 # shiny
tshiny=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
when 4 # form
tform=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
when 5 # shadow
tshadow=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
when 6 # delta
tdelta=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
end
end
folder=""
if defined?(GetKeyItemScene) # if BW data exists
folder="Front/"
folder="Back/" if back
folder="FrontShiny/" if tshiny
folder="BackShiny/" if back && tshiny
folder+="Female/" if tgender
end
bitmapFileName=sprintf("Graphics/Battlers/%s%s%s%s%s%s%s%s",
folder,
getConstantName(PBSpecies,species),
tgender ? "f" : "",
tshiny ? "s" : "",
tdelta ? "d" : "",
back ? "b" : "",
(tform!="" ? "_"+tform : ""),
tshadow ? "_shadow" : "") rescue nil
ret=pbResolveBitmap(bitmapFileName)
return ret if ret
bitmapFileName=sprintf("Graphics/Battlers/%s%03d%s%s%s%s%s%s",
folder, species,
tgender ? "f" : "",
tshiny ? "s" : "",
tdelta ? "d" : "",
back ? "b" : "",
(tform!="" ? "_"+tform : ""),
tshadow ? "_shadow" : "")
ret=pbResolveBitmap(bitmapFileName)
return ret if ret
end
return nil
end
def pbPokemonIconFile(pokemon)
bitmapFileName=nil
bitmapFileName=pbCheckPokemonIconFiles([pokemon.species,
(pokemon.isFemale?),
pokemon.isShiny?,
(pokemon.form rescue 0),
(pokemon.isShadow? rescue false),
pokemon.isDelta?],
pokemon.isEgg?)
return bitmapFileName
end
def pbCheckPokemonIconFiles(params,egg=false)
species=params[0]
if egg
bitmapFileName=sprintf("Graphics/Icons/icon%segg",getConstantName(PBSpecies,species)) rescue nil
if !pbResolveBitmap(bitmapFileName)
bitmapFileName=sprintf("Graphics/Icons/icon%03degg",species)
if !pbResolveBitmap(bitmapFileName)
bitmapFileName=sprintf("Graphics/Icons/iconEgg")
end
end
return pbResolveBitmap(bitmapFileName)
else
factors=[]
factors.push([4,params[4],false]) if params[4] && params[4]!=false # shadow
factors.push([1,params[1],false]) if params[1] && params[1]!=false # gender
factors.push([2,params[2],false]) if params[2] && params[2]!=false # shiny
factors.push([5,params[5],false]) if params[5] && params[5]!=false # delta
factors.push([3,params[3].to_s,""]) if params[3] && params[3].to_s!="" &&
params[3].to_s!="0" # form
tshadow=false
tgender=false
tshiny=false
tdelta=false
tform=""
for i in 0...2**factors.length
for j in 0...factors.length
case factors[j][0]
when 1 # gender
tgender=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
when 2 # shiny
tshiny=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
when 3 # form
tform=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
when 4 # shadow
tshadow=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
when 5 # delta
tdelta=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
end
end
bitmapFileName=sprintf("Graphics/Icons/icon%s%s%s%s%s%s",
getConstantName(PBSpecies,species),
tgender ? "f" : "",
tshiny ? "s" : "",
tdelta ? "d" : "",
(tform!="" ? "_"+tform : ""),
tshadow ? "_shadow" : "") rescue nil
ret=pbResolveBitmap(bitmapFileName)
return ret if ret
bitmapFileName=sprintf("Graphics/Icons/icon%03d%s%s%s%s%s",
species,
tgender ? "f" : "",
tshiny ? "s" : "",
tdelta ? "d" : "",
(tform!="" ? "_"+tform : ""),
tshadow ? "_shadow" : "")
ret=pbResolveBitmap(bitmapFileName)
return ret if ret
end
end
return nil
end
#########################################################################
# Following Pokemon compatibility
#########################################################################
class DependentEvents
def change_sprite(id, shiny=nil, animation=nil, form=nil, gender=nil, shadow=false, delta=nil)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][8]=="Dependent"
file=FOLLOWER_FILE_DIR+pbCheckPokemonFollowerFiles([id,gender,shiny,delta,form,shadow])
events[i][6]=file
@realEvents[i].character_name=file
if animation
$scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
end
$game_variables[Walking_Time_Variable]=0
end
end
end
def refresh_sprite(animation=true)
if $game_variables[Current_Following_Variable]!=0
return unless $game_switches[Toggle_Following_Switch]
return if $PokemonGlobal.bicycle
if $Trainer.party[0].isShiny?
shiny=true
else
shiny=false
end
if defined?($Trainer.party[0].isDelta?)
delta = $Trainer.party[0].isDelta?
else
delta = false
end
if $Trainer.party[0].form>0
form=$Trainer.party[0].form
else
form=nil
end
if defined?($Trainer.party[0].isShadow?)
shadow = $Trainer.party[0].isShadow?
else
shadow = false
end
if $PokemonGlobal.surfing
if $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg? && $Trainer.party[0].hasType?(:WATER)
events=$PokemonGlobal.dependentEvents
if animation
for i in 0...events.length
$scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
pbWait(10)
end
end
change_sprite($Trainer.party[0].species, shiny, false, form, $Trainer.party[0].gender, shadow, delta)
elsif ALWAYS_ANIMATED_CAN_SURF && ($Trainer.party[0].hasType?(:FLYING) ||
isConst?($Trainer.party[0].ability,PBAbilities,:LEVITATE) ||
ALWAYS_ANIMATED_FOLLOWERS.include?($Trainer.party[0].species)) &&
!(ALWAYS_ANIMATED_EXCEPTION.include?($Trainer.party[0].species)) &&
$Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg?
events=$PokemonGlobal.dependentEvents
if animation
for i in 0...events.length
$scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
pbWait(10)
end
end
change_sprite($Trainer.party[0].species, shiny, false, form, $Trainer.party[0].gender, shadow, delta)
else
remove_sprite(false)
end
elsif $PokemonGlobal.diving
if $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg? && $Trainer.party[0].hasType?(:WATER) && WATERPOKEMONCANDIVE
events=$PokemonGlobal.dependentEvents
if animation
for i in 0...events.length
$scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
pbWait(10)
end
end
change_sprite($Trainer.party[0].species, shiny, false, form, $Trainer.party[0].gender, shadow, delta)
else
remove_sprite(false)
end
else
if $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg? && $scene.is_a?(Scene_Map)
events=$PokemonGlobal.dependentEvents
if animation
for i in 0...events.length
$scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
pbWait(10)
end
end
change_sprite($Trainer.party[0].species, shiny, false, form, $Trainer.party[0].gender, shadow, delta)
elsif $Trainer.party[0].hp<=0 || $Trainer.party[0].isEgg?
remove_sprite(animation)
end
end
else
check_faint
end
end
def Come_back(shiny=nil, animation=nil, delta=nil)
return if !$game_variables[Following_Activated_Switch]
return if $Trainer.party.length==0
$PokemonTemp.dependentEvents.pbMoveDependentEvents
events=$PokemonGlobal.dependentEvents
if $game_variables[Current_Following_Variable]==$Trainer.party[0]
remove_sprite(false)
if $scene.is_a?(Scene_Map)
for i in 0...events.length
$scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
end
end
end
if $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg?
$game_variables[Current_Following_Variable]=$Trainer.party[0]
refresh_sprite(animation)
end
for i in 0...events.length
if events[i] && events[i][8]=="Dependent"
file=FOLLOWER_FILE_DIR+pbCheckPokemonFollowerFiles([id,gender,shiny,delta,form,shadow])
events[i][6]=file
@realEvents[i].character_name=file
if animation
$scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
end
end
end
end
end
# this is an entirely new function, not found in the official release of Following Pokemon
# it searches for Follower sprites the same way base Essentials searches for battlers and icons
# rather than a series of "if-than" events
def pbCheckPokemonFollowerFiles(params)
species=params[0]
factors=[]
factors.push([1,params[1],false]) if params[1] && params[1]!=false # gender
factors.push([2,params[2],false]) if params[2] && params[2]!=false # shiny
factors.push([3,params[3],false]) if params[3] && params[3]!=false # delta
factors.push([4,params[4].to_s,""]) if params[4] && params[4].to_s!="" # form
factors.push([5,params[5],false]) if params[5] && params[5]!=false # shadow
tshadow=false
tgender=false
tshiny=false
tdelta=false
tform=""
for i in 0...2**factors.length
for j in 0...factors.length
case factors[j][0]
when 1 # gender
tgender=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
when 2 # shiny
tshiny=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
when 3 # delta
tdelta=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
when 4 # form
tform=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
when 5 # shadow
tshadow=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
end
end
bitmapFileName=sprintf("%s%s%s%s%s%s",
getConstantName(PBSpecies,species),
tgender ? "f" : "",
tshiny ? "s" : "",
tdelta ? "d" : "",
(tform!="" ? "_"+tform : ""),
tshadow ? "_shadow" : "") rescue nil
ret=pbResolveBitmap(sprintf("%s%s%s",FOLLOWER_FILE_PATH,FOLLOWER_FILE_DIR,bitmapFileName))
return bitmapFileName if ret
bitmapFileName=sprintf("%03d%s%s%s%s%s",
species,
tgender ? "f" : "",
tshiny ? "s" : "",
tdelta ? "d" : "",
(tform!="" ? "_"+tform : ""),
tshadow ? "_shadow" : "")
ret=pbResolveBitmap(sprintf("%s%s%s",FOLLOWER_FILE_PATH,FOLLOWER_FILE_DIR,bitmapFileName))
return bitmapFileName if ret
end
end
##############################################################
# Hybrid AnimatedBitmapWrapper class to encompass both the
# EBS version's inputs and the BW version's ones
##############################################################
class AnimatedBitmapWrapper
attr_reader :width
attr_reader :height
attr_reader :totalFrames
attr_reader :animationFrames
attr_reader :currentIndex
attr_accessor :scale
def initialize(file,twoframe_scale=2)
raise "filename is nil" if file==nil
if scale.is_a?(Numeric) # EBS version
@scale = twoframe_scale
@twoframe = false
elsif !!scale == scale # BW version
@scale = 2
@twoframe = twoframe_scale
end
@width = 0
@height = 0
@frame = 0
@frames = 2
@direction = +1
@animationFinish = false
@totalFrames = 0
@currentIndex = 0
@speed = 1
# 0 - not moving at all
# 1 - normal speed
# 2 - medium speed
# 3 - slow speed
bmp = BitmapCache.load_bitmap(file)
#bmp = Bitmap.new(file)
@bitmapFile=Bitmap.new(bmp.width,bmp.height); @bitmapFile.blt(0,0,bmp,Rect.new(0,0,bmp.width,bmp.height))
# initializes full Pokemon bitmap
@bitmap=Bitmap.new(@bitmapFile.width,@bitmapFile.height)
@bitmap.blt(0,0,@bitmapFile,Rect.new(0,0,@bitmapFile.width,@bitmapFile.height))
@[email protected]*@scale
@[email protected]*@scale
@[email protected]/@bitmap.height
@animationFrames=@totalFrames*@frames
# calculates total number of frames
@loop_points=[0,@totalFrames]
# first value is start, second is end
@actualBitmap=Bitmap.new(@width,@height)
@actualBitmap.clear
@actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))
end
alias initialize_elite initialize
def length; @totalFrames; end
def disposed?; @actualBitmap.disposed?; end
def dispose; @actualBitmap.dispose; end
def copy; @actualBitmap.clone; end
def bitmap; @actualBitmap; end
def bitmap=(val); @actualBitmap=val; end
def each; end
def alterBitmap(index); return @strip[index]; end
def prepareStrip
@strip=[]
for i in 0...@totalFrames
bitmap=Bitmap.new(@width,@height)
bitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmapFile,Rect.new((@width/@scale)*i,0,@width/@scale,@height/@scale))
@strip.push(bitmap)
end
end
def compileStrip
@bitmap.clear
for i in [email protected]
@bitmap.stretch_blt(Rect.new((@width/@scale)*i,0,@width/@scale,@height/@scale),@strip[i],Rect.new(0,0,@width,@height))
end
end
def reverse
if @direction > 0
@direction=-1
elsif @direction < 0
@direction=+1
end
end
def setLoop(start, finish)
@loop_points=[start,finish]
end
def setSpeed(value)
@speed=value
end
def toFrame(frame)
if frame.is_a?(String)
if frame=="last"
frame=@totalFrames-1
else
frame=0
end
end
frame=@totalFrames if frame > @totalFrames
frame=0 if frame < 0
@currentIndex=frame
@actualBitmap.clear
@actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))
end
def play
return if @currentIndex >= @loop_points[1]-1
self.update
end
def finished?
return (@currentIndex==@totalFrames-1)
end
def update
return false if @actualBitmap.disposed?
return false if @speed < 1
case @speed
# frame skip
when 1
@frames=2
when 2
@frames=4
when 3
@frames=5
end
@frame+=1
if @frame >=@frames
# processes animation speed
@currentIndex+=@direction
@currentIndex=@loop_points[0] if @currentIndex >=@loop_points[1]
@currentIndex=@loop_points[1]-1 if @currentIndex < @loop_points[0]
@frame=0
end
@actualBitmap.clear
@actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))
# updates the actual bitmap
end
alias update_elite update
# returns bitmap to original state
def deanimate
@frame=0
@currentIndex=0
@actualBitmap.clear
@actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))
end
end
##############################################################
# Alolan Form differences
##############################################################
MultipleForms.register(:RAICHU,{
"getFormName"=>proc{|pokemon|
next _INTL("Alola Form") if pokemon.isDelta?
next
},
"type2"=>proc{|pokemon|
next getID(PBTypes,:PSYCHIC) if pokemon.isDelta?
next
},
"height"=>proc{|pokemon|
next 0.7 if pokemon.isDelta?
next
},
"weight"=>proc{|pokemon|
next 21.0 if pokemon.isDelta?
next
},
"getAbilityList"=>proc{|pokemon|
if pokemon.isDelta?
next [[getID(PBAbilities,:SURGESURFER),0],
[getID(PBAbilities,:SURGESURFER),2]]
end
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
MultipleForms.register(:MEOWTH,{
"getFormName"=>proc{|pokemon|
next _INTL("Alola Form") if pokemon.isDelta?
next
},
"type1"=>proc{|pokemon|
next getID(PBTypes,:DARK) if pokemon.isDelta?
next
},
"type2"=>proc{|pokemon|
next getID(PBTypes,:DARK) if pokemon.isDelta?
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
MultipleForms.register(:MAROWAK,{
"getFormName"=>proc{|pokemon|
next _INTL("Alola Form") if pokemon.isDelta?
next
},
"type1"=>proc{|pokemon|
next getID(PBTypes,:FIRE) if pokemon.isDelta?
next
},
"type2"=>proc{|pokemon|
next getID(PBTypes,:GHOST) if pokemon.isDelta?
next
},
"weight"=>proc{|pokemon|
next 34.0 if pokemon.isDelta?
next
},
"getAbilityList"=>proc{|pokemon|
if pokemon.isDelta?
next [[getID(PBAbilities,:CURSEDBODY),0],
[getID(PBAbilities,:LIGHTNINGROD),1]]
end
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
MultipleForms.register(:VULPIX,{
"getFormName"=>proc{|pokemon|
next _INTL("Alola Form") if pokemon.isDelta?
next
},
"type1"=>proc{|pokemon|
next getID(PBTypes,:ICE) if pokemon.isDelta?
next
},
"type2"=>proc{|pokemon|
next getID(PBTypes,:ICE) if pokemon.isDelta?
next
},
"getMoveList"=>proc{|pokemon|
next if !pokemon.isDelta?
movelist=[]
if pokemon.isDelta?
movelist=[[1,:POWDERSNOW],[4,:TAILWHIP],[7,:ROAR],[9,:BABYDOLLEYES],
[10,:QUICKATTACK],[12,:CONFUSERAY],[15,:BLIZZARD],
[18,:PAYBACK],[20,:ICEPUNCH],[23,:FEINTATTACK],[26,:HEX],
[28,:ICEBEAM],[31,:EXTRASENSORY],[34,:SAFEGUARD],
[36,:FROSTBREATH],[39,:IMPRISON],[44,:GRUDGE],[47,:CAPTIVATE]]
end
for i in movelist
i[1]=getConst(PBMoves,i[1])
end
next movelist
},
"getAbilityList"=>proc{|pokemon|
if pokemon.isDelta?
next [[getID(PBAbilities,:SNOWCLOAK),0],
[getID(PBAbilities,:SNOWCLOAK),2]]
end
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
MultipleForms.register(:NINETAILS,{
"getFormName"=>proc{|pokemon|
next _INTL("Alola Form") if pokemon.isDelta?
next
},
"type1"=>proc{|pokemon|
next getID(PBTypes,:ICE) if pokemon.isDelta?
next
},
"type2"=>proc{|pokemon|
next getID(PBTypes,:FAIRY) if pokemon.isDelta?
next
},
"getMoveList"=>proc{|pokemon|
next if pokemon.form==0
movelist=[]
if pokemon.isDelta?
movelist=[[1,:IMPRISON],[1,:NASTYPLOT],[1,:ICEBEAM],[1,:QUICKATTACK],
[1,:CONFUSERAY],[1,:SAFEGUARD]]
end
for i in movelist
i[1]=getConst(PBMoves,i[1])
end
next movelist
},
"getAbilityList"=>proc{|pokemon|
if pokemon.isDelta?
next [[getID(PBAbilities,:SNOWCLOAK),0],
[getID(PBAbilities,:SNOWCLOAK),2]]
end
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
MultipleForms.register(:SANDSHREW,{
"getFormName"=>proc{|pokemon|
next _INTL("Alola Form") if pokemon.isDelta?
next
},
"type1"=>proc{|pokemon|
next getID(PBTypes,:ICE) if pokemon.isDelta?
next
},
"type2"=>proc{|pokemon|
next getID(PBTypes,:STEEL) if pokemon.isDelta?
next
},
"height"=>proc{|pokemon|
next 0.6 if pokemon.isDelta?
next
},
"weight"=>proc{|pokemon|
next 40.0 if pokemon.isDelta?
next
},
"getMoveList"=>proc{|pokemon|
next if pokemon.form==0
movelist=[]
if pokemon.isDelta?
movelist=[[1,:SCRATCH],[1,:DEFENSECURL],[3,:HAIL],[5,:ICEPUNCH],
[7,:ROLLOUT],[9,:RAPIDSPIN],[11,:CUT],[14,:SHEERCOLD],
[17,:SWIFT],[20,:FURYSWIPES],[23,:HAIL],[26,:SLASH],
[30,:DIG],[34,:GYROBALL],[38,:SWORDSDANCE],[42,:HAIL],]
end
for i in movelist
i[1]=getConst(PBMoves,i[1])
end
next movelist
},
"getAbilityList"=>proc{|pokemon|
if pokemon.isDelta?
next [[getID(PBAbilities,:SNOWCLOAK),0],
[getID(PBAbilities,:SNOWCLOAK),2]]
end
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
MultipleForms.register(:SANDSLASH,{
"getFormName"=>proc{|pokemon|
next _INTL("Alola Form") if pokemon.isDelta?
next
},
"type1"=>proc{|pokemon|
next getID(PBTypes,:ICE) if pokemon.isDelta?
next
},
"type2"=>proc{|pokemon|
next getID(PBTypes,:STEEL) if pokemon.isDelta?
next
},
"height"=>proc{|pokemon|
next 1.2 if pokemon.isDelta?
next
},
"weight"=>proc{|pokemon|
next 55.0 if pokemon.isDelta?
next
},
"getMoveList"=>proc{|pokemon|
next if pokemon.form==0
movelist=[]
if pokemon.isDelta?
movelist=[[1,:SCRATCH],[1,:DEFENSECURL],[3,:HAIL],[5,:ICEPUNCH],
[7,:ROLLOUT],[9,:RAPIDSPIN],[11,:CUT],[14,:SHEERCOLD],
[17,:SWIFT],[20,:FURYSWIPES],[23,:HAIL],[26,:SLASH],
[30,:DIG],[34,:GYROBALL],[38,:SWORDSDANCE],[42,:HAIL],]
end
for i in movelist
i[1]=getConst(PBMoves,i[1])
end
next movelist
},
"getAbilityList"=>proc{|pokemon|
if pokemon.isDelta?
next [[getID(PBAbilities,:SNOWCLOAK),0],
[getID(PBAbilities,:SNOWCLOAK),2]]
end
next
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
MultipleForms.register(:EXEGGUTOR,{
"getFormName"=>proc{|pokemon|
next _INTL("Alola Form") if pokemon.isDelta?
next
},
"type2"=>proc{|pokemon|
next getID(PBTypes,:DRAGON) if pokemon.isDelta?
next
},
"height"=>proc{|pokemon|
next 10.9 if pokemon.isDelta?
next
},
"weight"=>proc{|pokemon|
next 415.6 if pokemon.isDelta?
next
},
"getAbilityList"=>proc{|pokemon|
if pokemon.isDelta?
next [[getID(PBAbilities,:FRISK),0],
[getID(PBAbilities,:FRISK),2]]
end
next
},
"getMoveList"=>proc{|pokemon|
next if pokemon.form==0
movelist=[]
if pokemon.isDelta?
movelist=[[1,:SEEDBOMB],[1,:BARRAGE],[1,:HYPNOSIS],[1,:CONFUSION],
[1,:STOMP],[17,:PSYSHOCK],[27,:EGGBOMB],[37,:WOODHAMMER],
[47,:LEAFSTORM]]
end
for i in movelist
i[1]=getConst(PBMoves,i[1])
end
next movelist
},
"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
}
})
###################################################################
# EXAMPLE ENCOUNTER MODIFIER
# "pokemon.deltaflag=true" is how to make the Pokemon a Delta/Alolan
###################################################################
# Events.onWildPokemonCreate+=proc {|sender,e|
# pokemon=e[0]
# if $game_map.map_id==51 && isConst?(pokemon.species,PBSpecies,:EXEGGUTOR)
# pokemon.deltaflag=true
# end
# }