Advancing System, incremento personalizzato di stat e skill

« Older   Newer »
  Share  
Siesh
view post Posted on 13/9/2010, 20:28




Autore: Siesh Scripter di RPG ES

con questo script potrete aumentare a piacimento le statistiche dei vostri personaggi e fargli apprendere le skill ke volete.

innanzitutto da database dovreste settare le curve delle varie statisti dei pg ad un valore fisso (esempio 55 da lvl 1 a lvl 99), poi nella sezione classi eliminate ogni magia nel riquadro in basso a destra (fatelo per ogni classe)... fatto ciò col database avremo finito.

entrate nell'editor degli script e copiate in Game_Actor alla riga 24 (senza cancellare niente, aggiungendo una nuova riga insomma)
SPOILER (click to view)
attr_reader :exp_point # EXP POINT

mentre alla riga 55 inserite sempre senza cancellare niente
SPOILER (click to view)
@exp_point = @exp

poi scorrete fino alla riga 351 e aggiungete questo
SPOILER (click to view)
#--------------------------------------------------------------------------
# * Prendi stringa EXP POINT
#--------------------------------------------------------------------------
def esp_p
return @exp_point == 0 ? "0" : @exp_point.to_s
end

scendete fino alla riga 492 e aggiungete
SPOILER (click to view)
#--------------------------------------------------------------------------
# * Modifica EXP POINT
# exp point : new EXP POINT
#--------------------------------------------------------------------------
def exp_point=(exp_point)
@exp_point = [[exp_point, 9999999].min, 0].max
end

infine andate in fondo e aggiungete questo
SPOILER (click to view)
def inc_hp_eroe
return @inc_hp_eroe
end
def inc_mp_eroe
return @inc_mp_eroe
end
def inc_str_eroe
return @inc_str_eroe
end
def inc_dex_eroe
return @inc_dex_eroe
end
def inc_agi_eroe
return @inc_agi_eroe
end
def inc_int_eroe
return @inc_int_eroe
end
def hp_plus(v)
@maxhp_plus += v
@exp_point -= @inc_hp_eroe
@inc_hp_eroe += 1
end
def mp_plus(v)
@maxsp_plus += v
@exp_point -= @inc_mp_eroe
@inc_mp_eroe += 1
end
def str_plus(v)
@str_plus += v
@exp_point -= @inc_str_eroe
@inc_str_eroe += 5
end
def dex_plus(v)
@dex_plus += v
@exp_point -= @inc_dex_eroe
@inc_dex_eroe += 5
end
def agi_plus(v)
@agi_plus += v
@exp_point -= @inc_agi_eroe
@inc_agi_eroe += 5
end
def int_plus(v)
@int_plus += v
@exp_point -= @inc_int_eroe
@inc_int_eroe += 5
end
def recover_hp_sp
@hp = maxhp
@sp = maxsp
end
def apprendi_skill(v)
@exp_point -= v
end


ora passiamo alla classe Window_Base e aggiungete alla riga 210
SPOILER (click to view)
#--------------------------------------------------------------------------
# * Draw EXP POINT
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_exp_point(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x - 80, y, 48, 32, "PE", 2)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 84, 32, actor.esp_p, 2)
end


andate ora in Window_MenuStatus e sostituite il suo contenuto con questo
SPOILER (click to view)
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 480, 480)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 116
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 24)
draw_actor_state(actor, x + 90, y + 24)
draw_actor_exp(actor, x, y + 9)
draw_actor_exp_point(actor, x + 58, y + 65)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 64)
end
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end


le modifiche alle classi finiscono qui, ora vanno create sopra a Main le seguenti 12 NUOVE classi:
la prima classe la chiamate Addestratore e al suo interno copierete questo
SPOILER (click to view)
class Addestratore
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make Command window
@actor = 0
@stat = 0
@command_window = Finestra_Comandi_Addestratore.new
@dummy_window_1 = Window_Base.new(0, 0, 640, 480)
@dummy_window_2 = Window_Base.new(0, 64, 320, 64)
@dummy_window_3 = Window_Base.new(0, 0, 320, 64)
@dummy_window_4 = Window_Base.new(0, 128, 640, 352)
@dummy_window_5 = Window_Base.new(0, 256, 640, 224)
@dummy_window_6 = Window_Base.new(0, 384, 640, 96)
@dummy_window_7 = Window_Base.new(320, 0, 320, 128)
@dummy_window_5.visible = false
@dummy_window_6.visible = false
@finestra_exp_addestratore = Window_Base.new(320, 0, 320, 128)
@finestra_exp_addestratore.visible = true
@finestra_addestra = Finestra_Addestra.new
@finestra_addestra.active = false
@finestra_addestra.visible = false
@scegli_eroi = Scegli_Eroi.new
@scegli_eroi.visible = false
@finestra_eroi_addestratore = Finestra_Eroi_Addestratore.new
@finestra_eroi_addestratore.active = false
@finestra_eroi_addestratore.visible = false
@finestra_stats = Finestra_Stats.new
@finestra_stats.active = false
@finestra_stats.visible = false
@finestra_skill = Window_Base.new(0, 256, 640, 160)
@finestra_skill.active = false
@finestra_skill.visible = false
@finestra_costo_incremento = Window_Base.new(0, 384, 640, 96)
@finestra_costo_incremento.visible = false
@finestra_scelta = Scelta.new
@finestra_scelta.visible = false
@finestra_scelta.active = false
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@command_window.dispose
@finestra_addestra.dispose
@scegli_eroi.dispose
@finestra_eroi_addestratore.dispose
@finestra_exp_addestratore.dispose
@finestra_stats.dispose
@finestra_skill.dispose
@finestra_costo_incremento.dispose
@finestra_scelta.dispose
@dummy_window_1.dispose
@dummy_window_2.dispose
@dummy_window_3.dispose
@dummy_window_4.dispose
@dummy_window_5.dispose
@dummy_window_6.dispose
@dummy_window_7.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
@finestra_addestra.update
@finestra_eroi_addestratore.update
@finestra_exp_addestratore.update
@finestra_stats.update
@finestra_skill.update
@finestra_costo_incremento.update
@finestra_scelta.update
if @command_window.active
update_command
return
end
if @finestra_addestra.active
update_addestra
return
end
if @finestra_eroi_addestratore.active
@skill_stat = @finestra_addestra.index
case @finestra_addestra.index
when 0
update_eroi_addestratore_stats
when 1
update_eroi_addestratore_skill
end
return
end
if @finestra_stats.active
update_finestra_stats
return
end
if @finestra_skill.active
update_finestra_skill
return
end
if @finestra_scelta.active
update_finestra_scelta
end
end
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
@command_window.visible = false
@finestra_exp_addestratore.visible = false
for i in 0...$game_party.actors.size
$game_party.actors[i].recover_hp_sp
end
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0
# Play decision SE
$game_system.se_play($data_system.decision_se)
# schermata addestra
@command_window.active = false
@finestra_addestra.active = true
@finestra_addestra.visible = true
when 1
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to map screen
@command_window.visible = false
for i in 0...$game_party.actors.size
$game_party.actors[i].recover_hp_sp
end
$scene = Scene_Map.new
end
return
end
end
def update_addestra
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
@command_window.active = true
@finestra_addestra.active = false
@finestra_addestra.visible = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Play decision SE
$game_system.se_play($data_system.decision_se)
# schermata scelta eroi
@dummy_window_4.visible = false
@dummy_window_5.visible = true
@scegli_eroi.visible = true
@finestra_addestra.active = false
@finestra_eroi_addestratore.active = true
@finestra_eroi_addestratore.visible = true
return
end
end
def update_eroi_addestratore_stats
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
@dummy_window_4.visible = true
@dummy_window_5.visible = false
@scegli_eroi.visible = false
@finestra_addestra.active = true
@finestra_eroi_addestratore.active = false
@finestra_eroi_addestratore.visible = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Play decision SE
$game_system.se_play($data_system.decision_se)
@dummy_window_5.visible = false
@dummy_window_6.visible = true
@skill_stat = @finestra_addestra.index
@actor=@finestra_eroi_addestratore.index
@finestra_exp_addestratore.visible = false
@finestra_exp_addestratore.active = false
@finestra_exp_addestratore = Finestra_Exp_Addestratore.new(@actor)
@finestra_exp_addestratore.visible = true
@finestra_exp_addestratore.active = true
@finestra_eroi_addestratore.active = false
@finestra_stats.active = true
@finestra_stats.visible = true
return
end
end
def update_finestra_stats
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
@dummy_window_6.visible = false
@dummy_window_5.visible = true
@finestra_exp_addestratore.visible = false
@finestra_exp_addestratore.active = false
@finestra_eroi_addestratore.active = true
@finestra_stats.active = false
@finestra_stats.visible = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
# Play decision SE
$game_system.se_play($data_system.decision_se)
# conferma scelta
@dummy_window_6.visible = false
@s=@finestra_stats.index
@finestra_stats.active = false
@finestra_costo_incremento = Finestra_Costo_Incremento.new(@actor,@stat,@skill_stat)
@finestra_costo_incremento.visible = true
@finestra_costo_incremento.active = true
@finestra_scelta.visible = true
@finestra_scelta.active = true
return
end
end
def update_eroi_addestratore_skill
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
@dummy_window_4.visible = true
@dummy_window_5.visible = false
@scegli_eroi.visible = false
@finestra_addestra.active = true
@finestra_eroi_addestratore.active = false
@finestra_eroi_addestratore.visible = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Play decision SE
$game_system.se_play($data_system.decision_se)
@dummy_window_5.visible = false
@dummy_window_6.visible = true
@skill_stat = @finestra_addestra.index
@actor=@finestra_eroi_addestratore.index
@finestra_exp_addestratore.visible = false
@finestra_exp_addestratore.active = false
@finestra_exp_addestratore = Finestra_Exp_Addestratore.new(@actor)
@finestra_exp_addestratore.visible = true
@finestra_exp_addestratore.active = true
@finestra_eroi_addestratore.active = false
@finestra_eroi_addestratore.visible = false
@scegli_eroi.visible = false
@finestra_skill = Finestra_Skill.new(@actor)
@finestra_skill.active = true
@finestra_skill.visible = true
return
end
end
def update_finestra_skill
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
@dummy_window_6.visible = false
@dummy_window_5.visible = true
@finestra_exp_addestratore.visible = false
@finestra_exp_addestratore.active = false
@finestra_eroi_addestratore.visible = true
@finestra_eroi_addestratore.active = true
@scegli_eroi.visible = true
@finestra_skill.active = false
@finestra_skill.visible = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Play decision SE
$game_system.se_play($data_system.decision_se)
# conferma scelta
@dummy_window_6.visible = false
@s=@finestra_skill.index
@finestra_skill.active = false
@finestra_costo_incremento = Finestra_Costo_Incremento.new(@actor,@s,@skill_stat)
@finestra_costo_incremento.visible = true
@finestra_costo_incremento.active = true
@finestra_scelta.visible = true
@finestra_scelta.active = true
return
end
end
end
def update_finestra_scelta
# If B button was pressed
if Input.trigger?(Input::B)
@dummy_window_6.visible = true
if @skill_stat == 0
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
@finestra_exp_addestratore.visible = true
@finestra_exp_addestratore.active = true
@finestra_stats.active = true
@finestra_stats.visible = true
@finestra_costo_incremento.visible = false
@finestra_scelta.visible = false
@finestra_scelta.active = false
else
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
@finestra_exp_addestratore.visible = true
@finestra_exp_addestratore.active = true
@finestra_skill.active = true
@finestra_skill.visible = true
@finestra_costo_incremento.visible = false
@finestra_scelta.visible = false
@finestra_scelta.active = false
end
return
end
# If C button was pressed
if Input.trigger?(Input::C)
@dummy_window_6.visible = true
if @skill_stat == 0
case @finestra_scelta.index
when 0
@finestra_stats.active = true
@finestra_stats.visible = true
@finestra_costo_incremento.visible = false
@finestra_scelta.visible = false
@finestra_scelta.active = false
incremento = Calcolatore_Incrementi.new(@actor,@s,@skill_stat)
incremento.incrementa(@actor,@s)
@finestra_exp_addestratore.visible = false
@finestra_exp_addestratore.active = false
@finestra_exp_addestratore = Finestra_Exp_Addestratore.new(@actor)
@finestra_exp_addestratore.visible = true
@finestra_exp_addestratore.active = true
when 1
$game_system.se_play($data_system.cancel_se)
@finestra_stats.active = true
@finestra_stats.visible = true
@finestra_costo_incremento.visible = false
@finestra_scelta.visible = false
@finestra_scelta.active = false
end
else
case @finestra_scelta.index
when 0
@finestra_costo_incremento.visible = false
@finestra_scelta.visible = false
@finestra_scelta.active = false
incremento = Calcolatore_Incrementi.new(@actor,@s,@skill_stat)
incremento.aggiunta_skill(@actor,@s)
@finestra_skill.active = false
@finestra_skill.visible = false
@finestra_skill.refresh
@finestra_skill.active = true
@finestra_skill.visible = true
@finestra_exp_addestratore.visible = false
@finestra_exp_addestratore.active = false
@finestra_exp_addestratore.refresh(@actor)
@finestra_exp_addestratore.visible = true
@finestra_exp_addestratore.active = true
when 1
$game_system.se_play($data_system.cancel_se)
@finestra_skill.active = true
@finestra_skill.visible = true
@finestra_costo_incremento.visible = false
@finestra_scelta.visible = false
@finestra_scelta.active = false
end
return
end
end
end


la seconda la create sotto ad addestratore e la chiamate Finestra_Comandi_Addestratore e all'interno mettete:
SPOILER (click to view)
class Finestra_Comandi_Addestratore < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 320, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@item_max = 2
@column_max = 2
@commands = ["Addestra", "Esci"]
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
x = 4 + index * 160
self.contents.draw_text(x, 0, 128, 32, @commands[index])
end
end


sotto a quest'ultima create Finestra_Addestra e dentro inserite questo:
SPOILER (click to view)
class Finestra_Addestra < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 64, 320, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@item_max = 2
@column_max = 2
@commands = ["Stats", "Skill"]
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
if index == 0
bitmap = RPG::Cache.icon("nome_icona") #inserite il nome dell'icona che volete, contenuta nel RTP in Graphics\Icons
self.contents.blt(4, 0 + 4, bitmap, Rect.new(0, 0, 24, 24), 255)
else
bitmap = RPG::Cache.icon("nome_icona") #inserite il nome dell'icona che volete, contenuta nel RTP in Graphics\Icons
self.contents.blt(164, 0 + 4, bitmap, Rect.new(0, 0, 24, 24), 255)
end
x = 32 + index * 160
self.contents.font.color = normal_color
self.contents.draw_text(x, 0, 128, 32, @commands[index])
end
end


la prossima classe la chiamate Scegli_Eroi e ci mettete:
SPOILER (click to view)
class Scegli_Eroi < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 128, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(250, 0, 320, 32, "Scegli Eroe:")
end
end


create poi Finestra_Eroi_Addestratore:
SPOILER (click to view)
class Finestra_Eroi_Addestratore < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 192, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@column_max = 8
@commands = []
for i in 0...$game_party.actors.size
@commands.push("")
end
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@item_max = @commands.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for n in 0...@item_max
x = (n % 8) * 80
y = (n / 8) *32
bitmap = RPG::Cache.character($game_party.actors[n].character_name,
$game_party.actors[n].character_hue)
self.contents.blt(x + 8, 0 + 4, bitmap, Rect.new(0, 0, 32, 32), 255)
self.contents.draw_text(x, y, 320, 32, @commands[n])
end
end
end
end


subito sotto create Finestra_Exp_Addestratore:
SPOILER (click to view)
#==============================================================================
# ** Finestra_Exp_Addestratore
#------------------------------------------------------------------------------
# questa finestra mostra i punti esperienza residui del personaggio selezionato
#==============================================================================

class Finestra_Exp_Addestratore < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(n)
super(320, 0, 320, 128)
self.contents = Bitmap.new(width - 32, height - 32)
refresh(n)
end
def refresh(n)
self.contents.clear
self.contents.draw_text(32, 16, 256, 32, "Punti Esperienza residui:")
actor=$game_party.actors[n]
self.contents.draw_text(130, 48, 84, 32, actor.esp_p, 2)
bitmap = RPG::Cache.icon("nome_icona") #inserite il nome dell'icona che volete, contenuta nel RTP in Graphics\Icons
self.contents.blt(215, 48, bitmap, Rect.new(0, 0, 24, 24), 255)
end
end


poi create Finestra_Stat:
SPOILER (click to view)
class Finestra_Stats < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 256, 640, 128)
self.contents = Bitmap.new(width - 32, height - 32)
@item_max = 6
@column_max = 2
@commands = ["+ Hp", "+ Mp", "+ For", "+ Dex", "+ Agi", "+ int", ]
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
x = 120 + (index % 2) * 320
y = (index / 2) * 32
if index == 0
bitmap = RPG::Cache.icon("037-Item06")
end
if index == 1
bitmap = RPG::Cache.icon("045-Skill02")
end
if index == 2
bitmap = RPG::Cache.icon("048-Skill05")
end
if index == 3
bitmap = RPG::Cache.icon("005-Weapon05")
end
if index == 4
bitmap = RPG::Cache.icon("044-Skill01")
end
if index == 5
bitmap = RPG::Cache.icon("035-Item04")
end
self.contents.blt(x - 32, y + 4, bitmap, Rect.new(0, 0, 24, 24), 255)
self.contents.draw_text(x, y, 128, 32, @commands[index])
end
end


create poi Finestra_Skill:
SPOILER (click to view)
class Finestra_Skill < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(eroe)
super(0, 128, 640, 256)
self.contents = Bitmap.new(width - 32, height - 32)
@eroe = eroe
@column_max = 2
@commands = []
for i in 0...$data_skills.size - 3
@commands.push($data_skills[i+1])
end
refresh
self.index = 0
end
def refresh
@item_max = @commands.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for n in 0...@item_max
x = ((n) % 2) * 320
y = ((n) / 2) * 32
if Calcolatore_Skill.new.controllo(@eroe,@commands[n]) != true
self.contents.font.color = normal_color
@opacita = 255
else
self.contents.font.color = disabled_color
@opacita = 128
end
bitmap = RPG::Cache.icon(@commands[n].icon_name)
self.contents.blt(x + 4, y + 4, bitmap, Rect.new(0, 0, 24, 24), @opacita)
self.contents.draw_text(x + 32, y, 320, 32, @commands[n].name)
end
end
end
end


create sotto Finestra_Costo_Incremento:
SPOILER (click to view)
class Finestra_Costo_Incremento < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(n,stat,skill_stat)
super(0, 384, 640, 96)
self.contents = Bitmap.new(width - 32, height - 32)
refresh(n,stat,skill_stat)
end
def refresh(n,stat,skill_stat)
self.contents.clear
costo = Calcolatore_Incrementi.new(n,stat,skill_stat)
self.contents.draw_text(32, 16, 544, 32, "Costo: " + costo.stringa_costo + " Incremento?")
end
end


create Calcolatore_Incrementi:
SPOILER (click to view)
class Calcolatore_Incrementi
attr_reader :costo
def initialize(n,stat,skill_stat)
@costo = 0
actor = $game_party.actors[n]
if skill_stat == 0
case stat
when 0
@costo = actor.inc_hp_eroe
when 1
@costo = actor.inc_mp_eroe
when 2
@costo = actor.inc_str_eroe
when 3
@costo = actor.inc_dex_eroe
when 4
@costo = actor.inc_agi_eroe
when 5
@costo = actor.inc_int_eroe
end
else
if stat>=31
stat %= 2
else
stat %= 3
end
case stat
when 0
@costo = 500
when 1
@costo = 1000
when 2
@costo = 2000
end
end
return
end
def stringa_costo
return @costo == nil ? "0" : @costo.to_s
end
def incrementa(n,s)
@errore=0
controllo(n)
if @errore == 0
$game_system.se_play($data_system.decision_se)
actor = $game_party.actors[n]
case s
when 0
case actor.class_name
when "Guerriero"
actor.hp_plus(10)
when "Lanciere"
actor.hp_plus(10)
when "Cavaliere"
actor.hp_plus(10)
when "Ladro"
actor.hp_plus(8)
when "Cacciatore"
actor.hp_plus(7)
when "Fuciliere"
actor.hp_plus(6)
when "Chierico"
actor.hp_plus(5)
when "Mago"
actor.hp_plus(4)
end
return
when 1
case actor.class_name
when "Guerriero"
actor.mp_plus(4)
when "Lanciere"
actor.mp_plus(4)
when "Cavaliere"
actor.mp_plus(4)
when "Ladro"
actor.mp_plus(6)
when "Cacciatore"
actor.mp_plus(8)
when "Fuciliere"
actor.mp_plus(7)
when "Chierico"
actor.mp_plus(9)
when "Mago"
actor.mp_plus(10)
end
return
when 2
case actor.class_name
when "Cavaliere"
actor.str_plus(4)
when "Guerriero"
actor.str_plus(4)
when "Ladro"
actor.str_plus(3)
when "Lanciere"
actor.str_plus(3)
when "Fuciliere"
actor.str_plus(2)
when "Fuciliere"
actor.str_plus(2)
when "Chierico"
actor.str_plus(1)
when "Mago"
actor.str_plus(1)
end
return
when 3
case actor.class_name
when "Guerriero"
actor.dex_plus(2)
when "Lanciere"
actor.dex_plus(2)
when "Cavaliere"
actor.dex_plus(1)
when "Ladro"
actor.dex_plus(4)
when "Cacciatore"
actor.dex_plus(4)
when "Fuciliere"
actor.dex_plus(4)
when "Chierico"
actor.dex_plus(3)
when "Mago"
actor.dex_plus(3)
end
return
when 4
case actor.class_name
when "Guerriero"
actor.agi_plus(2)
when "Lanciere"
actor.agi_plus(2)
when "Cavaliere"
actor.agi_plus(2)
when "Ladro"
actor.agi_plus(4)
when "Cacciatore"
actor.agi_plus(3)
when "Fuciliere"
actor.agi_plus(3)
when "Chierico"
actor.agi_plus(1)
when "Mago"
actor.agi_plus(1)
end
return
when 5
case actor.class_name
when "Guerriero"
actor.int_plus(1)
when "Lanciere"
actor.int_plus(1)
when "Cavaliere"
actor.int_plus(1)
when "Ladro"
actor.int_plus(3)
when "Cacciatore"
actor.int_plus(2)
when "Fuciliere"
actor.int_plus(2)
when "Chierico"
actor.int_plus(4)
when "mago"
actor.int_plus(4)
end
return
end
else
$game_system.se_play($data_system.buzzer_se)
end
end
def aggiunta_skill(n,s)
@actor = $game_party.actors[n]
skill = $data_skills[s+1]
@errore = 0
controllo(n)
if @errore == 0
if Calcolatore_Skill.new.controllo(n,skill) == false
@actor.learn_skill(s+1)
@actor.apprendi_skill(@costo)
else
$game_system.se_play($data_system.buzzer_se)
end
else
$game_system.se_play($data_system.buzzer_se)
end
end
def controllo(n)
actor = $game_party.actors[n]
@costo > actor.exp_point ? @errore = 1 : @errore = 0
end
end


create poi Scelta:
SPOILER (click to view)
class Scelta < Window_Selectable
def initialize
super(500, 400, 128, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@item_max = 2
@column_max = 2
@commands = ["Sì", "No"]
refresh
self.index = 0
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
def draw_item(index)
x = 6 + index * 63
self.contents.draw_text(x, 0, 32, 32, @commands[index])
end
end


ed infine create Calcolatore_Skill:
SPOILER (click to view)
class Calcolatore_Skill
def controllo(eroe,ability)
@posseduta = false
@actor = $game_party.actors[eroe]
if @actor.skills != nil
for i in [email protected]
valore = @actor.skills[i]
nome = $data_skills[valore].name
if nome == ability.name
@posseduta = true
end
end
end
return @posseduta
end
end


per richiamarlo basta che creiate un evento con scritto dentro:
script: $scene = Addestratore.new

e questo è tutto amici... buon utilizzo a tutti! (se vi dovessero venire fuori eventuali errori ditemeli xkè magari ho dimenticato di inserire qualcosa)

Edited by Siesh - 13/9/2010, 21:46
 
Top
::..Darkblade..::
view post Posted on 13/9/2010, 23:11




O: se Divine Empire non fosse sviluppato su RPG maker VX lo avrei messo ;o meraviglioso, chissà quanto lavoro. continua così siesh, sei grande!
 
Top
Siesh
view post Posted on 13/9/2010, 23:44




davvero taaanto lavoro, ma soprattutto il tempo, visto che cmq a causa studio e (quando capita) lavoro mi son sempre ritrovato ad usare RM nei momenti liberi, mettendoci così + di 1 anno!
 
Top
×GêMå†rIä_Ki¤
view post Posted on 14/9/2010, 09:42




:O! madoooooo >:< mi sarei già suicidato iooo! ! ! che lavoraccio! GRAZIE SIESH! (cià ** metto come discussione importante **) GRAZIE ANCORA!
 
Top
-mat-
view post Posted on 2/5/2011, 16:41




siesh una cosa ho provato lo script ma dice sempre esperienza residua = 0

Edited by -mat- - 2/5/2011, 19:43
 
Top
4 replies since 13/9/2010, 20:28   133 views
  Share