Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ################################################################################
- # NoFightFriendMenu 2.1a
- # By: Ixfuru
- # December 16, 2012
- ################################################################################
- #
- # The purpose of this script is to allow you to have a project without fighting.
- # This by no means is the SOLE purpose of the script, but it has that capability,
- # as you don't have to display any status scenes, weapons, skills, any of that
- # if you don't want. It's all up to you.
- #
- # This script creates several new systems. A menu system, A friendship system,
- # and a journal system. It offers two new scenes and various new accessible
- # windows. The menu system is set up so that you can a)keep both the menu
- # designed for this script, b)do away with the old one, or c)keep only the
- # old one.
- #
- # It is best that you only access the new scenes from the smaller, centered
- # menu that now appears when you press the menu button. And the great thing is
- # you control it through a single switch.
- #
- # There are tons of customization options and some special script call commands
- # that can be used to implement the friendship features. Please read through
- # the instructions carefully, one section at a time and set the script up so
- # that it best suits your needs.
- #
- ###############################################################################
- #
- #
- # If you use this script for non-commercial use, it's okay, as long as credit to
- # me, IXFURU, is given. For commercial projects, You'll have to contact me via
- # one of the forums by PM or in THE FINISH LINE user forum found here:
- #
- # http://www.rpgmakervx.net/index.php?showforum=94
- #
- # If you have problems with the script, contact me on the topic thread where this
- # script was posted. You may not redistribute without my consent.
- #
- ################################################################################
- ################################################################################
- #===============================================================================
- ################################################################################
- #
- # This script was requested by Tigergirl7707, here:
- #
- # http://www.rpgmakervx.net/index.php?showtopic=57208
- #
- #
- ################################################################################
- # SECTION 1
- ################################################################################
- #
- # SPECIAL COMMANDS
- #
- # The following series of commands can be used in the script command of an event
- # to perform procedures on individuals regarded as party friends. Use the id
- # given in the FRIENDS hash of the customization section to replace 'friend_id'
- # anywhere in these script calls.
- #
- # To add a friend to the parties friends, use:
- #
- # $game_party.make_new_friend(friend_id)
- #
- # To remove a friend from the friends list use:
- #
- # $game_party.defriend(friend_id)
- #
- # You can alter the friend's rating by using this script call. In this call,
- # use the 'how' as an integer from 0 to 3. This integer will state exactly how
- # to modify the rating. if how is 1, it will add. 2 is subtract, 3 is multiply
- # and 4 is divide. Just change the 'amount' to the value of how much you wish
- # to change the rating by.
- #
- # $game_friends[friend_id].alter_rating(how, amount)
- #
- # You can check if a specific person is in the party by using the following.
- # This is good if you want to run a conditional branch to see if the individual
- # is your friend:
- #
- # $game_party.check_for_friend(friend_id)
- #
- # You can get a total number of friends by using the following. So if you
- # wanted to save the number in a variable, you could say $game_variables[x] =:
- #
- # $game_party.total_friends
- #
- # To change an actor's portrait on the bio scene, call this. Replace x with the
- # actor whose portrait you wish to change. Then replace image with the image in
- # the Graphics\Pictures folder that you want to be the new portrait.
- #
- #
- # To alter a friend's storyline, you can use the following. Just make sure you
- # replace the 'new_storyline' with double-quoted text:
- #
- # $game_friends[friend_id].change_storyline(new_storyline)
- #
- # Call the bio scene on ANY actor in the party by using:
- #
- # $scene = Scene_Bio.new(0)
- #
- ################################################################################
- ################################################################################
- #
- # CUSTOMIZATION SECTION START
- #
- ################################################################################
- module NFFM
- ##############################################################################
- # SECTION 2
- ##############################################################################
- NFFM_SWITCH = 1 #This is the switch you want to grant access to the new menu
- # When it is ON, you will taken to the new menu, when OFF,
- # it will go to the old menu. So to avoid going to the old
- # menu completely, just turn the switch you place here ON and
- # leave it ON.
- #-----------------------------------------------------------------------------
- # Set up the friendtowns here. Anywhere you can find a friend
- # in the game, you'll need a string of where you found them here. The formula
- # is as follows:
- # town_id => town_name
- FRIENDTOWNS = {#<<<<Don't delete this!!!
- 1 => "Cloudsdale",
- 2 => "Linkville",
- }#<<<<Don't delete this!!!
- #-----------------------------------------------------------------------------
- # The following hash will store info about the friends you meet, for use in the
- # friends page. To complete it, you'll need to use this formula:
- #
- # id => [name, start_value, town, face_name, face_index, char_name, char_index, info],
- #
- # id: This needs to be any number from 0 up. Each id needs to be a unique
- # value. The system will call this number to identify which friend's
- # information to display.
- # name: This is the name of the friend you have met. Doesn't matter what you
- # place here, as long as it is in string ("") form.
- # start_value: The system will create a meter from which you will be able to
- # to tell how good of friends you are with this individual. The
- # value you place here must be 0 or greater and will be the value
- # at which the individual starts at. In other words, how good
- # of a friend is this person from the outset of the game.
- # town: This value MUST BE greater than 0. It will reference the FRIENDTOWN
- # hash above by key. So the value you place here tells the system
- # that this particular friend is from the town with that id.
- # face_name: This references which face to align with which individual friend.
- # In the scene, this face will be displayed along with that friend's
- # information. This is actually a filename for the image you
- # want to display.
- # face_index: This gives reference to which face you want to display from the
- # face file you selected in face_name. There are 8 faces on a
- # face file sheet. You can choose between 0-7 to pinpoint which
- # face of the given file you want.
- # char_name:, char_index: These are the same as the face_name, face_index. The
- # only difference is that they give reference to the character,
- # or sprite sheet instead of the faces.
- # info: This can be a long string, ("") form, which will display a brief
- # summary as to who this person is.
- FRIENDS = {#<<<Don't delete this!
- 0 => ["Rainbow Dash", 10, 1, "Ponies", 1, "$dashie", 4, "Rainbow Dash is a competive Pegasus from the city of Cloudsdale."],
- 1 => ["Ariel", 40, 1, "People1", 1, "People1", 1, "Ariel is Marty's daughter."],
- 2 => ["Father Bronze", 80, 2, "People2", 0, "People2", 0, "Father Bronze works at the Chapel. He is a good man, who gives to the poor."],
- }#<<<Don't delete this!
- #------------------------------------------------------------------------------
- STORYLINES = {#<<<<Don't delete this!!!
- 0 => "Work in Progress. No quest yet.",
- 1 => "Ariel is looking for some help in getting her cat Pickles out of a tree just outside of town.",
- 2 => "Father Bronze just wants me to be a good kid, and stay out of trouble.",
- }#<<<<<Don't delete this!!!
- ##############################################################################
- # SECTION 3
- ##############################################################################
- COMMAND_FRIENDSHIP = "Friendships" #The text displayed as an option in the menu to
- #open friendship scene
- BIO_TITLE = "'s Biography" #The title window will display this text, placing
- #the actor's name just before it.
- COMMANDS_COLOR = 28 #Text color of commands in menu
- BIO_TITLE_COLOR = 14 #Text color of Bio Title
- BIO_NAME_COLOR = 18 #Text color of name appearing over portrait
- FRIEND_TITLE_COLOR = 6 #Text color of Friends Title
- MENU_SKIN = "Liberty1" # You can alter this to the name of the windowskin you want to use
- # for the menu window. If you leave it blank (""), it will refer
- # to the default windowskin. If you use a custom windowskin here,
- # you'll have to ensure that the skin is found in your systems
- # folder.
- BIO_SKIN = "Liberty1"
- FRIEND_SKIN = "Liberty1"
- FULL_FRIEND_METER = 100 #Value at which a friend meter is considered full.
- FRIENDCOUNT_STRING = "Total Friends" #This is the text beside how many friends
- #you've made in both bio and friend scenes
- OPENING_SE = "Ice1" #Sound effect when new pages are opened
- CANCEL_SE = "Fire2" #Sound effect when pages are closed
- STORYLINE_TEXT = "Storylines" #Command in small Storylines window, takes you to
- #Where you can read how the friend fits into the game.
- USE_STORYLINES = true #Enables use of the Storyline Scene.
- USE_FRIEND_PORTRAITS = true #Enables you to use friend portraits, instead of faces
- METER_TEXT = "FRIEND METER" #Text to be displayed around the friend's rating meter
- HOME_TEXT = "HOMETOWN" #Text to be shown near where the friend lives.
- STORYLINE_SKIN = "Liberty1"
- METER_COLOR1 = 30
- METER_COLOR2 = 31
- METERBACK_COLOR = 8
- #************************************NFFM2************************************
- BIO_FONTSIZE = 12 # Size of the Fonts in the paragraph of Bio section
- QUICK_MENU_WIDTH = 160 #Width of the quickmenu (Default 160)
- QUICK_MENU_HEIGHT = 245 #Width of the quickmenu (Default 245, accomodates all commands)
- QUICK_MENU_X = 200 #x position of menu (Default 200)
- QUICK_MENU_Y = 90 #y position of menu (Default 90)
- USE_HOMES = true #Can use the option to display hometowns true = show hometowns
- FRIEND_FONTSIZE = 12 #Size of the Fonts in the paragraph of Friend scene
- #*****************************************************************************
- #-----------------------------------------------------------------------------
- ##############################################################################
- # SECTION 4
- ##############################################################################
- # Below is a hash which will hold the image of an actor to be displayed in the
- # bio scene. If only one member will 'lead' your party, then you should only
- # have to insert an image for that actor. Here is the formula for how to
- # set it up:
- # actor_id => image_filename
- #
- # Replace 'actor_id' with the id of the actor in the database. Replace
- # 'image_filname' with the name of the image you want which MUST be in kept
- # in your pictures folder.
- BIO_IMAGES = {#<<<<Don't delete this!
- 1 => "Twilight",
- }#Don't delete this!
- #
- #-----------------------------------------------------------------------------
- # Next, this is where you'll state the portraits used for FRIENDS. Set it up
- # just like you did in the BIO_IMAGES hash, except replace actor_id with the
- # id of the friend.
- #
- FRIEND_PORTRAITS = {#<<<Don't delete this!!!
- 0 => "Rainbow Dash",
- 1 => "People1_1",
- 2 => "People2_0",
- }#<<<<Don't delete this!!!
- #-----------------------------------------------------------------------------
- #
- # Set the following hash up with this formula:
- # actor_id => bio
- #
- # This will be responsible for retrieving the displayable text of the actor
- # who is currently leading your party. For every actor who may lead, you'll
- # need an actor_id in the party to match it.
- ACTOR_BIOS = {#<<<<Don't delete this!
- 1 => "Twilight Sparkle is a bright unicorn with a raw skill in magic that allows her to master even the toughest of spells."
- }#<<<<Don't delete this!
- #-----------------------------------------------------------------------------
- ##############################################################################
- # SECTION 5
- ##############################################################################
- # The following group of constants decides whether or not you wish to use any
- # of the default menu scenes, if true, they will be used. If false, they won't.
- USE_SAVE = true
- USE_STATUS = true
- USE_EQUIPMENT = true
- USE_INVENTORY = true
- USE_SKILL = true
- USE_END = true
- ##############################################################################
- #
- # END OF CUSTOMIZATION
- #
- ##############################################################################
- end
- #=============================================================================
- # FRIEND
- #=============================================================================
- class Friend
- include NFFM
- attr_accessor :id
- attr_accessor :name
- attr_accessor :rating
- attr_accessor :home
- attr_accessor :face_name
- attr_accessor :face_index
- attr_accessor :char_name
- attr_accessor :char_index
- attr_accessor :info
- attr_accessor :storyline
- def initialize(friend_id)
- @id = friend_id
- @rating = FRIENDS[@id][1]
- @name = FRIENDS[@id][0]
- @home = FRIENDS[@id][2]
- @face_name = FRIENDS[@id][3]
- @face_index = FRIENDS[@id][4]
- @char_name = FRIENDS[@id][5]
- @char_index = FRIENDS[@id][6]
- @info = FRIENDS[@id][7]
- @storyline = STORYLINES[@id]
- end
- def alter_rating(how = 0, amount = 1)
- if how == 0
- @rating += amount
- elsif how == 1
- @rating -= amount
- elsif how == 2
- @rating *= amount
- elsif how == 3
- @rating /= amount
- end
- if @rating < 0
- @rating = 0
- elsif @rating > FULL_FRIEND_METER
- @rating = FULL_FRIEND_METER
- end
- end
- def change_storyline(story)
- @storyline = story
- end
- end
- #===============================================================================
- # GAME_FRIENDS
- #===============================================================================
- class Game_Friends
- include NFFM
- def initialize
- @data = []
- end
- def [](friend_id)
- if @data[friend_id] == nil and FRIENDS[friend_id] != nil
- @data[friend_id] = Friend.new(friend_id)
- end
- return @data[friend_id]
- end
- end
- #===============================================================================
- # GAME TEMP
- #===============================================================================
- class Game_Temp
- include NFFM
- attr_accessor :quicku
- attr_accessor :from_friend
- attr_accessor :storybase
- alias nffm_gt_initialize initialize unless $@
- def initialize
- nffm_gt_initialize
- @quicku = false
- @from_friend = false
- @storybase = 0
- end
- end
- #===============================================================================
- # GAME PARTY
- #===============================================================================
- class Game_Party < Game_Unit
- include NFFM
- attr_accessor :friends
- attr_accessor :total_friends
- attr_accessor :friendtowns
- alias nffm_gp_initialize initialize unless $@
- def initialize
- nffm_gp_initialize
- @friends = []
- @friendtowns = []
- @total_friends = 0
- end
- def make_new_friend(friend_id)
- if @friends.include?(friend_id)
- else
- @friends.push(friend_id)
- get_total_friends
- end
- end
- def check_for_friend(friend_id)
- if @friends.include?(friend_id)
- return true
- else
- return false
- end
- end
- def defriend(friend_id)
- if @friends.include?(friend_id)
- @friends.delete(friend_id)
- get_total_friends
- end
- end
- def get_total_friends
- @total_friends = @friends.size
- end
- end
- #===============================================================================
- # Game Actor
- #===============================================================================
- class Game_Actor
- include NFFM
- attr_accessor :portrait
- alias nffm_ga_initialize initialize unless $@
- def initialize(actor_id)
- nffm_ga_initialize(actor_id)
- @portrait = BIO_IMAGES[actor_id]
- end
- def change_portrait(image)
- @portrait = image
- end
- def return_default_portrait
- @portrait = BIO_IMAGES[@id]
- end
- end
- #===============================================================================
- # Window Base
- #===============================================================================
- class Window_Base < Window
- include NFFM
- attr_accessor :meters
- attr_accessor :portrait
- def draw_friendship_gauge(friend_id, x, y, width = 120)
- friend = $game_friends[friend_id]
- gw = width * friend.rating / FULL_FRIEND_METER
- gc1 = text_color(METER_COLOR1)
- gc2 = text_color(METER_COLOR2)
- self.contents.fill_rect(x, y + WLH - 8, width, 6, text_color(METERBACK_COLOR))
- self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
- end
- def update_portrait
- if @portrait != nil
- @portrait.update
- end
- end
- def draw_friend_home(friend_id, x, y)
- hometown = $game_friends[friend_id].home
- self.contents.draw_text(x, y, self.width, WLH, FRIENDTOWNS[hometown])
- end
- def draw_friend_name(friend_id, x, y)
- name = $game_friends[friend_id].name
- self.contents.draw_text(x, y, self.width, WLH, name)
- end
- def draw_friend_portrait(friend_id, x, y)
- porport = Viewport.new(x, y, 272, 288)
- portsprite = Sprite.new(porport)
- portsprite.bitmap = Cache.picture(FRIEND_PORTRAITS[friend_id])
- portsprite.z = 101
- @portrait = portsprite
- end
- def clear_portrait
- if @portrait != nil
- @portrait.dispose
- end
- end
- end
- #===============================================================================
- # Scene Title
- #===============================================================================
- class Scene_Title < Scene_Base
- alias nffm_st_create_game_objects create_game_objects unless $@
- def create_game_objects
- nffm_st_create_game_objects
- $game_friends = Game_Friends.new
- end
- end
- #===============================================================================
- # Scene Map
- #===============================================================================
- class Scene_Map < Scene_Base
- include NFFM
- alias nffm_sm_start start unless $@
- def start
- nffm_sm_start
- $game_temp.quicku = false
- end
- alias nffm_sm_update update unless $@
- def update
- if $game_temp.from_friend
- open_quicku
- elsif $game_temp.quicku
- super
- update_quicku
- else
- nffm_sm_update
- end
- end
- alias nffm_sm_update_call_menu update_call_menu unless $@
- def update_call_menu
- if Input.trigger?(Input::B)
- if $game_switches[NFFM_SWITCH]
- return if $game_map.interpreter.running?
- return if $game_system.menu_disabled
- RPG::SE.new(OPENING_SE, 100, 80).play
- open_quicku
- else
- nffm_sm_update_call_menu
- end
- end
- end
- def open_quicku
- @win_quicku = Window_QuickMenu.new(200, 90)
- @win_quicku.active = true
- $game_temp.quicku = true
- $game_temp.from_friend = false
- end
- def update_quicku
- @win_quicku.update
- if Input.trigger?(Input::C)
- case @win_quicku.index
- when 0
- RPG::SE.new(OPENING_SE, 80, 80).play
- $scene = Scene_Bio.new(0)
- when 1
- if $game_party.total_friends > 0
- RPG::SE.new(OPENING_SE, 80, 80).play
- $scene = Scene_Friendships.new
- else
- Sound.play_buzzer
- end
- when 2...@win_quicku.commands_order.size
- wqc = @win_quicku.commands_order[@win_quicku.index]
- RPG::SE.new(OPENING_SE, 80, 80).play
- if wqc == 2
- $scene = Scene_Item.new
- elsif wqc == 3
- $scene = Scene_Skill.new
- elsif wqc == 4
- $scene = Scene_Equip.new
- elsif wqc == 5
- $scene = Scene_Status.new
- elsif wqc == 6
- $scene = Scene_File.new(true, false, false)
- elsif wqc == 7
- $scene = Scene_End.new
- end
- end
- elsif Input.trigger?(Input::B)
- RPG::SE.new(CANCEL_SE, 80, 80).play
- $scene = Scene_Map.new
- end
- end
- alias nffm_gm_terminate terminate unless $@
- def terminate
- if $game_temp.quicku
- @win_quicku.dispose
- $game_temp.quicku = false
- $game_temp.from_friend = false
- end
- nffm_gm_terminate
- end
- end
- #===============================================================================
- # Scene Item
- #===============================================================================
- class Scene_Item < Scene_Base
- include NFFM
- alias nffm_si_return_scene return_scene unless $@
- def return_scene
- if $game_switches[NFFM_SWITCH]
- $game_temp.from_friend = true
- $scene = Scene_Map.new
- else
- nffm_si_return_scene
- end
- end
- end
- #===============================================================================
- # Scene Skill
- #===============================================================================
- class Scene_Skill < Scene_Base
- include NFFM
- alias nffm_ss_return_scene return_scene unless $@
- def return_scene
- if $game_switches[NFFM_SWITCH]
- $game_temp.from_friend = true
- $scene = Scene_Map.new
- else
- nffm_ss_return_scene
- end
- end
- end
- #===============================================================================
- # Scene Equip
- #===============================================================================
- class Scene_Equip < Scene_Base
- include NFFM
- alias nffm_se_return_scene return_scene unless $@
- def return_scene
- if $game_switches[NFFM_SWITCH]
- $game_temp.from_friend = true
- $scene = Scene_Map.new
- else
- nffm_se_return_scene
- end
- end
- end
- #===============================================================================
- # Scene Status
- #===============================================================================
- class Scene_Status < Scene_Status
- include NFFM
- alias nffm_sstat_return_scene return_scene unless $@
- def return_scene
- if $game_switches[NFFM_SWITCH]
- $game_temp.from_friend = true
- $scene = Scene_Map.new
- else
- nffm_sstat_return_scene
- end
- end
- end
- #===============================================================================
- # Scene File
- #===============================================================================
- class Scene_File < Scene_Base
- include NFFM
- alias nffm_write_save_data write_save_data unless $@
- def write_save_data(file)
- nffm_write_save_data(file)
- Marshal.dump($game_friends, file)
- end
- #--------------------------------------------------------------------------
- # * Read Save Data (OVERWRITTEN)
- # file : file object for reading (opened)
- #--------------------------------------------------------------------------
- def read_save_data(file)
- characters = Marshal.load(file)
- Graphics.frame_count = Marshal.load(file)
- @last_bgm = Marshal.load(file)
- @last_bgs = Marshal.load(file)
- $game_system = Marshal.load(file)
- $game_message = Marshal.load(file)
- $game_switches = Marshal.load(file)
- $game_variables = Marshal.load(file)
- $game_self_switches = Marshal.load(file)
- $game_actors = Marshal.load(file)
- $game_party = Marshal.load(file)
- $game_troop = Marshal.load(file)
- $game_map = Marshal.load(file)
- $game_player = Marshal.load(file)
- $game_friends = Marshal.load(file)
- if $game_system.version_id != $data_system.version_id
- $game_map.setup($game_map.map_id)
- $game_player.center($game_player.x, $game_player.y)
- end
- end
- alias nffm_sf_return_scene return_scene unless $@
- def return_scene
- if $game_switches[NFFM_SWITCH]
- $game_temp.from_friend = true
- $scene = Scene_Map.new
- else
- nffm_sf_return_scene
- end
- end
- end
- #===============================================================================
- # Scene_End
- #===============================================================================
- class Scene_End < Scene_Base
- include NFFM
- alias nffm_send_return_scene return_scene unless $@
- def return_scene
- if $game_switches[NFFM_SWITCH]
- $game_temp.from_friend = true
- $scene = Scene_Map.new
- else
- nffm_send_return_scene
- end
- end
- end
- #===============================================================================
- # Window QuickMenu
- #===============================================================================
- class Window_QuickMenu < Window_Selectable
- include NFFM
- attr_reader :commands_order
- def initialize(x, y)
- super(x, y, QUICK_MENU_WIDTH, QUICK_MENU_HEIGHT)
- @commands = []
- get_commands
- @item_max = @commands.size
- unless MENU_SKIN == ""
- self.windowskin = Cache.system(MENU_SKIN)
- end
- refresh
- self.index = 0
- end
- def get_commands
- c1 = $game_party.members[0].name
- c2 = COMMAND_FRIENDSHIP
- shorts = [c1, c2]
- @commands.concat(shorts)
- if USE_INVENTORY
- @commands.push(Vocab::item)
- end
- if USE_SKILL
- @commands.push(Vocab::skill)
- end
- if USE_EQUIPMENT
- @commands.push(Vocab::equip)
- end
- if USE_STATUS
- @commands.push(Vocab::status)
- end
- if USE_SAVE
- @commands.push(Vocab::save)
- end
- if USE_END
- @commands.push(Vocab::game_end)
- end
- @commands_order = []
- @commands_order[0] = 0
- @commands_order[1] = 1
- for i in 2...@commands.size
- case @commands[i]
- when Vocab::item
- @commands_order[i] = 2
- when Vocab::skill
- @commands_order[i] = 3
- when Vocab::equip
- @commands_order[i] = 4
- when Vocab::status
- @commands_order[i] = 5
- when Vocab::save
- @commands_order[i] = 6
- when Vocab::game_end
- @commands_order[i] = 7
- end
- end
- end
- def refresh
- self.contents.clear
- create_contents
- for i in 0...@item_max
- draw_item(i)
- end
- end
- def draw_item(index)
- rect = item_rect(index)
- self.contents.clear_rect(rect)
- rect.x += 4
- rect.width -= 8
- self.contents.font.color = text_color(COMMANDS_COLOR)
- self.contents.draw_text(rect, @commands[index])
- end
- end
- #===============================================================================
- # Window Biography
- #===============================================================================
- class Window_Biography < Window_Base
- include NFFM
- def initialize(x, y)
- super(x, y, 544, 216)
- @actor = $game_party.members[0]
- unless BIO_SKIN == ""
- self.windowskin = Cache.system(BIO_SKIN)
- end
- refresh
- end
- def refresh
- self.contents.clear
- self.contents.font.size = BIO_FONTSIZE
- self.contents.font.color = text_color(BIO_TITLE_COLOR)
- self.contents.draw_text(-16, 0, self.width, 30, @actor.name + BIO_TITLE, 1)
- self.contents.font.size = BIO_FONTSIZE
- self.contents.font.color = normal_color
- self.contents.draw_paragraph(0, 35, self.width - 32, 116, ACTOR_BIOS[@actor.id])
- end
- end
- #===============================================================================
- # Window Portrait
- #===============================================================================
- class Window_Portrait < Window_Base
- include NFFM
- attr_accessor :bio_sprite
- def initialize(x, y, actor)
- super(x, y, 544, 200)
- @actor = actor
- unless BIO_SKIN == ""
- self.windowskin = Cache.system(BIO_SKIN)
- end
- refresh
- end
- def refresh
- self.contents.clear
- self.contents.font.size = 26
- self.contents.font.color = text_color(BIO_NAME_COLOR)
- self.contents.draw_text((self.width - 32) / 4, 0, self.width - 32, 30, @actor.name, 1)
- self.contents.font.size = BIO_FONTSIZE
- self.contents.font.color = system_color
- self.contents.draw_text((self.width - 32) / 4, 34, self.width - 32, BIO_FONTSIZE + 4, FRIENDCOUNT_STRING, 1)
- self.contents.font.color = normal_color
- move = FRIENDCOUNT_STRING.length
- self.contents.draw_text((self.width - 32) / 4, 64, self.width - 32, 30, $game_party.total_friends.to_s, 1)
- self.contents.font.size = 12
- port = Viewport.new(0, -50, 218, 236)
- port.z = 101
- @bio_sprite = Sprite.new(port)
- @bio_sprite.bitmap = Cache.picture(BIO_IMAGES[@actor.id])
- @bio_sprite.x = 0
- @bio_sprite.y = 0
- end
- end
- #===============================================================================
- # Scene Bio
- #===============================================================================
- class Scene_Bio < Scene_Base
- include NFFM
- def initialize(party_position)
- @actor = $game_party.members[party_position]
- end
- def start
- super
- create_menu_background
- @win_bio = Window_Biography.new(0, 201)
- @win_portrait = Window_Portrait.new(0, 0, @actor)
- end
- def update
- @win_portrait.bio_sprite.update
- if Input.trigger?(Input::B)
- RPG::SE.new(CANCEL_SE, 80, 80)
- $game_temp.from_friend = true
- $scene = Scene_Map.new
- end
- end
- def terminate
- @win_bio.dispose
- @win_portrait.bio_sprite.dispose
- @win_portrait.dispose
- end
- end
- #===============================================================================
- # Window_FriendCommands
- #===============================================================================
- class Window_FriendCommands < Window_Selectable
- include NFFM
- def initialize(x, y)
- if USE_STORYLINES
- super(x, y, 180, 326)
- else
- super(x, y, 180, 416)
- end
- @commands = []
- for i in 0...FRIENDS.size
- if $game_party.friends.include?(i)
- @commands.push($game_friends[$game_party.friends[i]].name)
- end
- end
- @item_max = @commands.size
- unless FRIEND_SKIN == ""
- self.windowskin = Cache.system(FRIEND_SKIN)
- end
- refresh
- self.index = 0
- end
- def refresh
- create_contents
- self.contents.clear
- for i in 0...@item_max
- draw_item(i)
- end
- end
- def draw_item(index, enabled = true)
- rect = item_rect(index)
- self.contents.clear_rect(rect)
- rect.x += 4
- rect.width -= 8
- self.contents.font.color = text_color(COMMANDS_COLOR)
- self.contents.draw_text(rect, @commands[index], 1)
- end
- end
- #===============================================================================
- # Window Storyline Command
- #===============================================================================
- class Window_StorylineCommand < Window_Selectable
- include NFFM
- def initialize(x, y)
- super(x, y, 180, 90)
- @commands = []
- @commands[0] = STORYLINE_TEXT
- @commands[1] = "Cancel"
- @item_max = @commands.size
- unless FRIEND_SKIN == ""
- self.windowskin = Cache.system(FRIEND_SKIN)
- end
- refresh
- self.index = 0
- end
- def refresh
- create_contents
- self.contents.clear
- for i in 0...@item_max
- draw_item(i)
- end
- end
- def draw_item(index, enabled = true)
- rect = item_rect(index)
- self.contents.clear_rect(rect)
- rect.x += 4
- rect.width -= 8
- self.contents.font.color = text_color(COMMANDS_COLOR)
- self.contents.draw_text(rect, @commands[index], 1)
- end
- end
- #===============================================================================
- # Window Friend Info
- #===============================================================================
- class Window_FriendInfo < Window_Base
- include NFFM
- def initialize(x, y)
- super(x, y, 364, 416)
- @friends = $game_friends
- unless FRIEND_SKIN == ""
- self.windowskin = Cache.system(FRIEND_SKIN)
- end
- end
- def create_friend_contents(friend_id)
- create_contents
- self.contents.clear
- if USE_FRIEND_PORTRAITS
- clear_portrait
- end
- id = friend_id
- friend = @friends[friend_id]
- self.contents.font.size = 26
- self.contents.font.color = text_color(FRIEND_TITLE_COLOR)
- draw_friend_name(id, 0, 0)
- if USE_FRIEND_PORTRAITS
- draw_friend_portrait(id, 225, 25)
- else
- draw_face(friend.face_name, friend.face_index, 25, 120, 96)
- end
- self.contents.font.color = system_color
- self.contents.font.size = 12
- self.contents.draw_text(0, 30, self.width, WLH, METER_TEXT)
- draw_friendship_gauge(id, (self.width - 32) - 180, 24, 200)
- if USE_HOMES
- self.contents.draw_text(0, 50, self.width, WLH, HOME_TEXT)
- end
- self.contents.font.color = normal_color
- self.contents.font.size = 12
- if USE_HOMES
- draw_friend_home(id, (self.width - 32) - 230, 50)
- end
- draw_character(friend.char_name, friend.char_index, self.width - 48, 56)
- self.contents.font.size = FRIEND_FONTSIZE
- self.contents.draw_paragraph(0, 250, self.width - 32, self.height - 80, friend.info)
- end
- end
- #===============================================================================
- # Window Storylines
- #===============================================================================
- class Window_Storylines < Window_Base
- include NFFM
- attr_accessor :story
- def initialize(x, y)
- super(x, y, 544, 416)
- unless FRIEND_SKIN == ""
- self.windowskin = Cache.system(FRIEND_SKIN)
- end
- @story = 0
- refresh
- end
- def refresh
- self.contents.clear
- unless @story == nil
- self.contents.font.color = normal_color
- self.contents.draw_paragraph(0, 0, 480, 380, $game_friends[@story].storyline)
- end
- end
- end
- #===============================================================================
- # Scene Friendships
- #===============================================================================
- class Scene_Friendships < Scene_Base
- include NFFM
- def start
- super
- @win_fcom = Window_FriendCommands.new(0, 0)
- @win_finfo = Window_FriendInfo.new(181, 0)
- if USE_STORYLINES
- @win_fslines = Window_StorylineCommand.new(0, 327)
- end
- @story_open = false
- @win_fcom.active = true
- end
- def update
- if @win_fcom.active
- @win_fcom.refresh
- @win_fcom.update
- @win_finfo.create_friend_contents($game_friends[$game_party.friends[@win_fcom.index]].id)
- @win_finfo.update_portrait
- if Input.trigger?(Input::B)
- RPG::SE.new(CANCEL_SE, 80, 80)
- $game_temp.quicku = true
- $game_temp.from_friend = true
- $scene = Scene_Map.new
- elsif Input.trigger?(Input::C)
- if USE_STORYLINES
- RPG::SE.new(OPENING_SE, 80, 80)
- make_storyline_active
- end
- end
- elsif USE_STORYLINES
- if @win_fslines.active
- @win_fslines.refresh
- @win_fslines.update
- if Input.trigger?(Input::B)
- RPG::SE.new(CANCEL_SE, 80, 80)
- make_commands_active
- elsif Input.trigger?(Input::C)
- RPG::SE.new(OPENING_SE, 80, 80)
- case @win_fslines.index
- when 0
- @win_story = Window_Storylines.new(0, 0)
- @win_story.story = $game_friends[$game_party.friends[@win_fcom.index]].id
- make_story_active
- @story_open = true
- when 1
- RPG::SE.new(CANCEL_SE, 80, 80)
- make_commands_active
- end
- end
- elsif @story_open
- @win_story.refresh
- if Input.trigger?(Input::B)
- RPG::SE.new(CANCEL_SE, 80, 80)
- make_storyline_active
- elsif Input.trigger?(Input::C)
- RPG::SE.new(CANCEL_SE, 80,80)
- make_storyline_active
- end
- end
- end
- end
- def make_storyline_active
- @win_fcom.active = false
- @win_fslines.active = true
- if @story_open
- $game_temp.storybase = -1
- @win_story.dispose
- @story_open = false
- end
- end
- def make_commands_active
- @win_fslines.active = false
- @win_fcom.active = true
- end
- def make_story_active
- @win_fslines.active = false
- @win_fcom.active = false
- end
- def terminate
- @win_fcom.dispose
- @win_finfo.contents.dispose
- @win_finfo.dispose
- if USE_STORYLINES
- @win_fslines.dispose
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement