Partagez
Aller en bas
Kaharon
Kaharon
Membre

Nombre de messages : 27
Age : 25
Distinction : aucune
Date d'inscription : 15/01/2010

Réunir 2 script dans status. Empty Réunir 2 script dans status.

le Mer 20 Jan 2010 - 9:06
Bonjours, j'aimerais réunir deux script que l'on pourrait choisir dans le menu Statu.
De plus chacun aurait son onglet. (comme celui de équipements, sauvegarde... mais dans statu).
Mais il y aurait encore le statu du personnage.


Voici le premier celui qui sert à augmenter les statistiques du héros :

Spoiler:
Code:
=begin

+------------------------------------------------------------------------------+

� ** Stat points distribution system 1.6

� By Lettuce.





�Some help:

� - Position wasn't stored properly in mode 1 (Thanks Akin)

� - Some sort of notification to player (Thanks Akin)

� - Player switch now supports LEFT and RIGHT arrow (Thanks Akin)

� - Advice on using class attr instead of global var (Thanks GoldenShadow)



�-----------------------------------------------------------------------------

� Ce script, permet de distribuer des points pour augmenter les stats de vos héros



� Pour l'appeler : $scene = Scene_Stat_Dist.new(0)





 Pour donner des points à vos héros utilisez :



� $game_party.members[ID_du_héros].points += Nombre_de_points



� Si vous voulez que votre héros ai ces points après avoir monté d'un niveau :

� Dans Game_Actor, à "def change_exp", sous la ligne 'level_up'; collez ça :



� $game_actors[@actor_id].points += Nombre_de_points



� OU (Si vous voulez le mode RO, expliqué en bas)



� $game_actors[@actor_id].points += ((@level/5).floor+2).floor



� # It seems the game returns non 0 based array if we use game_party >.<;



� **Note**

� Le script n'influance pas sur les stats du héros dans la base de données

� Il les ajoutes juste.

� Set the stats to 1 all the way in the database to disable growth :0



� **Modes**

� 1 : 1 point / caractéristiques

� Exemple : Pour augmenter l'attaque vous utiliserez 1 points quelque sois sa valeur

� 2 : Utiliser le systéme RO , les points a donner dépende de la valeur du stat.

� Explanation: Dans RO, si vous avez des stats éléves, vous avez besoin de plus de points pour

� les augmenter. Donc si vous avez 90 d'attaque et 5 d'intel, Vous pouvez choisir

� d'utiliser 10 point pour 1 d'attaque de plus ou utiliser 10 points pour obtenir 6 d'Intteligence

+------------------------------------------------------------------------------+

=end

#������������������������������ Configuration ���������������������������������#

#Points de départ : Nombre de points reçus au début du jeu

StartPoints = 0

#Le maximun de stats que vous autorisez

MaxStat = 800

MaxHP = 9999

MaxMP = 999

#Le maximum de stats : "% chance de toucher l'ennemi, d'esquiver et de faire un coup critique.

MaxHIT = 95 # 100 = Ne rate jamais

MaxEVA = 65 #100 = esquive TOUT les coups : Pas logique ^^'. 50-70 est une bonne moyenne

MaxCRIT = 85 #100 = Toujours des critiques.



# Combien de points sont nécessaire pour augmenter les stats

PointsPerHP = 10 # Hp

PointsPerMP = 5 # Mp

PointsPerHIT = 6 # % de chance de toucher

PointsPerEVA = 6 #% de chance d'esquiver

PointsPerCRIT = 7 # % chance de critique.



# De combien sont augmenté les stats par points ?

IncreaseBy = 10 # Attaque, défense,intelligence, agilitée

HPIncreaseBy = 50 # Hp

MPIncreaseBy = 25 # Mp

HITIncreaseBy = 1 # % de chance de toucher

EVAIncreaseBy = 1 # % de chance d'esquiver

CRITIncreaseBy = 1 # % chance de critique.





#1 pour le mode normal, 2 ou RO mode [Les points requis sont calculés différaments]

Mode = 2

#Vous pouvez changer la police et la taille :

Fontname = "UmePlus Gothic"

Fontsize = 20



#Layout mode, si vous utilisez des mots long à la place de atk,spi,def or agi ; mettez 2.

LayoutMode = 2



#========================== End Configuration ==================================

OFFSET = -10 #moves equipment part up and down XD

#==============================================================================

# ** Lettuce_Window_Top

#------------------------------------------------------------------------------

# This window displays Title message

#==============================================================================



class Lettuce_Window_Top < Window_Base

def initialize

super(0,0,544,70)

self.contents = Bitmap.new(width-32,height-32)

self.contents.font.name = Fontname

self.contents.font.size = Fontsize

refresh

end



def refresh

self.contents.clear

self.contents.draw_text(0,7,544-32,32,"Distribution de Statistiques",1)

self.contents.font.size = Fontsize-4


end



end

#==============================================================================

# ** Lettuce_Window_Points

#------------------------------------------------------------------------------

# This window displays the attributes of a party member

#==============================================================================

class Lettuce_Window_Points < Window_Base

def initialize(member_index)

super(401,320,144,52)

self.contents = Bitmap.new(width-32,height-32)

self.contents.font.name = Fontname

self.contents.font.size = Fontsize

refresh(member_index)

end



def refresh(member_index)

actor = $game_party.members[member_index]

points = actor.points

self.contents.clear

self.contents.draw_text(0,0,162,20,"Points: "+points.to_s)

end

end



#==============================================================================

# ** Lettuce_Window_Info

#------------------------------------------------------------------------------

# This window displays the attributes of a party member

#==============================================================================



class Lettuce_Window_Info < Window_Base

def initialize(member_index)

super(0,71,400,346)

self.contents = Bitmap.new(width-32,height-32)

self.contents.font.name = Fontname

self.contents.font.size = Fontsize

@exo = 25 #equipment section X coordinate offset

@exo2 = 35 #equipment section X coordinate offset

@eyo = -10 #equipment section Y coordinate offset

refresh(member_index)

end



def refresh(member_index)

actor = $game_party.members[member_index]

self.contents.clear

self.contents.font.size = Fontsize - 3

draw_actor_face(actor,10,10,92)

draw_actor_name(actor,120,5)

self.contents.draw_text(120,21,200,20,actor.class.name)

self.contents.draw_text(120,36,200,20,"Niveau "+actor.level.to_s)



if LayoutMode == 1

draw_actor_state(actor,200,280,168)

elsif LayoutMode == 2

draw_actor_state(actor,220,10)

end



s1 = actor.exp_s #total exp

s2 = actor.current_lvl_exp #exp to get to this level

if s1.is_a?(Numeric)

s3 = s1-s2 #progress in this level

s4 = actor.next_lvl_exp #exp needed for next level

self.contents.font.size = Fontsize - 5

self.contents.draw_text(230,74,90,20,"Exp: "+s3.to_s+"/"+s4.to_s,0)

self.contents.font.size = Fontsize

else

self.contents.draw_text(230,74,90,20,"-----/-----",2)

end



#Preparing bar colours

back_color = Color.new(39, 58, 83, 255)



str_color1 = Color.new(229, 153, 73, 255)

str_color2 = Color.new(255, 72, 0, 255)



def_color1 = Color.new(210, 255, 0, 255)

def_color2 = Color.new(85, 129, 9, 255)



spi_color1 = Color.new(99, 133, 161, 255)

spi_color2 = Color.new(10, 60,107, 255)



agi_color1 = Color.new(167, 125, 180, 255)

agi_color2 = Color.new(90, 11, 107, 255)



hp_color1 = Color.new(66, 114, 164, 255)

hp_color2 = Color.new(122, 175, 229, 255)



mp_color1 = Color.new(93, 50, 158, 255)

mp_color2 = Color.new(145, 122, 229, 255)



exp_color1 = Color.new(246, 243, 224, 255)

exp_color2 = Color.new(255, 182, 0, 255)

if s1.is_a?(Numeric)

self.contents.fill_rect(230,90,89,7,back_color)

self.contents.gradient_fill_rect(232,92,(85*s3)/s4,3,exp_color1,exp_color2)



else

self.contents.fill_rect(230,60,89,7,back_color)

end





self.contents.fill_rect(120,67,104,7,back_color)

self.contents.gradient_fill_rect(122,69,100*actor.hp/actor.maxhp,3,hp_color1,hp_color2)

self.contents.font.size = Fontsize - 5

self.contents.draw_text(120,44,100,35,"HP",0)

self.contents.draw_text(120,44,100,35,actor.hp.to_s + "/" + actor.maxhp.to_s,2)



self.contents.fill_rect(120,90,104,7,back_color)

self.contents.gradient_fill_rect(122,92,100*actor.mp/actor.maxmp,3,mp_color1,mp_color2)

self.contents.draw_text(120,67,100,35,"MP",0)

self.contents.draw_text(120,67,100,35,actor.mp.to_s + "/" + actor.maxmp.to_s,2)

self.contents.font.size = Fontsize



##weapons

weapon = $data_weapons[actor.weapon_id]

shield = $data_armors[actor.armor1_id]

helm =$data_armors[actor.armor2_id]

body =$data_armors[actor.armor3_id]

accessory =$data_armors[actor.armor4_id]



bonus_atk = 0

bonus_def = 0

bonus_spi = 0

bonus_agi = 0

evasion = 0

crit = 4



if $data_actors[actor.id].critical_bonus

crit +=4

end



if weapon

bonus_atk += weapon.atk

bonus_def += weapon.def

bonus_spi += weapon.spi

bonus_agi += weapon.agi

if weapon.critical_bonus

crit += 4

end

end

if shield

bonus_atk += shield.atk

bonus_def += shield.def

bonus_spi += shield.spi

bonus_agi += shield.agi

evasion += shield.eva

end

if helm

bonus_atk += helm.atk

bonus_def += helm.def

bonus_spi += helm.spi

bonus_agi += helm.agi

evasion += helm.eva

end

if body

bonus_atk += body.atk

bonus_def += body.def

bonus_spi += body.spi

bonus_agi += body.agi

evasion += body.eva

end

if accessory

bonus_atk += accessory.atk

bonus_def += accessory.def

bonus_spi += accessory.spi

bonus_agi += accessory.agi

evasion += accessory.eva

end

if LayoutMode == 1

draw_item_name(weapon,160+@exo,125+@eyo,true)

if weapon.two_handed == true

draw_item_name(weapon,160+@exo,155+@eyo,true)

else

draw_item_name(shield,160+@exo,155+@eyo,true)

end

draw_item_name(helm,160+@exo,185+@eyo,true)

draw_item_name(body,160+@exo,215+@eyo,true)

draw_item_name(accessory,160+@exo,245+@eyo,true)



#Testing area for Weapon upgrade script

#self.contents.font.size = Fontsize - 7

#self.contents.draw_text(160+@exo,135,30,20,"]+"+weapon.level.to_s+"]",0)



self.contents.font.color = Color.new(87,87,87,255)

if !weapon

draw_icon(216,160+@exo,125+@eyo,true)

self.contents.draw_text(184+@exo,127+@eyo,200,20,"Unequiped")

end

if !shield

draw_icon(217,160+@exo,155+@eyo,true)

self.contents.draw_text(184+@exo,157+@eyo,200,20,"Unequiped")

end

if !helm

draw_icon(218,160+@exo,185+@eyo,true)

self.contents.draw_text(184+@exo,187+@eyo,200,20,"Unequiped")

end

if !body

draw_icon(219,160+@exo,215+@eyo,true)

self.contents.draw_text(184+@exo,217+@eyo,200,20,"Unequiped")

end

if !accessory

draw_icon(220,160+@exo,245+@eyo,true)

self.contents.draw_text(184+@exo,247+@eyo,200,20,"Unequiped")

end

self.contents.font.color = Color.new(255,255,255,255)



elsif LayoutMode == 2

draw_item_name(weapon,160+@exo2,125+OFFSET+@eyo,true)

draw_item_name(shield,160+@exo2,165+OFFSET+@eyo,true)

draw_item_name(helm,160+@exo2,205+OFFSET+@eyo,true)

draw_item_name(body,160+@exo2,245+OFFSET+@eyo,true)

draw_item_name(accessory,160+@exo2,285+OFFSET+@eyo,true)







self.contents.font.color = Color.new(87,87,87,255)

if !weapon

draw_icon(216,160+@exo2,125+OFFSET+@eyo,true)

self.contents.draw_text(184+@exo2,127+OFFSET+@eyo,200,20,"Déséquipé")

end



if !helm

draw_icon(218,160+@exo2,205+OFFSET+@eyo,true)

self.contents.draw_text(184+@exo2,207+OFFSET+@eyo,200,20,"Déséquipé")

end

if !body

draw_icon(219,160+@exo2,245+OFFSET+@eyo,true)

self.contents.draw_text(184+@exo2,247+OFFSET+@eyo,200,20,"Déséquipé")

end

if !accessory

draw_icon(220,160+@exo2,285+OFFSET+@eyo,true)

self.contents.draw_text(184+@exo2,287+OFFSET+@eyo,200,20,"Déséquipé")

end

self.contents.font.color = Color.new(255,255,255,255)

end







self.contents.font.size = Fontsize - 5

self.contents.draw_text(10,120,100,20,Vocab::atk+": ")

self.contents.draw_text(10,120,100,20,(actor.atk-bonus_atk).to_s+" + "+bonus_atk.to_s,2)



self.contents.fill_rect(10,140,104,7,back_color)

self.contents.gradient_fill_rect(12,142,((actor.atk-bonus_atk)*100)/MaxStat,3,str_color1,str_color2)



self.contents.draw_text(10,150,100,20,Vocab::def+": ")

self.contents.draw_text(10,150,100,20,(actor.def-bonus_def).to_s+" + "+bonus_def.to_s,2)



self.contents.fill_rect(10,170,104,7,back_color)

self.contents.gradient_fill_rect(12,172,((actor.def-bonus_def)*100)/MaxStat,3,def_color1,def_color2)



self.contents.draw_text(10,180,100,20,Vocab::spi+": ")

self.contents.draw_text(10,180,100,20,(actor.spi-bonus_spi).to_s+" + "+bonus_spi.to_s,2)



self.contents.fill_rect(10,200,104,7,back_color)

self.contents.gradient_fill_rect(12,202,((actor.spi-bonus_spi)*100)/MaxStat,3,spi_color1,spi_color2)



self.contents.draw_text(10,210,100,20,Vocab::agi+": ")

self.contents.draw_text(10,210,100,20,(actor.agi-bonus_agi).to_s+" + "+bonus_agi.to_s,2)



self.contents.fill_rect(10,230,104,7,back_color)

self.contents.gradient_fill_rect(12,232,((actor.agi-bonus_agi)*100)/MaxStat,3,agi_color1,agi_color2)



if weapon

hit_rate = weapon.hit

else

hit_rate = 95

end





self.contents.font.size = Fontsize - 5

self.contents.font.color = Color.new(162,212,98,255)

self.contents.draw_text(10,245,100,20,"Attaque max. :",2)

self.contents.draw_text(10,260,100,20,"Frappe (%) :",2)

self.contents.draw_text(10,275,100,20,"Esquive (%) :",2)

self.contents.draw_text(10,290,100,20,"Critique (%) :",2)



self.contents.draw_text(120,245,60,20,(actor.atk*4).to_s,0)

self.contents.draw_text(120,260,60,20,actor.base_hit.to_s + "+" + actor.hitr.to_s,0)

self.contents.draw_text(120,275,60,20,actor.base_eva.to_s + "+" +actor.evar.to_s,0)

self.contents.draw_text(120,290,60,20,actor.base_cri.to_s + "+" + actor.crir.to_s,0)



self.contents.font.size = Fontsize-6

self.contents.font.color = text_color(16)

self.contents.draw_text(135,260,60,20,"]"+PointsPerHIT.to_s+"pt.]",2)

self.contents.draw_text(135,275,60,20,"]"+PointsPerEVA.to_s+"pt.]",2)

self.contents.draw_text(135,290,60,20,"]"+PointsPerCRIT.to_s+"pt.]",2)



#self.contents.draw_text(120,260,60,20,(hit_rate+actor.hit_bonus).to_s,0)

#self.contents.draw_text(120,275,60,20,(evasion+actor.eva).to_s,0)

#self.contents.draw_text(120,290,60,20,(crit+actor.cri_bonus).to_s,0)



if LayoutMode == 1



self.contents.font.color = Color.new(155,199,206,255)

self.contents.font.size = Fontsize - 8

if weapon

self.contents.draw_text(185+@exo,140+@eyo,100,20,Vocab::atk+"+"+weapon.atk.to_s)

self.contents.draw_text(219+@exo,140+@eyo,100,20,Vocab::def+"+"+weapon.def.to_s)

self.contents.draw_text(253+@exo,140+@eyo,100,20,Vocab::spi+"+"+weapon.spi.to_s)

self.contents.draw_text(287+@exo,140+@eyo,100,20,Vocab::agi+"+"+weapon.agi.to_s)

end



if shield

self.contents.draw_text(185+@exo,170+@eyo,100,20,Vocab::atk+"+"+shield.atk.to_s)

self.contents.draw_text(219+@exo,170+@eyo,100,20,Vocab::def+"+"+shield.def.to_s)

self.contents.draw_text(253+@exo,170+@eyo,100,20,Vocab::spi+"+"+shield.spi.to_s)

self.contents.draw_text(287+@exo,170+@eyo,100,20,Vocab::agi+"+"+shield.agi.to_s)

end



if helm

self.contents.draw_text(185+@exo,200+@eyo,100,20,Vocab::atk+"+"+helm.atk.to_s)

self.contents.draw_text(219+@exo,200+@eyo,100,20,Vocab::def+"+"+helm.def.to_s)

self.contents.draw_text(253+@exo,200+@eyo,100,20,Vocab::spi+"+"+helm.spi.to_s)

self.contents.draw_text(287+@exo,200+@eyo,100,20,Vocab::agi+"+"+helm.agi.to_s)

end



if body

self.contents.draw_text(185+@exo,230+@eyo,100,20,Vocab::atk+"+"+body.atk.to_s)

self.contents.draw_text(219+@exo,230+@eyo,100,20,Vocab::def+"+"+body.def.to_s)

self.contents.draw_text(253+@exo,230+@eyo,100,20,Vocab::spi+"+"+body.spi.to_s)

self.contents.draw_text(287+@exo,230+@eyo,100,20,Vocab::agi+"+"+body.agi.to_s)

end



if accessory

self.contents.draw_text(185+@exo,260+@eyo,100,20,Vocab::atk+"+"+accessory.atk.to_s)

self.contents.draw_text(219+@exo,260+@eyo,100,20,Vocab::def+"+"+accessory.def.to_s)

self.contents.draw_text(253+@exo,260+@eyo,100,20,Vocab::spi+"+"+accessory.spi.to_s)

self.contents.draw_text(287+@exo,260+@eyo,100,20,Vocab::agi+"+"+accessory.agi.to_s)

end

end



if Mode == 2

self.contents.font.size = Fontsize - 8

self.contents.font.color = Color.new(155,199,206,255)

self.contents.draw_text(23,100,125,20,"POINTS",2)

self.contents.draw_text(29,110,125,20,"REQUIS",2)

self.contents.font.size = Fontsize - 4

self.contents.draw_text(20,125,115,20,required(actor.atk-bonus_atk).to_s,2)

self.contents.draw_text(20,155,115,20,required(actor.def-bonus_def).to_s,2)

self.contents.draw_text(20,185,115,20,required(actor.spi-bonus_spi).to_s,2)

self.contents.draw_text(20,215,115,20,required(actor.agi-bonus_agi).to_s,2)

end



if LayoutMode == 2

self.contents.font.color = Color.new(155,199,206,255)

self.contents.font.size = Fontsize - 8

if weapon

self.contents.draw_text(185+@exo2,140+OFFSET+@eyo,100,20,Vocab::atk+"+"+weapon.atk.to_s)

self.contents.draw_text(185+@exo2,150+OFFSET+@eyo,100,20,Vocab::def+"+"+weapon.def.to_s)

self.contents.draw_text(253+@exo2,140+OFFSET+@eyo,100,20,Vocab::spi+"+"+weapon.spi.to_s)

self.contents.draw_text(253+@exo2,150+OFFSET+@eyo,100,20,Vocab::agi+"+"+weapon.agi.to_s)

end



if shield

self.contents.draw_text(185+@exo2,180+OFFSET+@eyo,100,20,Vocab::atk+"+"+shield.atk.to_s)

self.contents.draw_text(185+@exo2,190+OFFSET+@eyo,100,20,Vocab::def+"+"+shield.def.to_s)

self.contents.draw_text(253+@exo2,180+OFFSET+@eyo,100,20,Vocab::spi+"+"+shield.spi.to_s)

self.contents.draw_text(253+@exo2,190+OFFSET+@eyo,100,20,Vocab::agi+"+"+shield.agi.to_s)

end



if helm

self.contents.draw_text(185+@exo2,220+OFFSET+@eyo,100,20,Vocab::atk+"+"+helm.atk.to_s)

self.contents.draw_text(185+@exo2,230+OFFSET+@eyo,100,20,Vocab::def+"+"+helm.def.to_s)

self.contents.draw_text(253+@exo2,220+OFFSET+@eyo,100,20,Vocab::spi+"+"+helm.spi.to_s)

self.contents.draw_text(253+@exo2,230+OFFSET+@eyo,100,20,Vocab::agi+"+"+helm.agi.to_s)

end



if body

self.contents.draw_text(185+@exo2,260+OFFSET+@eyo,100,20,Vocab::atk+"+"+body.atk.to_s)

self.contents.draw_text(185+@exo2,270+OFFSET+@eyo,100,20,Vocab::def+"+"+body.def.to_s)

self.contents.draw_text(253+@exo2,260+OFFSET+@eyo,100,20,Vocab::spi+"+"+body.spi.to_s)

self.contents.draw_text(253+@exo2,270+OFFSET+@eyo,100,20,Vocab::agi+"+"+body.agi.to_s)

end



if accessory

self.contents.draw_text(185+@exo2,300+OFFSET+@eyo,100,20,Vocab::atk+"+"+accessory.atk.to_s)

self.contents.draw_text(185+@exo2,310+OFFSET+@eyo,100,20,Vocab::def+"+"+accessory.def.to_s)

self.contents.draw_text(253+@exo2,300+OFFSET+@eyo,100,20,Vocab::spi+"+"+accessory.spi.to_s)

self.contents.draw_text(253+@exo2,310+OFFSET+@eyo,100,20,Vocab::agi+"+"+accessory.agi.to_s)

end

end

end



def required(base)

return (((base-1)/10)+2).floor

end






#==============================================================================

# ** Lettuce_Window_Help

#------------------------------------------------------------------------------

# This window displays property of each attribute

#==============================================================================

class Lettuce_Window_Help < Window_Base

def initialize(index)

super(401,372,144,44)

self.contents = Bitmap.new(width-32,height-32)

self.contents.font.size = Fontsize - 6

refresh(index)

end



def refresh(index)

self.contents.clear

self.contents.font.color = text_color(16)



case index

when 0

self.contents.draw_text(0,-5,112,20,"HP + "+HPIncreaseBy.to_s)

when 1

self.contents.draw_text(0,-5,112,20,"MP + "+MPIncreaseBy.to_s)

when 2

self.contents.draw_text(0,-5,112,20,Vocab::atk+" + "+IncreaseBy.to_s)

when 3

self.contents.draw_text(0,-5,112,20,Vocab::def+" + "+IncreaseBy.to_s)

when 4

self.contents.draw_text(0,-5,112,20,Vocab::spi+" + "+IncreaseBy.to_s)

when 5

self.contents.draw_text(0,-5,112,20,Vocab::agi+" + "+IncreaseBy.to_s)

when 6

self.contents.draw_text(0,-5,112,20,"HIT + "+HITIncreaseBy.to_s)

when 7

self.contents.draw_text(0,-5,112,20,"EVA + "+EVAIncreaseBy.to_s)

when 8

self.contents.draw_text(0,-5,112,20,"CRIT + "+CRITIncreaseBy.to_s)

end





end



end

end



#==============================================================================

# ** Scene_Stat_Dist

#------------------------------------------------------------------------------

# Performs stat distribution process [img]http://illiweb.com/fa/i/smiles/icon_smile.gif[/img]

#==============================================================================

class Scene_Stat_Dist < Scene_Base


def initialize(menu_index)

@menu_index = menu_index

end


def start

super

create_menu_background

ihp = Vocab::hp

imp = Vocab::mp

i1 = Vocab::atk

i2 = Vocab::def

i3 = Vocab::spi

i4 = Vocab::agi

i5 = "Frappe"

i6 = "Esquive"

i7 = "Critique"

@window_select = Window_Command.new(144,[ihp,imp,i1,i2,i3,i4,i5,i6,i7])

if $position

@window_select.index = $position - 1

else

@window_select.index = 0

end



@window_select.active = true

@window_select.x = 401

@window_select.y = 71



@window_top = Lettuce_Window_Top.new

@window_points = Lettuce_Window_Points.new(@menu_index)

@window_info = Lettuce_Window_Info.new(@menu_index)

@window_help = Lettuce_Window_Help.new(@window_select.index)

end



def terminate

super

dispose_menu_background

@window_top.dispose

@window_points.dispose

@window_info.dispose

@window_help.dispose

@window_select.dispose

end



def update

update_menu_background

#@window_points.refresh(@menu_index)



@window_select.update

#@window_help.refresh(@window_select.index)

if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN)

@window_help.refresh(@window_select.index)

end



@changes = 0

if Input.trigger?(Input::B)

Sound.play_cancel

$scene = Scene_Map.new

elsif Input.trigger?(Input::R) or Input.trigger?(Input::RIGHT)

@menu_index += 1

@menu_index %= $game_party.members.size

$scene = Scene_Stat_Dist.new(@menu_index)

elsif Input.trigger?(Input::L) or Input.trigger?(Input::LEFT)

@menu_index += $game_party.members.size - 1

@menu_index %= $game_party.members.size

$scene = Scene_Stat_Dist.new(@menu_index)

elsif Input.trigger?(Input::C)

#Points addition begins

#which attribute

if Mode == 1

do_point_reg

elsif Mode == 2

do_point_rag

end

end



end



def do_point_reg

@att = @window_select.index



actor = $game_party.members[@menu_index]



##weapons

weapon = $data_weapons[actor.weapon_id]

shield = $data_armors[actor.armor1_id]

helm =$data_armors[actor.armor2_id]

body =$data_armors[actor.armor3_id]

accessory =$data_armors[actor.armor4_id]



bonus_atk = 0

bonus_def = 0

bonus_spi = 0

bonus_agi = 0



if weapon

bonus_atk += weapon.atk

bonus_def += weapon.def

bonus_spi += weapon.spi

bonus_agi += weapon.agi

end

if shield

bonus_atk += shield.atk

bonus_def += shield.def

bonus_spi += shield.spi

bonus_agi += shield.agi

end

if helm

bonus_atk += helm.atk

bonus_def += helm.def

bonus_spi += helm.spi

bonus_agi += helm.agi

end

if body

bonus_atk += body.atk

bonus_def += body.def

bonus_spi += body.spi

bonus_agi += body.agi

end

if accessory

bonus_atk += accessory.atk

bonus_def += accessory.def

bonus_spi += accessory.spi

bonus_agi += accessory.agi

end



case @att



when 0 #HP

if actor.points < PointsPerHP

Sound.play_cancel

elsif actor.maxhp >= MaxHP

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].maxhp += HPIncreaseBy

if $game_party.members[@menu_index].maxhp > MaxHP

$game_party.members[@menu_index].maxhp = MaxHP

end

actor.points -= PointsPerHP

@changes += 1

$position = 1

end



when 1 #MP

if actor.points < PointsPerMP

Sound.play_cancel

elsif actor.maxmp >= MaxMP

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].maxmp += MPIncreaseBy

if $game_party.members[@menu_index].maxmp > MaxMP

$game_party.members[@menu_index].maxmp = MaxMP

end

actor.points -= PointsPerMP

@changes += 1

$position = 1

end



when 2 #ATK

if actor.points < 1

Sound.play_cancel

elsif (actor.atk-bonus_atk) >= MaxStat

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].atk += IncreaseBy

if ($game_party.members[@menu_index].atk-bonus_atk) > MaxStat

$game_party.members[@menu_index].atk = MaxStat+bonus_atk

end

actor.points -= 1

@changes += 1

$position = 1

end



when 3 #DEF

if actor.points < 1

Sound.play_cancel

elsif (actor.def-bonus_def) >= MaxStat

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].def += IncreaseBy

if ($game_party.members[@menu_index].def-bonus_def) > MaxStat

$game_party.members[@menu_index].def = MaxStat+bonus_def

end

actor.points -= 1

@changes += 1

$position = 2

end



when 4 #SPI

if actor.points < 1

Sound.play_cancel

elsif (actor.spi-bonus_spi) >= MaxStat

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].spi += IncreaseBy

if ($game_party.members[@menu_index].spi-bonus_spi) > MaxStat

$game_party.members[@menu_index].spi = MaxStat+bonus_spi

end

actor.points -= 1

@changes += 1

$position = 3

end

when 5 #AGI

if actor.points < 1

Sound.play_cancel

elsif (actor.agi-bonus_agi) >= MaxStat

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].agi += IncreaseBy

if ($game_party.members[@menu_index].agi-bonus_agi) > MaxStat

$game_party.members[@menu_index].agi = MaxStat+bonus_agi

end

actor.points -= 1

@changes += 1

$position = 4

end





when 6 #HIT

if actor.points < PointsPerHIT

Sound.play_cancel

elsif actor.hitr >= MaxHIT

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].hitr += HITIncreaseBy

if $game_party.members[@menu_index].hitr > MaxHIT

$game_party.members[@menu_index].hitr = MaxHIT

end

actor.points -= PointsPerHIT

@changes += 1

$position = 1

end

when 7 #EVA

if actor.points < PointsPerEVA

Sound.play_cancel

elsif actor.evar >= MaxEVA

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].evar += EVAIncreaseBy

if $game_party.members[@menu_index].evar > MaxEVA

$game_party.members[@menu_index].evar = MaxEVA

end

actor.points -= PointsPerEVA

@changes += 1

$position = 1

end

when 8 #CRIT

if actor.points < PointsPerCRIT

Sound.play_cancel

elsif actor.crir >= MaxCRIT

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].crir += CRITIncreaseBy

if $game_party.members[@menu_index].crir > MaxCRIT

$game_party.members[@menu_index].crir = MaxCRIT

end

actor.points -= PointsPerCRIT

@changes += 1

$position = 1

end

end



if @changes > 0

@window_info.refresh(@menu_index)

@window_points.refresh(@menu_index)

#$scene = Scene_Stat_Dist.new(@menu_index)

end

end



def do_point_rag

@att = @window_select.index



actor = $game_party.members[@menu_index]



##weapons

weapon = $data_weapons[actor.weapon_id]

shield = $data_armors[actor.armor1_id]

helm =$data_armors[actor.armor2_id]

body =$data_armors[actor.armor3_id]

accessory =$data_armors[actor.armor4_id]



bonus_atk = 0

bonus_def = 0

bonus_spi = 0

bonus_agi = 0



if weapon

bonus_atk += weapon.atk

bonus_def += weapon.def

bonus_spi += weapon.spi

bonus_agi += weapon.agi

end

if shield

bonus_atk += shield.atk

bonus_def += shield.def

bonus_spi += shield.spi

bonus_agi += shield.agi

end

if helm

bonus_atk += helm.atk

bonus_def += helm.def

bonus_spi += helm.spi

bonus_agi += helm.agi

end

if body

bonus_atk += body.atk

bonus_def += body.def

bonus_spi += body.spi

bonus_agi += body.agi

end

if accessory

bonus_atk += accessory.atk

bonus_def += accessory.def

bonus_spi += accessory.spi

bonus_agi += accessory.agi

end



case @att



when 0 #HP

if actor.points < PointsPerHP

Sound.play_cancel

elsif actor.maxhp >= MaxHP

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].maxhp += HPIncreaseBy

if $game_party.members[@menu_index].maxhp > MaxHP

$game_party.members[@menu_index].maxhp = MaxHP

end

actor.points -= PointsPerHP

@changes += 1

$position = 1

end



when 1 #MP

if actor.points < PointsPerMP

Sound.play_cancel

elsif actor.maxmp >= MaxMP

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].maxmp += MPIncreaseBy

if $game_party.members[@menu_index].maxmp > MaxMP

$game_party.members[@menu_index].maxmp = MaxMP

end

actor.points -= PointsPerMP

@changes += 1

$position = 1

end



when 2 #ATK

base_value = actor.atk-bonus_atk

points = actor.points

if enough_point(base_value,points)

Sound.play_cancel

elsif (actor.atk-bonus_atk) >= MaxStat

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].atk += IncreaseBy

if ($game_party.members[@menu_index].atk-bonus_atk) > MaxStat

$game_party.members[@menu_index].atk = MaxStat+bonus_atk

end

actor.points -= required(base_value)

@changes += 1

$position = 1

end



when 3 #DEF

base_value = actor.def-bonus_def

points = actor.points

if enough_point(base_value,points)

Sound.play_cancel

elsif (actor.def-bonus_def) >= MaxStat

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].def += IncreaseBy

if ($game_party.members[@menu_index].def-bonus_def) > MaxStat

$game_party.members[@menu_index].def = MaxStat+bonus_def

end

actor.points -= required(base_value)

@changes += 1

$position = 2

end



when 4 #SPI

base_value = actor.spi-bonus_spi

points = actor.points

if enough_point(base_value,points)

Sound.play_cancel

elsif (actor.spi-bonus_spi) >= MaxStat

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].spi += IncreaseBy

if ($game_party.members[@menu_index].spi-bonus_spi) > MaxStat

$game_party.members[@menu_index].spi = MaxStat+bonus_spi

end

actor.points -= required(base_value)

@changes += 1

$position = 3

end

when 5 #AGI

base_value = actor.agi-bonus_agi

points = actor.points

if enough_point(base_value,points)

Sound.play_cancel

elsif (actor.agi-bonus_agi) >= MaxStat

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].agi += IncreaseBy

if ($game_party.members[@menu_index].agi-bonus_agi) > MaxStat

$game_party.members[@menu_index].agi = MaxStat+bonus_agi

end

actor.points -= required(base_value)

@changes += 1

$position = 4

end

when 6 #HIT

if actor.points < PointsPerHIT

Sound.play_cancel

elsif actor.hitr >= MaxHIT

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].hitr += HITIncreaseBy

if $game_party.members[@menu_index].hitr > MaxHIT

$game_party.members[@menu_index].hitr = MaxHIT

end

actor.points -= PointsPerHIT

@changes += 1

$position = 1

end

when 7 #EVA

if actor.points < PointsPerEVA

Sound.play_cancel

elsif actor.evar >= MaxEVA

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].evar += EVAIncreaseBy

if $game_party.members[@menu_index].evar > MaxEVA

$game_party.members[@menu_index].evar = MaxEVA

end

actor.points -= PointsPerEVA

@changes += 1

$position = 1

end

when 8 #CRIT

if actor.points < PointsPerCRIT

Sound.play_cancel

elsif actor.crir >= MaxCRIT

Sound.play_cancel

else

Sound.play_use_item

$game_party.members[@menu_index].crir += CRITIncreaseBy

if $game_party.members[@menu_index].crir > MaxCRIT

$game_party.members[@menu_index].crir = MaxCRIT

end

actor.points -= PointsPerCRIT

@changes += 1

$position = 1

end

end

if @changes > 0

@window_points.refresh(@menu_index)

@window_info.refresh(@menu_index)

#$scene = Scene_Stat_Dist.new(@menu_index)

end

end



def enough_point(base,points)

required = (((base-1)/10)+2).floor

if required > points

return true

elsif required <= points

return false

end

end



def required(base)

return (((base-1)/10)+2).floor

end



end





#==============================================================================

# ** Game_Actor

#------------------------------------------------------------------------------

# Giving game actor a point attribute

# -> $game_party.member[x].points

#==============================================================================



class Game_Actor < Game_Battler



attr_accessor :points

attr_accessor :hit_bonus

attr_accessor :eva_bonus

attr_accessor :cri_bonus

attr_accessor :hitr

attr_accessor :evar

attr_accessor :crir

#attr_accessor :current_lvl_exp

#attr_accessor :next_lvl_exp

alias Lettuce_Game_Actor_Ini initialize



def initialize(actor_id)

Lettuce_Game_Actor_Ini(actor_id)

@points = StartPoints

@hitr = 0

@evar = 0

@crir = 0

#@current_lvl_exp = @exp_list[@level-1]

#@next_lvl_exp = @exp_list[@level]

end



def points

return @points

end



#--------------------------------------------------------------------------

# * Get Hit Rate

#--------------------------------------------------------------------------

def hit

if two_swords_style

n1 = weapons[0] == nil ? 95 : weapons[0].hit

n2 = weapons[1] == nil ? 95 : weapons[1].hit

n = [n1, n2].min

else

n = weapons[0] == nil ? 95 : weapons[0].hit

end

if n+@hitr <= MaxHIT

return n+@hitr

else return MaxHIT

end

end

#--------------------------------------------------------------------------

# * Get Evasion Rate

#--------------------------------------------------------------------------

def eva

n = 5

for item in armors.compact do n += item.eva end

if n+@evar <= MaxEVA

return n+@evar

else return MaxEVA

end

end

#--------------------------------------------------------------------------

# * Get Critical Ratio

#--------------------------------------------------------------------------

def cri

n = 4

n += 4 if actor.critical_bonus

for weapon in weapons.compact

n += 4 if weapon.critical_bonus

end

if n+@crir <= MaxCRIT

return n+@crir

else return MaxCRIT

end

end



#--------------------------------------------------------------------------

# * Get Hit Rate

#--------------------------------------------------------------------------

def base_hit

if two_swords_style

n1 = weapons[0] == nil ? 95 : weapons[0].hit

n2 = weapons[1] == nil ? 95 : weapons[1].hit

n = [n1, n2].min

else

n = weapons[0] == nil ? 95 : weapons[0].hit

end

return n

end

#--------------------------------------------------------------------------

# * Get Evasion Rate

#--------------------------------------------------------------------------

def base_eva

n = 5

for item in armors.compact do n += item.eva end

return n

end

#--------------------------------------------------------------------------

# * Get Critical Ratio

#--------------------------------------------------------------------------

def base_cri

n = 4

n += 4 if actor.critical_bonus

for weapon in weapons.compact

n += 4 if weapon.critical_bonus

end

return n

end





#--------------------------------------------------------------------------

# * bonus rates

#--------------------------------------------------------------------------

def hitr

return @hitr

end



def evar

return @evar

end



def crir

return @crir

end







def current_lvl_exp

return @exp_list[@level]

end



def next_lvl_exp

return @exp_list[@level+1]-@exp_list[@level]

end

end



Et celui d'augmenter les niveaux des sorts :
Spoiler:
Code:
#===============================================================
# ● [VX] ◦ Ameliroation de Sorts
#--------------------------------------------------------------
# ◦ Par La Meche, d'une requête
# ◦ http://rpg-maker-vx.bbactif.com/forum.htm
# ◦ Crée le 14/01/2010
# ◦ Version 1.0
# ◦ Remerciment à ASKHA
#===============================================================

#===============================================================
#  Notes de version
#---------------------------------------------------------------
# Version 1.0
# > script initial
#===============================================================

#===============================================================
#  Enduits :: Début du Module de configuration
#===============================================================
module LaM
  module Skill_Up
    #--------------------------------------------------------------------------
    # Incorporation dans le menu ?
    # Si vous voulez ne pas mettre dans le menu mais
    # dans un PNJ par exemple, il suffit de choisir appeller un script puis
    # $scene = Scene_Amelioration.new(ID, false)
    # où ID est l'ID de l'actor pour qui l'on va ameliorer les sors
    #--------------------------------------------------------------------------
    Incorpor_Menu = true
    #--------------------------------------------------------------------------
    # Si utilisation du menu de moghunter : true
    # Sinon false
    # /!\ Ne marche que si Incorpor_menu = true
    # /!\ Pour que ca marche, le script de Moghunter doit être placé au dessus de ce script
    #--------------------------------------------------------------------------
    Menu_Moghunter = false
    #--------------------------------------------------------------------------
    # Nom de l'onglet dans le menu
    #--------------------------------------------------------------------------
    Nom_Menu = "Skill Up"
    #--------------------------------------------------------------------------
    # Nombre de points de skill lorsque l'on commence le jeu
    #--------------------------------------------------------------------------
    Point_Depart = 0
    #--------------------------------------------------------------------------
    # Nombre de point gagné lors d'un Level Up
    #--------------------------------------------------------------------------
    Point_Level_Up = 1
    #--------------------------------------------------------------------------
    # Nom des points de skill
    #--------------------------------------------------------------------------
    Name = "Points de Sort"
    #--------------------------------------------------------------------------
    # Amelioration des Sors
    # Doit être créer sur le model suivant :
    # ID => [],
    # où ID est l'ID du sors dans la base de donnée
    # Pour rajouter un niveau au sors et donc une amélioration
    # Rajouter ceci dans les [ ]
    # [type, nbr]
    # où type =
    # 1 = Dégats
    # 2 = Variation
    # 3 = Influence Physique
    # 4 = Influence Magique
    # 5 = Coût MP
    # 6 = Ajout d'altération d'état
    # 7 = Retrait d'altération d'état
    # et où nbr est le chiffre d'augmentation
    # /!\ SI type = 6 ou 7 alors nbr est l'ID de l'etat dans la base de donnée
    # Exemple :
    # 3 => [ [1, 5], [3, 2], [6, 2] ],
    # Au niveau 2 les dégats du sors seront augmenter de 5
    # Au niveau 3 l'influence physique du sors sera augmenter de 2
    # Au niveau 4 le sors causera l'etat d'ID 2
    #--------------------------------------------------------------------------
    Skill_Niv = {
    101 => [ [1, 3], [1, 3], [1, 3] ], # Autre exemple, peut être modifié
 
    } # /!\ A ne pas supprimer
    #--------------------------------------------------------------------------
    # Index des icones représentant les différentes
    # modification possible lors d'une augmentation
    # /!\ Attention à ne pas oublier de mettre une virgule après le chiffre
    #--------------------------------------------------------------------------
    Icon = {
    1 => 110, # Degats
    2 => 131, # Variation
    3 => 129, # Influence Physique
    4 => 130, # Influence Magique
    5 => 133, # Coût MP
    6 => 142, # Ajout d'altération d'état
    7 => 143, # Retrait d'altération d'état
    }
  end
end
#===============================================================
#  Enduits :: Fin du Module de configuration
#===============================================================

#==============================================================================
# * * Window_Skill_Status
#------------------------------------------------------------------------------
#  Affiche l'amélioration du sors.
#==============================================================================

class Window_Skill_Status < Window_Base
  include LaM::Skill_Up
  #--------------------------------------------------------------------------
  # * Initialize
  #--------------------------------------------------------------------------
  def initialize(skill)
    super(384, 56, 160, 56)
    refresh(skill)
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh(skill)
    self.contents.clear
    self.contents.draw_text(0, 0, 128, 24, "-", 1) if skill == nil or skill.niv == skill.niv_max
    return if skill == nil or skill.niv == skill.niv_max
    for i in Icon.keys
      if i == Skill_Niv[skill.id][skill.niv-1][0]
        draw_icon(Icon[i], 0, 0)
        if Skill_Niv[skill.id][skill.niv-1][0] == 6 or Skill_Niv[skill.id][skill.niv-1][0] == 7
          self.contents.draw_text(32, 0, 96, 24, "#{$data_states[Skill_Niv[skill.id][skill.niv-1][1]].name}")
        else
          signe = Skill_Niv[skill.id][skill.niv-1][1] < 0 ? "" : "+"
          self.contents.draw_text(32, 0, 96, 24, "#{signe}#{Skill_Niv[skill.id][skill.niv-1][1]}")
        end
      end
    end
  end
end

#==============================================================================
# * * Window_Skill_Up
#------------------------------------------------------------------------------
#  Affiche les différents sorts de l'acteur
#==============================================================================

class Window_Skill_Up < Window_Selectable
  #--------------------------------------------------------------------------
  # * Initialize
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 56, 384, 360)
    @actor = actor
    self.index = 0
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    @data = []
    for skill in @actor.skills
      @data.push(skill) if LaM::Skill_Up::Skill_Niv[skill.id] != nil
    end
    @item_max = @data.size
    create_contents
    for i in 0...@item_max
      draw_item(i)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    skill = @data[index]
    if skill != nil
      rect.width -= 4
      enable = skill.niv == skill.niv_max ? false : true
      draw_item_name(skill, rect.x, rect.y, enable)
      self.contents.draw_text(rect, "Niv #{skill.niv}/#{skill.niv_max}", 2)
    end
  end
  #--------------------------------------------------------------------------
  # * Retourne le skill selectionner
  #--------------------------------------------------------------------------
  def skill
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Update Help Text
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(skill == nil ? "" : skill.description)
  end
end

#==============================================================================
# * * Window_Points
#------------------------------------------------------------------------------
#  Affiche les nombres de points de sorts possédé
#==============================================================================

class Window_Points < Window_Base
  #--------------------------------------------------------------------------
  # * Initialize
  #--------------------------------------------------------------------------
  def  initialize(actor)
    super(384, 112, 160, 56)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.draw_text(0, 0, 128, 24, "#{@actor.skill_pts}")
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 128, 24, "#{LaM::Skill_Up::Name}", 2)
    self.contents.font.color = normal_color
  end
end

#==============================================================================
# * * Scene_Amelioration
#------------------------------------------------------------------------------
#  Scene de l'amélioration des sorts
#==============================================================================

class Scene_Amelioration < Scene_Base
  include LaM::Skill_Up
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(actor_index, carte = true)
    @actor_index = actor_index
    @carte = carte
  end
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  def start
    create_menu_background
    @actor = $game_party.members[@actor_index]
    @help_window = Window_Help.new
    @skill_window = Window_Skill_Up.new(@actor)
    @skill_window.help_window = @help_window
    @status_window = Window_Skill_Status.new(@skill_window.skill)
    @points_window = Window_Points.new(@actor)
    @index = @skill_window.index
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    dispose_menu_background
    @help_window.dispose
    @skill_window.dispose
    @status_window.dispose
    @points_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Return to Original Screen
  #--------------------------------------------------------------------------
  def return_scene
    if not @carte
      $scene = Scene_Map.new
    else
      $scene = Scene_Menu.new(4)
    end
  end
  #--------------------------------------------------------------------------
  # * Update Frame
  #--------------------------------------------------------------------------
  def update
    update_menu_background
    @help_window.update
    @skill_window.update
    if @index != @skill_window.index
      @status_window.refresh(@skill_window.skill)
      @index = @skill_window.index
    end
    if Input.trigger?(Input::B)
      Sound.play_cancel
      return_scene
    end
    if Input.trigger?(Input::C)
      input_c
    end
  end
  #--------------------------------------------------------------------------
  # * Input C
  #--------------------------------------------------------------------------
  def input_c
    skill = @skill_window.skill
    if @actor.skill_pts == 0 or skill == nil or skill.niv == skill.niv_max
      Sound.play_buzzer
    else
      Sound.play_decision
      add = Skill_Niv[skill.id][skill.niv-1][1]
      case Skill_Niv[skill.id][skill.niv-1][0]
      when 1
        skill.base_damage += add
      when 2
        skill.variation += add
      when 3
        skill.atk_f += add
      when 4
        skill.spi_f += add
      when 5
        skill.mp_cost  += add
      when 6
        skill.plus_state_set.push($data_states[Skill_Niv[skill.id][skill.niv-1][1]])
      when 7
        skill.minus_state_set.push($data_states[Skill_Niv[skill.id][skill.niv-1][1]])
      end
      @actor.skill_pts -= 1
      skill.niv += 1
      @skill_window.refresh
      @status_window.refresh(@skill_window.skill)
      @points_window.refresh
    end
  end
end

if LaM::Skill_Up::Incorpor_Menu == true
class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = LaM::Skill_Up::Nom_Menu
    s6 = Vocab::save
    s7 = Vocab::game_end
    if LaM::Skill_Up::Menu_Moghunter == false
      @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,s7])
    else
      @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,s7],column_max = 1, row_max = 6)
    end
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # If number of party members is 0
      @command_window.draw_item(0, false)    # Disable item
      @command_window.draw_item(1, false)    # Disable skill
      @command_window.draw_item(2, false)    # Disable equipment
      @command_window.draw_item(3, false)    # Disable status
      @command_window.draw_item(4, false)
    end
    if $game_system.save_disabled            # If save is forbidden
      @command_window.draw_item(5, false)    # Disable save
    end
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 5
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # Item
        $scene = Scene_Item.new
      when 1,2,3,4  # Skill, equipment, status, skill up
        start_actor_selection
      when 5      # Save
        $scene = Scene_File.new(true, false, false)
      when 6      # End Game
        $scene = Scene_End.new
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Update Actor Selection
  #--------------------------------------------------------------------------
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 1  # skill
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        $scene = Scene_Status.new(@status_window.index)
      when 4  # skill up
        $scene = Scene_Amelioration.new(@status_window.index)
      end
    end
  end
end
class Scene_File
  def return_scene
    if @from_title
      $scene = Scene_Title.new
    elsif @from_event
      $scene = Scene_Map.new
    else
      $scene = Scene_Menu.new(5)
    end
  end
end
class Scene_End
  def return_scene
    $scene = Scene_Menu.new(6)
  end
end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor  :skill_pts
  #--------------------------------------------------------------------------
  # * Setup
  #    actor_id : actor ID
  #--------------------------------------------------------------------------
  alias add_setup setup
  def setup(actor_id)
    add_setup(actor_id)
    @skill_pts = LaM::Skill_Up::Point_Depart
  end
  #--------------------------------------------------------------------------
  # * Level Up
  #--------------------------------------------------------------------------
  alias add_level_up level_up
  def level_up
    add_level_up
    @skill_pts += LaM::Skill_Up::Point_Level_Up
  end
end

class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # * Load Database
  #--------------------------------------------------------------------------
  alias add_load_database load_database
  def load_database
    add_load_database
    for skill in 1...$data_skills.size
      $data_skills[skill].initialize_niv
    end
  end
end

#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
#  This class performs the save and load screen processing.
#==============================================================================

class Scene_File < Scene_Base
  #--------------------------------------------------------------------------
  # * Write Save Data
  #    file : write file object (opened)
  #--------------------------------------------------------------------------
  alias add_write_save_data write_save_data
  def write_save_data(file)
    add_write_save_data(file)
    Marshal.dump($data_skills, file)
  end
  #--------------------------------------------------------------------------
  # * Read Save Data
  #    file : file object for reading (opened)
  #--------------------------------------------------------------------------
  alias add_read_save_data read_save_data
  def read_save_data(file)
    add_read_save_data(file)
    $data_skills = Marshal.load(file)
  end
end

module RPG
  class Skill < UsableItem
    attr_accessor :niv
    #--------------------------------------------------------------------------
    # * Initialise le niveau à 1
    #--------------------------------------------------------------------------
    def initialize_niv
      @niv = 1
    end
    #--------------------------------------------------------------------------
    # * Permet de connaître le niveau max du sort
    #--------------------------------------------------------------------------
    def niv_max
      niv_max = LaM::Skill_Up::Skill_Niv[@id].size + 1
    end
  end
end

class Window_Command < Window_Selectable
  #-----------------------------------------------------------------------------------------
  # * Redéfinition pour afficher correctement les choix d'en dessous
  #-----------------------------------------------------------------------------------------
  def refresh
    self.contents.clear
    create_contents # A ajouter
    for i in 0...@item_max
      draw_item(i)
    end
  end
end



P.S : pourriez vous me dire quel a été votre démarche, car j'essaye d'apprendre le ruby.
Ça sera sympa. =)
Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum