04-30-2017, 11:30 PM
Heyoo! Refound the forum? If you had another username, let us know. Heck, post an Intro thread while you're at it.
Aww... if I keep making fixes and patches to his system, everyone's going to think I'm Vic. Well... Here ya go. Not only do you have the ability to limit the states to just those you want to show (using an array), but this patch lets you do so with the Elements. I mean, no one wants 'Knockout' in their states display and you may be hiding 'Light' and 'Darkness' from the list too.
Just post this below Atoa's Scan script in your project and these should override the older methods while adding the new options. Remember that you are going to need matching 'state' icons in the manner of state-name_sta just as you have state-name_elm for element icons. Without the required icon, the state will not show at all (or the element for that matter).
*** I'll probably add this to the Forum Scripts Listings in a few days.
Aww... if I keep making fixes and patches to his system, everyone's going to think I'm Vic. Well... Here ya go. Not only do you have the ability to limit the states to just those you want to show (using an array), but this patch lets you do so with the Elements. I mean, no one wants 'Knockout' in their states display and you may be hiding 'Light' and 'Darkness' from the list too.
Just post this below Atoa's Scan script in your project and these should override the older methods while adding the new options. Remember that you are going to need matching 'state' icons in the manner of state-name_sta just as you have state-name_elm for element icons. Without the required icon, the state will not show at all (or the element for that matter).
Code:
#==============================================================================
# Skill Scan Expansion
# By DerVVulfman (April 30, 2017)
# Based on Atoa/Victor Sant's system
#==============================================================================
# With this you can add 'state' resistances to your scan window.
#==============================================================================
# Thanks goes to Victor Sant (Atoa) for the original system, and to Tumen
# for the request of the additional 'state' expansion.
#==============================================================================
module Atoa
# INITIAL SETTINGS
# ================
# Re-defined to expand the scan window and to add the 'state' request
# into the information-display array: Scan_Infos
# Scan_Window_Settings
# [Position X, Position Y, Width, Height, Opacity, Trasparent Edge]
# --------------------
#
Scan_Window_Settings = [0 , 0, 452, 320, 160, false]
# Information shown in the window
# -------------------------------
#
Scan_Infos = ['name', 'level', 'class', 'hp', 'sp', 'status', 'exp', 'element', 'state' ]
# Add the name of the info you wish to show
# 'name' = Shows target name
# 'level' = Shows target level, for enemies check 'Scan_Enemy_Level'
# 'class' = Shows target class, for enemies check 'Scan_Enemy_Class'
# 'hp' = Shows target HP
# 'sp' = Shows target SP
# 'status = Shows target Status
# 'exp' = Shows Exp given by target
# 'element' = Shows target elemental resistance
# 'states' = Shows target state resistance
# DATA LIMIT SETTINGS
# ===================
# Arrays that apply to both elements and states, you can now limit
# the information to only the elements and resistances you wish to
# show, rather from the first element/state on through. If not in
# the array, the element or state will not be shown. (Nil ignores)
# Elements Permitted
# List of elements shown in a scan (or nil)
# --------------------
#
Scan_Element_Permitted = nil
# States Permitted
# List of states shown in a scan (or nil)
# --------------------
#
Scan_State_Permitted = [2,3,4,5,6]
# STATE SCAN SYSTEM
# =================
# Configurable data for position and display of an enemy's weakness
# or resistances to certain states
# Postion of target elemental resistance in the window
#
Scan_State_Position = [306,64]
# Max number of states shown in a column, max value = 8
# * Note: Scan_State_Permitted is also a limiting factor
#
Scan_Max_State_Shown = 8
# Exhibition of state resistance
#
Scan_State_Resists_Exhibition = 0
# 0 = custom exhibition
# 1 = exhibition by numbers, value shows target resistance
# 2 = exhibition by numbers, value damage multiplication
# State resist text if 'Scan_State_Resists_Exhibition = 0'
#
Scan_State_Resist = ['Weakest','Weak','Normal','Resist','Imune','Absorb']
end
#==============================================================================
# ** Window_Scan
#------------------------------------------------------------------------------
# This window shows enemy information
#==============================================================================
class Window_Scan < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.size = Scan_Window_Font_Size
fake = (No_Scan_Enemies.include?(@battler.id) and not @battler.actor?)
if Scan_Infos.include?('name')
draw_actor_name(@battler, Scan_Name_Postion[0], Scan_Name_Postion[1])
end
if Scan_Infos.include?('class')
draw_actor_class(@battler, Scan_Class_Postion[0], Scan_Class_Postion[1])
end
if Scan_Infos.include?('element')
draw_element_resist(@battler, Scan_Element_Position[0], Scan_Element_Position[1])
end
if Scan_Infos.include?('state')
draw_state_resist(@battler, Scan_State_Position[0], Scan_State_Position[1])
end
if Scan_Infos.include?('level')
draw_actor_level(@battler, Scan_Level_Postion[0], Scan_Level_Postion[1], fake)
end
if Scan_Infos.include?('hp')
draw_actor_hp(@battler, Scan_Hp_Postion[0], Scan_Hp_Postion[1], 160, fake)
end
if Scan_Infos.include?('sp')
draw_actor_sp(@battler, Scan_Sp_Postion[0], Scan_Sp_Postion[1], 160, fake)
end
if Scan_Infos.include?('status')
for i in 0...Scan_Status_Shown.size
draw_actor_parameter(@battler, Scan_Status_Postion[0],
Scan_Status_Postion[1] + i * (Scan_Window_Font_Size + 2), Scan_Status_Shown[i],
Scan_Status_Distance, fake)
end
end
if Scan_Infos.include?('exp') and not @battler.actor?
x, y = Scan_Exp_Postion[0], Scan_Exp_Postion[1]
self.contents.draw_text(x, y, 72, 32, 'Exp:')
exp = fake ? '?????' : @battler.exp.to_s
self.contents.draw_text(x, y, 128, 32, exp, 2)
end
end
#--------------------------------------------------------------------------
# * Draw elemental resistance
# battler : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_element_resist(battler, x, y)
self.contents.font.size = Scan_Window_Font_Size
max_elment = [Scan_Max_Elements_Shown, 8].min
y = y + (200 - (max_elment * 25)) / 2
if battler.actor? and not $atoa_script['Atoa New Resistances']
elements = $data_classes[battler.class_id].element_ranks
elsif battler.actor? and $atoa_script['Atoa New Resistances']
elements = battler.elemental_resist
else
elements = $data_enemies[battler.id].element_ranks
end
base = value = 0
case Scan_Element_Resists_Exhibition
when 0
table = [0] + Scan_Element_Resist
when 1
table = [0] + ['-100%','-50%','0%','50%','100%','200%']
else
table = [0] + ['200%','150%','100%','50%','0%','-100%']
end
for i in 0...$data_system.elements.size
if Scan_Element_Permitted != nil
next unless Scan_Element_Permitted.include?(i)
end
begin
bitmap = RPG::Cache.icon($data_system.elements[i] + '_elm')
self.contents.blt(x + (base * 112), y + (value * 25), bitmap, Rect.new(0, 0, 24, 24))
result = table[elements[i]]
case elements[i]
when 1
self.contents.font.color = Scan_Weakest_Color
when 2
self.contents.font.color = Scan_Weak_Color
when 3
self.contents.font.color = Scan_Neutral_Color
when 4
self.contents.font.color = Scan_Resist_Color
when 5
self.contents.font.color = Scan_Imune_Color
when 6
self.contents.font.color = Scan_Absorb_Color
end
case Scan_Element_Resists_Exhibition
when 0
self.contents.draw_text(x + 28 + (base * 112), y - 4 + (value * 25), 180, 32,
result.to_s, 0)
else
self.contents.draw_text(x + (base * 112), y - 4 + (value * 25), 72, 32,
result.to_s, 2)
end
value += 1
base += 1 if value == max_elment
value = value % max_elment
rescue
end
end
end
#--------------------------------------------------------------------------
# * Draw state resistance
# battler : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_state_resist(battler, x, y)
self.contents.font.size = Scan_Window_Font_Size
max_elment = [Scan_Max_State_Shown, 8].min
y = y + (200 - (max_elment * 25)) / 2
if battler.actor? and not $atoa_script['Atoa New Resistances']
elements = $data_classes[battler.class_id].state_ranks
elsif battler.actor? and $atoa_script['Atoa New Resistances']
elements = battler.state_resist
else
elements = $data_enemies[battler.id].state_ranks
end
base = value = 0
case Scan_State_Resists_Exhibition
when 0
table = [0] + Scan_State_Resist
when 1
table = [0] + ['-100%','-50%','0%','50%','100%','200%']
else
table = [0] + ['200%','150%','100%','50%','0%','-100%']
end
for i in 1..$data_states.size-1
if Scan_State_Permitted != nil
next unless Scan_State_Permitted.include?(i)
end
begin
bitmap = RPG::Cache.icon($data_states[i].name + '_sta')
self.contents.blt(x + (base * 112), y + (value * 25), bitmap, Rect.new(0, 0, 24, 24))
result = table[elements[i]]
case elements[i]
when 1
self.contents.font.color = Scan_Weakest_Color
when 2
self.contents.font.color = Scan_Weak_Color
when 3
self.contents.font.color = Scan_Neutral_Color
when 4
self.contents.font.color = Scan_Resist_Color
when 5
self.contents.font.color = Scan_Imune_Color
when 6
self.contents.font.color = Scan_Absorb_Color
end
case Scan_State_Resists_Exhibition
when 0
self.contents.draw_text(x + 28 + (base * 112), y - 4 + (value * 25), 180, 32,
result.to_s, 0)
else
self.contents.draw_text(x + (base * 112), y - 4 + (value * 25), 72, 32,
result.to_s, 2)
end
value += 1
base += 1 if value == max_elment
value = value % max_elment
rescue
end
end
end
end
*** I'll probably add this to the Forum Scripts Listings in a few days.