Advertisement
Guest User

NoFightFriendMenu 2.0

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