More aligning of code

This commit is contained in:
Maruno17
2021-12-19 12:19:08 +00:00
parent 13a238cc6a
commit 33781493f4
121 changed files with 977 additions and 838 deletions
@@ -953,7 +953,8 @@ class Interpreter
sscreen = PokemonEntry.new(sscene)
$game_actors[@parameters[0]].name = sscreen.pbStartScreen(
_INTL("Enter {1}'s name.", $game_actors[@parameters[0]].name),
1, @parameters[1], $game_actors[@parameters[0]].name)
1, @parameters[1], $game_actors[@parameters[0]].name
)
}
end
return true
@@ -270,15 +270,14 @@ class PokemonMapFactory
# the array (3,-4), because (5-2=3) and (1-5=-4).
def getThisAndOtherEventRelativePos(thisEvent, otherEvent)
return [0, 0] if !thisEvent || !otherEvent
return getRelativePos(
thisEvent.map.map_id, thisEvent.x, thisEvent.y,
return getRelativePos(thisEvent.map.map_id, thisEvent.x, thisEvent.y,
otherEvent.map.map_id, otherEvent.x, otherEvent.y)
end
def getThisAndOtherPosRelativePos(thisEvent, otherMapID, otherX, otherY)
return [0, 0] if !thisEvent
return getRelativePos(
thisEvent.map.map_id, thisEvent.x, thisEvent.y, otherMapID, otherX, otherY)
return getRelativePos(thisEvent.map.map_id, thisEvent.x, thisEvent.y,
otherMapID, otherX, otherY)
end
# Unused
@@ -117,7 +117,8 @@ class Sprite_Character < RPG::Sprite
self.oy = @ch
else
@charbitmap = AnimatedBitmap.new(
'Graphics/Characters/' + @character_name, @character_hue)
'Graphics/Characters/' + @character_name, @character_hue
)
RPG::Cache.retain('Graphics/Characters/', @character_name, @character_hue) if @character == $game_player
@charbitmapAnimated = true
@bushbitmap.dispose if @bushbitmap
@@ -45,8 +45,8 @@ class Sprite_Shadow < RPG::Sprite
self.ox = 16
self.oy = 32
else
@chbitmap = AnimatedBitmap.new(
'Graphics/Characters/' + @character.character_name, @character.character_hue)
@chbitmap = AnimatedBitmap.new('Graphics/Characters/' + @character.character_name,
@character.character_hue)
@cw = @chbitmap.width / 4
@ch = @chbitmap.height / 4
self.ox = @cw / 2
@@ -180,8 +180,7 @@ def bltMinimapAutotile(dstBitmap, x, y, srcBitmap, id)
src = Rect.new(0, 0, 0, 0)
for i in 0...4
tile_position = tiles[i] - 1
src.set(
tile_position % 6 * cxTile + anim,
src.set(tile_position % 6 * cxTile + anim,
tile_position / 6 * cyTile, cxTile, cyTile)
dstBitmap.blt(i % 2 * cxTile + x, i / 2 * cyTile + y, srcBitmap, src)
end
@@ -522,24 +522,19 @@ class Window
@cursorbitmap.clear
@sprites["cursor"].bitmap = @cursorbitmap
@sprites["cursor"].src_rect.set(0, 0, width, height)
rect = Rect.new(margin, margin,
width - fullmargin, height - fullmargin)
rect = Rect.new(margin, margin, width - fullmargin, height - fullmargin)
@cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[8])
@cursorbitmap.blt(0, 0, @_windowskin, cursorrects[4]) # top left
@cursorbitmap.blt(width - margin, 0, @_windowskin, cursorrects[5]) # top right
@cursorbitmap.blt(0, height - margin, @_windowskin, cursorrects[6]) # bottom right
@cursorbitmap.blt(width - margin, height - margin, @_windowskin, cursorrects[7]) # bottom left
rect = Rect.new(margin, 0,
width - fullmargin, margin)
rect = Rect.new(margin, 0, width - fullmargin, margin)
@cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[0])
rect = Rect.new(0, margin,
margin, height - fullmargin)
rect = Rect.new(0, margin, margin, height - fullmargin)
@cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[1])
rect = Rect.new(width - margin, margin,
margin, height - fullmargin)
rect = Rect.new(width - margin, margin, margin, height - fullmargin)
@cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[2])
rect = Rect.new(margin, height - margin,
width - fullmargin, margin)
rect = Rect.new(margin, height - margin, width - fullmargin, margin)
@cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[3])
else
@sprites["cursor"].visible = false
@@ -553,8 +548,7 @@ class Window
@sprites["side#{i}"].src_rect.set(0, 0, dwidth, dheight)
@sidebitmaps[i].clear
if sideRects[i].width > 0 && sideRects[i].height > 0
@sidebitmaps[i].stretch_blt(@sprites["side#{i}"].src_rect,
@_windowskin, sideRects[i])
@sidebitmaps[i].stretch_blt(@sprites["side#{i}"].src_rect, @_windowskin, sideRects[i])
end
end
backwidth = @width - 4
@@ -618,8 +618,7 @@ class SpriteWindow < Window
@sprites["corner1"].src_rect.set(cx, 0, endX, startY)
@sprites["corner2"].src_rect.set(0, cy, startX, endY)
@sprites["corner3"].src_rect.set(cx, cy, endX, endY)
backRect = Rect.new(@skinrect.x, @skinrect.y,
@skinrect.width, @skinrect.height)
backRect = Rect.new(@skinrect.x, @skinrect.y, @skinrect.width, @skinrect.height)
blindsRect = nil
sideRects = [
Rect.new(startX, 0, @skinrect.width, startY), # side0 (top)
@@ -1344,8 +1344,7 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand
pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height,
@commands[index], self.baseColor, self.shadowColor)
else
chars = getFormattedText(
self.contents, rect.x, rect.y + 4, rect.width, rect.height,
chars = getFormattedText(self.contents, rect.x, rect.y + 4, rect.width, rect.height,
@commands[index], rect.height, true, true)
drawFormattedChars(self.contents, chars)
end
@@ -163,8 +163,7 @@ def getFormattedTextForDims(bitmap, xDst, yDst, widthDst, heightDst, text, lineh
if newlineBreaks
text2.gsub!(/<(\/?)(br)(\s*\=\s*([^>]*))?>/i, "\n")
end
return getFormattedText(
bitmap, xDst, yDst, widthDst, heightDst,
return getFormattedText(bitmap, xDst, yDst, widthDst, heightDst,
text2, lineheight, newlineBreaks,
explicitBreaksOnly, true)
end
@@ -701,8 +701,8 @@ class Battle
@field.weather = newWeather
duration = (fixedDuration) ? 5 : -1
if duration > 0 && user && user.itemActive?
duration = Battle::ItemEffects.triggerWeatherExtender(user.item,
@field.weather, duration, user, self)
duration = Battle::ItemEffects.triggerWeatherExtender(user.item, @field.weather,
duration, user, self)
end
@field.weatherDuration = duration
weather_data = GameData::BattleWeather.try_get(@field.weather)
@@ -779,8 +779,8 @@ class Battle
@field.terrain = newTerrain
duration = (fixedDuration) ? 5 : -1
if duration > 0 && user && user.itemActive?
duration = Battle::ItemEffects.triggerTerrainExtender(user.item,
newTerrain, duration, user, self)
duration = Battle::ItemEffects.triggerTerrainExtender(user.item, newTerrain,
duration, user, self)
end
@field.terrainDuration = duration
terrain_data = GameData::BattleTerrain.try_get(@field.terrain)
@@ -24,13 +24,11 @@ class Battle
return false
end
if party[idxParty].fainted?
partyScene.pbDisplay(_INTL("{1} has no energy left to battle!",
party[idxParty].name)) if partyScene
partyScene.pbDisplay(_INTL("{1} has no energy left to battle!", party[idxParty].name)) if partyScene
return false
end
if pbFindBattler(idxParty, idxBattler)
partyScene.pbDisplay(_INTL("{1} is already in battle!",
party[idxParty].name)) if partyScene
partyScene.pbDisplay(_INTL("{1} is already in battle!", party[idxParty].name)) if partyScene
return false
end
return true
@@ -128,8 +128,8 @@ class Battle
next false
end
next false if !pkmn
next false if !ItemHandlers.triggerCanUseInBattle(item,
pkmn, battler, idxMove, firstAction, self, itemScene)
next false if !ItemHandlers.triggerCanUseInBattle(item, pkmn, battler, idxMove,
firstAction, self, itemScene)
next false if !pbRegisterItem(idxBattler, item, idxPkmn, idxMove)
ret = true
next true
@@ -142,15 +142,18 @@ class Battle::Battler
end
if abilityActive?
return false if !@battle.moldBreaker && Battle::AbilityEffects.triggerStatLossImmunity(
self.ability, self, stat, @battle, showFailMsg)
self.ability, self, stat, @battle, showFailMsg
)
return false if Battle::AbilityEffects.triggerStatLossImmunityNonIgnorable(
self.ability, self, stat, @battle, showFailMsg)
self.ability, self, stat, @battle, showFailMsg
)
end
if !@battle.moldBreaker
allAllies.each do |b|
next if !b.abilityActive?
return false if Battle::AbilityEffects.triggerStatLossImmunityFromAlly(
b.ability, b, self, stat, @battle, showFailMsg)
b.ability, b, self, stat, @battle, showFailMsg
)
end
end
end
@@ -87,8 +87,7 @@ class Battle::Battler
# executing them)
if hasActiveItem?(:ASSAULTVEST) && move.statusMove? && move.id != :MEFIRST && commandPhase
if showMessages
msg = _INTL("The effects of the {1} prevent status moves from being used!",
itemName)
msg = _INTL("The effects of the {1} prevent status moves from being used!", itemName)
(commandPhase) ? @battle.pbDisplayPaused(msg) : @battle.pbDisplay(msg)
end
return false
@@ -86,8 +86,8 @@ class Battle::Move
return false if @battle.moldBreaker
ret = false
if target.abilityActive?
ret = Battle::AbilityEffects.triggerMoveImmunity(target.ability,
user, target, self, @calcType, @battle, show_message)
ret = Battle::AbilityEffects.triggerMoveImmunity(target.ability, user, target,
self, @calcType, @battle, show_message)
end
return ret
end
@@ -131,26 +131,31 @@ class Battle::Move
def pbCalcAccuracyModifiers(user, target, modifiers)
# Ability effects that alter accuracy calculation
if user.abilityActive?
Battle::AbilityEffects.triggerAccuracyCalcFromUser(user.ability,
modifiers, user, target, self, @calcType)
Battle::AbilityEffects.triggerAccuracyCalcFromUser(
user.ability, modifiers, user, target, self, @calcType
)
end
user.allAllies.each do |b|
next if !b.abilityActive?
Battle::AbilityEffects.triggerAccuracyCalcFromAlly(b.ability,
modifiers, user, target, self, @calcType)
Battle::AbilityEffects.triggerAccuracyCalcFromAlly(
b.ability, modifiers, user, target, self, @calcType
)
end
if target.abilityActive? && !@battle.moldBreaker
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(target.ability,
modifiers, user, target, self, @calcType)
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(
target.ability, modifiers, user, target, self, @calcType
)
end
# Item effects that alter accuracy calculation
if user.itemActive?
Battle::ItemEffects.triggerAccuracyCalcFromUser(user.item,
modifiers, user, target, self, @calcType)
Battle::ItemEffects.triggerAccuracyCalcFromUser(
user.item, modifiers, user, target, self, @calcType
)
end
if target.itemActive?
Battle::ItemEffects.triggerAccuracyCalcFromTarget(target.item,
modifiers, user, target, self, @calcType)
Battle::ItemEffects.triggerAccuracyCalcFromTarget(
target.item, modifiers, user, target, self, @calcType
)
end
# Other effects, inc. ones that set accuracy_multiplier or evasion_stage to
# specific values
@@ -295,8 +300,9 @@ class Battle::Move
end
# Ability effects that alter damage
if user.abilityActive?
Battle::AbilityEffects.triggerDamageCalcFromUser(user.ability,
user, target, self, multipliers, baseDmg, type)
Battle::AbilityEffects.triggerDamageCalcFromUser(
user.ability, user, target, self, multipliers, baseDmg, type
)
end
if !@battle.moldBreaker
# NOTE: It's odd that the user's Mold Breaker prevents its partner's
@@ -304,29 +310,35 @@ class Battle::Move
# how it works.
user.allAllies.each do |b|
next if !b.abilityActive?
Battle::AbilityEffects.triggerDamageCalcFromAlly(b.ability,
user, target, self, multipliers, baseDmg, type)
Battle::AbilityEffects.triggerDamageCalcFromAlly(
b.ability, user, target, self, multipliers, baseDmg, type
)
end
if target.abilityActive?
Battle::AbilityEffects.triggerDamageCalcFromTarget(target.ability,
user, target, self, multipliers, baseDmg, type) if !@battle.moldBreaker
Battle::AbilityEffects.triggerDamageCalcFromTargetNonIgnorable(target.ability,
user, target, self, multipliers, baseDmg, type)
Battle::AbilityEffects.triggerDamageCalcFromTarget(
target.ability, user, target, self, multipliers, baseDmg, type
)
Battle::AbilityEffects.triggerDamageCalcFromTargetNonIgnorable(
target.ability, user, target, self, multipliers, baseDmg, type
)
end
target.allAllies.each do |b|
next if !b.abilityActive?
Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(b.ability,
user, target, self, multipliers, baseDmg, type)
Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(
b.ability, user, target, self, multipliers, baseDmg, type
)
end
end
# Item effects that alter damage
if user.itemActive?
Battle::ItemEffects.triggerDamageCalcFromUser(user.item,
user, target, self, multipliers, baseDmg, type)
Battle::ItemEffects.triggerDamageCalcFromUser(
user.item, user, target, self, multipliers, baseDmg, type
)
end
if target.itemActive?
Battle::ItemEffects.triggerDamageCalcFromTarget(target.item,
user, target, self, multipliers, baseDmg, type)
Battle::ItemEffects.triggerDamageCalcFromTarget(
target.item, user, target, self, multipliers, baseDmg, type
)
end
# Parental Bond's second attack
if user.effects[PBEffects::ParentalBond] == 1
@@ -897,8 +897,10 @@ end
class Battle::Move::DisableTargetSoundMoves < Battle::Move
def pbAdditionalEffect(user, target)
return if target.fainted? || target.damageState.substitute
if target.effects[PBEffects::ThroatChop] == 0
@battle.pbDisplay(_INTL("The effects of {1} prevent {2} from using certain moves!",
@name, target.pbThis(true))) if target.effects[PBEffects::ThroatChop] == 0
@name, target.pbThis(true)))
end
target.effects[PBEffects::ThroatChop] = 3
end
end
@@ -31,8 +31,9 @@ class Battle::Scene
"Graphics/Pictures/Battle/overlay_message", @viewport)
messageBox.z = 195
# Create message window (displays the message)
msgWindow = Window_AdvancedTextPokemon.newWithSize("",
16, Graphics.height - 96 + 2, Graphics.width - 32, 96, @viewport)
msgWindow = Window_AdvancedTextPokemon.newWithSize(
"", 16, Graphics.height - 96 + 2, Graphics.width - 32, 96, @viewport
)
msgWindow.z = 200
msgWindow.opacity = 0
msgWindow.baseColor = MESSAGE_BASE_COLOR
@@ -58,8 +58,9 @@ class Battle::Scene
# Animates a party lineup appearing for the given side
#=============================================================================
def pbShowPartyLineup(side, fullAnim = false)
@animations.push(Animation::LineupAppear.new(@sprites, @viewport,
side, @battle.pbParty(side), @battle.pbPartyStarts(side), fullAnim))
@animations.push(Animation::LineupAppear.new(
@sprites, @viewport, side, @battle.pbParty(side), @battle.pbPartyStarts(side), fullAnim
))
if !fullAnim
while inPartyAnimation?
pbUpdate
@@ -112,13 +113,15 @@ class Battle::Scene
pbChangePokemon(b[0], pkmn)
pbRefresh
if @battle.opposes?(b[0])
sendOutAnim = Animation::PokeballTrainerSendOut.new(@sprites, @viewport,
@battle.pbGetOwnerIndexFromBattlerIndex(b[0]) + 1,
@battle.battlers[b[0]], startBattle, i)
sendOutAnim = Animation::PokeballTrainerSendOut.new(
@sprites, @viewport, @battle.pbGetOwnerIndexFromBattlerIndex(b[0]) + 1,
@battle.battlers[b[0]], startBattle, i
)
else
sendOutAnim = Animation::PokeballPlayerSendOut.new(@sprites, @viewport,
@battle.pbGetOwnerIndexFromBattlerIndex(b[0]) + 1,
@battle.battlers[b[0]], startBattle, i)
sendOutAnim = Animation::PokeballPlayerSendOut.new(
@sprites, @viewport, @battle.pbGetOwnerIndexFromBattlerIndex(b[0]) + 1,
@battle.battlers[b[0]], startBattle, i
)
end
dataBoxAnim = Animation::DataBoxAppear.new(@sprites, @viewport, b[0])
sendOutAnims.push([sendOutAnim, dataBoxAnim, false])
@@ -297,10 +300,12 @@ class Battle::Scene
pbTopRightWindow(
_INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}",
pkmn.totalhp - oldTotalHP, pkmn.attack - oldAttack, pkmn.defense - oldDefense,
pkmn.spatk - oldSpAtk, pkmn.spdef - oldSpDef, pkmn.speed - oldSpeed))
pkmn.spatk - oldSpAtk, pkmn.spdef - oldSpDef, pkmn.speed - oldSpeed)
)
pbTopRightWindow(
_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed))
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed)
)
end
#=============================================================================
@@ -326,8 +331,9 @@ class Battle::Scene
#=============================================================================
def pbThrow(ball, shakes, critical, targetBattler, showPlayer = false)
@briefMessage = false
captureAnim = Animation::PokeballThrowCapture.new(@sprites, @viewport,
ball, shakes, critical, @battle.battlers[targetBattler], showPlayer)
captureAnim = Animation::PokeballThrowCapture.new(
@sprites, @viewport, ball, shakes, critical, @battle.battlers[targetBattler], showPlayer
)
loop do
captureAnim.update
pbUpdate
@@ -367,8 +373,9 @@ class Battle::Scene
def pbThrowAndDeflect(ball, idxBattler)
@briefMessage = false
throwAnim = Animation::PokeballThrowDeflect.new(@sprites, @viewport,
ball, @battle.battlers[idxBattler])
throwAnim = Animation::PokeballThrowDeflect.new(
@sprites, @viewport, ball, @battle.battlers[idxBattler]
)
loop do
throwAnim.update
pbUpdate
@@ -534,7 +541,8 @@ class Battle::Scene
end
animPlayer.setLineTransform(
FOCUSUSER_X, FOCUSUSER_Y, FOCUSTARGET_X, FOCUSTARGET_Y,
oldUserX, oldUserY - userHeight / 2, oldTargetX, oldTargetY - targetHeight / 2)
oldUserX, oldUserY - userHeight / 2, oldTargetX, oldTargetY - targetHeight / 2
)
# Play the animation
animPlayer.start
loop do
@@ -118,8 +118,9 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase
self.x = 0
self.y = Graphics.height - 96
# Create message box (shows "What will X do?")
@msgBox = Window_UnformattedTextPokemon.newWithSize("",
self.x + 16, self.y + 2, 220, Graphics.height - self.y, viewport)
@msgBox = Window_UnformattedTextPokemon.newWithSize(
"", self.x + 16, self.y + 2, 220, Graphics.height - self.y, viewport
)
@msgBox.baseColor = TEXT_BASE_COLOR
@msgBox.shadowColor = TEXT_SHADOW_COLOR
@msgBox.windowskin = nil
@@ -146,8 +147,9 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase
end
else
# Create command window (shows Fight/Bag/Pokémon/Run)
@cmdWindow = Window_CommandPokemon.newWithSize([],
self.x + Graphics.width - 240, self.y, 240, Graphics.height - self.y, viewport)
@cmdWindow = Window_CommandPokemon.newWithSize(
[], self.x + Graphics.width - 240, self.y, 240, Graphics.height - self.y, viewport
)
@cmdWindow.columns = 2
@cmdWindow.columnSpacing = 4
@cmdWindow.ignore_input = true
@@ -287,15 +289,17 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
addSprite("shiftButton", @shiftButton)
else
# Create message box (shows type and PP of selected move)
@msgBox = Window_AdvancedTextPokemon.newWithSize("",
self.x + 320, self.y, Graphics.width - 320, Graphics.height - self.y, viewport)
@msgBox = Window_AdvancedTextPokemon.newWithSize(
"", self.x + 320, self.y, Graphics.width - 320, Graphics.height - self.y, viewport
)
@msgBox.baseColor = TEXT_BASE_COLOR
@msgBox.shadowColor = TEXT_SHADOW_COLOR
pbSetNarrowFont(@msgBox.contents)
addSprite("msgBox", @msgBox)
# Create command window (shows moves)
@cmdWindow = Window_CommandPokemon.newWithSize([],
self.x, self.y, 320, Graphics.height - self.y, viewport)
@cmdWindow = Window_CommandPokemon.newWithSize(
[], self.x, self.y, 320, Graphics.height - self.y, viewport
)
@cmdWindow.columns = 2
@cmdWindow.columnSpacing = 4
@cmdWindow.ignore_input = true
@@ -651,8 +651,7 @@ class Battle::Scene::Animation::BattlerFaint < Battle::Scene::Animation
shadow = addSprite(shaSprite, PictureOrigin::Center)
# Get approx duration depending on sprite's position/size. Min 20 frames.
battlerTop = batSprite.y - batSprite.height
cropY = Battle::Scene.pbBattlerPosition(@idxBattler,
@battle.pbSideSize(@idxBattler))[1]
cropY = Battle::Scene.pbBattlerPosition(@idxBattler, @battle.pbSideSize(@idxBattler))[1]
cropY += 8
duration = (cropY - battlerTop) / 8
duration = 10 if duration < 10 # Min 0.5 seconds
@@ -271,11 +271,13 @@ class Battle::AI
if GameData::Type.exists?(:FLYING)
if skill >= PBTrainerAI.highSkill
targetTypes = target.pbTypes(true)
mult = Effectiveness.calculate(:FLYING,
targetTypes[0], targetTypes[1], targetTypes[2])
mult = Effectiveness.calculate(
:FLYING, targetTypes[0], targetTypes[1], targetTypes[2]
)
else
mult = Effectiveness.calculate(:FLYING,
target.types[0], target.types[1], target.effects[PBEffects::Type3])
mult = Effectiveness.calculate(
:FLYING, target.types[0], target.types[1], target.effects[PBEffects::Type3]
)
end
baseDmg = (baseDmg.to_f * mult / Effectiveness::NORMAL_EFFECTIVE).round
end
@@ -338,15 +340,17 @@ class Battle::AI
break
end
if canCheck
Battle::AbilityEffects.triggerDamageCalcFromUser(user.ability,
user, target, move, multipliers, baseDmg, type)
Battle::AbilityEffects.triggerDamageCalcFromUser(
user.ability, user, target, move, multipliers, baseDmg, type
)
end
end
if skill >= PBTrainerAI.mediumSkill && !moldBreaker
user.allAllies.each do |b|
next if !b.abilityActive?
Battle::AbilityEffects.triggerDamageCalcFromAlly(b.ability,
user, target, move, multipliers, baseDmg, type)
Battle::AbilityEffects.triggerDamageCalcFromAlly(
b.ability, user, target, move, multipliers, baseDmg, type
)
end
end
if skill >= PBTrainerAI.bestSkill && !moldBreaker && target.abilityActive?
@@ -360,15 +364,17 @@ class Battle::AI
break
end
if canCheck
Battle::AbilityEffects.triggerDamageCalcFromTarget(target.ability,
user, target, move, multipliers, baseDmg, type)
Battle::AbilityEffects.triggerDamageCalcFromTarget(
target.ability, user, target, move, multipliers, baseDmg, type
)
end
end
if skill >= PBTrainerAI.bestSkill && !moldBreaker
target.allAllies.each do |b|
next if !b.abilityActive?
Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(b.ability,
user, target, move, multipliers, baseDmg, type)
Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(
b.ability, user, target, move, multipliers, baseDmg, type
)
end
end
# Item effects that alter damage
@@ -379,16 +385,18 @@ class Battle::AI
# round.
itemBlacklist = [:EXPERTBELT, :LIFEORB]
if !itemBlacklist.include?(user.item_id)
Battle::ItemEffects.triggerDamageCalcFromUser(user.item,
user, target, move, multipliers, baseDmg, type)
Battle::ItemEffects.triggerDamageCalcFromUser(
user.item, user, target, move, multipliers, baseDmg, type
)
end
end
if skill >= PBTrainerAI.bestSkill && target.itemActive?
# NOTE: Type-weakening berries aren't suitable for checking at the start
# of the round.
if target.item && !target.item.is_berry?
Battle::ItemEffects.triggerDamageCalcFromTarget(target.item,
user, target, move, multipliers, baseDmg, type)
Battle::ItemEffects.triggerDamageCalcFromTarget(
target.item, user, target, move, multipliers, baseDmg, type
)
end
end
# Global abilities
@@ -640,32 +648,37 @@ class Battle::AI
# Ability effects that alter accuracy calculation
if skill >= PBTrainerAI.mediumSkill
if user.abilityActive?
Battle::AbilityEffects.triggerAccuracyCalcFromUser(user.ability,
modifiers, user, target, move, type)
Battle::AbilityEffects.triggerAccuracyCalcFromUser(
user.ability, modifiers, user, target, move, type
)
end
user.allAllies.each do |b|
next if !b.abilityActive?
Battle::AbilityEffects.triggerAccuracyCalcFromAlly(b.ability,
modifiers, user, target, move, type)
Battle::AbilityEffects.triggerAccuracyCalcFromAlly(
b.ability, modifiers, user, target, move, type
)
end
end
if skill >= PBTrainerAI.bestSkill
if target.abilityActive? && !moldBreaker
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(target.ability,
modifiers, user, target, move, type)
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(
target.ability, modifiers, user, target, move, type
)
end
end
# Item effects that alter accuracy calculation
if skill >= PBTrainerAI.mediumSkill
if user.itemActive?
Battle::ItemEffects.triggerAccuracyCalcFromUser(user.item,
modifiers, user, target, move, type)
Battle::ItemEffects.triggerAccuracyCalcFromUser(
user.item, modifiers, user, target, move, type
)
end
end
if skill >= PBTrainerAI.bestSkill
if target.itemActive?
Battle::ItemEffects.triggerAccuracyCalcFromTarget(target.item,
modifiers, user, target, move, type)
Battle::ItemEffects.triggerAccuracyCalcFromTarget(
target.item, modifiers, user, target, move, type
)
end
end
# Other effects, inc. ones that set accuracy_multiplier or evasion_stage to specific values
@@ -222,7 +222,8 @@ class RPG::Animation
timing.se = RPG::AudioFile.new(
othertiming.se.name.clone,
othertiming.se.volume,
othertiming.se.pitch)
othertiming.se.pitch
)
timing.flash_scope = othertiming.flash_scope
timing.flash_color = othertiming.flash_color.clone
timing.flash_duration = othertiming.flash_duration
@@ -851,8 +852,7 @@ class PBAnimationPlayerX
sprite.y = cel[AnimFrame::Y] + @userOrig[1] - Battle::Scene::FOCUSUSER_Y
when 3 # Focused on user and target
next if !@srcLine || !@dstLine
point = transformPoint(
@srcLine[0], @srcLine[1], @srcLine[2], @srcLine[3],
point = transformPoint(@srcLine[0], @srcLine[1], @srcLine[2], @srcLine[3],
@dstLine[0], @dstLine[1], @dstLine[2], @dstLine[3],
sprite.x, sprite.y)
sprite.x = point[0]
@@ -64,8 +64,7 @@ class BugContestBattle < Battle
pbDisplayPaused(_INTL("You already caught a {1}.", lastPokemon.name))
helptext = _INTL("STOCK POKéMON:\n {1} Lv.{2} MaxHP: {3}\nTHIS POKéMON:\n {4} Lv.{5} MaxHP: {6}",
lastPokemon.name, lastPokemon.level, lastPokemon.totalhp,
pkmn.name, pkmn.level, pkmn.totalhp
)
pkmn.name, pkmn.level, pkmn.totalhp)
@scene.pbShowHelp(helptext)
if pbDisplayConfirm(_INTL("Switch Pokémon?"))
pbBugContestState.lastPokemon = pkmn
+2 -1
View File
@@ -507,7 +507,8 @@ def pbMoveRoute(event, commands, waitComplete = false)
i += 2
when PBMoveRoute::Graphic
route.list.push(RPG::MoveCommand.new(commands[i],
[commands[i + 1], commands[i + 2], commands[i + 3], commands[i + 4]]))
[commands[i + 1], commands[i + 2],
commands[i + 3], commands[i + 4]]))
i += 4
else
route.list.push(RPG::MoveCommand.new(commands[i]))
@@ -508,8 +508,7 @@ def pbTrainerBattle(trainerID, trainerName, endSpeech = nil,
# Perform the battle
if $game_temp.waiting_trainer
decision = pbTrainerBattleCore($game_temp.waiting_trainer[0],
[trainerID, trainerName, trainerPartyID, endSpeech]
)
[trainerID, trainerName, trainerPartyID, endSpeech])
else
decision = pbTrainerBattleCore([trainerID, trainerName, trainerPartyID, endSpeech])
end
@@ -91,7 +91,8 @@ def pbHiddenMoveAnimation(pokemon)
interp = RectInterpolator.new(
Rect.new(0, Graphics.height / 2, Graphics.width, 0),
Rect.new(0, (Graphics.height - bg.bitmap.height) / 2, Graphics.width, bg.bitmap.height),
Graphics.frame_rate / 4)
Graphics.frame_rate / 4
)
ptinterp = nil
phase = 1
frames = 0
@@ -110,7 +111,8 @@ def pbHiddenMoveAnimation(pokemon)
ptinterp = PointInterpolator.new(
Graphics.width + (sprite.bitmap.width / 2), bg.bitmap.height / 2,
Graphics.width / 2, bg.bitmap.height / 2,
Graphics.frame_rate * 4 / 10)
Graphics.frame_rate * 4 / 10
)
end
when 2 # Slide Pokémon sprite in from right to centre
ptinterp.update
@@ -129,7 +131,8 @@ def pbHiddenMoveAnimation(pokemon)
ptinterp = PointInterpolator.new(
Graphics.width / 2, bg.bitmap.height / 2,
-(sprite.bitmap.width / 2), bg.bitmap.height / 2,
Graphics.frame_rate * 4 / 10)
Graphics.frame_rate * 4 / 10
)
frames = 0
end
when 4 # Slide Pokémon sprite off from centre to left
@@ -142,7 +145,8 @@ def pbHiddenMoveAnimation(pokemon)
interp = RectInterpolator.new(
Rect.new(0, (Graphics.height - bg.bitmap.height) / 2, Graphics.width, bg.bitmap.height),
Rect.new(0, Graphics.height / 2, Graphics.width, 0),
Graphics.frame_rate / 4)
Graphics.frame_rate / 4
)
end
when 5 # Shrink viewport height from full to zero
interp.update
@@ -575,13 +575,13 @@ module RandomDungeonGenerator
for y in 0...maxHeight / cellHeight
for x in 0...maxWidth / cellWidth
pattern = maze.getEdgePattern(x, y)
if DungeonMaze.paint_cell_contents(
next if !DungeonMaze.paint_cell_contents(
self, BUFFER_X + x * cellWidth, BUFFER_Y + y * cellHeight,
corridor_patterns[pattern], DungeonMaze::TURN_NONE)
corridor_patterns[pattern], DungeonMaze::TURN_NONE
)
roomcount += 1
end
end
end
# If no rooms were generated, make the whole map a room
if roomcount == 0
for x in 0...maxWidth
+4 -2
View File
@@ -688,7 +688,8 @@ def pbUseItem(bag, item, bagscene = nil)
max_at_once = [max_at_once, $bag.quantity(item)].min
if max_at_once > 1
qty = screen.scene.pbChooseNumber(
_INTL("How many {1} do you want to use?", GameData::Item.get(item).name), max_at_once)
_INTL("How many {1} do you want to use?", GameData::Item.get(item).name), max_at_once
)
screen.scene.pbSetHelpText("") if screen.is_a?(PokemonPartyScreen)
end
if qty >= 1
@@ -749,7 +750,8 @@ def pbUseItemOnPokemon(item, pkmn, scene)
max_at_once = [max_at_once, $bag.quantity(item)].min
if max_at_once > 1
qty = scene.scene.pbChooseNumber(
_INTL("How many {1} do you want to use?", itm.name), max_at_once)
_INTL("How many {1} do you want to use?", itm.name), max_at_once
)
scene.scene.pbSetHelpText("") if scene.is_a?(PokemonPartyScreen)
end
return false if qty <= 0
+9 -6
View File
@@ -41,22 +41,25 @@ def pbDisplayMail(mail, _bearer = nil)
if GameData::Item.get(mail.item).is_icon_mail?
if mail.poke1
sprites["bearer"] = IconSprite.new(64, 288, viewport)
bitmapFileName = GameData::Species.icon_filename(mail.poke1[0],
mail.poke1[3], mail.poke1[1], mail.poke1[2], mail.poke1[4], mail.poke1[5])
bitmapFileName = GameData::Species.icon_filename(
mail.poke1[0], mail.poke1[3], mail.poke1[1], mail.poke1[2], mail.poke1[4], mail.poke1[5]
)
sprites["bearer"].setBitmap(bitmapFileName)
sprites["bearer"].src_rect.set(0, 0, 64, 64)
end
if mail.poke2
sprites["bearer2"] = IconSprite.new(144, 288, viewport)
bitmapFileName = GameData::Species.icon_filename(mail.poke2[0],
mail.poke2[3], mail.poke2[1], mail.poke2[2], mail.poke2[4], mail.poke2[5])
bitmapFileName = GameData::Species.icon_filename(
mail.poke2[0], mail.poke2[3], mail.poke2[1], mail.poke2[2], mail.poke2[4], mail.poke2[5]
)
sprites["bearer2"].setBitmap(bitmapFileName)
sprites["bearer2"].src_rect.set(0, 0, 64, 64)
end
if mail.poke3
sprites["bearer3"] = IconSprite.new(224, 288, viewport)
bitmapFileName = GameData::Species.icon_filename(mail.poke3[0],
mail.poke3[3], mail.poke3[1], mail.poke3[2], mail.poke3[4], mail.poke3[5])
bitmapFileName = GameData::Species.icon_filename(
mail.poke3[0], mail.poke3[3], mail.poke3[1], mail.poke3[2], mail.poke3[4], mail.poke3[5]
)
sprites["bearer3"].setBitmap(bitmapFileName)
sprites["bearer3"].src_rect.set(0, 0, 64, 64)
end
+2 -1
View File
@@ -78,7 +78,8 @@ class PokemonBag
max_size = max_pocket_size(pocket)
max_size = @pockets[pocket].length + 1 if max_size < 0 # Infinite size
return ItemStorageHelper.can_add?(
@pockets[pocket], max_size, Settings::BAG_MAX_PER_SLOT, item_data.id, qty)
@pockets[pocket], max_size, Settings::BAG_MAX_PER_SLOT, item_data.id, qty
)
end
def add(item, qty = 1)
@@ -103,8 +103,8 @@ class PokemonEggHatch_Scene
pbMEPlay("Evolution success")
@pokemon.name = nil
pbMessage(_INTL("\\se[]{1} hatched from the Egg!\\wt[80]", @pokemon.name)) { update }
if pbConfirmMessage(
_INTL("Would you like to nickname the newly hatched {1}?", @pokemon.name)) { update }
if pbConfirmMessage(_INTL("Would you like to nickname the newly hatched {1}?",
@pokemon.name)) { update }
nickname = pbEnterPokemonName(_INTL("{1}'s nickname?", @pokemon.name),
0, Pokemon::MAX_NAME_SIZE, "", @pokemon, true)
@pokemon.name = nickname
+2 -1
View File
@@ -47,7 +47,8 @@ class PokemonPokedexMenu_Scene
@sprites["background"] = IconSprite.new(0, 0, @viewport)
@sprites["background"].setBitmap(_INTL("Graphics/Pictures/Pokedex/bg_menu"))
@sprites["headings"] = Window_AdvancedTextPokemon.newWithSize(
_INTL("<c3=F8F8F8,C02028>SEEN<r>OBTAINED</c3>"), 286, 136, 208, 64, @viewport)
_INTL("<c3=F8F8F8,C02028>SEEN<r>OBTAINED</c3>"), 286, 136, 208, 64, @viewport
)
@sprites["headings"].windowskin = nil
@sprites["commands"] = Window_DexesList.new(commands, commands2, Graphics.width - 84)
@sprites["commands"].x = 40
+18 -11
View File
@@ -406,16 +406,14 @@ class PokemonPartyPanel < SpriteWrapper
# Draw shiny icon
if @pokemon.shiny?
pbDrawImagePositions(@overlaysprite.bitmap,
[["Graphics/Pictures/shiny", 80, 48, 0, 0, 16, 16]]
)
[["Graphics/Pictures/shiny", 80, 48, 0, 0, 16, 16]])
end
end
pbDrawTextPositions(@overlaysprite.bitmap, textpos)
# Draw level text
if !@pokemon.egg?
pbDrawImagePositions(@overlaysprite.bitmap,
[["Graphics/Pictures/Party/overlay_lv", 20, 70, 0, 0, 22, 14]]
)
[["Graphics/Pictures/Party/overlay_lv", 20, 70, 0, 0, 22, 14]])
pbSetSmallFont(@overlaysprite.bitmap)
pbDrawTextPositions(@overlaysprite.bitmap, [
[@pokemon.level.to_s, 42, 57, 0, basecolor, shadowcolor]
@@ -461,7 +459,8 @@ class PokemonParty_Scene
@sprites["messagebox"].letterbyletter = true
pbBottomLeftLines(@sprites["messagebox"], 2)
@sprites["storagetext"] = Window_UnformattedTextPokemon.new(
@can_access_storage ? _INTL("[Special]: To Boxes") : "")
@can_access_storage ? _INTL("[Special]: To Boxes") : ""
)
@sprites["storagetext"].x = 32
@sprites["storagetext"].y = Graphics.height - @sprites["messagebox"].height - 16
@sprites["storagetext"].z = 10
@@ -1103,11 +1102,15 @@ class PokemonPartyScreen
annot.push((elig) ? _INTL("ABLE") : _INTL("NOT ABLE"))
end
ret = -1
@scene.pbStartScene(@party,
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."), annot)
@scene.pbStartScene(
@party,
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."),
annot
)
loop do
@scene.pbSetHelpText(
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel.")
)
pkmnid = @scene.pbChoosePokemon
break if pkmnid < 0
if !eligibility[pkmnid] && !allowIneligible
@@ -1131,11 +1134,15 @@ class PokemonPartyScreen
annot.push((elig) ? _INTL("ABLE") : _INTL("NOT ABLE"))
end
ret = -1
@scene.pbStartScene(@party,
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."), annot)
@scene.pbStartScene(
@party,
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."),
annot
)
loop do
@scene.pbSetHelpText(
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel.")
)
pkmnid = @scene.pbChoosePokemon
break if pkmnid < 0
if !eligibility[pkmnid] && !allowIneligible
+12 -7
View File
@@ -197,8 +197,9 @@ class PokemonBag_Scene
@sprites["itemlist"].baseColor = ITEMLISTBASECOLOR
@sprites["itemlist"].shadowColor = ITEMLISTSHADOWCOLOR
@sprites["itemicon"] = ItemIconSprite.new(48, Graphics.height - 48, nil, @viewport)
@sprites["itemtext"] = Window_UnformattedTextPokemon.newWithSize("",
72, 270, Graphics.width - 72 - 24, 128, @viewport)
@sprites["itemtext"] = Window_UnformattedTextPokemon.newWithSize(
"", 72, 270, Graphics.width - 72 - 24, 128, @viewport
)
@sprites["itemtext"].baseColor = ITEMTEXTBASECOLOR
@sprites["itemtext"].shadowColor = ITEMTEXTSHADOWCOLOR
@sprites["itemtext"].visible = true
@@ -268,13 +269,16 @@ class PokemonBag_Scene
if @choosing && @filterlist
for i in 1...@bag.pockets.length
if @filterlist[i].length == 0
@sprites["pocketicon"].bitmap.blt(6 + (i - 1) * 22, 6,
@pocketbitmap.bitmap, Rect.new((i - 1) * 20, 28, 20, 20))
@sprites["pocketicon"].bitmap.blt(
6 + (i - 1) * 22, 6, @pocketbitmap.bitmap, Rect.new((i - 1) * 20, 28, 20, 20)
)
end
end
end
@sprites["pocketicon"].bitmap.blt(2 + (@sprites["itemlist"].pocket - 1) * 22, 2,
@pocketbitmap.bitmap, Rect.new((@sprites["itemlist"].pocket - 1) * 28, 0, 28, 28))
@sprites["pocketicon"].bitmap.blt(
2 + (@sprites["itemlist"].pocket - 1) * 22, 2, @pocketbitmap.bitmap,
Rect.new((@sprites["itemlist"].pocket - 1) * 28, 0, 28, 28)
)
# Refresh the item window
@sprites["itemlist"].refresh
# Refresh more things
@@ -552,7 +556,8 @@ class PokemonBagScreen
params.setRange(0, Settings::BAG_MAX_PER_SLOT)
params.setDefaultValue(qty)
newqty = pbMessageChooseNumber(
_INTL("Choose new quantity of {1} (max. #{Settings::BAG_MAX_PER_SLOT}).", itemplural), params) { @scene.pbUpdate }
_INTL("Choose new quantity of {1} (max. #{Settings::BAG_MAX_PER_SLOT}).", itemplural), params
) { @scene.pbUpdate }
if newqty > qty
@bag.add(item, newqty - qty)
elsif newqty < qty
+7 -6
View File
@@ -43,13 +43,15 @@ class PokemonPhoneScene
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999
@sprites["list"] = Window_PhoneList.newEmpty(152, 32, Graphics.width - 142, Graphics.height - 80, @viewport)
@sprites["header"] = Window_UnformattedTextPokemon.newWithSize(_INTL("Phone"),
2, -18, 128, 64, @viewport)
@sprites["header"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("Phone"), 2, -18, 128, 64, @viewport
)
@sprites["header"].baseColor = Color.new(248, 248, 248)
@sprites["header"].shadowColor = Color.new(0, 0, 0)
mapname = (@trainers[0][2]) ? pbGetMapNameFromId(@trainers[0][2]) : ""
@sprites["bottom"] = Window_AdvancedTextPokemon.newWithSize("",
162, Graphics.height - 64, Graphics.width - 158, 64, @viewport)
@sprites["bottom"] = Window_AdvancedTextPokemon.newWithSize(
"", 162, Graphics.height - 64, Graphics.width - 158, 64, @viewport
)
@sprites["bottom"].text = "<ac>" + mapname
@sprites["info"] = Window_AdvancedTextPokemon.newWithSize("", -8, 224, 180, 160, @viewport)
addBackgroundPlane(@sprites, "bg", "phonebg", @viewport)
@@ -68,8 +70,7 @@ class PokemonPhoneScene
for trainer in @trainers
if trainer.length == 4
displayname = _INTL("{1} {2}", GameData::TrainerType.get(trainer[0]).name,
pbGetMessageFromHash(MessageTypes::TrainerNames, trainer[1])
)
pbGetMessageFromHash(MessageTypes::TrainerNames, trainer[1]))
commands.push(displayname) # trainer's display name
else
commands.push(trainer[1]) # NPC's display name
+5 -3
View File
@@ -14,12 +14,14 @@ class PokemonJukebox_Scene
@sprites["background"] = IconSprite.new(0, 0, @viewport)
@sprites["background"].setBitmap("Graphics/Pictures/jukeboxbg")
@sprites["header"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("Jukebox"), 2, -18, 128, 64, @viewport)
_INTL("Jukebox"), 2, -18, 128, 64, @viewport
)
@sprites["header"].baseColor = Color.new(248, 248, 248)
@sprites["header"].shadowColor = Color.new(0, 0, 0)
@sprites["header"].windowskin = nil
@sprites["commands"] = Window_CommandPokemon.newWithSize(@commands,
94, 92, 324, 224, @viewport)
@sprites["commands"] = Window_CommandPokemon.newWithSize(
@commands, 94, 92, 324, 224, @viewport
)
@sprites["commands"].windowskin = nil
pbFadeInAndShow(@sprites) { pbUpdate }
end
+4 -2
View File
@@ -106,8 +106,10 @@ class PokemonLoad_Scene
addBackgroundOrColoredPlane(@sprites, "background", "loadbg", Color.new(248, 248, 248), @viewport)
y = 16 * 2
for i in 0...commands.length
@sprites["panel#{i}"] = PokemonLoadPanel.new(i, commands[i],
(show_continue) ? (i == 0) : false, trainer, frame_count, stats, map_id, @viewport)
@sprites["panel#{i}"] = PokemonLoadPanel.new(
i, commands[i], (show_continue) ? (i == 0) : false, trainer,
frame_count, stats, map_id, @viewport
)
@sprites["panel#{i}"].x = 24 * 2
@sprites["panel#{i}"].y = y
@sprites["panel#{i}"].pbRefresh
+1 -2
View File
@@ -87,8 +87,7 @@ class PokemonSaveScreen
pbMessage(_INTL('WARNING!'))
pbMessage(_INTL('There is a different game file that is already saved.'))
pbMessage(_INTL("If you save now, the other file's adventure, including items and Pokémon, will be entirely lost."))
if !pbConfirmMessageSerious(
_INTL('Are you sure you want to save now and overwrite the other save file?'))
if !pbConfirmMessageSerious(_INTL('Are you sure you want to save now and overwrite the other save file?'))
pbSEPlay('GUI save choice')
@scene.pbEndScreen
return false
+9 -7
View File
@@ -220,8 +220,7 @@ class Window_PokemonOption < Window_DrawableCommand
for value in @options[index].values
pbDrawShadowText(self.contents, xpos, rect.y, optionwidth, rect.height, value,
(ivalue == self[index]) ? @selBaseColor : self.baseColor,
(ivalue == self[index]) ? @selShadowColor : self.shadowColor
)
(ivalue == self[index]) ? @selShadowColor : self.shadowColor)
xpos += self.contents.text_size(value).width
xpos += spacing
ivalue += 1
@@ -245,7 +244,8 @@ class Window_PokemonOption < Window_DrawableCommand
self.contents.fill_rect(
xpos + (sliderlength - 8) * (@options[index].optstart + self[index]) / @options[index].optend,
rect.y - 8 + rect.height / 2,
8, 16, @selBaseColor)
8, 16, @selBaseColor
)
value = sprintf("%d", @options[index].optstart + self[index])
xpos += optionwidth - self.contents.text_size(value).width
pbDrawShadowText(self.contents, xpos, rect.y, optionwidth, rect.height, value,
@@ -291,7 +291,8 @@ class PokemonOption_Scene
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("Options"), 0, 0, Graphics.width, 64, @viewport)
_INTL("Options"), 0, 0, Graphics.width, 64, @viewport
)
@sprites["textbox"] = pbCreateMessageWindow
@sprites["textbox"].text = _INTL("Speech frame {1}.", 1 + $PokemonSystem.textskin)
@sprites["textbox"].letterbyletter = false
@@ -376,9 +377,10 @@ class PokemonOption_Scene
)
]
@PokemonOptions = pbAddOnOptions(@PokemonOptions)
@sprites["option"] = Window_PokemonOption.new(@PokemonOptions, 0,
@sprites["title"].height, Graphics.width,
Graphics.height - @sprites["title"].height - @sprites["textbox"].height)
@sprites["option"] = Window_PokemonOption.new(
@PokemonOptions, 0, @sprites["title"].height, Graphics.width,
Graphics.height - @sprites["title"].height - @sprites["textbox"].height
)
@sprites["option"].viewport = @viewport
@sprites["option"].visible = true
# Get the values of each option
+4 -5
View File
@@ -95,9 +95,9 @@ class MosaicPokemonSprite < PokemonSprite
@mosaicbitmap2.clear
@mosaicbitmap.stretch_blt(Rect.new(0, 0, newWidth, newHeight), @oldbitmap, @oldbitmap.rect)
@mosaicbitmap2.stretch_blt(
Rect.new(-@mosaic / 2 + 1, -@mosaic / 2 + 1,
@mosaicbitmap2.width, @mosaicbitmap2.height),
@mosaicbitmap, Rect.new(0, 0, newWidth, newHeight))
Rect.new(-@mosaic / 2 + 1, -@mosaic / 2 + 1, @mosaicbitmap2.width, @mosaicbitmap2.height),
@mosaicbitmap, Rect.new(0, 0, newWidth, newHeight)
)
self.bitmap = @mosaicbitmap2
end
@inrefresh = false
@@ -1928,8 +1928,7 @@ class PokemonStorageScreen
_INTL("Name"),
_INTL("Cancel")
]
command = pbShowCommands(
_INTL("What do you want to do?"), commands)
command = pbShowCommands(_INTL("What do you want to do?"), commands)
case command
when 0
destbox = @scene.pbChooseBox(_INTL("Jump to which Box?"))
+2 -4
View File
@@ -44,8 +44,7 @@ class StorageSystemPC
[_INTL("Organize the Pokémon in Boxes and in your party."),
_INTL("Move Pokémon stored in Boxes to your party."),
_INTL("Store Pokémon in your party in Boxes."),
_INTL("Return to the previous menu.")], -1, command
)
_INTL("Return to the previous menu.")], -1, command)
if command >= 0 && command < 3
case command
when 1 # Withdraw
@@ -123,8 +122,7 @@ def pbPCItemStorage
[_INTL("Take out items from the PC."),
_INTL("Store items in the PC."),
_INTL("Throw away items stored in the PC."),
_INTL("Go back to the previous menu.")], -1, command
)
_INTL("Go back to the previous menu.")], -1, command)
case command
when 0 # Withdraw Item
if !$PokemonGlobal.pcItemStorage
+11 -8
View File
@@ -203,13 +203,15 @@ class PokemonMart_Scene
@sprites["background"].setBitmap("Graphics/Pictures/martScreen")
@sprites["icon"] = ItemIconSprite.new(36, Graphics.height - 50, nil, @viewport)
winAdapter = buying ? BuyAdapter.new(adapter) : SellAdapter.new(adapter)
@sprites["itemwindow"] = Window_PokemonMart.new(stock, winAdapter,
Graphics.width - 316 - 16, 12, 330 + 16, Graphics.height - 126)
@sprites["itemwindow"] = Window_PokemonMart.new(
stock, winAdapter, Graphics.width - 316 - 16, 12, 330 + 16, Graphics.height - 126
)
@sprites["itemwindow"].viewport = @viewport
@sprites["itemwindow"].index = 0
@sprites["itemwindow"].refresh
@sprites["itemtextwindow"] = Window_UnformattedTextPokemon.newWithSize("",
64, Graphics.height - 96 - 16, Graphics.width - 64, 128, @viewport)
@sprites["itemtextwindow"] = Window_UnformattedTextPokemon.newWithSize(
"", 64, Graphics.height - 96 - 16, Graphics.width - 64, 128, @viewport
)
pbPrepareWindow(@sprites["itemtextwindow"])
@sprites["itemtextwindow"].baseColor = Color.new(248, 248, 248)
@sprites["itemtextwindow"].shadowColor = Color.new(0, 0, 0)
@@ -562,7 +564,8 @@ class PokemonMartScreen
maxafford = (price <= 0) ? Settings::BAG_MAX_PER_SLOT : @adapter.getMoney / price
maxafford = Settings::BAG_MAX_PER_SLOT if maxafford > Settings::BAG_MAX_PER_SLOT
quantity = @scene.pbChooseNumber(
_INTL("{1}? Certainly. How many would you like?", itemname), item, maxafford)
_INTL("{1}? Certainly. How many would you like?", itemname), item, maxafford
)
next if quantity == 0
price *= quantity
if !pbConfirm(_INTL("{1}, and you want {2}. That will be ${3}. OK?",
@@ -633,7 +636,8 @@ class PokemonMartScreen
@scene.pbShowMoney
if qty > 1
qty = @scene.pbChooseNumber(
_INTL("{1}? How many would you like to sell?", itemname), item, qty)
_INTL("{1}? How many would you like to sell?", itemname), item, qty
)
end
if qty == 0
@scene.pbHideMoney
@@ -669,8 +673,7 @@ def pbPokemonMart(stock, speech = nil, cantsell = false)
commands[cmdBuy = commands.length] = _INTL("Buy")
commands[cmdSell = commands.length] = _INTL("Sell") if !cantsell
commands[cmdQuit = commands.length] = _INTL("Quit")
cmd = pbMessage(
speech ? speech : _INTL("Welcome! How may I serve you?"),
cmd = pbMessage(speech ? speech : _INTL("Welcome! How may I serve you?"),
commands, cmdQuit + 1)
loop do
if cmdBuy >= 0 && cmd == cmdBuy
+6 -3
View File
@@ -411,7 +411,8 @@ class PurifyChamberScreen
if @chamber.setCount(set) == 0 && @chamber.isPurifiableIgnoreRegular?(set)
pkmn = @chamber.getShadow(set)
@scene.pbDisplay(
_INTL("This {1} is ready to open its heart. However, there must be at least one regular Pokémon in the set to perform a purification ceremony.", pkmn.name))
_INTL("This {1} is ready to open its heart. However, there must be at least one regular Pokémon in the set to perform a purification ceremony.", pkmn.name)
)
end
end
@@ -447,7 +448,8 @@ class PurifyChamberScreen
commands.push(_INTL("CANCEL"))
choice = @scene.pbShowCommands(
_INTL("What shall I do with this {1}?",
heldpkmn ? heldpkmn.name : curpkmn.name), commands)
heldpkmn ? heldpkmn.name : curpkmn.name), commands
)
if choice == 0
if heldpkmn
if pbPlace(heldpkmn, cmd[1]) # calls place or shift as appropriate
@@ -1113,7 +1115,8 @@ class PurifyChamberScene
addBackgroundOrColoredPlane(@sprites, "bg", "purifychamberbg",
Color.new(0, 0, 0), @viewport)
@sprites["setwindow"] = Window_PurifyChamberSets.new(
@chamber, 0, 0, 112, Graphics.height, @viewport)
@chamber, 0, 0, 112, Graphics.height, @viewport
)
@sprites["setview"] = PurifyChamberSetView.new(@chamber, set, @viewport)
@sprites["msgwindow"] = Window_AdvancedTextPokemon.new("")
@sprites["msgwindow"].viewport = @viewportmsg
+2 -1
View File
@@ -23,7 +23,8 @@ def pbEditMysteryGift(type, item, id = 0, giftname = "")
commands.push(_INTL("[Custom]"))
loop do
command = pbMessage(
_INTL("Choose a phrase to be where the gift Pokémon was obtained from."), commands, -1)
_INTL("Choose a phrase to be where the gift Pokémon was obtained from."), commands, -1
)
if command < 0
return nil if pbConfirmMessage(_INTL("Stop editing this gift?"))
elsif command < commands.length - 1
+3 -2
View File
@@ -81,8 +81,9 @@ class PokemonEntryScene
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999
if USEKEYBOARD
@sprites["entry"] = Window_TextEntry_Keyboard.new(initialText,
0, 0, 400 - 112, 96, helptext, true)
@sprites["entry"] = Window_TextEntry_Keyboard.new(
initialText, 0, 0, 400 - 112, 96, helptext, true
)
Input.text_input = true
else
@sprites["entry"] = Window_TextEntry.new(initialText, 0, 0, 400, 96, helptext, true)
@@ -419,7 +419,8 @@ def pbDuel(trainer_id, trainer_name, event, speeches)
trainer_id = GameData::TrainerType.get(trainer_id).id
duel = PokemonDuel.new
opponent = NPCTrainer.new(
pbGetMessageFromHash(MessageTypes::TrainerNames, trainer_name), trainer_id)
pbGetMessageFromHash(MessageTypes::TrainerNames, trainer_name), trainer_id
)
speech_texts = []
for i in 0...12
speech_texts.push(_I(speeches[i]))
@@ -169,8 +169,9 @@ class TriadScene
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999
addBackgroundPlane(@sprites, "background", "triad_bg", @viewport)
@sprites["helpwindow"] = Window_AdvancedTextPokemon.newWithSize("",
0, Graphics.height - 64, Graphics.width, 64, @viewport)
@sprites["helpwindow"] = Window_AdvancedTextPokemon.newWithSize(
"", 0, Graphics.height - 64, Graphics.width, 64, @viewport
)
for i in 0...@battle.width * @battle.height
@sprites["sprite#{i}"] = SpriteWrapper.new(@viewport)
@sprites["sprite#{i}"].x = Graphics.width / 2 - 118 + (i % 3) * 78
@@ -1076,7 +1077,8 @@ def pbBuyTriads
cmdwindow = Window_CommandPokemonEx.newWithSize(realcommands, 0, 0, Graphics.width / 2, Graphics.height)
cmdwindow.z = 99999
goldwindow = Window_UnformattedTextPokemon.newWithSize(
_INTL("Money:\r\n{1}", pbGetGoldString), 0, 0, 32, 32)
_INTL("Money:\r\n{1}", pbGetGoldString), 0, 0, 32, 32
)
goldwindow.resizeToFit(goldwindow.text, Graphics.width)
goldwindow.x = Graphics.width - goldwindow.width
goldwindow.y = 0
@@ -1118,7 +1120,8 @@ def pbBuyTriads
params.setInitialValue(1)
params.setCancelValue(0)
quantity = pbMessageChooseNumber(
_INTL("The {1} card? Certainly. How many would you like?", itemname), params)
_INTL("The {1} card? Certainly. How many would you like?", itemname), params
)
next if quantity <= 0
price *= quantity
next if !pbConfirmMessage(_INTL("{1}, and you want {2}. That will be ${3}. OK?", itemname, quantity, price.to_s_formatted))
@@ -1162,7 +1165,8 @@ def pbSellTriads
cmdwindow = Window_CommandPokemonEx.newWithSize(commands, 0, 0, Graphics.width / 2, Graphics.height)
cmdwindow.z = 99999
goldwindow = Window_UnformattedTextPokemon.newWithSize(
_INTL("Money:\r\n{1}", pbGetGoldString), 0, 0, 32, 32)
_INTL("Money:\r\n{1}", pbGetGoldString), 0, 0, 32, 32
)
goldwindow.resizeToFit(goldwindow.text, Graphics.width)
goldwindow.x = Graphics.width - goldwindow.width
goldwindow.y = 0
@@ -1216,7 +1220,8 @@ def pbSellTriads
params.setInitialValue(1)
params.setCancelValue(0)
quantity = pbMessageChooseNumber(
_INTL("The {1} card? How many would you like to sell?", itemname), params)
_INTL("The {1} card? How many would you like to sell?", itemname), params
)
end
if quantity > 0
price /= 4
@@ -56,11 +56,13 @@ class TilePuzzleCursor < BitmapSprite
if @game != 3
expand = (@holding) ? 0 : 4
for i in 0...4
self.bitmap.blt(x + (i % 2) * (@tilewidth - @cursorbitmap.width / 4) + expand * (((i % 2) * 2) - 1),
self.bitmap.blt(
x + (i % 2) * (@tilewidth - @cursorbitmap.width / 4) + expand * (((i % 2) * 2) - 1),
y + (i / 2) * (@tileheight - @cursorbitmap.height / 2) + expand * (((i / 2) * 2) - 1),
@cursorbitmap.bitmap, Rect.new(
(i % 2) * @cursorbitmap.width / 4, (i / 2) * @cursorbitmap.height / 2,
@cursorbitmap.width / 4, @cursorbitmap.height / 2))
@cursorbitmap.bitmap, Rect.new((i % 2) * @cursorbitmap.width / 4,
(i / 2) * @cursorbitmap.height / 2,
@cursorbitmap.width / 4, @cursorbitmap.height / 2)
)
end
end
# Arrows
@@ -72,8 +74,8 @@ class TilePuzzleCursor < BitmapSprite
(@tileheight - @cursorbitmap.height / 2) / 2, -expand]
for i in 0...4
if @arrows[i]
self.bitmap.blt(x + xin[i], y + yin[i], @cursorbitmap.bitmap, Rect.new(
@cursorbitmap.width / 2 + (i % 2) * (@cursorbitmap.width / 4),
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
@@ -373,7 +373,8 @@ class BattleFactoryData
trainerdata = bttrainers[@trainerid]
@opponent = NPCTrainer.new(
pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]),
trainerdata[0])
trainerdata[0]
)
opponentPkmn = pbBattleFactoryPokemon(pbBattleChallenge.rules, @bcdata.wins, @bcdata.swaps, @rentals)
@opponent.party = opponentPkmn.sample(3)
end
@@ -395,7 +396,8 @@ class BattleFactoryData
trainerdata = bttrainers[trainerid]
@opponent = NPCTrainer.new(
pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]),
trainerdata[0])
trainerdata[0]
)
opponentPkmn = pbBattleFactoryPokemon(pbBattleChallenge.rules, @bcdata.wins, @bcdata.swaps,
[].concat(@rentals).concat(@oldopponent))
@opponent.party = opponentPkmn.sample(3)
@@ -44,7 +44,8 @@ def pbGenerateBattleTrainer(idxTrainer, rules)
trainerdata = bttrainers[idxTrainer]
opponent = NPCTrainer.new(
pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]),
trainerdata[0])
trainerdata[0]
)
# Determine how many IVs the trainer's Pokémon will have
indvalues = 31
indvalues = 21 if idxTrainer < 220
@@ -7,13 +7,17 @@ class BattleSwapScene
@sprites = {}
addBackgroundPlane(@sprites, "bg", "rentbg", @viewport)
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("RENTAL POKéMON"), 0, 0, Graphics.width, 64, @viewport)
_INTL("RENTAL POKéMON"), 0, 0, Graphics.width, 64, @viewport
)
@sprites["list"] = Window_AdvancedCommandPokemonEx.newWithSize(
[], 0, 64, Graphics.width, Graphics.height - 128, @viewport)
@sprites["help"] = Window_UnformattedTextPokemon.newWithSize("",
0, Graphics.height - 64, Graphics.width, 64, @viewport)
@sprites["msgwindow"] = Window_AdvancedTextPokemon.newWithSize("",
0, Graphics.height - 64, Graphics.height, 64, @viewport)
[], 0, 64, Graphics.width, Graphics.height - 128, @viewport
)
@sprites["help"] = Window_UnformattedTextPokemon.newWithSize(
"", 0, Graphics.height - 64, Graphics.width, 64, @viewport
)
@sprites["msgwindow"] = Window_AdvancedTextPokemon.newWithSize(
"", 0, Graphics.height - 64, Graphics.height, 64, @viewport
)
@sprites["msgwindow"].visible = false
pbUpdateChoices([])
pbDeactivateWindows(@sprites)
@@ -29,13 +33,17 @@ class BattleSwapScene
@sprites = {}
addBackgroundPlane(@sprites, "bg", "swapbg", @viewport)
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("POKéMON SWAP"), 0, 0, Graphics.width, 64, @viewport)
_INTL("POKéMON SWAP"), 0, 0, Graphics.width, 64, @viewport
)
@sprites["list"] = Window_AdvancedCommandPokemonEx.newWithSize(
[], 0, 64, Graphics.width, Graphics.height - 128, @viewport)
[], 0, 64, Graphics.width, Graphics.height - 128, @viewport
)
@sprites["help"] = Window_UnformattedTextPokemon.newWithSize(
"", 0, Graphics.height - 64, Graphics.width, 64, @viewport)
"", 0, Graphics.height - 64, Graphics.width, 64, @viewport
)
@sprites["msgwindow"] = Window_AdvancedTextPokemon.newWithSize(
"", 0, Graphics.height - 64, Graphics.width, 64, @viewport)
"", 0, Graphics.height - 64, Graphics.width, 64, @viewport
)
@sprites["msgwindow"].visible = false
pbInitSwapScreen
pbDeactivateWindows(@sprites)
@@ -293,9 +293,10 @@ Events.onMapChange += proc { |_sender, _e|
Events.onMapSceneChange += proc { |_sender, e|
scene = e[0]
if pbInBugContest? && pbBugContestState.decision == 0 && BugContestState::TIME_ALLOWED > 0
scene.spriteset.addUserSprite(TimerDisplay.new(
pbBugContestState.timer,
BugContestState::TIME_ALLOWED * Graphics.frame_rate))
scene.spriteset.addUserSprite(
TimerDisplay.new(pbBugContestState.timer,
BugContestState::TIME_ALLOWED * Graphics.frame_rate)
)
end
}
@@ -342,8 +342,9 @@ def pbDecideWinnerScore(party0, party1, rating)
for move in party0[i].moves
next if !move
for j in 0...party1.length
score += pbDecideWinnerEffectiveness(move.id,
types1[j], types2[j], abilities[j], [-16, -8, 0, 4, 12, 20])
score += pbDecideWinnerEffectiveness(
move.id, types1[j], types2[j], abilities[j], [-16, -8, 0, 4, 12, 20]
)
end
end
basestatsum = baseStatTotal(party0[i].species)
@@ -8,8 +8,9 @@ def pbEncountersEditor
commands = []
maps = []
list = pbListWindow([])
help_window = Window_UnformattedTextPokemon.newWithSize(_INTL("Edit wild encounters"),
Graphics.width / 2, 0, Graphics.width / 2, 96)
help_window = Window_UnformattedTextPokemon.newWithSize(
_INTL("Edit wild encounters"), Graphics.width / 2, 0, Graphics.width / 2, 96
)
help_window.z = 99999
ret = 0
need_refresh = true
@@ -128,8 +129,9 @@ def pbEncounterMapVersionEditor(enc_data)
commands = []
enc_types = []
list = pbListWindow([])
help_window = Window_UnformattedTextPokemon.newWithSize(_INTL("Edit map's encounters"),
Graphics.width / 2, 0, Graphics.width / 2, 96)
help_window = Window_UnformattedTextPokemon.newWithSize(
_INTL("Edit map's encounters"), Graphics.width / 2, 0, Graphics.width / 2, 96
)
help_window.z = 99999
ret = 0
need_refresh = true
@@ -253,8 +255,9 @@ end
def pbEncounterTypeEditor(enc_data, enc_type)
commands = []
list = pbListWindow([])
help_window = Window_UnformattedTextPokemon.newWithSize(_INTL("Edit encounter slots"),
Graphics.width / 2, 0, Graphics.width / 2, 96)
help_window = Window_UnformattedTextPokemon.newWithSize(
_INTL("Edit encounter slots"), Graphics.width / 2, 0, Graphics.width / 2, 96
)
help_window.z = 99999
enc_type_name = ""
ret = 0
@@ -1172,7 +1175,8 @@ def pbRegionalDexEditor(dex)
cmd_window = pbListWindow([])
info = Window_AdvancedTextPokemon.newWithSize(
_INTL("Z+Up/Down: Rearrange entries\nZ+Right: Insert new entry\nZ+Left: Delete entry\nD: Clear entry"),
Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport)
Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport
)
info.z = 2
dex.compact!
ret = dex.clone
@@ -1226,7 +1230,9 @@ def pbRegionalDexEditor(dex)
when 0
if cmd[1] >= 0 # Edit entry
case pbMessage(_INTL("\\ts[]Do what with this entry?"),
[_INTL("Change species"), _INTL("Clear"), _INTL("Insert entry"), _INTL("Delete entry"), _INTL("Cancel")], 5)
[_INTL("Change species"), _INTL("Clear"),
_INTL("Insert entry"), _INTL("Delete entry"),
_INTL("Cancel")], 5)
when 0 # Change species
species = pbChooseSpeciesList(dex[cmd[1]])
if species
@@ -1276,11 +1282,14 @@ def pbRegionalDexEditorMain
cmd_window = pbListWindow([])
cmd_window.viewport = viewport
cmd_window.z = 2
title = Window_UnformattedTextPokemon.newWithSize(_INTL("Regional Dexes Editor"),
Graphics.width / 2, 0, Graphics.width / 2, 64, viewport)
title = Window_UnformattedTextPokemon.newWithSize(
_INTL("Regional Dexes Editor"), Graphics.width / 2, 0, Graphics.width / 2, 64, viewport
)
title.z = 2
info = Window_AdvancedTextPokemon.newWithSize(_INTL("Z+Up/Down: Rearrange Dexes"),
Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport)
info = Window_AdvancedTextPokemon.newWithSize(
_INTL("Z+Up/Down: Rearrange Dexes"), Graphics.width / 2, 64,
Graphics.width / 2, Graphics.height - 64, viewport
)
info.z = 2
dex_lists = []
pbLoadRegionalDexes.each_with_index { |d, index| dex_lists[index] = d.clone }
@@ -1314,7 +1323,8 @@ def pbRegionalDexEditorMain
when 0 # Clicked on a command/Dex
if cmd[1] == 0 # Add new Dex
case pbMessage(_INTL("Fill in this new Dex?"),
[_INTL("Leave blank"), _INTL("National Dex"), _INTL("Nat. Dex grouped families"), _INTL("Cancel")], 4)
[_INTL("Leave blank"), _INTL("National Dex"),
_INTL("Nat. Dex grouped families"), _INTL("Cancel")], 4)
when 0 # Leave blank
dex_lists.push([])
refresh_list = true
@@ -1432,11 +1442,14 @@ def pbAnimationsOrganiser
cmdwin = pbListWindow([])
cmdwin.viewport = viewport
cmdwin.z = 2
title = Window_UnformattedTextPokemon.newWithSize(_INTL("Animations Organiser"),
Graphics.width / 2, 0, Graphics.width / 2, 64, viewport)
title = Window_UnformattedTextPokemon.newWithSize(
_INTL("Animations Organiser"), Graphics.width / 2, 0, Graphics.width / 2, 64, viewport
)
title.z = 2
info = Window_AdvancedTextPokemon.newWithSize(_INTL("Z+Up/Down: Swap\nZ+Left: Delete\nZ+Right: Insert"),
Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport)
info = Window_AdvancedTextPokemon.newWithSize(
_INTL("Z+Up/Down: Swap\nZ+Left: Delete\nZ+Right: Insert"),
Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport
)
info.z = 2
commands = []
refreshlist = true
@@ -18,7 +18,8 @@ class PokemonTilesetScene
@sprites = {}
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("Tileset Editor\r\nA/S: SCROLL\r\nZ: MENU"),
TILESET_WIDTH, 0, Graphics.width - TILESET_WIDTH, 128, @viewport)
TILESET_WIDTH, 0, Graphics.width - TILESET_WIDTH, 128, @viewport
)
@sprites["tileset"] = BitmapSprite.new(TILESET_WIDTH, Graphics.height, @viewport)
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
pbSetSystemFont(@sprites["overlay"].bitmap)
@@ -60,7 +60,8 @@ class SelectionSprite < Sprite
if @othersprite && !@othersprite.disposed? &&
@othersprite.bitmap && !@othersprite.bitmap.disposed?
@sprite.bitmap = pbDoEnsureBitmap(
@sprite.bitmap, @othersprite.bitmap.width, @othersprite.bitmap.height)
@sprite.bitmap, @othersprite.bitmap.width, @othersprite.bitmap.height
)
red = Color.new(255, 0, 0)
@sprite.bitmap.clear
@sprite.bitmap.fill_rect(0, 0, @othersprite.bitmap.width, 2, red)
@@ -324,8 +325,9 @@ class MapScreenScene
@selmapid = -1
@sprites["background"] = ColoredPlane.new(Color.new(160, 208, 240), @viewport)
@sprites["selsprite"] = SelectionSprite.new(@viewport)
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(_INTL("D: Help"),
0, Graphics.height - 64, Graphics.width, 64, @viewport)
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("D: Help"), 0, Graphics.height - 64, Graphics.width, 64, @viewport
)
@sprites["title"].z = 2
@mapinfos = pbLoadMapInfos
conns = MapFactoryHelper.getMapConnections
@@ -358,8 +360,9 @@ class MapScreenScene
helptext += _INTL("Double-click: Edit map's metadata\r\n")
helptext += _INTL("Drag map to move it\r\n")
helptext += _INTL("Arrow keys/drag canvas: Move around canvas")
title = Window_UnformattedTextPokemon.newWithSize(helptext,
0, 0, Graphics.width * 8 / 10, Graphics.height, @viewport)
title = Window_UnformattedTextPokemon.newWithSize(
helptext, 0, 0, Graphics.width * 8 / 10, Graphics.height, @viewport
)
title.z = 2
loop do
Graphics.update
@@ -541,12 +541,15 @@ class AnimationCanvas < Sprite
oldtargetx = targetsprite ? targetsprite.x : 0
oldtargety = targetsprite ? targetsprite.y : 0
@player = PBAnimationPlayerX.new(@animation,
@battle.battlers[oppmove ? 1 : 0], @battle.battlers[oppmove ? 0 : 1], self, oppmove, true)
@battle.battlers[oppmove ? 1 : 0],
@battle.battlers[oppmove ? 0 : 1],
self, oppmove, true)
@player.setLineTransform(
Battle::Scene::FOCUSUSER_X, Battle::Scene::FOCUSUSER_Y,
Battle::Scene::FOCUSTARGET_X, Battle::Scene::FOCUSTARGET_Y,
olduserx, oldusery,
oldtargetx, oldtargety)
oldtargetx, oldtargety
)
@player.start
@playing = true
@sprites["pokemon_0"].x += BORDERSIZE
@@ -992,8 +995,7 @@ class BitmapDisplayWindow < SpriteWindow_Base
wh = sx * wh
ww = self.contents.width
end
dest = Rect.new(
(self.contents.width - ww) / 2,
dest = Rect.new((self.contents.width - ww) / 2,
(self.contents.height - wh) / 2,
ww, wh)
src = Rect.new(0, 0, bmap.width, bmap.height)
@@ -1009,7 +1011,8 @@ class AnimationNameWindow
@canvas = canvas
@oldname = nil
@window = Window_UnformattedTextPokemon.newWithSize(
_INTL("Name: {1}", @canvas.animation.name), x, y, width, height, viewport)
_INTL("Name: {1}", @canvas.animation.name), x, y, width, height, viewport
)
end
def viewport=(value); @window.viewport = value; end
@@ -47,10 +47,7 @@ class UIControl
end
def toAbsoluteRect(rc)
return Rect.new(
rc.x + self.parentX,
rc.y + self.parentY,
rc.width, rc.height)
return Rect.new(rc.x + self.parentX, rc.y + self.parentY, rc.width, rc.height)
end
def parentX
@@ -283,8 +283,9 @@ def pbDefinePath(canvas)
showline = false
sliderwin2.visible = false
# This window displays the mouse's current position
window = Window_UnformattedTextPokemon.newWithSize("",
0, 320 - 64, 128, 64, canvas.viewport)
window = Window_UnformattedTextPokemon.newWithSize(
"", 0, 320 - 64, 128, 64, canvas.viewport
)
loop do
Graphics.update
Input.update
@@ -363,8 +364,9 @@ def pbDefinePath(canvas)
point.dispose
end
points.clear
window = Window_UnformattedTextPokemon.newWithSize("",
0, 320 - 64, 128, 64, canvas.viewport)
window = Window_UnformattedTextPokemon.newWithSize(
"", 0, 320 - 64, 128, 64, canvas.viewport
)
sliderwin2.visible = false
loop do
Graphics.update
@@ -129,7 +129,8 @@ def pbAnimList(animations, canvas, animwin)
cmdwin.viewport = canvas.viewport
helpwindow = Window_UnformattedTextPokemon.newWithSize(
_INTL("Enter: Load/rename an animation\nEsc: Cancel"),
320, 0, 320, 128, canvas.viewport)
320, 0, 320, 128, canvas.viewport
)
maxsizewindow = ControlWindow.new(0, 416, 320, 32 * 3)
maxsizewindow.addSlider(_INTL("Total Animations:"), 1, 2000, animations.length)
maxsizewindow.addButton(_INTL("Resize Animation List"))
@@ -684,8 +684,9 @@ end
def chooseMapPoint(map, rgnmap = false)
viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
viewport.z = 99999
title = Window_UnformattedTextPokemon.newWithSize(_INTL("Click a point on the map."),
0, Graphics.height - 64, Graphics.width, 64, viewport)
title = Window_UnformattedTextPokemon.newWithSize(
_INTL("Click a point on the map."), 0, Graphics.height - 64, Graphics.width, 64, viewport
)
title.z = 2
if rgnmap
sprite = RegionMapSprite.new(map, viewport)
@@ -1554,11 +1555,13 @@ def pbPropertyList(title, data, properties, saveprompt = false)
list = pbListWindow([], Graphics.width / 2)
list.viewport = viewport
list.z = 2
title = Window_UnformattedTextPokemon.newWithSize(title,
list.width, 0, Graphics.width / 2, 64, viewport)
title = Window_UnformattedTextPokemon.newWithSize(
title, list.width, 0, Graphics.width / 2, 64, viewport
)
title.z = 2
desc = Window_UnformattedTextPokemon.newWithSize("",
list.width, title.height, Graphics.width / 2, Graphics.height - title.height, viewport)
desc = Window_UnformattedTextPokemon.newWithSize(
"", list.width, title.height, Graphics.width / 2, Graphics.height - title.height, viewport
)
desc.z = 2
selectedmap = -1
retval = nil
@@ -257,7 +257,8 @@ DebugMenuCommands.register("testwildbattleadvanced", {
params.setInitialValue(size0)
params.setCancelValue(0)
newSize = pbMessageChooseNumber(
_INTL("Choose the number of battlers on the player's side (max. {1}).", maxVal), params)
_INTL("Choose the number of battlers on the player's side (max. {1}).", maxVal), params
)
size0 = newSize if newSize > 0
elsif pkmnCmd == pkmnCmds.length - 3 # Add Pokémon
species = pbChooseSpeciesList
@@ -325,7 +326,8 @@ DebugMenuCommands.register("testtrainerbattleadvanced", {
elsif size1 > trainers.length && trainers[0][1].party_count == 1
pbMessage(
_INTL("Opposing side size cannot be {1}, as that requires the first trainer to have 2 or more Pokémon, which they don't.",
size1))
size1)
)
next
end
setBattleRule(sprintf("%dv%d", size0, size1))
@@ -347,7 +349,8 @@ DebugMenuCommands.register("testtrainerbattleadvanced", {
params.setInitialValue(size1)
params.setCancelValue(0)
newSize = pbMessageChooseNumber(
_INTL("Choose the number of battlers on the opponent's side (max. {1}).", maxVal), params)
_INTL("Choose the number of battlers on the opponent's side (max. {1}).", maxVal), params
)
size1 = newSize if newSize > 0
elsif trainerCmd == trainerCmds.length - 3 # Set player side size
if !pbCanDoubleBattle?
@@ -360,7 +363,8 @@ DebugMenuCommands.register("testtrainerbattleadvanced", {
params.setInitialValue(size0)
params.setCancelValue(0)
newSize = pbMessageChooseNumber(
_INTL("Choose the number of battlers on the player's side (max. {1}).", maxVal), params)
_INTL("Choose the number of battlers on the player's side (max. {1}).", maxVal), params
)
size0 = newSize if newSize > 0
elsif trainerCmd == trainerCmds.length - 4 # Add trainer
trainerdata = pbListScreen(_INTL("CHOOSE A TRAINER"), TrainerBattleLister.new(0, false))
@@ -58,7 +58,8 @@ PokemonDebugMenuCommands.register("sethp", {
params.setRange(0, pkmn.totalhp)
params.setDefaultValue(pkmn.hp)
newhp = pbMessageChooseNumber(
_INTL("Set {1}'s HP (max. {2}).", pkmn.name, pkmn.totalhp), params) { screen.pbUpdate }
_INTL("Set {1}'s HP (max. {2}).", pkmn.name, pkmn.totalhp), params
) { screen.pbUpdate }
if newhp != pkmn.hp
pkmn.hp = newhp
screen.pbRefreshSingle(pkmnid)
@@ -106,7 +107,8 @@ PokemonDebugMenuCommands.register("setstatus", {
params.setRange(0, 9)
params.setDefaultValue(3)
count = pbMessageChooseNumber(
_INTL("Set the Pokémon's sleep count."), params) { screen.pbUpdate }
_INTL("Set the Pokémon's sleep count."), params
) { screen.pbUpdate }
cancel = true if count <= 0
end
if !cancel
@@ -209,7 +211,8 @@ PokemonDebugMenuCommands.register("setlevel", {
params.setRange(1, GameData::GrowthRate.max_level)
params.setDefaultValue(pkmn.level)
level = pbMessageChooseNumber(
_INTL("Set the Pokémon's level (max. {1}).", params.maxNumber), params) { screen.pbUpdate }
_INTL("Set the Pokémon's level (max. {1}).", params.maxNumber), params
) { screen.pbUpdate }
if level != pkmn.level
pkmn.level = level
pkmn.calc_stats
@@ -237,7 +240,8 @@ PokemonDebugMenuCommands.register("setexp", {
params.setRange(minxp, maxxp - 1)
params.setDefaultValue(pkmn.exp)
newexp = pbMessageChooseNumber(
_INTL("Set the Pokémon's Exp (range {1}-{2}).", minxp, maxxp - 1), params) { screen.pbUpdate }
_INTL("Set the Pokémon's Exp (range {1}-{2}).", minxp, maxxp - 1), params
) { screen.pbUpdate }
if newexp != pkmn.exp
pkmn.exp = newexp
pkmn.calc_stats
@@ -372,7 +376,8 @@ PokemonDebugMenuCommands.register("sethappiness", {
params.setRange(0, 255)
params.setDefaultValue(pkmn.happiness)
h = pbMessageChooseNumber(
_INTL("Set the Pokémon's happiness (max. 255)."), params) { screen.pbUpdate }
_INTL("Set the Pokémon's happiness (max. 255)."), params
) { screen.pbUpdate }
if h != pkmn.happiness
pkmn.happiness = h
screen.pbRefreshSingle(pkmnid)
@@ -396,7 +401,8 @@ PokemonDebugMenuCommands.register("setbeauty", {
params.setRange(0, 255)
params.setDefaultValue(pkmn.beauty)
newval = pbMessageChooseNumber(
_INTL("Set the Pokémon's Beauty (max. 255)."), params) { screen.pbUpdate }
_INTL("Set the Pokémon's Beauty (max. 255)."), params
) { screen.pbUpdate }
if newval != pkmn.beauty
pkmn.beauty = newval
screen.pbRefreshSingle(pkmnid)
@@ -414,7 +420,8 @@ PokemonDebugMenuCommands.register("setcool", {
params.setRange(0, 255)
params.setDefaultValue(pkmn.cool)
newval = pbMessageChooseNumber(
_INTL("Set the Pokémon's Cool (max. 255)."), params) { screen.pbUpdate }
_INTL("Set the Pokémon's Cool (max. 255)."), params
) { screen.pbUpdate }
if newval != pkmn.cool
pkmn.cool = newval
screen.pbRefreshSingle(pkmnid)
@@ -432,7 +439,8 @@ PokemonDebugMenuCommands.register("setcute", {
params.setRange(0, 255)
params.setDefaultValue(pkmn.cute)
newval = pbMessageChooseNumber(
_INTL("Set the Pokémon's Cute (max. 255)."), params) { screen.pbUpdate }
_INTL("Set the Pokémon's Cute (max. 255)."), params
) { screen.pbUpdate }
if newval != pkmn.cute
pkmn.cute = newval
screen.pbRefreshSingle(pkmnid)
@@ -450,7 +458,8 @@ PokemonDebugMenuCommands.register("setsmart", {
params.setRange(0, 255)
params.setDefaultValue(pkmn.smart)
newval = pbMessageChooseNumber(
_INTL("Set the Pokémon's Smart (max. 255)."), params) { screen.pbUpdate }
_INTL("Set the Pokémon's Smart (max. 255)."), params
) { screen.pbUpdate }
if newval != pkmn.smart
pkmn.smart = newval
screen.pbRefreshSingle(pkmnid)
@@ -468,7 +477,8 @@ PokemonDebugMenuCommands.register("settough", {
params.setRange(0, 255)
params.setDefaultValue(pkmn.tough)
newval = pbMessageChooseNumber(
_INTL("Set the Pokémon's Tough (max. 255)."), params) { screen.pbUpdate }
_INTL("Set the Pokémon's Tough (max. 255)."), params
) { screen.pbUpdate }
if newval != pkmn.tough
pkmn.tough = newval
screen.pbRefreshSingle(pkmnid)
@@ -486,7 +496,8 @@ PokemonDebugMenuCommands.register("setsheen", {
params.setRange(0, 255)
params.setDefaultValue(pkmn.sheen)
newval = pbMessageChooseNumber(
_INTL("Set the Pokémon's Sheen (max. 255)."), params) { screen.pbUpdate }
_INTL("Set the Pokémon's Sheen (max. 255)."), params
) { screen.pbUpdate }
if newval != pkmn.sheen
pkmn.sheen = newval
screen.pbRefreshSingle(pkmnid)
@@ -585,7 +596,8 @@ PokemonDebugMenuCommands.register("setmovepp", {
params.setRange(0, move.total_pp)
params.setDefaultValue(move.pp)
h = pbMessageChooseNumber(
_INTL("Set PP of {1} (max. {2}).", movename, move.total_pp), params) { screen.pbUpdate }
_INTL("Set PP of {1} (max. {2}).", movename, move.total_pp), params
) { screen.pbUpdate }
move.pp = h
when 1 # Full PP
move.pp = move.total_pp
@@ -594,7 +606,8 @@ PokemonDebugMenuCommands.register("setmovepp", {
params.setRange(0, 3)
params.setDefaultValue(move.ppup)
h = pbMessageChooseNumber(
_INTL("Set PP Up of {1} (max. 3).", movename), params) { screen.pbUpdate }
_INTL("Set PP Up of {1} (max. 3).", movename), params
) { screen.pbUpdate }
move.ppup = h
move.pp = move.total_pp if move.pp > move.total_pp
end
@@ -869,11 +882,8 @@ PokemonDebugMenuCommands.register("setshininess", {
loop do
msg_idx = pkmn.shiny? ? (pkmn.super_shiny? ? 1 : 0) : 2
msg = [_INTL("Is shiny."), _INTL("Is super shiny."), _INTL("Is normal (not shiny).")][msg_idx]
cmd = screen.pbShowCommands(msg,
[_INTL("Make shiny"),
_INTL("Make super shiny"),
_INTL("Make normal"),
_INTL("Reset")], cmd)
cmd = screen.pbShowCommands(msg, [_INTL("Make shiny"), _INTL("Make super shiny"),
_INTL("Make normal"), _INTL("Reset")], cmd)
break if cmd < 0
case cmd
when 0 # Make shiny
@@ -1022,7 +1032,8 @@ PokemonDebugMenuCommands.register("ownership", {
params.setRange(0, 65535)
params.setDefaultValue(pkmn.owner.public_id)
val = pbMessageChooseNumber(
_INTL("Set the new ID (max. 65535)."), params) { screen.pbUpdate }
_INTL("Set the new ID (max. 65535)."), params
) { screen.pbUpdate }
pkmn.owner.id = val | val << 16
end
end
@@ -1132,7 +1143,8 @@ PokemonDebugMenuCommands.register("shadowpkmn", {
params.setDefaultValue(pkmn.heart_gauge)
val = pbMessageChooseNumber(
_INTL("Set the heart gauge (max. {1}).", pkmn.max_gauge_size),
params) { screen.pbUpdate }
params
) { screen.pbUpdate }
if val != oldheart
pkmn.adjustHeart(val - oldheart)
pkmn.check_ready_to_purify
@@ -162,7 +162,8 @@ BattleDebugMenuCommands.register("weather", {
when 0 # Change type
weather_cmd = weather_types.index(battle.field.weather) || 0
new_weather = pbMessage(
"\\ts[]" + _INTL("Choose the new weather type."), weather_cmds, -1, nil, weather_cmd)
"\\ts[]" + _INTL("Choose the new weather type."), weather_cmds, -1, nil, weather_cmd
)
if new_weather >= 0
battle.field.weather = weather_types[new_weather]
battle.field.weatherDuration = 5 if battle.field.weatherDuration == 0
@@ -177,7 +178,8 @@ BattleDebugMenuCommands.register("weather", {
params.setInitialValue([battle.field.weatherDuration, 0].max)
params.setCancelValue([battle.field.weatherDuration, 0].max)
new_duration = pbMessageChooseNumber(
"\\ts[]" + _INTL("Choose the new weather duration (0=infinite)."), params)
"\\ts[]" + _INTL("Choose the new weather duration (0=infinite)."), params
)
if new_duration != [battle.field.weatherDuration, 0].max
battle.field.weatherDuration = (new_duration == 0) ? -1 : new_duration
end
@@ -223,7 +225,8 @@ BattleDebugMenuCommands.register("terrain", {
when 0 # Change type
terrain_cmd = terrain_types.index(battle.field.terrain) || 0
new_terrain = pbMessage(
"\\ts[]" + _INTL("Choose the new terrain type."), terrain_cmds, -1, nil, terrain_cmd)
"\\ts[]" + _INTL("Choose the new terrain type."), terrain_cmds, -1, nil, terrain_cmd
)
if new_terrain >= 0
battle.field.terrain = terrain_types[new_terrain]
battle.field.terrainDuration = 5 if battle.field.terrainDuration == 0
@@ -238,7 +241,8 @@ BattleDebugMenuCommands.register("terrain", {
params.setInitialValue([battle.field.terrainDuration, 0].max)
params.setCancelValue([battle.field.terrainDuration, 0].max)
new_duration = pbMessageChooseNumber(
"\\ts[]" + _INTL("Choose the new terrain duration (0=infinite)."), params)
"\\ts[]" + _INTL("Choose the new terrain duration (0=infinite)."), params
)
if new_duration != [battle.field.terrainDuration, 0].max
battle.field.terrainDuration = (new_duration == 0) ? -1 : new_duration
end
@@ -275,7 +279,8 @@ BattleDebugMenuCommands.register("environment", {
when 0 # Change environment
environment_cmd = environment_types.index(battle.environment) || 0
new_environment = pbMessage(
"\\ts[]" + _INTL("Choose the new environment."), environment_cmds, -1, nil, environment_cmd)
"\\ts[]" + _INTL("Choose the new environment."), environment_cmds, -1, nil, environment_cmd
)
if new_environment >= 0
battle.environment = environment_types[new_environment]
end
@@ -72,7 +72,8 @@ BattlerDebugMenuCommands.register("sethp", {
params.setRange(1, battler.totalhp)
params.setDefaultValue(battler.hp)
new_hp = pbMessageChooseNumber(
"\\ts[]" + _INTL("Set {1}'s HP (1-{2}).", battler.pbThis(true), battler.totalhp), params)
"\\ts[]" + _INTL("Set {1}'s HP (1-{2}).", battler.pbThis(true), battler.totalhp), params
)
battler.hp = new_hp if new_hp != battler.hp
}
})
@@ -126,7 +127,8 @@ BattlerDebugMenuCommands.register("setstatus", {
params.setDefaultValue(0)
params.setCancelValue(-1)
count = pbMessageChooseNumber(
"\\ts[]" + _INTL("Set {1}'s toxic count (0-15).", battler.pbThis(true)), params)
"\\ts[]" + _INTL("Set {1}'s toxic count (0-15).", battler.pbThis(true)), params
)
next if count < 0
battler.statusCount = 1
battler.effects[PBEffects::Toxic] = count
@@ -192,7 +194,8 @@ BattlerDebugMenuCommands.register("setstatstages", {
params.setNegativesAllowed(true)
params.setDefaultValue(battler.stages[stat_ids[cmd]])
value = pbMessageChooseNumber(
"\\ts[]" + _INTL("Set the stage for {1}.", GameData::Stat.get(stat_ids[cmd]).name), params)
"\\ts[]" + _INTL("Set the stage for {1}.", GameData::Stat.get(stat_ids[cmd]).name), params
)
battler.stages[stat_ids[cmd]] = value
else # Reset all stats
GameData::Stat.each_battle { |stat| battler.stages[stat.id] = 0 }
@@ -214,7 +217,8 @@ BattlerDebugMenuCommands.register("setlevel", {
params.setRange(1, GameData::GrowthRate.max_level)
params.setDefaultValue(pkmn.level)
level = pbMessageChooseNumber(
"\\ts[]" + _INTL("Set the Pokémon's level (max. {1}).", params.maxNumber), params)
"\\ts[]" + _INTL("Set the Pokémon's level (max. {1}).", params.maxNumber), params
)
if level != pkmn.level
pkmn.level = level
pkmn.calc_stats
@@ -242,7 +246,8 @@ BattlerDebugMenuCommands.register("setexp", {
params.setRange(min_exp, max_exp - 1)
params.setDefaultValue(pkmn.exp)
new_exp = pbMessageChooseNumber(
"\\ts[]" + _INTL("Set the Pokémon's Exp (range {1}-{2}).", min_exp, max_exp - 1), params)
"\\ts[]" + _INTL("Set the Pokémon's Exp (range {1}-{2}).", min_exp, max_exp - 1), params
)
pkmn.exp = new_exp if new_exp != pkmn.exp
}
})
@@ -514,7 +519,8 @@ BattlerDebugMenuCommands.register("setmovepp", {
params.setRange(0, move.total_pp)
params.setDefaultValue(move.pp)
h = pbMessageChooseNumber(
"\\ts[]" + _INTL("Set PP of {1} (max. {2}).", move_name, move.total_pp), params)
"\\ts[]" + _INTL("Set PP of {1} (max. {2}).", move_name, move.total_pp), params
)
move.pp = h
if battler && battler.moves[move_indices[cmd]].id == move.id
battler.moves[move_indices[cmd]].pp = move.pp
@@ -529,7 +535,8 @@ BattlerDebugMenuCommands.register("setmovepp", {
params.setRange(0, 3)
params.setDefaultValue(move.ppup)
h = pbMessageChooseNumber(
"\\ts[]" + _INTL("Set PP Up of {1} (max. 3).", move_name), params)
"\\ts[]" + _INTL("Set PP Up of {1} (max. 3).", move_name), params
)
move.ppup = h
move.pp = move.total_pp if move.pp > move.total_pp
if battler && battler.moves[move_indices[cmd]].id == move.id
+9 -6
View File
@@ -16,8 +16,9 @@ def pbListScreen(title, lister)
list = pbListWindow([])
list.viewport = viewport
list.z = 2
title = Window_UnformattedTextPokemon.newWithSize(title,
Graphics.width / 2, 0, Graphics.width / 2, 64, viewport)
title = Window_UnformattedTextPokemon.newWithSize(
title, Graphics.width / 2, 0, Graphics.width / 2, 64, viewport
)
title.z = 2
lister.setViewport(viewport)
selectedmap = -1
@@ -63,8 +64,9 @@ def pbListScreenBlock(title, lister)
list = pbListWindow([], Graphics.width / 2)
list.viewport = viewport
list.z = 2
title = Window_UnformattedTextPokemon.newWithSize(title,
Graphics.width / 2, 0, Graphics.width / 2, 64, viewport)
title = Window_UnformattedTextPokemon.newWithSize(
title, Graphics.width / 2, 0, Graphics.width / 2, 64, viewport
)
title.z = 2
lister.setViewport(viewport)
selectedmap = -1
@@ -552,8 +554,9 @@ class TrainerBattleLister
def initialize(selection, includeNew)
@sprite = IconSprite.new(Graphics.width * 3 / 4, (Graphics.height / 2) + 32)
@sprite.z = 2
@pkmnList = Window_UnformattedTextPokemon.newWithSize("",
Graphics.width / 2, Graphics.height - 64, Graphics.width / 2, 64)
@pkmnList = Window_UnformattedTextPokemon.newWithSize(
"", Graphics.width / 2, Graphics.height - 64, Graphics.width / 2, 64
)
@pkmnList.z = 3
@selection = selection
@commands = []
@@ -351,8 +351,7 @@ module Compiler
line = pbGetCsvRecord(line, line_no,
[0, "snssueeuuueiss",
nil, nil, nil, nil, nil, :Type, ["Physical", "Special", "Status"],
nil, nil, nil, :Target, nil, nil, nil]
)
nil, nil, nil, :Target, nil, nil, nil])
move_id = line[1].to_sym
if GameData::Move::DATA[move_id]
raise _INTL("Move ID '{1}' is used twice.\r\n{2}", move_id, FileLineData.linereport)
@@ -471,8 +470,7 @@ module Compiler
# Parse item
line = pbGetCsvRecord(line, line_no,
[0, "snssvusuuUE", nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, :Move]
)
nil, nil, nil, nil, nil, nil, nil, :Move])
item_id = line[1].to_sym
if GameData::Item.exists?(item_id)
raise _INTL("Item ID '{1}' is used twice.\r\n{2}", item_id, FileLineData.linereport)
@@ -1347,8 +1345,7 @@ module Compiler
{ "Male" => 0, "M" => 0, "0" => 0,
"Female" => 1, "F" => 1, "1" => 1,
"Mixed" => 2, "X" => 2, "2" => 2, "" => 2 },
nil, nil]
)
nil, nil])
tr_type_id = line[1].to_sym
if GameData::TrainerType.exists?(tr_type_id)
raise _INTL("Trainer Type ID '{1}' is used twice.\r\n{2}", tr_type_id, FileLineData.linereport)
@@ -119,7 +119,8 @@ module Compiler
for i in 0...route.list.length
list.push(RPG::EventCommand.new(
(i == 0) ? 209 : 509, indent,
(i == 0) ? [character, route] : [route.list[i - 1]]))
(i == 0) ? [character, route] : [route.list[i - 1]]
))
end
end
@@ -946,15 +947,15 @@ module Compiler
list.delete_at(i)
end
list.insert(i,
RPG::EventCommand.new(314, list[i].indent, [0]) # Recover All
)
RPG::EventCommand.new(314, list[i].indent, [0])) # Recover All
changed = true
when "pbFadeOutIn(99999){foriin$player.partyi.healend}"
oldIndent = list[i].indent
for j in i..lastScript
list.delete_at(i)
end
list.insert(i,
list.insert(
i,
RPG::EventCommand.new(223, oldIndent, [Tone.new(-255, -255, -255), 6]), # Fade to black
RPG::EventCommand.new(106, oldIndent, [6]), # Wait
RPG::EventCommand.new(314, oldIndent, [0]), # Recover All
@@ -1175,7 +1176,8 @@ module Compiler
fullTransfer = list[i]
indent = list[i].indent
(list.length - 1).times { list.delete_at(0) }
list.insert(0,
list.insert(
0,
RPG::EventCommand.new(250, indent, [RPG::AudioFile.new("Exit Door", 80, 100)]), # Play SE
RPG::EventCommand.new(223, indent, [Tone.new(-255, -255, -255), 6]), # Fade to black
RPG::EventCommand.new(106, indent, [8]), # Wait
@@ -1324,11 +1326,13 @@ module Compiler
end
if isempty
if elseIndex >= 0
list.insert(elseIndex + 1,
list.insert(
elseIndex + 1,
RPG::EventCommand.new(115, list[i].indent + 1, []) # Exit Event Processing
)
else
list.insert(i + 1,
list.insert(
i + 1,
RPG::EventCommand.new(0, list[i].indent + 1, []), # Empty Event
RPG::EventCommand.new(411, list[i].indent, []), # Else
RPG::EventCommand.new(115, list[i].indent + 1, []) # Exit Event Processing