- 800
- Posts
- 9
- Years
- The Dissa Region
- Seen Oct 7, 2024
Now that you know the thing looks right, you can revert DELTAPOKEMONCHANCE to its initial value and now know that Delta Pokemon work right.
# Makes this Pokemon delta species.
def makeDelta
case rand(17)
when 0
@deltatype=0
when 1
@deltatype=1
when 2
@deltatype=2
when 3
@deltatype=3
when 4
@deltatype=4
when 5
@deltatype=5
when 6
@deltatype=6
when 7
@deltatype=7
when 8
@deltatype=8
when 9
@deltatype=10
when 10
@deltatype=11
when 11
@deltatype=12
when 12
@deltatype=13
when 13
@deltatype=14
when 14
@deltatype=15
when 15
@deltatype=16
when 16
@deltatype=17
when 17
@deltatype=18
end
case rand(22)
when 0
@deltatype2=0
when 1
@deltatype2=1
when 2
@deltatype2=2
when 3
@deltatype2=3
when 4
@deltatype2=4
when 5
@deltatype2=5
when 6
@deltatype2=6
when 7
@deltatype2=7
when 8
@deltatype2=8
when 9
@deltatype2=10
when 10
@deltatype2=11
when 11
@deltatype2=12
when 12
@deltatype2=13
when 13
@deltatype2=14
when 14
@deltatype2=15
when 15
@deltatype2=16
when 16
@deltatype2=17
when 17
@deltatype2=18
end
@deltaflag=true
end
# Returns this Pokémon's second type.
def type2
if self.isDelta?
ret=((@personalID/4)/17)%17
ret+=1 if ret>8
ret=@deltatype if @deltatype != nil
ret=@deltatype2 if @deltatype2 != nil
return ret
end
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,@species,9)
ret=dexdata.fgetb
dexdata.close
return ret
end
p=PokeBattle_Pokemon.new(:GLACEON,30,$Trainer)
p.makeDelta
p.deltaflag=getConst(PBTypes,:PSYCHIC)
p.deltaflag2=getConst(PBTypes,:FIGHTING)
# Masuda method and Shiny Charm
shinyretries=0
shinyretries+=10 if father.isShiny? && mother.isShiny?
shinyretries+=5 if father.language!=mother.language
shinyretries+=4 if father.isShiny? || mother.isShiny?
shinyretries+=2 if hasConst?(PBItems,:SHINYCHARM) &&
$PokemonBag.pbQuantity(:SHINYCHARM)>0
I didn't realize that was what it was like. I might have to adjust the number then. Just to be clear, we're both thinking of this code, right?
Code:# Masuda method and Shiny Charm shinyretries=0 shinyretries+=10 if father.isShiny? && mother.isShiny? shinyretries+=5 if father.language!=mother.language shinyretries+=4 if father.isShiny? || mother.isShiny? shinyretries+=2 if hasConst?(PBItems,:SHINYCHARM) && $PokemonBag.pbQuantity(:SHINYCHARM)>0
# Masuda method and Shiny Charm
shinyretries=0
shinyretries+=10 if father.isShiny? && mother.isShiny?[COLOR="Red"]
shinyretries+=10 if father.isDelta? && mother.isDelta?[/COLOR]
shinyretries+=5 if father.language!=mother.language
shinyretries+=4 if father.isShiny? || mother.isShiny?[COLOR="Red"]
shinyretries+=4 if father.isDelta? || mother.isDelta?[/COLOR]
shinyretries+=2 if hasConst?(PBItems,:SHINYCHARM) &&
$PokemonBag.pbQuantity(:SHINYCHARM)>0
if shinyretries>0
for i in 0...shinyretries
break if egg.isShiny?[COLOR="Red"] || egg.isDelta?[/COLOR]
egg.personalID=rand(65536)|(rand(65536)<<16)
end
end
# Inheriting form
if isConst?(babyspecies,PBSpecies,:BURMY) ||
isConst?(babyspecies,PBSpecies,:SHELLOS) ||
isConst?(babyspecies,PBSpecies,:BASCULIN)
egg.form=mother.form
end
# parents' Delta types
delta_types=[]
if mother.isDelta?
delta_types.push(mother.type1)
delta_types.push(mother.type2) if !delta_types.include?(mother.type2)
end
if father.isDelta?
delta_types.push(father.type1) if !delta_types.include?(father.type1)
delta_types.push(father.type2) if !delta_types.include?(father.type2)
end
case delta_types.length
when 1
egg.deltatype=delta_types[0]
when 2
egg.deltatype=delta_types[0]
egg.deltatype2=delta_types[1]
when 3,4
bob=rand(delta_types.length)
egg.deltatype=delta_types[bob]
delta_types[bob]=nil
delta_types.compact!
bob=rand(delta_types.length)
egg.deltatype2=delta_types[bob]
end