# Z-Systems by: Zetu #
#===========================#======================#===========================#
# * * * CORE v1.01 * * * #
#=#==========================================================================#=#
# For Z01 to Z07+ #
# * Make sure ALL Z items are in order and adjacent to each other, with #
# this script preceeding them. #
#--------------------------------------------------------------------------#
# General Methods : #
# Object #
# rand_range(min, max) #
# Give a random value between the two given values. #
# Array #
# random #
# Returns a random item in an array. #
# random! #
# Returns a random item in array and deletes it. #
# sum #
# Returns sum of all values in an array. #
# mean #
# Returns the average of all values in an array #
#--------------------------------------------------------------------------#
# Handled Methods (RGSS3) #
# Window_BattleLog #
# display_action_results #
#==========================================================================#
($imported||={})[:zcore] = true
module Z
def self.display_command_symbols
symbols = []
symbols.push

critical)
symbols.push

hpdamage)
symbols.push

ampxdamage) if $imported[:z02]
symbols.push

mpdamage) unless $imported[:z02]
symbols.push

tpdamage)
symbols.push

miss)
symbols.push

evasion)
symbols.push

steal) if $imported[:z05]
symbols.push

states)
end
end
#========#======================#====#================================#========#
#--------# #----# DO NOT EDIT PAST THIS POINT!!! #--------#
#--------# End of Customization #----# Editing will cause death by #--------#
#--------# #----# brain asplosions. #--------#
#========#======================#====#================================#========#
class Window_BattleLog < Window_Selectable
#--------------------------------------------------------------------------
# ● Overwrite method: display_action_results
#--------------------------------------------------------------------------
def display_action_results(target, item)
if target.result.used
last_line_number = line_number
for symbol in Z::display_command_symbols
case symbol
when :critical; display_critical(target, item)
when :damage; display_damage(target, item)
when :hpdamage, :mpdamage, :tpdamage, :ampxdamage
if !target.result.missed and !target.result.evaded
case symbol
when :hpdamage; display_hp_damage(target, item)
when :mpdamage; display_mp_damage(target, item)
when :tpdamage; display_tp_damage(target, item)
when :ampxdamage; display_ampx_damage(target, item)
end
end
when :states; display_affected_status(target, item)
when :steal; display_steal(target, item)
end
end
display_failure(target, item)
wait if line_number > last_line_number
back_to(last_line_number)
target.reset_steal_item if $imported[:z05] unless target.actor?
end
end
alias :zdf :display_failure
def display_failure(target, item)
return unless target.result.steal.nil?
zdf(target, item)
end
#--------------------------------------------------------------------------
# ● New method: display_steal (Z05)
#--------------------------------------------------------------------------
def display_steal(target, skill)
return unless skill.steal?
item = target.last_stolen_item
result = target.result.steal
case result
when :success
if item.is_a?(Integer)
add_text(sprintf(Z05::STEAL_GOLD, item, target.name))
else
add_text(sprintf(Z05::STEAL_ITEM, item.name, target.name))
end
when :nosteal
add_text(sprintf(Z05::NO_STEALS, target.name))
when :fail
add_text(Z05::STEAL_FAIL)
end
end
#--------------------------------------------------------------------------
# ● New method: display_ampx_damage (Z02)
#--------------------------------------------------------------------------
def display_ampx_damage(target, item)
return if target.dead? || target.result.mp_damage == 0
return if (resource = target.resource(item)).nil?
Sound.play_recovery if target.result.mp_damage < 0
add_text(target.result.ampx_damage_text(resource.name))
wait
end
end
module DataManager
#--------------------------------------------------------------------------
# ● Overwrite method: make_save_contents
#--------------------------------------------------------------------------
def self.make_save_contents
contents = {}
contents[:system] = $game_system
contents[:timer] = $game_timer
contents[:message] = $game_message
contents[:switches] = $game_switches
contents[:variables] = $game_variables
contents[:self_switches] = $game_self_switches
contents[:actors] = $game_actors
contents[

arty] = $game_party
contents[:troop] = $game_troop
contents[:map] = $game_map
contents[

layer] = $game_player
#------------------------=
contents[:quest] = QuestLog.questlist if $imported[:z07]
#------------------------=
contents
end
#--------------------------------------------------------------------------
# ● Overwrite method: extract_save_contents
#--------------------------------------------------------------------------
def self.extract_save_contents(contents)
$game_system = contents[:system]
$game_timer = contents[:timer]
$game_message = contents[:message]
$game_switches = contents[:switches]
$game_variables = contents[:variables]
$game_self_switches = contents[:self_switches]
$game_actors = contents[:actors]
$game_party = contents[

arty]
$game_troop = contents[:troop]
$game_map = contents[:map]
$game_player = contents[

layer]
#-------------------=
QuestList.loadquestlist(contents[:quest]) if $imported[:z07]
#-------------------=
end
end
class Object
#--------------------------------------------------------------------------
# ● New method: rand_range
#--------------------------------------------------------------------------
def rand_range(min, max)
rand(max - min + 1) + min
end
end
class Array
#--------------------------------------------------------------------------
# ● New method: random
#--------------------------------------------------------------------------
def random
self[rand(size)]
end
#--------------------------------------------------------------------------
# ● New method: random!
#--------------------------------------------------------------------------
def random!
self.delete_at(rand(size))
end
#--------------------------------------------------------------------------
# ● New method: sum
#--------------------------------------------------------------------------
def sum
self.inject{|sum,x| sum + x }
end
#--------------------------------------------------------------------------
# ● New method: mean
#--------------------------------------------------------------------------
def mean
sum.to_f / size
end
end
class Object
def tryconvert(value)
begin
return eval(value)
rescue
return value
end
end
end