Advertisement
biward

Script Zouz

Feb 9th, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.23 KB | None | 0 0
  1. #    Auteur : Zouzaka
  2. #    Description : Ce Scripte permet de modifier les stats d'un hero grace a une
  3. #    pierre ou autre objet ...
  4.  
  5. module P_Stats
  6.   # ID de l'objet requis pour modifier les stats
  7.   Pierre_id = 17
  8.   Voc = ["Ajouter Max HP", "Ajouter Max MP", "Ajouter Attaque", "Ajouter Defense", "Ajouter Attaque Magique",
  9.   "Ajouter Defense Magique", "Ajouter Agilité", "Ajouter Chance", "Tu n'as pas la pierre"]
  10.      
  11. end
  12. class Scene_Pierre < Scene_Base
  13.   def start
  14.     super
  15.     create_background
  16.     creat_window_choix_actor
  17.     creat_window_help
  18.   end
  19.   def update
  20.     super
  21.     if Input.trigger?(:B)
  22.       if @window_actors.open?
  23.         SceneManager.return
  24.       else @window_choix.open?
  25.         @window_choix.close
  26.         @window_actors.open
  27.         @window_actors.activate
  28.       end
  29.     end
  30.   end
  31.   def create_background
  32.     @background_sprite = Sprite.new
  33.     @background_sprite.bitmap = SceneManager.background_bitmap
  34.     @background_sprite.color.set(16, 16, 16, 128)
  35.   end
  36.   def creat_window_choix
  37.     @window_choix = Window_Choix.new(0,50)
  38.     @window_choix.set_handler(:sym,      method(:cmd))
  39.   end
  40.   def creat_window_help
  41.     @window_help = Window_Help.new(1)
  42.   end
  43.   def creat_window_choix_actor
  44.     @window_actors = Window_Choix_Actor.new(350,50)
  45.     @window_actors.set_handler(:actor,      method(:cmd_hero))
  46.   end
  47.   #Commands Select Actor ...
  48.   def cmd_hero
  49.     @Selected_hero = $game_party.battle_members[@window_actors.index].id
  50.     creat_window_choix
  51.     @window_actors.close
  52.   end
  53.   #Commands Params
  54.   def cmd
  55.     if $game_party.item_number($data_items[P_Stats::Pierre_id]) >= 1
  56.       $game_party.lose_item($data_items[P_Stats::Pierre_id], 1)
  57.       $game_actors[@Selected_hero].add_param(@window_choix.index, 10)
  58.       @window_help.set_text("Max HP Augmenté !")
  59.       @window_choix.activate
  60.     else
  61.       @window_help.set_text(P_Stats::Voc[8])
  62.       @window_choix.activate
  63.     end
  64.   end
  65. end
  66. class Window_Choix < Window_Command
  67.   def make_command_list
  68.     P_Stats::Voc.each { |cmd| add_command(cmd,   :sym) }
  69.   end
  70. end
  71.    
  72. class Window_Choix_Actor < Window_Command
  73.   def make_command_list
  74.     $game_party.battle_members.each { |actor| add_command(actor.name, :actor) }
  75.   end  
  76. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement