Renames $Trainer to $player

This commit is contained in:
chardub
2025-04-24 19:57:12 -04:00
parent 95ef337de8
commit 7de024dafd
34 changed files with 391 additions and 391 deletions

View File

@@ -1,44 +1,44 @@
# frozen_string_literal: true
def unlock_easter_egg_hats()
if $Trainer.name == "Ash"
$Trainer.hat = HAT_ASH
$Trainer.unlock_hat(HAT_ASH)
if $player.name == "Ash"
$player.hat = HAT_ASH
$player.unlock_hat(HAT_ASH)
end
if $Trainer.name == "Frogman"
$Trainer.hat = HAT_FROG
$Trainer.unlock_hat(HAT_FROG)
if $player.name == "Frogman"
$player.hat = HAT_FROG
$player.unlock_hat(HAT_FROG)
end
end
def setupStartingOutfit()
$Trainer.hat = nil
$Trainer.clothes = STARTING_OUTFIT
$player.hat = nil
$player.clothes = STARTING_OUTFIT
unlock_easter_egg_hats()
gender = pbGet(VAR_TRAINER_GENDER)
if gender == GENDER_FEMALE
$Trainer.unlock_clothes(DEFAULT_OUTFIT_FEMALE, true)
$Trainer.unlock_hat(DEFAULT_OUTFIT_FEMALE, true)
$Trainer.hair = "3_" + DEFAULT_OUTFIT_FEMALE if !$Trainer.hair # when migrating old savefiles
$player.unlock_clothes(DEFAULT_OUTFIT_FEMALE, true)
$player.unlock_hat(DEFAULT_OUTFIT_FEMALE, true)
$player.hair = "3_" + DEFAULT_OUTFIT_FEMALE if !$player.hair # when migrating old savefiles
elsif gender == GENDER_MALE
$Trainer.unlock_clothes(DEFAULT_OUTFIT_MALE, true)
$Trainer.unlock_hat(DEFAULT_OUTFIT_MALE, true)
$player.unlock_clothes(DEFAULT_OUTFIT_MALE, true)
$player.unlock_hat(DEFAULT_OUTFIT_MALE, true)
echoln $Trainer.hair
$Trainer.hair = ("3_" + DEFAULT_OUTFIT_MALE) if !$Trainer.hair # when migrating old savefiles
echoln $Trainer.hair
echoln $player.hair
$player.hair = ("3_" + DEFAULT_OUTFIT_MALE) if !$player.hair # when migrating old savefiles
echoln $player.hair
end
$Trainer.unlock_hair(DEFAULT_OUTFIT_MALE, true)
$Trainer.unlock_hair(DEFAULT_OUTFIT_FEMALE, true)
$Trainer.unlock_clothes(STARTING_OUTFIT, true)
$player.unlock_hair(DEFAULT_OUTFIT_MALE, true)
$player.unlock_hair(DEFAULT_OUTFIT_FEMALE, true)
$player.unlock_clothes(STARTING_OUTFIT, true)
end
def give_date_specific_hats()
current_date = Time.new
# Christmas
if (current_date.day == 24 || current_date.day == 25) && current_date.month == 12
if !$Trainer.unlocked_hats.include?(HAT_SANTA)
if !$player.unlocked_hats.include?(HAT_SANTA)
pbCallBub(2, @event_id, true)
pbMessage("Hi! We're giving out a special hat today for the holidays season. Enjoy!")
obtainHat(HAT_SANTA)
@@ -47,7 +47,7 @@ def give_date_specific_hats()
# April's fool
if (current_date.day == 1 && current_date.month == 4)
if !$Trainer.unlocked_hats.include?(HAT_CLOWN)
if !$player.unlocked_hats.include?(HAT_CLOWN)
pbCallBub(2, @event_id, true)
pbMessage("Hi! We're giving out this fun accessory for this special day. Enjoy!")
obtainHat(HAT_CLOWN)