mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-01-23 14:56:00 +00:00
More Rubocop changes
This commit is contained in:
@@ -553,11 +553,10 @@ class TriadScene
|
||||
(@battle.width * @battle.height).times do |i|
|
||||
x = i % @battle.width
|
||||
y = i / @battle.width
|
||||
if @boardSprites[i]
|
||||
owner = @battle.getOwner(x, y)
|
||||
@boardSprites[i].bitmap&.dispose
|
||||
@boardSprites[i].bitmap = @boardCards[i].createBitmap(owner)
|
||||
end
|
||||
next if !@boardSprites[i]
|
||||
@boardSprites[i].bitmap&.dispose
|
||||
owner = @battle.getOwner(x, y)
|
||||
@boardSprites[i].bitmap = @boardCards[i].createBitmap(owner)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -655,7 +654,7 @@ class TriadScreen
|
||||
panels[7] = (@wrapAround ? 0 : @height - 1) if panels[7] > @height - 1 # bottom
|
||||
attacker = attackerParam.nil? ? @board[(y * @width) + x] : attackerParam
|
||||
flips = []
|
||||
return nil if attackerParam != nil && @board[(y * @width) + x].owner != 0
|
||||
return nil if attackerParam && @board[(y * @width) + x].owner != 0
|
||||
return nil if !attacker.card || attacker.owner == 0
|
||||
4.times do |i|
|
||||
defenderX = panels[i * 2]
|
||||
@@ -830,9 +829,7 @@ class TriadScreen
|
||||
y = i / @width
|
||||
square.type = @board[i].type
|
||||
flips = flipBoard(x, y, square)
|
||||
if flips != nil
|
||||
scores.push([cardIndex, x, y, flips.length])
|
||||
end
|
||||
scores.push([cardIndex, x, y, flips.length]) if flips
|
||||
end
|
||||
end
|
||||
# Sort by number of flips
|
||||
|
||||
@@ -53,11 +53,10 @@ class VoltorbFlip
|
||||
squareValues[i] = rand(2..3)
|
||||
total *= squareValues[i]
|
||||
end
|
||||
if total > LEVEL_RANGES[@level - 1][1]
|
||||
# Lowers value of square to 1 if over max
|
||||
total /= squareValues[i]
|
||||
squareValues[i] = 1
|
||||
end
|
||||
next if total <= LEVEL_RANGES[@level - 1][1]
|
||||
# Lowers value of square to 1 if over max
|
||||
total /= squareValues[i]
|
||||
squareValues[i] = 1
|
||||
end
|
||||
# Randomize the values a little
|
||||
25.times do |i|
|
||||
@@ -67,11 +66,10 @@ class VoltorbFlip
|
||||
squareValues[i] -= 1
|
||||
total *= squareValues[i]
|
||||
end
|
||||
if total < LEVEL_RANGES[@level - 1][0] && squareValues[i] > 0
|
||||
total /= squareValues[i]
|
||||
squareValues[i] = temp
|
||||
total *= squareValues[i]
|
||||
end
|
||||
next if total >= LEVEL_RANGES[@level - 1][0] || squareValues[i] <= 0
|
||||
total /= squareValues[i]
|
||||
squareValues[i] = temp
|
||||
total *= squareValues[i]
|
||||
end
|
||||
# Populate @squares array
|
||||
25.times do |i|
|
||||
|
||||
@@ -20,33 +20,25 @@ def pbLottery(winnum, nameVar = 2, positionVar = 3, matchedVar = 4)
|
||||
thismatched = 0
|
||||
id = i.owner.public_id
|
||||
5.times do |j|
|
||||
if (id / (10**j)) % 10 == (winnum / (10**j)) % 10
|
||||
thismatched += 1
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
if thismatched > winmatched
|
||||
winpoke = i.name
|
||||
winpos = 1 # Party
|
||||
winmatched = thismatched
|
||||
break if (id / (10**j)) % 10 != (winnum / (10**j)) % 10
|
||||
thismatched += 1
|
||||
end
|
||||
next if thismatched <= winmatched
|
||||
winpoke = i.name
|
||||
winpos = 1 # Party
|
||||
winmatched = thismatched
|
||||
end
|
||||
pbEachPokemon { |poke, _box|
|
||||
thismatched = 0
|
||||
id = poke.owner.public_id
|
||||
5.times do |j|
|
||||
if (id / (10**j)) % 10 == (winnum / (10**j)) % 10
|
||||
thismatched += 1
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
if thismatched > winmatched
|
||||
winpoke = poke.name
|
||||
winpos = 2 # Storage
|
||||
winmatched = thismatched
|
||||
break if (id / (10**j)) % 10 != (winnum / (10**j)) % 10
|
||||
thismatched += 1
|
||||
end
|
||||
next if thismatched <= winmatched
|
||||
winpoke = poke.name
|
||||
winpos = 2 # Storage
|
||||
winmatched = thismatched
|
||||
}
|
||||
$game_variables[nameVar] = winpoke
|
||||
$game_variables[positionVar] = winpos
|
||||
|
||||
@@ -73,12 +73,11 @@ class TilePuzzleCursor < BitmapSprite
|
||||
yin = [@tileheight - (@cursorbitmap.height / 2) + expand, (@tileheight - (@cursorbitmap.height / 2)) / 2,
|
||||
(@tileheight - (@cursorbitmap.height / 2)) / 2, -expand]
|
||||
4.times do |i|
|
||||
if @arrows[i]
|
||||
self.bitmap.blt(x + xin[i], y + yin[i], @cursorbitmap.bitmap,
|
||||
Rect.new((@cursorbitmap.width / 2) + ((i % 2) * (@cursorbitmap.width / 4)),
|
||||
(i / 2) * (@cursorbitmap.height / 2),
|
||||
@cursorbitmap.width / 4, @cursorbitmap.height / 2))
|
||||
end
|
||||
next if !@arrows[i]
|
||||
self.bitmap.blt(x + xin[i], y + yin[i], @cursorbitmap.bitmap,
|
||||
Rect.new((@cursorbitmap.width / 2) + ((i % 2) * (@cursorbitmap.width / 4)),
|
||||
(i / 2) * (@cursorbitmap.height / 2),
|
||||
@cursorbitmap.width / 4, @cursorbitmap.height / 2))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user