Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Status change indication
#1
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given.

INSTRUCTIONS
Add a new script above main.
What this does: If u or your enemy inflict a status, it is shown like the damage text.
To alter check the comments inside the script
90% credit goes to MoMoMo

Code:
#===============================================================
# State change indication
# Scripted by MoMoMo
# Translation And Aditional Code by Mr. DJ
#===============================================================
# The state/status which is added and deleted, will now be indicated like Damage.
# The Positive/Good state, which increases your own abilities or strenght are refered to initializing, like sharpen and barrier etc.
# When font name "Arial Black" is XP default , then its not to be able to indicate/see  Japanese
# Here it has modified in "MS P gothic". #Changed it back to ARIAL beacuse there is no Japanese anymore!
# It corresponded  alsoto the nature recovery of the state.
# what is that supposed to mean
# ... This time, the explanation is short, don't you think? ...

module State_Change_Pop_Config
  ST_CHANGE_PLUS_STATE_COLOR  = Color.new(255, 128, 128)          # + State color (green standard)
  ST_CHANGE_MINUS_STATE_COLOR = Color.new(128, 255, 128)        # - State color (red standard)
  ST_CHANGE_FONT_NAME         = "Arial"                                           # font name
  ST_CHANGE_FONT_SIZE         = 32                                                  # font size
  ST_CHANGE_GOOD_STATE        = ["Sharpen","Barrier","Resist","Blink"] # good states , you may add ... (,"withcommaandquotes")
  ST_CHANGE_GOOD_STATE_COLOR  = Color.new(128, 128, 255)        # Until good state apperance color
  ST_CHANGE_G_ST_VANISH_COLOR = Color.new(128, 128, 128)        # good state disappearance color
  ST_CHANGE_WAIT              = true    # indicates if the next code should be applied
  ST_CHANGE_DAM_DURATION      = 20  # indicates the duration ...
end
class Game_Battler
  attr_accessor :state_change_pop              # State change indicatory flag
  attr_accessor :state_change_plus              # plus state change (positif)
  attr_accessor :state_change_minus           # minus state change (negatif)
  alias game_battler_state_change_initialize initialize
  def initialize
    game_battler_state_change_initialize
    @state_change_pop = false
    @state_change_plus = []
    @state_change_minus = []
  end
  alias game_battler_state_change_attack_effect attack_effect
  def attack_effect(attacker)
    b_st = @states.dup
    temp = game_battler_state_change_attack_effect(attacker)
    a_st = @states.dup
    change_st = state_change_check(b_st, a_st)
    @state_change_plus = state_name_transfer(change_st[0])
    @state_change_minus = state_name_transfer(change_st[1])
    return temp
  end
  alias game_battler_state_change_skill_effect skill_effect
  def skill_effect(user, skill)
    b_st = @states.dup
    temp = game_battler_state_change_skill_effect(user, skill)
    a_st = @states.dup
    change_st = state_change_check(b_st, a_st)
    @state_change_plus = state_name_transfer(change_st[0])
    @state_change_minus = state_name_transfer(change_st[1])
    return temp
  end
  alias game_battler_state_change_item_effect item_effect
  def item_effect(item)
    b_st = @states.dup
    temp = game_battler_state_change_item_effect(item)
    a_st = @states.dup
    change_st = state_change_check(b_st, a_st)
    @state_change_plus = state_name_transfer(change_st[0])
    @state_change_minus = state_name_transfer(change_st[1])
    return temp
  end
  alias game_battler_state_change_remove_states_auto remove_states_auto
  def remove_states_auto
    b_st = @states.dup
    game_battler_state_change_remove_states_auto
    a_st = @states.dup
    change_st = state_change_check(b_st, a_st)
    @state_change_plus = state_name_transfer(change_st[0])
    @state_change_minus = state_name_transfer(change_st[1])
  end
  #--------------------------------------------------------------------------
  # â—? Investigating the state which it is added and is deleted ...
  # â—? take it like a parallel event ...
  #--------------------------------------------------------------------------
  def state_change_check(b_st, a_st)
    p_st = a_st - b_st
    m_st = b_st - a_st
    for st in p_st.dup
      p_st.delete(st) if $data_states[st].rating == 0
    end
    for st in m_st.dup
      m_st.delete(st) if $data_states[st].rating == 0
    end
    return [p_st, m_st]
  end
  #--------------------------------------------------------------------------
  # â—? Converting arrangement of state ID to the arrangement of state name
  # â—? (number to text, convert string to fixnum lol)
  #--------------------------------------------------------------------------
  def state_name_transfer(state)
    temp = []
    for st in state
      temp.push($data_states[st].name)
    end
    return temp
  end
end

class Scene_Battle
  alias scene_battle_state_change_update_phase4_step1 update_phase4_step1
  def update_phase4_step1
    scene_battle_state_change_update_phase4_step1
    if @active_battler != nil
      # State indication Start
      if @active_battler.state_change_plus != [] or @active_battler.state_change_minus != []
        @active_battler.state_change_pop = true
      end
    end
  end
  alias scene_battle_state_change_update_phase4_step5 update_phase4_step5
  def update_phase4_step5
    scene_battle_state_change_update_phase4_step5
    # State indication End
    for target in @target_battlers
      if target.state_change_plus != [] or target.state_change_minus != []
        target.state_change_pop = true
      end
    end
  end
end

class Sprite_Battler < RPG::Sprite
  alias sprite_battler_state_change_update update
  def update
    sprite_battler_state_change_update
    # Unless the batler is nil, #translated butler lol
    return if @battler == nil
    # So when  it is visible, ... (it = batler)
    if @battler_visible
      #... Change State text is visible too
      if @battler.state_change_pop
        state_change(@battler.state_change_plus, @battler.state_change_minus)
        @battler.state_change_pop = false
      end
    end
  end
end

module RPG
  class Sprite < ::Sprite
    include State_Change_Pop_Config
    # F12 reset measure dunno whats that about
    if $alias_rpg_sprite_initialize != true
      alias rpg_sprite_state_change_initialize initialize
      $alias_rpg_sprite_initialize = true
    end
    def initialize(viewport = nil)
      rpg_sprite_state_change_initialize(viewport)
      @_st_change_duration = 0
    end
    def state_change(change_plus, change_minus)
      dispose_state_change
      bitmap_p = []
      bitmap_m = []
      #below here is everything taken on screen, did not translate
      for i in 0...change_plus.size
        bitmap_p[i] = Bitmap.new(160, 48)
        bitmap_p[i].font.name = ST_CHANGE_FONT_NAME
        bitmap_p[i].font.size = ST_CHANGE_FONT_SIZE
        bitmap_p[i].font.color.set(0, 0, 0)
        bitmap_p[i].draw_text(-1, 12-1, 160, 36, change_plus[i], 1)
        bitmap_p[i].draw_text(+1, 12-1, 160, 36, change_plus[i], 1)
        bitmap_p[i].draw_text(-1, 12+1, 160, 36, change_plus[i], 1)
        bitmap_p[i].draw_text(+1, 12+1, 160, 36, change_plus[i], 1)
        if ST_CHANGE_GOOD_STATE.include?(change_plus[i])
          f_color = ST_CHANGE_GOOD_STATE_COLOR
        else
          f_color = ST_CHANGE_PLUS_STATE_COLOR
        end
        bitmap_p[i].font.color = f_color
        bitmap_p[i].draw_text(0, 12, 160, 36, change_plus[i], 1)
      end
      for i in 0...change_minus.size
        bitmap_m[i] = Bitmap.new(160, 48)
        bitmap_m[i].font.name = ST_CHANGE_FONT_NAME
        bitmap_m[i].font.size = ST_CHANGE_FONT_SIZE
        bitmap_m[i].font.color.set(0, 0, 0)
        bitmap_m[i].draw_text(-1, 12-1, 160, 36, change_minus[i], 1)
        bitmap_m[i].draw_text(+1, 12-1, 160, 36, change_minus[i], 1)
        bitmap_m[i].draw_text(-1, 12+1, 160, 36, change_minus[i], 1)
        bitmap_m[i].draw_text(+1, 12+1, 160, 36, change_minus[i], 1)
        if ST_CHANGE_GOOD_STATE.include?(change_minus[i])
          f_color = ST_CHANGE_G_ST_VANISH_COLOR
        else
          f_color = ST_CHANGE_MINUS_STATE_COLOR
        end
        bitmap_m[i].font.color = f_color
        bitmap_m[i].draw_text(0, 12, 160, 36, change_minus[i], 1)
      end
      bitmap = bitmap_p + bitmap_m
      @_st_change_sprite = []
      for i in 0...bitmap.size
        @_st_change_sprite.push(::Sprite.new(self.viewport))
        @_st_change_sprite[i].bitmap = bitmap[i]
        @_st_change_sprite[i].ox = 80
        @_st_change_sprite[i].oy = 20
        @_st_change_sprite[i].x = self.x
        @_st_change_sprite[i].y = self.y - self.oy / 2
        @_st_change_sprite[i].z = 2999
        @_st_change_sprite[i].visible = false
      end
      @_st_change_duration = 40 + 20 * @_st_change_sprite.size
      @st_change_start = false
    end
    def dispose_state_change
      if @_st_change_sprite != [] and @_st_change_sprite != nil
        for sprite in @_st_change_sprite
          sprite.bitmap.dispose
          sprite.dispose
          sprite = nil
        end
        @_st_change_sprite = nil
        @_st_change_duration = 0
      end
    end
    # F12 reset measure 3still dont know what it is, but i think he means aliasing
    if $alias_rpg_sprite_effect != true
      alias rpg_sprite_state_change_effect? effect?
      $alias_rpg_sprite_effect = true
    end
    def effect?
      temp = rpg_sprite_state_change_effect?
      if ST_CHANGE_WAIT
        return true if @_st_change_duration > 0
      end
      return temp
    end
    #F12 reset measure again....
    if $alias_rpg_sprite_update != true
      alias rpg_sprite_state_change_update update
      $alias_rpg_sprite_update = true
    end
    def update
      rpg_sprite_state_change_update
      if @_st_change_duration > 0 and
         (@_damage_duration <= ST_CHANGE_DAM_DURATION or @st_change_start)
        @st_change_start = true
        @_st_change_duration -= 1
        st_size = @_st_change_sprite.size
        for i in 0...st_size
          if @_st_change_duration <= 27 + 20 * (st_size - i)
            #Dummy
          elsif @_st_change_duration <= 33 + 20 * (st_size - i)
            @_st_change_sprite[i].y += 4
          elsif @_st_change_duration <= 35 + 20 * (st_size - i)
            @_st_change_sprite[i].y += 2
          elsif @_st_change_duration <= 37 + 20 * (st_size - i)
            @_st_change_sprite[i].y -= 2
          elsif @_st_change_duration <= 39 + 20 * (st_size - i)
            @_st_change_sprite[i].visible = true
            @_st_change_sprite[i].y -= 4
          end
          @_st_change_sprite[i].opacity = 256 - (12 - @_st_change_duration + 20 * (st_size - i)) * 32
        end
        #below the text is deleted
        if @_st_change_duration == 0
          dispose_state_change
        end
      end
    end
  end
end
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Change character script jaigai 0 2,736 11-19-2006, 01:00 PM
Last Post: jaigai
  Friend Death Status sandsand 0 2,904 10-10-2006, 01:00 PM
Last Post: sandsand
  Change menu character sprites to Pictures like in rpg maker 2003 Abyssos 0 3,628 09-28-2006, 01:00 PM
Last Post: Abyssos
  Change Color of The diferent Status Script MASTERLOKI 0 2,267 07-18-2006, 01:00 PM
Last Post: MASTERLOKI
  Change Cursor with differend commands in Battle Divinity 0 2,209 06-22-2006, 01:00 PM
Last Post: Divinity
  Change Level/Exp/Status name ryujijitei 0 1,997 04-29-2006, 01:00 PM
Last Post: ryujijitei
  Show all status names Guedez 0 1,969 12-26-2005, 01:00 PM
Last Post: Guedez
  Custom Menu Status jstreet 0 2,453 12-23-2005, 01:00 PM
Last Post: jstreet
  Change the hue of pictures Sheol 0 2,054 11-29-2005, 01:00 PM
Last Post: Sheol
  Equipment Menu Change Seraphim Dark 0 2,243 07-21-2005, 01:00 PM
Last Post: Seraphim Dark



Users browsing this thread: