Added terrain tag 17 NoEffect, Terrain Tag Editor now only sets defined terrain tags, fixed some move effects, fixed opposing Shadow Pokémon going into Hyper Mode, fixed Shadow Pokémon nature visibility

This commit is contained in:
Maruno17
2021-08-14 22:36:55 +01:00
parent 2112cdba37
commit 7ae62d74b7
10 changed files with 54 additions and 48 deletions

View File

@@ -192,3 +192,8 @@ GameData::TerrainTag.register({
:battle_environment => :Puddle,
:shows_reflections => true
})
GameData::TerrainTag.register({
:id => :NoEffect,
:id_number => 17
})

View File

@@ -91,6 +91,8 @@ class PokeBattle_Move
def damagingMove?; return @category!=2; end
def statusMove?; return @category==2; end
def pbPriority(user); return @priority; end
def usableWhenAsleep?; return false; end
def unusableInGravity?; return false; end
def healingMove?; return false; end

View File

@@ -93,7 +93,7 @@ end
#===============================================================================
class PokeBattle_Move_086 < PokeBattle_Move
def pbBaseDamageMultiplier(damageMult,user,target)
damageMult *= 2 if !user.item
damageMult *= 2 if !user.item || user.effects[PBEffects::GemConsumed]
return damageMult
end
end
@@ -1107,6 +1107,7 @@ class PokeBattle_Move_0AD < PokeBattle_Move
def pbEffectAgainstTarget(user,target)
target.effects[PBEffects::BanefulBunker] = false
target.effects[PBEffects::KingsShield] = false
target.effects[PBEffects::Obstruct] = false
target.effects[PBEffects::Protect] = false
target.effects[PBEffects::SpikyShield] = false
target.pbOwnSide.effects[PBEffects::CraftyShield] = false
@@ -1336,54 +1337,36 @@ class PokeBattle_Move_0B3 < PokeBattle_Move
when :Psychic
@npMove = :PSYCHIC if GameData::Move.exists?(:PSYCHIC)
else
try_move = nil
case @battle.environment
when :Grass, :TallGrass, :Forest, :ForestGrass
if Settings::MECHANICS_GENERATION >= 6
@npMove = :ENERGYBALL if GameData::Move.exists?(:ENERGYBALL)
else
@npMove = :SEEDBOMB if GameData::Move.exists?(:SEEDBOMB)
end
try_move = (Settings::MECHANICS_GENERATION >= 6) ? :ENERGYBALL : :SEEDBOMB
when :MovingWater, :StillWater, :Underwater
@npMove = :HYDROPUMP if GameData::Move.exists?(:HYDROPUMP)
try_move = :HYDROPUMP
when :Puddle
@npMove = :MUDBOMB if GameData::Move.exists?(:MUDBOMB)
try_move = :MUDBOMB
when :Cave
if Settings::MECHANICS_GENERATION >= 6
@npMove = :POWERGEM if GameData::Move.exists?(:POWERGEM)
else
@npMove = :ROCKSLIDE if GameData::Move.exists?(:ROCKSLIDE)
end
when :Rock
if Settings::MECHANICS_GENERATION >= 6
@npMove = :EARTHPOWER if GameData::Move.exists?(:EARTHPOWER)
else
@npMove = :ROCKSLIDE if GameData::Move.exists?(:ROCKSLIDE)
end
when :Sand
if Settings::MECHANICS_GENERATION >= 6
@npMove = :EARTHPOWER if GameData::Move.exists?(:EARTHPOWER)
else
@npMove = :EARTHQUAKE if GameData::Move.exists?(:EARTHQUAKE)
end
try_move = (Settings::MECHANICS_GENERATION >= 6) ? :POWERGEM : :ROCKSLIDE
when :Rock, :Sand
try_move = (Settings::MECHANICS_GENERATION >= 6) ? :EARTHPOWER : :EARTHQUAKE
when :Snow
if Settings::MECHANICS_GENERATION >= 6
@npMove = :FROSTBREATH if GameData::Move.exists?(:FROSTBREATH)
else
@npMove = :BLIZZARD if GameData::Move.exists?(:BLIZZARD)
end
try_move = :BLIZZARD
try_move = :FROSTBREATH if Settings::MECHANICS_GENERATION == 6
try_move = :ICEBEAM if Settings::MECHANICS_GENERATION >= 7
when :Ice
@npMove = :ICEBEAM if GameData::Move.exists?(:ICEBEAM)
try_move = :ICEBEAM
when :Volcano
@npMove = :LAVAPLUME if GameData::Move.exists?(:LAVAPLUME)
try_move = :LAVAPLUME
when :Graveyard
@npMove = :SHADOWBALL if GameData::Move.exists?(:SHADOWBALL)
try_move = :SHADOWBALL
when :Sky
@npMove = :AIRSLASH if GameData::Move.exists?(:AIRSLASH)
try_move = :AIRSLASH
when :Space
@npMove = :DRACOMETEOR if GameData::Move.exists?(:DRACOMETEOR)
try_move = :DRACOMETEOR
when :UltraSpace
@npMove = :PSYSHOCK if GameData::Move.exists?(:PSYSHOCK)
try_move = :PSYSHOCK
end
@npMove = try_move if GameData::Move.exists?(try_move)
end
end
@@ -2227,6 +2210,7 @@ class PokeBattle_Move_0CD < PokeBattle_TwoTurnMove
def pbAttackingTurnEffect(user,target)
target.effects[PBEffects::BanefulBunker] = false
target.effects[PBEffects::KingsShield] = false
target.effects[PBEffects::Obstruct] = false
target.effects[PBEffects::Protect] = false
target.effects[PBEffects::SpikyShield] = false
target.pbOwnSide.effects[PBEffects::CraftyShield] = false

View File

@@ -1235,6 +1235,7 @@ class PokeBattle_Move_13B < PokeBattle_StatDownMove
def pbEffectAgainstTarget(user,target)
target.effects[PBEffects::BanefulBunker] = false
target.effects[PBEffects::KingsShield] = false
target.effects[PBEffects::Obstruct] = false
target.effects[PBEffects::Protect] = false
target.effects[PBEffects::SpikyShield] = false
target.pbOwnSide.effects[PBEffects::CraftyShield] = false
@@ -1543,6 +1544,7 @@ class PokeBattle_Move_147 < PokeBattle_Move
def pbEffectAgainstTarget(user,target)
target.effects[PBEffects::BanefulBunker] = false
target.effects[PBEffects::KingsShield] = false
target.effects[PBEffects::Obstruct] = false
target.effects[PBEffects::Protect] = false
target.effects[PBEffects::SpikyShield] = false
target.pbOwnSide.effects[PBEffects::CraftyShield] = false

View File

@@ -264,7 +264,7 @@ end
#===============================================================================
class PokeBattle_Move_180 < PokeBattle_Move
def pbBaseDamage(baseDmg, user, target)
baseDmg *= 2 if @battle.field.terrain == :Electric
baseDmg *= 2 if @battle.field.terrain == :Electric && target.affectedByTerrain?
return baseDmg
end
end
@@ -353,9 +353,9 @@ end
# If Grassy Terrain applies, priority is increased by 1. (Grassy Glide)
#===============================================================================
class PokeBattle_Move_185 < PokeBattle_Move
def priority
def pbPriority(user)
ret = super
ret += 1 if @battle.field.terrain == :Electric
ret += 1 if @battle.field.terrain == :Grass && user.affectedByTerrain?
return ret
end
end

View File

@@ -90,7 +90,7 @@ class PokeBattle_Battle
end
def pbGainExpOne(idxParty,defeatedBattler,numPartic,expShare,expAll,showMessages=true)
pkmn = pbParty(0)[idxParty] # The Pokémon gaining EVs from defeatedBattler
pkmn = pbParty(0)[idxParty] # The Pokémon gaining Exp from defeatedBattler
growth_rate = pkmn.growth_rate
# Don't bother calculating if gainer is already at max Exp
if pkmn.exp>=growth_rate.maximum_exp

View File

@@ -153,7 +153,7 @@ class PokeBattle_Battle
# Calculate move's priority
if @choices[b.index][0]==:UseMove
move = @choices[b.index][2]
pri = move.priority
pri = move.pbPriority(b)
if b.abilityActive?
pri = BattleHandlers.triggerPriorityChangeAbility(b.ability,b,move,pri)
end

View File

@@ -213,7 +213,7 @@ class PokeBattle_Battler
end
def pbHyperMode
return if fainted? || !shadowPokemon? || inHyperMode?
return if fainted? || !shadowPokemon? || inHyperMode? || !pbOwnedByPlayer?
p = self.pokemon
if @battle.pbRandom(p.heart_gauge) <= Pokemon::HEART_GAUGE_SIZE / 4
p.hyper_mode = true

View File

@@ -534,7 +534,7 @@ class PokemonSummary_Scene
overlay = @sprites["overlay"].bitmap
memo = ""
# Write nature
showNature = !@pokemon.shadowPokemon? || @pokemon.heartStage>3
showNature = !@pokemon.shadowPokemon? || @pokemon.heartStage <= 3
if showNature
natureName = @pokemon.nature.name
memo += _INTL("<c3=F83820,E09890>{1}<c3=404040,B0B0B0> nature.\n",natureName)

View File

@@ -204,11 +204,20 @@ class PokemonTilesetScene
break if pbConfirmMessage(_INTL("Exit from the editor?"))
elsif Input.trigger?(Input::USE)
selected = tile_ID_from_coordinates(@x, @y)
params = ChooseNumberParams.new
params.setRange(0, 99)
params.setDefaultValue(@tileset.terrain_tags[selected])
set_terrain_tag_for_tile_ID(selected, pbMessageChooseNumber(_INTL("Set the terrain tag."), params))
draw_overlay
old_tag = @tileset.terrain_tags[selected]
cmds = []
ids = []
old_idx = 0
GameData::TerrainTag.each do |tag|
old_idx = cmds.length if tag.id_number == old_tag
cmds.push("#{tag.id_number}: #{tag.real_name}")
ids.push(tag.id_number)
end
val = pbMessage(_INTL("\\l[1]\\ts[]Set the terrain tag."), cmds, -1, nil, old_idx)
if val >= 0 && val != old_tag
set_terrain_tag_for_tile_ID(selected, val)
draw_overlay
end
end
end
close_screen
@@ -220,7 +229,11 @@ end
#===============================================================================
def pbTilesetScreen
pbFadeOutIn {
Graphics.resize_screen(Settings::SCREEN_WIDTH, Settings::SCREEN_HEIGHT * 2)
pbSetResizeFactor(1)
scene = PokemonTilesetScene.new
scene.pbStartScene
Graphics.resize_screen(Settings::SCREEN_WIDTH, Settings::SCREEN_HEIGHT)
pbSetResizeFactor($PokemonSystem.screensize)
}
end