Per 2016, RMID pindah ke RMID Discord (Invite link dihapus untuk mencegah spambot -Theo @ 2019). Posting sudah tidak bisa dilakukan lagi.
Mohon maaf atas ketidaknyamanannya dan mohon kerjasamanya.

Share | 
 

 [Xp] Multiple Treasure Info

Topik sebelumnya Topik selanjutnya Go down 
[Xp] Multiple Treasure Info Empty2011-06-09, 09:48
Post[Xp] Multiple Treasure Info
#1
LiTTleDRAgo 
Senior
Senior
LiTTleDRAgo

Level 5
Posts : 712
Thanked : 27
Engine : RMXP
Skill : Skilled
Type : Scripter
Awards:
[Xp] Multiple Treasure Info Vide
Multiple Treasure Info
Versi: 1.00
Tipe: Misc


Pengenalan

Salah satu skrip yang gw buat asal2an


Fitur


  • Screenshot menjelaskan semuanya



Screenshots

[Xp] Multiple Treasure Info C9aac6135845551
http://www.imagebam.com/image/c9aac6135845551


Demo

Males


Scripts

Code:
#==============================================================================#
# Multi Treasure Info                                                          #
# By LiTTleDRAgo                                                              #
#==============================================================================#

module DRG_TREASURE_INFO
 
  MTI_HUD_X = -20
  MTI_HUD_Y = 420 - 100
  MTI_TIME = 1# 2
  WINDOW_PRIORITY_Z = 99999
  FONT = 'Monotype Corsiva'
  SIZE = 20 
  ACT_SE = 'Mana - Menu-01'
 
end

#==============================================================================
# ■ MTI
#==============================================================================
 class Mti < Sprite
  include DRG_TREASURE_INFO
 
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
  def initialize
    super
    init_text01
    init_text02
    init_text03
    init_text04
  end 
   
  def init_text01
    @text = Sprite.new
    @text.bitmap = Bitmap.new(120,40)
    @text.z = 2 + WINDOW_PRIORITY_Z
    @text.bitmap.font.name = FONT
    @text.bitmap.font.size = SIZE
    # @text.bitmap.font.color.set(250, 250, 250,220)
    @text.ox = -MTI_HUD_X - 50 + $game_temp.mti_text_x
    @text.oy = -MTI_HUD_Y + 5 + $game_temp.mti_text_y
    @text.zoom_x = $game_temp.mti_text_zoom_x
    @text.zoom_y = $game_temp.mti_text_zoom_y
    @text.opacity = $game_temp.mti_text_opa
  end
 
   
  def init_text02
    @text1 = Sprite.new
    @text1.bitmap = Bitmap.new(120,40)
    @text1.z = 2 + WINDOW_PRIORITY_Z
    @text1.bitmap.font.name = FONT
    @text1.bitmap.font.size = SIZE
    # @text1.bitmap.font.color.set(250, 250, 250,220)
    @text1.ox = -MTI_HUD_X - 50 + $game_temp.mti_text_x
    @text1.oy = -MTI_HUD_Y + 5 + $game_temp.mti_text_y
    @text1.zoom_x = $game_temp.mti_text_zoom_x
    @text1.zoom_y = $game_temp.mti_text_zoom_y
    @text1.opacity = $game_temp.mti_text_opa
  end 
   
   
  def init_text03
    @text2 = Sprite.new
    @text2.bitmap = Bitmap.new(120,40)
    @text2.z = 2 + WINDOW_PRIORITY_Z
    @text2.bitmap.font.name = FONT
    @text2.bitmap.font.size = SIZE
    # @text2.bitmap.font.color.set(250, 250, 250,220)
    @text2.ox = -MTI_HUD_X - 50 + $game_temp.mti_text_x
    @text2.oy = -MTI_HUD_Y + 5 + $game_temp.mti_text_y
    @text2.zoom_x = $game_temp.mti_text_zoom_x
    @text2.zoom_y = $game_temp.mti_text_zoom_y
    @text2.opacity = $game_temp.mti_text_opa
  end 
   
  def init_text04
    @text3 = Sprite.new
    @text3.bitmap = Bitmap.new(120,40)
    @text3.z = 2 + WINDOW_PRIORITY_Z
    @text3.bitmap.font.name = FONT
    @text3.bitmap.font.size = SIZE
  #  @text3.bitmap.font.color.set(250, 250, 250,220)
    @text3.ox = -MTI_HUD_X - 50 + $game_temp.mti_text_x
    @text3.oy = -MTI_HUD_Y + 5 + $game_temp.mti_text_y
    @text3.zoom_x = $game_temp.mti_text_zoom_x
    @text3.zoom_y = $game_temp.mti_text_zoom_y
    @text3.opacity = $game_temp.mti_text_opa
  end 
 
#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
  def dispose
    delete_text01
    delete_text02
    delete_text03
    delete_text04
    super 
  end
 
  def delete_text01
    @text.bitmap.dispose
    @text.dispose
  end
     
  def delete_text02
    @text1.bitmap.dispose
    @text1.dispose
  end
     
  def delete_text03
    @text2.bitmap.dispose
    @text2.dispose
  end
     
  def delete_text04
    @text3.bitmap.dispose
    @text3.dispose
  end
     
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
  def update
      super
      slide_update
      refresh if $game_temp.mti_start
  end
#--------------------------------------------------------------------------
# ● Refresh
#--------------------------------------------------------------------------
  def refresh
    $game_temp.mti_start = false
    @text_oy = -MTI_HUD_Y + 5 + $game_temp.mti_text_y
    if $game_temp.mti_text_acs == 0
      refresh_text01
    elsif $game_temp.mti_text_acs < 1
      refresh_text02
    elsif $game_temp.mti_text_acs < 2
      refresh_text03
    elsif $game_temp.mti_text_acs < 3
      refresh_text04
    elsif $game_temp.mti_text_acs < 4
      $game_temp.mti_text_acs = 0
      refresh
    end
  end
 
  def refresh_text01
    $game_temp.mti_text_acs += 1
    @text.bitmap.clear
    @text.opacity = 100
    @text.zoom_x = 1.50
    @text.oy = -MTI_HUD_Y + 5 + $game_temp.mti_text_y
    @text.ox = -MTI_HUD_X - 50 + $game_temp.mti_text_x
    @text.zoom_x = $game_temp.mti_text_zoom_x
    @text.zoom_y = $game_temp.mti_text_zoom_y
    @text.bitmap.draw_text(0, 0, 120, 40, $game_temp.mti_text.to_s,0)
    @text.visible = true
    @time1 = $game_temp.mti_text_time
    (@phase.nil? || @phase <= 0) ? @phase = 16 : @phase += 16
  end
   
  def refresh_text02
    $game_temp.mti_text_acs += 1
    @text1.bitmap.clear
    @text1.opacity = 100
    @text1.zoom_x = 1.50
    @text1.oy = -MTI_HUD_Y + 5 + $game_temp.mti_text_y
    @text1.ox = -MTI_HUD_X - 50 + $game_temp.mti_text_x
    @text1.zoom_x = $game_temp.mti_text_zoom_x
    @text1.zoom_y = $game_temp.mti_text_zoom_y
    @text1.bitmap.draw_text(0, 0, 120, 40, $game_temp.mti_text.to_s,0)
    @text1.visible = true   
    @time2 = $game_temp.mti_text_time
    (@phase1.nil? || @phase1 <= 0) ? @phase1 = 16 : @phase1 += 16
  end
 
  def refresh_text03
    $game_temp.mti_text_acs += 1
    @text2.bitmap.clear
    @text2.opacity = 100
    @text2.zoom_x = 1.50
    @text2.oy = -MTI_HUD_Y + 5 + $game_temp.mti_text_y
    @text2.ox = -MTI_HUD_X - 50 + $game_temp.mti_text_x
    @text2.zoom_x = $game_temp.mti_text_zoom_x
    @text2.zoom_y = $game_temp.mti_text_zoom_y
    @text2.bitmap.draw_text(0, 0, 120, 40, $game_temp.mti_text.to_s,0)
    @text2.visible = true
    @time3 = $game_temp.mti_text_time
    (@phase2.nil? || @phase2 <= 0) ? @phase2 = 16 : @phase2 += 16
  end
   
  def refresh_text04
    $game_temp.mti_text_acs += 1
    @text3.bitmap.clear
    @text3.opacity = 100
    @text3.zoom_x = 1.50
    @text3.oy = -MTI_HUD_Y + 5 + $game_temp.mti_text_y
    @text3.ox = -MTI_HUD_X - 50 + $game_temp.mti_text_x
    @text3.zoom_x = $game_temp.mti_text_zoom_x
    @text3.zoom_y = $game_temp.mti_text_zoom_y
    @text3.bitmap.draw_text(0, 0, 120, 40, $game_temp.mti_text.to_s,0)
    @text3.visible = true
    @time4 = $game_temp.mti_text_time
    (@phase3.nil? || @phase3 <= 0) ? @phase3 = 16 : @phase3 += 16
  end
 
#--------------------------------------------------------------------------
# ● Slide Update
#--------------------------------------------------------------------------
  def slide_update
    @time1 -= 1 if (!@time1.nil? && @time1 > 0)
    @time2 -= 1 if (!@time2.nil? && @time2 > 0)
    @time3 -= 1 if (!@time3.nil? && @time3 > 0)
    @time4 -= 1 if (!@time4.nil? && @time4 > 0)
    (!@time1.nil? && @time1 > 0) ? update_start_move1 : update_end_move1
    (!@time2.nil? && @time2 > 0) ? update_start_move2 : update_end_move2
    (!@time3.nil? && @time3 > 0) ? update_start_move3 : update_end_move3
    (!@time4.nil? && @time4 > 0) ? update_start_move4 : update_end_move4
  end
 
#--------------------------------------------------------------------------
# ● Update Start Move
#-------------------------------------------------------------------------- 
 def update_start_move1
    @text2.opacity -= 5 if @text2.opacity > 0
    return if @text.opacity >= 255
    if @phase > 0
      @phase -= 1
      @text.oy = -MTI_HUD_Y + 5 + $game_temp.mti_text_y
      @text1.oy += 1 #if @text1.oy < @text_oy+16
      @text2.oy += 1 #if @text2.oy < @text_oy+16*2
      @text3.oy += 1 #if @text3.oy < @text_oy+16*3
    end
    @text.opacity += 10
    if @text.zoom_x > 1.00
      @text.zoom_x -= 0.1
    elsif @text.zoom_x < 1.00
      @text.zoom_x = 1.00
      @text.zoom_y = 1.00
  end     
 end
 
  def update_start_move2
    @text3.opacity -= 5 if @text3.opacity > 0
    return if @text1.opacity >= 255
    if @phase1 > 0
      @phase1 -= 1
      @text1.oy = -MTI_HUD_Y + 5 + $game_temp.mti_text_y
      @text2.oy += 1# if @text2.oy < @text_oy+16
      @text3.oy += 1 #if @text3.oy < @text_oy+16*2
      @text.oy += 1  #if @text.oy < @text_oy+16*3
    end
    @text1.opacity += 10
    if @text1.zoom_x > 1.00
      @text1.zoom_x -= 0.1
    elsif @text1.zoom_x < 1.00
      @text1.zoom_x = 1.00
      @text1.zoom_y = 1.00
    end 
 end
 
  def update_start_move3
    @text.opacity -= 5 if @text.opacity > 0
    return if @text2.opacity >= 255 
    if @phase2 > 0
      @phase2 -= 1
      @text2.oy = -MTI_HUD_Y + 5 + $game_temp.mti_text_y
      @text3.oy += 1 # if @text3.oy < @text_oy+16
      @text.oy += 1  #if @text.oy < @text_oy+16*2
      @text1.oy += 1 #if @text1.oy < @text_oy+16*3

    end 
    @text2.opacity += 10
    if @text2.zoom_x > 1.00
      @text2.zoom_x -= 0.1
    elsif @text2.zoom_x < 1.00
      @text2.zoom_x = 1.00
      @text2.zoom_y = 1.00
    end
  end 
 
  def update_start_move4
    @text1.opacity -= 5 if @text1.opacity > 0
    return if @text3.opacity >= 255 
    if @phase3 > 0
      @phase3 -= 1
      @text3.oy = -MTI_HUD_Y + 5 + $game_temp.mti_text_y
      @text.oy += 1  #if @text.oy < @text_oy+16
      @text1.oy += 1 #if @text1.oy < @text_oy+16*2
      @text2.oy += 1 # if @text2.oy < @text_oy+16*3
    end 
    @text3.opacity += 10
    if @text3.zoom_x > 1.00
      @text3.zoom_x -= 0.1
    elsif @text3.zoom_x < 1.00
      @text3.zoom_x = 1.00
      @text3.zoom_y = 1.00
    end
  end 

#--------------------------------------------------------------------------
# ● Update End Move
#--------------------------------------------------------------------------
  def update_end_move1   
    if @text.opacity > 0
      @text.opacity -= 5
    else
      @text.visible = false
    end
  end
 
  def update_end_move2
    if @text1.opacity > 0
      @text1.opacity -= 5
    else
      @text1.visible = false
    end
  end
 
  def update_end_move3
    if @text2.opacity > 0
      @text2.opacity -= 5
    else
      @text2.visible = false
    end
  end
 
  def update_end_move4
    if @text3.opacity > 0
      @text3.opacity -= 5
    else
      @text3.visible = false
    end
  end
 
end


#===============================================================================
# ■ Interpreter
#===============================================================================
class Interpreter 
 
  #--------------------------------------------------------------------------
  # ● multi_treasure_info_popup(text)
  #-------------------------------------------------------------------------- 
  def multi_treasure_info_popup(text)
      $game_temp.mti_text = text
      $game_temp.mti_text_time = 40 * DRG_TREASURE_INFO::MTI_TIME
      $game_temp.mti_start = true     
  end
 
  def play_se_itm
      Audio.se_play("Audio/SE/" + DRG_TREASURE_INFO::ACT_SE , 70, 100) rescue nil
  end
   
  #--------------------------------------------------------------------------
  # ● Change Gold
  #--------------------------------------------------------------------------
  alias drgXp_command_125 command_125
  def command_125
      drgXp_command_125
      value = operate_value(@parameters[0], @parameters[1], @parameters[2])
      text = value.to_s + " " + $data_system.words.gold 
      multi_treasure_info_popup(text) if value > 0   
  end
 #--------------------------------------------------------------------------
 # ● Command_126 (ITEM)
 #--------------------------------------------------------------------------
 alias drgXp_item_command_126 command_126
 def command_126
    drgXp_item_command_126
    value = operate_value(@parameters[1], @parameters[2], @parameters[3]) 
    item_name = load_data("Data/Items.rxdata")
    text = value.to_s +  " x " + item_name[@parameters[0]].name
    multi_treasure_info_popup(text) if value > 0           
    play_se_itm if value > 0
 end
 #--------------------------------------------------------------------------
 # ● Command_127 (WEAPON)
 #--------------------------------------------------------------------------
 alias drgXp_item_command_127 command_127
 def command_127
    drgXp_item_command_127
    value = operate_value(@parameters[1], @parameters[2], @parameters[3]) 
    item_name = load_data("Data/Weapons.rxdata")
    text = value.to_s +  " x " + item_name[@parameters[0]].name
    multi_treasure_info_popup(text) if value > 0         
 end
   
 #--------------------------------------------------------------------------
 # ● Command_128 (ARMOR)
 #--------------------------------------------------------------------------
 alias drgXp_command_128 command_128
 def command_128
    drgXp_command_128
    value = operate_value(@parameters[1], @parameters[2], @parameters[3]) 
    item_name = load_data("Data/Armors.rxdata")
    text = value.to_s +  " x " + item_name[@parameters[0]].name
    multi_treasure_info_popup(text) if value > 0         
 end
 
end 

#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map   
 
#--------------------------------------------------------------------------
# ● Main
#--------------------------------------------------------------------------
  alias drgXp_mti_main main
  def main 
    @mti = Mti.new
    drgXp_mti_main
    @mti.dispose
  end   
 
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
  alias drgXp_mti_update update
  def update
    drgXp_mti_update
    @mti.update
  end   
end 
#==============================================================================
# ■ Game_Temp
#==============================================================================
class Game_Temp 
    attr_accessor :mti_text_x
    attr_accessor :mti_text_y
    attr_accessor :mti_text_zoom_x
    attr_accessor :mti_text_zoom_y
    attr_accessor :mti_text_opa 
    attr_accessor :mti_text
    attr_accessor :mti_text_time
    attr_accessor :mti_text_acs
    attr_accessor :mti_start
   
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
 alias drgXp_if_initialize initialize
 def initialize   
  drgXp_if_initialize 
    @mti_text_x = 0
    @mti_text_y = 0
    @mti_text_zoom_x = 1.00
    @mti_text_zoom_y = 1.00
    @mti_text_opa = 0
    @mti_text = ""
    @mti_text_acs = 0
    @mti_text_time = 0
    @mti_start = false   
 end 
end

$drago_multi_treasure_info = true


Credits


  • LiTTleDRAgo
  • Moghunter - Based on XAS Active Action Info
[Xp] Multiple Treasure Info Empty2011-06-09, 13:37
PostRe: [Xp] Multiple Treasure Info
#2
nisamerica 
Living Skeleton
nisamerica

Kosong
Posts : 1668
Thanked : 25
Engine : RMVX
Skill : Very Beginner
Type : Artist
Awards:


[Xp] Multiple Treasure Info Vide
Hm? Jadi maksudnya mempermudah pemberitahuan satu treasure chest memuat apa saja?
Sepertinya ini lebih cocok ke fast paced game seperti ABS ya

Good script anyway
 

[Xp] Multiple Treasure Info

Topik sebelumnya Topik selanjutnya Kembali Ke Atas 

Similar topics

+
Halaman 1 dari 1

Permissions in this forum:Anda tidak dapat menjawab topik
RPGMakerID :: Scripts & Event Systems :: RMXP Scripts-