Added decent spacing to all scripts thanks to Rubocop

This commit is contained in:
Maruno17
2021-12-18 15:25:40 +00:00
parent f7b76ae62e
commit d17fc40a47
207 changed files with 18577 additions and 18587 deletions

View File

@@ -1,135 +1,135 @@
module MultipleForms
@@formSpecies = SpeciesHandlerHash.new
def self.copy(sym,*syms)
@@formSpecies.copy(sym,*syms)
def self.copy(sym, *syms)
@@formSpecies.copy(sym, *syms)
end
def self.register(sym,hash)
@@formSpecies.add(sym,hash)
def self.register(sym, hash)
@@formSpecies.add(sym, hash)
end
def self.registerIf(cond,hash)
@@formSpecies.addIf(cond,hash)
def self.registerIf(cond, hash)
@@formSpecies.addIf(cond, hash)
end
def self.hasFunction?(pkmn,func)
def self.hasFunction?(pkmn, func)
spec = (pkmn.is_a?(Pokemon)) ? pkmn.species : pkmn
sp = @@formSpecies[spec]
return sp && sp[func]
end
def self.getFunction(pkmn,func)
def self.getFunction(pkmn, func)
spec = (pkmn.is_a?(Pokemon)) ? pkmn.species : pkmn
sp = @@formSpecies[spec]
return (sp && sp[func]) ? sp[func] : nil
end
def self.call(func,pkmn,*args)
def self.call(func, pkmn, *args)
sp = @@formSpecies[pkmn.species]
return nil if !sp || !sp[func]
return sp[func].call(pkmn,*args)
return sp[func].call(pkmn, *args)
end
end
def drawSpot(bitmap,spotpattern,x,y,red,green,blue)
def drawSpot(bitmap, spotpattern, x, y, red, green, blue)
height = spotpattern.length
width = spotpattern[0].length
for yy in 0...height
spot = spotpattern[yy]
for xx in 0...width
if spot[xx]==1
xOrg = (x+xx)<<1
yOrg = (y+yy)<<1
color = bitmap.get_pixel(xOrg,yOrg)
r = color.red+red
g = color.green+green
b = color.blue+blue
color.red = [[r,0].max,255].min
color.green = [[g,0].max,255].min
color.blue = [[b,0].max,255].min
bitmap.set_pixel(xOrg,yOrg,color)
bitmap.set_pixel(xOrg+1,yOrg,color)
bitmap.set_pixel(xOrg,yOrg+1,color)
bitmap.set_pixel(xOrg+1,yOrg+1,color)
if spot[xx] == 1
xOrg = (x + xx) << 1
yOrg = (y + yy) << 1
color = bitmap.get_pixel(xOrg, yOrg)
r = color.red + red
g = color.green + green
b = color.blue + blue
color.red = [[r, 0].max, 255].min
color.green = [[g, 0].max, 255].min
color.blue = [[b, 0].max, 255].min
bitmap.set_pixel(xOrg, yOrg, color)
bitmap.set_pixel(xOrg + 1, yOrg, color)
bitmap.set_pixel(xOrg, yOrg + 1, color)
bitmap.set_pixel(xOrg + 1, yOrg + 1, color)
end
end
end
end
def pbSpindaSpots(pkmn,bitmap)
def pbSpindaSpots(pkmn, bitmap)
spot1 = [
[0,0,1,1,1,1,0,0],
[0,1,1,1,1,1,1,0],
[1,1,1,1,1,1,1,1],
[1,1,1,1,1,1,1,1],
[1,1,1,1,1,1,1,1],
[1,1,1,1,1,1,1,1],
[1,1,1,1,1,1,1,1],
[0,1,1,1,1,1,1,0],
[0,0,1,1,1,1,0,0]
[0, 0, 1, 1, 1, 1, 0, 0],
[0, 1, 1, 1, 1, 1, 1, 0],
[1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1],
[0, 1, 1, 1, 1, 1, 1, 0],
[0, 0, 1, 1, 1, 1, 0, 0]
]
spot2 = [
[0,0,1,1,1,0,0],
[0,1,1,1,1,1,0],
[1,1,1,1,1,1,1],
[1,1,1,1,1,1,1],
[1,1,1,1,1,1,1],
[1,1,1,1,1,1,1],
[1,1,1,1,1,1,1],
[0,1,1,1,1,1,0],
[0,0,1,1,1,0,0]
[0, 0, 1, 1, 1, 0, 0],
[0, 1, 1, 1, 1, 1, 0],
[1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1],
[0, 1, 1, 1, 1, 1, 0],
[0, 0, 1, 1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1,1,1,1,1,1,1,1,0],
[1,1,1,1,1,1,1,1,1,1,1,1],
[1,1,1,1,1,1,1,1,1,1,1,1],
[1,1,1,1,1,1,1,1,1,1,1,1],
[1,1,1,1,1,1,1,1,1,1,1,0],
[0,1,1,1,1,1,1,1,1,1,1,0],
[0,0,1,1,1,1,1,1,1,1,0,0],
[0,0,0,0,1,1,1,1,1,0,0,0]
[0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
[0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0]
]
id = pkmn.personalID
h = (id>>28)&15
g = (id>>24)&15
f = (id>>20)&15
e = (id>>16)&15
d = (id>>12)&15
c = (id>>8)&15
b = (id>>4)&15
a = (id)&15
h = (id >> 28) & 15
g = (id >> 24) & 15
f = (id >> 20) & 15
e = (id >> 16) & 15
d = (id >> 12) & 15
c = (id >> 8) & 15
b = (id >> 4) & 15
a = (id) & 15
if pkmn.shiny?
drawSpot(bitmap,spot1,b+33,a+25,-75,-10,-150)
drawSpot(bitmap,spot2,d+21,c+24,-75,-10,-150)
drawSpot(bitmap,spot3,f+39,e+7,-75,-10,-150)
drawSpot(bitmap,spot4,h+15,g+6,-75,-10,-150)
drawSpot(bitmap, spot1, b + 33, a + 25, -75, -10, -150)
drawSpot(bitmap, spot2, d + 21, c + 24, -75, -10, -150)
drawSpot(bitmap, spot3, f + 39, e + 7, -75, -10, -150)
drawSpot(bitmap, spot4, h + 15, g + 6, -75, -10, -150)
else
drawSpot(bitmap,spot1,b+33,a+25,0,-115,-75)
drawSpot(bitmap,spot2,d+21,c+24,0,-115,-75)
drawSpot(bitmap,spot3,f+39,e+7,0,-115,-75)
drawSpot(bitmap,spot4,h+15,g+6,0,-115,-75)
drawSpot(bitmap, spot1, b + 33, a + 25, 0, -115, -75)
drawSpot(bitmap, spot2, d + 21, c + 24, 0, -115, -75)
drawSpot(bitmap, spot3, f + 39, e + 7, 0, -115, -75)
drawSpot(bitmap, spot4, h + 15, g + 6, 0, -115, -75)
end
end
@@ -137,39 +137,39 @@ end
# Regular form differences
#===============================================================================
MultipleForms.register(:UNOWN,{
MultipleForms.register(:UNOWN, {
"getFormOnCreation" => proc { |pkmn|
next rand(28)
}
})
MultipleForms.register(:SPINDA,{
"alterBitmap" => proc { |pkmn,bitmap|
pbSpindaSpots(pkmn,bitmap)
MultipleForms.register(:SPINDA, {
"alterBitmap" => proc { |pkmn, bitmap|
pbSpindaSpots(pkmn, bitmap)
}
})
MultipleForms.register(:CASTFORM,{
"getFormOnLeavingBattle" => proc { |pkmn,battle,usedInBattle,endBattle|
MultipleForms.register(:CASTFORM, {
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next 0
}
})
MultipleForms.register(:GROUDON,{
MultipleForms.register(:GROUDON, {
"getPrimalForm" => proc { |pkmn|
next 1 if pkmn.hasItem?(:REDORB)
next
}
})
MultipleForms.register(:KYOGRE,{
MultipleForms.register(:KYOGRE, {
"getPrimalForm" => proc { |pkmn|
next 1 if pkmn.hasItem?(:BLUEORB)
next
}
})
MultipleForms.register(:BURMY,{
MultipleForms.register(:BURMY, {
"getFormOnCreation" => proc { |pkmn|
case pbGetEnvironment
when :Rock, :Sand, :Cave
@@ -180,7 +180,7 @@ MultipleForms.register(:BURMY,{
next 0 # Plant Cloak
end
},
"getFormOnLeavingBattle" => proc { |pkmn,battle,usedInBattle,endBattle|
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next if !endBattle || !usedInBattle
case battle.environment
when :Rock, :Sand, :Cave
@@ -193,7 +193,7 @@ MultipleForms.register(:BURMY,{
}
})
MultipleForms.register(:WORMADAM,{
MultipleForms.register(:WORMADAM, {
"getFormOnCreation" => proc { |pkmn|
case pbGetEnvironment
when :Rock, :Sand, :Cave
@@ -206,8 +206,8 @@ MultipleForms.register(:WORMADAM,{
}
})
MultipleForms.register(:CHERRIM,{
"getFormOnLeavingBattle" => proc { |pkmn,battle,usedInBattle,endBattle|
MultipleForms.register(:CHERRIM, {
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next 0
}
})
@@ -257,9 +257,9 @@ MultipleForms.register(:ROTOM, {
}
})
MultipleForms.register(:GIRATINA,{
MultipleForms.register(:GIRATINA, {
"getForm" => proc { |pkmn|
maps = [49,50,51,72,73] # Map IDs for Origin Forme
maps = [49, 50, 51, 72, 73] # Map IDs for Origin Forme
if pkmn.hasItem?(:GRISEOUSORB) || ($game_map && maps.include?($game_map.map_id))
next 1
end
@@ -267,13 +267,13 @@ MultipleForms.register(:GIRATINA,{
}
})
MultipleForms.register(:SHAYMIN,{
MultipleForms.register(:SHAYMIN, {
"getForm" => proc { |pkmn|
next 0 if pkmn.fainted? || pkmn.status == :FROZEN || PBDayNight.isNight?
}
})
MultipleForms.register(:ARCEUS,{
MultipleForms.register(:ARCEUS, {
"getForm" => proc { |pkmn|
next nil if !pkmn.hasAbility?(:MULTITYPE)
typeArray = {
@@ -308,26 +308,26 @@ MultipleForms.register(:ARCEUS,{
}
})
MultipleForms.register(:DARMANITAN,{
"getFormOnLeavingBattle" => proc { |pkmn,battle,usedInBattle,endBattle|
MultipleForms.register(:DARMANITAN, {
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next 2 * (pkmn.form / 2)
}
})
MultipleForms.register(:DEERLING,{
MultipleForms.register(:DEERLING, {
"getForm" => proc { |pkmn|
next pbGetSeason
}
})
MultipleForms.copy(:DEERLING,:SAWSBUCK)
MultipleForms.copy(:DEERLING, :SAWSBUCK)
MultipleForms.register(:KYUREM,{
"getFormOnEnteringBattle" => proc { |pkmn,wild|
next pkmn.form+2 if pkmn.form==1 || pkmn.form==2
MultipleForms.register(:KYUREM, {
"getFormOnEnteringBattle" => proc { |pkmn, wild|
next pkmn.form + 2 if pkmn.form == 1 || pkmn.form == 2
},
"getFormOnLeavingBattle" => proc { |pkmn,battle,usedInBattle,endBattle|
next pkmn.form-2 if pkmn.form>=3 # Fused forms stop glowing
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next pkmn.form - 2 if pkmn.form >= 3 # Fused forms stop glowing
},
"onSetForm" => proc { |pkmn, form, oldForm|
case form
@@ -354,20 +354,20 @@ MultipleForms.register(:KYUREM,{
}
})
MultipleForms.register(:KELDEO,{
MultipleForms.register(:KELDEO, {
"getForm" => proc { |pkmn|
next 1 if pkmn.hasMove?(:SECRETSWORD) # Resolute Form
next 0 # Ordinary Form
}
})
MultipleForms.register(:MELOETTA,{
"getFormOnLeavingBattle" => proc { |pkmn,battle,usedInBattle,endBattle|
MultipleForms.register(:MELOETTA, {
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next 0
}
})
MultipleForms.register(:GENESECT,{
MultipleForms.register(:GENESECT, {
"getForm" => proc { |pkmn|
next 1 if pkmn.hasItem?(:SHOCKDRIVE)
next 2 if pkmn.hasItem?(:BURNDRIVE)
@@ -377,47 +377,47 @@ MultipleForms.register(:GENESECT,{
}
})
MultipleForms.register(:GRENINJA,{
"getFormOnLeavingBattle" => proc { |pkmn,battle,usedInBattle,endBattle|
MultipleForms.register(:GRENINJA, {
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next 1 if pkmn.form == 2 && (pkmn.fainted? || endBattle)
}
})
MultipleForms.register(:SCATTERBUG,{
MultipleForms.register(:SCATTERBUG, {
"getFormOnCreation" => proc { |pkmn|
next $player.secret_ID % 18
}
})
MultipleForms.copy(:SCATTERBUG,:SPEWPA,:VIVILLON)
MultipleForms.copy(:SCATTERBUG, :SPEWPA, :VIVILLON)
MultipleForms.register(:FURFROU,{
MultipleForms.register(:FURFROU, {
"getForm" => proc { |pkmn|
if !pkmn.time_form_set ||
pbGetTimeNow.to_i > pkmn.time_form_set.to_i + 60 * 60 * 24 * 5 # 5 days
next 0
end
},
"onSetForm" => proc { |pkmn,form,oldForm|
"onSetForm" => proc { |pkmn, form, oldForm|
pkmn.time_form_set = (form > 0) ? pbGetTimeNow.to_i : nil
}
})
MultipleForms.register(:ESPURR,{
MultipleForms.register(:ESPURR, {
"getForm" => proc { |pkmn|
next pkmn.gender
}
})
MultipleForms.copy(:ESPURR,:MEOWSTIC)
MultipleForms.copy(:ESPURR, :MEOWSTIC)
MultipleForms.register(:AEGISLASH,{
"getFormOnLeavingBattle" => proc { |pkmn,battle,usedInBattle,endBattle|
MultipleForms.register(:AEGISLASH, {
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next 0
}
})
MultipleForms.register(:PUMPKABOO,{
MultipleForms.register(:PUMPKABOO, {
"getFormOnCreation" => proc { |pkmn|
r = rand(100)
next 3 if r < 5 # Super Size (5%)
@@ -427,36 +427,36 @@ MultipleForms.register(:PUMPKABOO,{
}
})
MultipleForms.copy(:PUMPKABOO,:GOURGEIST)
MultipleForms.copy(:PUMPKABOO, :GOURGEIST)
MultipleForms.register(:XERNEAS,{
"getFormOnEnteringBattle" => proc { |pkmn,wild|
MultipleForms.register(:XERNEAS, {
"getFormOnEnteringBattle" => proc { |pkmn, wild|
next 1
},
"getFormOnLeavingBattle" => proc { |pkmn,battle,usedInBattle,endBattle|
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next 0
}
})
MultipleForms.register(:ZYGARDE,{
"getFormOnLeavingBattle" => proc { |pkmn,battle,usedInBattle,endBattle|
next pkmn.form-2 if pkmn.form>=2 && (pkmn.fainted? || endBattle)
MultipleForms.register(:ZYGARDE, {
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next pkmn.form - 2 if pkmn.form >= 2 && (pkmn.fainted? || endBattle)
}
})
MultipleForms.register(:HOOPA,{
MultipleForms.register(:HOOPA, {
"getForm" => proc { |pkmn|
if !pkmn.time_form_set ||
pbGetTimeNow.to_i > pkmn.time_form_set.to_i + 60 * 60 * 24 * 3 # 3 days
next 0
end
},
"onSetForm" => proc { |pkmn,form,oldForm|
pkmn.time_form_set = (form>0) ? pbGetTimeNow.to_i : nil
"onSetForm" => proc { |pkmn, form, oldForm|
pkmn.time_form_set = (form > 0) ? pbGetTimeNow.to_i : nil
}
})
MultipleForms.register(:ROCKRUFF,{
MultipleForms.register(:ROCKRUFF, {
"getForm" => proc { |pkmn|
next if pkmn.form_simple >= 2 # Own Tempo Rockruff cannot become another form
next 1 if PBDayNight.isNight?
@@ -464,7 +464,7 @@ MultipleForms.register(:ROCKRUFF,{
}
})
MultipleForms.register(:LYCANROC,{
MultipleForms.register(:LYCANROC, {
"getFormOnCreation" => proc { |pkmn|
next 2 if PBDayNight.isEvening? # Dusk
next 1 if PBDayNight.isNight? # Midnight
@@ -472,13 +472,13 @@ MultipleForms.register(:LYCANROC,{
}
})
MultipleForms.register(:WISHIWASHI,{
"getFormOnLeavingBattle" => proc { |pkmn,battle,usedInBattle,endBattle|
MultipleForms.register(:WISHIWASHI, {
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next 0
}
})
MultipleForms.register(:SILVALLY,{
MultipleForms.register(:SILVALLY, {
"getForm" => proc { |pkmn|
next nil if !pkmn.hasAbility?(:RKSSYSTEM)
typeArray = {
@@ -507,34 +507,34 @@ MultipleForms.register(:SILVALLY,{
ret = f
break
end
break if ret>0
break if ret > 0
end
next ret
}
})
MultipleForms.register(:MINIOR,{
MultipleForms.register(:MINIOR, {
"getFormOnCreation" => proc { |pkmn|
next 7+rand(7) # Meteor forms are 0-6, Core forms are 7-13
next 7 + rand(7) # Meteor forms are 0-6, Core forms are 7-13
},
"getFormOnEnteringBattle" => proc { |pkmn,wild|
next pkmn.form-7 if pkmn.form>=7 && wild # Wild Minior always appear in Meteor form
"getFormOnEnteringBattle" => proc { |pkmn, wild|
next pkmn.form - 7 if pkmn.form >= 7 && wild # Wild Minior always appear in Meteor form
},
"getFormOnLeavingBattle" => proc { |pkmn,battle,usedInBattle,endBattle|
next pkmn.form+7 if pkmn.form<7
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next pkmn.form + 7 if pkmn.form < 7
}
})
MultipleForms.register(:MIMIKYU,{
"getFormOnLeavingBattle" => proc { |pkmn,battle,usedInBattle,endBattle|
MultipleForms.register(:MIMIKYU, {
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next 0 if pkmn.fainted? || endBattle
}
})
MultipleForms.register(:NECROZMA,{
"getFormOnLeavingBattle" => proc { |pkmn,battle,usedInBattle,endBattle|
MultipleForms.register(:NECROZMA, {
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
# Fused forms are 1 and 2, Ultra form is 3 or 4 depending on which fusion
next pkmn.form-2 if pkmn.form>=3 && (pkmn.fainted? || endBattle)
next pkmn.form - 2 if pkmn.form >= 3 && (pkmn.fainted? || endBattle)
},
"onSetForm" => proc { |pkmn, form, oldForm|
next if form > 2 || oldForm > 2 # Ultra form changes don't affect moveset