mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-03-15 21:02:00 +00:00
Resolved many Rubocop warnings
This commit is contained in:
@@ -29,7 +29,7 @@ class Window_Pokedex < Window_DrawableCommand
|
||||
return @commands.length
|
||||
end
|
||||
|
||||
def drawItem(index,count,rect)
|
||||
def drawItem(index,_count,rect)
|
||||
return if index>=self.top_row+self.page_item_max
|
||||
rect = Rect.new(rect.x+16,rect.y,rect.width-16,rect.height)
|
||||
species = @commands[index][0]
|
||||
@@ -431,7 +431,8 @@ class PokemonPokedex_Scene
|
||||
y = 78
|
||||
y += ((sliderheight-boxheight)*itemlist.top_row/(itemlist.row_max-itemlist.page_row_max)).floor
|
||||
overlay.blt(468,y,@sliderbitmap.bitmap,Rect.new(40,0,40,8))
|
||||
i = 0; while i*16<boxheight-8-16
|
||||
i = 0
|
||||
while i*16<boxheight-8-16
|
||||
height = [boxheight-8-16-i*16,16].min
|
||||
overlay.blt(468,y+8+i*16,@sliderbitmap.bitmap,Rect.new(40,8,40,height))
|
||||
i += 1
|
||||
@@ -440,7 +441,7 @@ class PokemonPokedex_Scene
|
||||
end
|
||||
end
|
||||
|
||||
def pbRefreshDexSearch(params,index)
|
||||
def pbRefreshDexSearch(params,_index)
|
||||
overlay = @sprites["overlay"].bitmap
|
||||
overlay.clear
|
||||
base = Color.new(248,248,248)
|
||||
@@ -509,7 +510,7 @@ class PokemonPokedex_Scene
|
||||
pbDrawTextPositions(overlay,textpos)
|
||||
end
|
||||
|
||||
def pbRefreshDexSearchParam(mode,cmds,sel,index)
|
||||
def pbRefreshDexSearchParam(mode,cmds,sel,_index)
|
||||
overlay = @sprites["overlay"].bitmap
|
||||
overlay.clear
|
||||
base = Color.new(248,248,248)
|
||||
@@ -795,7 +796,6 @@ class PokemonPokedex_Scene
|
||||
region = dexnames[pbGetSavePositionIndex][1]
|
||||
end
|
||||
end
|
||||
ret = -1
|
||||
scene = PokemonPokedexInfo_Scene.new
|
||||
screen = PokemonPokedexInfoScreen.new(scene)
|
||||
ret = screen.pbStartScreen(@dexlist,index,region)
|
||||
@@ -985,7 +985,6 @@ class PokemonPokedex_Scene
|
||||
|
||||
def pbDexSearch
|
||||
oldsprites = pbFadeOutAndHide(@sprites)
|
||||
oldparams = @searchParams
|
||||
params = @searchParams.clone
|
||||
@orderCommands = []
|
||||
@orderCommands[MODENUMERICAL] = _INTL("Numerical")
|
||||
|
||||
@@ -113,7 +113,7 @@ class Window_CommandPokemonColor < Window_CommandPokemon
|
||||
super(commands,width)
|
||||
end
|
||||
|
||||
def drawItem(index,count,rect)
|
||||
def drawItem(index,_count,rect)
|
||||
pbSetSystemFont(self.contents) if @starting
|
||||
rect = drawCursor(index,rect)
|
||||
base = self.baseColor
|
||||
@@ -134,7 +134,7 @@ end
|
||||
class PokemonPartyBlankPanel < SpriteWrapper
|
||||
attr_accessor :text
|
||||
|
||||
def initialize(pokemon,index,viewport=nil)
|
||||
def initialize(_pokemon,index,viewport=nil)
|
||||
super(viewport)
|
||||
self.x = [0,256,0,256,0,256][index]
|
||||
self.y = [0,16,96,112,192,208][index]
|
||||
@@ -165,7 +165,7 @@ class PokemonPartyPanel < SpriteWrapper
|
||||
attr_reader :selected
|
||||
attr_reader :preselected
|
||||
attr_reader :switching
|
||||
attr_accessor :text
|
||||
attr_reader :text
|
||||
|
||||
def initialize(pokemon,index,viewport=nil)
|
||||
super(viewport)
|
||||
@@ -832,7 +832,7 @@ class PokemonPartyScreen
|
||||
@party = party
|
||||
end
|
||||
|
||||
def pbStartScene(helptext,numBattlersOut,annotations=nil)
|
||||
def pbStartScene(helptext,_numBattlersOut,annotations=nil)
|
||||
@scene.pbStartScene(@party,helptext,annotations)
|
||||
end
|
||||
|
||||
|
||||
@@ -316,7 +316,6 @@ class PokemonSummary_Scene
|
||||
end
|
||||
# Draw all images
|
||||
pbDrawImagePositions(overlay,imagepos)
|
||||
textpos = []
|
||||
# Write various bits of text
|
||||
pagename = [_INTL("INFO"),
|
||||
_INTL("TRAINER MEMO"),
|
||||
@@ -516,8 +515,6 @@ class PokemonSummary_Scene
|
||||
|
||||
def drawPageTwo
|
||||
overlay = @sprites["overlay"].bitmap
|
||||
base = Color.new(248,248,248)
|
||||
shadow = Color.new(104,104,104)
|
||||
memo = ""
|
||||
# Write nature
|
||||
showNature = !@pokemon.shadowPokemon? || @pokemon.heartStage>3
|
||||
@@ -718,10 +715,8 @@ class PokemonSummary_Scene
|
||||
# Get data for selected move
|
||||
moveData = pbGetMoveData(moveid)
|
||||
basedamage = moveData[MOVE_BASE_DAMAGE]
|
||||
type = moveData[MOVE_TYPE]
|
||||
category = moveData[MOVE_CATEGORY]
|
||||
accuracy = moveData[MOVE_ACCURACY]
|
||||
move = moveid
|
||||
textpos = []
|
||||
# Write power and accuracy values for selected move
|
||||
if basedamage==0 # Status move
|
||||
@@ -818,8 +813,6 @@ class PokemonSummary_Scene
|
||||
|
||||
def drawPageFive
|
||||
overlay = @sprites["overlay"].bitmap
|
||||
base = Color.new(248,248,248)
|
||||
shadow = Color.new(104,104,104)
|
||||
@sprites["uparrow"].visible = false
|
||||
@sprites["downarrow"].visible = false
|
||||
# Write various bits of text
|
||||
@@ -1178,7 +1171,7 @@ class PokemonSummary_Scene
|
||||
pbFadeOutIn {
|
||||
scene = PokemonBag_Scene.new
|
||||
screen = PokemonBagScreen.new(scene,$PokemonBag)
|
||||
item = screen.pbChooseItemScreen(Proc.new { |item| pbCanHoldItem?(item) })
|
||||
item = screen.pbChooseItemScreen(Proc.new { |itm| pbCanHoldItem?(itm) })
|
||||
}
|
||||
if item>0
|
||||
dorefresh = pbGiveItemToPokemon(item,@pokemon,self,@partyindex)
|
||||
|
||||
@@ -58,7 +58,7 @@ class Window_PokemonBag < Window_DrawableCommand
|
||||
end
|
||||
end
|
||||
|
||||
def drawItem(index,count,rect)
|
||||
def drawItem(index,_count,rect)
|
||||
textpos = []
|
||||
rect = Rect.new(rect.x+16,rect.y+16,rect.width-16,rect.height)
|
||||
ypos = rect.y+4
|
||||
@@ -307,7 +307,8 @@ class PokemonBag_Scene
|
||||
y = 54
|
||||
y += ((sliderheight-boxheight)*itemlist.top_row/(itemlist.row_max-itemlist.page_row_max)).floor
|
||||
overlay.blt(470,y,@sliderbitmap.bitmap,Rect.new(36,0,36,4))
|
||||
i = 0; while i*16<boxheight-4-18
|
||||
i = 0
|
||||
while i*16<boxheight-4-18
|
||||
height = [boxheight-4-18-i*16,16].min
|
||||
overlay.blt(470,y+4+i*16,@sliderbitmap.bitmap,Rect.new(36,4,36,height))
|
||||
i += 1
|
||||
@@ -365,7 +366,6 @@ class PokemonBag_Scene
|
||||
pbPlayDecisionSE
|
||||
pbRefresh
|
||||
elsif Input.trigger?(Input::B)
|
||||
curindex = itemwindow.index
|
||||
thispocket.insert(swapinitialpos,thispocket.delete_at(itemwindow.index))
|
||||
itemwindow.index = swapinitialpos
|
||||
itemwindow.sorting = false
|
||||
|
||||
@@ -13,7 +13,7 @@ class Window_PhoneList < Window_CommandPokemon
|
||||
def drawItem(index,count,rect)
|
||||
return if index>=self.top_row+self.page_item_max
|
||||
super
|
||||
overlapCursor = drawCursor(index-1,itemRect(index-1))
|
||||
drawCursor(index-1,itemRect(index-1))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -551,15 +551,9 @@ module FontInstaller
|
||||
success = []
|
||||
# Check if all fonts already exist
|
||||
filesExist = true
|
||||
fontsExist = true
|
||||
dest = self.getFontFolder
|
||||
for i in 0...Names.size
|
||||
if !safeExists?(dest + Filenames[i])
|
||||
filesExist = false
|
||||
end
|
||||
if !Font.exist?(Names[i])
|
||||
fontsExist = false
|
||||
end
|
||||
filesExist = false if !safeExists?(dest + Filenames[i])
|
||||
end
|
||||
return if filesExist
|
||||
# Check if all source fonts exist
|
||||
|
||||
@@ -117,7 +117,6 @@ class PokemonSaveScreen
|
||||
@scene.pbStartScreen
|
||||
if pbConfirmMessage(_INTL("Would you like to save the game?"))
|
||||
if safeExists?(RTP.getSaveFileName("Game.rxdata"))
|
||||
confirm=""
|
||||
if $PokemonTemp.begunNewGame
|
||||
pbMessage(_INTL("WARNING!"))
|
||||
pbMessage(_INTL("There is a different game file that is already saved."))
|
||||
|
||||
@@ -3,15 +3,15 @@ class PokemonSystem
|
||||
attr_accessor :battlescene
|
||||
attr_accessor :battlestyle
|
||||
attr_accessor :frame
|
||||
attr_accessor :textskin
|
||||
attr_writer :textskin
|
||||
attr_accessor :font
|
||||
attr_accessor :screensize
|
||||
attr_accessor :border
|
||||
attr_accessor :language
|
||||
attr_accessor :runstyle
|
||||
attr_accessor :bgmvolume
|
||||
attr_accessor :sevolume
|
||||
attr_accessor :textinput
|
||||
attr_writer :border
|
||||
attr_writer :language
|
||||
attr_writer :runstyle
|
||||
attr_writer :bgmvolume
|
||||
attr_writer :sevolume
|
||||
attr_writer :textinput
|
||||
|
||||
def initialize
|
||||
@textspeed = 1 # Text speed (0=slow, 1=normal, 2=fast)
|
||||
@@ -327,7 +327,7 @@ class Window_PokemonOption < Window_DrawableCommand
|
||||
return @options.length+1
|
||||
end
|
||||
|
||||
def drawItem(index,count,rect)
|
||||
def drawItem(index,_count,rect)
|
||||
rect = drawCursor(index,rect)
|
||||
optionname = (index==@options.length) ? _INTL("Cancel") : @options[index].name
|
||||
optionwidth = rect.width*9/20
|
||||
@@ -389,7 +389,6 @@ class Window_PokemonOption < Window_DrawableCommand
|
||||
end
|
||||
|
||||
def update
|
||||
dorefresh = false
|
||||
oldindex = self.index
|
||||
@mustUpdateOptions = false
|
||||
super
|
||||
@@ -419,7 +418,7 @@ class PokemonOption_Scene
|
||||
pbUpdateSpriteHash(@sprites)
|
||||
end
|
||||
|
||||
def pbStartScene(inloadscreen=false)
|
||||
def pbStartScene(inloadscreen=false)
|
||||
@sprites = {}
|
||||
@viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
|
||||
@viewport.z = 99999
|
||||
|
||||
@@ -805,7 +805,7 @@ class PokemonStorageScene
|
||||
return selection
|
||||
end
|
||||
|
||||
def pbSelectBoxInternal(party)
|
||||
def pbSelectBoxInternal(_party)
|
||||
selection = @selection
|
||||
pbSetArrow(@sprites["arrow"],selection)
|
||||
pbUpdateOverlay(selection)
|
||||
@@ -995,13 +995,14 @@ class PokemonStorageScene
|
||||
newbox.x = 520
|
||||
Graphics.frame_reset
|
||||
distancePerFrame = 64*20/Graphics.frame_rate
|
||||
begin
|
||||
loop do
|
||||
Graphics.update
|
||||
Input.update
|
||||
@sprites["box"].x -= distancePerFrame
|
||||
newbox.x -= distancePerFrame
|
||||
self.update
|
||||
end until newbox.x<=184
|
||||
break if newbox.x<=184
|
||||
end
|
||||
diff = newbox.x-184
|
||||
newbox.x = 184
|
||||
@sprites["box"].x -= diff
|
||||
@@ -1014,13 +1015,14 @@ class PokemonStorageScene
|
||||
newbox.x = -152
|
||||
Graphics.frame_reset
|
||||
distancePerFrame = 64*20/Graphics.frame_rate
|
||||
begin
|
||||
loop do
|
||||
Graphics.update
|
||||
Input.update
|
||||
@sprites["box"].x += distancePerFrame
|
||||
newbox.x += distancePerFrame
|
||||
self.update
|
||||
end until newbox.x>=184
|
||||
break if newbox.x>=184
|
||||
end
|
||||
diff = newbox.x-184
|
||||
newbox.x = 184
|
||||
@sprites["box"].x -= diff
|
||||
@@ -1057,24 +1059,26 @@ class PokemonStorageScene
|
||||
def pbShowPartyTab
|
||||
pbSEPlay("GUI storage show party panel")
|
||||
distancePerFrame = 48*20/Graphics.frame_rate
|
||||
begin
|
||||
loop do
|
||||
Graphics.update
|
||||
Input.update
|
||||
@sprites["boxparty"].y -= distancePerFrame
|
||||
self.update
|
||||
end until @sprites["boxparty"].y<=Graphics.height-352
|
||||
break if @sprites["boxparty"].y<=Graphics.height-352
|
||||
end
|
||||
@sprites["boxparty"].y = Graphics.height-352
|
||||
end
|
||||
|
||||
def pbHidePartyTab
|
||||
pbSEPlay("GUI storage hide party panel")
|
||||
distancePerFrame = 48*20/Graphics.frame_rate
|
||||
begin
|
||||
loop do
|
||||
Graphics.update
|
||||
Input.update
|
||||
@sprites["boxparty"].y += distancePerFrame
|
||||
self.update
|
||||
end until @sprites["boxparty"].y>=Graphics.height
|
||||
break if @sprites["boxparty"].y>=Graphics.height
|
||||
end
|
||||
@sprites["boxparty"].y = Graphics.height
|
||||
end
|
||||
|
||||
@@ -1092,7 +1096,7 @@ class PokemonStorageScene
|
||||
end
|
||||
end
|
||||
|
||||
def pbSwap(selected,heldpoke)
|
||||
def pbSwap(selected,_heldpoke)
|
||||
pbSEPlay("GUI storage pick up")
|
||||
heldpokesprite = @sprites["arrow"].heldPokemon
|
||||
boxpokesprite = nil
|
||||
@@ -1112,7 +1116,7 @@ class PokemonStorageScene
|
||||
@selectionForMosaic = selected[1]
|
||||
end
|
||||
|
||||
def pbPlace(selected,heldpoke)
|
||||
def pbPlace(selected,_heldpoke)
|
||||
pbSEPlay("GUI storage put down")
|
||||
heldpokesprite = @sprites["arrow"].heldPokemon
|
||||
@sprites["arrow"].place
|
||||
@@ -1270,7 +1274,6 @@ class PokemonStorageScene
|
||||
end
|
||||
|
||||
def pbMark(selected,heldpoke)
|
||||
ret = 0
|
||||
@sprites["markingbg"].visible = true
|
||||
@sprites["markingoverlay"].visible = true
|
||||
msg = _INTL("Mark your Pokémon.")
|
||||
@@ -1366,7 +1369,7 @@ class PokemonStorageScene
|
||||
@sprites["boxparty"].y = oldPartyY
|
||||
end
|
||||
|
||||
def drawMarkings(bitmap,x,y,width,height,markings)
|
||||
def drawMarkings(bitmap,x,y,_width,_height,markings)
|
||||
markrect = Rect.new(0,0,16,16)
|
||||
for i in 0...8
|
||||
markrect.x = i*16
|
||||
@@ -1704,7 +1707,6 @@ class PokemonStorageScreen
|
||||
loop do
|
||||
destbox = @scene.pbChooseBox(_INTL("Deposit in which Box?"))
|
||||
if destbox>=0
|
||||
success = false
|
||||
firstfree = @storage.pbFirstFreePos(destbox)
|
||||
if firstfree<0
|
||||
pbDisplay(_INTL("The Box is full."))
|
||||
@@ -1921,7 +1923,7 @@ class PokemonStorageScreen
|
||||
end
|
||||
end
|
||||
|
||||
def pbChoosePokemon(party=nil)
|
||||
def pbChoosePokemon(_party=nil)
|
||||
@heldpkmn = nil
|
||||
@scene.pbStartBox(self,1)
|
||||
retval = nil
|
||||
|
||||
@@ -25,7 +25,7 @@ class Window_PokemonItemStorage < Window_DrawableCommand
|
||||
return @bag.length+1
|
||||
end
|
||||
|
||||
def drawItem(index,count,rect)
|
||||
def drawItem(index,_count,rect)
|
||||
rect = drawCursor(index,rect)
|
||||
ypos = rect.y
|
||||
textpos = []
|
||||
|
||||
@@ -25,14 +25,14 @@ def pbPCItemStorage
|
||||
pbFadeOutIn {
|
||||
scene = WithdrawItemScene.new
|
||||
screen = PokemonBagScreen.new(scene,$PokemonBag)
|
||||
ret = screen.pbWithdrawItemScreen
|
||||
screen.pbWithdrawItemScreen
|
||||
}
|
||||
end
|
||||
when 1 # Deposit Item
|
||||
pbFadeOutIn {
|
||||
scene = PokemonBag_Scene.new
|
||||
screen = PokemonBagScreen.new(scene,$PokemonBag)
|
||||
ret = screen.pbDepositItemScreen
|
||||
screen.pbDepositItemScreen
|
||||
}
|
||||
when 2 # Toss Item
|
||||
if !$PokemonGlobal.pcItemStorage
|
||||
@@ -44,7 +44,7 @@ def pbPCItemStorage
|
||||
pbFadeOutIn {
|
||||
scene = TossItemScene.new
|
||||
screen = PokemonBagScreen.new(scene,$PokemonBag)
|
||||
ret = screen.pbTossItemScreen
|
||||
screen.pbTossItemScreen
|
||||
}
|
||||
end
|
||||
else
|
||||
|
||||
@@ -190,7 +190,7 @@ def pbHatchAnimation(pokemon)
|
||||
end
|
||||
|
||||
def pbHatch(pokemon)
|
||||
speciesname = PBSpecies.getName(pokemon.species)
|
||||
speciesname = pokemon.speciesName
|
||||
pokemon.name = speciesname
|
||||
pokemon.trainerID = $Trainer.id
|
||||
pokemon.ot = $Trainer.name
|
||||
@@ -208,7 +208,6 @@ def pbHatch(pokemon)
|
||||
pbMessage(_INTL("... .... .....\1"))
|
||||
pbMessage(_INTL("{1} hatched from the Egg!",speciesname))
|
||||
if pbConfirmMessage(_INTL("Would you like to nickname the newly hatched {1}?",speciesname))
|
||||
species = PBSpecies.getName(pokemon.species)
|
||||
nickname = pbEnterPokemonName(_INTL("{1}'s nickname?",speciesname),
|
||||
0,PokeBattle_Pokemon::MAX_POKEMON_NAME_SIZE,"",pokemon)
|
||||
pokemon.name = nickname if nickname!=""
|
||||
@@ -216,7 +215,7 @@ def pbHatch(pokemon)
|
||||
end
|
||||
end
|
||||
|
||||
Events.onStepTaken += proc { |sender,e|
|
||||
Events.onStepTaken += proc { |_sender,_e|
|
||||
for egg in $Trainer.party
|
||||
next if egg.eggsteps<=0
|
||||
egg.eggsteps -= 1
|
||||
|
||||
@@ -48,8 +48,7 @@ class SpriteMetafile
|
||||
return false
|
||||
end
|
||||
|
||||
def dispose
|
||||
end
|
||||
def dispose; end
|
||||
|
||||
def flash(color,duration)
|
||||
if duration>0
|
||||
@@ -95,8 +94,8 @@ class SpriteMetafile
|
||||
|
||||
def src_rect=(value)
|
||||
@values[SRC_RECT]=value
|
||||
@metafile.push([SRC_RECT,value])
|
||||
end
|
||||
@metafile.push([SRC_RECT,value])
|
||||
end
|
||||
|
||||
def visible
|
||||
return @values[VISIBLE]
|
||||
@@ -610,7 +609,7 @@ class PokemonEvolutionScene
|
||||
|
||||
def pbRemoveItemAfterEvolution
|
||||
removeItem = false
|
||||
createSpecies = pbCheckEvolutionEx(@pokemon) { |pokemon,evonib,level,pkmn|
|
||||
createSpecies = pbCheckEvolutionEx(@pokemon) { |_pokemon,evonib,_level,pkmn|
|
||||
case evonib
|
||||
when PBEvolution::Shedinja
|
||||
next pkmn if $PokemonBag.pbHasItem?(getConst(PBItems,:POKEBALL))
|
||||
|
||||
@@ -84,8 +84,6 @@ class MoveRelearner_Scene
|
||||
movesData = pbLoadMovesData
|
||||
overlay=@sprites["overlay"].bitmap
|
||||
overlay.clear
|
||||
textpos=[]
|
||||
imagepos=[]
|
||||
type1rect=Rect.new(0,@pokemon.type1*28,64,28)
|
||||
type2rect=Rect.new(0,@pokemon.type2*28,64,28)
|
||||
if @pokemon.type1==@pokemon.type2
|
||||
@@ -97,6 +95,7 @@ class MoveRelearner_Scene
|
||||
textpos=[
|
||||
[_INTL("Teach which move?"),16,8,0,Color.new(88,88,80),Color.new(168,184,184)]
|
||||
]
|
||||
imagepos=[]
|
||||
yPos=82
|
||||
for i in 0...VISIBLEMOVES
|
||||
moveobject=@moves[@sprites["commands"].top_item+i]
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
class PurifyChamberSet
|
||||
attr_accessor :facing
|
||||
attr_accessor :shadow
|
||||
attr_reader :facing
|
||||
attr_reader :shadow
|
||||
|
||||
def partialSum(x)
|
||||
return (x*x+x)/2 # pattern: 1, 3, 6, 10, 15, 21, 28, ...
|
||||
end
|
||||
|
||||
def length
|
||||
return @list.length
|
||||
return @list.length
|
||||
end
|
||||
|
||||
def initialize
|
||||
@@ -16,15 +16,15 @@ class PurifyChamberSet
|
||||
end
|
||||
|
||||
def facing=(value)
|
||||
if value>=0 && value<@list.length
|
||||
@facing=value
|
||||
end
|
||||
if value>=0 && value<@list.length
|
||||
@facing=value
|
||||
end
|
||||
end
|
||||
|
||||
def shadow=(value)
|
||||
if value==nil || value.shadowPokemon?
|
||||
@shadow=value
|
||||
end
|
||||
if value==nil || value.shadowPokemon?
|
||||
@shadow=value
|
||||
end
|
||||
end
|
||||
|
||||
=begin
|
||||
@@ -33,15 +33,15 @@ Boosted if center has advantage over facing Pokemon
|
||||
Boosted based on number of best circles
|
||||
=end
|
||||
def flow
|
||||
ret=0
|
||||
return 0 if !@shadow
|
||||
for i in 0...@list.length
|
||||
ret+=(PurifyChamberSet.isSuperEffective(@list[i],@list[(i+1)%@list.length])) ? 1 : 0
|
||||
end
|
||||
if @list[@facing]
|
||||
ret+=PurifyChamberSet.isSuperEffective(@shadow,@list[@facing]) ? 1 : 0
|
||||
end
|
||||
return [ret+(@list.length/2),4].min
|
||||
ret=0
|
||||
return 0 if !@shadow
|
||||
for i in 0...@list.length
|
||||
ret+=(PurifyChamberSet.isSuperEffective(@list[i],@list[(i+1)%@list.length])) ? 1 : 0
|
||||
end
|
||||
if @list[@facing]
|
||||
ret+=PurifyChamberSet.isSuperEffective(@shadow,@list[@facing]) ? 1 : 0
|
||||
end
|
||||
return [ret+(@list.length/2),4].min
|
||||
end
|
||||
|
||||
def shadowAffinity
|
||||
@@ -57,19 +57,19 @@ Boosted based on number of best circles
|
||||
# Tempo refers to the type advantages of each Pokemon in a certain set in a
|
||||
# clockwise direction. Tempo also depends on the number of Pokemon in the set
|
||||
def tempo
|
||||
ret=0
|
||||
for i in 0...@list.length
|
||||
ret+=(PurifyChamberSet.isSuperEffective(@list[i],@list[(i+1)%@list.length])) ? 1 : 0
|
||||
end
|
||||
return partialSum(@list.length)+ret
|
||||
ret=0
|
||||
for i in 0...@list.length
|
||||
ret+=(PurifyChamberSet.isSuperEffective(@list[i],@list[(i+1)%@list.length])) ? 1 : 0
|
||||
end
|
||||
return partialSum(@list.length)+ret
|
||||
end
|
||||
|
||||
def list
|
||||
return @list.clone
|
||||
return @list.clone
|
||||
end
|
||||
|
||||
def [](index)
|
||||
return @list[index]
|
||||
return @list[index]
|
||||
end
|
||||
|
||||
def insertAfter(index,value)
|
||||
@@ -108,7 +108,7 @@ end
|
||||
class PurifyChamber # German: der Kryptorbis
|
||||
NUMSETS=9
|
||||
SETSIZE=4
|
||||
attr_accessor :currentSet # German: das Forum
|
||||
attr_reader :currentSet # German: das Forum
|
||||
|
||||
def self.maximumTempo() # Calculates the maximum possible tempo
|
||||
x=SETSIZE+1
|
||||
@@ -198,7 +198,6 @@ class PurifyChamber # German: der Kryptorbis
|
||||
def update # called each step
|
||||
for set in 0...NUMSETS
|
||||
# If a shadow Pokemon and a regular Pokemon are on the same set
|
||||
count=setCount(set)
|
||||
if @sets[set].shadow
|
||||
if @sets[set].shadow.heartgauge>0
|
||||
flow=self.chamberFlow(set)
|
||||
@@ -225,12 +224,11 @@ class PurifyChamber # German: der Kryptorbis
|
||||
end
|
||||
|
||||
def debugAdd(set,shadow,type1,type2=nil)
|
||||
species=getID(PBSpecies,species)
|
||||
pkmn=PseudoPokemon.new(shadow,type1,type2||type1)
|
||||
if pkmn.shadowPokemon?
|
||||
self.setShadow(set,pkmn)
|
||||
self.setShadow(set,pkmn)
|
||||
else
|
||||
self.insertAfter(set,setCount(set),pkmn)
|
||||
self.insertAfter(set,setCount(set),pkmn)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -238,14 +236,12 @@ end
|
||||
|
||||
|
||||
class PokemonGlobalMetadata
|
||||
attr_accessor :purifyChamber
|
||||
attr_writer :purifyChamber
|
||||
attr_accessor :seenPurifyChamber
|
||||
|
||||
def purifyChamber
|
||||
if !@purifyChamber
|
||||
@purifyChamber=PurifyChamber.new()
|
||||
end
|
||||
return @purifyChamber
|
||||
@purifyChamber = PurifyChamber.new() if !@purifyChamber
|
||||
return @purifyChamber
|
||||
end
|
||||
end
|
||||
|
||||
@@ -330,13 +326,13 @@ module PurifyChamberHelper
|
||||
|
||||
def self.adjustOnInsert(position)
|
||||
if position>0
|
||||
position-=1
|
||||
oldpos=position/2
|
||||
if position%2==0
|
||||
position-=1
|
||||
oldpos=position/2
|
||||
if position%2==0
|
||||
return position+1
|
||||
else
|
||||
return ((oldpos+1)*2)+1
|
||||
end
|
||||
else
|
||||
return ((oldpos+1)*2)+1
|
||||
end
|
||||
end
|
||||
return position
|
||||
end
|
||||
@@ -384,8 +380,8 @@ class PurifyChamberScreen
|
||||
@scene.pbShift(position,pkmn)
|
||||
else
|
||||
@scene.pbPlace(position,pkmn)
|
||||
end
|
||||
PurifyChamberHelper.pbSetPokemon(@chamber,position,pkmn)
|
||||
end
|
||||
PurifyChamberHelper.pbSetPokemon(@chamber,position,pkmn)
|
||||
@scene.pbRefresh
|
||||
else
|
||||
@scene.pbDisplay(_INTL("Only a Shadow Pokémon can go there."))
|
||||
@@ -401,8 +397,8 @@ class PurifyChamberScreen
|
||||
@scene.pbShift(position,pkmn)
|
||||
else
|
||||
@scene.pbPlace(position,pkmn)
|
||||
end
|
||||
PurifyChamberHelper.pbSetPokemon(@chamber,position,pkmn)
|
||||
end
|
||||
PurifyChamberHelper.pbSetPokemon(@chamber,position,pkmn)
|
||||
@scene.pbRefresh
|
||||
end
|
||||
end
|
||||
@@ -431,7 +427,6 @@ class PurifyChamberScreen
|
||||
def pbOpenSetDetail
|
||||
chamber=@chamber
|
||||
@scene.pbOpenSetDetail(chamber.currentSet)
|
||||
selected=nil
|
||||
heldpkmn=nil
|
||||
loop do
|
||||
# Commands
|
||||
@@ -459,7 +454,7 @@ class PurifyChamberScreen
|
||||
if !heldpkmn && curpkmn
|
||||
commands[cmdReplace=commands.length]=_INTL("REPLACE")
|
||||
end
|
||||
commands.push(_INTL("CANCEL"))
|
||||
commands.push(_INTL("CANCEL"))
|
||||
choice=@scene.pbShowCommands(
|
||||
_INTL("What shall I do with this {1}?",
|
||||
heldpkmn ? heldpkmn.name : curpkmn.name),commands)
|
||||
@@ -468,7 +463,7 @@ class PurifyChamberScreen
|
||||
if pbPlace(heldpkmn,cmd[1]) # calls place or shift as appropriate
|
||||
if !curpkmn
|
||||
pbOnPlace(heldpkmn)
|
||||
@scene.pbPositionHint(PurifyChamberHelper.adjustOnInsert(cmd[1]))
|
||||
@scene.pbPositionHint(PurifyChamberHelper.adjustOnInsert(cmd[1]))
|
||||
heldpkmn=nil # Pokemon was placed
|
||||
else
|
||||
heldpkmn=curpkmn # Pokemon was shifted
|
||||
@@ -490,7 +485,7 @@ class PurifyChamberScreen
|
||||
$PokemonStorage.pbStoreCaught(heldpkmn)
|
||||
heldpkmn=nil
|
||||
@scene.pbRefresh
|
||||
else
|
||||
else
|
||||
# Store and delete Pokemon.
|
||||
@scene.pbWithdraw(cmd[1],heldpkmn)
|
||||
$PokemonStorage.pbStoreCaught(curpkmn)
|
||||
@@ -516,7 +511,7 @@ class PurifyChamberScreen
|
||||
@scene.pbReplace(cmd,pos)
|
||||
PurifyChamberHelper.pbSetPokemon(@chamber,cmd[1],newpkmn)
|
||||
$PokemonStorage[pos[0],pos[1]]=curpkmn
|
||||
@scene.pbRefresh
|
||||
@scene.pbRefresh
|
||||
pbOnPlace(curpkmn)
|
||||
end
|
||||
end
|
||||
@@ -527,7 +522,7 @@ class PurifyChamberScreen
|
||||
if pbPlacePokemon(pos,cmd[1])
|
||||
curpkmn=PurifyChamberHelper.pbGetPokemon(@chamber,cmd[1])
|
||||
pbOnPlace(curpkmn)
|
||||
@scene.pbPositionHint(PurifyChamberHelper.adjustOnInsert(cmd[1]))
|
||||
@scene.pbPositionHint(PurifyChamberHelper.adjustOnInsert(cmd[1]))
|
||||
end
|
||||
end
|
||||
elsif cmd[0]==1 # Change the active set
|
||||
@@ -614,7 +609,6 @@ class PurifyChamberScreen
|
||||
@scene.pbEnd()
|
||||
return
|
||||
end
|
||||
alreadyopen=false
|
||||
@scene.pbOpenSet(chamber.currentSet)
|
||||
loop do
|
||||
set=@scene.pbChooseSet
|
||||
@@ -650,7 +644,7 @@ end
|
||||
|
||||
|
||||
class Window_PurifyChamberSets < Window_DrawableCommand
|
||||
attr_accessor :switching
|
||||
attr_reader :switching
|
||||
|
||||
def initialize(chamber,x,y,width,height,viewport=nil)
|
||||
@chamber=chamber
|
||||
@@ -663,10 +657,11 @@ class Window_PurifyChamberSets < Window_DrawableCommand
|
||||
end
|
||||
|
||||
def switching=(value)
|
||||
@switching=value; refresh
|
||||
@switching = value
|
||||
refresh
|
||||
end
|
||||
|
||||
def drawItem(index,count,rect)
|
||||
def drawItem(index,_count,rect)
|
||||
textpos=[]
|
||||
rect=drawCursor(index,rect)
|
||||
if index==@switching
|
||||
@@ -736,7 +731,8 @@ class DirectFlowDiagram
|
||||
point.visible=false
|
||||
end
|
||||
j=0
|
||||
i=0; while i<@distance
|
||||
i=0
|
||||
while i<@distance
|
||||
o=(i+@offset)%@distance
|
||||
if o>=0 && o<@distance
|
||||
ensurePoint(j)
|
||||
@@ -818,7 +814,8 @@ class FlowDiagram
|
||||
point.visible=false
|
||||
end
|
||||
j=0
|
||||
i=0; while i<360
|
||||
i=0
|
||||
while i<360
|
||||
angle=(i+@offset)%360
|
||||
if withinRange(angle,@startAngle,@endAngle)
|
||||
ensurePoint(j)
|
||||
@@ -956,30 +953,30 @@ class PurifyChamberSetView < SpriteWrapper
|
||||
pbSetSmallFont(@info.bitmap)
|
||||
textpos=[]
|
||||
if pkmn
|
||||
if pkmn.type1==pkmn.type2
|
||||
if pkmn.type1==pkmn.type2
|
||||
textpos.push([_INTL("{1} Lv.{2} {3}",pkmn.name,pkmn.level,PBTypes.getName(pkmn.type1)),2,0,0,
|
||||
Color.new(248,248,248),Color.new(128,128,128)])
|
||||
Color.new(248,248,248),Color.new(128,128,128)])
|
||||
else
|
||||
textpos.push([_INTL("{1} Lv.{2} {3}/{4}",pkmn.name,pkmn.level,PBTypes.getName(pkmn.type1),
|
||||
PBTypes.getName(pkmn.type2)),2,0,0,
|
||||
Color.new(248,248,248),Color.new(128,128,128)])
|
||||
PBTypes.getName(pkmn.type2)),2,0,0,
|
||||
Color.new(248,248,248),Color.new(128,128,128)])
|
||||
end
|
||||
textpos.push([_INTL("FLOW"),2+@info.bitmap.width/2,24,0,
|
||||
Color.new(248,248,248),Color.new(128,128,128)])
|
||||
# draw heart gauge
|
||||
pbDrawGauge(@info.bitmap,Rect.new(@info.bitmap.width*3/4,8,@info.bitmap.width*1/4,8),
|
||||
Color.new(192,0,256),pkmn.heartgauge,
|
||||
Color.new(248,248,248),Color.new(128,128,128)])
|
||||
# draw heart gauge
|
||||
pbDrawGauge(@info.bitmap,Rect.new(@info.bitmap.width*3/4,8,@info.bitmap.width*1/4,8),
|
||||
Color.new(192,0,256),pkmn.heartgauge,
|
||||
PokeBattle_Pokemon::HEARTGAUGESIZE)
|
||||
# draw flow gauge
|
||||
# draw flow gauge
|
||||
pbDrawGauge(@info.bitmap,Rect.new(@info.bitmap.width*3/4,24+8,@info.bitmap.width*1/4,8),
|
||||
Color.new(0,0,248),@chamber.chamberFlow(@set),6)
|
||||
Color.new(0,0,248),@chamber.chamberFlow(@set),6)
|
||||
end
|
||||
if @chamber.setCount(@set)>0
|
||||
textpos.push([_INTL("TEMPO"),2,24,0,
|
||||
Color.new(248,248,248),Color.new(128,128,128)])
|
||||
Color.new(248,248,248),Color.new(128,128,128)])
|
||||
# draw tempo gauge
|
||||
pbDrawGauge(@info.bitmap,Rect.new(@info.bitmap.width*1/4,24+8,@info.bitmap.width*1/4,8),
|
||||
Color.new(0,0,248),@chamber[@set].tempo,
|
||||
Color.new(0,0,248),@chamber[@set].tempo,
|
||||
PurifyChamber.maximumTempo())
|
||||
end
|
||||
pbDrawTextPositions(@info.bitmap,textpos)
|
||||
@@ -1161,30 +1158,29 @@ class PurifyChamberScene
|
||||
pbRefresh
|
||||
end
|
||||
|
||||
def pbMove(pos)
|
||||
def pbMove(_pos)
|
||||
@sprites["setview"].heldpkmn=@sprites["setview"].getCurrent()
|
||||
pbRefresh
|
||||
end
|
||||
|
||||
def pbShift(pos,heldpoke)
|
||||
def pbShift(_pos,_heldpoke)
|
||||
@sprites["setview"].heldpkmn=@sprites["setview"].getCurrent()
|
||||
pbRefresh
|
||||
end
|
||||
|
||||
def pbPlace(pos,heldpoke)
|
||||
def pbPlace(_pos,_heldpoke)
|
||||
@sprites["setview"].heldpkmn=nil
|
||||
pbRefresh
|
||||
end
|
||||
|
||||
def pbReplace(pos,storagePos)
|
||||
def pbReplace(_pos,_storagePos)
|
||||
@sprites["setview"].heldpkmn=nil
|
||||
pbRefresh
|
||||
end
|
||||
|
||||
def pbRotate(facing)
|
||||
end
|
||||
def pbRotate(facing); end
|
||||
|
||||
def pbWithdraw(pos,heldpoke)
|
||||
def pbWithdraw(_pos,_heldpoke)
|
||||
@sprites["setview"].heldpkmn=nil
|
||||
pbRefresh
|
||||
end
|
||||
|
||||
@@ -40,7 +40,7 @@ class PokemonMartAdapter
|
||||
return pbItemIconFile(item)
|
||||
end
|
||||
|
||||
def getItemIconRect(item)
|
||||
def getItemIconRect(_item)
|
||||
return Rect.new(0,0,48,48)
|
||||
end
|
||||
|
||||
@@ -101,7 +101,7 @@ class RpgxpMartAdapter
|
||||
$game_party.gain_gold(value)
|
||||
end
|
||||
|
||||
def getPrice(item,selling=false)
|
||||
def getPrice(item,_selling=false)
|
||||
return item.price
|
||||
end
|
||||
|
||||
@@ -129,19 +129,13 @@ class RpgxpMartAdapter
|
||||
def getInventory()
|
||||
data = []
|
||||
for i in 1...$data_items.size
|
||||
if getQuantity($data_items[i]) > 0
|
||||
data.push($data_items[i])
|
||||
end
|
||||
data.push($data_items[i]) if getQuantity($data_items[i]) > 0
|
||||
end
|
||||
for i in 1...$data_weapons.size
|
||||
if getQuantity($data_weapons[i]) > 0
|
||||
data.push($data_weapons[i])
|
||||
end
|
||||
data.push($data_weapons[i]) if getQuantity($data_weapons[i]) > 0
|
||||
end
|
||||
for i in 1...$data_armors.size
|
||||
if getQuantity($data_armors[i]) > 0
|
||||
data.push($data_armors[i])
|
||||
end
|
||||
data.push($data_armors[i]) if getQuantity($data_armors[i]) > 0
|
||||
end
|
||||
return data
|
||||
end
|
||||
@@ -158,7 +152,7 @@ class RpgxpMartAdapter
|
||||
return item ? item.name : ""
|
||||
end
|
||||
|
||||
def getDisplayPrice(item,selling=false)
|
||||
def getDisplayPrice(item,_selling=false)
|
||||
price=item.price
|
||||
return price.to_s
|
||||
end
|
||||
@@ -201,7 +195,7 @@ class RpgxpMartAdapter
|
||||
return ret
|
||||
end
|
||||
|
||||
def showQuantity?(item)
|
||||
def showQuantity?(_item)
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -788,7 +782,7 @@ class PokemonMartScreen
|
||||
price*=qty
|
||||
if pbConfirm(_INTL("I can pay ${1}. Would that be OK?",price.to_s_formatted))
|
||||
@adapter.setMoney(@adapter.getMoney+price)
|
||||
for i in 0...qty
|
||||
qty.times do
|
||||
@adapter.removeItem(item)
|
||||
end
|
||||
pbDisplayPaused(_INTL("Turned over the {1} and received ${2}.",itemname,price.to_s_formatted)) { pbSEPlay("Mart buy item") }
|
||||
|
||||
@@ -12,17 +12,15 @@ MYSTERY_GIFT_URL = "http://images1.wikia.nocookie.net/pokemonessentials/images/e
|
||||
|
||||
|
||||
class PokeBattle_Trainer
|
||||
attr_accessor(:mysterygiftaccess) # Whether MG can be used from load screen
|
||||
attr_accessor(:mysterygift) # Variable that stores downloaded MG data
|
||||
attr_writer :mysterygiftaccess # Whether MG can be used from load screen
|
||||
attr_writer :mysterygift # Variable that stores downloaded MG data
|
||||
|
||||
def mysterygiftaccess
|
||||
@mysterygiftaccess = false if !@mysterygiftaccess
|
||||
return @mysterygiftaccess
|
||||
return @mysterygiftaccess || false
|
||||
end
|
||||
|
||||
def mysterygift
|
||||
@mysterygift = [] if !@mysterygift
|
||||
return @mysterygift
|
||||
return @mysterygift || []
|
||||
end
|
||||
end
|
||||
|
||||
@@ -288,7 +286,6 @@ def pbDownloadMysteryGift(trainer)
|
||||
else
|
||||
gift=pending[command]
|
||||
sprites["msgwindow"].visible=false
|
||||
isitem=false
|
||||
if gift[1]==0
|
||||
sprite=PokemonSprite.new(viewport)
|
||||
sprite.setOffset(PictureOrigin::Center)
|
||||
@@ -299,15 +296,15 @@ def pbDownloadMysteryGift(trainer)
|
||||
sprite=ItemIconSprite.new(0,0,gift[2],viewport)
|
||||
sprite.x=Graphics.width/2
|
||||
sprite.y=-sprite.height/2
|
||||
isitem=true
|
||||
end
|
||||
distanceDiff = 8*20/Graphics.frame_rate
|
||||
begin
|
||||
loop do
|
||||
Graphics.update
|
||||
Input.update
|
||||
sprite.update
|
||||
sprite.y+=distanceDiff
|
||||
end while sprite.y<Graphics.height/2
|
||||
break if sprite.y>=Graphics.height/2
|
||||
end
|
||||
pbMEPlay("Battle capture success")
|
||||
(Graphics.frame_rate*3).times do
|
||||
Graphics.update
|
||||
@@ -321,12 +318,13 @@ def pbDownloadMysteryGift(trainer)
|
||||
trainer.mysterygift.push(gift)
|
||||
pending[command]=nil; pending.compact!
|
||||
opacityDiff = 16*20/Graphics.frame_rate
|
||||
begin
|
||||
loop do
|
||||
Graphics.update
|
||||
Input.update
|
||||
sprite.update
|
||||
sprite.opacity-=opacityDiff
|
||||
end while sprite.opacity>0
|
||||
break if sprite.opacity<=0
|
||||
end
|
||||
sprite.dispose
|
||||
end
|
||||
if pending.length==0
|
||||
|
||||
@@ -481,18 +481,16 @@ PokemonPCList.registerPC(HallOfFamePC.new)
|
||||
|
||||
|
||||
class PokemonGlobalMetadata
|
||||
attr_accessor :hallOfFame
|
||||
attr_writer :hallOfFame
|
||||
# Number necessary if hallOfFame array reach in its size limit
|
||||
attr_accessor :hallOfFameLastNumber
|
||||
attr_writer :hallOfFameLastNumber
|
||||
|
||||
def hallOfFame
|
||||
@hallOfFame=[] if !@hallOfFame
|
||||
return @hallOfFame
|
||||
return @hallOfFame || []
|
||||
end
|
||||
|
||||
def hallOfFameLastNumber
|
||||
@hallOfFameLastNumber=0 if !@hallOfFameLastNumber
|
||||
return @hallOfFameLastNumber
|
||||
return @hallOfFameLastNumber || 0
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user