E-magination
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
E-magination

~ S'évader de la banalité... Et entrer dans l'imaginaire ! ~
 
AccueilGuelnika, le site de E-m !ChatS'enregistrerConnexion

 

 [VX.Ace] Learn Skills based on Usage

Aller en bas 
AuteurMessage
Choco-sama
Fan traître de harusame lvl 69
Choco-sama


Nombre de messages : 13810
Age : 37

[VX.Ace] Learn Skills based on Usage Empty
MessageSujet: [VX.Ace] Learn Skills based on Usage   [VX.Ace] Learn Skills based on Usage Icon_minitimeVen 09 Aoû 2013, 01:29

Learn Skills based on Usage

Auteur: Fomar0153

Ce script permet de faire apprendre (ou évoluer) des techniques ou magies, en fonction de son nombre d'utilisation. On peut aussi remplacer une technique par une autre plus puissante au bout d'un certain nombre de fois utilisé.

Sinon, tout est expliqué au début du script pour son fonctionnement.


Script Autonome:
Code:
=begin
Skills Level Up Based on Usage Script
by Fomar0153
Version 1.0
----------------------
Notes
----------------------
No requirements
Allows you to learn new skills by using your existing skills.
----------------------
Instructions
----------------------
You will need to edit module Skill_Uses, further instructions
are located there.
----------------------
Known bugs
----------------------
None
=end
module Skill_Uses

  SKILLS = []
  # Add/Edit lines like the one below
  # SKILLS[ORIGINAL] = [NEW, USES, REPLACE] REPLACE should be true or false
  SKILLS[3] = [4, 50, true]
  # Reads as: When using skill 3 for it's 50th time replace it with skill 4

end

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● Aliases setup
  #--------------------------------------------------------------------------
  alias fomar0003_setup setup
  def setup(actor_id)
    fomar0003_setup(actor_id)
    @skill_uses = []
  end
  #--------------------------------------------------------------------------
  # ● New Method add_skill_use
  #--------------------------------------------------------------------------
  def add_skill_use(id)
    if @skill_uses[id] == nil
      @skill_uses[id] = 0
    end
    @skill_uses[id] += 1
    unless Skill_Uses::SKILLS[id] == nil
      if @skill_uses[id] == Skill_Uses::SKILLS[id][1]
        learn_skill(Skill_Uses::SKILLS[id][0])
        forget_skill(id) if Skill_Uses::SKILLS[id][2]
        SceneManager.scene.add_text(@name + " learns " + $data_skills[Skill_Uses::SKILLS[id][0]].name + ".")
      end
    end
  end
end

class Game_Battler < Game_BattlerBase
  #--------------------------------------------------------------------------
  # ● Aliases item_apply
  #--------------------------------------------------------------------------
  alias fomar0004_item_apply item_apply
  def item_apply(user, item)
    if user.is_a?(Game_Actor) and item.is_a?(RPG::Skill)
      user.add_skill_use(item.id)
    end
    fomar0004_item_apply(user, item)
  end
end

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # ● New method add_text
  #--------------------------------------------------------------------------
  def add_text(text)
    @log_window.add_text(text)
  end
end

Script en lien avec le script "Unique Classes":
Code:
=begin
Skill Master Script
by Fomar0153
Version 1.0
----------------------
Notes
----------------------
Requires my unique classes script
Allows you to learn new skills by using your existing skills.
----------------------
Instructions
----------------------
You will need to edit module Skill_Uses, further instructions
are located there.
----------------------
Known bugs
----------------------
None
=end

module Skill_Uses

  SKILLS = []
  # Add/Edit lines like the one below
  # SKILLS[ORIGINAL] = [NEW, USES, REPLACE] REPLACE should be true or false
  SKILLS[3] = [4, 50, true]
  # Reads as: When using skill 3 for it's 50th time replace it with skill 4

end

class Game_SkillMaster < Game_Actor
  #--------------------------------------------------------------------------
  # ● New Method setup
  #--------------------------------------------------------------------------
  def setup(actor_id)
    super(actor_id)
    @skill_uses = []
  end
  #--------------------------------------------------------------------------
  # ● New Method add_skill_use
  #--------------------------------------------------------------------------
  def add_skill_use(id)
    if @skill_uses[id] == nil
      @skill_uses[id] = 0
    end
    @skill_uses[id] += 1
    unless Skill_Uses::SKILLS[id] == nil
      if @skill_uses[id] == Skill_Uses::SKILLS[id][1]
        learn_skill(Skill_Uses::SKILLS[id][0])
        forget_skill(id) if Skill_Uses::SKILLS[id][2]
        SceneManager.scene.add_text(@name + " learns " + $data_skills[Skill_Uses::SKILLS[id][0]].name + ".")
      end
    end
  end
end

class Game_Battler < Game_BattlerBase
  #--------------------------------------------------------------------------
  # ● Aliases item_apply
  #--------------------------------------------------------------------------
  alias fomar0004_item_apply item_apply
  def item_apply(user, item)
    if user.is_a?(Game_SkillMaster) and item.is_a?(RPG::Skill)
      user.add_skill_use(item.id)
    end
    fomar0004_item_apply(user, item)
  end
end

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # ● New method add_text
  #--------------------------------------------------------------------------
  def add_text(text)
        @log_window.add_text(text)
  end
end

____________
Zim a écrit:
voire les super-hardcore-poke-nerds genre Choco


[VX.Ace] Learn Skills based on Usage 1ABov
"Quand j'ai faim, hop, un voisin!"

Derniers Pokemons Chromatiques/ Shiney capturés 2019/2020: Metamorph/ Charbi
Revenir en haut Aller en bas
 
[VX.Ace] Learn Skills based on Usage
Revenir en haut 
Page 1 sur 1

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
E-magination :: ~ Forums d'enrichissement ~ :: Apprentissage et partage :: RPG Maker VX & VX Ace :: Tutoriels / Scripts-
Sauter vers: