Advertisement
Guest User

Untitled

a guest
Jun 30th, 2012
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.19 KB | None | 0 0
  1. =begin
  2. More Choices
  3. by Fomar0153
  4. Version 1.0
  5. ----------------------
  6. Notes
  7. ----------------------
  8. No requirements
  9. Allows you to have more than four choices
  10. ----------------------
  11. Instructions
  12. ----------------------
  13. Edit the method more_choice and then use the call in
  14. a choice option.
  15. ----------------------
  16. Known bugs
  17. ----------------------
  18. None
  19.  
  20. Modifications made by Darkhog:
  21. You can use call script to set choices. Call is as follows:
  22. $morechoices = ["choice1","choice2","choice3",...]
  23. and then call Show Choices: choices.
  24. =end
  25. class Game_Interpreter
  26.   #--------------------------------------------------------------------------
  27.   # ● Edit Here
  28.   # when handle
  29.   #   $game_message.choices.push("a choice")
  30.   #--------------------------------------------------------------------------
  31.   def more_choice(p)
  32.     case p
  33.     when "Pizza Topping"
  34.       $game_message.choices.push("Ham & Pineapple")
  35.       $game_message.choices.push("Meat Feast")
  36.       $game_message.choices.push("Chocolate")
  37.       $game_message.choices.push("BBQ")
  38.       $game_message.choices.push("Diamonds")
  39.       $game_message.choices.push("Spicy Chicken")
  40.       $game_message.choices.push("Garlic")
  41.     when "choices"
  42.       #DO NOT EDIT THIS BIT! - Darkhog
  43.       $morechoices.each do |i|
  44.         $game_message.choices.push(i)
  45.       end
  46.     else
  47.       $game_message.choices.push(p)
  48.     end
  49.   end
  50.   #--------------------------------------------------------------------------
  51.   # ● Long Choices - Don't edit this bit
  52.   #--------------------------------------------------------------------------
  53.   def setup_choices(params)
  54.     for s in params[0]
  55.       more_choice(s)
  56.     end
  57.     $game_message.choice_cancel_type = params[1]
  58.     $game_message.choice_proc = Proc.new {|n| @branch[@indent] = n }
  59.   end
  60. end
  61.  
  62. class Window_ChoiceList < Window_Command
  63.   #--------------------------------------------------------------------------
  64.   # ● Feel free to change the 1 to another variable that you'd prefer
  65.   #--------------------------------------------------------------------------
  66.   alias mc_call_ok_handler call_ok_handler
  67.   def call_ok_handler
  68.     $game_variables[1] = index
  69.     mc_call_ok_handler
  70.   end
  71. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement