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

View File

@@ -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

View File

@@ -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

View File

@@ -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