Tidied up semicolon use, refactored random dungeon generation code, fixed visual bug in Day Care debug screen

This commit is contained in:
Maruno17
2021-08-22 23:18:34 +01:00
parent ecc5a040cd
commit 8bb70a226e
64 changed files with 1286 additions and 926 deletions
@@ -409,11 +409,15 @@ module PluginManager
#-----------------------------------------------------------------------------
def self.compare_versions(v1, v2)
d1 = v1.split("")
d1.insert(0, "0") if d1[0] == "." # Turn ".123" into "0.123"
while d1[-1] == "."; d1 = d1[0..-2]; end # Turn "123." into "123"
d1.insert(0, "0") if d1[0] == "." # Turn ".123" into "0.123"
while d1[-1] == "." # Turn "123." into "123"
d1 = d1[0..-2]
end
d2 = v2.split("")
d2.insert(0, "0") if d2[0] == "." # Turn ".123" into "0.123"
while d2[-1] == "."; d2 = d2[0..-2]; end # Turn "123." into "123"
d2.insert(0, "0") if d2[0] == "." # Turn ".123" into "0.123"
while d2[-1] == "." # Turn "123." into "123"
d2 = d2[0..-2]
end
for i in 0...[d1.size, d2.size].max # Compare each digit in turn
c1 = d1[i]
c2 = d2[i]
@@ -181,7 +181,7 @@ module SaveData
# new_game_value { Bar.new }
# end
# @param id [Symbol] value id
# @yieldself [Value]
# @yield the block of code to be saved as a Value
def self.register(id, &block)
validate id => Symbol
unless block_given?
@@ -152,7 +152,7 @@ module SaveData
# save_data[:new_value] = Foo.new
# end
# end
# @yield self [Conversion]
# @yield the block of code to be saved as a Conversion
def self.register_conversion(id, &block)
validate id => Symbol
unless block_given?
@@ -5,8 +5,8 @@ SaveData.register(:player) do
save_value { $Trainer }
load_value { |value| $Trainer = value }
new_game_value {
trainer_type = nil # Get the first defined trainer type as a placeholder
GameData::TrainerType.each { |t| trainer_type = t.id; break }
# Get the first defined trainer type as a placeholder
trainer_type = GameData::TrainerType.keys.first
Player.new("Unnamed", trainer_type)
}
from_old_format { |old_format| old_format[0] }
@@ -620,13 +620,15 @@ class Game_Character
def move_random_range(xrange=-1,yrange=-1)
dirs = [] # 0=down, 1=left, 2=right, 3=up
if xrange<0
dirs.push(1); dirs.push(2)
dirs.push(1)
dirs.push(2)
elsif xrange>0
dirs.push(1) if @x > @original_x - xrange
dirs.push(2) if @x < @original_x + xrange
end
if yrange<0
dirs.push(0); dirs.push(3)
dirs.push(0)
dirs.push(3)
elsif yrange>0
dirs.push(0) if @y < @original_y + yrange
dirs.push(3) if @y > @original_y - yrange
@@ -400,10 +400,13 @@ end
def pbUpdateVehicle
meta = GameData::Metadata.get_player($Trainer.character_ID)
if meta
charset = 1 # Regular graphic
if $PokemonGlobal.diving; charset = 5 # Diving graphic
elsif $PokemonGlobal.surfing; charset = 3 # Surfing graphic
elsif $PokemonGlobal.bicycle; charset = 2 # Bicycle graphic
charset = 1 # Regular graphic
if $PokemonGlobal.diving
charset = 5 # Diving graphic
elsif $PokemonGlobal.surfing
charset = 3 # Surfing graphic
elsif $PokemonGlobal.bicycle
charset = 2 # Bicycle graphic
end
newCharName = pbGetPlayerCharset(meta,charset)
$game_player.character_name = newCharName if newCharName
+20 -9
View File
@@ -38,10 +38,14 @@ end
def getCubicPoint2(src,t)
x0 = src[0]; y0 = src[1]
cx0 = src[2]; cy0 = src[3]
cx1 = src[4]; cy1 = src[5]
x1 = src[6]; y1 = src[7]
x0 = src[0]
y0 = src[1]
cx0 = src[2]
cy0 = src[3]
cx1 = src[4]
cy1 = src[5]
x1 = src[6]
y1 = src[7]
x1 = cx1+(x1-cx1)*t
x0 = x0+(cx0-x0)*t
@@ -117,9 +121,12 @@ class PictureEx
end
def callback(cb)
if cb.is_a?(Proc); cb.call(self)
elsif cb.is_a?(Array); cb[0].method(cb[1]).call(self)
elsif cb.is_a?(Method); cb.call(self)
if cb.is_a?(Proc)
cb.call(self)
elsif cb.is_a?(Array)
cb[0].method(cb[1]).call(self)
elsif cb.is_a?(Method)
cb.call(self)
end
end
@@ -163,7 +170,9 @@ class PictureEx
# the angle another way too.
def rotate(speed)
@rotate_speed = speed*20.0/Graphics.frame_rate
while @rotate_speed<0; @rotate_speed += 360; end
while @rotate_speed<0
@rotate_speed += 360
end
@rotate_speed %= 360
end
@@ -440,7 +449,9 @@ class PictureEx
if @rotate_speed != 0
@frameUpdates.push(Processes::Angle) if !@frameUpdates.include?(Processes::Angle)
@angle += @rotate_speed
while @angle<0; @angle += 360; end
while @angle<0
@angle += 360
end
@angle %= 360
end
end
@@ -233,7 +233,8 @@ class CustomTilemap
return if disposed?
@help.dispose if @help
@help = nil
i = 0; len = @autotileInfo.length
i = 0
len = @autotileInfo.length
while i<len
if @autotileInfo[i]
@autotileInfo[i].dispose
@@ -241,7 +242,8 @@ class CustomTilemap
end
i += 1
end
i = 0; len = @regularTileInfo.length
i = 0
len = @regularTileInfo.length
while i<len
if @regularTileInfo[i]
@regularTileInfo[i].dispose
@@ -249,13 +251,15 @@ class CustomTilemap
end
i += 1
end
i = 0; len = @tiles.length
i = 0
len = @tiles.length
while i<len
@tiles[i].dispose
@tiles[i] = nil
i += 2
end
i = 0; len = @autosprites.length
i = 0
len = @autosprites.length
while i<len
@autosprites[i].dispose
@autosprites[i] = nil
@@ -288,7 +288,7 @@ def isDarkBackground(background,rect=nil)
yStart = (ySeg==0) ? rect.y+(rect.height/2) : rect.y+ySeg/2
count = 0
y = yStart
r = 0; g = 0; b = 0
r = g = b = 0
yLoop.times do
x = xStart
xLoop.times do
@@ -335,8 +335,10 @@ class Window
return if !srcbitmap || srcbitmap.disposed?
left=dstrect.x
top=dstrect.y
y=0;loop do break unless y<dstrect.height
x=0;loop do break unless x<dstrect.width
y = 0
loop do break unless y < dstrect.height
x = 0
loop do break unless x < dstrect.width
dstbitmap.blt(x+left,y+top,srcbitmap,srcrect)
x+=srcrect.width
end
@@ -432,10 +434,10 @@ class Window
backRect=Rect.new(0,0,128,128)
blindsRect=nil
end
@sprites["corner0"].src_rect.set(trimX,trimY+0,16,16);
@sprites["corner1"].src_rect.set(trimX+48,trimY+0,16,16);
@sprites["corner2"].src_rect.set(trimX,trimY+48,16,16);
@sprites["corner3"].src_rect.set(trimX+48,trimY+48,16,16);
@sprites["corner0"].src_rect.set(trimX,trimY+0,16,16)
@sprites["corner1"].src_rect.set(trimX+48,trimY+0,16,16)
@sprites["corner2"].src_rect.set(trimX,trimY+48,16,16)
@sprites["corner3"].src_rect.set(trimX+48,trimY+48,16,16)
@sprites["scroll0"].src_rect.set(trimX+24, trimY+16, 16, 8) # up
@sprites["scroll3"].src_rect.set(trimX+24, trimY+40, 16, 8) # down
@sprites["scroll1"].src_rect.set(trimX+16, trimY+24, 8, 16) # left
@@ -455,8 +455,10 @@ class SpriteWindow < Window
return if !srcbitmap || srcbitmap.disposed?
left=dstrect.x
top=dstrect.y
y=0;loop do break unless y<dstrect.height
x=0;loop do break unless x<dstrect.width
y = 0
loop do break unless y < dstrect.height
x = 0
loop do break unless x < dstrect.width
dstbitmap.blt(x+left,y+top,srcbitmap,srcrect)
x+=srcrect.width
end
@@ -567,10 +569,10 @@ class SpriteWindow < Window
blindsRect=nil
end
if @_windowskin && !@_windowskin.disposed?
@sprites["corner0"].src_rect.set(trimX,trimY+0,16,16);
@sprites["corner1"].src_rect.set(trimX+48,trimY+0,16,16);
@sprites["corner2"].src_rect.set(trimX,trimY+48,16,16);
@sprites["corner3"].src_rect.set(trimX+48,trimY+48,16,16);
@sprites["corner0"].src_rect.set(trimX,trimY+0,16,16)
@sprites["corner1"].src_rect.set(trimX+48,trimY+0,16,16)
@sprites["corner2"].src_rect.set(trimX,trimY+48,16,16)
@sprites["corner3"].src_rect.set(trimX+48,trimY+48,16,16)
@sprites["scroll0"].src_rect.set(trimX+24, trimY+16, 16, 8) # up
@sprites["scroll3"].src_rect.set(trimX+24, trimY+40, 16, 8) # down
@sprites["scroll1"].src_rect.set(trimX+16, trimY+24, 8, 16) # left
@@ -613,12 +615,12 @@ class SpriteWindow < Window
endX=(!@_windowskin || @_windowskin.disposed?) ? @skinrect.x : @_windowskin.width-cx
# height of bottom end of window
endY=(!@_windowskin || @_windowskin.disposed?) ? @skinrect.y : @_windowskin.height-cy
@sprites["corner0"].src_rect.set(0,0,startX,startY);
@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);
@sprites["corner0"].src_rect.set(0,0,startX,startY)
@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);
@skinrect.width,@skinrect.height)
blindsRect=nil
sideRects=[
Rect.new(startX,0,@skinrect.width,startY), # side0 (top)
@@ -346,14 +346,14 @@ class ChangelingSprite < SpriteWrapper
def dispose
return if disposed?
for bm in @bitmaps.values; bm.dispose; end
@bitmaps.values.each { |bm| bm.dispose }
@bitmaps.clear
super
end
def update
return if disposed?
for bm in @bitmaps.values; bm.update; end
@bitmaps.values.each { |bm| bm.update }
self.bitmap = (@currentBitmap) ? @currentBitmap.bitmap : nil
end
end
@@ -46,13 +46,13 @@ class LargePlane < Plane
def ox; @__ox; end
def oy; @__oy; end
def ox=(value);
def ox=(value)
return if @__ox==value
@__ox = value
refresh
end
def oy=(value);
def oy=(value)
return if @__oy==value
@__oy = value
refresh
@@ -89,13 +89,13 @@ class LargePlane < Plane
def color; @__sprite.color; end
def tone; @__sprite.tone; end
def zoom_x=(v);
def zoom_x=(v)
return if @__sprite.zoom_x==v
@__sprite.zoom_x = v
refresh
end
def zoom_y=(v);
def zoom_y=(v)
return if @__sprite.zoom_y==v
@__sprite.zoom_y = v
refresh
@@ -107,7 +107,7 @@ class LargePlane < Plane
def z=(v); @__sprite.z=(v); end
def color=(v); @__sprite.color=(v); end
def tone=(v); @__sprite.tone=(v); end
def update; ;end
def update; end
def refresh
@__sprite.visible = (@__visible && !@__bitmap.nil?)
@@ -93,7 +93,9 @@ end
def getContrastColor(color)
raise "No color given" if !color
r=color.red; g=color.green; b=color.blue
r=color.red
g=color.green
b=color.blue
yuv=[
r * 0.299 + g * 0.587 + b * 0.114,
r * -0.1687 + g * -0.3313 + b * 0.500 + 0.5,
@@ -593,7 +595,8 @@ def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight=32,
elsif control=="r" # Right align this line
if !endtag
x=0
rightalign=1; lastword=[characters.length,x]
rightalign=1
lastword=[characters.length,x]
end
end
controls[i]=nil
@@ -719,13 +722,15 @@ def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight=32,
leftSearch = 0
rightSearch = 0
# Search left for a space
i = half; while i>=0
i = half
while i>=0
break if realtext[i,1][/\s/]||isWaitChar(realtext[i,1]) # found a space
leftSearch += 1
i -= 1
end
# Search right for a space
i = half; while i<realtext.length
i = half
while i<realtext.length
break if realtext[i,1][/\s/]||isWaitChar(realtext[i,1]) # found a space
rightSearch += 1
i += 1
+8 -6
View File
@@ -68,7 +68,7 @@ def pbBGMPlay(param,volume=nil,pitch=nil)
end
# Fades out or stops BGM playback. 'x' is the time in seconds to fade out.
def pbBGMFade(x=0.0); pbBGMStop(x);end
def pbBGMFade(x=0.0); pbBGMStop(x); end
# Fades out or stops BGM playback. 'x' is the time in seconds to fade out.
def pbBGMStop(timeInSeconds=0.0)
@@ -109,7 +109,8 @@ def pbMEPlay(param,volume=nil,pitch=nil)
elsif (RPG.const_defined?(:ME) rescue false)
b=RPG::ME.new(param.name,param.volume,param.pitch)
if b && b.respond_to?("play")
b.play; return
b.play
return
end
end
Audio.me_play(canonicalize("Audio/ME/"+param.name),param.volume,param.pitch)
@@ -117,7 +118,7 @@ def pbMEPlay(param,volume=nil,pitch=nil)
end
# Fades out or stops ME playback. 'x' is the time in seconds to fade out.
def pbMEFade(x=0.0); pbMEStop(x);end
def pbMEFade(x=0.0); pbMEStop(x); end
# Fades out or stops ME playback. 'x' is the time in seconds to fade out.
def pbMEStop(timeInSeconds=0.0)
@@ -158,7 +159,8 @@ def pbBGSPlay(param,volume=nil,pitch=nil)
elsif (RPG.const_defined?(:BGS) rescue false)
b=RPG::BGS.new(param.name,param.volume,param.pitch)
if b && b.respond_to?("play")
b.play; return
b.play
return
end
end
Audio.bgs_play(canonicalize("Audio/BGS/"+param.name),param.volume,param.pitch)
@@ -166,7 +168,7 @@ def pbBGSPlay(param,volume=nil,pitch=nil)
end
# Fades out or stops BGS playback. 'x' is the time in seconds to fade out.
def pbBGSFade(x=0.0); pbBGSStop(x);end
def pbBGSFade(x=0.0); pbBGSStop(x); end
# Fades out or stops BGS playback. 'x' is the time in seconds to fade out.
def pbBGSStop(timeInSeconds=0.0)
@@ -217,7 +219,7 @@ def pbSEPlay(param,volume=nil,pitch=nil)
end
# Stops SE playback.
def pbSEFade(x=0.0); pbSEStop(x);end
def pbSEFade(x=0.0); pbSEStop(x); end
# Stops SE playback.
def pbSEStop(_timeInSeconds=0.0)
@@ -100,7 +100,8 @@ class PokeBattle_Battler
return false
end
# Ability immunity
immuneByAbility = false; immAlly = nil
immuneByAbility = false
immAlly = nil
if BattleHandlers.triggerStatusImmunityAbilityNonIgnorable(self.ability,self,newStatus)
immuneByAbility = true
elsif selfInflicted || !@battle.moldBreaker
@@ -10,7 +10,8 @@ class PokeBattle_Battler
# Snatch
move.snatched = false
if move.statusMove? && move.canSnatch?
newUser = nil; strength = 100
newUser = nil
strength = 100
@battle.eachBattler do |b|
next if b.effects[PBEffects::Snatch]==0 ||
b.effects[PBEffects::Snatch]>=strength
@@ -101,7 +102,8 @@ class PokeBattle_Battler
priority = @battle.pbPriority(true)
nearOnly = !target_data.can_choose_distant_target?
# Spotlight (takes priority over Follow Me/Rage Powder/Lightning Rod/Storm Drain)
newTarget = nil; strength = 100 # Lower strength takes priority
newTarget = nil
strength = 100 # Lower strength takes priority
priority.each do |b|
next if b.fainted? || b.effects[PBEffects::SkyDrop]>=0
next if b.effects[PBEffects::Spotlight]==0 ||
@@ -118,7 +120,8 @@ class PokeBattle_Battler
return targets
end
# Follow Me/Rage Powder (takes priority over Lightning Rod/Storm Drain)
newTarget = nil; strength = 100 # Lower strength takes priority
newTarget = nil
strength = 100 # Lower strength takes priority
priority.each do |b|
next if b.fainted? || b.effects[PBEffects::SkyDrop]>=0
next if b.effects[PBEffects::RagePowder] && !user.affectedByPowder?
@@ -506,7 +506,8 @@ class PokeBattle_Battler
user.effects[PBEffects::LockOnPos]==target.index
# Toxic
return true if move.pbOverrideSuccessCheckPerHit(user,target)
miss = false; hitsInvul = false
miss = false
hitsInvul = false
# No Guard
hitsInvul = true if user.hasActiveAbility?(:NOGUARD) ||
target.hasActiveAbility?(:NOGUARD)
@@ -493,8 +493,10 @@ def pbBattleConfusionBerry(battler,battle,item,forced,flavor,confuseMsg)
return false if !forced && !battler.canConsumePinchBerry?(Settings::MECHANICS_GENERATION >= 7)
itemName = GameData::Item.get(item).name
fraction_to_heal = 8 # Gens 6 and lower
if Settings::MECHANICS_GENERATION == 7; fraction_to_heal = 2
elsif Settings::MECHANICS_GENERATION >= 8; fraction_to_heal = 3
if Settings::MECHANICS_GENERATION == 7
fraction_to_heal = 2
elsif Settings::MECHANICS_GENERATION >= 8
fraction_to_heal = 3
end
amt = battler.totalhp / fraction_to_heal
ripening = false
@@ -240,8 +240,10 @@ class PokeBattle_Move
oldHP = b.hp+b.damageState.hpLost
PBDebug.log("[Move damage] #{b.pbThis} lost #{b.damageState.hpLost} HP (#{oldHP}=>#{b.hp})")
effectiveness = 0
if Effectiveness.resistant?(b.damageState.typeMod); effectiveness = 1
elsif Effectiveness.super_effective?(b.damageState.typeMod); effectiveness = 2
if Effectiveness.resistant?(b.damageState.typeMod)
effectiveness = 1
elsif Effectiveness.super_effective?(b.damageState.typeMod)
effectiveness = 2
end
animArray.push([b,oldHP,effectiveness])
end
@@ -492,8 +492,10 @@ class PokeBattle_TwoTurnMove < PokeBattle_Move
end
def pbEffectAgainstTarget(user,target)
if @damagingTurn; pbAttackingTurnEffect(user,target)
elsif @chargingTurn; pbChargingTurnEffect(user,target)
if @damagingTurn
pbAttackingTurnEffect(user,target)
elsif @chargingTurn
pbChargingTurnEffect(user,target)
end
end
@@ -652,14 +654,20 @@ end
#===============================================================================
class PokeBattle_PledgeMove < PokeBattle_Move
def pbOnStartUse(user,targets)
@pledgeSetup = false; @pledgeCombo = false; @pledgeOtherUser = nil
@comboEffect = nil; @overrideType = nil; @overrideAnim = nil
@pledgeSetup = false
@pledgeCombo = false
@pledgeOtherUser = nil
@comboEffect = nil
@overrideType = nil
@overrideAnim = nil
# Check whether this is the use of a combo move
@combos.each do |i|
next if i[0]!=user.effects[PBEffects::FirstPledge]
@battle.pbDisplay(_INTL("The two moves have become one! It's a combined move!"))
@pledgeCombo = true
@comboEffect = i[1]; @overrideType = i[2]; @overrideAnim = i[3]
@comboEffect = i[1]
@overrideType = i[2]
@overrideAnim = i[3]
@overrideType = nil if !GameData::Type.exists?(@overrideType)
break
end
@@ -706,7 +714,8 @@ class PokeBattle_PledgeMove < PokeBattle_Move
def pbEffectAfterAllHits(user,target)
return if !@pledgeCombo
msg = nil; animName = nil
msg = nil
animName = nil
case @comboEffect
when :SeaOfFire # Grass + Fire
if user.pbOpposingSide.effects[PBEffects::SeaOfFire]==0
@@ -927,12 +927,14 @@ class PokeBattle_Move_035 < PokeBattle_Move
failed = true
for i in 0...@statUp.length/2
if user.pbCanRaiseStatStage?(@statUp[i*2],user,self)
failed = false; break
failed = false
break
end
end
for i in 0...@statDown.length/2
if user.pbCanLowerStatStage?(@statDown[i*2],user,self)
failed = false; break
failed = false
break
end
end
if failed
@@ -1686,11 +1688,15 @@ end
class PokeBattle_Move_05A < PokeBattle_Move
def pbEffectAgainstTarget(user,target)
newHP = (user.hp+target.hp)/2
if user.hp>newHP; user.pbReduceHP(user.hp-newHP,false,false)
elsif user.hp<newHP; user.pbRecoverHP(newHP-user.hp,false)
if user.hp>newHP
user.pbReduceHP(user.hp-newHP,false,false)
elsif user.hp<newHP
user.pbRecoverHP(newHP-user.hp,false)
end
if target.hp>newHP; target.pbReduceHP(target.hp-newHP,false,false)
elsif target.hp<newHP; target.pbRecoverHP(newHP-target.hp,false)
if target.hp>newHP
target.pbReduceHP(target.hp-newHP,false,false)
elsif target.hp<newHP
target.pbRecoverHP(newHP-target.hp,false)
end
@battle.pbDisplay(_INTL("The battlers shared their pain!"))
user.pbItemHPHealCheck
@@ -260,7 +260,8 @@ def pbHiddenPower(pkmn)
# NOTE: This allows Hidden Power to be Fairy-type (if you have that type in
# your game). I don't care that the official games don't work like that.
iv = pkmn.iv
idxType = 0; power = 60
idxType = 0
power = 60
types = []
GameData::Type.each do |t|
types[t.icon_position] ||= []
@@ -355,9 +356,12 @@ class PokeBattle_Move_094 < PokeBattle_Move
def pbOnStartUse(user,targets)
@presentDmg = 0 # 0 = heal, >0 = damage
r = @battle.pbRandom(100)
if r<40; @presentDmg = 40
elsif r<70; @presentDmg = 80
elsif r<80; @presentDmg = 120
if r<40
@presentDmg = 40
elsif r<70
@presentDmg = 80
elsif r<80
@presentDmg = 120
end
end
@@ -549,11 +553,16 @@ class PokeBattle_Move_098 < PokeBattle_Move
def pbBaseDamage(baseDmg,user,target)
ret = 20
n = 48*user.hp/user.totalhp
if n<2; ret = 200
elsif n<5; ret = 150
elsif n<10; ret = 100
elsif n<17; ret = 80
elsif n<33; ret = 40
if n<2
ret = 200
elsif n<5
ret = 150
elsif n<10
ret = 100
elsif n<17
ret = 80
elsif n<33
ret = 40
end
return ret
end
@@ -568,10 +577,14 @@ class PokeBattle_Move_099 < PokeBattle_Move
def pbBaseDamage(baseDmg,user,target)
ret = 40
n = user.pbSpeed/target.pbSpeed
if n>=4; ret = 150
elsif n>=3; ret = 120
elsif n>=2; ret = 80
elsif n>=1; ret = 60
if n>=4
ret = 150
elsif n>=3
ret = 120
elsif n>=2
ret = 80
elsif n>=1
ret = 60
end
return ret
end
@@ -586,11 +599,16 @@ class PokeBattle_Move_09A < PokeBattle_Move
def pbBaseDamage(baseDmg,user,target)
ret = 20
weight = target.pbWeight
if weight>=2000; ret = 120
elsif weight>=1000; ret = 100
elsif weight>=500; ret = 80
elsif weight>=250; ret = 60
elsif weight>=100; ret = 40
if weight>=2000
ret = 120
elsif weight>=1000
ret = 100
elsif weight>=500
ret = 80
elsif weight>=250
ret = 60
elsif weight>=100
ret = 40
end
return ret
end
@@ -611,10 +629,14 @@ class PokeBattle_Move_09B < PokeBattle_Move
def pbBaseDamage(baseDmg,user,target)
ret = 40
n = (user.pbWeight/target.pbWeight).floor
if n>=5; ret = 120
elsif n>=4; ret = 100
elsif n>=3; ret = 80
elsif n>=2; ret = 60
if n>=5
ret = 120
elsif n>=4
ret = 100
elsif n>=3
ret = 80
elsif n>=2
ret = 60
end
return ret
end
@@ -3324,8 +3346,10 @@ class PokeBattle_Move_0F2 < PokeBattle_Move
end
def pbEffectAgainstTarget(user,target)
oldUserItem = user.item; oldUserItemName = user.itemName
oldTargetItem = target.item; oldTargetItemName = target.itemName
oldUserItem = user.item
oldUserItemName = user.itemName
oldTargetItem = target.item
oldTargetItemName = target.itemName
user.item = oldTargetItem
user.effects[PBEffects::ChoiceBand] = nil if user.ability_id != :GORILLATACTICS
user.effects[PBEffects::Unburden] = (!user.item && oldUserItem)
@@ -1017,7 +1017,9 @@ end
#===============================================================================
class PokeBattle_Move_125 < PokeBattle_Move
def pbFailsAgainstTarget?(user,target)
hasThisMove = false; hasOtherMoves = false; hasUnusedMoves = false
hasThisMove = false
hasOtherMoves = false
hasUnusedMoves = false
user.eachMove do |m|
hasThisMove = true if m.id==@id
hasOtherMoves = true if m.id!=@id
@@ -195,11 +195,16 @@ module PokeBattle_BattleCommon
if Settings::ENABLE_CRITICAL_CAPTURES
dex_modifier = 0
numOwned = $Trainer.pokedex.owned_count
if numOwned>600; dex_modifier = 5
elsif numOwned>450; dex_modifier = 4
elsif numOwned>300; dex_modifier = 3
elsif numOwned>150; dex_modifier = 2
elsif numOwned>30; dex_modifier = 1
if numOwned>600
dex_modifier = 5
elsif numOwned>450
dex_modifier = 4
elsif numOwned>300
dex_modifier = 3
elsif numOwned>150
dex_modifier = 2
elsif numOwned>30
dex_modifier = 1
end
dex_modifier *= 2 if $PokemonBag.pbHasItem?(:CATCHINGCHARM)
c = x * dex_modifier / 12
@@ -531,9 +531,12 @@ class PokeBattle_Battle
def pbJudge
fainted1 = pbAllFainted?(0)
fainted2 = pbAllFainted?(1)
if fainted1 && fainted2; @decision = pbDecisionOnDraw # Draw
elsif fainted1; @decision = 2 # Loss
elsif fainted2; @decision = 1 # Win
if fainted1 && fainted2
@decision = pbDecisionOnDraw # Draw
elsif fainted1
@decision = 2 # Loss
elsif fainted2
@decision = 1 # Win
end
end
end
@@ -2003,7 +2003,9 @@ BattleHandlers::EORGainItemAbility.add(:HARVEST,
BattleHandlers::EORGainItemAbility.add(:PICKUP,
proc { |ability,battler,battle|
next if battler.item
foundItem = nil; fromBattler = nil; use = 0
foundItem = nil
fromBattler = nil
use = 0
battle.eachBattler do |b|
next if b.index==battler.index
next if b.effects[PBEffects::PickupUse]<=use
@@ -193,10 +193,14 @@ class PokeBattle_AI
# Pick a good move for the Choice items
if user.hasActiveItem?([:CHOICEBAND,:CHOICESPECS,:CHOICESCARF]) ||
user.hasActiveAbility?(:GORILLATACTICS)
if move.baseDamage>=60; score += 60
elsif move.damagingMove?; score += 30
elsif move.function=="0F2"; score += 70 # Trick
else; score -= 60
if move.baseDamage>=60
score += 60
elsif move.damagingMove?
score += 30
elsif move.function=="0F2"
score += 70 # Trick
else
score -= 60
end
end
# If user is asleep, prefer moves that are usable while asleep
@@ -166,11 +166,14 @@ class PokeBattle_AI
agender = user.gender
ogender = target.gender
if agender==2 || ogender==2 || agender==ogender
score -= 90; canattract = false
score -= 90
canattract = false
elsif target.effects[PBEffects::Attract]>=0
score -= 80; canattract = false
score -= 80
canattract = false
elsif skill>=PBTrainerAI.bestSkill && target.hasActiveAbility?(:OBLIVIOUS)
score -= 80; canattract = false
score -= 80
canattract = false
end
if skill>=PBTrainerAI.highSkill
if canattract && target.hasActiveItem?(:DESTINYKNOT) &&
@@ -727,7 +730,8 @@ class PokeBattle_AI
end
#---------------------------------------------------------------------------
when "037"
avgStat = 0; canChangeStat = false
avgStat = 0
canChangeStat = false
GameData::Stat.each_battle do |s|
next if target.statStageAtMax?(s.id)
avgStat -= target.stages[s.id]
@@ -1116,7 +1120,8 @@ class PokeBattle_AI
if target.effects[PBEffects::Substitute]>0
score -= 90
else
avg = 0; anyChange = false
avg = 0
anyChange = false
GameData::Stat.each_battle do |s|
next if target.stages[s.id]==0
avg += target.stages[s.id]
@@ -1178,7 +1183,8 @@ class PokeBattle_AI
#---------------------------------------------------------------------------
when "054"
if skill>=PBTrainerAI.mediumSkill
userStages = 0; targetStages = 0
userStages = 0
targetStages = 0
GameData::Stat.each_battle do |s|
userStages += user.stages[s.id]
targetStages += target.stages[s.id]
@@ -2675,7 +2681,8 @@ class PokeBattle_AI
if target.effects[PBEffects::Substitute]>0
score -= 90
else
numpos = 0; numneg = 0
numpos = 0
numneg = 0
GameData::Stat.each_battle do |s|
numpos += target.stages[s.id] if target.stages[s.id] > 0
numneg += target.stages[s.id] if target.stages[s.id] < 0
@@ -106,9 +106,12 @@ BallHandlers::ModifyCatchRate.add(:LEVELBALL,proc { |ball,catchRate,battle,battl
battle.eachSameSideBattler do |b|
maxlevel = b.level if b.level>maxlevel
end
if maxlevel>=battler.level*4; catchRate *= 8
elsif maxlevel>=battler.level*2; catchRate *= 4
elsif maxlevel>battler.level; catchRate *= 2
if maxlevel >= battler.level * 4
catchRate *= 8
elsif maxlevel >= battler.level * 2
catchRate *= 4
elsif maxlevel > battler.level
catchRate *= 2
end
next [catchRate,255].min
})
@@ -123,15 +126,22 @@ BallHandlers::ModifyCatchRate.add(:HEAVYBALL,proc { |ball,catchRate,battle,battl
next 0 if catchRate==0
weight = battler.pokemon.species_data.base_stats[:SPEED]
if Settings::NEW_POKE_BALL_CATCH_RATES
if weight>=3000; catchRate += 30
elsif weight>=2000; catchRate += 20
elsif weight<1000; catchRate -= 20
if weight >= 3000
catchRate += 30
elsif weight >= 2000
catchRate += 20
elsif weight < 1000
catchRate -= 20
end
else
if weight>=4096; catchRate += 40
elsif weight>=3072; catchRate += 30
elsif weight>=2048; catchRate += 20
else; catchRate -= 20
if weight >= 4096
catchRate += 40
elsif weight >= 3072
catchRate += 30
elsif weight >= 2048
catchRate += 20
else
catchRate -= 20
end
end
catchRate = [catchRate,1].max
@@ -37,7 +37,9 @@ class PokeBattle_Scene
# animations (including cry)
@animations.push(BattleIntroAnimation2.new(@sprites,@viewport,@battle.sideSizes[1]))
# Play all the animations
while inPartyAnimation?; pbUpdate; end
while inPartyAnimation?
pbUpdate
end
# Show shiny animation for wild Pokémon
if @battle.showAnims
for i in 0...@battle.sideSizes[1]
@@ -59,7 +61,9 @@ class PokeBattle_Scene
@animations.push(LineupAppearAnimation.new(@sprites,@viewport,
side,@battle.pbParty(side),@battle.pbPartyStarts(side),fullAnim))
if !fullAnim
while inPartyAnimation?; pbUpdate; end
while inPartyAnimation?
pbUpdate
end
end
end
@@ -73,7 +77,9 @@ class PokeBattle_Scene
appearAnim = TrainerAppearAnimation.new(@sprites,@viewport,idxTrainer)
@animations.push(appearAnim)
# Play the animation
while inPartyAnimation?; pbUpdate; end
while inPartyAnimation?
pbUpdate
end
end
#=============================================================================
@@ -86,7 +92,9 @@ class PokeBattle_Scene
return if sendOuts.length==0
# If party balls are still appearing, wait for them to finish showing up, as
# the FadeAnimation will make them disappear.
while inPartyAnimation?; pbUpdate; end
while inPartyAnimation?
pbUpdate
end
@briefMessage = false
# Make all trainers and party lineups disappear (player-side trainers may
# animate throwing a Poké Ball)
@@ -130,7 +138,10 @@ class PokeBattle_Scene
end
end
fadeAnim.dispose
sendOutAnims.each { |a| a[0].dispose; a[1].dispose }
sendOutAnims.each do |a|
a[0].dispose
a[1].dispose
end
# Play shininess animations for shiny Pokémon
sendOuts.each do |b|
next if !@battle.showAnims || !@battle.battlers[b[0]].shiny?
@@ -274,7 +285,9 @@ class PokeBattle_Scene
expRange = endExp-startExp
dataBox = @sprites["dataBox_#{battler.index}"]
dataBox.animateExp(startExpLevel,endExpLevel,expRange)
while dataBox.animatingExp; pbUpdate; end
while dataBox.animatingExp
pbUpdate
end
end
#=============================================================================
@@ -440,7 +440,7 @@ class PBAnimation < Array
@position = 4 # 1=target, 2=user, 3=user and target, 4=screen
@array = []
size = 1 if size<1 # Always create at least one frame
size.times do; addFrame; end
size.times { addFrame }
@timing = []
@scope = 0
end
@@ -20,10 +20,14 @@ class PokeBattle_SuccessState
if @useState==1
@skill = -2 if !@protected
elsif @useState==2
if Effectiveness.super_effective?(@typeMod); @skill = 2
elsif Effectiveness.normal?(@typeMod); @skill = 1
elsif Effectiveness.not_very_effective?(@typeMod); @skill = -1
else; @skill = -2 # Ineffective
if Effectiveness.super_effective?(@typeMod)
@skill = 2
elsif Effectiveness.normal?(@typeMod)
@skill = 1
elsif Effectiveness.not_very_effective?(@typeMod)
@skill = -1
else # Ineffective
@skill = -2
end
end
clear(false)
@@ -41,8 +41,10 @@ class PokeBattle_Battle
if @rules["suddendeath"] && @decision==0
p1able = pbAbleCount(0)
p2able = pbAbleCount(1)
if p1able>p2able; @decision = 1 # loss
elsif p1able<p2able; @decision = 2 # win
if p1able>p2able
@decision = 1 # loss
elsif p1able<p2able
@decision = 2 # win
end
end
end
@@ -157,9 +157,12 @@ def pbPrepareBattle(battle)
battle.time = 2 # This makes Dusk Balls work properly in caves
elsif Settings::TIME_SHADING
timeNow = pbGetTimeNow
if PBDayNight.isNight?(timeNow); battle.time = 2
elsif PBDayNight.isEvening?(timeNow); battle.time = 1
else; battle.time = 0
if PBDayNight.isNight?(timeNow)
battle.time = 2
elsif PBDayNight.isEvening?(timeNow)
battle.time = 1
else
battle.time = 0
end
end
end
@@ -79,8 +79,10 @@ def pbBattleAnimation(bgm=nil,battletype=0,foe=nil)
2.times do
viewport.color.alpha = 0
for i in 0...halfFlashTime*2
if i<halfFlashTime; viewport.color.alpha += alphaDiff
else; viewport.color.alpha -= alphaDiff
if i<halfFlashTime
viewport.color.alpha += alphaDiff
else
viewport.color.alpha -= alphaDiff
end
Graphics.update
pbUpdateSceneMap
@@ -541,10 +541,13 @@ def pbHeadbuttEffect(event=nil)
a = (event.x+(event.x/24).floor+1)*(event.y+(event.y/24).floor+1)
a = (a*2/5)%10 # Even 2x as likely as odd, 0 is 1.5x as likely as odd
b = $Trainer.public_ID % 10 # Practically equal odds of each value
chance = 1 # ~50%
if a==b; chance = 8 # 10%
elsif a>b && (a-b).abs<5; chance = 5 # ~30.3%
elsif a<b && (a-b).abs>5; chance = 5 # ~9.7%
chance = 1 # ~50%
if a==b # 10%
chance = 8
elsif a>b && (a-b).abs<5 # ~30.3%
chance = 5
elsif a<b && (a-b).abs>5 # ~9.7%
chance = 5
end
if rand(10)>=chance
pbMessage(_INTL("Nope. Nothing..."))
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -185,7 +185,8 @@ ItemHandlers::UseInField.add(:SACREDASH,proc { |item|
canrevive = false
for i in $Trainer.pokemon_party
next if !i.fainted?
canrevive = true; break
canrevive = true
break
end
if !canrevive
pbMessage(_INTL("It won't have any effect."))
@@ -434,11 +434,10 @@ MultipleForms.register(:AEGISLASH,{
MultipleForms.register(:PUMPKABOO,{
"getFormOnCreation" => proc { |pkmn|
r = rand(100)
if r<5; next 3 # Super Size (5%)
elsif r<20; next 2 # Large (15%)
elsif r<65; next 1 # Average (45%)
end
next 0 # Small (35%)
next 3 if r < 5 # Super Size (5%)
next 2 if r < 20 # Large (15%)
next 1 if r < 65 # Average (45%)
next 0 # Small (35%)
}
})
@@ -171,9 +171,11 @@ class PokemonIconSprite < SpriteWrapper
return 0 if @pokemon.fainted? # Fainted - no animation
# ret is initially the time a whole animation cycle lasts. It is divided by
# the number of frames in that cycle at the end.
ret = Graphics.frame_rate/4 # Green HP - 0.25 seconds
if @pokemon.hp<=@pokemon.totalhp/4; ret *= 4 # Red HP - 1 second
elsif @pokemon.hp<=@pokemon.totalhp/2; ret *= 2 # Yellow HP - 0.5 seconds
ret = Graphics.frame_rate/4 # Green HP - 0.25 seconds
if @pokemon.hp<=@pokemon.totalhp/4 # Red HP - 1 second
ret *= 4
elsif @pokemon.hp<=@pokemon.totalhp/2 # Yellow HP - 0.5 seconds
ret *= 2
end
ret /= @numFrames
ret = 1 if ret<1
@@ -108,7 +108,8 @@ class PokemonStorage
@unlockedWallpapers = [] if !@unlockedWallpapers
for i in 0...papers.length
next if !isAvailableWallpaper?(i)
ret[0].push(papers[i]); ret[1].push(i)
ret[0].push(papers[i])
ret[1].push(i)
end
return ret
end
+1 -1
View File
@@ -1110,7 +1110,7 @@ class Pokemon
# @param level [Integer] Pokémon level
# @param owner [Owner, Player, NPCTrainer] Pokémon owner (the player by default)
# @param withMoves [TrueClass, FalseClass] whether the Pokémon should have moves
# @param rechech_form [TrueClass, FalseClass] whether to auto-check the form
# @param recheck_form [TrueClass, FalseClass] whether to auto-check the form
def initialize(species, level, owner = $Trainer, withMoves = true, recheck_form = true)
species_data = GameData::Species.get(species)
@species = species_data.species
@@ -73,8 +73,10 @@ class Pokemon
def makeUnprimal
v = MultipleForms.call("getUnprimalForm", self)
if !v.nil?; self.form = v
elsif primal?; self.form = 0
if !v.nil?
self.form = v
elsif primal?
self.form = 0
end
end
end
@@ -73,7 +73,7 @@ class Player < Trainer
# Returns whether there are any seen Pokémon.
# If a region is given, returns whether there are seen Pokémon
# in that region.
# @param region [Integer] region ID
# @param dex [Integer] region ID
# @return [Boolean] whether there are any seen Pokémon
def seen_any?(dex = -1)
validate dex => Integer
@@ -153,7 +153,7 @@ class Player < Trainer
# Returns the amount of owned Pokémon.
# If a region ID is given, returns the amount of owned Pokémon
# in that region.
# @param region [Integer] region ID
# @param dex [Integer] region ID
def owned_count(dex = -1)
validate dex => Integer
return self.count_species(@owned, dex)
@@ -161,7 +161,7 @@ class Player < Trainer
#===========================================================================
# @param pkmn [Pokemon, Symbol, GameData::Species] Pokemon to register as seen
# @param species [Pokemon, Symbol, GameData::Species] Pokemon to register as seen
# @param gender [Integer] gender to register (0=male, 1=female, 2=genderless)
# @param form [Integer] form to register
def register(species, gender = 0, form = 0, should_refresh_dexes = true)
+176 -86
View File
@@ -103,27 +103,39 @@ class PokedexSearchSelectionSprite < SpriteWrapper
@mode = value
case @mode
when 0 # Order
@xstart = 46; @ystart = 128
@xgap = 236; @ygap = 64
@xstart = 46
@ystart = 128
@xgap = 236
@ygap = 64
@cols = 2
when 1 # Name
@xstart = 78; @ystart = 114
@xgap = 52; @ygap = 52
@xstart = 78
@ystart = 114
@xgap = 52
@ygap = 52
@cols = 7
when 2 # Type
@xstart = 8; @ystart = 104
@xgap = 124; @ygap = 44
@xstart = 8
@ystart = 104
@xgap = 124
@ygap = 44
@cols = 4
when 3,4 # Height, weight
@xstart = 44; @ystart = 110
@xgap = 8; @ygap = 112
@xstart = 44
@ystart = 110
@xgap = 8
@ygap = 112
when 5 # Color
@xstart = 62; @ystart = 114
@xgap = 132; @ygap = 52
@xstart = 62
@ystart = 114
@xgap = 132
@ygap = 52
@cols = 3
when 6 # Shape
@xstart = 82; @ystart = 116
@xgap = 70; @ygap = 70
@xstart = 82
@ystart = 116
@xgap = 70
@ygap = 70
@cols = 5
end
end
@@ -133,46 +145,63 @@ class PokedexSearchSelectionSprite < SpriteWrapper
if @mode==-1 # Main search screen
case @index
when 0 # Order
self.src_rect.y = 0; self.src_rect.height = 44
self.src_rect.y = 0
self.src_rect.height = 44
when 1,5 # Name, color
self.src_rect.y = 44; self.src_rect.height = 44
self.src_rect.y = 44
self.src_rect.height = 44
when 2 # Type
self.src_rect.y = 88; self.src_rect.height = 44
self.src_rect.y = 88
self.src_rect.height = 44
when 3,4 # Height, weight
self.src_rect.y = 132; self.src_rect.height = 44
self.src_rect.y = 132
self.src_rect.height = 44
when 6 # Shape
self.src_rect.y = 176; self.src_rect.height = 68
self.src_rect.y = 176
self.src_rect.height = 68
else # Reset/start/cancel
self.src_rect.y = 244; self.src_rect.height = 40
self.src_rect.y = 244
self.src_rect.height = 40
end
case @index
when 0 # Order
self.x = 252; self.y = 52
self.x = 252
self.y = 52
when 1,2,3,4 # Name, type, height, weight
self.x = 114; self.y = 110+(@index-1)*52
self.x = 114
self.y = 110 + (@index - 1) * 52
when 5 # Color
self.x = 382; self.y = 110
self.x = 382
self.y = 110
when 6 # Shape
self.x = 420; self.y = 214
self.x = 420
self.y = 214
when 7,8,9 # Reset, start, cancel
self.x = 4+(@index-7)*176; self.y = 334
self.x = 4 + (@index - 7) * 176
self.y = 334
end
else # Parameter screen
case @index
when -2,-3 # OK, Cancel
self.src_rect.y = 244; self.src_rect.height = 40
self.src_rect.y = 244
self.src_rect.height = 40
else
case @mode
when 0 # Order
self.src_rect.y = 0; self.src_rect.height = 44
self.src_rect.y = 0
self.src_rect.height = 44
when 1 # Name
self.src_rect.y = 284; self.src_rect.height = 44
self.src_rect.y = 284
self.src_rect.height = 44
when 2,5 # Type, color
self.src_rect.y = 44; self.src_rect.height = 44
self.src_rect.y = 44
self.src_rect.height = 44
when 3,4 # Height, weight
self.src_rect.y = (@minmax==1) ? 328 : 424; self.src_rect.height = 96
self.src_rect.y = (@minmax == 1) ? 328 : 424
self.src_rect.height = 96
when 6 # Shape
self.src_rect.y = 176; self.src_rect.height = 68
self.src_rect.y = 176
self.src_rect.height = 68
end
end
case @index
@@ -185,9 +214,11 @@ class PokedexSearchSelectionSprite < SpriteWrapper
self.y = @ystart+(@cmds/@cols).floor*@ygap
end
when -2 # OK
self.x = 4; self.y = 334
self.x = 4
self.y = 334
when -3 # Cancel
self.x = 356; self.y = 334
self.x = 356
self.y = 334
else
case @mode
when 0,1,2,5,6 # Order, name, type, color, shape
@@ -527,34 +558,57 @@ class PokemonPokedex_Scene
textpos.push([title,102,(mode==6) ? 58 : 52,0,base,shadow])
case mode
when 0 # Order
xstart = 46; ystart = 128
xgap = 236; ygap = 64
halfwidth = 92; cols = 2
selbuttony = 0; selbuttonheight = 44
xstart = 46
ystart = 128
xgap = 236
ygap = 64
halfwidth = 92
cols = 2
selbuttony = 0
selbuttonheight = 44
when 1 # Name
xstart = 78; ystart = 114
xgap = 52; ygap = 52
halfwidth = 22; cols = 7
selbuttony = 156; selbuttonheight = 44
xstart = 78
ystart = 114
xgap = 52
ygap = 52
halfwidth = 22
cols = 7
selbuttony = 156
selbuttonheight = 44
when 2 # Type
xstart = 8; ystart = 104
xgap = 124; ygap = 44
halfwidth = 62; cols = 4
selbuttony = 44; selbuttonheight = 44
xstart = 8
ystart = 104
xgap = 124
ygap = 44
halfwidth = 62
cols = 4
selbuttony = 44
selbuttonheight = 44
when 3,4 # Height, weight
xstart = 44; ystart = 110
xgap = 304/(cmds.length+1); ygap = 112
halfwidth = 60; cols = cmds.length+1
xstart = 44
ystart = 110
xgap = 304 / (cmds.length + 1)
ygap = 112
halfwidth = 60
cols = cmds.length + 1
when 5 # Color
xstart = 62; ystart = 114
xgap = 132; ygap = 52
halfwidth = 62; cols = 3
selbuttony = 44; selbuttonheight = 44
xstart = 62
ystart = 114
xgap = 132
ygap = 52
halfwidth = 62
cols = 3
selbuttony = 44
selbuttonheight = 44
when 6 # Shape
xstart = 82; ystart = 116
xgap = 70; ygap = 70
halfwidth = 0; cols = 5
selbuttony = 88; selbuttonheight = 68
xstart = 82
ystart = 116
xgap = 70
ygap = 70
halfwidth = 0
cols = 5
selbuttony = 88
selbuttonheight = 68
end
# Draw selected option(s) text in top bar
case mode
@@ -870,23 +924,32 @@ class PokemonPokedex_Scene
Input.update
if mode==3 || mode==4
if Input.trigger?(Input::UP)
if index<-1; minmax = 0; index = selindex[minmax] # From OK/Cancel
elsif minmax==0; minmax = 1; index = selindex[minmax]
if index<-1 # From OK/Cancel
minmax = 0
index = selindex[minmax]
elsif minmax==0
minmax = 1
index = selindex[minmax]
end
if index!=oldindex || minmax!=oldminmax
pbPlayCursorSE
pbRefreshDexSearchParam(mode,cmds,selindex,index)
end
elsif Input.trigger?(Input::DOWN)
if minmax==1; minmax = 0; index = selindex[minmax]
elsif minmax==0; minmax = -1; index = -2
if minmax==1
minmax = 0
index = selindex[minmax]
elsif minmax==0
minmax = -1
index = -2
end
if index!=oldindex || minmax!=oldminmax
pbPlayCursorSE
pbRefreshDexSearchParam(mode,cmds,selindex,index)
end
elsif Input.repeat?(Input::LEFT)
if index==-3; index = -2
if index==-3
index = -2
elsif index>=-1
if minmax==1 && index==-1
index = cmds.length-1 if selindex[0]<cmds.length-1
@@ -902,10 +965,13 @@ class PokemonPokedex_Scene
pbRefreshDexSearchParam(mode,cmds,selindex,index)
end
elsif Input.repeat?(Input::RIGHT)
if index==-2; index = -3
if index==-2
index = -3
elsif index>=-1
if minmax==1 && index>=cmds.length; index = 0
elsif minmax==1 && index==cmds.length-1; index = -1
if minmax==1 && index>=cmds.length
index = 0
elsif minmax==1 && index==cmds.length-1
index = -1
elsif index<cmds.length && !(minmax==1 && index<0)
index += 1 if minmax==1 || selindex[1]==-1 ||
(selindex[1]<cmds.length && selindex[1]>=index+1)
@@ -919,17 +985,24 @@ class PokemonPokedex_Scene
end
else
if Input.trigger?(Input::UP)
if index==-1; index = cmds.length-1-(cmds.length-1)%cols-1 # From blank
elsif index==-2; index = ((cmds.length-1)/cols).floor*cols # From OK
elsif index==-3 && mode==0; index = cmds.length-1 # From Cancel
elsif index==-3; index = -1 # From Cancel
elsif index>=cols; index -= cols
if index==-1 # From blank
index = cmds.length-1-(cmds.length-1)%cols-1
elsif index==-2 # From OK
index = ((cmds.length-1)/cols).floor*cols
elsif index==-3 && mode==0 # From Cancel
index = cmds.length-1
elsif index==-3 # From Cancel
index = -1
elsif index>=cols
index -= cols
end
pbPlayCursorSE if index!=oldindex
elsif Input.trigger?(Input::DOWN)
if index==-1; index = -3 # From blank
if index==-1 # From blank
index = -3
elsif index>=0
if index+cols<cmds.length; index += cols
if index+cols<cmds.length
index += cols
elsif (index/cols).floor<((cmds.length-1)/cols).floor
index = (index%cols<cols/2.0) ? cmds.length-1 : -1
else
@@ -938,15 +1011,21 @@ class PokemonPokedex_Scene
end
pbPlayCursorSE if index!=oldindex
elsif Input.trigger?(Input::LEFT)
if index==-3; index = -2
elsif index==-1; index = cmds.length-1
elsif index>0 && index%cols!=0; index -= 1
if index==-3
index = -2
elsif index==-1
index = cmds.length-1
elsif index>0 && index%cols!=0
index -= 1
end
pbPlayCursorSE if index!=oldindex
elsif Input.trigger?(Input::RIGHT)
if index==-2; index = -3
elsif index==cmds.length-1 && mode!=0; index = -1
elsif index>=0 && index%cols!=cols-1; index += 1
if index==-2
index = -3
elsif index==cmds.length-1 && mode!=0
index = -1
elsif index>=0 && index%cols!=cols-1
index += 1
end
pbPlayCursorSE if index!=oldindex
end
@@ -1043,26 +1122,37 @@ class PokemonPokedex_Scene
oldindex = index
end
if Input.trigger?(Input::UP)
if index>=7; index = 4
elsif index==5; index = 0
elsif index>0; index -= 1
if index>=7
index = 4
elsif index==5
index = 0
elsif index>0
index -= 1
end
pbPlayCursorSE if index!=oldindex
elsif Input.trigger?(Input::DOWN)
if index==4 || index==6; index = 8
elsif index<7; index += 1
if index==4 || index==6
index = 8
elsif index<7
index += 1
end
pbPlayCursorSE if index!=oldindex
elsif Input.trigger?(Input::LEFT)
if index==5; index = 1
elsif index==6; index = 3
elsif index>7; index -= 1
if index==5
index = 1
elsif index==6
index = 3
elsif index>7
index -= 1
end
pbPlayCursorSE if index!=oldindex
elsif Input.trigger?(Input::RIGHT)
if index==1; index = 5
elsif index>=2 && index<=4; index = 6
elsif index==7 || index==8; index += 1
if index==1
index = 5
elsif index>=2 && index<=4
index = 6
elsif index==7 || index==8
index += 1
end
pbPlayCursorSE if index!=oldindex
elsif Input.trigger?(Input::ACTION)
+2 -1
View File
@@ -372,7 +372,8 @@ class PokemonPokedexInfo_Scene
formname = ""
for i in @available
if i[1]==@gender && i[2]==@form
formname = i[0]; break
formname = i[0]
break
end
end
textpos = [
+23 -11
View File
@@ -298,15 +298,22 @@ class PokemonPartyPanel < SpriteWrapper
@refreshing = true
if @panelbgsprite && !@panelbgsprite.disposed?
if self.selected
if self.preselected; @panelbgsprite.changeBitmap("swapsel2")
elsif @switching; @panelbgsprite.changeBitmap("swapsel")
elsif @pokemon.fainted?; @panelbgsprite.changeBitmap("faintedsel")
else; @panelbgsprite.changeBitmap("ablesel")
if self.preselected
@panelbgsprite.changeBitmap("swapsel2")
elsif @switching
@panelbgsprite.changeBitmap("swapsel")
elsif @pokemon.fainted?
@panelbgsprite.changeBitmap("faintedsel")
else
@panelbgsprite.changeBitmap("ablesel")
end
else
if self.preselected; @panelbgsprite.changeBitmap("swap")
elsif @pokemon.fainted?; @panelbgsprite.changeBitmap("fainted")
else; @panelbgsprite.changeBitmap("able")
if self.preselected
@panelbgsprite.changeBitmap("swap")
elsif @pokemon.fainted?
@panelbgsprite.changeBitmap("fainted")
else
@panelbgsprite.changeBitmap("able")
end
end
@panelbgsprite.x = self.x
@@ -316,9 +323,12 @@ class PokemonPartyPanel < SpriteWrapper
if @hpbgsprite && !@hpbgsprite.disposed?
@hpbgsprite.visible = (!@pokemon.egg? && !(@text && @text.length>0))
if @hpbgsprite.visible
if self.preselected || (self.selected && @switching); @hpbgsprite.changeBitmap("swap")
elsif @pokemon.fainted?; @hpbgsprite.changeBitmap("fainted")
else; @hpbgsprite.changeBitmap("able")
if self.preselected || (self.selected && @switching)
@hpbgsprite.changeBitmap("swap")
elsif @pokemon.fainted?
@hpbgsprite.changeBitmap("fainted")
else
@hpbgsprite.changeBitmap("able")
end
@hpbgsprite.x = self.x+96
@hpbgsprite.y = self.y+50
@@ -1022,7 +1032,9 @@ class PokemonPartyScreen
addedEntry = false
if pkmnid == Settings::MAX_PARTY_SIZE # Confirm was chosen
ret = []
for i in realorder; ret.push(@party[i]); end
for i in realorder
ret.push(@party[i])
end
error = []
break if ruleset.isValid?(ret,error)
pbDisplay(error[0])
+28 -14
View File
@@ -705,9 +705,12 @@ class PokemonSummary_Scene
if move.total_pp>0
textpos.push([_INTL("PP"),342,yPos+32,0,moveBase,moveShadow])
ppfraction = 0
if move.pp==0; ppfraction = 3
elsif move.pp*4<=move.total_pp; ppfraction = 2
elsif move.pp*2<=move.total_pp; ppfraction = 1
if move.pp==0
ppfraction = 3
elsif move.pp*4<=move.total_pp
ppfraction = 2
elsif move.pp*2<=move.total_pp
ppfraction = 1
end
textpos.push([sprintf("%d/%d",move.pp,move.total_pp),460,yPos+32,1,ppBase[ppfraction],ppShadow[ppfraction]])
end
@@ -768,9 +771,12 @@ class PokemonSummary_Scene
if move.total_pp>0
textpos.push([_INTL("PP"),342,yPos+32,0,moveBase,moveShadow])
ppfraction = 0
if move.pp==0; ppfraction = 3
elsif move.pp*4<=move.total_pp; ppfraction = 2
elsif move.pp*2<=move.total_pp; ppfraction = 1
if move.pp==0
ppfraction = 3
elsif move.pp*4<=move.total_pp
ppfraction = 2
elsif move.pp*2<=move.total_pp
ppfraction = 1
end
textpos.push([sprintf("%d/%d",move.pp,move.total_pp),460,yPos+32,1,ppBase[ppfraction],ppShadow[ppfraction]])
end
@@ -1128,17 +1134,25 @@ class PokemonSummary_Scene
redraw = true
end
elsif Input.trigger?(Input::UP)
if index==7; index = 6
elsif index==6; index = 4
elsif index<3; index = 7
else; index -= 3
if index==7
index = 6
elsif index==6
index = 4
elsif index<3
index = 7
else
index -= 3
end
pbPlayCursorSE
elsif Input.trigger?(Input::DOWN)
if index==7; index = 1
elsif index==6; index = 7
elsif index>=3; index = 6
else; index += 3
if index==7
index = 1
elsif index==6
index = 7
elsif index>=3
index = 6
else
index += 3
end
pbPlayCursorSE
elsif Input.trigger?(Input::LEFT)
+4 -2
View File
@@ -160,9 +160,11 @@ class PokemonBag_Scene
(!@filterlist && @bag.pockets[lastpocket].length==0)
for i in 1...@bag.pockets.length
if @filterlist && @filterlist[i].length>0
lastpocket = i; break
lastpocket = i
break
elsif !@filterlist && @bag.pockets[i].length>0
lastpocket = i; break
lastpocket = i
break
end
end
end
+4 -2
View File
@@ -117,8 +117,10 @@ class PokemonReadyMenu_Scene
if @index[1]>=@itemcommands.length && @itemcommands.length>0
@index[1] = @itemcommands.length-1
end
if @index[2]==0 && @movecommands.length==0; @index[2] = 1
elsif @index[2]==1 && @itemcommands.length==0; @index[2] = 0
if @index[2]==0 && @movecommands.length==0
@index[2] = 1
elsif @index[2]==1 && @itemcommands.length==0
@index[2] = 0
end
@viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z = 99999
+19 -10
View File
@@ -1262,16 +1262,24 @@ class PokemonStorageScene
selection -= 3 if selection%3==0
end
when Input::UP
if selection==7; selection = 6
elsif selection==6; selection = 4
elsif selection<3; selection = 7
else; selection -= 3
if selection==7
selection = 6
elsif selection==6
selection = 4
elsif selection<3
selection = 7
else
selection -= 3
end
when Input::DOWN
if selection==7; selection = 1
elsif selection==6; selection = 7
elsif selection>=3; selection = 6
else; selection += 3
if selection==7
selection = 1
elsif selection==6
selection = 7
elsif selection>=3
selection = 6
else
selection += 3
end
end
return selection
@@ -1675,7 +1683,7 @@ class PokemonStorageScreen
box = selected[0]
index = selected[1]
if box==-1
raise _INTL("Can't withdraw from party...");
raise _INTL("Can't withdraw from party...")
end
if @storage.party_full?
pbDisplay(_INTL("Your party's full!"))
@@ -1912,7 +1920,8 @@ class PokemonStorageScreen
index = 0
for i in 0...papers[1].length
if papers[1][i]==@storage[@storage.currentBox].background
index = i; break
index = i
break
end
end
wpaper = pbShowCommands(_INTL("Pick the wallpaper."),papers[0],index)
+6 -2
View File
@@ -1181,7 +1181,9 @@ class PurifyChamberScene
def pbSetScreen
pbDeactivateWindows(@sprites) {
loop do
Graphics.update; Input.update; pbUpdate
Graphics.update
Input.update
pbUpdate
btn=0
btn=Input::DOWN if Input.repeat?(Input::DOWN)
btn=Input::UP if Input.repeat?(Input::UP)
@@ -1218,7 +1220,9 @@ class PurifyChamberScene
oldindex=@sprites["setwindow"].index
@sprites["setview"].set=oldindex
end
Graphics.update; Input.update; pbUpdate
Graphics.update
Input.update
pbUpdate
if Input.trigger?(Input::USE)
pbPlayDecisionSE()
return @sprites["setwindow"].index
+8 -3
View File
@@ -61,7 +61,9 @@ def pbEditMysteryGift(type,item,id=0,giftname="")
master=IO.read("MysteryGiftMaster.txt")
master=pbMysteryGiftDecrypt(master)
end
for i in master; idlist.push(i[0]); end
for i in master
idlist.push(i[0])
end
params=ChooseNumberParams.new
params.setRange(0,99999)
params.setDefaultValue(id)
@@ -199,7 +201,8 @@ def pbManageMysteryGifts
replaced=false
for i in 0...$Trainer.mystery_gifts.length
if $Trainer.mystery_gifts[i][0]==gift[0]
$Trainer.mystery_gifts[i]=gift; replaced=true
$Trainer.mystery_gifts[i]=gift
replaced=true
end
end
$Trainer.mystery_gifts.push(gift) if !replaced
@@ -260,7 +263,9 @@ def pbDownloadMysteryGift(trainer)
else
loop do
commands=[]
for gift in pending; commands.push(gift[3]); end
for gift in pending
commands.push(gift[3])
end
commands.push(_INTL("Cancel"))
pbMessageDisplay(sprites["msgwindow"],_INTL("Choose the gift you want to receive.\\wtnp[0]"))
command=pbShowCommands(sprites["msgwindow"],commands,-1)
@@ -67,11 +67,16 @@ class TriadCard
ret *= (@north + @east + @south + @west)
ret /= 10 # Ranges from 2 to 24,000
# Quantize prices to the next highest "unit"
if ret > 10000; ret = (1 + ret / 1000) * 1000
elsif ret > 5000; ret = (1 + ret / 500) * 500
elsif ret > 1000; ret = (1 + ret / 100) * 100
elsif ret > 500; ret = (1 + ret / 50) * 50
else; ret = (1 + ret / 10) * 10
if ret > 10000
ret = (1 + ret / 1000) * 1000
elsif ret > 5000
ret = (1 + ret / 500) * 500
elsif ret > 1000
ret = (1 + ret / 100) * 100
elsif ret > 500
ret = (1 + ret / 50) * 50
else
ret = (1 + ret / 10) * 10
end
return ret
end
@@ -42,11 +42,16 @@ class MiningGameTile < BitmapSprite
@viewport.z=99999
super(32,32,@viewport)
r = rand(100)
if r<10; @layer = 2 # 10%
elsif r<25; @layer = 3 # 15%
elsif r<60; @layer = 4 # 35%
elsif r<85; @layer = 5 # 25%
else; @layer = 6 # 15%
if r < 10
@layer = 2 # 10%
elsif r < 25
@layer = 3 # 15%
elsif r < 60
@layer = 4 # 35%
elsif r < 85
@layer = 5 # 25%
else
@layer = 6 # 15%
end
@image=AnimatedBitmap.new(_INTL("Graphics/Pictures/Mining/tiles"))
update
@@ -104,10 +109,12 @@ class MiningGameCursor < BitmapSprite
y = 32*(@position/MiningGameScene::BOARDWIDTH)
if @counter>0
@counter -= 1
toolx = x; tooly = y
toolx = x
tooly = y
i = 10-(@counter/2).floor
if ToolPositions[i][1]==1
toolx -= 8; tooly += 8
toolx -= 8
tooly += 8
elsif ToolPositions[i][1]==2
toolx += 6
end
@@ -153,7 +153,9 @@ class TilePuzzleScene
addBackgroundPlane(@sprites,"bg","Tile Puzzle/bg",@viewport)
end
@tilebitmap=AnimatedBitmap.new("Graphics/Pictures/Tile Puzzle/tiles#{@board}")
@tilebitmap1=nil; @tilebitmap2=nil; @tilebitmap3=nil
@tilebitmap1=nil
@tilebitmap2=nil
@tilebitmap3=nil
if pbResolveBitmap("Graphics/Pictures/Tile Puzzle/tiles#{@board}_1")
@tilebitmap1=AnimatedBitmap.new("Graphics/Pictures/Tile Puzzle/tiles#{@board}_1")
end
@@ -184,7 +186,10 @@ class TilePuzzleScene
def pbShuffleTiles
ret=[]
for i in 0...@boardwidth*@boardheight; ret.push(i); @angles.push(0); end
for i in 0...@boardwidth*@boardheight
ret.push(i)
@angles.push(0)
end
if @game==6
@tiles=ret
5.times do
@@ -199,7 +204,8 @@ class TilePuzzleScene
else
ret.shuffle!
if @game==3 # Make sure only solvable Mystic Squares are allowed.
num=0; blank=-1
num=0
blank=-1
for i in 0...ret.length-1
blank=i if ret[i]==@boardwidth*@boardheight-1
for j in i...ret.length
@@ -216,11 +222,15 @@ class TilePuzzleScene
end
if @game==1 || @game==2
ret2=[]
for i in 0...@boardwidth*@boardheight; ret2.push(-1); end
for i in 0...@boardwidth*@boardheight
ret2.push(-1)
end
ret=ret2+ret
end
if @game==2 || @game==5
for i in 0...@angles.length; @angles[i]=rand(4); end
for i in 0...@angles.length
@angles[i]=rand(4)
end
end
end
return ret
@@ -399,7 +409,8 @@ class TilePuzzleScene
def pbShiftLine(dir,cursor,anim=true)
# Get tiles involved
tiles=[]; dist=0
tiles=[]
dist=0
if dir==2 || dir==8
dist=(dir/4).floor-1
while (dist>0 && cursor<(@boardwidth-1)*@boardheight) ||
@@ -453,7 +464,9 @@ class TilePuzzleScene
end
end
temp=[]
for i in tiles; temp.push(@tiles[i]); end
for i in tiles
temp.push(@tiles[i])
end
for i in 0...temp.length
@tiles[tiles[(i+1)%(temp.length)]]=temp[i]
end
@@ -134,9 +134,7 @@ class PBPokemon
move_data = GameData::Move.try_get(moves[i])
moveid.push(move_data.id) if move_data
end
if moveid.length == 0
GameData::Move.each { |mov| moveid.push(mov.id); break } # Get any one move
end
moveid.push(GameData::Move.keys.first) if moveid.length == 0 # Get any one move
return self.new(species, item, nature, moveid[0], moveid[1], moveid[2], moveid[3], ev_array)
end
@@ -379,8 +379,7 @@ def pbRuledBattle(team1, team2, rule)
decision = pbDecideWinner(party1, party2, team1.rating, team2.rating)
else
level = rule.ruleset.suggestedLevel
t_type = nil
GameData::TrainerType.each { |t| t_type = t.id; break }
t_type = GameData::TrainerType.keys.first
trainer1 = NPCTrainer.new("PLAYER1", t_type)
trainer2 = NPCTrainer.new("PLAYER2", t_type)
items1 = []
@@ -1390,7 +1390,8 @@ def pbAnimationsOrganiser
Graphics.width / 2, 64, Graphics.width / 2, Graphics.height - 64, viewport)
info.z = 2
commands = []
refreshlist = true; oldsel = -1
refreshlist = true
oldsel = -1
cmd = [0,0]
loop do
if refreshlist
@@ -1399,7 +1400,8 @@ def pbAnimationsOrganiser
commands.push(sprintf("%d: %s",i,(list[i]) ? list[i].name : "???"))
end
end
refreshlist = false; oldsel = -1
refreshlist = false
oldsel = -1
cmd = pbCommands3(cmdwin,commands,-1,cmd[1],true)
if cmd[0]==1 # Swap animation up
if cmd[1]>=0 && cmd[1]<commands.length-1
@@ -15,7 +15,9 @@ class MiniBattle
def initialize
@battlers=[]
for i in 0...4; @battlers[i]=MiniBattler.new(i); end
for i in 0...4
@battlers[i] = MiniBattler.new(i)
end
end
end
@@ -950,8 +952,8 @@ def pbAnimEditorHelpWindow
helptext=""+
"To add a cel to the scene, click on the canvas. The selected cel will have a black "+
"frame. After a cel is selected, you can modify its properties using the keyboard:\n"+
"E, R - Rotate left/right;\nP - Open properties screen;\nArrow keys - Move cel 8 pixels "+
"(hold ALT for 2 pixels);\n+/- : Zoom in/out;\nL - Lock a cel. Locking a cel prevents it "+
"E, R - Rotate left/right.\nP - Open properties screen.\nArrow keys - Move cel 8 pixels "+
"(hold ALT for 2 pixels).\n+/- : Zoom in/out.\nL - Lock a cel. Locking a cel prevents it "+
"from being moved or deleted.\nDEL - Deletes the cel.\nAlso press TAB to switch the selected cel."
cmdwin=Window_UnformattedTextPokemon.newWithSize("",0,0,640,512)
cmdwin.opacity=224
@@ -77,7 +77,8 @@ class SpriteWindow_DebugVariables < Window_DrawableCommand
def drawItem(index,_count,rect)
pbSetNarrowFont(self.contents)
colors = 0; codeswitch = false
colors = 0
codeswitch = false
if @mode==0
name = $data_system.switches[index+1]
codeswitch = (name[/^s\:/])
@@ -235,7 +236,7 @@ def pbDebugDayCare
for i in 0...2
textpos.push([_INTL("Pokémon {1}",i+1),Graphics.width/4+i*Graphics.width/2,2,2,base,shadow])
end
for i in 0...pbDayCareDeposited
for i in 0...2
next if !$PokemonGlobal.daycare[i][0]
y = 34
pkmn = $PokemonGlobal.daycare[i][0]
@@ -381,12 +382,16 @@ class SpriteWindow_DebugRoamers < Window_DrawableCommand
def shadowtext(t,x,y,w,h,align=0,colors=0)
width = self.contents.text_size(t).width
if align==1 ; x += (w-width) # Right aligned
elsif align==2; x += (w/2)-(width/2) # Centre aligned
if align==1
x += (w-width) # Right aligned
elsif align==2
x += (w/2)-(width/2) # Centre aligned
end
base = Color.new(12*8,12*8,12*8)
if colors==1; base = Color.new(168,48,56) # Red
elsif colors==2; base = Color.new(0,144,0) # Green
if colors==1
base = Color.new(168,48,56) # Red
elsif colors==2
base = Color.new(0,144,0) # Green
end
pbDrawShadowText(self.contents,x,y,[width,w].max,h,t,base,Color.new(26*8,26*8,25*8))
end
+2 -1
View File
@@ -587,7 +587,8 @@ module Compiler
for key in enumer.keys
if enumer[key]==rec[i]
file.write(key)
hasenum = true; break
hasenum = true
break
end
end
file.write(rec[i]) unless hasenum
@@ -1002,10 +1002,12 @@ module Compiler
deleteMoveRouteAt = proc { |list,i|
arr = []
if list[i] && list[i].code==209 # Set Move Route
arr.push(list[i]); list.delete_at(i)
arr.push(list[i])
list.delete_at(i)
while i<list.length
break if !list[i] || list[i].code!=509 # Set Move Route (continuation line)
arr.push(list[i]); list.delete_at(i)
arr.push(list[i])
list.delete_at(i)
end
end
next arr
@@ -1028,17 +1030,26 @@ module Compiler
if route && route.list.length<=2
# Delete superfluous move route command if necessary
if route.list[0].code==16 # Player Turn Down
deleteMoveRouteAt.call(list,i+1); params[4] = 2; changed = true
deleteMoveRouteAt.call(list,i+1)
params[4] = 2
changed = true
elsif route.list[0].code==17 # Player Turn Left
deleteMoveRouteAt.call(list,i+1); params[4] = 4; changed = true
deleteMoveRouteAt.call(list,i+1)
params[4] = 4
changed = true
elsif route.list[0].code==18 # Player Turn Right
deleteMoveRouteAt.call(list,i+1); params[4] = 6; changed = true
deleteMoveRouteAt.call(list,i+1)
params[4] = 6
changed = true
elsif route.list[0].code==19 # Player Turn Up
deleteMoveRouteAt.call(list,i+1); params[4] = 8; changed = true
deleteMoveRouteAt.call(list,i+1)
params[4] = 8
changed = true
elsif (route.list[0].code==1 || route.list[0].code==2 || # Player Move (4-dir)
route.list[0].code==3 || route.list[0].code==4) && list.length==4
params[4] = [0,2,4,6,8][route.list[0].code]
deletedRoute = deleteMoveRouteAt.call(list,i+1); changed = true
deletedRoute = deleteMoveRouteAt.call(list,i+1)
changed = true
end
end
# If an event command before this one is a Move Route that just
@@ -1055,13 +1066,25 @@ module Compiler
# oldlistlength = list.length
# # Delete superfluous move route command if necessary
# if route.list[0].code==16 # Player Turn Down
# deleteMoveRouteAt.call(list,j); params[4] = 2; changed = true; i -= (oldlistlength-list.length)
# deleteMoveRouteAt.call(list,j)
# params[4] = 2
# changed = true
# i -= (oldlistlength-list.length)
# elsif route.list[0].code==17 # Player Turn Left
# deleteMoveRouteAt.call(list,j); params[4] = 4; changed = true; i -= (oldlistlength-list.length)
# deleteMoveRouteAt.call(list,j)
# params[4] = 4
# changed = true
# i -= (oldlistlength-list.length)
# elsif route.list[0].code==18 # Player Turn Right
# deleteMoveRouteAt.call(list,j); params[4] = 6; changed = true; i -= (oldlistlength-list.length)
# deleteMoveRouteAt.call(list,j)
# params[4] = 6
# changed = true
# i -= (oldlistlength-list.length)
# elsif route.list[0].code==19 # Player Turn Up
# deleteMoveRouteAt.call(list,j); params[4] = 8; changed = true; i -= (oldlistlength-list.length)
# deleteMoveRouteAt.call(list,j)
# params[4] = 8
# changed = true
# i -= (oldlistlength-list.length)
# end
# end
# end
@@ -1080,13 +1103,21 @@ module Compiler
if route && route.list.length<=2
# Delete superfluous move route command if necessary
if route.list[0].code==16 # Player Turn Down
deleteMoveRouteAt.call(list,i+2); params[4] = 2; changed = true
deleteMoveRouteAt.call(list,i+2)
params[4] = 2
changed = true
elsif route.list[0].code==17 # Player Turn Left
deleteMoveRouteAt.call(list,i+2); params[4] = 4; changed = true
deleteMoveRouteAt.call(list,i+2)
params[4] = 4
changed = true
elsif route.list[0].code==18 # Player Turn Right
deleteMoveRouteAt.call(list,i+2); params[4] = 6; changed = true
deleteMoveRouteAt.call(list,i+2)
params[4] = 6
changed = true
elsif route.list[0].code==19 # Player Turn Up
deleteMoveRouteAt.call(list,i+2); params[4] = 8; changed = true
deleteMoveRouteAt.call(list,i+2)
params[4] = 8
changed = true
end
end
end