Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
- # #
- # V's Relationships/Bio Window #
- # Version 2.4 #
- # #
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
- # Written By: V #
- # Last Edited: February 23, 2013 #
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
- # Special Thanks to: #
- # #
- # Tsukihime #
- # Poundcakery #
- # BigEd781 #
- # D&P3 #
- # Enelvon #
- # InternetAkias #
- # ReconVirus #
- # #
- #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
- #==============================================================================#
- #------------------------------------------------------------------------------#
- # ** Disclaimer #
- #------------------------------------------------------------------------------#
- # #
- # This script was intended for Non-commercial use only, if you wish to use #
- # this script in a commercial game please PM me at which ever site you found #
- # this script. Either way please give me credit in your game script as the #
- # writer of this script, and send me a PM abuot the release of the game/demo. #
- # #
- #------------------------------------------------------------------------------#
- # ** How To Use #
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
- # #
- # * To access this window use SceneManager.call(Scene_Relationships) #
- # * Remember to use "" before and after your name, title, face_name, loaction,#
- # descriptions current_status and bg's. #
- # * The favorite_gift, worst_gift, lv_4_gift, lv_8_gift, and lv_12_gift #
- # variables are the item index numbers found in the Items section of #
- # the RPGMVXA database. #
- # * If you choose not to use a title or one of the description just leave it #
- # blank when adding the relationship like so... "" #
- # #
- #------------------------------------------------------------------------------#
- # #
- # Use anyone of these commands in a script call. #
- # #
- #------------------------------------------------------------------------------#
- # #
- # * To add a new relationship use #
- # #
- # add_relationship( name, title, relationship_variable, #
- # relationship_level_variable, face_name, face_index, #
- # location, description1, description2, description3, #
- # description4, description5, description6, current_status, #
- # lv_4_gift, lv_8_gift, lv_12_gift, favorite_gift, worst_gift ) #
- # #
- # #
- # * After adding the relationship to change the current location use #
- # current_relationship_location( name, location ) #
- # #
- # * After adding the relationship to change the current status use #
- # current_relationship_status( name, current_status ) #
- # #
- # * After adding the relationship to use personalized leveling icons use #
- # personalize_lv_icons( name, lv_0, tier_1, tier_2, tier_3 ) #
- # #
- # * After adding the relationship to change the liked or disliked items use #
- # change_liked_item( name , item_index ) #
- # change_disliked_item( name , item_index ) #
- # #
- # * After adding the relationship to change the tier rewards use #
- # change_level_4_reward( name , item_index ) #
- # change_level_8_reward( name , item_index ) #
- # change_level_12_reward( name , item_index ) #
- # #
- #------------------------------------------------------------------------------#
- # ** Description #
- #------------------------------------------------------------------------------#
- # #
- # v0.1 #
- # ~=~=~=~ #
- # #
- # In v0.1, This window displays Relationships with with other actors. As of #
- # v0.1 the window displays the face of the npc, the name, the location, and a #
- # gauge to display if you are liked or disliked. the gauges controlled by game #
- # variables. #
- # #
- # v0.2 #
- # ~=~=~=~ #
- # #
- # In v0.2, I added a title/nick name text to be displayed next to the name and #
- # two lines for descriptions. Also with this upgrade I have added options to #
- # display feelings in one of three forms; gauges, text or a percentage. #
- # # #
- # v1.0 #
- # ~=~=~=~ #
- # #
- # In v1.0, I've added more description lines, favorite and hated gifts, a #
- # leveling system with rewards customizable to the person, and a current #
- # status text. Also I have add a script call to change the current status. #
- # #
- # v1.1 #
- # ~=~=~=~ #
- # #
- # In v1.1, I fied a few bug that I found. #
- # #
- # v1.2 #
- # ~=~=~=~ #
- # #
- # In v1.2, I add an option to display a normal gauge instead of using #
- # love/hate polarities and an option to display an item icon next to the #
- # name in the reward window. #
- # #
- # v2.0 #
- # ~=~=~=~ #
- # #
- # In v2.0, I rewrote a lot of the script and add options to display everything #
- # with the exception of the Face, Name, and Description. I have also added an #
- # option to use the leveling system. I have also add a few new commands to #
- # use personalized level icons and change the location, current status, liked #
- # and disliked items, and the level up tier rewards. #
- # #
- # v2.1 #
- # ~=~=~=~ #
- # #
- # In v2.1, I set up all the sounds to run the same as the rest of the script, #
- # I also added the ability to shift threw the detail pages with out having to #
- # back out and reselectand fixed the menu command placement. #
- # #
- # v2.2 #
- # ~=~=~=~ #
- # #
- # In v2.2, I fixed an issue with the sound bugging out and the level up button #
- # remaining lit up when a relationship hit level twelve. I also fixed an issue #
- # with the icons layering instead of just drawing right proper one, once a #
- # relationship passed level five. #
- # #
- # v2.3 #
- # ~=~=~=~ #
- # #
- # In v2.3, I added a mastered icon and text once a relationship is mastered. I #
- # also made the menu command appear once a relationship is added. #
- # #
- # v2.4 #
- # ~=~=~=~ #
- # #
- # In v2.4, I added an option to use the original blurred bg from the main menu.#
- # I also added an $import for future compatibilities. #
- # #
- #------------------------------------------------------------------------------#
- #==============================================================================#
- ($imported ||= {})[:v_relationships] = true
- #==============================================================================
- # ** V's Relationship's Window Module
- #------------------------------------------------------------------------------
- # This module manages customizable features and methods.
- #==============================================================================
- module V_Relationships
- module Specs
- #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
- # #
- # Start Customizable Area. #
- # #
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
- # #
- # ONLY EDIT AFTER THE EQUALS SYMBOL. #
- # #
- #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
- #============================================================================
- # Use Regular Blurred Menu Background
- #============================================================================
- Use_Custom_Background = false
- #============================================================================
- # Name Of The File Used For Background
- #============================================================================
- Background = "StarlitSky"
- #============================================================================
- # Title of the Relationship Window
- #============================================================================
- Window_Title = "Relationships"
- #============================================================================
- # Use Menu Command For Access
- # ~=~=~=~=~=~=~=~=~=~=~=~=~=~
- # If you choose not to use a window command you can still access the window
- # by using SceneManager.call(Scene_Relationships)
- #============================================================================
- Use_Menu_Command = true
- #============================================================================
- # Use Level System
- #============================================================================
- Use_Leveling_System = true
- #============================================================================
- # Name Of The Feeling If Text Is Used
- #============================================================================
- Terms_Of_Feelings = ["Hated", "Disliked", "None", "Liked", "Loved"]
- #============================================================================
- # Name Of The Mastered Text If Leveling System is used
- #============================================================================
- Term_Of_Mastered = "Mastered"
- #============================================================================
- # Use Polarities
- # ~=~=~=~=~=~=~=~=~
- # If true will display a gauge with love/hate polarities, If it is false a
- # normal guage will be used.
- #============================================================================
- Use_Polarities = true
- #============================================================================
- # Information Displayed
- # ~=~=~=~=~=~=~=~=~=~=~=~
- # If Use_Leveling_System = false, Use_Level_Icons will automatically be false
- #============================================================================
- Use_Level_Icons = true
- Use_Title = true
- Use_Location = true
- Use_Liked_and_Disliked_Items = true
- Use_Feelings = true
- Use_Current_Status = true
- Use_Gauges = true
- #============================================================================
- # Use Reward Item Icons
- #============================================================================
- Use_Icons = true
- #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
- # #
- # End Customizable Area. #
- # #
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
- # #
- # DO NOT EDIT PAST THIS POINT UNLESS YOU KNOW WHAT YOUR DOING. #
- # #
- #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
- end
- end
- #==============================================================================
- # ** Window Reward
- #------------------------------------------------------------------------------
- # This window displays the Relationship info.
- #==============================================================================
- class Window_Reward < Window_Base
- #--------------------------------------------------------------------------
- # * Includes Module's Variables With Class
- #--------------------------------------------------------------------------
- include V_Relationships::Specs
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(x, y, w, h)
- super(x, y, w, h)
- draw_reward
- end
- #--------------------------------------------------------------------------
- # * Draw Reward
- #--------------------------------------------------------------------------
- def draw_reward
- id = $game_system.relationship_counter
- lvvar = $game_variables[$game_system.relationship_info[id][:var_level_id]]
- dfs = Font.default_size
- item = $data_items[$game_system.relationship_info[id][:lv_4_gift]] if lvvar == 4
- item = $data_items[$game_system.relationship_info[id][:lv_8_gift]] if lvvar == 8
- item = $data_items[$game_system.relationship_info[id][:lv_12_gift]] if lvvar == 12
- Font.default_size = 16
- draw_text_ex(10, 5, "Reward:")
- draw_text(15, 25, 120, 42, item.name, 1)
- Font.default_size = dfs
- draw_icon(item.icon_index, 0, 30, 120) if Use_Icons
- end
- end
- #==============================================================================
- # ** Window Relationship Level Up
- #------------------------------------------------------------------------------
- # This window displays the Relationship info.
- #==============================================================================
- class Window_Relationship_Lv_Up < Window_Base
- #--------------------------------------------------------------------------
- # * Includes Module's Variables With Class
- #--------------------------------------------------------------------------
- include V_Relationships::Specs
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(x, y, w, h)
- super(x, y, w, h)
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_lv_up
- end
- #--------------------------------------------------------------------------
- # * Draw Gray Text with Control Characters
- #--------------------------------------------------------------------------
- def draw_text_ex_gray(x, y, text)
- change_color(gauge_back_color)
- text = convert_escape_characters(text)
- pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
- process_character(text.slice!(0, 1), text, pos) until text.empty?
- reset_font_settings
- end
- #--------------------------------------------------------------------------
- # * Draw Level Up
- #--------------------------------------------------------------------------
- def draw_lv_up
- id = $game_system.relationship_counter
- varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
- lvvar = $game_variables[$game_system.relationship_info[id][:var_level_id]]
- draw_text_ex_gray(8, -5, "Level Up") unless varnum >= 100
- draw_text_ex_gray(8, -5, "Level Up") if lvvar == 12
- draw_text_ex(8, -5, "Level Up") if varnum >= 100 && lvvar != 12
- end
- #--------------------------------------------------------------------------
- # * Update
- #--------------------------------------------------------------------------
- def update
- super
- refresh if Input.press?(:C)
- end
- end
- #==============================================================================
- # ** Window Relationship Title
- #------------------------------------------------------------------------------
- # This window displays the Relationship Title.
- #==============================================================================
- class Window_Relationship_Details < Window_Base
- #--------------------------------------------------------------------------
- # * Includes Module's Variables With Class
- #--------------------------------------------------------------------------
- include V_Relationships::Specs
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(x, y, w, h)
- super(x, y, w, h)
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_relationship_details_top
- draw_relationship_details_bottom
- end
- #--------------------------------------------------------------------------
- # * Draw Gray Text with Control Characters
- #--------------------------------------------------------------------------
- def draw_text_ex_gray(x, y, text)
- change_color(gauge_back_color)
- text = convert_escape_characters(text)
- pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
- process_character(text.slice!(0, 1), text, pos) until text.empty?
- reset_font_settings
- end
- #--------------------------------------------------------------------------
- # * Draw Red Text with Control Characters
- #--------------------------------------------------------------------------
- def draw_text_ex_red(x, y, text)
- change_color(knockout_color)
- text = convert_escape_characters(text)
- pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
- process_character(text.slice!(0, 1), text, pos) until text.empty?
- reset_font_settings
- end
- #--------------------------------------------------------------------------
- # * Draw Blue Text with Control Characters
- #--------------------------------------------------------------------------
- def draw_text_ex_blue(x, y, text)
- change_color(mp_gauge_color1)
- text = convert_escape_characters(text)
- pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
- process_character(text.slice!(0, 1), text, pos) until text.empty?
- reset_font_settings
- end
- #--------------------------------------------------------------------------
- # * Draw Blue Text with Control Characters
- #--------------------------------------------------------------------------
- def draw_text_ex_yellow(x, y, text)
- change_color(crisis_color)
- text = convert_escape_characters(text)
- pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
- process_character(text.slice!(0, 1), text, pos) until text.empty?
- reset_font_settings
- end
- #--------------------------------------------------------------------------
- # * Draw Gauge
- # rate : Rate (full at 1.0)
- # color1 : Left side gradation
- # color2 : Right side gradation
- #--------------------------------------------------------------------------
- def draw_gauge(x, y, width, rate, color1, color2)
- fill_w = (width * rate).to_i
- gauge_y = y + line_height - 8
- contents.fill_rect(x, gauge_y, width, 15, gauge_back_color)
- contents.gradient_fill_rect(x, gauge_y, fill_w, 15, color1, color2)
- end
- #--------------------------------------------------------------------------
- # * Draw Horizontal Line
- #--------------------------------------------------------------------------
- def draw_horz_line(y)
- line_y = y + line_height / 2 - 1
- contents.fill_rect(22, line_y, 490, 2, line_color)
- end
- #--------------------------------------------------------------------------
- # * Get Color of Horizontal Line
- #--------------------------------------------------------------------------
- def line_color
- color = normal_color
- color.alpha = 200
- color
- end
- #--------------------------------------------------------------------------
- # * Draw Relationship Details Top
- #--------------------------------------------------------------------------
- def draw_relationship_details_top
- draw_relationship_face
- draw_name
- draw_title if Use_Title
- draw_feelings if Use_Feelings
- draw_location if Use_Location
- if Use_Leveling_System
- draw_level_icons if Use_Level_Icons
- end
- draw_relationship_gauge if Use_Gauges
- draw_horz_line(110)
- end
- #--------------------------------------------------------------------------
- # * Draw Relationship Details Bottom
- #--------------------------------------------------------------------------
- def draw_relationship_details_bottom
- draw_current_status if Use_Current_Status
- draw_likes_and_dislikes if Use_Liked_and_Disliked_Items
- draw_description
- end
- #--------------------------------------------------------------------------
- # * Draw Face of Current Relationship
- #--------------------------------------------------------------------------
- def draw_relationship_face
- id = $game_system.relationship_counter
- varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
- draw_face($game_system.relationship_info[id][:face_name], $game_system.relationship_info[id][:face_index], 10, 10, enabled = true)
- end
- #--------------------------------------------------------------------------
- # * Draw Name of Current Relationship
- #--------------------------------------------------------------------------
- def draw_name
- id = $game_system.relationship_counter
- varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
- dfs = Font.default_size
- Font.default_size = 30
- draw_text_ex(115, 10, $game_system.relationship_info[id][:name]) if $game_system.relationship_info[id].has_key?(:name)
- Font.default_size = dfs
- end
- #--------------------------------------------------------------------------
- # * Draw Title of Current Relationship
- #--------------------------------------------------------------------------
- def draw_title
- id = $game_system.relationship_counter
- varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
- dfs = Font.default_size
- Font.default_size = 16
- draw_text_ex(115, 32, $game_system.relationship_info[id][:title]) if $game_system.relationship_info[id].has_key?(:title)
- Font.default_size = dfs
- end
- #--------------------------------------------------------------------------
- # * Draw Location
- #--------------------------------------------------------------------------
- def draw_location
- dfs = Font.default_size
- id = $game_system.relationship_counter
- varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
- Font.default_size = 16
- draw_text_ex(120, 80, "Location: ")
- draw_text_ex(130, 95, $game_system.relationship_info[id][:location]) if $game_system.relationship_info[id].has_key?(:location)
- Font.default_size = dfs
- end
- #--------------------------------------------------------------------------
- # * Draw Feelings
- #--------------------------------------------------------------------------
- def draw_feelings
- fx = 360
- fy = 74
- dfs = Font.default_size
- id = $game_system.relationship_counter
- varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
- Font.default_size = 16
- draw_text_ex(fx - 70, fy, "Feelings: ")
- if varnum == 0
- draw_text_ex_blue(fx, fy, Terms_Of_Feelings[0])
- elsif varnum > 0 && varnum < 50
- draw_text_ex(fx, fy, Terms_Of_Feelings[1])
- elsif varnum == 50
- draw_text_ex(fx, fy, Terms_Of_Feelings[2])
- elsif varnum > 50 && varnum >= 100
- draw_text_ex(fx, fy, Terms_Of_Feelings[3])
- elsif varnum == 100
- draw_text_ex_red(fx, fy, Terms_Of_Feelings[4])
- end
- Font.default_size = dfs
- end
- #--------------------------------------------------------------------------
- # * Draw Level Icons
- #--------------------------------------------------------------------------
- def draw_level_icons
- ix = 115
- iy = 55
- mx = 200
- id = $game_system.relationship_counter
- relationship = $game_system.relationship_info[id]
- varnum = $game_variables[relationship[:var_id]]
- lvvar = $game_variables[relationship[:var_level_id]]
- mastered_icon = relationship[:mastered_icons]
- if lvvar >= 12 && relationship.has_key?(:mastered_icons)
- draw_icon(mastered_icon, mx, iy)
- draw_text_ex_yellow(mx + 30, iy, Term_Of_Mastered)
- elsif lvvar >= 12 && relationship.has_key?(:mastered_icons) == false
- draw_icon(495, mx, iy)
- draw_text_ex_yellow(mx + 30, iy + 5, Term_Of_Mastered)
- end
- if relationship.has_key?(:icons)
- lv_0 = relationship[:icons][0]
- tier_1 = relationship[:icons][1]
- tier_2 = relationship[:icons][2]
- tier_3 = relationship[:icons][3]
- draw_icon(lv_0, ix, iy) if lvvar == 0
- draw_icon(tier_1, ix, iy) if lvvar >= 1 && lvvar < 5
- draw_icon(tier_1, ix + 20, iy) if lvvar >= 2 && lvvar < 6
- draw_icon(tier_1, ix + 40, iy) if lvvar >= 3 && lvvar < 7
- draw_icon(tier_1, ix + 60, iy) if lvvar >= 4 && lvvar < 8
- draw_icon(tier_2, ix, iy) if lvvar >= 5 && lvvar < 9
- draw_icon(tier_2, ix + 20, iy) if lvvar >= 6 && lvvar < 10
- draw_icon(tier_2, ix + 40, iy) if lvvar >= 7 && lvvar < 11
- draw_icon(tier_2, ix + 60, iy) if lvvar >= 8 && lvvar < 12
- draw_icon(tier_3, ix, iy) if lvvar >= 9
- draw_icon(tier_3, ix + 20, iy) if lvvar >= 10
- draw_icon(tier_3, ix + 40, iy) if lvvar >= 11
- draw_icon(tier_3, ix + 60, iy) if lvvar >= 12
- elsif relationship.has_key?(:icons) == false
- draw_icon(123, ix, iy) if lvvar == 0
- draw_icon(124, ix + 10, iy) if lvvar == 0
- draw_icon(127, ix, iy) if lvvar >= 1 && lvvar < 5
- draw_icon(127, ix + 20, iy) if lvvar >= 2 && lvvar < 6
- draw_icon(127, ix + 40, iy) if lvvar >= 3 && lvvar < 7
- draw_icon(127, ix + 60, iy) if lvvar >= 4 && lvvar < 8
- draw_icon(126, ix, iy) if lvvar >= 5 && lvvar < 9
- draw_icon(126, ix + 20, iy) if lvvar >= 6 && lvvar < 10
- draw_icon(126, ix + 40, iy) if lvvar >= 7 && lvvar < 11
- draw_icon(126, ix + 60, iy) if lvvar >= 8 && lvvar < 12
- draw_icon(125, ix, iy) if lvvar >= 9
- draw_icon(125, ix + 20, iy) if lvvar >= 10
- draw_icon(125, ix + 40, iy) if lvvar >= 11
- draw_icon(125, ix + 60, iy) if lvvar >= 12
- end
- end
- #--------------------------------------------------------------------------
- # * Draw Relationship Gauge
- #--------------------------------------------------------------------------
- def draw_relationship_gauge
- x = 165
- y = 80
- id = $game_system.relationship_counter
- varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
- lvvar = $game_variables[$game_system.relationship_info[id][:var_level_id]]
- rate = varnum.to_f / 100 unless varnum >= 100
- rate = 1 / 1 if varnum >= 100
- if Use_Polarities
- draw_gauge(x + 125, y, 200, 1, gauge_back_color, gauge_back_color)
- draw_gauge(x + 125, y, 105, 1, mp_gauge_color1, mp_gauge_color1) if varnum == 0
- draw_gauge(x + 225, y, 100, 1, knockout_color, knockout_color) if varnum >= 100
- draw_gauge(x + 125 + (varnum * 2), y, 100 - (varnum * 2), 1, mp_gauge_color1, normal_color) if varnum < 50 && varnum > 0
- draw_gauge(x + 220, y, 2 * ( varnum - 50), 1, normal_color, knockout_color) if varnum > 50 && varnum < 100
- draw_gauge(x + 220, y, 10, 1, normal_color, normal_color) if varnum == 50
- else
- draw_gauge(x + 125, y, 200, rate, normal_color, knockout_color)
- end
- end
- #--------------------------------------------------------------------------
- # * Draw Current Status
- #--------------------------------------------------------------------------
- def draw_current_status
- dfs = Font.default_size
- id = $game_system.relationship_counter
- varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
- Font.default_size = 16
- draw_text_ex(50, 135, "Current Status: ") if $game_system.relationship_info[id].has_key?(:current_status)
- draw_text_ex(60, 150, $game_system.relationship_info[id][:current_status]) if $game_system.relationship_info[id].has_key?(:current_status)
- Font.default_size = dfs
- end
- #--------------------------------------------------------------------------
- # * Draw Liked and Disliked Items
- #--------------------------------------------------------------------------
- def draw_likes_and_dislikes
- dfs = Font.default_size
- id = $game_system.relationship_counter
- relationship = $game_system.relationship_info[id]
- varnum = $game_variables[relationship[:var_id]]
- likes = $data_items[relationship[:likes]]
- dislikes = $data_items[relationship[:dislikes]]
- Font.default_size = 16
- draw_text_ex(320, 135, "Likes: ") if relationship.has_key?(:likes)
- draw_text_ex(345, 150, likes.name) if relationship.has_key?(:likes)
- draw_text_ex(400, 135, "Dislikes: ") if relationship.has_key?(:dislikes)
- draw_text_ex(445, 150, dislikes.name) if relationship.has_key?(:dislikes)
- Font.default_size = dfs
- end
- #--------------------------------------------------------------------------
- # * Draw Description
- #--------------------------------------------------------------------------
- def draw_description
- id = $game_system.relationship_counter
- relationship = $game_system.relationship_info[id]
- varnum = $game_variables[relationship[:var_id]]
- draw_text_ex(60, 190, relationship[:description1]) if relationship.has_key?(:description1)
- draw_text_ex(60, 210, relationship[:description2]) if relationship.has_key?(:description2)
- draw_text_ex(60, 230, relationship[:description3]) if relationship.has_key?(:description3)
- draw_text_ex(60, 250, relationship[:description4]) if relationship.has_key?(:description4)
- draw_text_ex(60, 270, relationship[:description5]) if relationship.has_key?(:description5)
- draw_text_ex(60, 290, relationship[:description6]) if relationship.has_key?(:description6)
- end
- end
- #==============================================================================
- # ** Window Relationship Select
- #------------------------------------------------------------------------------
- # This window displays the Relationship info.
- #==============================================================================
- class Window_Relationship_Select < Window_Base
- #--------------------------------------------------------------------------
- # * Includes Module's Variables With Class
- #--------------------------------------------------------------------------
- include V_Relationships::Specs
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(x, y, w, h)
- super(x, y, w, h)
- end
- end
- #==============================================================================
- # ** Window Relationship Title
- #------------------------------------------------------------------------------
- # This window displays the Relationship Title.
- #==============================================================================
- class Window_Relationship_Title < Window_Base
- #--------------------------------------------------------------------------
- # * Includes Module's Variables With Class
- #--------------------------------------------------------------------------
- include V_Relationships::Specs
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(x, y, w, h)
- super(x, y, w, h)
- draw_relationship_title
- end
- #--------------------------------------------------------------------------
- # * Draw Relationship Title
- #--------------------------------------------------------------------------
- def draw_relationship_title
- make_font_bigger
- draw_text(-15, -20, 544, 90, Window_Title, 1)
- make_font_smaller
- end
- end
- #==============================================================================
- # ** Window Relationship Info
- #------------------------------------------------------------------------------
- # This window displays the Relationship info.
- #==============================================================================
- class Window_Relationship_Info < Window_Base
- #--------------------------------------------------------------------------
- # * Includes Module's Variables With Class
- #--------------------------------------------------------------------------
- include V_Relationships::Specs
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(x, y, w, h)
- super(x, y - 25, w, h)
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- draw_relationship_info
- end
- #--------------------------------------------------------------------------
- # * Draw Blue Text with Control Characters
- #--------------------------------------------------------------------------
- def draw_text_ex_yellow(x, y, text)
- change_color(crisis_color)
- text = convert_escape_characters(text)
- pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
- process_character(text.slice!(0, 1), text, pos) until text.empty?
- reset_font_settings
- end
- #--------------------------------------------------------------------------
- # * Draw Gauge
- # rate : Rate (full at 1.0)
- # color1 : Left side gradation
- # color2 : Right side gradation
- #--------------------------------------------------------------------------
- def draw_gauge(x, y, width, rate, color1, color2)
- fill_w = (width * rate).to_i
- gauge_y = y + line_height - 8
- contents.fill_rect(x, gauge_y, width, 15, gauge_back_color)
- contents.gradient_fill_rect(x, gauge_y, fill_w, 15, color1, color2)
- end
- #--------------------------------------------------------------------------
- # * Draw Relationship Info
- #--------------------------------------------------------------------------
- def draw_relationship_info
- x = 50
- y_start = -100 + (line_height * 1 + self.oy )
- pad = 3
- height = 105
- i = 1
- like_gauge = 0
- dislike_gauge = 0
- $game_system.relationship_info.each_key do |id|
- dfs = Font.default_size
- filler = 1 / 1
- varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
- rate = varnum.to_f / 100 unless varnum >= 100
- rate = 1 / 1 if varnum >= 100
- y = y_start + height * i + pad * i
- draw_face($game_system.relationship_info[id][:face_name], $game_system.relationship_info[id][:face_index], x, y - 20, enabled = true)
- draw_text_ex(x + 105, y - 20, $game_system.relationship_info[id][:name])
- Font.default_size = 16
- draw_text_ex(x + 105, y - 3, $game_system.relationship_info[id][:title]) if Use_Title
- draw_text_ex(x + 105, y + 13, "Current Status: ") if Use_Current_Status
- draw_text_ex(x + 175, y + 28, $game_system.relationship_info[id][:current_status]) if Use_Current_Status
- Font.default_size = dfs
- if Use_Level_Icons
- relationship = $game_system.relationship_info[id]
- lvvar = $game_variables[relationship[:var_level_id]]
- mastered_icon = relationship[:mastered_icons]
- if lvvar >= 12 && relationship.has_key?(:mastered_icons)
- draw_icon(mastered_icon, x + 300, y - 20)
- draw_text_ex_yellow(x + 330, y - 15, Term_Of_Mastered)
- elsif lvvar >= 12 && relationship.has_key?(:mastered_icons) == false
- draw_icon(495, x + 300, y - 20)
- draw_text_ex_yellow(x + 330, y - 15, Term_Of_Mastered)
- end
- end
- if Use_Gauges && Use_Polarities
- draw_gauge(x + 125, y + 40, 200, 1, gauge_back_color, gauge_back_color)
- draw_gauge(x + 125, y + 40, 105, 1, mp_gauge_color1, mp_gauge_color1) if varnum == 0
- draw_gauge(x + 225, y + 40, 100, 1, knockout_color, knockout_color) if varnum >= 100
- draw_gauge(x + 125 + (varnum * 2), y + 40, 100 - (varnum * 2), 1, mp_gauge_color1, normal_color) if varnum < 50 && varnum > 0
- draw_gauge(x + 220, y + 40, 2 * ( varnum - 50), 1, normal_color, knockout_color) if varnum > 50 && varnum < 100
- draw_gauge(x + 220, y + 40, 10, 1, normal_color, normal_color) if varnum == 50
- elsif Use_Gauges && Use_Polarities == false
- draw_gauge(x + 125, y + 40, 200, rate, normal_color, knockout_color)
- end
- i += 1
- end
- end
- #--------------------------------------------------------------------------
- # * Process Cursor Move
- #--------------------------------------------------------------------------
- def process_cursor_move
- if ((Input.press?(:UP)) if Input.repeat?(:UP)) && self.oy > 0
- self.oy -= 108
- Sound.play_cursor
- $game_system.relationship_counter -= 1
- elsif ((Input.press?(:DOWN)) if Input.repeat?(:DOWN)) && contents_height / 2 - 175 >= self.oy
- self.oy += 108
- Sound.play_cursor
- $game_system.relationship_counter += 1
- end
- end
- #--------------------------------------------------------------------------
- # * Update
- #--------------------------------------------------------------------------
- def update
- super
- process_cursor_move
- end
- end
- #==============================================================================
- # ** Scene Relationship Details
- #------------------------------------------------------------------------------
- # This class performs Relationships scene processing.
- #==============================================================================
- class Scene_Relationship_Details < Scene_MenuBase
- #--------------------------------------------------------------------------
- # * Includes Module's Variables With Class
- #--------------------------------------------------------------------------
- include V_Relationships::Specs
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- def start
- super
- $c = 0
- create_relationship_details_window
- create_relationship_lv_up_window if Use_Leveling_System
- #--------------------------------------------------------------------------
- # * Background Processing
- #--------------------------------------------------------------------------
- if Use_Custom_Background != true
- @relationship_details_bg = Sprite.new
- @relationship_details_bg.bitmap = SceneManager.background_bitmap
- @relationship_details_bg.color.set(16, 16, 16, 128)
- else
- @relationship_details_bg = Sprite.new
- @relationship_details_bg.bitmap = Cache.picture(Background)
- @relationship_details_bg.x = 0
- @relationship_details_bg.y = 0
- @relationship_details_bg.zoom_x = ( Graphics.width.to_f / 544 )
- @relationship_details_bg.zoom_y = ( Graphics.height.to_f / 416 )
- @relationship_details_bg.opacity = 255
- @relationship_details_bg.visible = true
- end
- end
- #--------------------------------------------------------------------------
- # * Check For Reward
- #--------------------------------------------------------------------------
- def check_for_reward
- id = $game_system.relationship_counter
- relationship = $game_system.relationship_info[id]
- lvvar = $game_variables[relationship[:var_level_id]]
- if lvvar == 4
- item = relationship[:lv_4_gift]
- $game_party.gain_item($data_items[item], 1)
- create_reward_window
- RPG::ME.new("Fanfare3", 80, 115).play
- elsif lvvar == 8
- item = relationship[:lv_8_gift]
- $game_party.gain_item($data_items[item], 1)
- create_reward_window
- RPG::ME.new("Fanfare3", 80, 115).play
- elsif lvvar == 12
- item = relationship[:lv_12_gift]
- $game_party.gain_item($data_items[item], 1)
- create_reward_window
- RPG::ME.new("Fanfare3", 80, 115).play
- else
- RPG::ME.new("Item", 80, 100).play
- end
- end
- #--------------------------------------------------------------------------
- # * Create Relationship Level Up Window
- #--------------------------------------------------------------------------
- def create_reward_window
- @reward_window = Window_Reward.new(200, 180, 160, 90)
- @reward_window.back_opacity = 255
- $c = 1
- end
- #--------------------------------------------------------------------------
- # * Create Relationship Level Up Window
- #--------------------------------------------------------------------------
- def create_relationship_lv_up_window
- @relationship_lv_up_window = Window_Relationship_Lv_Up.new(220, 355, 120, 42)
- @relationship_lv_up_window.back_opacity = 0
- end
- #--------------------------------------------------------------------------
- # * Create Relationship Details Window
- #--------------------------------------------------------------------------
- def create_relationship_details_window
- @relationship_details_window = Window_Relationship_Details.new(0, 0, 544, 416)
- @relationship_details_window.back_opacity = 0
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- super()
- $c += 1 if $c != 0
- return_scene && $c = 0 if $c == 300
- id = $game_system.relationship_counter
- varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
- if Input.trigger?(:R) && $game_system.relationship_info.size != 1 && $game_system.relationship_counter < $game_system.relationship_info.size
- $game_system.relationship_counter += 1
- @relationship_lv_up_window.refresh
- @relationship_details_window.refresh
- Sound.play_cursor
- elsif Input.trigger?(:R) && $game_system.relationship_info.size != 1 && $game_system.relationship_counter == $game_system.relationship_info.size
- $game_system.relationship_counter = 1
- @relationship_lv_up_window.refresh
- @relationship_details_window.refresh
- Sound.play_cursor
- elsif Input.trigger?(:L) && $game_system.relationship_info.size != 1 && $game_system.relationship_counter > 1
- $game_system.relationship_counter -= 1
- @relationship_lv_up_window.refresh
- @relationship_details_window.refresh
- Sound.play_cursor
- elsif Input.trigger?(:L) && $game_system.relationship_info.size != 1 && $game_system.relationship_counter == 1
- $game_system.relationship_counter = $game_system.relationship_info.size
- @relationship_lv_up_window.refresh
- @relationship_details_window.refresh
- Sound.play_cursor
- elsif Input.trigger?(:B)
- Sound.play_cancel
- $game_system.relationship_counter = 1
- return_scene
- elsif Input.trigger?(:C) && varnum >= 100 && $game_variables[$game_system.relationship_info[id][:var_level_id]] < 12 && Use_Leveling_System
- $game_variables[$game_system.relationship_info[id][:var_id]] = 0 unless Use_Polarities
- $game_variables[$game_system.relationship_info[id][:var_id]] = 50 if Use_Polarities
- $game_variables[$game_system.relationship_info[id][:var_level_id]] += 1
- check_for_reward
- @relationship_details_window.refresh
- @relationship_lv_up_window.refresh
- elsif Input.trigger?(:C) && (varnum != 100 || $game_variables[$game_system.relationship_info[id][:var_level_id]] == 12)
- Sound.play_cancel
- end
- end
- end
- #==============================================================================
- # ** Scene Relationships
- #------------------------------------------------------------------------------
- # This class performs Relationships scene processing.
- #==============================================================================
- class Scene_Relationships < Scene_MenuBase
- #--------------------------------------------------------------------------
- # * Includes Module's Variables With Class
- #--------------------------------------------------------------------------
- include V_Relationships::Specs
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- def start
- super
- create_relationship_title_window
- create_relationship_info_window
- create_relationship_select_window
- #--------------------------------------------------------------------------
- # * Background Processing
- #--------------------------------------------------------------------------
- if Use_Custom_Background != true
- @relationship_bg = Sprite.new
- @relationship_bg.bitmap = SceneManager.background_bitmap
- @relationship_bg.color.set(16, 16, 16, 128)
- else
- @relationship_bg = Sprite.new
- @relationship_bg.bitmap = Cache.picture(Background)
- @relationship_bg.x = 0
- @relationship_bg.y = 0
- @relationship_bg.zoom_x = ( Graphics.width.to_f / 544 )
- @relationship_bg.zoom_y = ( Graphics.height.to_f / 416 )
- @relationship_bg.opacity = 255
- @relationship_bg.visible = true
- end
- end
- #--------------------------------------------------------------------------
- # * Create Relationship Title Window
- #--------------------------------------------------------------------------
- def create_relationship_title_window
- @relationship_title_window = Window_Relationship_Title.new(0, 0, 544, 90)
- @relationship_title_window.opacity = 0
- end
- #--------------------------------------------------------------------------
- # * Create Relationship Info Window
- #--------------------------------------------------------------------------
- def create_relationship_info_window
- @relationship_info_window = Window_Relationship_Info.new(0, 90, 544, ($game_system.relationship_info.size*215) + 70)
- @relationship_info_window.opacity = 0
- end
- #--------------------------------------------------------------------------
- # * Create Relationship Select Window
- #--------------------------------------------------------------------------
- def create_relationship_select_window
- @relationship_select_window = Window_Relationship_Select.new(55, 80, 415, 114)
- @relationship_select_window.back_opacity = 0
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- super()
- if Input.trigger?(:B)
- Sound.play_cancel
- $game_system.relationship_counter = 1
- return_scene
- elsif Input.trigger?(:C)
- Sound.play_ok
- SceneManager.call(Scene_Relationship_Details)
- end
- end
- end
- #==============================================================================
- # ** Window_MenuCommand
- #------------------------------------------------------------------------------
- # This command window appears on the menu screen.
- #==============================================================================
- class Window_MenuCommand < Window_Command
- #--------------------------------------------------------------------------
- # * Includes Module's Variables With Class
- #--------------------------------------------------------------------------
- include V_Relationships::Specs
- #--------------------------------------------------------------------------
- # * For Creating An Alias
- #--------------------------------------------------------------------------
- alias v_relationships_winmenucmmd_aoc_13215 add_original_commands
- #--------------------------------------------------------------------------
- # * For Adding Original Commands
- #--------------------------------------------------------------------------
- def add_original_commands
- v_relationships_winmenucmmd_aoc_13215
- add_command(Window_Title, :relationships) unless $game_system.relationship_size == 1
- end
- end
- #==============================================================================
- # ** Scene_Menu
- #------------------------------------------------------------------------------
- # This class performs the menu screen processing.
- #==============================================================================
- class Scene_Menu < Scene_MenuBase
- #--------------------------------------------------------------------------
- # * Includes Module's Variables With Class
- #--------------------------------------------------------------------------
- include V_Relationships::Specs
- #--------------------------------------------------------------------------
- # * For Creating An Alias
- #--------------------------------------------------------------------------
- alias v_relationships_scenemenu_ccw_13215 create_command_window
- #--------------------------------------------------------------------------
- # * Create Command Window
- #--------------------------------------------------------------------------
- def create_command_window
- v_relationships_scenemenu_ccw_13215()
- @command_window.set_handler(:relationships, method(:command_relationships)) if Use_Menu_Command && $game_system.relationship_info.size > 0
- end
- #--------------------------------------------------------------------------
- # * [Save] Command
- #--------------------------------------------------------------------------
- def command_relationships
- SceneManager.call(Scene_Relationships)
- end
- end
- #==============================================================================
- # ** Game_System
- #------------------------------------------------------------------------------
- # This class handles system data. It saves the disable state of saving and
- # menus. Instances of this class are referenced by $game_system.
- #==============================================================================
- class Game_System
- #--------------------------------------------------------------------------
- # * Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :relationship_info
- attr_accessor :relationship_counter
- attr_accessor :relationship_size
- #--------------------------------------------------------------------------
- # * For Creating An Alias
- #--------------------------------------------------------------------------
- alias v_relationships_gamesys_init_32 initialize
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- @relationship_info = {}
- @relationship_counter = 1
- @relationship_size = 1
- v_relationships_gamesys_init_32()
- end
- end
- #==============================================================================
- # ** Game_Interpreter
- #------------------------------------------------------------------------------
- # An interpreter for executing event commands. This class is used within the
- # Game_Map, Game_Troop, and Game_Event classes.
- #==============================================================================
- class Game_Interpreter
- #--------------------------------------------------------------------------
- # * Includes Module's Variables With Class
- #--------------------------------------------------------------------------
- include V_Relationships::Specs
- #--------------------------------------------------------------------------
- # * Add Relationship
- #--------------------------------------------------------------------------
- def add_relationship( name, title, relationship_variable,
- relationship_level_variable, face_name, face_index,
- location, description1, description2, description3,
- description4, description5, description6, current_status,
- lv_4_reward, lv_8_reward, lv_12_reward, liked_item,
- disliked_item )
- id = $game_system.relationship_size
- $game_system.relationship_info[id] = { :name => name,
- :title => title,
- :var_id => relationship_variable,
- :var_level_id => relationship_level_variable,
- :likes => liked_item,
- :dislikes => disliked_item,
- :face_name => face_name,
- :face_index => face_index,
- :location => location,
- :description1 => description1,
- :description2 => description2,
- :description3 => description3,
- :description4 => description4,
- :description5 => description5,
- :description6 => description6,
- :current_status => current_status,
- :lv_4_gift => lv_4_reward,
- :lv_8_gift => lv_8_reward,
- :lv_12_gift => lv_12_reward}
- $game_variables[$game_system.relationship_info[id][:var_id]] = 50 if Use_Polarities
- $game_system.relationship_size += 1
- end
- #--------------------------------------------------------------------------
- # * Personalize Leveling Icons
- #--------------------------------------------------------------------------
- def personalize_lv_icons( name, lv_0, tier_1, tier_2, tier_3 )
- $game_system.relationship_info.each_key do |id|
- if $game_system.relationship_info[id].has_value?(name)
- $game_system.relationship_info[id][:icons] = [lv_0, tier_1, tier_2, tier_3]
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Personalize Mastered Icons
- #--------------------------------------------------------------------------
- def personalize_mastered_icon( name, mastered_icon )
- $game_system.relationship_info.each_key do |id|
- if $game_system.relationship_info[id].has_value?(name)
- $game_system.relationship_info[id][:mastered_icon] = mastered_icon
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Change the Current Location of a Relationship
- #--------------------------------------------------------------------------
- def current_relationship_location( name , location )
- $game_system.relationship_info.each_key do |id|
- if $game_system.relationship_info[id].has_value?(name)
- $game_system.relationship_info[id][:location] = location
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Change the Current Status of a Relationship
- #--------------------------------------------------------------------------
- def current_relationship_status( name , current_status )
- $game_system.relationship_info.each_key do |id|
- if $game_system.relationship_info[id].has_value?(name)
- $game_system.relationship_info[id][:current_status] = current_status
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Change the Liked Item of a Relationship
- #--------------------------------------------------------------------------
- def change_liked_item( name , item_index )
- $game_system.relationship_info.each_key do |id|
- if $game_system.relationship_info[id].has_value?(name)
- $game_system.relationship_info[id][:likes] = item_index
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Change the Disliked Item of a Relationship
- #--------------------------------------------------------------------------
- def change_disliked_item( name , item_index )
- $game_system.relationship_info.each_key do |id|
- if $game_system.relationship_info[id].has_value?(name)
- $game_system.relationship_info[id][:dislikes] = item_index
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Change the Level 4 Reward of a Relationship
- #--------------------------------------------------------------------------
- def change_level_4_reward( name , item_index )
- $game_system.relationship_info.each_key do |id|
- if $game_system.relationship_info[id].has_value?(name)
- $game_system.relationship_info[id][:lv_4_gift] = item_index
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Change the Level 8 Reward of a Relationship
- #--------------------------------------------------------------------------
- def change_level_8_reward( name , item_index )
- $game_system.relationship_info.each_key do |id|
- if $game_system.relationship_info[id].has_value?(name)
- $game_system.relationship_info[id][:lv_8_gift] = item_index
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Change the Level 12 Reward of a Relationship
- #--------------------------------------------------------------------------
- def change_level_12_reward( name , item_index )
- $game_system.relationship_info.each_key do |id|
- if $game_system.relationship_info[id].has_value?(name)
- $game_system.relationship_info[id][:lv_12_gift] = item_index
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Add Level 12 Bonus Reward of a Relationship
- #--------------------------------------------------------------------------
- def add_level_12_bonus_reward( name )
- $game_system.relationship_info.each_key do |id|
- if $game_system.relationship_info[id].has_value?(name)
- $game_system.relationship_info[id][:lv_12_bonus] = {}
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement