SHARE
TWEET

V's Relationships/Bio Window v2.4

vindaca510 Jul 2nd, 2013 6,051 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  2. #                                                                              #
  3. #                         V's Relationships/Bio Window                         #
  4. #                                 Version  2.4                                 #
  5. #                                                                              #
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  7. #                                Written By:  V                                #
  8. #                        Last Edited: February 23, 2013                        #
  9. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  10. #                              Special Thanks to:                              #
  11. #                                                                              #
  12. #                                  Tsukihime                                   #
  13. #                                 Poundcakery                                  #
  14. #                                   BigEd781                                   #
  15. #                                     D&P3                                     #
  16. #                                   Enelvon                                    #
  17. #                                InternetAkias                                 #
  18. #                                  ReconVirus                                  #
  19. #                                                                              #
  20. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  21.  
  22.  
  23. #==============================================================================#
  24. #------------------------------------------------------------------------------#
  25. # ** Disclaimer                                                                #
  26. #------------------------------------------------------------------------------#
  27. #                                                                              #
  28. # This script was intended for Non-commercial use only, if you wish to use     #
  29. # this script in a commercial game please PM me at which ever site you found   #
  30. # this script. Either way please give me credit in your game script as the     #
  31. # writer of this script, and send me a PM abuot the release of the game/demo.  #
  32. #                                                                              #
  33. #------------------------------------------------------------------------------#
  34. # ** How To Use                                                                #
  35. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  36. #                                                                              #
  37. #  * To access this window use SceneManager.call(Scene_Relationships)          #
  38. #  * Remember to use "" before and after your name, title, face_name, loaction,#
  39. #    descriptions current_status and bg's.                                     #
  40. #  * The favorite_gift, worst_gift, lv_4_gift, lv_8_gift, and lv_12_gift       #
  41. #    variables are the item index numbers found in the Items section of        #
  42. #    the RPGMVXA database.                                                     #
  43. #  * If you choose not to use a title or one of the description just leave it  #
  44. #    blank when adding the relationship like so... ""                          #
  45. #                                                                              #
  46. #------------------------------------------------------------------------------#
  47. #                                                                              #
  48. #             Use anyone of these commands in a script call.                   #
  49. #                                                                              #
  50. #------------------------------------------------------------------------------#
  51. #                                                                              #
  52. #  * To add a new relationship use                                             #
  53. #                                                                              #
  54. #  add_relationship( name, title, relationship_variable,                       #
  55. #                relationship_level_variable, face_name, face_index,           #
  56. #                location, description1, description2, description3,           #
  57. #                description4, description5, description6, current_status,     #
  58. #                lv_4_gift, lv_8_gift, lv_12_gift, favorite_gift, worst_gift ) #
  59. #                                                                              #
  60. #                                                                              #
  61. #  * After adding the relationship to change the current location use          #
  62. #               current_relationship_location( name, location )                #
  63. #                                                                              #
  64. #  * After adding the relationship to change the current status use            #
  65. #               current_relationship_status( name, current_status )            #
  66. #                                                                              #
  67. #  * After adding the relationship to use personalized leveling icons use      #
  68. #               personalize_lv_icons( name, lv_0, tier_1, tier_2, tier_3 )     #
  69. #                                                                              #
  70. #  * After adding the relationship to change the liked or disliked items use   #
  71. #               change_liked_item( name , item_index )                         #
  72. #               change_disliked_item( name , item_index )                      #
  73. #                                                                              #
  74. #  * After adding the relationship to change the tier rewards use              #
  75. #               change_level_4_reward( name , item_index )                     #
  76. #               change_level_8_reward( name , item_index )                     #
  77. #               change_level_12_reward( name , item_index )                    #
  78. #                                                                              #
  79. #------------------------------------------------------------------------------#
  80. # ** Description                                                               #
  81. #------------------------------------------------------------------------------#
  82. #                                                                              #
  83. #  v0.1                                                                        #
  84. # ~=~=~=~                                                                      #
  85. #                                                                              #
  86. # In v0.1, This window displays Relationships with with other actors. As of    #
  87. # v0.1 the window displays the face of the npc, the name, the location, and a  #
  88. # gauge to display if you are liked or disliked. the gauges controlled by game #
  89. # variables.                                                                   #
  90. #                                                                              #
  91. #  v0.2                                                                        #
  92. # ~=~=~=~                                                                      #
  93. #                                                                              #
  94. # In v0.2, I added a title/nick name text to be displayed next to the name and #
  95. # two lines for descriptions. Also with this upgrade I have added options to   #
  96. # display feelings in one of three forms; gauges, text or a percentage.        #
  97. #                                                                              #                                                                              #
  98. #  v1.0                                                                        #
  99. # ~=~=~=~                                                                      #
  100. #                                                                              #
  101. # In v1.0, I've added more description lines, favorite and hated gifts, a      #
  102. # leveling system with rewards customizable to the person, and a current       #
  103. # status text. Also I have add a script call to change the current status.     #
  104. #                                                                              #
  105. #  v1.1                                                                        #
  106. # ~=~=~=~                                                                      #
  107. #                                                                              #
  108. # In v1.1, I fied a few bug that I found.                                      #
  109. #                                                                              #
  110. #  v1.2                                                                        #
  111. # ~=~=~=~                                                                      #
  112. #                                                                              #
  113. # In v1.2, I add an option to display a normal gauge instead of using          #
  114. # love/hate polarities and an option to display an item icon next to the       #
  115. # name in the reward window.                                                   #
  116. #                                                                              #
  117. #  v2.0                                                                        #
  118. # ~=~=~=~                                                                      #
  119. #                                                                              #
  120. # In v2.0, I rewrote a lot of the script and add options to display everything #
  121. # with the exception of the Face, Name, and Description. I have also added an  #
  122. # option to use the leveling system. I have also add a few new commands to     #
  123. # use personalized level icons and change the location, current status, liked  #
  124. # and disliked items, and the level up tier rewards.                           #
  125. #                                                                              #
  126. #  v2.1                                                                        #
  127. # ~=~=~=~                                                                      #
  128. #                                                                              #
  129. # In v2.1, I set up all the sounds to run the same as the rest of the script,  #
  130. # I also added the ability to shift threw the detail pages with out having to  #
  131. # back out and reselectand fixed the menu command placement.                   #
  132. #                                                                              #
  133. #  v2.2                                                                        #
  134. # ~=~=~=~                                                                      #
  135. #                                                                              #
  136. # In v2.2, I fixed an issue with the sound bugging out and the level up button #
  137. # remaining lit up when a relationship hit level twelve. I also fixed an issue #
  138. # with the icons layering instead of just drawing right proper one, once a     #
  139. # relationship passed level five.                                              #
  140. #                                                                              #
  141. #  v2.3                                                                        #
  142. # ~=~=~=~                                                                      #
  143. #                                                                              #
  144. # In v2.3, I added a mastered icon and text once a relationship is mastered. I #
  145. # also made the menu command appear once a relationship is added.              #
  146. #                                                                              #
  147. #  v2.4                                                                        #
  148. # ~=~=~=~                                                                      #
  149. #                                                                              #
  150. # In v2.4, I added an option to use the original blurred bg from the main menu.#
  151. # I also added an $import for future compatibilities.                          #
  152. #                                                                              #
  153. #------------------------------------------------------------------------------#
  154. #==============================================================================#
  155.  
  156.  ($imported ||= {})[:v_relationships] = true
  157.  
  158. #==============================================================================
  159. # ** V's Relationship's Window Module
  160. #------------------------------------------------------------------------------
  161. #  This module manages customizable features and methods.
  162. #==============================================================================
  163.  
  164. module V_Relationships
  165.   module Specs
  166.    
  167. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  168. #                                                                              #
  169. #                           Start Customizable Area.                           #
  170. #                                                                              #
  171. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  172. #                                                                              #
  173. #                      ONLY EDIT AFTER THE EQUALS SYMBOL.                      #
  174. #                                                                              #
  175. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  176.    
  177.  
  178.   #============================================================================
  179.   # Use Regular Blurred Menu Background
  180.   #============================================================================
  181.  
  182.     Use_Custom_Background = false
  183.  
  184.   #============================================================================
  185.   # Name Of The File Used For Background
  186.   #============================================================================
  187.  
  188.     Background = "StarlitSky"
  189.  
  190.   #============================================================================
  191.   # Title of the Relationship Window
  192.   #============================================================================
  193.  
  194.     Window_Title = "Relationships"
  195.    
  196.   #============================================================================
  197.   # Use Menu Command For Access
  198.   # ~=~=~=~=~=~=~=~=~=~=~=~=~=~
  199.   # If you choose not to use a window command you can still access the window
  200.   # by using SceneManager.call(Scene_Relationships)
  201.   #============================================================================
  202.  
  203.     Use_Menu_Command = true
  204.  
  205.   #============================================================================
  206.   #  Use Level System
  207.   #============================================================================
  208.    
  209.     Use_Leveling_System = true
  210.  
  211.   #============================================================================
  212.   # Name Of The Feeling If Text Is Used
  213.   #============================================================================
  214.  
  215.     Terms_Of_Feelings = ["Hated", "Disliked", "None", "Liked", "Loved"]
  216.  
  217.   #============================================================================
  218.   # Name Of The Mastered Text If Leveling System is used
  219.   #============================================================================
  220.  
  221.     Term_Of_Mastered = "Mastered"
  222.  
  223.   #============================================================================
  224.   #  Use  Polarities
  225.   # ~=~=~=~=~=~=~=~=~
  226.   # If true will display a gauge with love/hate polarities, If it is false a
  227.   # normal guage will be used.
  228.   #============================================================================
  229.    
  230.     Use_Polarities = true
  231.  
  232.   #============================================================================
  233.   #  Information Displayed
  234.   # ~=~=~=~=~=~=~=~=~=~=~=~
  235.   # If Use_Leveling_System = false, Use_Level_Icons will automatically be false
  236.   #============================================================================
  237.    
  238.     Use_Level_Icons = true
  239.     Use_Title = true
  240.     Use_Location = true
  241.     Use_Liked_and_Disliked_Items = true
  242.     Use_Feelings = true
  243.     Use_Current_Status = true
  244.     Use_Gauges = true
  245.  
  246.   #============================================================================
  247.   #  Use Reward Item Icons
  248.   #============================================================================
  249.    
  250.     Use_Icons = true
  251.  
  252.  
  253. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  254. #                                                                              #
  255. #                            End Customizable Area.                            #
  256. #                                                                              #
  257. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  258. #                                                                              #
  259. #         DO NOT EDIT PAST THIS POINT UNLESS YOU KNOW WHAT YOUR DOING.         #
  260. #                                                                              #
  261. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  262.    
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.   end
  299. end
  300.  
  301.  
  302.  
  303.  
  304.  
  305. #==============================================================================
  306. # ** Window Reward
  307. #------------------------------------------------------------------------------
  308. #  This window displays the Relationship info.
  309. #==============================================================================
  310.  
  311. class Window_Reward < Window_Base
  312.  
  313.   #--------------------------------------------------------------------------
  314.   # * Includes Module's Variables With Class
  315.   #--------------------------------------------------------------------------
  316.  
  317.   include V_Relationships::Specs
  318.  
  319.   #--------------------------------------------------------------------------
  320.   # * Object Initialization
  321.   #--------------------------------------------------------------------------
  322.  
  323.   def initialize(x, y, w, h)
  324.     super(x, y, w, h)
  325.     draw_reward
  326.   end
  327.  
  328.   #--------------------------------------------------------------------------
  329.   # * Draw Reward
  330.   #--------------------------------------------------------------------------
  331.  
  332.   def draw_reward
  333.     id = $game_system.relationship_counter
  334.     lvvar = $game_variables[$game_system.relationship_info[id][:var_level_id]]
  335.     dfs = Font.default_size
  336.     item = $data_items[$game_system.relationship_info[id][:lv_4_gift]] if lvvar == 4
  337.     item = $data_items[$game_system.relationship_info[id][:lv_8_gift]] if lvvar == 8
  338.     item = $data_items[$game_system.relationship_info[id][:lv_12_gift]] if lvvar == 12
  339.     Font.default_size = 16
  340.     draw_text_ex(10, 5, "Reward:")
  341.     draw_text(15, 25, 120, 42, item.name, 1)
  342.     Font.default_size = dfs
  343.     draw_icon(item.icon_index, 0, 30, 120) if Use_Icons
  344.   end
  345.  
  346. end
  347.  
  348. #==============================================================================
  349. # ** Window Relationship Level Up
  350. #------------------------------------------------------------------------------
  351. #  This window displays the Relationship info.
  352. #==============================================================================
  353.  
  354. class Window_Relationship_Lv_Up < Window_Base
  355.  
  356.   #--------------------------------------------------------------------------
  357.   # * Includes Module's Variables With Class
  358.   #--------------------------------------------------------------------------
  359.  
  360.   include V_Relationships::Specs
  361.  
  362.   #--------------------------------------------------------------------------
  363.   # * Object Initialization
  364.   #--------------------------------------------------------------------------
  365.  
  366.   def initialize(x, y, w, h)
  367.     super(x, y, w, h)
  368.     refresh
  369.   end
  370.  
  371.   #--------------------------------------------------------------------------
  372.   # * Refresh
  373.   #--------------------------------------------------------------------------
  374.  
  375.   def refresh
  376.     contents.clear
  377.     draw_lv_up
  378.   end
  379.  
  380.   #--------------------------------------------------------------------------
  381.   # * Draw Gray Text with Control Characters
  382.   #--------------------------------------------------------------------------
  383.  
  384.   def draw_text_ex_gray(x, y, text)
  385.     change_color(gauge_back_color)
  386.     text = convert_escape_characters(text)
  387.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  388.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  389.     reset_font_settings
  390.   end
  391.  
  392.   #--------------------------------------------------------------------------
  393.   # * Draw Level Up
  394.   #--------------------------------------------------------------------------
  395.  
  396.   def draw_lv_up
  397.     id = $game_system.relationship_counter
  398.     varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
  399.     lvvar = $game_variables[$game_system.relationship_info[id][:var_level_id]]
  400.     draw_text_ex_gray(8, -5, "Level Up") unless varnum >= 100
  401.     draw_text_ex_gray(8, -5, "Level Up") if lvvar == 12
  402.     draw_text_ex(8, -5, "Level Up") if varnum >= 100 && lvvar != 12
  403.   end
  404.  
  405.   #--------------------------------------------------------------------------
  406.   # * Update
  407.   #--------------------------------------------------------------------------
  408.  
  409.   def update
  410.     super
  411.     refresh if Input.press?(:C)
  412.   end
  413.  
  414. end
  415.  
  416.  
  417.  
  418.  
  419. #==============================================================================
  420. # ** Window Relationship Title
  421. #------------------------------------------------------------------------------
  422. #  This window displays the Relationship Title.
  423. #==============================================================================
  424.  
  425. class Window_Relationship_Details < Window_Base
  426.  
  427.   #--------------------------------------------------------------------------
  428.   # * Includes Module's Variables With Class
  429.   #--------------------------------------------------------------------------
  430.  
  431.   include V_Relationships::Specs
  432.  
  433.   #--------------------------------------------------------------------------
  434.   # * Object Initialization
  435.   #--------------------------------------------------------------------------
  436.  
  437.   def initialize(x, y, w, h)
  438.     super(x, y, w, h)
  439.     refresh
  440.   end
  441.  
  442.   #--------------------------------------------------------------------------
  443.   # * Refresh
  444.   #--------------------------------------------------------------------------
  445.  
  446.   def refresh
  447.     contents.clear
  448.     draw_relationship_details_top
  449.     draw_relationship_details_bottom
  450.   end
  451.  
  452.   #--------------------------------------------------------------------------
  453.   # * Draw Gray Text with Control Characters
  454.   #--------------------------------------------------------------------------
  455.  
  456.   def draw_text_ex_gray(x, y, text)
  457.     change_color(gauge_back_color)
  458.     text = convert_escape_characters(text)
  459.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  460.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  461.     reset_font_settings
  462.   end
  463.  
  464.   #--------------------------------------------------------------------------
  465.   # * Draw Red Text with Control Characters
  466.   #--------------------------------------------------------------------------
  467.  
  468.   def draw_text_ex_red(x, y, text)
  469.     change_color(knockout_color)
  470.     text = convert_escape_characters(text)
  471.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  472.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  473.     reset_font_settings
  474.   end
  475.  
  476.   #--------------------------------------------------------------------------
  477.   # * Draw Blue Text with Control Characters
  478.   #--------------------------------------------------------------------------
  479.  
  480.   def draw_text_ex_blue(x, y, text)
  481.     change_color(mp_gauge_color1)
  482.     text = convert_escape_characters(text)
  483.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  484.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  485.     reset_font_settings
  486.   end
  487.  
  488.   #--------------------------------------------------------------------------
  489.   # * Draw Blue Text with Control Characters
  490.   #--------------------------------------------------------------------------
  491.  
  492.   def draw_text_ex_yellow(x, y, text)
  493.     change_color(crisis_color)
  494.     text = convert_escape_characters(text)
  495.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  496.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  497.     reset_font_settings
  498.   end
  499.  
  500.   #--------------------------------------------------------------------------
  501.   # * Draw Gauge
  502.   #     rate   : Rate (full at 1.0)
  503.   #     color1 : Left side gradation
  504.   #     color2 : Right side gradation
  505.   #--------------------------------------------------------------------------
  506.  
  507.   def draw_gauge(x, y, width, rate, color1, color2)
  508.     fill_w = (width * rate).to_i
  509.     gauge_y = y + line_height - 8
  510.     contents.fill_rect(x, gauge_y, width, 15, gauge_back_color)
  511.     contents.gradient_fill_rect(x, gauge_y, fill_w, 15, color1, color2)
  512.   end
  513.  
  514.   #--------------------------------------------------------------------------
  515.   # * Draw Horizontal Line
  516.   #--------------------------------------------------------------------------
  517.  
  518.   def draw_horz_line(y)
  519.     line_y = y + line_height / 2 - 1
  520.     contents.fill_rect(22, line_y, 490, 2, line_color)
  521.   end
  522.  
  523.   #--------------------------------------------------------------------------
  524.   # * Get Color of Horizontal Line
  525.   #--------------------------------------------------------------------------
  526.  
  527.   def line_color
  528.     color = normal_color
  529.     color.alpha = 200
  530.     color
  531.   end
  532.  
  533.   #--------------------------------------------------------------------------
  534.   # * Draw Relationship Details Top
  535.   #--------------------------------------------------------------------------
  536.  
  537.   def draw_relationship_details_top
  538.     draw_relationship_face
  539.     draw_name
  540.     draw_title if Use_Title
  541.     draw_feelings if Use_Feelings
  542.     draw_location if Use_Location
  543.    
  544.     if Use_Leveling_System
  545.        draw_level_icons if Use_Level_Icons
  546.     end
  547.      
  548.     draw_relationship_gauge if Use_Gauges
  549.     draw_horz_line(110)
  550.   end
  551.    
  552.   #--------------------------------------------------------------------------
  553.   # * Draw Relationship Details Bottom
  554.   #--------------------------------------------------------------------------
  555.  
  556.   def draw_relationship_details_bottom
  557.     draw_current_status if Use_Current_Status
  558.     draw_likes_and_dislikes if Use_Liked_and_Disliked_Items
  559.     draw_description
  560.   end
  561.  
  562.   #--------------------------------------------------------------------------
  563.   # * Draw Face of Current Relationship
  564.   #--------------------------------------------------------------------------
  565.  
  566.   def draw_relationship_face
  567.     id = $game_system.relationship_counter
  568.     varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
  569.     draw_face($game_system.relationship_info[id][:face_name], $game_system.relationship_info[id][:face_index], 10, 10, enabled = true)    
  570.   end
  571.  
  572.   #--------------------------------------------------------------------------
  573.   # * Draw Name of Current Relationship
  574.   #--------------------------------------------------------------------------
  575.  
  576.   def draw_name
  577.     id = $game_system.relationship_counter
  578.     varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
  579.     dfs = Font.default_size
  580.     Font.default_size = 30
  581.     draw_text_ex(115, 10, $game_system.relationship_info[id][:name]) if $game_system.relationship_info[id].has_key?(:name)
  582.     Font.default_size = dfs
  583.   end
  584.  
  585.   #--------------------------------------------------------------------------
  586.   # * Draw Title of Current Relationship
  587.   #--------------------------------------------------------------------------
  588.  
  589.   def draw_title
  590.     id = $game_system.relationship_counter
  591.     varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
  592.     dfs = Font.default_size
  593.     Font.default_size = 16
  594.     draw_text_ex(115, 32, $game_system.relationship_info[id][:title]) if $game_system.relationship_info[id].has_key?(:title)
  595.     Font.default_size = dfs
  596.   end
  597.  
  598.   #--------------------------------------------------------------------------
  599.   # * Draw Location
  600.   #--------------------------------------------------------------------------
  601.  
  602.   def draw_location
  603.     dfs = Font.default_size
  604.     id = $game_system.relationship_counter
  605.     varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
  606.     Font.default_size = 16
  607.     draw_text_ex(120, 80, "Location: ")
  608.     draw_text_ex(130, 95, $game_system.relationship_info[id][:location]) if $game_system.relationship_info[id].has_key?(:location)
  609.     Font.default_size = dfs
  610.   end
  611.  
  612.   #--------------------------------------------------------------------------
  613.   # * Draw Feelings
  614.   #--------------------------------------------------------------------------
  615.  
  616.   def draw_feelings
  617.     fx = 360
  618.     fy = 74
  619.     dfs = Font.default_size
  620.     id = $game_system.relationship_counter
  621.     varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
  622.     Font.default_size = 16
  623.     draw_text_ex(fx - 70, fy, "Feelings: ")
  624.      
  625.     if varnum == 0
  626.       draw_text_ex_blue(fx, fy, Terms_Of_Feelings[0])
  627.     elsif varnum > 0 && varnum < 50
  628.       draw_text_ex(fx, fy, Terms_Of_Feelings[1])
  629.     elsif varnum == 50
  630.       draw_text_ex(fx, fy, Terms_Of_Feelings[2])
  631.     elsif varnum > 50 && varnum >= 100
  632.       draw_text_ex(fx, fy, Terms_Of_Feelings[3])
  633.     elsif varnum == 100
  634.       draw_text_ex_red(fx, fy, Terms_Of_Feelings[4])
  635.     end
  636.      
  637.  
  638.     Font.default_size = dfs
  639.   end
  640.  
  641.   #--------------------------------------------------------------------------
  642.   # * Draw Level Icons
  643.   #--------------------------------------------------------------------------
  644.  
  645.   def draw_level_icons
  646.     ix = 115
  647.     iy = 55
  648.     mx = 200
  649.     id = $game_system.relationship_counter
  650.     relationship = $game_system.relationship_info[id]
  651.     varnum = $game_variables[relationship[:var_id]]
  652.     lvvar = $game_variables[relationship[:var_level_id]]
  653.     mastered_icon = relationship[:mastered_icons]
  654.    
  655.     if lvvar >= 12 && relationship.has_key?(:mastered_icons)
  656.       draw_icon(mastered_icon, mx, iy)
  657.       draw_text_ex_yellow(mx + 30, iy, Term_Of_Mastered)
  658.     elsif lvvar >= 12 && relationship.has_key?(:mastered_icons) == false
  659.       draw_icon(495, mx, iy)
  660.       draw_text_ex_yellow(mx + 30, iy + 5, Term_Of_Mastered)
  661.     end
  662.  
  663.    
  664.     if relationship.has_key?(:icons)
  665.       lv_0 = relationship[:icons][0]
  666.       tier_1 = relationship[:icons][1]
  667.       tier_2 = relationship[:icons][2]
  668.       tier_3 = relationship[:icons][3]
  669.       draw_icon(lv_0, ix, iy) if lvvar == 0
  670.       draw_icon(tier_1, ix, iy) if lvvar >= 1 && lvvar < 5
  671.       draw_icon(tier_1, ix + 20, iy) if lvvar >= 2 && lvvar < 6
  672.       draw_icon(tier_1, ix + 40, iy) if lvvar >= 3 && lvvar < 7
  673.       draw_icon(tier_1, ix + 60, iy) if lvvar >= 4 && lvvar < 8
  674.       draw_icon(tier_2, ix, iy) if lvvar >= 5 && lvvar < 9
  675.       draw_icon(tier_2, ix + 20, iy) if lvvar >= 6 && lvvar < 10
  676.       draw_icon(tier_2, ix + 40, iy) if lvvar >= 7 && lvvar < 11
  677.       draw_icon(tier_2, ix + 60, iy) if lvvar >= 8 && lvvar < 12
  678.       draw_icon(tier_3, ix, iy) if lvvar >= 9
  679.       draw_icon(tier_3, ix + 20, iy) if lvvar >= 10
  680.       draw_icon(tier_3, ix + 40, iy) if lvvar >= 11
  681.       draw_icon(tier_3, ix + 60, iy) if lvvar >= 12
  682.     elsif relationship.has_key?(:icons) == false
  683.       draw_icon(123, ix, iy) if lvvar == 0
  684.       draw_icon(124, ix + 10, iy) if lvvar == 0
  685.       draw_icon(127, ix, iy) if lvvar >= 1 && lvvar < 5
  686.       draw_icon(127, ix + 20, iy) if lvvar >= 2 && lvvar < 6
  687.       draw_icon(127, ix + 40, iy) if lvvar >= 3 && lvvar < 7
  688.       draw_icon(127, ix + 60, iy) if lvvar >= 4 && lvvar < 8
  689.       draw_icon(126, ix, iy) if lvvar >= 5 && lvvar < 9
  690.       draw_icon(126, ix + 20, iy) if lvvar >= 6 && lvvar < 10
  691.       draw_icon(126, ix + 40, iy) if lvvar >= 7 && lvvar < 11
  692.       draw_icon(126, ix + 60, iy) if lvvar >= 8 && lvvar < 12
  693.       draw_icon(125, ix, iy) if lvvar >= 9
  694.       draw_icon(125, ix + 20, iy) if lvvar >= 10
  695.       draw_icon(125, ix + 40, iy) if lvvar >= 11
  696.       draw_icon(125, ix + 60, iy) if lvvar >= 12
  697.     end
  698.  
  699.   end
  700.  
  701.   #--------------------------------------------------------------------------
  702.   # * Draw Relationship Gauge
  703.   #--------------------------------------------------------------------------
  704.  
  705.   def draw_relationship_gauge
  706.   x = 165
  707.   y = 80
  708.   id = $game_system.relationship_counter
  709.   varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
  710.   lvvar = $game_variables[$game_system.relationship_info[id][:var_level_id]]
  711.   rate = varnum.to_f / 100 unless varnum >= 100
  712.   rate = 1 / 1 if varnum >= 100
  713.  
  714.     if Use_Polarities
  715.       draw_gauge(x + 125, y, 200, 1, gauge_back_color, gauge_back_color)
  716.       draw_gauge(x + 125, y, 105, 1, mp_gauge_color1, mp_gauge_color1) if varnum == 0
  717.       draw_gauge(x + 225, y, 100, 1, knockout_color, knockout_color) if varnum >= 100
  718.       draw_gauge(x + 125 + (varnum * 2), y, 100 - (varnum * 2), 1, mp_gauge_color1, normal_color) if  varnum < 50 && varnum > 0
  719.       draw_gauge(x + 220, y, 2 * ( varnum - 50), 1, normal_color, knockout_color) if varnum > 50 && varnum < 100
  720.       draw_gauge(x + 220, y, 10, 1, normal_color, normal_color) if varnum == 50
  721.     else
  722.       draw_gauge(x + 125, y, 200, rate, normal_color, knockout_color)
  723.     end
  724.  
  725.   end
  726.  
  727.   #--------------------------------------------------------------------------
  728.   # * Draw Current Status
  729.   #--------------------------------------------------------------------------
  730.  
  731.   def draw_current_status
  732.     dfs = Font.default_size
  733.     id = $game_system.relationship_counter
  734.     varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
  735.     Font.default_size = 16
  736.     draw_text_ex(50, 135, "Current Status: ") if $game_system.relationship_info[id].has_key?(:current_status)
  737.     draw_text_ex(60, 150, $game_system.relationship_info[id][:current_status]) if $game_system.relationship_info[id].has_key?(:current_status)
  738.     Font.default_size = dfs
  739.   end
  740.  
  741.   #--------------------------------------------------------------------------
  742.   # * Draw Liked and Disliked Items
  743.   #--------------------------------------------------------------------------
  744.  
  745.   def draw_likes_and_dislikes
  746.     dfs = Font.default_size
  747.     id = $game_system.relationship_counter
  748.     relationship = $game_system.relationship_info[id]
  749.     varnum = $game_variables[relationship[:var_id]]
  750.     likes = $data_items[relationship[:likes]]
  751.     dislikes = $data_items[relationship[:dislikes]]
  752.     Font.default_size = 16
  753.     draw_text_ex(320, 135, "Likes: ") if relationship.has_key?(:likes)
  754.     draw_text_ex(345, 150, likes.name) if relationship.has_key?(:likes)
  755.     draw_text_ex(400, 135, "Dislikes: ") if relationship.has_key?(:dislikes)
  756.     draw_text_ex(445, 150, dislikes.name) if relationship.has_key?(:dislikes)
  757.     Font.default_size = dfs
  758.   end
  759.  
  760.   #--------------------------------------------------------------------------
  761.   # * Draw Description
  762.   #--------------------------------------------------------------------------
  763.  
  764.   def draw_description
  765.     id = $game_system.relationship_counter
  766.     relationship = $game_system.relationship_info[id]
  767.     varnum = $game_variables[relationship[:var_id]]
  768.     draw_text_ex(60, 190, relationship[:description1]) if relationship.has_key?(:description1)
  769.     draw_text_ex(60, 210, relationship[:description2]) if relationship.has_key?(:description2)
  770.     draw_text_ex(60, 230, relationship[:description3]) if relationship.has_key?(:description3)
  771.     draw_text_ex(60, 250, relationship[:description4]) if relationship.has_key?(:description4)
  772.     draw_text_ex(60, 270, relationship[:description5]) if relationship.has_key?(:description5)
  773.     draw_text_ex(60, 290, relationship[:description6]) if relationship.has_key?(:description6)
  774.  
  775.   end
  776.  
  777. end
  778.  
  779.  
  780.  
  781.  
  782.  
  783. #==============================================================================
  784. # ** Window Relationship Select
  785. #------------------------------------------------------------------------------
  786. #  This window displays the Relationship info.
  787. #==============================================================================
  788.  
  789. class Window_Relationship_Select < Window_Base
  790.  
  791.   #--------------------------------------------------------------------------
  792.   # * Includes Module's Variables With Class
  793.   #--------------------------------------------------------------------------
  794.  
  795.   include V_Relationships::Specs
  796.  
  797.   #--------------------------------------------------------------------------
  798.   # * Object Initialization
  799.   #--------------------------------------------------------------------------
  800.  
  801.   def initialize(x, y, w, h)
  802.     super(x, y, w, h)
  803.   end
  804.  
  805. end
  806.  
  807.  
  808.  
  809.  
  810. #==============================================================================
  811. # ** Window Relationship Title
  812. #------------------------------------------------------------------------------
  813. #  This window displays the Relationship Title.
  814. #==============================================================================
  815.  
  816. class Window_Relationship_Title < Window_Base
  817.  
  818.   #--------------------------------------------------------------------------
  819.   # * Includes Module's Variables With Class
  820.   #--------------------------------------------------------------------------
  821.  
  822.   include V_Relationships::Specs
  823.  
  824.   #--------------------------------------------------------------------------
  825.   # * Object Initialization
  826.   #--------------------------------------------------------------------------
  827.  
  828.   def initialize(x, y, w, h)
  829.     super(x, y, w, h)
  830.     draw_relationship_title
  831.   end
  832.  
  833.   #--------------------------------------------------------------------------
  834.   # * Draw Relationship Title
  835.   #--------------------------------------------------------------------------
  836.  
  837.   def draw_relationship_title
  838.     make_font_bigger
  839.     draw_text(-15, -20, 544, 90, Window_Title, 1)
  840.     make_font_smaller
  841.   end
  842.  
  843. end
  844.  
  845.  
  846.  
  847.  
  848.  
  849. #==============================================================================
  850. # ** Window Relationship Info
  851. #------------------------------------------------------------------------------
  852. #  This window displays the Relationship info.
  853. #==============================================================================
  854.  
  855. class Window_Relationship_Info < Window_Base
  856.  
  857.   #--------------------------------------------------------------------------
  858.   # * Includes Module's Variables With Class
  859.   #--------------------------------------------------------------------------
  860.  
  861.   include V_Relationships::Specs
  862.  
  863.   #--------------------------------------------------------------------------
  864.   # * Object Initialization
  865.   #--------------------------------------------------------------------------
  866.  
  867.   def initialize(x, y, w, h)
  868.     super(x, y - 25, w, h)
  869.     refresh
  870.   end
  871.  
  872.   #--------------------------------------------------------------------------
  873.   # * Refresh
  874.   #--------------------------------------------------------------------------
  875.  
  876.   def refresh
  877.     draw_relationship_info
  878.   end
  879.  
  880.   #--------------------------------------------------------------------------
  881.   # * Draw Blue Text with Control Characters
  882.   #--------------------------------------------------------------------------
  883.  
  884.   def draw_text_ex_yellow(x, y, text)
  885.     change_color(crisis_color)
  886.     text = convert_escape_characters(text)
  887.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  888.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  889.     reset_font_settings
  890.   end
  891.  
  892.   #--------------------------------------------------------------------------
  893.   # * Draw Gauge
  894.   #     rate   : Rate (full at 1.0)
  895.   #     color1 : Left side gradation
  896.   #     color2 : Right side gradation
  897.   #--------------------------------------------------------------------------
  898.  
  899.   def draw_gauge(x, y, width, rate, color1, color2)
  900.     fill_w = (width * rate).to_i
  901.     gauge_y = y + line_height - 8
  902.     contents.fill_rect(x, gauge_y, width, 15, gauge_back_color)
  903.     contents.gradient_fill_rect(x, gauge_y, fill_w, 15, color1, color2)
  904.   end
  905.  
  906.   #--------------------------------------------------------------------------
  907.   # * Draw Relationship Info
  908.   #--------------------------------------------------------------------------
  909.  
  910.   def draw_relationship_info
  911.       x = 50
  912.       y_start = -100 + (line_height * 1 + self.oy )
  913.       pad = 3
  914.       height = 105
  915.       i = 1
  916.       like_gauge = 0
  917.       dislike_gauge = 0
  918.    
  919.     $game_system.relationship_info.each_key do |id|
  920.       dfs = Font.default_size
  921.       filler = 1 / 1
  922.       varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
  923.       rate = varnum.to_f / 100 unless varnum >= 100
  924.       rate = 1 / 1 if varnum >= 100
  925.       y = y_start + height * i + pad * i
  926.       draw_face($game_system.relationship_info[id][:face_name], $game_system.relationship_info[id][:face_index], x, y - 20, enabled = true)    
  927.       draw_text_ex(x + 105, y - 20, $game_system.relationship_info[id][:name])
  928.       Font.default_size = 16
  929.       draw_text_ex(x + 105, y - 3, $game_system.relationship_info[id][:title]) if Use_Title
  930.       draw_text_ex(x + 105, y + 13, "Current Status: ") if Use_Current_Status
  931.       draw_text_ex(x + 175, y + 28, $game_system.relationship_info[id][:current_status]) if Use_Current_Status
  932.       Font.default_size = dfs
  933.      
  934.       if Use_Level_Icons
  935.         relationship = $game_system.relationship_info[id]
  936.         lvvar = $game_variables[relationship[:var_level_id]]
  937.         mastered_icon = relationship[:mastered_icons]
  938.        
  939.         if lvvar >= 12 && relationship.has_key?(:mastered_icons)
  940.           draw_icon(mastered_icon, x + 300, y - 20)
  941.           draw_text_ex_yellow(x + 330, y - 15, Term_Of_Mastered)
  942.         elsif lvvar >= 12 && relationship.has_key?(:mastered_icons) == false
  943.           draw_icon(495, x + 300, y - 20)
  944.           draw_text_ex_yellow(x + 330, y - 15, Term_Of_Mastered)
  945.         end
  946.        
  947.       end
  948.  
  949.  
  950.  
  951.        
  952.        
  953.       if Use_Gauges && Use_Polarities
  954.         draw_gauge(x + 125, y + 40, 200, 1, gauge_back_color, gauge_back_color)
  955.         draw_gauge(x + 125, y + 40, 105, 1, mp_gauge_color1, mp_gauge_color1) if varnum == 0
  956.         draw_gauge(x + 225, y + 40, 100, 1, knockout_color, knockout_color) if varnum >= 100
  957.         draw_gauge(x + 125 + (varnum * 2), y + 40, 100 - (varnum * 2), 1, mp_gauge_color1, normal_color) if varnum < 50 && varnum > 0
  958.         draw_gauge(x + 220, y + 40, 2 * ( varnum - 50), 1, normal_color, knockout_color) if varnum > 50 && varnum < 100
  959.         draw_gauge(x + 220, y + 40, 10, 1, normal_color, normal_color) if varnum == 50
  960.       elsif Use_Gauges && Use_Polarities == false
  961.         draw_gauge(x + 125, y + 40, 200, rate, normal_color, knockout_color)
  962.       end
  963.  
  964.       i += 1
  965.     end
  966.  
  967.   end
  968.  
  969.   #--------------------------------------------------------------------------
  970.   # * Process Cursor Move
  971.   #--------------------------------------------------------------------------
  972.  
  973.   def process_cursor_move
  974.    
  975.     if ((Input.press?(:UP)) if Input.repeat?(:UP)) && self.oy > 0
  976.       self.oy -= 108
  977.       Sound.play_cursor
  978.       $game_system.relationship_counter -= 1
  979.     elsif ((Input.press?(:DOWN)) if Input.repeat?(:DOWN)) && contents_height / 2 - 175 >= self.oy
  980.       self.oy += 108
  981.       Sound.play_cursor
  982.       $game_system.relationship_counter += 1
  983.     end
  984.  
  985.   end
  986.  
  987.   #--------------------------------------------------------------------------
  988.   # * Update
  989.   #--------------------------------------------------------------------------
  990.  
  991.   def update
  992.     super
  993.     process_cursor_move
  994.   end
  995.  
  996. end
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002. #==============================================================================
  1003. # ** Scene Relationship Details
  1004. #------------------------------------------------------------------------------
  1005. #  This class performs Relationships scene processing.
  1006. #==============================================================================
  1007.  
  1008. class Scene_Relationship_Details < Scene_MenuBase
  1009.  
  1010.   #--------------------------------------------------------------------------
  1011.   # * Includes Module's Variables With Class
  1012.   #--------------------------------------------------------------------------
  1013.  
  1014.   include V_Relationships::Specs
  1015.  
  1016.   #--------------------------------------------------------------------------
  1017.   # * Start Processing
  1018.   #--------------------------------------------------------------------------
  1019.  
  1020.   def start
  1021.     super
  1022.     $c = 0
  1023.     create_relationship_details_window
  1024.     create_relationship_lv_up_window if Use_Leveling_System
  1025.  
  1026.   #--------------------------------------------------------------------------
  1027.   # * Background Processing
  1028.   #--------------------------------------------------------------------------
  1029.     if Use_Custom_Background != true
  1030.       @relationship_details_bg = Sprite.new
  1031.       @relationship_details_bg.bitmap = SceneManager.background_bitmap
  1032.       @relationship_details_bg.color.set(16, 16, 16, 128)
  1033.     else
  1034.       @relationship_details_bg = Sprite.new
  1035.       @relationship_details_bg.bitmap = Cache.picture(Background)
  1036.       @relationship_details_bg.x = 0
  1037.       @relationship_details_bg.y = 0
  1038.       @relationship_details_bg.zoom_x = ( Graphics.width.to_f / 544 )
  1039.       @relationship_details_bg.zoom_y = ( Graphics.height.to_f / 416 )
  1040.       @relationship_details_bg.opacity = 255
  1041.       @relationship_details_bg.visible = true  
  1042.     end
  1043.   end
  1044.  
  1045.   #--------------------------------------------------------------------------
  1046.   # * Check For Reward
  1047.   #--------------------------------------------------------------------------
  1048.  
  1049.   def check_for_reward
  1050.     id = $game_system.relationship_counter
  1051.     relationship = $game_system.relationship_info[id]
  1052.     lvvar = $game_variables[relationship[:var_level_id]]
  1053.    
  1054.     if lvvar == 4
  1055.       item = relationship[:lv_4_gift]
  1056.       $game_party.gain_item($data_items[item], 1)    
  1057.       create_reward_window
  1058.       RPG::ME.new("Fanfare3", 80, 115).play
  1059.     elsif lvvar == 8
  1060.       item = relationship[:lv_8_gift]
  1061.       $game_party.gain_item($data_items[item], 1)    
  1062.       create_reward_window
  1063.       RPG::ME.new("Fanfare3", 80, 115).play
  1064.     elsif lvvar == 12
  1065.       item = relationship[:lv_12_gift]
  1066.       $game_party.gain_item($data_items[item], 1)    
  1067.       create_reward_window
  1068.       RPG::ME.new("Fanfare3", 80, 115).play
  1069.     else
  1070.       RPG::ME.new("Item", 80, 100).play
  1071.     end
  1072.    
  1073.   end
  1074.  
  1075.   #--------------------------------------------------------------------------
  1076.   # * Create Relationship Level Up Window
  1077.   #--------------------------------------------------------------------------
  1078.  
  1079.   def create_reward_window
  1080.     @reward_window = Window_Reward.new(200, 180, 160, 90)
  1081.     @reward_window.back_opacity = 255
  1082.     $c = 1
  1083.   end
  1084.  
  1085.   #--------------------------------------------------------------------------
  1086.   # * Create Relationship Level Up Window
  1087.   #--------------------------------------------------------------------------
  1088.  
  1089.   def create_relationship_lv_up_window
  1090.     @relationship_lv_up_window = Window_Relationship_Lv_Up.new(220, 355, 120, 42)
  1091.     @relationship_lv_up_window.back_opacity = 0
  1092.   end
  1093.  
  1094.   #--------------------------------------------------------------------------
  1095.   # * Create Relationship Details Window
  1096.   #--------------------------------------------------------------------------
  1097.  
  1098.   def create_relationship_details_window
  1099.     @relationship_details_window = Window_Relationship_Details.new(0, 0, 544, 416)
  1100.     @relationship_details_window.back_opacity = 0
  1101.   end
  1102.  
  1103.   #--------------------------------------------------------------------------
  1104.   # * Frame Update
  1105.   #--------------------------------------------------------------------------
  1106.  
  1107.   def update
  1108.     super()
  1109.     $c += 1 if $c != 0
  1110.     return_scene && $c = 0 if $c == 300
  1111.    
  1112.     id = $game_system.relationship_counter
  1113.     varnum = $game_variables[$game_system.relationship_info[id][:var_id]]
  1114.    
  1115.     if Input.trigger?(:R) && $game_system.relationship_info.size != 1 && $game_system.relationship_counter < $game_system.relationship_info.size
  1116.       $game_system.relationship_counter += 1
  1117.       @relationship_lv_up_window.refresh
  1118.       @relationship_details_window.refresh
  1119.       Sound.play_cursor
  1120.     elsif Input.trigger?(:R) && $game_system.relationship_info.size != 1 && $game_system.relationship_counter == $game_system.relationship_info.size
  1121.       $game_system.relationship_counter = 1
  1122.       @relationship_lv_up_window.refresh
  1123.       @relationship_details_window.refresh
  1124.       Sound.play_cursor
  1125.     elsif Input.trigger?(:L) && $game_system.relationship_info.size != 1 && $game_system.relationship_counter > 1
  1126.       $game_system.relationship_counter -= 1
  1127.       @relationship_lv_up_window.refresh
  1128.       @relationship_details_window.refresh
  1129.       Sound.play_cursor
  1130.     elsif Input.trigger?(:L) && $game_system.relationship_info.size != 1 && $game_system.relationship_counter == 1
  1131.       $game_system.relationship_counter = $game_system.relationship_info.size
  1132.       @relationship_lv_up_window.refresh
  1133.       @relationship_details_window.refresh
  1134.       Sound.play_cursor
  1135.     elsif Input.trigger?(:B)
  1136.       Sound.play_cancel
  1137.       $game_system.relationship_counter = 1
  1138.       return_scene
  1139.     elsif Input.trigger?(:C) && varnum >= 100 && $game_variables[$game_system.relationship_info[id][:var_level_id]] < 12 && Use_Leveling_System
  1140.       $game_variables[$game_system.relationship_info[id][:var_id]] = 0 unless Use_Polarities
  1141.       $game_variables[$game_system.relationship_info[id][:var_id]] = 50 if Use_Polarities
  1142.       $game_variables[$game_system.relationship_info[id][:var_level_id]] += 1
  1143.       check_for_reward
  1144.       @relationship_details_window.refresh
  1145.       @relationship_lv_up_window.refresh
  1146.     elsif Input.trigger?(:C) && (varnum != 100 || $game_variables[$game_system.relationship_info[id][:var_level_id]] == 12)
  1147.       Sound.play_cancel
  1148.     end
  1149.  
  1150.   end
  1151.  
  1152. end
  1153.  
  1154.  
  1155.  
  1156.  
  1157. #==============================================================================
  1158. # ** Scene Relationships
  1159. #------------------------------------------------------------------------------
  1160. #  This class performs Relationships scene processing.
  1161. #==============================================================================
  1162.  
  1163. class Scene_Relationships < Scene_MenuBase
  1164.  
  1165.   #--------------------------------------------------------------------------
  1166.   # * Includes Module's Variables With Class
  1167.   #--------------------------------------------------------------------------
  1168.  
  1169.   include V_Relationships::Specs
  1170.  
  1171.   #--------------------------------------------------------------------------
  1172.   # * Start Processing
  1173.   #--------------------------------------------------------------------------
  1174.  
  1175.   def start
  1176.     super
  1177.     create_relationship_title_window
  1178.     create_relationship_info_window
  1179.     create_relationship_select_window
  1180.  
  1181.   #--------------------------------------------------------------------------
  1182.   # * Background Processing
  1183.   #--------------------------------------------------------------------------
  1184.    
  1185.     if Use_Custom_Background != true
  1186.       @relationship_bg = Sprite.new
  1187.       @relationship_bg.bitmap = SceneManager.background_bitmap
  1188.       @relationship_bg.color.set(16, 16, 16, 128)
  1189.     else
  1190.       @relationship_bg = Sprite.new
  1191.       @relationship_bg.bitmap = Cache.picture(Background)
  1192.       @relationship_bg.x = 0
  1193.       @relationship_bg.y = 0
  1194.       @relationship_bg.zoom_x = ( Graphics.width.to_f / 544 )
  1195.       @relationship_bg.zoom_y = ( Graphics.height.to_f / 416 )
  1196.       @relationship_bg.opacity = 255
  1197.       @relationship_bg.visible = true  
  1198.     end
  1199.  
  1200.   end
  1201.  
  1202.   #--------------------------------------------------------------------------
  1203.   # * Create Relationship Title Window
  1204.   #--------------------------------------------------------------------------
  1205.  
  1206.   def create_relationship_title_window
  1207.     @relationship_title_window = Window_Relationship_Title.new(0, 0, 544, 90)
  1208.     @relationship_title_window.opacity = 0
  1209.   end
  1210.  
  1211.   #--------------------------------------------------------------------------
  1212.   # * Create Relationship Info Window
  1213.   #--------------------------------------------------------------------------
  1214.  
  1215.   def create_relationship_info_window
  1216.     @relationship_info_window = Window_Relationship_Info.new(0, 90, 544, ($game_system.relationship_info.size*215) + 70)
  1217.     @relationship_info_window.opacity = 0
  1218.   end
  1219.  
  1220.   #--------------------------------------------------------------------------
  1221.   # * Create Relationship Select Window
  1222.   #--------------------------------------------------------------------------
  1223.  
  1224.   def create_relationship_select_window
  1225.     @relationship_select_window = Window_Relationship_Select.new(55, 80, 415, 114)
  1226.     @relationship_select_window.back_opacity = 0
  1227.   end
  1228.  
  1229.   #--------------------------------------------------------------------------
  1230.   # * Frame Update
  1231.   #--------------------------------------------------------------------------
  1232.  
  1233.   def update
  1234.     super()
  1235.    
  1236.     if Input.trigger?(:B)
  1237.       Sound.play_cancel
  1238.       $game_system.relationship_counter = 1
  1239.       return_scene
  1240.     elsif Input.trigger?(:C)
  1241.       Sound.play_ok
  1242.       SceneManager.call(Scene_Relationship_Details)
  1243.     end
  1244.  
  1245.   end
  1246.  
  1247. end
  1248.  
  1249.  
  1250.  
  1251.  
  1252. #==============================================================================
  1253. # ** Window_MenuCommand
  1254. #------------------------------------------------------------------------------
  1255. #  This command window appears on the menu screen.
  1256. #==============================================================================
  1257.  
  1258. class Window_MenuCommand < Window_Command
  1259.  
  1260.   #--------------------------------------------------------------------------
  1261.   # * Includes Module's Variables With Class
  1262.   #--------------------------------------------------------------------------
  1263.  
  1264.   include V_Relationships::Specs
  1265.  
  1266.   #--------------------------------------------------------------------------
  1267.   # * For Creating An Alias
  1268.   #--------------------------------------------------------------------------
  1269.  
  1270.   alias v_relationships_winmenucmmd_aoc_13215           add_original_commands
  1271.  
  1272.   #--------------------------------------------------------------------------
  1273.   # * For Adding Original Commands
  1274.   #--------------------------------------------------------------------------
  1275.  
  1276.   def add_original_commands
  1277.     v_relationships_winmenucmmd_aoc_13215
  1278.     add_command(Window_Title, :relationships) unless $game_system.relationship_size == 1
  1279.   end
  1280.  
  1281. end
  1282.  
  1283.  
  1284.  
  1285.  
  1286. #==============================================================================
  1287. # ** Scene_Menu
  1288. #------------------------------------------------------------------------------
  1289. #  This class performs the menu screen processing.
  1290. #==============================================================================
  1291.  
  1292. class Scene_Menu < Scene_MenuBase
  1293.  
  1294.  
  1295.   #--------------------------------------------------------------------------
  1296.   # * Includes Module's Variables With Class
  1297.   #--------------------------------------------------------------------------
  1298.  
  1299.   include V_Relationships::Specs
  1300.  
  1301.   #--------------------------------------------------------------------------
  1302.   # * For Creating An Alias
  1303.   #--------------------------------------------------------------------------
  1304.  
  1305.   alias v_relationships_scenemenu_ccw_13215             create_command_window
  1306.  
  1307.   #--------------------------------------------------------------------------
  1308.   # * Create Command Window
  1309.   #--------------------------------------------------------------------------
  1310.  
  1311.   def create_command_window
  1312.     v_relationships_scenemenu_ccw_13215()
  1313.     @command_window.set_handler(:relationships,    method(:command_relationships)) if Use_Menu_Command && $game_system.relationship_info.size > 0
  1314.   end
  1315.  
  1316.   #--------------------------------------------------------------------------
  1317.   # * [Save] Command
  1318.   #--------------------------------------------------------------------------
  1319.   def command_relationships
  1320.     SceneManager.call(Scene_Relationships)
  1321.   end
  1322.  
  1323. end
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329. #==============================================================================
  1330. # ** Game_System
  1331. #------------------------------------------------------------------------------
  1332. #  This class handles system data. It saves the disable state of saving and
  1333. # menus. Instances of this class are referenced by $game_system.
  1334. #==============================================================================
  1335.  
  1336. class Game_System
  1337.  
  1338.   #--------------------------------------------------------------------------
  1339.   # * Public Instance Variables
  1340.   #--------------------------------------------------------------------------
  1341.  
  1342.   attr_accessor :relationship_info
  1343.   attr_accessor :relationship_counter
  1344.   attr_accessor :relationship_size
  1345.  
  1346.   #--------------------------------------------------------------------------
  1347.   # * For Creating An Alias
  1348.   #--------------------------------------------------------------------------
  1349.  
  1350.   alias v_relationships_gamesys_init_32                            initialize
  1351.  
  1352.   #--------------------------------------------------------------------------
  1353.   # * Object Initialization
  1354.   #--------------------------------------------------------------------------
  1355.  
  1356.   def initialize
  1357.     @relationship_info = {}
  1358.     @relationship_counter = 1
  1359.     @relationship_size = 1
  1360.     v_relationships_gamesys_init_32()
  1361.   end
  1362.  
  1363. end
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370. #==============================================================================
  1371. # ** Game_Interpreter
  1372. #------------------------------------------------------------------------------
  1373. #  An interpreter for executing event commands. This class is used within the
  1374. # Game_Map, Game_Troop, and Game_Event classes.
  1375. #==============================================================================
  1376.  
  1377. class Game_Interpreter
  1378.  
  1379.   #--------------------------------------------------------------------------
  1380.   # * Includes Module's Variables With Class
  1381.   #--------------------------------------------------------------------------
  1382.  
  1383.   include V_Relationships::Specs
  1384.  
  1385.   #--------------------------------------------------------------------------
  1386.   # * Add Relationship
  1387.   #--------------------------------------------------------------------------
  1388.    
  1389.   def add_relationship( name, title, relationship_variable,
  1390.                         relationship_level_variable, face_name, face_index,
  1391.                         location, description1, description2, description3,
  1392.                         description4, description5, description6, current_status,
  1393.                         lv_4_reward, lv_8_reward, lv_12_reward, liked_item,
  1394.                         disliked_item )
  1395.     id = $game_system.relationship_size
  1396.     $game_system.relationship_info[id] = {  :name           => name,
  1397.                                             :title          => title,
  1398.                                             :var_id         => relationship_variable,
  1399.                                             :var_level_id   => relationship_level_variable,
  1400.                                             :likes          => liked_item,
  1401.                                             :dislikes       => disliked_item,
  1402.                                             :face_name      => face_name,
  1403.                                             :face_index     => face_index,
  1404.                                             :location       => location,
  1405.                                             :description1   => description1,
  1406.                                             :description2   => description2,
  1407.                                             :description3   => description3,
  1408.                                             :description4   => description4,
  1409.                                             :description5   => description5,
  1410.                                             :description6   => description6,
  1411.                                             :current_status => current_status,
  1412.                                             :lv_4_gift      => lv_4_reward,
  1413.                                             :lv_8_gift      => lv_8_reward,
  1414.                                             :lv_12_gift     => lv_12_reward}
  1415.     $game_variables[$game_system.relationship_info[id][:var_id]] = 50 if Use_Polarities
  1416.     $game_system.relationship_size += 1
  1417.   end
  1418.  
  1419.   #--------------------------------------------------------------------------
  1420.   # * Personalize Leveling Icons
  1421.   #--------------------------------------------------------------------------
  1422.    
  1423.   def personalize_lv_icons( name, lv_0, tier_1, tier_2, tier_3 )
  1424.    
  1425.     $game_system.relationship_info.each_key do |id|
  1426.      
  1427.       if $game_system.relationship_info[id].has_value?(name)
  1428.         $game_system.relationship_info[id][:icons] = [lv_0, tier_1, tier_2, tier_3]
  1429.       end
  1430.    
  1431.     end
  1432.        
  1433.   end  
  1434.  
  1435.   #--------------------------------------------------------------------------
  1436.   # * Personalize Mastered Icons
  1437.   #--------------------------------------------------------------------------
  1438.    
  1439.   def personalize_mastered_icon( name, mastered_icon )
  1440.    
  1441.     $game_system.relationship_info.each_key do |id|
  1442.      
  1443.       if $game_system.relationship_info[id].has_value?(name)
  1444.         $game_system.relationship_info[id][:mastered_icon] = mastered_icon
  1445.       end
  1446.    
  1447.     end
  1448.        
  1449.   end  
  1450.  
  1451.   #--------------------------------------------------------------------------
  1452.   # * Change the Current Location of a Relationship
  1453.   #--------------------------------------------------------------------------
  1454.    
  1455.   def current_relationship_location( name , location )
  1456.    
  1457.     $game_system.relationship_info.each_key do |id|
  1458.      
  1459.       if $game_system.relationship_info[id].has_value?(name)
  1460.         $game_system.relationship_info[id][:location] = location
  1461.       end
  1462.      
  1463.     end
  1464.   end  
  1465.  
  1466.   #--------------------------------------------------------------------------
  1467.   # * Change the Current Status of a Relationship
  1468.   #--------------------------------------------------------------------------
  1469.    
  1470.   def current_relationship_status( name , current_status )
  1471.    
  1472.     $game_system.relationship_info.each_key do |id|
  1473.      
  1474.       if $game_system.relationship_info[id].has_value?(name)
  1475.         $game_system.relationship_info[id][:current_status] = current_status
  1476.       end
  1477.      
  1478.     end
  1479.   end  
  1480.  
  1481.   #--------------------------------------------------------------------------
  1482.   # * Change the Liked Item of a Relationship
  1483.   #--------------------------------------------------------------------------
  1484.    
  1485.   def change_liked_item( name , item_index )
  1486.    
  1487.     $game_system.relationship_info.each_key do |id|
  1488.      
  1489.       if $game_system.relationship_info[id].has_value?(name)
  1490.         $game_system.relationship_info[id][:likes] = item_index
  1491.       end
  1492.      
  1493.     end
  1494.   end  
  1495.  
  1496.   #--------------------------------------------------------------------------
  1497.   # * Change the Disliked Item of a Relationship
  1498.   #--------------------------------------------------------------------------
  1499.    
  1500.   def change_disliked_item( name , item_index )
  1501.    
  1502.     $game_system.relationship_info.each_key do |id|
  1503.      
  1504.       if $game_system.relationship_info[id].has_value?(name)
  1505.         $game_system.relationship_info[id][:dislikes] = item_index
  1506.       end
  1507.      
  1508.     end
  1509.   end  
  1510.  
  1511.   #--------------------------------------------------------------------------
  1512.   # * Change the Level 4 Reward of a Relationship
  1513.   #--------------------------------------------------------------------------
  1514.    
  1515.   def change_level_4_reward( name , item_index )
  1516.    
  1517.     $game_system.relationship_info.each_key do |id|
  1518.      
  1519.       if $game_system.relationship_info[id].has_value?(name)
  1520.         $game_system.relationship_info[id][:lv_4_gift] = item_index
  1521.       end
  1522.      
  1523.     end
  1524.   end  
  1525.  
  1526.   #--------------------------------------------------------------------------
  1527.   # * Change the Level 8 Reward of a Relationship
  1528.   #--------------------------------------------------------------------------
  1529.    
  1530.   def change_level_8_reward( name , item_index )
  1531.    
  1532.     $game_system.relationship_info.each_key do |id|
  1533.      
  1534.       if $game_system.relationship_info[id].has_value?(name)
  1535.         $game_system.relationship_info[id][:lv_8_gift] = item_index
  1536.       end
  1537.      
  1538.     end
  1539.   end  
  1540.  
  1541.   #--------------------------------------------------------------------------
  1542.   # * Change the Level 12 Reward of a Relationship
  1543.   #--------------------------------------------------------------------------
  1544.    
  1545.   def change_level_12_reward( name , item_index )
  1546.    
  1547.     $game_system.relationship_info.each_key do |id|
  1548.      
  1549.       if $game_system.relationship_info[id].has_value?(name)
  1550.         $game_system.relationship_info[id][:lv_12_gift] = item_index
  1551.       end
  1552.      
  1553.     end
  1554.   end  
  1555.  
  1556.   #--------------------------------------------------------------------------
  1557.   # * Add Level 12 Bonus Reward of a Relationship
  1558.   #--------------------------------------------------------------------------
  1559.    
  1560.   def add_level_12_bonus_reward( name )
  1561.    
  1562.     $game_system.relationship_info.each_key do |id|
  1563.      
  1564.       if $game_system.relationship_info[id].has_value?(name)
  1565.         $game_system.relationship_info[id][:lv_12_bonus] = {}
  1566.       end
  1567.      
  1568.     end
  1569.   end  
  1570.  
  1571. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top