Added effects of Ripen/Gorilla Tactics/Steam Engine, fixed SE move-weakening berries working on normal effectiveness moves as well

This commit is contained in:
Maruno17
2021-08-07 20:56:43 +01:00
parent 61242a9836
commit c360c4ddd2
7 changed files with 140 additions and 53 deletions

View File

@@ -145,7 +145,7 @@ class PokeBattle_Battler
# permanent is whether the item is lost even after battle. Is false for Knock
# Off.
def pbRemoveItem(permanent = true)
@effects[PBEffects::ChoiceBand] = nil
@effects[PBEffects::ChoiceBand] = nil if ability_id != :GORILLATACTICS
@effects[PBEffects::Unburden] = true if self.item
setInitialItem(nil) if permanent && self.item == self.initialItem
self.item = nil

View File

@@ -108,7 +108,8 @@ class PokeBattle_Battler
def pbEndTurn(_choice)
@lastRoundMoved = @battle.turnCount # Done something this round
if !@effects[PBEffects::ChoiceBand] &&
hasActiveItem?([:CHOICEBAND,:CHOICESPECS,:CHOICESCARF])
(hasActiveItem?([:CHOICEBAND,:CHOICESPECS,:CHOICESCARF]) ||
hasActiveAbility?(:GORILLATACTICS))
if @lastMoveUsed && pbHasMove?(@lastMoveUsed)
@effects[PBEffects::ChoiceBand] = @lastMoveUsed
elsif @lastRegularMoveUsed && pbHasMove?(@lastRegularMoveUsed)
@@ -726,6 +727,17 @@ class PokeBattle_Battler
@battle.pbDisplay(_INTL("The {1} weakened the damage to {2}!",b.itemName,b.pbThis(true)))
b.pbConsumeItem
end
# Steam Engine (goes here because it should be after stat changes caused by
# the move)
if [:FIRE, :WATER].include?(move.calcType)
targets.each do |b|
next if b.damageState.unaffected
next if b.damageState.calcDamage == 0 || b.damageState.substitute
next if !b.hasActiveAbility?(:STEAMENGINE)
b.pbRaiseStatStageByAbility(:SPEED, 6, b) if b.pbCanRaiseStatStage?(:SPEED, b)
end
end
# Fainting
targets.each { |b| b.pbFaint if b && b.fainted? }
user.pbFaint if user.fainted?
return true

View File

@@ -40,20 +40,22 @@ class PokeBattle_Battler
end
return false
end
# Choice Band
if @effects[PBEffects::ChoiceBand]
if hasActiveItem?([:CHOICEBAND,:CHOICESPECS,:CHOICESCARF]) &&
pbHasMove?(@effects[PBEffects::ChoiceBand])
if move.id!=@effects[PBEffects::ChoiceBand]
if showMessages
msg = _INTL("{1} allows the use of only {2}!",itemName,
GameData::Move.get(@effects[PBEffects::ChoiceBand]).name)
(commandPhase) ? @battle.pbDisplayPaused(msg) : @battle.pbDisplay(msg)
end
return false
# Choice Band/Gorilla Tactics
@effects[PBEffects::ChoiceBand] = nil if !pbHasMove?(@effects[PBEffects::ChoiceBand])
if @effects[PBEffects::ChoiceBand] && move.id != @effects[PBEffects::ChoiceBand]
choiced_move_name = GameData::Move.get(@effects[PBEffects::ChoiceBand]).name
if hasActiveItem?([:CHOICEBAND, :CHOICESPECS, :CHOICESCARF])
if showMessages
msg = _INTL("The {1} only allows the use of {2}!",itemName, choiced_move_name)
(commandPhase) ? @battle.pbDisplayPaused(msg) : @battle.pbDisplay(msg)
end
else
@effects[PBEffects::ChoiceBand] = nil
return false
elsif hasActiveAbility?(:GORILLATACTICS)
if showMessages
msg = _INTL("{1} can only use {2}!", pbThis, choiced_move_name)
(commandPhase) ? @battle.pbDisplayPaused(msg) : @battle.pbDisplay(msg)
end
return false
end
end
# Taunt