Advertisement
CrowMakerVX

NoFightFriendMenu2.0

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