- pinguino21vMembre
- Nombre de messages : 199
Age : 35
Localisation : Vous êtes ici
Distinction : aucune
Date d'inscription : 22/07/2008
Mixeur de compétences
Lun 18 Aoû 2008 - 14:55
Script écrit par Woratana
Ce script permet de mélanger 2 compétences ou plus afin d'en acquérir de nouvelles. Très simple d'utilisation et très efficace.
Les explications du fonctionnement se trouvent dans le script.
Ce script permet de mélanger 2 compétences ou plus afin d'en acquérir de nouvelles. Très simple d'utilisation et très efficace.
Les explications du fonctionnement se trouvent dans le script.
- Spoiler:
- #===============================================================
# ● [VX] ◦ Mix Skill System ◦ □
#--------------------------------------------------------------
# ◦ by Woratana
# Traduzido por ViniV
#------------------------------------------------- -------------
# ◦ Features: # ◦ Características:
# - Mix 2 ou mais aptidões para obter novas competências (s)
# - Escolha ator (s) que possa / não possa utilizar cada receita
# - Escolha a acrescentar novas competências (s), ou retirar-lhe competências utilizado para misturar também.
# - Fácil de editar texto em Letras Mix Sistema janelas
#------------------------------------------------- -------------
# ◦ Para chamar use:
# $scene = Scene_Mixskill.new
#=================================================================
#=============================================================
# ** Constantes Inicialização (NÃO editar esta parte!) **
#-------------------------------------------------------------
class Skill_Recipe
attr_accessor :result, :skills, :user, :nonuser, :replace
end
class Scene_Mixskill < Scene_Base
RECIPE = []
#=============================================================
#===============================================================
#
# rpgmakervx.1fr1.net
#
#===============================================================
#=============================================================
# ** TEXTOS
#-------------------------------------------------------------
ACTOR_LIST_WIDTH = 172 # Texto mostrar a janela quando começar Topo
TOP_WINDOW_TEXT = 'Mélange de compétences' # Text show on Top window when start
TOP_WINDOW_TEXT_WITH_ACTOR = 'Mélange de compétences: {name}'
# Texto após mostrar escolheu ator, (nome) para a utilização do nome do ator
BOTTOM_WINDOW_TEXT_ACTOR = 'Choisissez un personnage'
# Texto mostrar a janela quando começar Topo
MIX_BUTTON = 'On mélange!' # Mix button
MIX_BETWEEN = '---------------------------'
# Texto do resultado entre receita e habilidades escolhidos
EXIT_BUTTON = 'Sortir' # Exit button in Actors list window
SE_FOUND_RECIPE = 'Chime1'
# Efeitos sonoros para jogar quando encontrado receita para escolher as competências
SE_FOUND_RECIPE_VOLUME = 80 # Sound Effect volume
SE_MIXED = 'Chime2'
# Efeitos sonoros para jogar quando misturado skils
SE_MIXED_VOLUME = 80
#=============================================================
=begin
#=============================================================
# ** [SETUP] SKILL MIX RECIPE
#-------------------------------------------------------------
# .: RECIPE TEMPLATE :.
#-------------------------------------------------
data = Skill_Recipe.new
data.skills = [skill ID, skill ID, ...]
data.result = [skill ID, skill ID, ...]
data.replace = true (or) false
data.user = [Actor ID, Actor ID, ...]
data.nonuser = [Actor ID, Actor ID, ...]
RECIPE << data
#-------------------------------------------------
# * data = Skill_Recipe.new: create new blank recipe.
# * data.skills: Skills that you have to mix to get data.result (line below)
# You must have data.skills at least 2 skills (or recipe will not work).
# * data.result: Skills that you will get when you mixed data.skills (line above)
# You can have data.result 1 skill or more.
# * data.user: Actors that can use this recipe, put 0 as Actor ID for ALL ACTORS.
# * data.nonuser: Actors that cannot use this recipe.
# You don't have to use data.nonuser if you didn't put 0 (usable for All actors)
# in data.user. -- Put [] if you don't use this.
# ** TIP: When system check to see if Actor can use each recipe,
# It will check if Actor's ID is not included in data.nonuser first.
# Next, it will check if Actor's ID include in data.user (or) recipe's data.user
# is included 0 (usable for All actors).
#
# So, you can create recipe that will work with all actors, except for actors 2 and 3
# by set data.user and data.nonuser like this:
# data.user = [0]
# data.nonuser = [2, 3]
# * data.replace = true (or) false: If you want to remove skills in data.skills
when you mixed this recipe, put 'true'. If not, put 'false'.
# * RECIPE << data: Add new recipe to database.
#-------------------------------------------------------------
=end
#=============================================================
data = Skill_Recipe.new
data.skills = [59,60]
data.result = [61]
data.user = [0]
data.nonuser = []
data.replace = false
RECIPE << data
data = Skill_Recipe.new
data.skills = [1,44]
data.result = [5]
data.user = [0]
data.nonuser = []
data.replace = false
RECIPE << data
#=============================================================
def start
super
create_menu_background
@help1 = Window_Help.new
@help2 = Window_Help.new
@help2.y = Graphics.height - @help2.height
@sk = Window_MS_Skill.new(0, @help1.height, Graphics.width/2,
Graphics.height - (@help1.height*2))
@sk.help_window = @help2
@sk_chosen = Window_MS_SkillList.new(@sk.width, @sk.y + @help1.height,
@sk.width, @sk.height - @help1.height)
@act_list = Window_MS_ActorList.new(ACTOR_LIST_WIDTH)
@act_list.x = (Graphics.width - @act_list.width) / 2
@act_list.y = (Graphics.height - @act_list.height) / 2
@winmix = Window_Command.new(@sk.width, [MIX_BUTTON])
@winmix.x = @sk.width
@winmix.y = @help1.height
runstep(0)
end
def update
super
if @act_list.active
@act_list.update
if Input.trigger?(Input::C)
@act_list.visible = @act_list.active = false
case @act_list.define[@act_list.index]
when 'exit'
Sound.play_cancel
$scene = Scene_Map.new
else
runstep(1)
end
elsif Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
end
elsif @sk.active
@sk.update
if Input.trigger?(Input::C)
if @sk_chosen.skills.include?(@sk.skill)
Sound.play_cancel
return
end
Sound.play_decision
@sk_chosen.skills << @sk.skill
refresh_chosen_data
elsif Input.trigger?(Input::B)
runstep(4)
elsif Input.trigger?(Input::RIGHT)
runstep(2)
end
elsif @winmix.active
@winmix.update
if Input.trigger?(Input::C)
runstep(5)
elsif Input.trigger?(Input::LEFT)
runstep(3)
elsif Input.trigger?(Input::B)
runstep(4)
end
end
end
- pinguino21vMembre
- Nombre de messages : 199
Age : 35
Localisation : Vous êtes ici
Distinction : aucune
Date d'inscription : 22/07/2008
Re: Mixeur de compétences
Lun 18 Aoû 2008 - 14:55
- Spoiler:
- def terminate
super
@act_list.dispose
@sk_chosen.dispose
@sk.dispose
@help1.dispose
@help2.dispose
dispose_menu_background
end
def refresh_chosen_data
@sk.chosen = @sk_chosen.skills
@sk_chosen.skills.uniq!
@sk.chosen.uniq!
data_mixable = spell_mixable(@sk_chosen.skills)
@sk_chosen.result = data_mixable[0]
@sk_chosen.result -= @sk.actor.skills
@sk_chosen.replace = data_mixable[1]
RPG::SE.new(SE_FOUND_RECIPE, SE_FOUND_RECIPE_VOLUME).play if !@sk_chosen.result.empty?
@winmix.draw_item(0, !@sk_chosen.result.empty?)
@sk_chosen.refresh
@sk.refresh
end
def spell_mixable(chosen)
skills = []
chosen.each {|i| skills << i.id if i.is_a?(RPG::Skill) }
RECIPE.each_index do |r|
next if RECIPE[r].nil? or RECIPE[r].skills.size < 2 or
RECIPE[r].skills.size != skills.size or RECIPE[r].skills.sort != skills.sort
next if RECIPE[r].nonuser.include?(@sk.actor.id)
if RECIPE[r].user.include?(@sk.actor.id) or RECIPE[r].user.include?(0)
result = RECIPE[r].result
result_skills = []
result.each {|i| result_skills << $data_skills[i] unless $data_skills[i].nil? }
return [result_skills, RECIPE[r].replace]
end
end
return [[], true]
end
def runstep(id)
case id
when 0
@sk.visible = @sk.active = false
@sk_chosen.visible = @sk_chosen.active = false
@act_list.active = @act_list.visible = true
@winmix.visible = @winmix.active = false
@help1.set_text(TOP_WINDOW_TEXT, 1)
@help2.set_text(BOTTOM_WINDOW_TEXT_ACTOR, 1)
when 1
Sound.play_decision
@act_list.active = @act_list.visible = false
@sk.visible = @sk.active = true
@sk_chosen.visible = true
@sk_chosen.active = false
@winmix.visible = true
@winmix.active = false
@winmix.index = -1
@sk.set_actor(@act_list.define[@act_list.index])
@help1.set_text(TOP_WINDOW_TEXT_WITH_ACTOR.gsub(/\{name\}/i){@sk.actor.name}, 1)
@sk_chosen.clear
@winmix.draw_item(0, !@sk_chosen.result.empty?)
when 2
if @sk_chosen.result.empty?
Sound.play_cancel
else
Sound.play_decision
@winmix.index = 0
@winmix.active = true
@sk.active = false
@sk_lastindex = @sk.index
@sk.index = -1
end
when 3
Sound.play_decision
@winmix.index = -1
@winmix.active = false
@sk.active = true
@sk.index = @sk_lastindex
when 4
if @sk_chosen.skills.empty?
Sound.play_decision
runstep(0)
else
Sound.play_cancel
@sk_chosen.skills.pop
refresh_chosen_data
end
when 5
if @sk_chosen.result.empty?
Sound.play_cancel
else
RPG::SE.new(SE_MIXED,SE_MIXED_VOLUME).play
actor = @sk.actor
ingrad = @sk_chosen.skills
result = @sk_chosen.result
ingrad.each {|i| actor.forget_skill(i.id) } if @sk_chosen.replace
result.each {|i| actor.learn_skill(i.id) }
runstep(1)
end
end
end
end
#==============================================================================
# ** Window_MS_Skill
#==============================================================================
class Window_MS_Skill < Window_Selectable
attr_accessor :chosen, :actor
def initialize(x, y, width, height)
super(x, y, width, height)
@column_max = 1
@chosen = []
@data = []
self.index = 0
end
def skill
return @data[self.index]
end
def refresh
@data = []
for skill in @actor.skills
@data.push(skill)
if skill.id == @actor.last_skill_id
self.index = @data.size - 1
end
end
@item_max = @data.size
create_contents
for i in 0...@item_max
draw_item(i)
end
end
def set_actor(actor)
@actor = actor
@chosen = []
self.index = 0
refresh
end
def draw_item(index)
skill = @data[index]
return if @chosen.include?(skill)
rect = item_rect(index)
self.contents.clear_rect(rect)
if skill != nil
rect.width -= 4
draw_item_name(skill, rect.x, rect.y)
end
end
def update_help
@help_window.set_text(skill == nil ? '' : skill.description)
end
end
#==============================================================================
# ** Window_MS_SkillList
#==============================================================================
class Window_MS_SkillList < Window_Selectable
attr_accessor :result, :skills, :replace
def initialize(x, y, width, height)
super(x, y, width, height)
clear
end
def refresh
self.contents.clear
@data = @result + [Scene_Mixskill::MIX_BETWEEN] + @skills
@item_max = @data.size
for i in 0...@item_max
draw_item(i)
end
end
def draw_item(index, enabled = true)
rect = item_rect(index)
self.contents.clear_rect(rect)
skill = @data[index]
rect.width -= 4
if skill.is_a?(RPG::Skill)
draw_icon(skill.icon_index, rect.x, rect.y, enabled)
self.contents.font.color = @result.include?(skill) ? system_color : normal_color
self.contents.draw_text(rect.x + 24, rect.y, rect.width-24, WLH, skill.name)
else
self.contents.font.color = normal_color
self.contents.draw_text(rect.x, rect.y, rect.width, rect.height, skill, 1)
end
end
def clear
@result = []
@skills = []
@replace = true
refresh
end
def cursor_movable?
return false
end
end
#==============================================================================
# ** Window_MS_ActorList
#==============================================================================
class Window_MS_ActorList < Window_Command
attr_reader :define
def initialize(width)
commands = []
@define = []
$game_party.members.each do |i|
commands << i.name
@define << i
end
commands << Scene_Mixskill::EXIT_BUTTON
@define << 'exit'
super(width, commands)
end
end
- UchikoMembre
- Nombre de messages : 85
Age : 32
Localisation : Devant mon pc
Distinction : aucune
Date d'inscription : 20/02/2008
Re: Mixeur de compétences
Lun 18 Aoû 2008 - 15:06
C'est un script super interessant merci à toi pour le partage
- ZodiakMembre
- Nombre de messages : 209
Age : 29
Localisation : Entre l'Enfer et le Paradis
Distinction : Souffre douleur
Ne sert pas à grand chose
Mais on l'aime quand même
[ Zang ]
Date d'inscription : 26/05/2008
Re: Mixeur de compétences
Mer 20 Aoû 2008 - 22:19
Je ne pense pas que je l'utiliserais, mais merci du partage !
- Sword-of-chaosMembre
- Nombre de messages : 168
Localisation : Dans un petit village de 200.000 mille habitants en Bretagne
Distinction : aucune
Date d'inscription : 16/04/2008
Re: Mixeur de compétences
Mer 20 Aoû 2008 - 22:27
merci beaucoup enfin une "forge" à skill
- mysteriousMembre
- Nombre de messages : 400
Age : 35
Distinction : aucune
Date d'inscription : 24/07/2008
Re: Mixeur de compétences
Mer 20 Aoû 2008 - 23:16
très interessant ce script merci du partage
- OrbitalMembre
- Nombre de messages : 141
Age : 33
Localisation : Euh, tu vois la France ? l'Isère ? grenoble ? SMH ? ma maison ? le bureau ? le PC ? bah c'est là
Distinction : aucune
Date d'inscription : 09/08/2008
Re: Mixeur de compétences
Jeu 21 Aoû 2008 - 20:46
magnifique ca comme script d'évolution de compétence...interessant, j'sais pas si ca va me servir mais un grand bravo à l'auteur !
- nipponstyleMembre
- Nombre de messages : 5
Age : 32
Localisation : Isere
Distinction : aucune
Date d'inscription : 12/04/2008
Re: Mixeur de compétences
Dim 9 Nov 2008 - 10:59
Question:
Comment on fait pour l'utiliser
js'é pas parler anglais moi
Jeremy
Comment on fait pour l'utiliser
js'é pas parler anglais moi
Jeremy
- RatMembre
- Nombre de messages : 84
Age : 35
Distinction : aucune
Date d'inscription : 23/03/2008
Re: Mixeur de compétences
Dim 9 Nov 2008 - 11:11
Ben il te faut faire un evenement ensuite "appeler un script" et tu mets:
$scene = Scene_Mixskill.new
$scene = Scene_Mixskill.new
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum