mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
Refactor: double hats
This commit is contained in:
@@ -5,15 +5,23 @@ def isWearingTeamRocketOutfit()
|
|||||||
end
|
end
|
||||||
|
|
||||||
def isWearingFavoriteOutfit()
|
def isWearingFavoriteOutfit()
|
||||||
is_wearing_favorite_hat = $Trainer.hat == $Trainer.favorite_hat || !$Trainer.favorite_hat
|
favorites = {
|
||||||
is_wearing_favorite_clothes = $Trainer.clothes == $Trainer.favorite_clothes || !$Trainer.favorite_clothes
|
hat: $Trainer.favorite_hat,
|
||||||
if $Trainer.favorite_hat && !$Trainer.favorite_clothes
|
hat2: $Trainer.favorite_hat2,
|
||||||
return is_wearing_favorite_hat
|
clothes: $Trainer.favorite_clothes
|
||||||
|
}
|
||||||
|
favorites.select! { |item, favorite| !favorite.nil? }
|
||||||
|
return false if favorites.empty?
|
||||||
|
return favorites.all? do |item, favorite|
|
||||||
|
case item
|
||||||
|
when :hat
|
||||||
|
$Trainer.hat == favorite
|
||||||
|
when :hat2
|
||||||
|
$Trainer.hat2 == favorite
|
||||||
|
when :clothes
|
||||||
|
$Trainer.clothes == favorite
|
||||||
end
|
end
|
||||||
if $Trainer.favorite_clothes && !$Trainer.favorite_hat
|
|
||||||
return is_wearing_favorite_clothes
|
|
||||||
end
|
end
|
||||||
return is_wearing_favorite_clothes && is_wearing_favorite_hat
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def obtainRocketOutfit()
|
def obtainRocketOutfit()
|
||||||
|
|||||||
Reference in New Issue
Block a user