Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Scan skill should show states
#2
Heyoo! Refound the forum? If you had another username, let us know. Heck, post an Intro thread while you're at it. Laughing

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.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png] [Image: liM4ikn.png] [Image: fdzKgZA.png] [Image: sj0H81z.png]
[Image: QL7oRau.png] [Image: uSqjY09.png] [Image: GAA3qE9.png] [Image: 2Hmnx1G.png] [Image: BwtNdKw.png%5B]
Above are clickable links

Reply }


Messages In This Thread
Scan skill should show states - by Tumen - 04-30-2017, 06:00 PM
RE: Scan skill should show states - by DerVVulfman - 04-30-2017, 11:30 PM
RE: Scan skill should show states - by Tumen - 05-01-2017, 10:59 AM
RE: Scan skill should show states - by Tumen - 05-01-2017, 06:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
   [RMXP] Showing skill gained by leveling up on battle result FrQise 12 10,338 05-07-2021, 02:05 PM
Last Post: FrQise
   Skill Cooldown script Fenriswolf 11 14,135 12-10-2019, 11:10 AM
Last Post: Fenriswolf
   Remaining turns of states Melana 3 6,384 08-01-2018, 02:43 PM
Last Post: kyonides
   Dervvulfman's Skill Tree (Micko's) Passive Skill Malfunction! reiji1337 6 8,637 04-28-2017, 03:27 AM
Last Post: reiji1337
  Expiration States with Atoa acbs: error Noctis 5 8,126 02-18-2017, 01:10 AM
Last Post: DerVVulfman
   RMXP SKill animations too bright (overlaying the battle screen) Starmage 4 9,171 06-13-2016, 03:41 AM
Last Post: Starmage
   Atoa ACBS HP Regen Skill Lightness 11 12,298 03-11-2016, 10:43 PM
Last Post: Lightness
   Inserting MOG Chain Commands in a particular Skill ID iceflux 6 11,636 08-27-2015, 06:33 PM
Last Post: iceflux
   show variables on screen rpg maker xp ThePrinceofMars 22 29,808 10-19-2014, 08:01 PM
Last Post: ThePrinceofMars
   Analyse show HP Bars Ace 12 14,840 12-28-2010, 04:39 PM
Last Post: Ace



Users browsing this thread: