Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Auteur : Zouzaka
- # Description : Ce Scripte permet de modifier les stats d'un hero grace a une
- # pierre ou autre objet ...
- module P_Stats
- # ID de l'objet requis pour modifier les stats
- Pierre_id = 17
- Voc = ["Ajouter Max HP", "Ajouter Max MP", "Ajouter Attaque", "Ajouter Defense", "Ajouter Attaque Magique",
- "Ajouter Defense Magique", "Ajouter Agilité", "Ajouter Chance", "Tu n'as pas la pierre"]
- end
- class Scene_Pierre < Scene_Base
- def start
- super
- create_background
- creat_window_choix_actor
- creat_window_help
- end
- def update
- super
- if Input.trigger?(:B)
- if @window_actors.open?
- SceneManager.return
- else @window_choix.open?
- @window_choix.close
- @window_actors.open
- @window_actors.activate
- end
- end
- end
- def create_background
- @background_sprite = Sprite.new
- @background_sprite.bitmap = SceneManager.background_bitmap
- @background_sprite.color.set(16, 16, 16, 128)
- end
- def creat_window_choix
- @window_choix = Window_Choix.new(0,50)
- @window_choix.set_handler(:sym, method(:cmd))
- end
- def creat_window_help
- @window_help = Window_Help.new(1)
- end
- def creat_window_choix_actor
- @window_actors = Window_Choix_Actor.new(350,50)
- @window_actors.set_handler(:actor, method(:cmd_hero))
- end
- #Commands Select Actor ...
- def cmd_hero
- @Selected_hero = $game_party.battle_members[@window_actors.index].id
- creat_window_choix
- @window_actors.close
- end
- #Commands Params
- def cmd
- if $game_party.item_number($data_items[P_Stats::Pierre_id]) >= 1
- $game_party.lose_item($data_items[P_Stats::Pierre_id], 1)
- $game_actors[@Selected_hero].add_param(@window_choix.index, 10)
- @window_help.set_text("Max HP Augmenté !")
- @window_choix.activate
- else
- @window_help.set_text(P_Stats::Voc[8])
- @window_choix.activate
- end
- end
- end
- class Window_Choix < Window_Command
- def make_command_list
- P_Stats::Voc.each { |cmd| add_command(cmd, :sym) }
- end
- end
- class Window_Choix_Actor < Window_Command
- def make_command_list
- $game_party.battle_members.each { |actor| add_command(actor.name, :actor) }
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement