mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Minor tweaks
This commit is contained in:
@@ -101,7 +101,6 @@ class Battle
|
|||||||
end
|
end
|
||||||
@scene = scene
|
@scene = scene
|
||||||
@peer = Peer.new
|
@peer = Peer.new
|
||||||
@battleAI = AI.new(self)
|
|
||||||
@field = ActiveField.new # Whole field (gravity/rooms)
|
@field = ActiveField.new # Whole field (gravity/rooms)
|
||||||
@sides = [ActiveSide.new, # Player's side
|
@sides = [ActiveSide.new, # Player's side
|
||||||
ActiveSide.new] # Foe's side
|
ActiveSide.new] # Foe's side
|
||||||
@@ -171,6 +170,7 @@ class Battle
|
|||||||
end
|
end
|
||||||
@mega_rings = []
|
@mega_rings = []
|
||||||
GameData::Item.each { |item| @mega_rings.push(item.id) if item.has_flag?("MegaRing") }
|
GameData::Item.each { |item| @mega_rings.push(item.id) if item.has_flag?("MegaRing") }
|
||||||
|
@battleAI = AI.new(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ class Battle::Move
|
|||||||
attr_accessor :powerBoost
|
attr_accessor :powerBoost
|
||||||
attr_accessor :snatched
|
attr_accessor :snatched
|
||||||
|
|
||||||
|
CRITICAL_HIT_RATIOS = (Settings::NEW_CRITICAL_HIT_RATE_MECHANICS) ? [24, 8, 2, 1] : [16, 8, 4, 3, 2]
|
||||||
|
|
||||||
def to_int; return @id; end
|
def to_int; return @id; end
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|||||||
@@ -183,8 +183,6 @@ class Battle::Move
|
|||||||
# Returns whether the move will be a critical hit.
|
# Returns whether the move will be a critical hit.
|
||||||
def pbIsCritical?(user, target)
|
def pbIsCritical?(user, target)
|
||||||
return false if target.pbOwnSide.effects[PBEffects::LuckyChant] > 0
|
return false if target.pbOwnSide.effects[PBEffects::LuckyChant] > 0
|
||||||
# Set up the critical hit ratios
|
|
||||||
ratios = (Settings::NEW_CRITICAL_HIT_RATE_MECHANICS) ? [24, 8, 2, 1] : [16, 8, 4, 3, 2]
|
|
||||||
c = 0
|
c = 0
|
||||||
# Ability effects that alter critical hit rate
|
# Ability effects that alter critical hit rate
|
||||||
if c >= 0 && user.abilityActive?
|
if c >= 0 && user.abilityActive?
|
||||||
@@ -212,6 +210,8 @@ class Battle::Move
|
|||||||
c += 1 if highCriticalRate?
|
c += 1 if highCriticalRate?
|
||||||
c += user.effects[PBEffects::FocusEnergy]
|
c += user.effects[PBEffects::FocusEnergy]
|
||||||
c += 1 if user.inHyperMode? && @type == :SHADOW
|
c += 1 if user.inHyperMode? && @type == :SHADOW
|
||||||
|
# Set up the critical hit ratios
|
||||||
|
ratios = CRITICAL_HIT_RATIOS
|
||||||
c = ratios.length - 1 if c >= ratios.length
|
c = ratios.length - 1 if c >= ratios.length
|
||||||
# Calculation
|
# Calculation
|
||||||
return true if ratios[c] == 1
|
return true if ratios[c] == 1
|
||||||
|
|||||||
Reference in New Issue
Block a user