Merge branch 'dev' into dev-gen8

This commit is contained in:
Maruno17
2021-07-01 21:59:47 +01:00
9 changed files with 1585 additions and 1787 deletions

View File

@@ -27,7 +27,7 @@ module GameData
"Target" => [:target, "e", :Target],
"Priority" => [:priority, "i"],
"FunctionCode" => [:function_code, "s"],
"Flags" => [:flags, "s"],
"Flags" => [:flags, "*s"],
"EffectChance" => [:effect_chance, "u"],
"Description" => [:description, "q"]
}
@@ -46,7 +46,8 @@ module GameData
@target = hash[:target] || :None
@priority = hash[:priority] || 0
@function_code = hash[:function_code] || "000"
@flags = hash[:flags] || ""
@flags = hash[:flags] || []
@flags = [@flags] if !@flags.is_a?(Array)
@effect_chance = hash[:effect_chance] || 0
@real_description = hash[:description] || "???"
end

View File

@@ -38,7 +38,7 @@ class PokeBattle_Move
@addlEffect = move.effect_chance
@target = move.target
@priority = move.priority
@flags = move.flags
@flags = move.flags.clone
@calcType = nil
@powerBoost = false # For Aerilate, Pixilate, Refrigerate, Galvanize
@snatched = false
@@ -114,18 +114,18 @@ class PokeBattle_Move
def canSnatch?; return false; end
def canMagicCoat?; return false; end
def contactMove?; return @flags[/a/]; end
def canProtectAgainst?; return @flags[/b/]; end
def canMirrorMove?; return @flags[/e/]; end
def thawsUser?; return @flags[/g/]; end
def highCriticalRate?; return @flags[/h/]; end
def bitingMove?; return @flags[/i/]; end
def punchingMove?; return @flags[/j/]; end
def soundMove?; return @flags[/k/]; end
def powderMove?; return @flags[/l/]; end
def pulseMove?; return @flags[/m/]; end
def bombMove?; return @flags[/n/]; end
def danceMove?; return @flags[/o/]; end
def contactMove?; return @flags.any? { |f| f[/^Contact$/i] }; end
def canProtectAgainst?; return @flags.any? { |f| f[/^CanProtect$/i] }; end
def canMirrorMove?; return @flags.any? { |f| f[/^CanMirrorMove$/i] }; end
def thawsUser?; return @flags.any? { |f| f[/^ThawsUser$/i] }; end
def highCriticalRate?; return @flags.any? { |f| f[/^HighCriticalHitRate$/i] }; end
def bitingMove?; return @flags.any? { |f| f[/^Biting$/i] }; end
def punchingMove?; return @flags.any? { |f| f[/^Punching$/i] }; end
def soundMove?; return @flags.any? { |f| f[/^Sound$/i] }; end
def powderMove?; return @flags.any? { |f| f[/^Powder$/i] }; end
def pulseMove?; return @flags.any? { |f| f[/^Pulse$/i] }; end
def bombMove?; return @flags.any? { |f| f[/^Bomb$/i] }; end
def danceMove?; return @flags.any? { |f| f[/^Dance$/i] }; end
# Causes perfect accuracy (param=1) and double damage (param=2).
def tramplesMinimize?(_param=1); return false; end

View File

@@ -1127,7 +1127,7 @@ class PokeBattle_Move_0AE < PokeBattle_Move
def pbFailsAgainstTarget?(user,target)
if !target.lastRegularMoveUsed ||
!GameData::Move.get(target.lastRegularMoveUsed).flags[/e/] # Not copyable by Mirror Move
!GameData::Move.get(target.lastRegularMoveUsed).flags.any? { |f| f[/^CanMirrorMove$/i] }
@battle.pbDisplay(_INTL("The mirror move failed!"))
return true
end

View File

@@ -1742,7 +1742,7 @@ class PokeBattle_AI
score -= 40
if skill>=PBTrainerAI.highSkill
score -= 100 if !target.lastRegularMoveUsed ||
!GameData::Move.get(target.lastRegularMoveUsed).flags[/e/] # Not copyable by Mirror Move
!GameData::Move.get(target.lastRegularMoveUsed).flags.any? { |f| f[/^CanMirrorMove$/i] }
end
#---------------------------------------------------------------------------
when "0AF"

View File

@@ -351,6 +351,19 @@ module Compiler
print _INTL("Warning: Move {1} was defined as Physical or Special but had a base damage of 0. Changing it to a Status move.\r\n{2}", line[2], FileLineData.linereport)
line[6] = 2
end
flags = []
flags.push("Contact") if line[12][/a/]
flags.push("CanProtect") if line[12][/b/]
flags.push("CanMirrorMove") if line[12][/e/]
flags.push("ThawsUser") if line[12][/g/]
flags.push("HighCriticalHitRate") if line[12][/h/]
flags.push("Bite") if line[12][/i/]
flags.push("Punch") if line[12][/j/]
flags.push("Sound") if line[12][/k/]
flags.push("Powder") if line[12][/l/]
flags.push("Pulse") if line[12][/m/]
flags.push("Bomb") if line[12][/n/]
flags.push("Dance") if line[12][/o/]
# Construct move hash
move_hash = {
:id => move_id,
@@ -364,7 +377,7 @@ module Compiler
:effect_chance => line[9],
:target => line[10],
:priority => line[11],
:flags => line[12],
:flags => flags,
:description => line[13]
}
# Add move's data to records

View File

@@ -188,7 +188,7 @@ module Compiler
f.write("Target = #{move.target}\r\n")
f.write("Priority = #{move.priority}\r\n") if move.priority != 0
f.write("FunctionCode = #{move.function_code}\r\n")
f.write("Flags = #{move.flags}\r\n") if !nil_or_empty?(move.flags)
f.write("Flags = #{move.flags.join(",")}\r\n") if move.flags && move.flags.length > 0
f.write("EffectChance = #{move.effect_chance}\r\n") if move.effect_chance > 0
f.write("Description = #{move.real_description}\r\n")
end

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff