Moved some global metadata values to class Player, added battle points property

This commit is contained in:
Maruno17
2021-04-12 20:31:15 +01:00
parent e49ddde198
commit 9f70b29795
24 changed files with 283 additions and 94 deletions

View File

@@ -269,7 +269,7 @@ class SlotMachineScene
@sprites["window1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/insert"))
@sprites["window1"].src_rect.set(0,0,152,208)
@sprites["window2"]=IconSprite.new(358,96,@viewport)
@sprites["credit"]=SlotMachineScore.new(360,66,$PokemonGlobal.coins)
@sprites["credit"]=SlotMachineScore.new(360,66,$Trainer.coins)
@sprites["payout"]=SlotMachineScore.new(438,66,0)
@wager=0
update
@@ -289,7 +289,7 @@ class SlotMachineScene
if @sprites["credit"].score == Settings::MAX_COINS
pbMessage(_INTL("You've got {1} Coins.", Settings::MAX_COINS.to_s_formatted))
break
elsif $PokemonGlobal.coins==0
elsif $Trainer.coins==0
pbMessage(_INTL("You've run out of Coins.\nGame over!"))
break
elsif @gameRunning # Reels are spinning
@@ -361,7 +361,7 @@ class SlotMachineScene
end
frame = (frame+1)%(Graphics.frame_rate*4)
end
$PokemonGlobal.coins = @sprites["credit"].score
$Trainer.coins = @sprites["credit"].score
end
def pbEndScene
@@ -390,9 +390,9 @@ end
def pbSlotMachine(difficulty=1)
if GameData::Item.exists?(:COINCASE) && !$PokemonBag.pbHasItem?(:COINCASE)
pbMessage(_INTL("It's a Slot Machine."))
elsif $PokemonGlobal.coins==0
elsif $Trainer.coins == 0
pbMessage(_INTL("You don't have any Coins to play!"))
elsif $PokemonGlobal.coins == Settings::MAX_COINS
elsif $Trainer.coins == Settings::MAX_COINS
pbMessage(_INTL("Your Coin Case is full!"))
else
pbFadeOutIn {