Merge branch 'dev'

This commit is contained in:
Maruno17
2022-05-24 19:10:34 +01:00
14 changed files with 129 additions and 99 deletions

View File

@@ -152,7 +152,7 @@ module Console
# Text markup that turns text between them a certain color # Text markup that turns text between them a certain color
def markup_colors def markup_colors
{ {
"`" => :cyan, '"' => :purple, "'" => :purple, "$" => :green, "~" => :red "`" => :cyan, '"' => :purple, "==" => :purple, "$" => :green, "~" => :red
} }
end end

View File

@@ -651,7 +651,7 @@ module PluginManager
# try to run the code # try to run the code
begin begin
eval(code, TOPLEVEL_BINDING, fname) eval(code, TOPLEVEL_BINDING, fname)
Console.echoln_li "Loaded plugin: '#{name}' (ver. #{meta[:version]})" if !echoed_plugins.include?(name) Console.echoln_li "Loaded plugin: ==#{name}== (ver. #{meta[:version]})" if !echoed_plugins.include?(name)
echoed_plugins.push(name) echoed_plugins.push(name)
rescue Exception # format error message to display rescue Exception # format error message to display
self.pluginErrorMsg(name, sname) self.pluginErrorMsg(name, sname)

View File

@@ -517,6 +517,7 @@ class Game_Player < Game_Character
@pattern = p if !@lock_pattern @pattern = p if !@lock_pattern
@pattern_surf = p @pattern_surf = p
@bob_height = (p >= 2) ? 2 : 0 @bob_height = (p >= 2) ? 2 : 0
@anime_count = 0
else else
@bob_height = 0 @bob_height = 0
super super

View File

@@ -741,7 +741,7 @@ class Battle::Move::RaiseTargetAttack1 < Battle::Move
return false if damagingMove? return false if damagingMove?
failed = true failed = true
targets.each do |b| targets.each do |b|
next if b.pbCanRaiseStatStage?(:ATTACK, user, self) next if !b.pbCanRaiseStatStage?(:ATTACK, user, self)
failed = false failed = false
break break
end end

View File

@@ -463,7 +463,7 @@ class DayCare
day_care.reset_egg_counters day_care.reset_egg_counters
end end
def self.choose(text, choice_var) def self.choose(message, choice_var)
day_care = $PokemonGlobal.day_care day_care = $PokemonGlobal.day_care
case day_care.count case day_care.count
when 0 when 0
@@ -474,13 +474,13 @@ class DayCare
commands = [] commands = []
indices = [] indices = []
day_care.slots.each_with_index do |slot, i| day_care.slots.each_with_index do |slot, i|
text = slot.choice_text choice_text = slot.choice_text
next if !text next if !choice_text
commands.push(text) commands.push(choice_text)
indices.push(i) indices.push(i)
end end
commands.push(_INTL("CANCEL")) commands.push(_INTL("CANCEL"))
command = pbMessage(text, commands, commands.length) command = pbMessage(message, commands, commands.length)
$game_variables[choice_var] = (command == commands.length - 1) ? -1 : indices[command] $game_variables[choice_var] = (command == commands.length - 1) ? -1 : indices[command]
end end
end end

View File

@@ -1210,7 +1210,7 @@ ItemHandlers::UseOnPokemon.add(:ROTOMCATALOG, proc { |item, qty, pkmn, scene|
_INTL("Cancel") _INTL("Cancel")
] ]
new_form = scene.pbShowCommands(_INTL("Which appliance would you like to order?"), new_form = scene.pbShowCommands(_INTL("Which appliance would you like to order?"),
commands, pkmn.form) choices, pkmn.form)
if new_form == pkmn.form if new_form == pkmn.form
scene.pbDisplay(_INTL("It won't have any effect.")) scene.pbDisplay(_INTL("It won't have any effect."))
next false next false

View File

@@ -1009,7 +1009,7 @@ class Pokemon
# @param value [Integer] a value that may be used by the evolution method # @param value [Integer] a value that may be used by the evolution method
# @return [Symbol, nil] the ID of the species to evolve into # @return [Symbol, nil] the ID of the species to evolve into
def check_evolution_by_event(value = 0) def check_evolution_by_event(value = 0)
return check_evolution_internal { |pkmn, new_species, method, parameter, value| return check_evolution_internal { |pkmn, new_species, method, parameter|
success = GameData::Evolution.get(method).call_event(pkmn, parameter, value) success = GameData::Evolution.get(method).call_event(pkmn, parameter, value)
next (success) ? new_species : nil next (success) ? new_species : nil
} }

View File

@@ -383,11 +383,11 @@ class PokemonPartyPanel < SpriteWrapper
# Draw status # Draw status
status = -1 status = -1
if @pokemon.fainted? if @pokemon.fainted?
status = GameData::Status.count status = GameData::Status.count - 1
elsif @pokemon.status != :NONE elsif @pokemon.status != :NONE
status = GameData::Status.get(@pokemon.status).icon_position status = GameData::Status.get(@pokemon.status).icon_position
elsif @pokemon.pokerusStage == 1 elsif @pokemon.pokerusStage == 1
status = GameData::Status.count + 1 status = GameData::Status.count
end end
if status >= 0 if status >= 0
statusrect = Rect.new(0, 16 * status, 44, 16) statusrect = Rect.new(0, 16 * status, 44, 16)

View File

@@ -314,11 +314,11 @@ class PokemonSummary_Scene
# Show status/fainted/Pokérus infected icon # Show status/fainted/Pokérus infected icon
status = -1 status = -1
if @pokemon.fainted? if @pokemon.fainted?
status = GameData::Status.count status = GameData::Status.count - 1
elsif @pokemon.status != :NONE elsif @pokemon.status != :NONE
status = GameData::Status.get(@pokemon.status).icon_position status = GameData::Status.get(@pokemon.status).icon_position
elsif @pokemon.pokerusStage == 1 elsif @pokemon.pokerusStage == 1
status = GameData::Status.count + 1 status = GameData::Status.count
end end
if status >= 0 if status >= 0
imagepos.push(["Graphics/Pictures/statuses", 124, 100, 0, 16 * status, 44, 16]) imagepos.push(["Graphics/Pictures/statuses", 124, 100, 0, 16 * status, 44, 16])

View File

@@ -305,8 +305,8 @@ def pbUseKeyItem
:WATERFALL, :WHIRLPOOL] :WATERFALL, :WHIRLPOOL]
real_moves = [] real_moves = []
moves.each do |move| moves.each do |move|
$player.pokemon_party.each_with_index do |pkmn, i| $player.party.each_with_index do |pkmn, i|
next if !pkmn.hasMove?(move) next if pkmn.egg? || !pkmn.hasMove?(move)
real_moves.push([move, i]) if pbCanUseHiddenMove?(pkmn, move, false) real_moves.push([move, i]) if pbCanUseHiddenMove?(pkmn, move, false)
end end
end end

View File

@@ -56,9 +56,11 @@ def pbAddPokemon(pkmn, level = 1, see_form = true)
species_name = pkmn.speciesName species_name = pkmn.speciesName
pbMessage(_INTL("{1} obtained {2}!\\me[Pkmn get]\\wtnp[80]\1", $player.name, species_name)) pbMessage(_INTL("{1} obtained {2}!\\me[Pkmn get]\\wtnp[80]\1", $player.name, species_name))
was_owned = $player.owned?(pkmn.species) was_owned = $player.owned?(pkmn.species)
$player.pokedex.set_seen(pkmn.species)
$player.pokedex.set_owned(pkmn.species)
$player.pokedex.register(pkmn) if see_form $player.pokedex.register(pkmn) if see_form
# Show Pokédex entry for new species if it hasn't been owned before # Show Pokédex entry for new species if it hasn't been owned before
if Settings::SHOW_NEW_SPECIES_POKEDEX_ENTRY_MORE_OFTEN && !was_owned && $player.has_pokedex if Settings::SHOW_NEW_SPECIES_POKEDEX_ENTRY_MORE_OFTEN && see_form && !was_owned && $player.has_pokedex
pbMessage(_INTL("{1}'s data was added to the Pokédex.", species_name)) pbMessage(_INTL("{1}'s data was added to the Pokédex.", species_name))
$player.pokedex.register_last_seen(pkmn) $player.pokedex.register_last_seen(pkmn)
pbFadeOutIn { pbFadeOutIn {
@@ -75,8 +77,9 @@ end
def pbAddPokemonSilent(pkmn, level = 1, see_form = true) def pbAddPokemonSilent(pkmn, level = 1, see_form = true)
return false if !pkmn || pbBoxesFull? return false if !pkmn || pbBoxesFull?
pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon) pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon)
$player.pokedex.register(pkmn) if see_form $player.pokedex.set_seen(pkmn.species)
$player.pokedex.set_owned(pkmn.species) $player.pokedex.set_owned(pkmn.species)
$player.pokedex.register(pkmn) if see_form
pkmn.record_first_moves pkmn.record_first_moves
if $player.party_full? if $player.party_full?
$PokemonStorage.pbStoreCaught(pkmn) $PokemonStorage.pbStoreCaught(pkmn)
@@ -95,9 +98,11 @@ def pbAddToParty(pkmn, level = 1, see_form = true)
species_name = pkmn.speciesName species_name = pkmn.speciesName
pbMessage(_INTL("{1} obtained {2}!\\me[Pkmn get]\\wtnp[80]\1", $player.name, species_name)) pbMessage(_INTL("{1} obtained {2}!\\me[Pkmn get]\\wtnp[80]\1", $player.name, species_name))
was_owned = $player.owned?(pkmn.species) was_owned = $player.owned?(pkmn.species)
$player.pokedex.set_seen(pkmn.species)
$player.pokedex.set_owned(pkmn.species)
$player.pokedex.register(pkmn) if see_form $player.pokedex.register(pkmn) if see_form
# Show Pokédex entry for new species if it hasn't been owned before # Show Pokédex entry for new species if it hasn't been owned before
if Settings::SHOW_NEW_SPECIES_POKEDEX_ENTRY_MORE_OFTEN && !was_owned && $player.has_pokedex if Settings::SHOW_NEW_SPECIES_POKEDEX_ENTRY_MORE_OFTEN && see_form && !was_owned && $player.has_pokedex
pbMessage(_INTL("{1}'s data was added to the Pokédex.", species_name)) pbMessage(_INTL("{1}'s data was added to the Pokédex.", species_name))
$player.pokedex.register_last_seen(pkmn) $player.pokedex.register_last_seen(pkmn)
pbFadeOutIn { pbFadeOutIn {
@@ -133,10 +138,11 @@ def pbAddForeignPokemon(pkmn, level = 1, owner_name = nil, nickname = nil, owner
pbMessage(_INTL("\\me[Pkmn get]{1} received a Pokémon.\1", $player.name)) pbMessage(_INTL("\\me[Pkmn get]{1} received a Pokémon.\1", $player.name))
end end
was_owned = $player.owned?(pkmn.species) was_owned = $player.owned?(pkmn.species)
$player.pokedex.register(pkmn) if see_form $player.pokedex.set_seen(pkmn.species)
$player.pokedex.set_owned(pkmn.species) $player.pokedex.set_owned(pkmn.species)
$player.pokedex.register(pkmn) if see_form
# Show Pokédex entry for new species if it hasn't been owned before # Show Pokédex entry for new species if it hasn't been owned before
if Settings::SHOW_NEW_SPECIES_POKEDEX_ENTRY_MORE_OFTEN && !was_owned && $player.has_pokedex if Settings::SHOW_NEW_SPECIES_POKEDEX_ENTRY_MORE_OFTEN && see_form && !was_owned && $player.has_pokedex
pbMessage(_INTL("The Pokémon's data was added to the Pokédex.")) pbMessage(_INTL("The Pokémon's data was added to the Pokédex."))
$player.pokedex.register_last_seen(pkmn) $player.pokedex.register_last_seen(pkmn)
pbFadeOutIn { pbFadeOutIn {

View File

@@ -31,7 +31,10 @@ module Compiler
["pbEggGenerated?", "DayCare.egg_generated?"], ["pbEggGenerated?", "DayCare.egg_generated?"],
["pbDayCareGenerateEgg", "DayCare.collect_egg"], ["pbDayCareGenerateEgg", "DayCare.collect_egg"],
["get_character(0)", "get_self"], ["get_character(0)", "get_self"],
["get_character(-1)", "get_player"] ["get_character(-1)", "get_player"],
["pbCheckAble", "$player.has_other_able_pokemon?"],
["$PokemonTemp.lastbattle", "$game_temp.last_battle_record"],
["calcStats", "calc_stats"]
] ]
module_function module_function
@@ -905,12 +908,33 @@ module Compiler
return ret return ret
end end
# Splits the given code string into an array of parameters (all strings),
# using "," as the delimiter. It will not split in the middle of a string
# parameter. Used to extract parameters from a script call in an event.
def split_string_with_quotes(str)
ret = []
new_str = ""
in_msg = false
str.scan(/./) do |s|
if s == "," && !in_msg
ret.push(new_str.strip)
new_str = ""
else
in_msg = !in_msg if s == "\""
new_str += s
end
end
new_str.strip!
ret.push(new_str) if !new_str.empty?
return ret
end
def replace_old_battle_scripts(event, list, index) def replace_old_battle_scripts(event, list, index)
changed = false changed = false
script = list[index].parameters[1] script = list[index].parameters[1]
if script[/^\s*pbWildBattle\((.+)\)\s*$/] if script[/^\s*pbWildBattle\((.+)\)\s*$/]
battle_params = $1.split(",") battle_params = split_string_with_quotes($1) # Split on commas
list[index].parameters[1] = sprintf("WildBattle.start(#{battle_params[0].strip}, #{battle_params[1].strip})") list[index].parameters[1] = sprintf("WildBattle.start(#{battle_params[0]}, #{battle_params[1]})")
old_indent = list[index].indent old_indent = list[index].indent
new_events = [] new_events = []
if battle_params[3] && battle_params[3][/false/] if battle_params[3] && battle_params[3][/false/]
@@ -919,15 +943,15 @@ module Compiler
if battle_params[4] && battle_params[4][/true/] if battle_params[4] && battle_params[4][/true/]
push_script(new_events, "setBattleRule(\"canLose\")", old_indent) push_script(new_events, "setBattleRule(\"canLose\")", old_indent)
end end
if battle_params[2] && battle_params[2].strip != "1" if battle_params[2] && battle_params[2] != "1"
push_script(new_events, "setBattleRule(\"outcome\", #{battle_params[2].strip})", old_indent) push_script(new_events, "setBattleRule(\"outcome\", #{battle_params[2]})", old_indent)
end end
list[index, 0] = new_events if new_events.length > 0 list[index, 0] = new_events if new_events.length > 0
changed = true changed = true
elsif script[/^\s*pbDoubleWildBattle\((.+)\)\s*$/] elsif script[/^\s*pbDoubleWildBattle\((.+)\)\s*$/]
battle_params = $1.split(",") battle_params = split_string_with_quotes($1) # Split on commas
pkmn1 = "#{battle_params[0].strip}, #{battle_params[1].strip}" pkmn1 = "#{battle_params[0]}, #{battle_params[1]}"
pkmn2 = "#{battle_params[2].strip}, #{battle_params[3].strip}" pkmn2 = "#{battle_params[2]}, #{battle_params[3]}"
list[index].parameters[1] = sprintf("WildBattle.start(#{pkmn1}, #{pkmn2})") list[index].parameters[1] = sprintf("WildBattle.start(#{pkmn1}, #{pkmn2})")
old_indent = list[index].indent old_indent = list[index].indent
new_events = [] new_events = []
@@ -937,16 +961,16 @@ module Compiler
if battle_params[4] && battle_params[6][/true/] if battle_params[4] && battle_params[6][/true/]
push_script(new_events, "setBattleRule(\"canLose\")", old_indent) push_script(new_events, "setBattleRule(\"canLose\")", old_indent)
end end
if battle_params[2] && battle_params[4].strip != "1" if battle_params[2] && battle_params[4] != "1"
push_script(new_events, "setBattleRule(\"outcome\", #{battle_params[4].strip})", old_indent) push_script(new_events, "setBattleRule(\"outcome\", #{battle_params[4]})", old_indent)
end end
list[index, 0] = new_events if new_events.length > 0 list[index, 0] = new_events if new_events.length > 0
changed = true changed = true
elsif script[/^\s*pbTripleWildBattle\((.+)\)\s*$/] elsif script[/^\s*pbTripleWildBattle\((.+)\)\s*$/]
battle_params = $1.split(",") battle_params = split_string_with_quotes($1) # Split on commas
pkmn1 = "#{battle_params[0].strip}, #{battle_params[1].strip}" pkmn1 = "#{battle_params[0]}, #{battle_params[1]}"
pkmn2 = "#{battle_params[2].strip}, #{battle_params[3].strip}" pkmn2 = "#{battle_params[2]}, #{battle_params[3]}"
pkmn3 = "#{battle_params[4].strip}, #{battle_params[5].strip}" pkmn3 = "#{battle_params[4]}, #{battle_params[5]}"
list[index].parameters[1] = sprintf("WildBattle.start(#{pkmn1}, #{pkmn2}, #{pkmn3})") list[index].parameters[1] = sprintf("WildBattle.start(#{pkmn1}, #{pkmn2}, #{pkmn3})")
old_indent = list[index].indent old_indent = list[index].indent
new_events = [] new_events = []
@@ -956,22 +980,26 @@ module Compiler
if battle_params[4] && battle_params[8][/true/] if battle_params[4] && battle_params[8][/true/]
push_script(new_events, "setBattleRule(\"canLose\")", old_indent) push_script(new_events, "setBattleRule(\"canLose\")", old_indent)
end end
if battle_params[2] && battle_params[6].strip != "1" if battle_params[2] && battle_params[6] != "1"
push_script(new_events, "setBattleRule(\"outcome\", #{battle_params[6].strip})", old_indent) push_script(new_events, "setBattleRule(\"outcome\", #{battle_params[6]})", old_indent)
end end
list[index, 0] = new_events if new_events.length > 0 list[index, 0] = new_events if new_events.length > 0
changed = true changed = true
elsif script[/^\s*pbTrainerBattle\((.+)\)\s*$/] elsif script[/^\s*pbTrainerBattle\((.+)\)\s*$/]
battle_params = $1.split(",") echoln ""
trainer1 = "#{battle_params[0].strip}, #{battle_params[1].strip}" echoln $1
trainer1 += ", #{battle_params[4].strip}" if battle_params[4] && battle_params[4].strip != "nil" battle_params = split_string_with_quotes($1) # Split on commas
echoln battle_params
trainer1 = "#{battle_params[0]}, #{battle_params[1]}"
trainer1 += ", #{battle_params[4]}" if battle_params[4] && battle_params[4] != "nil"
list[index].parameters[1] = "TrainerBattle.start(#{trainer1})" list[index].parameters[1] = "TrainerBattle.start(#{trainer1})"
old_indent = list[index].indent old_indent = list[index].indent
new_events = [] new_events = []
if battle_params[2] && !battle_params[2].strip.empty? && battle_params[2].strip != "nil" if battle_params[2] && !battle_params[2].empty? && battle_params[2] != "nil"
speech = battle_params[2].gsub(/^\s*_I\(\s*"\s*/, "") echoln battle_params[2]
speech.gsub!(/\"\s*\)\s*$/, "").strip speech = battle_params[2].gsub(/^\s*_I\(\s*"\s*/, "").gsub(/\"\s*\)\s*$/, "")
push_comment(new_events, "EndSpeech: #{speech}", old_indent) echoln speech
push_comment(new_events, "EndSpeech: #{speech.strip}", old_indent)
end end
if battle_params[3] && battle_params[3][/true/] if battle_params[3] && battle_params[3][/true/]
push_script(new_events, "setBattleRule(\"double\")", old_indent) push_script(new_events, "setBattleRule(\"double\")", old_indent)
@@ -979,69 +1007,64 @@ module Compiler
if battle_params[5] && battle_params[5][/true/] if battle_params[5] && battle_params[5][/true/]
push_script(new_events, "setBattleRule(\"canLose\")", old_indent) push_script(new_events, "setBattleRule(\"canLose\")", old_indent)
end end
if battle_params[6] && battle_params[6].strip != "1" if battle_params[6] && battle_params[6] != "1"
push_script(new_events, "setBattleRule(\"outcome\", #{battle_params[6].strip})", old_indent) push_script(new_events, "setBattleRule(\"outcome\", #{battle_params[6]})", old_indent)
end end
list[index, 0] = new_events if new_events.length > 0 list[index, 0] = new_events if new_events.length > 0
changed = true changed = true
elsif script[/^\s*pbDoubleTrainerBattle\((.+)\)\s*$/] elsif script[/^\s*pbDoubleTrainerBattle\((.+)\)\s*$/]
battle_params = $1.split(",") battle_params = split_string_with_quotes($1) # Split on commas
trainer1 = "#{battle_params[0].strip}, #{battle_params[1].strip}" trainer1 = "#{battle_params[0]}, #{battle_params[1]}"
trainer1 += ", #{battle_params[2].strip}" if battle_params[2] && battle_params[2].strip != "nil" trainer1 += ", #{battle_params[2]}" if battle_params[2] && battle_params[2] != "nil"
trainer2 = "#{battle_params[4].strip}, #{battle_params[5].strip}" trainer2 = "#{battle_params[4]}, #{battle_params[5]}"
trainer2 += ", #{battle_params[6].strip}" if battle_params[6] && battle_params[6].strip != "nil" trainer2 += ", #{battle_params[6]}" if battle_params[6] && battle_params[6] != "nil"
list[index].parameters[1] = "TrainerBattle.start(#{trainer1}, #{trainer2})" list[index].parameters[1] = "TrainerBattle.start(#{trainer1}, #{trainer2})"
old_indent = list[index].indent old_indent = list[index].indent
new_events = [] new_events = []
if battle_params[3] && !battle_params[3].strip.empty? && battle_params[3].strip != "nil" if battle_params[3] && !battle_params[3].empty? && battle_params[3] != "nil"
speech = battle_params[3].gsub(/^\s*_I\(\s*"\s*/, "") speech = battle_params[3].gsub(/^\s*_I\(\s*"\s*/, "").gsub(/\"\s*\)\s*$/, "")
speech.gsub!(/\"\s*\)\s*$/, "").strip push_comment(new_events, "EndSpeech1: #{speech.strip}", old_indent)
push_comment(new_events, "EndSpeech1: #{speech}", old_indent)
end end
if battle_params[7] && !battle_params[7].strip.empty? && battle_params[7].strip != "nil" if battle_params[7] && !battle_params[7].empty? && battle_params[7] != "nil"
speech = battle_params[7].gsub(/^\s*_I\(\s*"\s*/, "") speech = battle_params[7].gsub(/^\s*_I\(\s*"\s*/, "").gsub(/\"\s*\)\s*$/, "")
speech.gsub!(/\"\s*\)\s*$/, "").strip push_comment(new_events, "EndSpeech2: #{speech.strip}", old_indent)
push_comment(new_events, "EndSpeech2: #{speech}", old_indent)
end end
if battle_params[8] && battle_params[8][/true/] if battle_params[8] && battle_params[8][/true/]
push_script(new_events, "setBattleRule(\"canLose\")", old_indent) push_script(new_events, "setBattleRule(\"canLose\")", old_indent)
end end
if battle_params[9] && battle_params[9].strip != "1" if battle_params[9] && battle_params[9] != "1"
push_script(new_events, "setBattleRule(\"outcome\", #{battle_params[9].strip})", old_indent) push_script(new_events, "setBattleRule(\"outcome\", #{battle_params[9]})", old_indent)
end end
list[index, 0] = new_events if new_events.length > 0 list[index, 0] = new_events if new_events.length > 0
changed = true changed = true
elsif script[/^\s*pbTripleTrainerBattle\((.+)\)\s*$/] elsif script[/^\s*pbTripleTrainerBattle\((.+)\)\s*$/]
battle_params = $1.split(",") battle_params = split_string_with_quotes($1) # Split on commas
trainer1 = "#{battle_params[0].strip}, #{battle_params[1].strip}" trainer1 = "#{battle_params[0]}, #{battle_params[1]}"
trainer1 += ", #{battle_params[2].strip}" if battle_params[2] && battle_params[2].strip != "nil" trainer1 += ", #{battle_params[2]}" if battle_params[2] && battle_params[2] != "nil"
trainer2 = "#{battle_params[4].strip}, #{battle_params[5].strip}" trainer2 = "#{battle_params[4]}, #{battle_params[5]}"
trainer2 += ", #{battle_params[6].strip}" if battle_params[6] && battle_params[6].strip != "nil" trainer2 += ", #{battle_params[6]}" if battle_params[6] && battle_params[6] != "nil"
trainer3 = "#{battle_params[8].strip}, #{battle_params[9].strip}" trainer3 = "#{battle_params[8]}, #{battle_params[9]}"
trainer3 += ", #{battle_params[10].strip}" if battle_params[10] && battle_params[10].strip != "nil" trainer3 += ", #{battle_params[10]}" if battle_params[10] && battle_params[10] != "nil"
list[index].parameters[1] = "TrainerBattle.start(#{trainer1}, #{trainer2}, #{trainer3})" list[index].parameters[1] = "TrainerBattle.start(#{trainer1}, #{trainer2}, #{trainer3})"
old_indent = list[index].indent old_indent = list[index].indent
new_events = [] new_events = []
if battle_params[3] && !battle_params[3].strip.empty? && battle_params[3].strip != "nil" if battle_params[3] && !battle_params[3].empty? && battle_params[3] != "nil"
speech = battle_params[3].gsub(/^\s*_I\(\s*"\s*/, "") speech = battle_params[3].gsub(/^\s*_I\(\s*"\s*/, "").gsub(/\"\s*\)\s*$/, "")
speech.gsub!(/\"\s*\)\s*$/, "").strip push_comment(new_events, "EndSpeech1: #{speech.strip}", old_indent)
push_comment(new_events, "EndSpeech1: #{speech}", old_indent)
end end
if battle_params[7] && !battle_params[7].strip.empty? && battle_params[7].strip != "nil" if battle_params[7] && !battle_params[7].empty? && battle_params[7] != "nil"
speech = battle_params[7].gsub(/^\s*_I\(\s*"\s*/, "") speech = battle_params[7].gsub(/^\s*_I\(\s*"\s*/, "").gsub(/\"\s*\)\s*$/, "")
speech.gsub!(/\"\s*\)\s*$/, "").strip push_comment(new_events, "EndSpeech2: #{speech.strip}", old_indent)
push_comment(new_events, "EndSpeech2: #{speech}", old_indent)
end end
if battle_params[7] && !battle_params[7].strip.empty? && battle_params[11].strip != "nil" if battle_params[7] && !battle_params[7].empty? && battle_params[11] != "nil"
speech = battle_params[11].gsub(/^\s*_I\(\s*"\s*/, "") speech = battle_params[11].gsub(/^\s*_I\(\s*"\s*/, "").gsub(/\"\s*\)\s*$/, "")
speech.gsub!(/\"\s*\)\s*$/, "").strip push_comment(new_events, "EndSpeech3: #{speech.strip}", old_indent)
push_comment(new_events, "EndSpeech3: #{speech}", old_indent)
end end
if battle_params[12] && battle_params[12][/true/] if battle_params[12] && battle_params[12][/true/]
push_script(new_events, "setBattleRule(\"canLose\")", old_indent) push_script(new_events, "setBattleRule(\"canLose\")", old_indent)
end end
if battle_params[13] && battle_params[13].strip != "1" if battle_params[13] && battle_params[13] != "1"
push_script(new_events, "setBattleRule(\"outcome\", #{battle_params[13].strip})", old_indent) push_script(new_events, "setBattleRule(\"outcome\", #{battle_params[13]})", old_indent)
end end
list[index, 0] = new_events if new_events.length > 0 list[index, 0] = new_events if new_events.length > 0
changed = true changed = true

View File

@@ -314,88 +314,88 @@ Name = Gym Leader
Gender = Male Gender = Male
BaseMoney = 100 BaseMoney = 100
BattleBGM = Battle Gym Leader BattleBGM = Battle Gym Leader
VictoryME = Battle victory leader VictoryBGM = Battle victory leader
#------------------------------- #-------------------------------
[LEADER_Misty] [LEADER_Misty]
Name = Gym Leader Name = Gym Leader
Gender = Female Gender = Female
BaseMoney = 100 BaseMoney = 100
BattleBGM = Battle Gym Leader BattleBGM = Battle Gym Leader
VictoryME = Battle victory leader VictoryBGM = Battle victory leader
#------------------------------- #-------------------------------
[LEADER_Surge] [LEADER_Surge]
Name = Gym Leader Name = Gym Leader
Gender = Male Gender = Male
BaseMoney = 100 BaseMoney = 100
BattleBGM = Battle Gym Leader BattleBGM = Battle Gym Leader
VictoryME = Battle victory leader VictoryBGM = Battle victory leader
#------------------------------- #-------------------------------
[LEADER_Erika] [LEADER_Erika]
Name = Gym Leader Name = Gym Leader
Gender = Female Gender = Female
BaseMoney = 100 BaseMoney = 100
BattleBGM = Battle Gym Leader BattleBGM = Battle Gym Leader
VictoryME = Battle victory leader VictoryBGM = Battle victory leader
#------------------------------- #-------------------------------
[LEADER_Koga] [LEADER_Koga]
Name = Gym Leader Name = Gym Leader
Gender = Male Gender = Male
BaseMoney = 100 BaseMoney = 100
BattleBGM = Battle Gym Leader BattleBGM = Battle Gym Leader
VictoryME = Battle victory leader VictoryBGM = Battle victory leader
#------------------------------- #-------------------------------
[LEADER_Sabrina] [LEADER_Sabrina]
Name = Gym Leader Name = Gym Leader
Gender = Female Gender = Female
BaseMoney = 100 BaseMoney = 100
BattleBGM = Battle Gym Leader BattleBGM = Battle Gym Leader
VictoryME = Battle victory leader VictoryBGM = Battle victory leader
#------------------------------- #-------------------------------
[LEADER_Blaine] [LEADER_Blaine]
Name = Gym Leader Name = Gym Leader
Gender = Male Gender = Male
BaseMoney = 100 BaseMoney = 100
BattleBGM = Battle Gym Leader BattleBGM = Battle Gym Leader
VictoryME = Battle victory leader VictoryBGM = Battle victory leader
#------------------------------- #-------------------------------
[LEADER_Giovanni] [LEADER_Giovanni]
Name = Gym Leader Name = Gym Leader
Gender = Male Gender = Male
BaseMoney = 100 BaseMoney = 100
BattleBGM = Battle Gym Leader BattleBGM = Battle Gym Leader
VictoryME = Battle victory leader VictoryBGM = Battle victory leader
#------------------------------- #-------------------------------
[ELITEFOUR_Lorelei] [ELITEFOUR_Lorelei]
Name = Elite Four Name = Elite Four
Gender = Female Gender = Female
BaseMoney = 100 BaseMoney = 100
BattleBGM = Battle Elite BattleBGM = Battle Elite
VictoryME = Battle victory leader VictoryBGM = Battle victory leader
#------------------------------- #-------------------------------
[ELITEFOUR_Bruno] [ELITEFOUR_Bruno]
Name = Elite Four Name = Elite Four
Gender = Male Gender = Male
BaseMoney = 100 BaseMoney = 100
BattleBGM = Battle Elite BattleBGM = Battle Elite
VictoryME = Battle victory leader VictoryBGM = Battle victory leader
#------------------------------- #-------------------------------
[ELITEFOUR_Agatha] [ELITEFOUR_Agatha]
Name = Elite Four Name = Elite Four
Gender = Female Gender = Female
BaseMoney = 100 BaseMoney = 100
BattleBGM = Battle Elite BattleBGM = Battle Elite
VictoryME = Battle victory leader VictoryBGM = Battle victory leader
#------------------------------- #-------------------------------
[ELITEFOUR_Lance] [ELITEFOUR_Lance]
Name = Elite Four Name = Elite Four
Gender = Male Gender = Male
BaseMoney = 100 BaseMoney = 100
BattleBGM = Battle Elite BattleBGM = Battle Elite
VictoryME = Battle victory leader VictoryBGM = Battle victory leader
#------------------------------- #-------------------------------
[CHAMPION] [CHAMPION]
Name = Champion Name = Champion
Gender = Male Gender = Male
BaseMoney = 100 BaseMoney = 100
BattleBGM = Battle Champion BattleBGM = Battle Champion
VictoryME = Battle victory leader VictoryBGM = Battle victory leader

View File

@@ -1,14 +1,14 @@
# Pokémon Essentials # Pokémon Essentials
Based on Essentials v19. Based on Essentials v20.
You can build your fangame on top of a fork of this repository. Doing so will let you update your fangame with improvements made to this repo as soon as they are made. You can build your fangame on top of a fork of this repository. Doing so will let you update your fangame with improvements made to this repo as soon as they are made.
## Usage ## Usage
1. Fork this repo. 1. Fork this repo.
2. Get a copy of Essentials v19 (a download link cannot be provided here). 2. Get a copy of Essentials v20 (a download link cannot be provided here).
3. Clone your forked repo into the Essentials v19 folder, replacing the existing files with the ones from the repo. 3. Clone your forked repo into the Essentials v20 folder, replacing the existing files with the ones from the repo.
From here, you can edit this project to turn it into your fangame/develop mods. When this repo is updated, you can pull the changes to update your fork and get the updates into your fangame/modding environment. From here, you can edit this project to turn it into your fangame/develop mods. When this repo is updated, you can pull the changes to update your fork and get the updates into your fangame/modding environment.