Advertisement
CrowMakerVX

NoFightFriendMenu_1.0a

Dec 16th, 2012
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 37.43 KB | None | 0 0
  1. ################################################################################
  2. #                      NoFightFriendMenu 1.0a
  3. #                           By: Ixfuru
  4. #                        December 16, 2012
  5. ################################################################################
  6. #
  7. # The purpose of this script is to allow you to have a project without fighting.
  8. # This by no means is the SOLE purpose of the script, but it has that capability,
  9. # as you don't have to display any status scenes, weapons, skills, any of that
  10. # if you don't want.  It's all up to you.
  11. #
  12. # This script creates several new systems.  A menu system, A friendship system,
  13. # and a journal system.  It offers two new scenes and various new accessible
  14. # windows.  The menu system is set up so that you can a)keep both the menu
  15. # designed for this script, b)do away with the old one, or c)keep only the
  16. # old one.
  17. #
  18. # It is best that you only access the new scenes from the smaller, centered
  19. # menu that now appears when you press the menu button.  And the great thing is
  20. # you control it through a single switch.  
  21. #
  22. # There are tons of customization options and some special script call commands
  23. # that can be used to implement the friendship features.  Please read through
  24. # the instructions carefully, one section at a time and set the script up so
  25. # that it best suits your needs.
  26. #
  27. # By default, you will have access to every option available in the normal menu.
  28. # To change this, jump to SECTION 5 of the CUSTOMIZATION OPTIONS and set the
  29. # options you don't want to false.  Then, for how ever many you took out, you
  30. # may wish to adjust the window's size.  To do this, Jump down to line 750 or so,
  31. # you'll see an area boxed out with number signs.  Just follow the instructions
  32. # there to change the height of your menu window.  
  33. ###############################################################################            
  34. #
  35. #
  36. # If you use this script for non-commercial use, it's okay, as long as credit to
  37. # me, IXFURU, is given.  For commercial projects, You'll have to contact me via
  38. # one of the forums by PM or in THE FINISH LINE user forum found here:
  39. #
  40. #                http://www.rpgmakervx.net/index.php?showforum=94
  41. #
  42. # If you have problems with the script, contact me on the topic thread where this
  43. # script was posted.  You may not redistribute without my consent.
  44. #
  45. ################################################################################
  46. ################################################################################
  47. #===============================================================================
  48. ################################################################################
  49. #
  50. # This script was requested by Tigergirl7707, here:
  51. #  
  52. #             http://www.rpgmakervx.net/index.php?showtopic=57208
  53. #
  54. #
  55. ################################################################################
  56. #                             SECTION 1
  57. ################################################################################
  58. #
  59. #                          SPECIAL COMMANDS
  60. #
  61. # The following series of commands can be used in the script command of an event
  62. # to perform procedures on individuals regarded as party friends.  Use the id
  63. # given in the FRIENDS hash of the customization section to replace 'friend_id'
  64. # anywhere in these script calls.
  65. #
  66. # To add a friend to the parties friends, use:
  67. #
  68. #  $game_party.make_new_friend(friend_id)
  69. #
  70. # To remove a friend from the friends list use:
  71. #
  72. #   $game_party.defriend(friend_id)
  73. #
  74. # You can alter the friend's rating by using this script call.  In this call,
  75. # use the 'how' as an integer from 0 to 3.  This integer will state exactly how
  76. # to modify the rating.  if how is 1, it will add.  2 is subtract, 3 is multiply
  77. # and 4 is divide.   Just change the 'amount' to the value of how much you wish
  78. # to change the rating by.
  79. #
  80. #   $game_friends[friend_id].alter_rating(how, amount)
  81. #  
  82. # You can check if a specific person is in the party by using the following.  
  83. # This is good if you want to run a conditional branch to see if the individual
  84. # is your friend:
  85. #
  86. #   $game_party.check_for_friend(friend_id)
  87. #
  88. # You can get a total number of friends by using the following.  So if you
  89. # wanted to save the number in a variable, you could say $game_variables[x] =:
  90. #
  91. #    $game_party.total_friends
  92. #
  93. # To change an actor's portrait on the bio scene, call this.  Replace x with the
  94. # actor whose portrait you wish to change.  Then replace image with the image in
  95. # the Graphics\Pictures folder that you want to be the new portrait.
  96. #
  97. #
  98. # To alter a friend's storyline, you can use the following.  Just make sure you
  99. # replace the 'new_storyline' with double-quoted text:
  100. #      
  101. #    $game_friends[friend_id].change_storyline(new_storyline)
  102. #
  103. ################################################################################          
  104. ################################################################################
  105. #
  106. #                    CUSTOMIZATION SECTION START
  107. #
  108. ################################################################################
  109.  
  110. module NFFM
  111.  
  112.   ##############################################################################
  113.   #                             SECTION 2
  114.   ##############################################################################
  115.  
  116.   NFFM_SWITCH = 1 #This is the switch you want to grant access to the new menu
  117.                   # When it is ON, you will taken to the new menu, when OFF,
  118.                   # it will go to the old menu.  So to avoid going to the old
  119.                   # menu completely, just turn the switch you place here ON and
  120.                   # leave it ON.
  121.    
  122.   #-----------------------------------------------------------------------------
  123.   # Set up the friendtowns here.  Anywhere you can find a friend
  124.   # in the game, you'll need a string of where you found them here.  The formula
  125.   # is as follows:
  126.   #               town_id => town_name
  127.  
  128.   FRIENDTOWNS = {#<<<<Don't delete this!!!
  129.  
  130.   1 => "Smalltown",
  131.   2 => "Linkville",
  132.  
  133.   }#<<<<Don't delete this!!!
  134.  
  135.  
  136.   #-----------------------------------------------------------------------------
  137.  
  138.   # The following hash will store info about the friends you meet, for use in the
  139.   # friends page.  To complete it, you'll need to use this formula:
  140.   #
  141.   # id => [name, start_value, town, face_name, face_index, char_name, char_index, info],
  142.   #
  143.   # id:  This needs to be any number from 0 up.  Each id needs to be a unique
  144.   #      value.  The system will call this number to identify which friend's
  145.   #      information to display.
  146.   # name: This is the name of the friend you have met.  Doesn't matter what you
  147.   #       place here, as long as it is in string ("") form.
  148.   # start_value: The system will create a meter from which you will be able to
  149.   #            to tell how good of friends you are with this individual.  The
  150.   #            value you place here must be 0 or greater and will be the value
  151.   #             at which the individual starts at.  In other words, how good
  152.   #           of a friend is this person from the outset of the game.
  153.   # town: This value MUST BE greater than 0.  It will reference the FRIENDTOWN
  154.   #        hash above by key.  So the value you place here tells the system
  155.   #        that this particular friend is from the town with that id.
  156.   # face_name: This references which face to align with which individual friend.
  157.   #           In the scene, this face will be displayed along with that friend's
  158.   #            information.   This is actually a filename for the image you
  159.   #           want to display.
  160.   # face_index: This gives reference to which face you want to display from the
  161.   #            face file you selected in face_name.  There are 8 faces on a
  162.   #            face file sheet.  You can choose between 0-7 to pinpoint which
  163.   #            face of the given file you want.
  164.   # char_name:, char_index: These are the same as the face_name, face_index. The
  165.   #            only difference is that they give reference to the character,
  166.   #            or sprite sheet instead of the faces.
  167.   # info:   This can be a long string, ("") form, which will display a brief
  168.   #            summary as to who this person is.  
  169.  
  170.   FRIENDS = {#<<<Don't delete this!
  171.  
  172.   0 => ["Marty", 50, 1, "People1", 4, "People1", 4, "Marty is a quiet man from Smalltown. He has thrived on his toolshop, where he produces ladders, shovels and such."],
  173.   1 => ["Ariel", 40, 1, "People1", 1, "People1", 1, "Ariel is Marty's daughter."],
  174.   2 => ["Father Bronze", 80, 2, "People2", 0, "People2", 0, "Father Bronze works at the Chapel.  He is a good man, who gives to the poor."],
  175.  
  176.   }#<<<Don't delete this!
  177.  
  178.   #------------------------------------------------------------------------------
  179.  
  180.   STORYLINES = {#<<<<Don't delete this!!!
  181.  
  182.   0 => "Marty really wants me to retrieve his lost sword from the sewers.  Maybe I'll try to do that.",
  183.   1 => "Ariel is looking for some help in getting her cat  Pickles out of a tree just outside of town.",
  184.   2 => "Father Bronze just wants me to be a good kid, and stay out of trouble.",
  185.  
  186.   }#<<<<<Don't delete this!!!
  187.  
  188.   ##############################################################################
  189.   #                                SECTION 3
  190.   ##############################################################################
  191.  
  192.   COMMAND_FRIENDSHIP = "Relationships" #The text displayed as an option in the menu to
  193.                                    #open friendship scene
  194.   BIO_TITLE = "'s Biography" #The title window will display this text, placing
  195.                               #the actor's name just before it.
  196.   COMMANDS_COLOR = 28 #Text color of commands in menu
  197.   BIO_TITLE_COLOR = 14 #Text color of Bio Title
  198.   BIO_NAME_COLOR = 18 #Text color of name appearing over portrait
  199.   FRIEND_TITLE_COLOR = 6 #Text color of Friends Title
  200.   MENU_SKIN = "Liberty1" # You can alter this to the name of the windowskin you want to use
  201.                   # for the menu window.  If you leave it blank (""), it will refer
  202.                   # to the default windowskin. If you use a custom windowskin here,
  203.                   # you'll have to ensure that the skin is found in your systems
  204.                   # folder.
  205.   BIO_SKIN = "Liberty1"
  206.   FRIEND_SKIN = "Liberty1"
  207.   FULL_FRIEND_METER = 100 #Value at which a friend meter is considered full.
  208.   FRIENDCOUNT_STRING = "Total Friends" #This is the text beside how many friends
  209.                                         #you've made in both bio and friend scenes
  210.   OPENING_SE = "Ice1" #Sound effect when new pages are opened
  211.   CANCEL_SE = "Fire2" #Sound effect when pages are closed
  212.   STORYLINE_TEXT = "Storylines" #Command in small Storylines window, takes you to
  213.                            #Where you can read how the friend fits into the game.
  214.   USE_STORYLINES = true #Enables use of the Storyline Scene.
  215.   USE_FRIEND_PORTRAITS = true #Enables you to use friend portraits, instead of faces
  216.   METER_TEXT = "FRIEND METER" #Text to be displayed around the friend's rating meter
  217.   HOME_TEXT = "Hometown" #Text to be shown near where the friend lives.
  218.   STORYLINE_SKIN = "Liberty1"
  219.   METER_COLOR1 = 30
  220.   METER_COLOR2 = 31
  221.   METERBACK_COLOR = 8
  222.   #-----------------------------------------------------------------------------
  223.   ##############################################################################
  224.   #                             SECTION 4
  225.   ##############################################################################
  226.  
  227.   # Below is a hash which will hold the image of an actor to be displayed in the
  228.   # bio scene.  If only one member will 'lead' your party, then you should only
  229.   # have to insert an image for that actor. Here is the formula for how to
  230.   # set it up:
  231.   #                actor_id => image_filename
  232.   #
  233.   # Replace 'actor_id' with the id of the actor in the database.  Replace
  234.   # 'image_filname' with the name of the image you want which MUST be in kept
  235.   # in your pictures folder.
  236.  
  237.   BIO_IMAGES = {#<<<<Don't delete this!
  238.  
  239.   1 => "People1_0",
  240.  
  241.   }#Don't delete this!
  242.   #
  243.   #-----------------------------------------------------------------------------
  244.  
  245.   # Next, this is where you'll state the portraits used for FRIENDS.  Set it up
  246.   # just like you did in the BIO_IMAGES hash, except replace actor_id with the
  247.   # id of the friend.
  248.   #
  249.   FRIEND_PORTRAITS = {#<<<Don't delete this!!!
  250.  
  251.   0 => "People1_3",
  252.   1 => "People1_1",
  253.   2 => "People2_0",
  254.  
  255.   }#<<<<Don't delete this!!!
  256.  
  257.   #-----------------------------------------------------------------------------
  258.   #
  259.   # Set the following hash up with this formula:
  260.   #                 actor_id => bio
  261.   #
  262.   # This will be responsible for retrieving the displayable text of the actor
  263.   # who is currently leading your party.  For every actor who may lead, you'll
  264.   # need an actor_id in the party to match it.
  265.  
  266.   ACTOR_BIOS = {#<<<<Don't delete this!
  267.  
  268.   1 => "Barney is a strange young man.  All he does is wander the streets looking for friends.  He says he wants to help people.  Yet some feel it is Barney who requires assistance."
  269.  
  270.   }#<<<<Don't delete this!
  271.  
  272.   #-----------------------------------------------------------------------------
  273.   ##############################################################################
  274.   #                              SECTION 5
  275.   ##############################################################################
  276.   # The following group of constants decides whether or not you wish to use any
  277.   # of the default menu scenes, if true, they will be used.  If false, they won't.
  278.   USE_SAVE = true
  279.   USE_STATUS = true
  280.   USE_EQUIPMENT = true
  281.   USE_INVENTORY = true
  282.   USE_SKILL = true
  283.   USE_END = true
  284.  
  285.   ##############################################################################
  286.   #
  287.   #                       END OF CUSTOMIZATION
  288.   #
  289.   ##############################################################################
  290. end
  291.  
  292.  
  293.   #=============================================================================
  294.   #                         FRIEND
  295.   #=============================================================================
  296.  
  297. class Friend
  298.    
  299.   include NFFM
  300.    
  301.   attr_accessor :id
  302.   attr_accessor :name
  303.   attr_accessor :rating
  304.   attr_accessor :home
  305.   attr_accessor :face_name
  306.   attr_accessor :face_index
  307.   attr_accessor :char_name
  308.   attr_accessor :char_index
  309.   attr_accessor :info
  310.   attr_accessor :storyline
  311.  
  312.   def initialize(friend_id)
  313.     @id = friend_id
  314.     @rating = FRIENDS[@id][1]
  315.     @name = FRIENDS[@id][0]
  316.     @home = FRIENDS[@id][2]
  317.     @face_name = FRIENDS[@id][3]
  318.     @face_index = FRIENDS[@id][4]
  319.     @char_name = FRIENDS[@id][5]
  320.     @char_index = FRIENDS[@id][6]
  321.     @info = FRIENDS[@id][7]
  322.     @storyline = STORYLINES[@id]
  323.   end
  324.  
  325.   def alter_rating(how = 0, amount = 1)
  326.     if how == 0
  327.       @rating += amount
  328.     elsif how == 1
  329.       @rating -= amount
  330.     elsif how == 2
  331.       @rating *= amount
  332.     elsif how == 3
  333.       @rating /= amount
  334.     end
  335.     if @rating < 0
  336.       @rating = 0
  337.     elsif @rating > FULL_FRIEND_METER
  338.       @rating = FULL_FRIEND_METER
  339.     end
  340.   end
  341.  
  342.   def change_storyline(story)
  343.     @storyline = story
  344.   end
  345.  
  346.  
  347. end
  348.  
  349. #===============================================================================
  350. #                         GAME_FRIENDS
  351. #===============================================================================
  352. class Game_Friends
  353.  
  354.   include NFFM
  355.  
  356.   def initialize
  357.     @data = []
  358.   end
  359.  
  360.    def [](friend_id)
  361.     if @data[friend_id] == nil and FRIENDS[friend_id] != nil
  362.       @data[friend_id] = Friend.new(friend_id)
  363.     end
  364.     return @data[friend_id]
  365.   end
  366.  
  367. end
  368.  
  369.  
  370. #===============================================================================
  371. #                             GAME TEMP
  372. #===============================================================================
  373. class Game_Temp
  374.  
  375.   include NFFM
  376.  
  377.   attr_accessor :quicku
  378.   attr_accessor :from_friend
  379.   attr_accessor :storybase
  380.  
  381.   alias nffm_gt_initialize initialize unless $@
  382.   def initialize
  383.     nffm_gt_initialize
  384.     @quicku = false
  385.     @from_friend = false
  386.     @storybase = 0
  387.   end
  388.  
  389. end
  390.  
  391. #===============================================================================
  392. #                               GAME PARTY
  393. #===============================================================================
  394. class Game_Party < Game_Unit
  395.  
  396.   include NFFM
  397.  
  398.   attr_accessor :friends
  399.   attr_accessor :total_friends
  400.   attr_accessor :friendtowns
  401.  
  402.   alias nffm_gp_initialize initialize unless $@
  403.   def initialize
  404.     nffm_gp_initialize
  405.     @friends = []
  406.     @friendtowns = []
  407.     @total_friends = 0
  408.   end
  409.  
  410.   def make_new_friend(friend_id)
  411.     if @friends.include?(friend_id)
  412.     else
  413.       @friends.push(friend_id)
  414.       get_total_friends
  415.     end
  416.   end
  417.  
  418.   def check_for_friend(friend_id)
  419.     if @friends.include?(friend_id)
  420.       return true
  421.     else
  422.       return false
  423.     end
  424.   end
  425.  
  426.   def defriend(friend_id)
  427.     if @friends.include?(friend_id)
  428.       @friends.delete(friend_id)
  429.       get_total_friends
  430.     end
  431.   end
  432.  
  433.   def get_total_friends
  434.     @total_friends = @friends.size
  435.   end
  436.  
  437. end
  438.  
  439. #===============================================================================
  440. #                      Game Actor
  441. #===============================================================================
  442. class Game_Actor
  443.  
  444.   include NFFM
  445.  
  446.   attr_accessor :portrait
  447.  
  448.   alias nffm_ga_initialize initialize unless $@
  449.   def initialize(actor_id)
  450.     nffm_ga_initialize(actor_id)
  451.     @portrait = BIO_IMAGES[actor_id]
  452.   end
  453.  
  454.   def change_portrait(image)
  455.     @portrait = image
  456.   end
  457.  
  458.   def return_default_portrait
  459.     @portrait = BIO_IMAGES[@id]
  460.   end
  461.  
  462. end
  463.  
  464.  
  465. #===============================================================================
  466. #                           Window Base
  467. #===============================================================================
  468. class Window_Base < Window
  469.  
  470.   include NFFM
  471.  
  472.   attr_accessor :meters
  473.   attr_accessor :portrait
  474.  
  475.   def draw_friendship_gauge(friend_id, x, y, width = 120)
  476.     friend = $game_friends[friend_id]
  477.     gw = width * friend.rating / FULL_FRIEND_METER
  478.     gc1 = text_color(METER_COLOR1)
  479.     gc2 = text_color(METER_COLOR2)
  480.     self.contents.fill_rect(x, y + WLH - 8, width, 6, text_color(METERBACK_COLOR))
  481.     self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  482.   end
  483.  
  484.   def update_portrait
  485.     if @portrait != nil
  486.       @portrait.update
  487.     end
  488.   end
  489.  
  490.   def draw_friend_home(friend_id, x, y)
  491.     hometown = $game_friends[friend_id].home
  492.     self.contents.draw_text(x, y, self.width, WLH, FRIENDTOWNS[hometown])
  493.   end
  494.  
  495.   def draw_friend_name(friend_id, x, y)
  496.     name = $game_friends[friend_id].name
  497.     self.contents.draw_text(x, y, self.width, WLH, name, 1)
  498.   end
  499.  
  500.   def draw_friend_portrait(friend_id, x, y)
  501.     porport = Viewport.new(x,  y, 272, 288)
  502.     portsprite = Sprite.new(porport)
  503.     portsprite.bitmap = Cache.picture(FRIEND_PORTRAITS[friend_id])
  504.     portsprite.z = 101
  505.     @portrait = portsprite
  506.   end
  507.  
  508.   def clear_portrait
  509.     if @portrait != nil
  510.       @portrait.dispose
  511.     end
  512.   end
  513.  
  514. end
  515.  
  516. #===============================================================================
  517. #                            Scene Title
  518. #===============================================================================
  519. class Scene_Title < Scene_Base
  520.  
  521.   alias nffm_st_create_game_objects create_game_objects unless $@
  522.   def create_game_objects
  523.     nffm_st_create_game_objects
  524.     $game_friends = Game_Friends.new
  525.   end
  526.  
  527. end
  528.  
  529. #===============================================================================
  530. #                             Scene Map
  531. #===============================================================================
  532.  
  533. class Scene_Map < Scene_Base
  534.  
  535.   include NFFM
  536.  
  537.   alias nffm_sm_start start unless $@
  538.   def start
  539.     nffm_sm_start
  540.     $game_temp.quicku = false
  541.   end
  542.  
  543.   alias nffm_sm_update update unless $@
  544.   def update
  545.     if $game_temp.from_friend
  546.       open_quicku
  547.     elsif $game_temp.quicku
  548.       super
  549.       update_quicku
  550.     else
  551.       nffm_sm_update
  552.     end
  553.   end
  554.  
  555.   alias nffm_sm_update_call_menu update_call_menu unless $@
  556.   def update_call_menu
  557.     if Input.trigger?(Input::B)
  558.       if $game_switches[NFFM_SWITCH]
  559.         return if $game_map.interpreter.running?
  560.         return if $game_system.menu_disabled
  561.         RPG::SE.new(OPENING_SE, 100, 80).play
  562.         open_quicku
  563.       else
  564.         nffm_sm_update_call_menu
  565.       end
  566.     end
  567.   end
  568.  
  569.   def open_quicku
  570.     @win_quicku = Window_QuickMenu.new(200, 90)
  571.     @win_quicku.active = true
  572.     $game_temp.quicku = true
  573.     $game_temp.from_friend = false
  574.   end
  575.  
  576.  
  577.   def update_quicku
  578.     @win_quicku.update
  579.     if Input.trigger?(Input::C)
  580.       case @win_quicku.index
  581.       when 0
  582.         RPG::SE.new(OPENING_SE, 80, 80).play
  583.         $scene = Scene_Bio.new
  584.       when 1
  585.         RPG::SE.new(OPENING_SE, 80, 80).play
  586.         $scene = Scene_Friendships.new
  587.       when 2...@win_quicku.commands_order.size
  588.         wqc = @win_quicku.commands_order[@win_quicku.index]
  589.         RPG::SE.new(OPENING_SE, 80, 80).play
  590. #~         p wqc
  591.         if wqc == 2
  592.           $scene = Scene_Item.new
  593.         elsif wqc == 3
  594.           $scene = Scene_Skill.new
  595.         elsif wqc == 4
  596.           $scene = Scene_Equip.new
  597.         elsif wqc == 5
  598.           $scene = Scene_Status.new
  599.         elsif wqc == 6
  600.           $scene = Scene_File.new(true, false, false)
  601.         elsif wqc == 7
  602.           $scene = Scene_End.new
  603.         end
  604.       end
  605.     elsif Input.trigger?(Input::B)
  606.       RPG::SE.new(CANCEL_SE, 80, 80).play
  607.       $scene = Scene_Map.new
  608.     end
  609.   end
  610.  
  611.   alias nffm_gm_terminate terminate unless $@
  612.   def terminate
  613.     if $game_temp.quicku
  614.       @win_quicku.dispose
  615.       $game_temp.quicku = false
  616.       $game_temp.from_friend = false
  617.     end
  618.     nffm_gm_terminate
  619.   end
  620.  
  621.  
  622. end
  623.  
  624. #===============================================================================
  625. #                         Scene Item
  626. #===============================================================================
  627. class Scene_Item < Scene_Base
  628.  
  629.   include NFFM
  630.  
  631.   alias nffm_si_return_scene return_scene unless $@
  632.   def return_scene
  633.     if $game_switches[NFFM_SWITCH]
  634.       $game_temp.from_friend = true
  635.       $scene = Scene_Map.new
  636.     else
  637.       nffm_si_return_scene
  638.     end
  639.   end
  640.  
  641. end
  642.  
  643. #===============================================================================
  644. #                          Scene Skill
  645. #===============================================================================
  646. class Scene_Skill < Scene_Base
  647.  
  648.   include NFFM
  649.  
  650.   alias nffm_ss_return_scene return_scene unless $@
  651.   def return_scene
  652.     if $game_switches[NFFM_SWITCH]
  653.       $game_temp.from_friend = true
  654.       $scene = Scene_Map.new
  655.     else
  656.       nffm_ss_return_scene
  657.     end
  658.   end
  659.  
  660. end
  661.  
  662. #===============================================================================
  663. #                         Scene Equip
  664. #===============================================================================
  665. class Scene_Equip < Scene_Base
  666.  
  667.   include NFFM
  668.  
  669.   alias nffm_se_return_scene return_scene unless $@
  670.   def return_scene
  671.     if $game_switches[NFFM_SWITCH]
  672.       $game_temp.from_friend = true
  673.       $scene = Scene_Map.new
  674.     else
  675.       nffm_se_return_scene
  676.     end
  677.   end
  678.  
  679. end
  680.  
  681. #===============================================================================
  682. #                          Scene Status
  683. #===============================================================================
  684. class Scene_Status < Scene_Status
  685.  
  686.   include NFFM
  687.  
  688.   alias nffm_sstat_return_scene return_scene unless $@
  689.   def return_scene
  690.     if $game_switches[NFFM_SWITCH]
  691.       $game_temp.from_friend = true
  692.       $scene = Scene_Map.new
  693.     else
  694.       nffm_sstat_return_scene
  695.     end
  696.   end
  697.  
  698. end
  699. #===============================================================================
  700. #                          Scene File
  701. #===============================================================================
  702. class Scene_File < Scene_Base
  703.  
  704.   include NFFM
  705.  
  706.   alias nffm_write_save_data write_save_data unless $@
  707.   def write_save_data(file)
  708.     nffm_write_save_data(file)
  709.     Marshal.dump($game_friends, file)
  710.   end
  711.  
  712.   alias nffm_read_save_data read_save_data unless $@
  713.   def read_save_data(file)
  714.     $game_friends = Marshal.load(file)
  715.     nffm_read_save_data(file)
  716.   end
  717.  
  718.   alias nffm_sf_return_scene return_scene unless $@
  719.   def return_scene
  720.     if $game_switches[NFFM_SWITCH]
  721.       $game_temp.from_friend = true
  722.       $scene = Scene_Map.new
  723.     else
  724.       nffm_sf_return_scene
  725.     end
  726.   end
  727. end
  728.  
  729. #===============================================================================
  730. #                           Scene_End
  731. #===============================================================================
  732. class Scene_End < Scene_Base
  733.  
  734.   include NFFM
  735.  
  736.   alias nffm_send_return_scene return_scene unless $@
  737.   def return_scene
  738.     if $game_switches[NFFM_SWITCH]
  739.       $game_temp.from_friend = true
  740.       $scene = Scene_Map.new
  741.     else
  742.       nffm_send_return_scene
  743.     end
  744.   end
  745.  
  746. end
  747.  
  748. #===============================================================================
  749. #                       Window QuickMenu
  750. #===============================================================================
  751.  
  752. class Window_QuickMenu < Window_Selectable
  753.  
  754.   include NFFM
  755.  
  756.   attr_reader :commands_order
  757.  
  758.   def initialize(x, y)
  759.     ############################################################################
  760.     ############################################################################
  761.     super(x, y, 160, 232) # for every selection you omit, from the menu options,
  762.     ####################### subtract 32 from the last number in the super().
  763.     ######################  Then, adjust as needed.
  764.     ############################################################################
  765.     ############################################################################
  766.     @commands = []
  767.     get_commands
  768.     @item_max = @commands.size
  769.     unless MENU_SKIN == ""
  770.       self.windowskin = Cache.system(MENU_SKIN)
  771.     end
  772.     refresh
  773.     self.index = 0
  774.   end
  775.  
  776.   def get_commands
  777.     c1 = $game_party.members[0].name
  778.     c2 = COMMAND_FRIENDSHIP
  779.     shorts = [c1, c2]
  780.     @commands.concat(shorts)
  781.     if USE_INVENTORY
  782.       @commands.push(Vocab::item)
  783.     end
  784.     if USE_SKILL
  785.       @commands.push(Vocab::skill)
  786.     end
  787.     if USE_EQUIPMENT
  788.       @commands.push(Vocab::equip)
  789.     end
  790.     if USE_STATUS
  791.       @commands.push(Vocab::status)
  792.     end
  793.     if USE_SAVE
  794.       @commands.push(Vocab::save)
  795.     end
  796.     if USE_END
  797.       @commands.push(Vocab::game_end)
  798.     end
  799.     @commands_order = []
  800.     @commands_order[0] = 0
  801.     @commands_order[1] = 1
  802.     for i in 2...@commands.size
  803.       case @commands[i]
  804.       when Vocab::item
  805.         @commands_order[i] = 2
  806.       when Vocab::skill
  807.         @commands_order[i] = 3
  808.       when Vocab::equip
  809.         @commands_order[i] = 4
  810.       when Vocab::status
  811.         @commands_order[i] = 5
  812.       when Vocab::save
  813.         @commands_order[i] = 6
  814.       when Vocab::game_end
  815.         @commands_order[i] = 7
  816.       end
  817.     end
  818.   end
  819.  
  820.   def refresh
  821.     self.contents.clear
  822.     create_contents
  823.     for i in 0...@item_max
  824.       draw_item(i)
  825.     end
  826.   end
  827.  
  828.   def draw_item(index)
  829.     rect = item_rect(index)
  830.     self.contents.clear_rect(rect)
  831.     rect.x += 4
  832.     rect.width -= 8
  833.     self.contents.font.color = text_color(COMMANDS_COLOR)
  834.     self.contents.draw_text(rect, @commands[index])
  835.   end
  836.  
  837. end
  838.  
  839.  
  840. #===============================================================================
  841. #                             Window Biography
  842. #===============================================================================
  843. class Window_Biography < Window_Base
  844.  
  845.   include NFFM
  846.  
  847.   def initialize(x, y)
  848.     super(x, y, 180, 416)
  849.     @actor = $game_party.members[0]
  850.     unless BIO_SKIN == ""
  851.       self.windowskin = Cache.system(BIO_SKIN)
  852.     end
  853.     refresh
  854.   end
  855.  
  856.   def refresh
  857.     self.contents.clear
  858.     self.contents.font.size = 18
  859.     self.contents.font.color = text_color(BIO_TITLE_COLOR)
  860.     self.contents.draw_text(-15, 0, self.width, 36, @actor.name + BIO_TITLE, 1)
  861.     self.contents.font.size = 12
  862.     self.contents.font.color = normal_color
  863.     self.contents.draw_paragraph(0, 48, 145, self.height, ACTOR_BIOS[@actor.id])
  864.   end
  865.  
  866. end
  867.  
  868. #===============================================================================
  869. #                           Window Portrait
  870. #===============================================================================
  871. class Window_Portrait < Window_Base
  872.  
  873.   include NFFM
  874.  
  875.   attr_accessor :bio_sprite
  876.  
  877.   def initialize(x, y)
  878.     super(x, y, 364, 416)
  879.     @actor = $game_party.members[0]
  880.     unless BIO_SKIN == ""
  881.       self.windowskin = Cache.system(BIO_SKIN)
  882.     end
  883.     refresh
  884.   end
  885.  
  886.   def refresh
  887.     self.contents.clear
  888.     self.contents.font.size = 32
  889.     self.contents.font.color = text_color(BIO_NAME_COLOR)
  890.     self.contents.draw_text(-22, 0, self.width, 44, @actor.name, 1)
  891.     self.contents.font.size = 18
  892.     self.contents.font.color = system_color
  893.     self.contents.draw_text(-22, 44, self.width, 30, FRIENDCOUNT_STRING, 1)
  894.     self.contents.font.color = normal_color
  895.     move = FRIENDCOUNT_STRING.length
  896.     self.contents.draw_text(-30 + move, 64, self.width, 30, $game_party.total_friends.to_s, 1)
  897.     self.contents.font.size = 12
  898.     port = Viewport.new(225, 105, 272, 288)
  899.     port.z = 101
  900.     @bio_sprite = Sprite.new(port)
  901.     @bio_sprite.bitmap = Cache.picture(BIO_IMAGES[@actor.id])
  902.     @bio_sprite.x = 0
  903.     @bio_sprite.y = 0
  904.   end
  905.  
  906. end
  907.  
  908. #===============================================================================
  909. #                           Scene Bio
  910. #===============================================================================
  911. class Scene_Bio < Scene_Base
  912.  
  913.   include NFFM
  914.  
  915.   def start
  916.     super
  917.     create_menu_background
  918.     @win_bio = Window_Biography.new(0, 0)
  919.     @win_portrait = Window_Portrait.new(181, 0)
  920.   end
  921.  
  922.   def update
  923.     @win_portrait.bio_sprite.update
  924.     if Input.trigger?(Input::B)
  925.       RPG::SE.new(CANCEL_SE, 80, 80)
  926.       $game_temp.from_friend = true
  927.       $scene = Scene_Map.new
  928.     end
  929.   end
  930.  
  931.   def terminate
  932.     @win_bio.dispose
  933.     @win_portrait.bio_sprite.dispose
  934.     @win_portrait.dispose
  935.   end
  936.  
  937. end
  938.  
  939. #===============================================================================
  940. #                              Window_FriendCommands
  941. #===============================================================================
  942. class Window_FriendCommands < Window_Selectable
  943.  
  944.   include NFFM
  945.  
  946.   def initialize(x, y)
  947.     super(x, y, 180, 416)
  948.     @commands = []
  949.     for i in 0...FRIENDS.size
  950.       if $game_party.friends.include?(i)
  951.         @commands.push($game_friends[$game_party.friends[i]].name)
  952.       end
  953.     end
  954.     @item_max = @commands.size
  955.     unless FRIEND_SKIN == ""
  956.       self.windowskin = Cache.system(FRIEND_SKIN)
  957.     end
  958.     refresh
  959.     self.index = 0
  960.   end
  961.  
  962.   def refresh
  963.     create_contents
  964.     self.contents.clear
  965.     for i in 0...@item_max
  966.       draw_item(i)
  967.     end
  968.   end
  969.  
  970.   def draw_item(index, enabled = true)
  971.     rect = item_rect(index)
  972.     self.contents.clear_rect(rect)
  973.     rect.x += 4
  974.     rect.width -= 8
  975.     self.contents.font.color = text_color(COMMANDS_COLOR)
  976.     self.contents.draw_text(rect, @commands[index], 1)
  977.   end
  978.  
  979. end
  980.  
  981. #===============================================================================
  982. #                         Window Storyline Command
  983. #===============================================================================
  984. class Window_StorylineCommand < Window_Selectable
  985.  
  986.   include NFFM
  987.  
  988.   def initialize(x, y)
  989.     super(x, y, 364, 90)
  990.     @commands = []
  991.     @commands[0] = STORYLINE_TEXT
  992.     @commands[1] = "Cancel"
  993.     @item_max = @commands.size
  994.     unless FRIEND_SKIN == ""
  995.       self.windowskin = Cache.system(FRIEND_SKIN)
  996.     end
  997.     refresh
  998.     self.index = 0
  999.   end
  1000.  
  1001.   def refresh
  1002.     create_contents
  1003.     self.contents.clear
  1004.     for i in 0...@item_max
  1005.       draw_item(i)
  1006.     end
  1007.   end
  1008.  
  1009.   def draw_item(index, enabled = true)
  1010.     rect = item_rect(index)
  1011.     self.contents.clear_rect(rect)
  1012.     rect.x += 4
  1013.     rect.width -= 8
  1014.     self.contents.font.color = text_color(COMMANDS_COLOR)
  1015.     self.contents.draw_text(rect, @commands[index], 1)
  1016.   end
  1017.  
  1018. end
  1019.  
  1020. #===============================================================================
  1021. #                          Window Friend Info
  1022. #===============================================================================
  1023. class Window_FriendInfo < Window_Base
  1024.  
  1025.   include NFFM
  1026.  
  1027.   def initialize(x, y)
  1028.     if USE_STORYLINES
  1029.       super(x, y, 364, 326)
  1030.     else
  1031.       super(x, y, 364, 416)
  1032.     end
  1033.     @friends = $game_friends
  1034.     unless FRIEND_SKIN == ""
  1035.       self.windowskin = Cache.system(FRIEND_SKIN)
  1036.     end
  1037.   end
  1038.  
  1039.   def create_friend_contents(friend_id)
  1040.     create_contents
  1041.     self.contents.clear
  1042.     if USE_FRIEND_PORTRAITS
  1043.       clear_portrait
  1044.     end
  1045.     id = friend_id
  1046.     friend = @friends[friend_id]
  1047.     self.contents.font.size = 26
  1048.     self.contents.font.color = text_color(FRIEND_TITLE_COLOR)
  1049.     draw_friend_name(id, -12, 0)
  1050.     if USE_FRIEND_PORTRAITS
  1051.       draw_friend_portrait(id, 205, 30)
  1052.     else
  1053.       draw_face(friend.face_name, friend.face_index, 25, 120, 96)
  1054.     end
  1055.     self.contents.font.color = system_color
  1056.     self.contents.font.size = 12
  1057.     self.contents.draw_text(10, 225, self.width, WLH, METER_TEXT)
  1058.     draw_friendship_gauge(id, 102, 219, 250)
  1059.     self.contents.draw_text(90, 50, self.width, WLH, HOME_TEXT)
  1060.     self.contents.font.color = normal_color
  1061.     self.contents.font.size = 14
  1062.     draw_friend_home(id, 160, 50)
  1063.     draw_character(friend.char_name, friend.char_index, 25, 230)
  1064.     self.contents.font.size = 12
  1065.     self.contents.draw_paragraph(0, 250, 300, 100, friend.info)
  1066.   end
  1067.  
  1068. end
  1069.  
  1070. #===============================================================================
  1071. #                       Window Storylines
  1072. #===============================================================================
  1073. class Window_Storylines < Window_Base
  1074.  
  1075.   include NFFM
  1076.  
  1077.   attr_accessor :story
  1078.  
  1079.   def initialize(x, y)
  1080.     super(x, y, 544, 416)
  1081.     unless FRIEND_SKIN == ""
  1082.       self.windowskin = Cache.system(FRIEND_SKIN)
  1083.     end
  1084.     @story = 0
  1085.     refresh
  1086.   end
  1087.  
  1088.   def refresh
  1089.     self.contents.clear
  1090.     unless @story == nil
  1091.       self.contents.font.color = normal_color
  1092.       self.contents.draw_paragraph(0, 0, 480, 380, $game_friends[@story].storyline)
  1093.     end
  1094.   end
  1095.  
  1096. end
  1097.  
  1098. #===============================================================================
  1099. #                               Scene Friendships
  1100. #===============================================================================
  1101. class Scene_Friendships < Scene_Base
  1102.  
  1103.   include NFFM
  1104.  
  1105.   def start
  1106.     super
  1107.     @win_fcom = Window_FriendCommands.new(0, 0)
  1108.     @win_finfo = Window_FriendInfo.new(181, 0)
  1109.     if USE_STORYLINES
  1110.       @win_fslines = Window_StorylineCommand.new(181, 327)
  1111.     end
  1112.     @story_open = false
  1113.     @win_fcom.active = true
  1114.   end
  1115.  
  1116.   def update
  1117.     if @win_fcom.active
  1118.       @win_fcom.refresh
  1119.       @win_fcom.update
  1120.       @win_finfo.create_friend_contents($game_friends[$game_party.friends[@win_fcom.index]].id)
  1121.       @win_finfo.update_portrait
  1122.       if Input.trigger?(Input::B)
  1123.         RPG::SE.new(CANCEL_SE, 80, 80)
  1124.         $game_temp.quicku = true
  1125.         $game_temp.from_friend = true
  1126.         $scene = Scene_Map.new
  1127.       elsif Input.trigger?(Input::C)
  1128.         if USE_STORYLINES
  1129.           RPG::SE.new(OPENING_SE, 80, 80)
  1130.           make_storyline_active
  1131.         end
  1132.       end
  1133.     elsif USE_STORYLINES
  1134.       if @win_fslines.active
  1135.         @win_fslines.refresh
  1136.         @win_fslines.update
  1137.         if Input.trigger?(Input::B)
  1138.           RPG::SE.new(CANCEL_SE, 80, 80)
  1139.           make_commands_active
  1140.         elsif Input.trigger?(Input::C)
  1141.           RPG::SE.new(OPENING_SE, 80, 80)
  1142.           case @win_fslines.index
  1143.           when 0
  1144.            @win_story = Window_Storylines.new(0, 0)
  1145.            @win_story.story = $game_friends[$game_party.friends[@win_fcom.index]].id
  1146.            make_story_active
  1147.            @story_open = true
  1148.           when 1
  1149.             RPG::SE.new(CANCEL_SE, 80, 80)
  1150.             make_commands_active
  1151.           end
  1152.         end
  1153.       elsif @story_open
  1154.         @win_story.refresh
  1155.         if Input.trigger?(Input::B)
  1156.           RPG::SE.new(CANCEL_SE, 80, 80)
  1157.           make_storyline_active
  1158.         elsif Input.trigger?(Input::C)
  1159.           RPG::SE.new(CANCEL_SE, 80,80)
  1160.           make_storyline_active
  1161.         end
  1162.       end
  1163.     end
  1164.   end
  1165.  
  1166.   def make_storyline_active
  1167.     @win_fcom.active = false
  1168.     @win_fslines.active = true
  1169.     if @story_open
  1170.       $game_temp.storybase = -1
  1171.       @win_story.dispose
  1172.       @story_open = false
  1173.     end
  1174.   end
  1175.  
  1176.   def make_commands_active
  1177.     @win_fslines.active = false
  1178.     @win_fcom.active = true
  1179.   end
  1180.  
  1181.   def make_story_active
  1182.     @win_fslines.active = false
  1183.     @win_fcom.active = false
  1184.   end
  1185.  
  1186.   def terminate
  1187.     @win_fcom.dispose
  1188.     @win_finfo.contents.dispose
  1189.     @win_finfo.dispose
  1190.     if USE_STORYLINES
  1191.       @win_fslines.dispose
  1192.     end
  1193.   end
  1194.  
  1195. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement