Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # =============================================================================
- # TheoAllen - Non-RPG Actor Biography
- # Version : 1.0
- # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
- # (This script documentation is written in informal indonesian language)
- # =============================================================================
- ($imported ||= {})[:Theo_NonRPGBioGraphy] = true
- # =============================================================================
- # CHANGE LOGS:
- # -----------------------------------------------------------------------------
- # 2013.07.14 - Finished script
- # =============================================================================
- =begin
- Perkenalan :
- Script ini merubah menu status untuk game yang bertema non-RPG (no level,
- no exp, no stats)
- Cara penggunaan :
- Pasang script ini dibawah material namun diatas main
- Actor biography dibagi menjadi 2. Yaitu biografi atas, dan bawah.
- Untuk penggunaan tag biografi, gunakan pada note actor kek gini
- Biografi atas (maksimal 4 baris)
- <bio1>
- fullname : Eric Hakon
- info lain : Tambahin sendiri
- </bio1>
- Biografi bawah (maksimal 6 baris)
- <bio2>
- Biografi :
- Line 1 disini
- Line 2 disini
- Line 3 disini
- Fave Quote :
- United we stand
- </bio2>
- Kamu bebas nambahin info apa aja yang ada disana. Jika text dipisah dengan
- titik dua (:) maka kata sebelumnya akan ditulis dengan warna biru / system
- Terms of use :
- Credit gw, TheoAllen. Kalo semisal u bisa ngedit2 script gw trus jadi lebih
- keren, terserah. Ane bebasin. Asal ngga ngeklaim aja. Kalo semisal mau
- dipake buat komersil, jangan lupa, gw dibagi gratisannya.
- =end
- # =============================================================================
- # Tidak ada konfigurasi
- # =============================================================================
- class << DataManager
- alias pre_load_bio_db load_database
- def load_database
- pre_load_bio_db
- load_actor_biography
- end
- def load_actor_biography
- $data_actors.compact.each do |actor|
- actor.load_biography
- end
- end
- end
- class RPG::Actor < RPG::BaseItem
- attr_accessor :bio1
- attr_accessor :bio2
- BIO1_REG_ON = /<(?:BIO1|bio1)>/i
- BIO1_REG_OFF = /<\/(?:BIO1|bio1)>/i
- BIO2_REG_ON = /<(?:BIO2|bio2)>/i
- BIO2_REG_OFF = /<\/(?:BIO2|bio2)>/i
- def load_biography
- @bio1 = []
- @bio2 = []
- read_bio1 = false
- read_bio2 = false
- self.note.split(/[\r\n]+/).each do |line|
- case line
- when BIO1_REG_ON
- read_bio1 = true
- when BIO2_REG_ON
- read_bio2 = true
- when BIO1_REG_OFF
- read_bio1 = false
- when BIO2_REG_OFF
- read_bio2 = false
- else
- @bio1.push(line) if read_bio1
- @bio2.push(line) if read_bio2
- end
- end
- end
- end
- class Game_Actor < Game_Battler
- def bio1
- $data_actors[id].bio1
- end
- def bio2
- $data_actors[id].bio2
- end
- end
- class Window_Status < Window_Selectable
- BIO_REGEXP = /(.*):(.*)/i
- def draw_block2(y)
- draw_actor_face(@actor, 8, y)
- draw_basic_info(136, y)
- end
- def draw_block3(y)
- draw_bio2(20, y)
- end
- def draw_basic_info(x,y)
- ypos = y
- @actor.bio1.each do |bio|
- case bio
- when BIO_REGEXP
- text = bio.split(/:/)
- size = text_size(text[0]).width
- change_color(system_color)
- draw_text(x,ypos,contents.width,line_height,text[0]+":")
- change_color(normal_color)
- draw_text(x+size,ypos,contents.width,line_height,text[1])
- else
- change_color(normal_color)
- draw_text(x,ypos,contents.width,line_height,bio)
- end
- ypos += line_height
- end
- end
- def draw_bio2(x,y)
- ypos = y
- @actor.bio2.each do |bio|
- case bio
- when BIO_REGEXP
- text = bio.split(/:/)
- size = text_size(text[0]).width
- change_color(system_color)
- draw_text(x,ypos,contents.width,line_height,text[0]+":")
- change_color(normal_color)
- draw_text(x+size,ypos,contents.width,line_height,text[1])
- else
- change_color(normal_color)
- draw_text(x,ypos,contents.width,line_height,bio)
- end
- ypos += line_height
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment