Renamed $Trainer to $player

This commit is contained in:
Maruno17
2021-10-20 22:57:43 +01:00
parent fbddb9034f
commit e49cd8d498
71 changed files with 470 additions and 470 deletions

View File

@@ -49,10 +49,10 @@ class PokemonDuel
@viewport.z = 99999
@sprites = {}
@sprites["player"] = IconSprite.new(-128 - 32, 96, @viewport)
@sprites["player"].setBitmap(GameData::TrainerType.front_sprite_filename($Trainer.trainer_type))
@sprites["player"].setBitmap(GameData::TrainerType.front_sprite_filename($player.trainer_type))
@sprites["opponent"] = IconSprite.new(Graphics.width + 32, 96, @viewport)
@sprites["opponent"].setBitmap(GameData::TrainerType.front_sprite_filename(opponent.trainer_type))
@sprites["playerwindow"] = DuelWindow.new($Trainer.name, false)
@sprites["playerwindow"] = DuelWindow.new($player.name, false)
@sprites["playerwindow"].x = -@sprites["playerwindow"].width
@sprites["playerwindow"].viewport = @viewport
@sprites["opponentwindow"] = DuelWindow.new(opponent.name, true)

View File

@@ -723,7 +723,7 @@ class TriadScreen
count += item[1] # Add item count to total count
end
@board = []
@playerName = $Trainer ? $Trainer.name : "Trainer"
@playerName = $player ? $player.name : "Trainer"
@opponentName = opponentName
type_keys = GameData::Type.keys
for i in 0...@width*@height
@@ -781,7 +781,7 @@ class TriadScreen
total = triad.north + triad.south + triad.east + triad.west
# Add random species and its total point count
candidates.push([card, total])
if candidates.length < 200 && $Trainer.owned?(card_data.species)
if candidates.length < 200 && $player.owned?(card_data.species)
# Add again if player owns the species
candidates.push([card, total])
end
@@ -1059,7 +1059,7 @@ def pbBuyTriads
commands = []
realcommands = []
GameData::Species.each_species do |s|
next if !$Trainer.owned?(s.species)
next if !$player.owned?(s.species)
price = TriadCard.new(s.id).price
commands.push([price, s.name, _INTL("{1} - ${2}", s.name, price.to_s_formatted), s.id])
end
@@ -1107,11 +1107,11 @@ def pbBuyTriads
itemname = commands[cmdwindow.index][1]
cmdwindow.active = false
cmdwindow.update
if $Trainer.money<price
if $player.money<price
pbMessage(_INTL("You don't have enough money."))
next
end
maxafford = (price<=0) ? 99 : $Trainer.money/price
maxafford = (price<=0) ? 99 : $player.money/price
maxafford = 99 if maxafford>99
params = ChooseNumberParams.new
params.setRange(1,maxafford)
@@ -1122,7 +1122,7 @@ def pbBuyTriads
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))
if $Trainer.money<price
if $player.money<price
pbMessage(_INTL("You don't have enough money."))
next
end
@@ -1131,7 +1131,7 @@ def pbBuyTriads
next
end
$PokemonGlobal.triads.add(item, quantity)
$Trainer.money -= price
$player.money -= price
goldwindow.text = _INTL("Money:\r\n{1}",pbGetGoldString)
pbMessage(_INTL("Here you are! Thank you!\\se[Mart buy item]"))
end
@@ -1222,7 +1222,7 @@ def pbSellTriads
price /= 4
price *= quantity
if pbConfirmMessage(_INTL("I can pay ${1}. Would that be OK?",price.to_s_formatted))
$Trainer.money += price
$player.money += price
goldwindow.text = _INTL("Money:\r\n{1}",pbGetGoldString)
$PokemonGlobal.triads.remove(item,quantity)
pbMessage(_INTL("Turned over the {1} card and received ${2}.\\se[Mart buy item]",itemname,price.to_s_formatted))

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,$Trainer.coins)
@sprites["credit"]=SlotMachineScore.new(360,66,$player.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 $Trainer.coins==0
elsif $player.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
$Trainer.coins = @sprites["credit"].score
$player.coins = @sprites["credit"].score
end
def pbEndScene
@@ -390,9 +390,9 @@ end
def pbSlotMachine(difficulty=1)
if !$bag.has?(:COINCASE)
pbMessage(_INTL("It's a Slot Machine."))
elsif $Trainer.coins == 0
elsif $player.coins == 0
pbMessage(_INTL("You don't have any Coins to play!"))
elsif $Trainer.coins == Settings::MAX_COINS
elsif $player.coins == Settings::MAX_COINS
pbMessage(_INTL("Your Coin Case is full!"))
else
pbFadeOutIn {

View File

@@ -108,11 +108,11 @@ class VoltorbFlip
@sprites["curtainL"].visible=false
@sprites["curtainR"].visible=false
@sprites["curtain"].opacity=100
if $Trainer.coins >= Settings::MAX_COINS
if $player.coins >= Settings::MAX_COINS
pbMessage(_INTL("You've gathered {1} Coins. You cannot gather any more.", Settings::MAX_COINS.to_s_formatted))
$Trainer.coins = Settings::MAX_COINS # As a precaution
$player.coins = Settings::MAX_COINS # As a precaution
@quit=true
# elsif !pbConfirmMessage(_INTL("Play Voltorb Flip Lv. {1}?",@level)) && $Trainer.coins<Settings::MAX_COINS
# elsif !pbConfirmMessage(_INTL("Play Voltorb Flip Lv. {1}?",@level)) && $player.coins<Settings::MAX_COINS
# @quit=true
else
@sprites["curtain"].opacity=0
@@ -366,11 +366,11 @@ class VoltorbFlip
pbMessage(_INTL("\\me[Voltorb Flip win]Game clear!\\wtnp[40]"))
# pbMessage(_INTL("You've found all of the hidden x2 and x3 cards."))
# pbMessage(_INTL("This means you've found all the Coins in this game, so the game is now over."))
pbMessage(_INTL("\\se[Voltorb Flip gain coins]{1} received {2} Coins!",$Trainer.name,@points.to_s_formatted))
pbMessage(_INTL("\\se[Voltorb Flip gain coins]{1} received {2} Coins!",$player.name,@points.to_s_formatted))
# Update level text
@sprites["level"].bitmap.clear
pbDrawShadowText(@sprites["level"].bitmap,8,150,118,28,_INTL("Level {1}",@level.to_s),Color.new(60,60,60),Color.new(150,190,170),1)
$Trainer.coins+=@points
$player.coins+=@points
@points=0
pbUpdateCoins
@sprites["curtain"].opacity=0
@@ -413,8 +413,8 @@ class VoltorbFlip
@quit=true
end
elsif pbConfirmMessage(_INTL("If you quit now, you will recieve {1} Coin(s). Will you quit?",@points.to_s_formatted))
pbMessage(_INTL("{1} received {2} Coin(s)!",$Trainer.name,@points.to_s_formatted))
$Trainer.coins+=@points
pbMessage(_INTL("{1} received {2} Coin(s)!",$player.name,@points.to_s_formatted))
$player.coins+=@points
@points=0
pbUpdateCoins
@sprites["curtain"].opacity=0
@@ -479,7 +479,7 @@ class VoltorbFlip
def pbUpdateCoins
# Update coins display
@sprites["totalCoins"].bitmap.clear
pbCreateCoins($Trainer.coins,44)
pbCreateCoins($player.coins,44)
pbDrawImagePositions(@sprites["totalCoins"].bitmap,@coins)
# Update points display
@sprites["currentCoins"].bitmap.clear
@@ -616,7 +616,7 @@ end
def pbVoltorbFlip
if !$bag.has?(:COINCASE)
pbMessage(_INTL("You can't play unless you have a Coin Case."))
elsif $Trainer.coins == Settings::MAX_COINS
elsif $player.coins == Settings::MAX_COINS
pbMessage(_INTL("Your Coin Case is full!"))
else
scene=VoltorbFlip.new

View File

@@ -16,7 +16,7 @@ def pbLottery(winnum,nameVar=2,positionVar=3,matchedVar=4)
winpoke=nil
winpos=0
winmatched=0
for i in $Trainer.party
for i in $player.party
thismatched=0
id=i.owner.public_id
for j in 0...5