More or less standardised separator comments in the code

This commit is contained in:
Maruno17
2024-06-27 21:21:26 +01:00
parent 225549bfce
commit 509a414f37
198 changed files with 1907 additions and 1263 deletions

View File

@@ -1,3 +1,6 @@
#===============================================================================
#
#===============================================================================
class Battle::Move
attr_reader :battle
attr_reader :realMove
@@ -28,9 +31,10 @@ class Battle::Move
return @power
end
#=============================================================================
# Creating a move
#=============================================================================
#-----------------------------------------------------------------------------
# Creating a move.
#-----------------------------------------------------------------------------
def initialize(battle, move)
@battle = battle
@realMove = move
@@ -68,9 +72,10 @@ class Battle::Move
return Battle::Move::Unimplemented.new(battle, move)
end
#=============================================================================
# About the move
#=============================================================================
#-----------------------------------------------------------------------------
# About the move.
#-----------------------------------------------------------------------------
def pbTarget(_user); return GameData::Target.get(@target); end
def total_pp

View File

@@ -1,7 +1,11 @@
#===============================================================================
#
#===============================================================================
class Battle::Move
#=============================================================================
# Effect methods per move usage
#=============================================================================
#-----------------------------------------------------------------------------
# Effect methods per move usage.
#-----------------------------------------------------------------------------
def pbCanChooseMove?(user, commandPhase, showMessages); return true; end # For Belch
def pbDisplayChargeMessage(user); end # For Focus Punch/shell Trap/Beak Blast
def pbOnStartUse(user, targets); end
@@ -24,9 +28,10 @@ class Battle::Move
def pbShowFailMessages?(targets); return true; end
def pbMissMessage(user, target); return false; end
#=============================================================================
#-----------------------------------------------------------------------------
#
#=============================================================================
#-----------------------------------------------------------------------------
# Whether the move is currently in the "charging" turn of a two-turn move.
# Is false if Power Herb or another effect lets a two-turn move charge and
# attack in the same turn.
@@ -56,9 +61,10 @@ class Battle::Move
# For two-turn moves when they charge and attack in the same turn.
def pbQuickChargingMove(user, targets); end
#=============================================================================
# Effect methods per hit
#=============================================================================
#-----------------------------------------------------------------------------
# Effect methods per hit.
#-----------------------------------------------------------------------------
def pbOverrideSuccessCheckPerHit(user, target); return false; end
def pbCrashDamage(user); end
def pbInitialEffect(user, targets, hitNum); end
@@ -83,9 +89,10 @@ class Battle::Move
def pbSwitchOutTargetEffect(user, targets, numHits, switched_battlers); end
def pbEndOfMoveUsageEffect(user, targets, numHits, switchedBattlers); end
#=============================================================================
# Check if target is immune to the move because of its ability
#=============================================================================
#-----------------------------------------------------------------------------
# Check if target is immune to the move because of its ability.
#-----------------------------------------------------------------------------
def pbImmunityByAbility(user, target, show_message)
ret = false
if target.abilityActive? && !target.beingMoldBroken?
@@ -95,9 +102,10 @@ class Battle::Move
return ret
end
#=============================================================================
# Move failure checks
#=============================================================================
#-----------------------------------------------------------------------------
# Move failure checks.
#-----------------------------------------------------------------------------
# Check whether the move fails completely due to move-specific requirements.
def pbMoveFailed?(user, targets); return false; end
# Checks whether the move will be ineffective against the target.
@@ -156,9 +164,10 @@ class Battle::Move
return false
end
#=============================================================================
# Weaken the damage dealt (doesn't actually change a battler's HP)
#=============================================================================
#-----------------------------------------------------------------------------
# Weaken the damage dealt (doesn't actually change a battler's HP).
#-----------------------------------------------------------------------------
def pbCheckDamageAbsorption(user, target)
# Substitute will take the damage
if target.effects[PBEffects::Substitute] > 0 && !ignoresSubstitute?(user) &&
@@ -225,9 +234,10 @@ class Battle::Move
target.damageState.totalHPLost += damage
end
#=============================================================================
# Change the target's HP by the amount calculated above
#=============================================================================
#-----------------------------------------------------------------------------
# Change the target's HP by the amount calculated above.
#-----------------------------------------------------------------------------
def pbInflictHPDamage(target)
if target.damageState.substitute
target.effects[PBEffects::Substitute] -= target.damageState.hpLost
@@ -236,9 +246,10 @@ class Battle::Move
end
end
#=============================================================================
# Animate the damage dealt, including lowering the HP
#=============================================================================
#-----------------------------------------------------------------------------
# Animate the damage dealt, including lowering the HP.
#-----------------------------------------------------------------------------
# Animate being damaged and losing HP (by a move)
def pbAnimateHitAndHPLost(user, targets)
# Animate allies first, then foes
@@ -269,9 +280,10 @@ class Battle::Move
end
end
#=============================================================================
# Messages upon being hit
#=============================================================================
#-----------------------------------------------------------------------------
# Messages upon being hit.
#-----------------------------------------------------------------------------
def pbEffectivenessMessage(user, target, numTargets = 1)
return if self.is_a?(Battle::Move::FixedDamageMove)
return if target.damageState.disguise || target.damageState.iceFace

View File

@@ -1,7 +1,11 @@
#===============================================================================
#
#===============================================================================
class Battle::Move
#=============================================================================
# Move's type calculation
#=============================================================================
#-----------------------------------------------------------------------------
# Move's type calculation.
#-----------------------------------------------------------------------------
def pbBaseType(user)
ret = @type
if ret && user.abilityActive?
@@ -26,9 +30,10 @@ class Battle::Move
return ret
end
#=============================================================================
# Type effectiveness calculation
#=============================================================================
#-----------------------------------------------------------------------------
# Type effectiveness calculation.
#-----------------------------------------------------------------------------
def pbCalcTypeModSingle(moveType, defType, user, target)
ret = Effectiveness.calculate(moveType, defType)
if Effectiveness.ineffective_type?(moveType, defType)
@@ -78,9 +83,10 @@ class Battle::Move
return ret
end
#=============================================================================
# Accuracy check
#=============================================================================
#-----------------------------------------------------------------------------
# Accuracy check.
#-----------------------------------------------------------------------------
def pbBaseAccuracy(user, target); return @accuracy; end
# Accuracy calculations for one-hit KO moves are handled elsewhere.
@@ -166,9 +172,10 @@ class Battle::Move
modifiers[:evasion_stage] = 0 if user.hasActiveAbility?(:MINDSEYE)
end
#=============================================================================
# Critical hit check
#=============================================================================
#-----------------------------------------------------------------------------
# Critical hit check.
#-----------------------------------------------------------------------------
# Return values:
# -1: Never a critical hit.
# 0: Calculate normally.
@@ -220,9 +227,10 @@ class Battle::Move
return false
end
#=============================================================================
# Damage calculation
#=============================================================================
#-----------------------------------------------------------------------------
# Damage calculation.
#-----------------------------------------------------------------------------
def pbBaseDamage(baseDmg, user, target); return baseDmg; end
def pbBaseDamageMultiplier(damageMult, user, target); return damageMult; end
def pbModifyDamage(damageMult, user, target); return damageMult; end
@@ -505,9 +513,10 @@ class Battle::Move
multipliers[:final_damage_multiplier] = pbModifyDamage(multipliers[:final_damage_multiplier], user, target)
end
#=============================================================================
# Additional effect chance
#=============================================================================
#-----------------------------------------------------------------------------
# Additional effect chance.
#-----------------------------------------------------------------------------
def pbAdditionalEffectChance(user, target, effectChance = 0)
return 0 if target.hasActiveAbility?(:SHIELDDUST) && !target.beingMoldBroken?
ret = (effectChance > 0) ? effectChance : @addlEffect