Accueil du SiteAccueil du Site  AccueilAccueil  Dernières imagesDernières images  RechercherRechercher  ConnexionConnexion  S'enregistrerS'enregistrer  



Le Deal du moment :
SSD interne Crucial BX500 2,5″ SATA – 500 ...
Voir le deal
29.99 €

Partagez
 

 Learn Skills based on Usage

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
Choco-sama
Ancien staffeux
Ancien staffeux
Choco-sama

Masculin
Messages postés : 3012
Date d'inscription : 19/10/2009
Jauge LPC :
Learn Skills based on Usage 891527140058 / 10058 / 100Learn Skills based on Usage 8915271400

Learn Skills based on Usage Game-d10
Learn Skills based on Usage Mappeu10
Learn Skills based on Usage Projet16
Learn Skills based on Usage Projet10
Learn Skills based on Usage Membre15
Learn Skills based on Usage Promot10
Learn Skills based on Usage Padago10
Learn Skills based on Usage Riche_10
Learn Skills based on Usage Travai10
Learn Skills based on Usage Mythe_10


Learn Skills based on Usage Empty
MessageSujet: Learn Skills based on Usage   Learn Skills based on Usage EmptyVen 9 Aoû 2013 - 1:28

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
Revenir en haut Aller en bas
 
Learn Skills based on Usage
Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Le Palais Créatif :: ~ PARTAGE ~ :: Scripts et plugins :: RPG Maker VXAce :: Système-
Sauter vers: