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

@@ -434,11 +434,10 @@ MultipleForms.register(:AEGISLASH,{
MultipleForms.register(:PUMPKABOO,{
"getFormOnCreation" => proc { |pkmn|
r = rand(100)
if r<5; next 3 # Super Size (5%)
elsif r<20; next 2 # Large (15%)
elsif r<65; next 1 # Average (45%)
end
next 0 # Small (35%)
next 3 if r < 5 # Super Size (5%)
next 2 if r < 20 # Large (15%)
next 1 if r < 65 # Average (45%)
next 0 # Small (35%)
}
})

View File

@@ -171,9 +171,11 @@ class PokemonIconSprite < SpriteWrapper
return 0 if @pokemon.fainted? # Fainted - no animation
# ret is initially the time a whole animation cycle lasts. It is divided by
# the number of frames in that cycle at the end.
ret = Graphics.frame_rate/4 # Green HP - 0.25 seconds
if @pokemon.hp<=@pokemon.totalhp/4; ret *= 4 # Red HP - 1 second
elsif @pokemon.hp<=@pokemon.totalhp/2; ret *= 2 # Yellow HP - 0.5 seconds
ret = Graphics.frame_rate/4 # Green HP - 0.25 seconds
if @pokemon.hp<=@pokemon.totalhp/4 # Red HP - 1 second
ret *= 4
elsif @pokemon.hp<=@pokemon.totalhp/2 # Yellow HP - 0.5 seconds
ret *= 2
end
ret /= @numFrames
ret = 1 if ret<1

View File

@@ -108,7 +108,8 @@ class PokemonStorage
@unlockedWallpapers = [] if !@unlockedWallpapers
for i in 0...papers.length
next if !isAvailableWallpaper?(i)
ret[0].push(papers[i]); ret[1].push(i)
ret[0].push(papers[i])
ret[1].push(i)
end
return ret
end

View File

@@ -1110,7 +1110,7 @@ class Pokemon
# @param level [Integer] Pokémon level
# @param owner [Owner, Player, NPCTrainer] Pokémon owner (the player by default)
# @param withMoves [TrueClass, FalseClass] whether the Pokémon should have moves
# @param rechech_form [TrueClass, FalseClass] whether to auto-check the form
# @param recheck_form [TrueClass, FalseClass] whether to auto-check the form
def initialize(species, level, owner = $Trainer, withMoves = true, recheck_form = true)
species_data = GameData::Species.get(species)
@species = species_data.species

View File

@@ -73,8 +73,10 @@ class Pokemon
def makeUnprimal
v = MultipleForms.call("getUnprimalForm", self)
if !v.nil?; self.form = v
elsif primal?; self.form = 0
if !v.nil?
self.form = v
elsif primal?
self.form = 0
end
end
end