-
Posts
125 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Posts posted by Bahamut87
-
-
Spero riprenda il progetto... Xche merita
-
Ma che fine ha fatto questo Project ?? avendo finito la demo pensavo ci fosse pure il gioco completo...cmq veramente fatto bene mi piace; complimenti...
-
Benvenuto !
-
Grazie del Bentornato.. Usando l' rtp originale gran parte del progetto andrebbe avanti sicuramente qualcosa di esterno ci vuole... Per l idea cm ne ho 2... Quindi 2 ipotetici progetti.... Stasera metto giù tutta la trama del primo o per lo meno quanto riesco..Ma hai già in mente un'idea di progetto? Graficamente trovi che le risorse RTP si sposino con tale idea? Hai già visto qualche RIP che potrebbe starci bene? ^ ^
Bentornato! ^ ^
Inviato dal mio PLUS utilizzando Tapatalk
-
Buongiorno a tutti raga,
finalmente sono tornato, dopo una lunga pausa tra lavoro e impegni vari, per fortuna mi sono ritagliato del tempo per il mio progetto....
Volevo chiedervi un consiglio generale ; come primo progetto in assoluto consigliate di rippare o usare grafica esterna per il Project oppure di usare l' RTP originale ??...
Sinceramente a livello grafico faccio veramente schifo ed ho tantissimo da apprendere e non solo...anche se c'è cmq un botto di materiale in giro per internet....
-
Giusto giusto....mi fa piacere... Io continuo con quello che avevo iniziato....
-
Ciao nonno come va col progetto???
-
Ho risolto Zoro sei un grande..ty mille...
-
OK allora questo è il link del mio progetto con tutti gli script inseriti... https://www.dropbox.com/s/6kz6a0oxngv8ryq/Project1.7z
-
D: Ragazzi ho un problema abb serio...nel senso...nel progetto dove sto lavorando e dico la verità ho inserito un po troppi script...fino a quando mi è arrivato un errorino con scritto "stack level too deep", allora ho rifatto un nuovo progetto con il materiale del progetto vecchio pero senza script lasciando solo quelli originali....invece dell'errore di prima sto giro non parte proprio e mi crasha....e non capisco il perche....vi ringrazio come al solito....
-
Benvenuta ^_^
-
Gran bel progetto...in bocca al lupo nonno !
-
Ottimo ty High
-
c'è un modo per sapere quali sono gli script che sono in collisione ?? il problema che ho tanti script inseriti nel progetto
-
D: Ragazzi stavo iniziando a mappare fino a quando mi arriva questo errore...Help !
http://i57.tinypic.com/34i5soz.jpg
-
Purtroppo Buddy ci ho provato, ma preferisco questo alla gran lunga piu bello secondo me...poi avevo dei problemi di incompatibilità tra il bs di mog e l'after di yan
-
Volevo chiedere se qualcuno mi poteva aiutare...anche se penso che sia difficile ma io ci provo cmq....io uso il Battle result di Moghunter... e qui c'è lo script
#==============================================================================
# +++ MOG - Battle Result (1.4) +++
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com
#==============================================================================
# Apresentação animada do resultado da batalha.
#==============================================================================
# Arquivos necessários. (Graphics/System)
#
# Result.png
# Result_Layout.png
# Result_Levelup.png
# Result_Levelword.png
# Result_Number_1.png
# Result_Number_2.png
#
#==============================================================================
# Histórico (Version History)
#==============================================================================
# 1.4 - Compatibilidade com o script de pause.
# 1.3 - Melhoria do código e compatibilidade.
# 1.2 - Melhoria do código e compatibilidade.
# - Adição de sons.
# 1.1 - Corrigido o erro de apresentar o Resultado ao fugir ou perder a batalha.
#==============================================================================
module MOG_BATLE_RESULT
#Posição do EXP.
RESULT_EXP_POSITION = [440,80]
#Posição do GOLD.
RESULT_GOLD_POSITION = [476,125]
#Posição da palavra LeveL UP.
RESULT_LEVELWORD_POSITION = [0,0]
#Posição do Level.
RESULT_LEVEL_POSITION = [230,-7]
#Posição dos parâmetros
RESULT_PARAMETER_POSITION = [170,85]
#Posição da janela de skill.
RESULT_NEW_SKILL_POSITION = [240,85]
#Definição da animação de Level UP.
RESULT_LEVELUP_ANIMATION_ID = 37
end
#==============================================================================
# ■ Game Temp
#==============================================================================
class Game_Temp
attr_accessor :level_parameter
attr_accessor :level_parameter_old
attr_accessor :result
attr_accessor :battle_end
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_result_initialize initialize
def initialize
@level_parameter = []
@level_parameter_old = []
@result = false
@battle_end = false
mog_result_initialize
end
end
#==============================================================================
# ■ Game Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● Display_level_up
#--------------------------------------------------------------------------
alias mog_result_display_level_up display_level_up
def display_level_up(new_skills)
if $game_temp.result
$game_temp.level_parameter = [@level,new_skills]
return
end
mog_result_display_level_up(new_skills)
end
end
#==============================================================================
# ■ BattleManager
#==============================================================================
module BattleManager
#--------------------------------------------------------------------------
# ● Process Victory
#--------------------------------------------------------------------------
def self.process_victory
play_battle_end_me
replay_bgm_and_bgs
if $mog_rgss3_battle_cry != nil
execute_battle_cry(1, nil, nil)
end
battle_end(0)
SceneManager.return
return true
end
end
#==============================================================================
# ■ Spriteset Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
alias mog_battle_result_pre_terminate pre_terminate
def pre_terminate
execute_result if can_enable_battle_result?
mog_battle_result_pre_terminate
end
#--------------------------------------------------------------------------
# ● Can Enable Battle Result?
#--------------------------------------------------------------------------
def can_enable_battle_result?
return false if !$game_troop.all_dead?
return false if $game_party.members.empty?
return false if $game_party.all_dead?
return true
end
#--------------------------------------------------------------------------
# ● Execute Result
#--------------------------------------------------------------------------
def execute_result
@result = Battle_Result.new
if $mog_rgss3_combo_count != nil
$game_temp.combo_time = 0 rescue nil
end
loop do
@result.update
@spriteset.update
Graphics.update
Input.update
break if @result.victory_phase == 10
end
@result.dispose
end
end
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
include MOG_BATLE_RESULT
attr_accessor :victory_phase
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
$game_temp.battle_end = true
$game_temp.result = true
@victory_phase = 0
@victory_wait_duration = 0
@fade_result_window = false
create_victory_sprites
end
#--------------------------------------------------------------------------
# ● Create Victory Sprites
#--------------------------------------------------------------------------
def create_victory_sprites
@result_number = Cache.system("Result_Number_1")
@result_number2 = Cache.system("Result_Number_2")
@result_cw = @result_number.width / 10
@result_ch = @result_number.height / 2
@result2_cw = @result_number2.width / 10
@result2_ch = @result_number2.height / 2
create_victory_text
create_victory_layout
create_victory_exp
create_victory_gold
create_window_treasure
end
#--------------------------------------------------------------------------
# ● Victory Wait ?
#--------------------------------------------------------------------------
def victory_wait?
return false if @victory_wait_duration <= 0
@victory_wait_duration -= 1
return true
end
#--------------------------------------------------------------------------
# ● End Victory
#--------------------------------------------------------------------------
def end_victory
@victory_wait_duration = 10
dispose
end
#--------------------------------------------------------------------------
# ● Create Victory Layout
#--------------------------------------------------------------------------
def create_victory_layout
return if @victory_layout_sprite != nil
@victory_layout_sprite = Sprite.new
@victory_layout_sprite.z = 1001
@victory_layout_sprite.bitmap = Cache.system("Result_Layout")
@victory_layout_sprite.zoom_x = 2.0
@victory_layout_sprite.opacity = 0
end
#--------------------------------------------------------------------------
# ● Create Victory Text
#--------------------------------------------------------------------------
def create_victory_text
return if @victory_sprite != nil
@victory_sprite = Sprite.new
@victory_sprite.z = 1000
@victory_sprite.bitmap = Cache.system("Result")
@victory_sprite.ox = @victory_sprite.width / 2
@victory_sprite.oy = @victory_sprite.height / 2
@victory_sprite.x = @victory_sprite.ox
@victory_sprite.y = @victory_sprite.oy
@victory_sprite.zoom_x = 1.5
@victory_sprite.zoom_y = 1.5
@victory_sprite.opacity = 0
end
end
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
def dispose
$game_temp.result = false
$game_temp.battle_end = false
@victory_sprite.bitmap.dispose
@victory_sprite.dispose
@victory_layout_sprite.bitmap.dispose
@victory_layout_sprite.dispose
@exp_number.bitmap.dispose
@exp_number.dispose
@gold_number.bitmap.dispose
@gold_number.dispose
@result_number.dispose
@window_treasure.dispose
dispose_level_up
@result_number.dispose
@result_number2.dispose
@tr_viewport.dispose
end
#--------------------------------------------------------------------------
# ● Dispose Result Actor Bitmap
#--------------------------------------------------------------------------
def dispose_result_actor_bitmap
return if @result_actor_sprite == nil
return if @result_actor_sprite.bitmap == nil
@result_actor_sprite.bitmap.dispose
end
#--------------------------------------------------------------------------
# ● Dispose Level UP
#--------------------------------------------------------------------------
def dispose_level_up
return if @levelup_layout == nil
@levelup_layout.bitmap.dispose
@levelup_layout.dispose
@levelup_word.bitmap.dispose
@levelup_word.dispose
@result_actor_sprite.bitmap.dispose
@result_actor_sprite.dispose
@parameter_sprite.bitmap.dispose
@parameter_sprite.dispose
@level_sprite.bitmap.dispose
@level_sprite.dispose
if @new_skill_window != nil
@new_skill_window.dispose
end
end
end
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
if $mog_rgss3_pause != nil
update_pause if MOG_PAUSE::PAUSE_SCENE_BATTLE
end
return if @victory_phase == nil
update_victory_fade if @fade_result_window
return if victory_wait?
case @victory_phase
when 0; update_victory_initial
when 1; update_victory_initial2
when 2; update_victory_initial3
when 3; update_victory_exp
when 4; update_victory_gold
when 5; update_victory_item
when 6; update_victory_levelup
when 9; update_skip_result
end
if Input.trigger?(:C)
if @victory_phase == 10
end_victory
elsif @victory_phase.between?(1,5)
Sound.play_cursor
@victory_phase = 9
end
end
end
#--------------------------------------------------------------------------
# ● Skip Result
#--------------------------------------------------------------------------
def update_skip_result
@victory_sprite.opacity -= 10
@victory_sprite.visible = false
@victory_layout_sprite.opacity += 10
@victory_layout_sprite.zoom_x = 1.00
@gold_number.opacity += 10
@gold_number.zoom_x = 1.00
@gold_number.zoom_y = 1.00
@exp_number.opacity += 10
@exp_number.zoom_x = 1.00
@exp_number.zoom_y = 1.00
@window_treasure.contents_opacity += 10
if @exp_old != @exp_total
@exp_old = @exp_total
refresh_exp_number
end
if @gold_old = @gold_total
@gold_old = @gold_total
refresh_gold_number
end
@window_treasure.x = 0
update_victory_item if @window_treasure.contents_opacity == 255
end
#--------------------------------------------------------------------------
# ● Update Victory Fade
#--------------------------------------------------------------------------
def update_victory_fade
fade_speed = 10
@victory_sprite.opacity -= fade_speed
@victory_layout_sprite.opacity -= fade_speed
@gold_number.opacity -= fade_speed
@exp_number.opacity -= fade_speed
@window_treasure.contents_opacity -= fade_speed
end
#--------------------------------------------------------------------------
# ● Update Victory Initial
#--------------------------------------------------------------------------
def update_victory_initial
@victory_sprite.zoom_x -= 0.01
@victory_sprite.zoom_y -= 0.01
@victory_sprite.opacity += 10
if @victory_sprite.zoom_x <= 1.00
@victory_sprite.zoom_x = 1
@victory_sprite.zoom_y = 1
@victory_sprite.opacity = 255
@victory_phase = 1
@victory_wait_duration = 20
end
end
#--------------------------------------------------------------------------
# ● Update Victory Initial 2
#--------------------------------------------------------------------------
def update_victory_initial2
@victory_sprite.zoom_x += 0.01
@victory_sprite.zoom_y += 0.01
@victory_sprite.opacity -= 10
if @victory_sprite.opacity <= 0
@victory_sprite.zoom_x = 1
@victory_sprite.zoom_y = 1
@victory_sprite.opacity = 0
@victory_phase = 2
end
end
#--------------------------------------------------------------------------
# ● Update Victory Initial 3
#--------------------------------------------------------------------------
def update_victory_initial3
@victory_layout_sprite.zoom_x -= 0.02
@victory_layout_sprite.opacity += 10
if @victory_layout_sprite.zoom_x <= 1.00
@victory_layout_sprite.zoom_x = 1
@victory_layout_sprite.opacity = 255
@victory_phase = 3
end
end
end
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
#--------------------------------------------------------------------------
# ● Create Victory Exp
#--------------------------------------------------------------------------
def create_victory_exp
@exp_number = Sprite.new
@exp_number.bitmap = Bitmap.new(@result_number.width,@result_ch)
@exp_number.z = 1002
@exp_number.y = RESULT_EXP_POSITION[1]
@exp_number.zoom_x = 2
@exp_number.zoom_y = 2
@exp_total = $game_troop.exp_total
@exp_number.opacity = 0
@exp_old = 0
@exp_ref = ((1 * @exp_total) / 111).truncate rescue nil
@exp_ref = 1 if @exp_ref < 1 or @exp_ref == nil
@exp_ref = 0 if @exp_total == 0
refresh_exp_number
end
#--------------------------------------------------------------------------
# ● Update Victory Exp
#--------------------------------------------------------------------------
def update_victory_exp
update_exp_sprite
update_exp_number
end
#--------------------------------------------------------------------------
# ● Update EXP Sprite
#--------------------------------------------------------------------------
def update_exp_sprite
@exp_number.opacity += 15
if @exp_number.zoom_x > 1.00
@exp_number.zoom_x -= 0.03
@exp_number.zoom_x = 1.00 if @exp_number.zoom_x <= 1.00
end
@exp_number.zoom_y = @exp_number.zoom_x
if (@exp_old >= @exp_total) and @exp_number.zoom_x == 1.00
@victory_phase = 4
Sound.play_cursor
end
end
#--------------------------------------------------------------------------
# ● Refresh Exp Number
#--------------------------------------------------------------------------
def refresh_exp_number
@exp_number.bitmap.clear
draw_result_exp(@exp_old, 0,0)
end
#--------------------------------------------------------------------------
# ● Update Exp_number
#--------------------------------------------------------------------------
def update_exp_number
return if @exp_old == @exp_total
@exp_old += @exp_ref
@exp_old = @exp_total if @exp_old > @exp_total
refresh_exp_number
end
#--------------------------------------------------------------------------
# ● Draw Result EXP
#--------------------------------------------------------------------------
def draw_result_exp(value,x,y)
ncw = @result_cw
nch = @result_ch
number = value.abs.to_s.split(//)
x2 = x - (number.size * ncw)
@exp_number.ox = (number.size * ncw) / 2
@exp_number.oy = @result_ch / 2
@exp_number.x = (RESULT_EXP_POSITION[0] + @result_cw + @exp_number.ox) - (number.size * ncw)
for r in 0..number.size - 1
number_abs = number[r].to_i
nsrc_rect = Rect.new(ncw * number_abs, 0, ncw, nch)
@exp_number.bitmap.blt(x + (ncw * r), y, @result_number, nsrc_rect)
end
end
end
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
#--------------------------------------------------------------------------
# ● Create Victory Gold
#--------------------------------------------------------------------------
def create_victory_gold
@gold_number = Sprite.new
@gold_number.bitmap = Bitmap.new(@result_number.width,@result_ch)
@gold_number.z = 1002
@gold_number.y = RESULT_GOLD_POSITION[1]
@gold_number.opacity = 0
@gold_number.zoom_x = 2
@gold_number.zoom_y = 2
@gold_total = $game_troop.gold_total
@gold_old = 0
@gold_ref = ((1 * @gold_total) / 111).truncate rescue nil
@gold_ref = 1 if @gold_ref < 1 or @gold_ref == nil
@gold_ref = 0 if @gold_total == 0
$game_party.gain_gold($game_troop.gold_total)
refresh_gold_number
end
#--------------------------------------------------------------------------
# ● Update Victory Gold
#--------------------------------------------------------------------------
def update_victory_gold
update_gold_sprite
update_gold_number
end
#--------------------------------------------------------------------------
# ● Update GOLD Sprite
#--------------------------------------------------------------------------
def update_gold_sprite
@gold_number.opacity += 15
if @gold_number.zoom_x > 1.00
@gold_number.zoom_x -= 0.03
@gold_number.zoom_x = 1.00 if @gold_number.zoom_x <= 1.00
end
@gold_number.zoom_y = @gold_number.zoom_x
if @gold_old >= @gold_total and @gold_number.zoom_x == 1.00
@victory_phase = 5
Sound.play_cursor
end
end
#--------------------------------------------------------------------------
# ● Refresh gold Number
#--------------------------------------------------------------------------
def refresh_gold_number
@gold_number.bitmap.clear
draw_result_gold(@gold_old, 0,0)
end
#--------------------------------------------------------------------------
# ● Update Gold Number
#--------------------------------------------------------------------------
def update_gold_number
return if @gold_old == @gold_total
@gold_old += @gold_ref
@gold_old = @gold_total if @gold_old > @gold_total
refresh_gold_number
end
#--------------------------------------------------------------------------
# ● Draw Result Gold
#--------------------------------------------------------------------------
def draw_result_gold(value,x,y)
ncw = @result_cw
nch = @result_ch
number = value.abs.to_s.split(//)
x2 = x - (number.size * ncw)
@gold_number.ox = (number.size * ncw) / 2
@gold_number.oy = @result_ch / 2
@gold_number.x = (RESULT_GOLD_POSITION[0] + @result_cw + @gold_number.ox) - (number.size * ncw)
for r in 0..number.size - 1
number_abs = number[r].to_i
nsrc_rect = Rect.new(ncw * number_abs, @result_ch, ncw, nch)
@gold_number.bitmap.blt(x + (ncw * r), y, @result_number, nsrc_rect)
end
end
end
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
#--------------------------------------------------------------------------
# ● Create Window Treasure
#--------------------------------------------------------------------------
def create_window_treasure
@tr_viewport = Viewport.new(-8, 164, 576, 118)
@tr_viewport.z = 1003
@window_treasure = Window_Treasure.new
@window_treasure.viewport = @tr_viewport
end
#--------------------------------------------------------------------------
# ● Update Victory Item
#--------------------------------------------------------------------------
def update_victory_item
@window_treasure.update
@actor_level = []
return if @window_treasure.x != 0 and @victory_phase >= 6
@victory_phase = 6
@result_member_max = $game_party.battle_members.size
@result_member_id = 0
end
end
#==============================================================================
# ■ Window Treasure
#==============================================================================
class Window_Treasure < Window_Base
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
super(-544,-10, 576, 256)
self.opacity = 0
self.contents_opacity = 0
self.contents.font.size = 24
self.contents.font.bold = true
self.z = 1003
@range_max = 256
@wait_time = 30
@scroll = false
draw_treasure
end
#--------------------------------------------------------------------------
# ● Draw_Treasure
#--------------------------------------------------------------------------
def draw_treasure
contents.clear
t_index = 0
space_x = 540 / 3
$game_troop.make_drop_items.each do |item|
xi = (t_index * space_x) - ((t_index / 3) * (space_x * 3))
yi = (t_index / 3) * 32
$game_party.gain_item(item, 1)
draw_item_name(item,xi, yi, true, 140)
t_index += 1
end
@range_max = (t_index / 3) * 32
@scroll = true if t_index > 12
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
super
self.contents_opacity += 10
if self.x < 0
self.x += 15
if self.x >= 0
self.x = 0
Sound.play_cursor
end
end
if @scroll and self.contents_opacity == 255 and self.x == 0
@wait_time -= 1 if @wait_time > 0
return if @wait_time > 0
self.y -= 1
self.y = 128 if self.y < -@range_max
@wait_time = 30 if self.y == -10
end
end
end
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
#--------------------------------------------------------------------------
# ● Create Levelup
#--------------------------------------------------------------------------
def create_levelup
if @levelup_layout == nil
@levelup_layout = Sprite.new
@levelup_layout.z = 1000
@levelup_layout.bitmap = Cache.system("Result_Levelup")
end
if @levelup_word == nil
@levelup_word = Sprite.new
@levelup_word.z = 1001
@levelup_word.bitmap = Cache.system("Result_Levelword")
@levelup_word.ox = @levelup_word.bitmap.width / 2
@levelup_word.oy = @levelup_word.bitmap.height / 2
@levelup_word.x = @levelup_word.ox + RESULT_LEVELWORD_POSITION[0]
@levelup_word.y = @levelup_word.oy + RESULT_LEVELWORD_POSITION[1]
end
@levelup_word.blend_type = 1
@levelup_word.zoom_x = 2
@levelup_word.zoom_y = 2
end
#--------------------------------------------------------------------------
# ● Create Parameter Number
#--------------------------------------------------------------------------
def create_parameter_number
if @parameter_sprite == nil
@parameter_sprite = Sprite.new
@parameter_sprite.bitmap = Bitmap.new(250,220)
@parameter_sprite.z = 1001
@parameter_sprite.x = RESULT_PARAMETER_POSITION[0]
@parameter_sprite.y = RESULT_PARAMETER_POSITION[1]
@parameter_sprite.bitmap.font.size = 16
@parameter_sprite.bitmap.font.bold = true
end
refresh_parameter
end
#--------------------------------------------------------------------------
# ● Refresh Parameter
#--------------------------------------------------------------------------
def refresh_parameter
@parameter_animation = 0
@parameter_sprite.bitmap.clear
@parameter_sprite.opacity = 0
@parameter_sprite.x = RESULT_PARAMETER_POSITION[0] - 200
actor_old = $game_temp.level_parameter_old
draw_result_parameter(@actor_result.mhp,actor_old[1],0,28 * 0)
draw_result_parameter(@actor_result.mmp,actor_old[2],0,28 * 1)
draw_result_parameter(@actor_result.atk,actor_old[3],0,28 * 2)
draw_result_parameter(@actor_result.def,actor_old[4],0,28 * 3)
draw_result_parameter(@actor_result.mat,actor_old[5],0,28 * 4)
draw_result_parameter(@actor_result.mdf,actor_old[6],0,28 * 5)
draw_result_parameter(@actor_result.agi,actor_old[7],0,28 * 6)
draw_result_parameter(@actor_result.luk,actor_old[8],0,28 * 7)
end
#--------------------------------------------------------------------------
# ● Draw Result EXP
#--------------------------------------------------------------------------
def draw_result_parameter(value,value2,x,y)
ncw = @result2_cw
nch = @result2_ch
number = value.abs.to_s.split(//)
x2 = x + (number.size * ncw) + 16
for r in 0..number.size - 1
number_abs = number[r].to_i
nsrc_rect = Rect.new(ncw * number_abs, 0, ncw, nch)
@parameter_sprite.bitmap.blt(x + (ncw * r), y, @result_number2, nsrc_rect)
end
value3 = value - value2
par = ""
if value > value2
par = "+"
@parameter_sprite.bitmap.font.color = Color.new(50,255,255)
elsif value < value2
par = ""
@parameter_sprite.bitmap.font.color = Color.new(255,155,100)
end
return if value == value2
@parameter_sprite.bitmap.draw_text(x2,y - 8,100,32,par.to_s + value3.to_s,0)
end
#--------------------------------------------------------------------------
# ● Create Result Actor
#--------------------------------------------------------------------------
def create_result_actor
if @result_actor_sprite == nil
@result_actor_sprite = Sprite.new
@result_actor_sprite.z = 999
end
dispose_result_actor_bitmap
@result_actor_sprite.bitmap = Cache.picture("Actor" + @actor_result.id.to_s)
@result_actor_org = [380 - (@result_actor_sprite.bitmap.width / 2), Graphics.height - @result_actor_sprite.bitmap.height]
@result_actor_sprite.x = @result_actor_org[0] + 200
@result_actor_sprite.y = @result_actor_org[1]
@result_actor_sprite.opacity = 0
end
#--------------------------------------------------------------------------
# ● Check New Skill
#--------------------------------------------------------------------------
def check_new_skill
@new_skills = $game_temp.level_parameter[1]
@new_skills_index = 0
end
#--------------------------------------------------------------------------
# ● Show New Skill
#--------------------------------------------------------------------------
def show_new_skill(start = false)
Sound.play_recovery unless start
@new_skill_window.draw_new_skill(@new_skills[@new_skills_index])
@new_skills_index += 1
if @new_skills_index == @new_skills.size or
@new_skills[@new_skills_index] == nil
@new_skills = nil
end
end
#--------------------------------------------------------------------------
# ● Check Level UP
#--------------------------------------------------------------------------
def check_level_up
if @new_skills != nil and !@new_skills.empty?
show_new_skill
return
end
for battler_id in @result_member_id..@result_member_max
actor_result = $game_party.members[@result_member_id]
$game_temp.level_parameter = [] if $game_temp.level_parameter == nil
$game_temp.level_parameter_old = [] if $game_temp.level_parameter_old == nil
$game_temp.level_parameter.clear
$game_temp.level_parameter_old.clear
$game_temp.level_parameter_old = [actor_result.level,actor_result.mhp,actor_result.mmp,
actor_result.atk, actor_result.def, actor_result.mat, actor_result.mdf, actor_result.agi, actor_result.luk] rescue nil
actor_result.gain_exp($game_troop.exp_total) rescue nil
@result_member_id += 1
@new_skills = nil
@new_skills_index = 0
if $game_temp.level_parameter != nil and !$game_temp.level_parameter.empty?
show_level_result
break
end
end
return if !$game_temp.level_parameter.empty?
@victory_phase = 10 if @result_member_id >= @result_member_max
end
#--------------------------------------------------------------------------
# ● Create Level
#--------------------------------------------------------------------------
def create_level
if @level_sprite == nil
@level_sprite = Sprite.new
@level_sprite.bitmap = Bitmap.new(200,64)
@level_sprite.z = 1002
end
@level_sprite.bitmap.font.size = 48
@level_sprite.bitmap.font.bold = true
@level_sprite.x = RESULT_LEVEL_POSITION[0]
@level_sprite.y = RESULT_LEVEL_POSITION[1]
@level_sprite.bitmap.clear
@level_sprite.bitmap.font.color = Color.new(255,255,255)
@level_sprite.bitmap.draw_text(0,0,100,64,@actor_result.level,1)
levelup = @actor_result.level - $game_temp.level_parameter_old[0]
@level_sprite.bitmap.font.color = Color.new(50,255,255)
@level_sprite.bitmap.font.size = 18
@level_sprite.bitmap.draw_text(80,0,100,64,"+" + levelup.to_s ,0)
end
#--------------------------------------------------------------------------
# ● Create New Skill Windos
#--------------------------------------------------------------------------
def create_new_skill_window
if @new_skill_window == nil
@new_skill_window = Window_Result_Skill.new
end
@new_skill_window.x = RESULT_NEW_SKILL_POSITION[0]
@new_skill_window.y = RESULT_NEW_SKILL_POSITION[1]
check_new_skill
if @new_skills != nil and !@new_skills.empty?
show_new_skill
else
@new_skill_window.x = -544
end
end
#--------------------------------------------------------------------------
# ● Show Level Result
#--------------------------------------------------------------------------
def show_level_result
Sound.play_cursor
@actor_result = $game_party.members[@result_member_id - 1] rescue nil
return if @actor_result == nil
@actor_result.animation_id = RESULT_LEVELUP_ANIMATION_ID
@fade_result_window = true
create_levelup
create_level
create_parameter_number
create_result_actor
create_new_skill_window
end
end
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
#--------------------------------------------------------------------------
# ● Update Victory Item
#--------------------------------------------------------------------------
def update_victory_levelup
check_level_up if Input.trigger?(:C)
update_show_levelup
if @levelup_layout == nil
@window_treasure.update
else
@window_treasure.contents_opacity -= 15
end
end
#--------------------------------------------------------------------------
# ● Update Show Level UP
#--------------------------------------------------------------------------
def update_show_levelup
return if @levelup_layout == nil
return if @result_actor_sprite == nil
@new_skill_window.update
if @result_actor_sprite.x > @result_actor_org[0]
@result_actor_sprite.x -= 5
@result_actor_sprite.opacity += 7
if @result_actor_sprite.x <= @result_actor_org[0]
@result_actor_sprite.x = @result_actor_org[0]
@result_actor_sprite.opacity = 255
end
end
if @levelup_word.zoom_x > 1.00
@levelup_word.zoom_x -= 0.03
if @levelup_word.zoom_x < 1.00
@levelup_word.zoom_x = 1.00
@levelup_word.blend_type = 0
end
end
@levelup_word.zoom_y = @levelup_word.zoom_x
if @parameter_sprite.x < RESULT_PARAMETER_POSITION[0]
@parameter_sprite.opacity += 13
@parameter_sprite.x += 5
if @parameter_sprite.x >= RESULT_PARAMETER_POSITION[0]
@parameter_sprite.opacity = 255
@parameter_sprite.x = RESULT_PARAMETER_POSITION[0]
end
end
end
end
#==============================================================================
# ■ Window Result Skill
#==============================================================================
class Window_Result_Skill < Window_Base
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
super(0,0, 270, 58)
self.opacity = 160
self.contents_opacity = 255
self.contents.font.name = "Arial"
self.contents.font.bold = true
self.z = 1003
@animation_time = 999
@org = [MOG_BATLE_RESULT::RESULT_NEW_SKILL_POSITION[0],MOG_BATLE_RESULT::RESULT_NEW_SKILL_POSITION[1]]
end
#--------------------------------------------------------------------------
# ● DrawNew Skill
#--------------------------------------------------------------------------
def draw_new_skill(skill)
contents.clear
self.contents.font.size = 16
self.contents.font.color = Color.new(100,200,100)
contents.draw_text(0,0,100,32, "New Skill",0)
self.contents.font.color = Color.new(255,255,255)
draw_item_name_skill(skill,70,0, true, 170)
self.x = @org[0]
self.y = @org[1]
@animation_time = 0
self.opacity = 0
self.contents_opacity = 0
end
#--------------------------------------------------------------------------
# ● Draw Item Name
#--------------------------------------------------------------------------
def draw_item_name_skill(item, x, y, enabled = true, width = 172)
return unless item
draw_icon(item.icon_index, x, y, enabled)
change_color(normal_color, enabled)
draw_text(x + 24, y + 4, width, line_height, item.name)
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
super
return if @animation_time == 999
@animation_time += 1 if @animation_time != 999
case @animation_time
when 0..30
self.y -= 1
self.opacity += 5
self.contents_opacity += 5
when 31..60
self.y += 1
self.opacity += 5
self.contents_opacity += 5
else
self.y = @org[1]
self.opacity = 255
self.contents_opacity = 255
@animation_time = 999
end
end
end
$mog_battle_result = true, e uso anche il Jp manager di Yanfly che serve per inserire una sorta di sistema di apprendimento di abilità con dei punti dati a fine battaglia...alla FF per fare un esempio....uso sia il Jp manager che il Learn Skill sempre di Yanfly... qui di seguito il Jp manager..
#==============================================================================
#
# ▼ Yanfly Engine Ace - JP Manager v1.00
# -- Last Updated: 2012.01.07
# -- Level: Normal, Hard
# -- Requires: n/a
#
#==============================================================================
$imported = {} if $imported.nil?
$imported["YEA-JPManager"] = true
#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.01.07 - Started Script and Finished.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script provides a base for JP implementation. JP is a currency similar
# to EXP that's gained through performing actions and leveling up in addition
# to killing enemies. This script provides modifiers that adjust the gains for
# JP through rates, individual gains per skill or item, and per enemy. Though
# this script provides no usage of JP by itself, future Yanfly Engine Ace
# scripts may make use of it.
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Actor Notetags - These notetags go in the actors notebox in the database.
# -----------------------------------------------------------------------------
#
# Changes the JP earned rate to x%. This affects JP earned and not JP directly
# gained. If this notetag isn't used, the object will default to 100%.
#
# -----------------------------------------------------------------------------
# Class Notetags - These notetags go in the class notebox in the database.
# -----------------------------------------------------------------------------
#
# Changes the JP earned rate to x%. This affects JP earned and not JP directly
# gained. If this notetag isn't used, the object will default to 100%.
#
# -----------------------------------------------------------------------------
# Skill Notetags - These notetags go in the skills notebox in the database.
# -----------------------------------------------------------------------------
#
# When the actor successfully hits an target with this action, the actor will
# earn x JP. If this notetag isn't used, the amount of JP earned will equal to
# the ACTION_JP constant in the module.
#
# -----------------------------------------------------------------------------
# Item Notetags - These notetags go in the items notebox in the database.
# -----------------------------------------------------------------------------
#
# When the actor successfully hits an target with this action, the actor will
# earn x JP. If this notetag isn't used, the amount of JP earned will equal to
# the ACTION_JP constant in the module.
#
# -----------------------------------------------------------------------------
# Weapon Notetags - These notetags go in the weapon notebox in the database.
# -----------------------------------------------------------------------------
#
# Changes the JP earned rate to x%. This affects JP earned and not JP directly
# gained. If this notetag isn't used, the object will default to 100%.
#
# -----------------------------------------------------------------------------
# Armour Notetags - These notetags go in the armour notebox in the database.
# -----------------------------------------------------------------------------
#
# Changes the JP earned rate to x%. This affects JP earned and not JP directly
# gained. If this notetag isn't used, the object will default to 100%.
#
# -----------------------------------------------------------------------------
# Enemy Notetags - These notetags go in the enemy notebox in the database.
# -----------------------------------------------------------------------------
#
# Changes the amount of JP gained for killing the enemy to x. If this notetag
# isn't used, then the default JP gain will be equal to the amount set in the
# module through the constant ENEMY_KILL.
#
# -----------------------------------------------------------------------------
# State Notetags - These notetags go in the states notebox in the database.
# -----------------------------------------------------------------------------
#
# Changes the JP earned rate to x%. This affects JP earned and not JP directly
# gained. If this notetag isn't used, the object will default to 100%.
#
# -----------------------------------------------------------------------------
# Script Calls - These commands are used with script calls.
# -----------------------------------------------------------------------------
# $game_actors[x].earn_jp(y)
# $game_actors[x].earn_jp(y, z)
# This will cause actor x to earn y amount of JP. JP earned will be modified by
# any JP Rate traits provided through notetags. If z is used, z will be the
# class the JP is earned for.
#
# $game_actors[x].gain_jp(y)
# $game_actors[x].gain_jp(y, z)
# This will cause actor x to gain y amount of JP. JP gained this way will not
# be modified by any JP Rate traits provided through notetags. If z is used,
# z will be the class the JP is gained for.
#
# $game_actors[x].lose_jp(y)
# $game_actors[x].lose_jp(y, z)
# This will cause actor x to lose y amount of JP. JP lost this way will not be
# modified by any JP Rate traits provided through notetags. If z is used, z
# will be the class the JP is lost from.
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
# This script is compatible with Yanfly Engine Ace - Victory Aftermath v1.03+.
# If you wish to have Victory Aftermath display JP gains, make sure the version
# is 1.03+. Script placement of these two scripts don't matter.
#
#==============================================================================
module YEA
module JP
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - General JP Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# This adjusts the way JP appears visually in your game. Change the icon
# used and the vocabulary used here. Furthermore, adjust the maximum amount
# of JP that an actor can have at a time.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
ICON = 119 # Icon index used to represent JP.
VOCAB = "AP" # What JP will be called in your game.
MAX_JP = 99999999 # Maximum JP an actor can have.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Default JP Gain Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# The following constants adjust how much JP is earned by default through
# enemy kills, leveling up, and performing actions.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
ENEMY_KILL = 2 # JP earned for the whole party.
LEVEL_UP = 7 # JP earned when leveling up!
ACTION_JP = 5 # JP earned per successful hit.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Victory Message -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# This adjusts the victory message shown for the default battle system and
# the Yanfly Engine Ace - Victory Aftermath script (if used together).
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
VICTORY_MESSAGE = "%s has earned %s %s!"
VICTORY_AFTERMATH = "+%s%s"
end # JP
end # YEA
#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================
module YEA
module REGEXP
module BASEITEM
JP_RATE = /<(?:JP_RATE|jp rate):[ ](\d+)([%%])>/i
end # BASEITEM
module USABLEITEM
JP_GAIN = /<(?:JP_GAIN|jp gain):[ ](\d+)>/i
end # USABLEITEM
module ENEMY
JP_GAIN = /<(?:JP_GAIN|jp gain):[ ](\d+)>/i
end # ENEMY
end # REGEXP
end # YEA
#==============================================================================
# ■ Vocab
#==============================================================================
module Vocab
#--------------------------------------------------------------------------
# new method: self.jp
#--------------------------------------------------------------------------
def self.jp
return YEA::JP::VOCAB
end
end # Vocab
#==============================================================================
# ■ Icon
#==============================================================================
module Icon
#--------------------------------------------------------------------------
# self.jp
#--------------------------------------------------------------------------
def self.jp; return YEA::JP::ICON; end
end # Icon
#==============================================================================
# ■ Numeric
#==============================================================================
class Numeric
#--------------------------------------------------------------------------
# new method: group_digits
#--------------------------------------------------------------------------
unless $imported["YEA-CoreEngine"]
def group; return self.to_s; end
end # $imported["YEA-CoreEngine"]
end # Numeric
#==============================================================================
# ■ DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# alias method: load_database
#--------------------------------------------------------------------------
class < def self.load_database
load_database_jp
load_notetags_jp
end
#--------------------------------------------------------------------------
# new method: load_notetags_jp
#--------------------------------------------------------------------------
def self.load_notetags_jp
groups = [$data_actors, $data_classes, $data_weapons, $data_armors,
$data_states, $data_enemies, $data_items, $data_skills]
for group in groups
for obj in group
next if obj.nil?
obj.load_notetags_jp
end
end
end
end # DataManager
#==============================================================================
# ■ RPG::BaseItem
#==============================================================================
class RPG::BaseItem
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :jp_rate
#--------------------------------------------------------------------------
# common cache: load_notetags_jp
#--------------------------------------------------------------------------
def load_notetags_jp
@jp_rate = 1.0
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when YEA::REGEXP::BASEITEM::JP_RATE
@jp_rate = $1.to_i * 0.01
#---
end
} # self.note.split
#---
end
end # RPG::BaseItem
#==============================================================================
# ■ RPG::UsableItem
#==============================================================================
class RPG::UsableItem < RPG::BaseItem
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :jp_gain
#--------------------------------------------------------------------------
# common cache: load_notetags_jp
#--------------------------------------------------------------------------
def load_notetags_jp
@jp_gain = YEA::JP::ACTION_JP
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when YEA::REGEXP::USABLEITEM::JP_GAIN
@jp_gain = $1.to_i
#---
end
} # self.note.split
#---
end
end # RPG::UsableItem
#==============================================================================
# ■ RPG::Enemy
#==============================================================================
class RPG::Enemy < RPG::BaseItem
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :jp_gain
#--------------------------------------------------------------------------
# common cache: load_notetags_jp
#--------------------------------------------------------------------------
def load_notetags_jp
@jp_gain = YEA::JP::ENEMY_KILL
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when YEA::REGEXP::ENEMY::JP_GAIN
@jp_gain = $1.to_i
#---
end
} # self.note.split
#---
end
end # RPG::Enemy
#==============================================================================
# ■ BattleManager
#==============================================================================
module BattleManager
#--------------------------------------------------------------------------
# alias method: display_exp
#--------------------------------------------------------------------------
unless $imported["YEA-VictoryAftermath"]
class < def self.display_exp
battlemanager_display_exp_jp
gain_jp
end
end # $imported["YEA-VictoryAftermath"]
#--------------------------------------------------------------------------
# new method: gain_jp
#--------------------------------------------------------------------------
def self.gain_jp
amount = $game_troop.jp_total
fmt = YEA::JP::VICTORY_MESSAGE
for member in $game_party.members
member.earn_jp(amount)
next if $imported["YEA-VictoryAftermath"]
value = member.battle_jp_earned.group
$game_message.add('\.' + sprintf(fmt, member.name, value, Vocab::jp))
end
wait_for_message unless $imported["YEA-VictoryAftermath"]
end
end # BattleManager
#==============================================================================
# ■ Game_BattlerBase
#==============================================================================
class Game_BattlerBase
#--------------------------------------------------------------------------
# new method: jpr
#--------------------------------------------------------------------------
def jpr
n = 1.0
if actor?
n *= self.actor.jp_rate
n *= self.class.jp_rate
for equip in equips
next if equip.nil?
n *= equip.jp_rate
end
end
for state in states
next if state.nil?
n *= state.jp_rate
end
return n
end
end # Game_BattlerBase
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler < Game_BattlerBase
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :battle_jp_earned
#--------------------------------------------------------------------------
# alias method: on_battle_start
#--------------------------------------------------------------------------
alias game_battler_on_battle_start_jp on_battle_start
def on_battle_start
game_battler_on_battle_start_jp
@battle_jp_earned = 0
end
#--------------------------------------------------------------------------
# alias method: on_battle_end
#--------------------------------------------------------------------------
alias game_battler_on_battle_end_jp on_battle_end
def on_battle_end
game_battler_on_battle_end_jp
@battle_jp_earned = 0
end
#--------------------------------------------------------------------------
# alias method: item_user_effect
#--------------------------------------------------------------------------
alias game_battler_item_user_effect_jp item_user_effect
def item_user_effect(user, item)
game_battler_item_user_effect_jp(user, item)
user.earn_jp(item.jp_gain) if user.actor?
end
end # Game_Battler
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# alias method: setup
#--------------------------------------------------------------------------
alias game_actor_setup_jp setup
def setup(actor_id)
game_actor_setup_jp(actor_id)
init_jp
end
#--------------------------------------------------------------------------
# new method: init_jp
#--------------------------------------------------------------------------
def init_jp
@jp = {}
@jp[@class_id] = 0
end
#--------------------------------------------------------------------------
# new method: earn_jp
#--------------------------------------------------------------------------
def earn_jp(jp, class_id = nil)
gain_jp(jp * jpr, class_id)
end
#--------------------------------------------------------------------------
# new method: gain_jp
#--------------------------------------------------------------------------
def gain_jp(jp, class_id = nil)
init_jp if @jp.nil?
class_id = @class_id if class_id.nil?
@jp[class_id] = 0 if @jp[class_id].nil?
@jp[class_id] += jp.to_i
@jp[class_id] = [[@jp[class_id], YEA::JP::MAX_JP].min, 0].max
@battle_jp_earned = 0 if @battle_jp_earned.nil? && $game_party.in_battle
@battle_jp_earned += jp.to_i if $game_party.in_battle
end
#--------------------------------------------------------------------------
# new method: lose_jp
#--------------------------------------------------------------------------
def lose_jp(jp, class_id = nil)
gain_jp(-jp, class_id)
end
#--------------------------------------------------------------------------
# new method: jp
#--------------------------------------------------------------------------
def jp(class_id = nil)
class_id = @class_id if class_id.nil?
@jp[class_id] = 0 if @jp[class_id].nil?
return @jp[class_id]
end
#--------------------------------------------------------------------------
# alias method: level_up
#--------------------------------------------------------------------------
alias game_actor_level_up_jp level_up
def level_up
game_actor_level_up_jp
earn_jp(YEA::JP::LEVEL_UP)
end
end # Game_Actor
#==============================================================================
# ■ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# new method: jp
#--------------------------------------------------------------------------
def jp
return enemy.jp_gain
end
end # Game_Enemy
#==============================================================================
# ■ Game_Troop
#==============================================================================
class Game_Troop < Game_Unit
#--------------------------------------------------------------------------
# new method: jp_total
#--------------------------------------------------------------------------
def jp_total
dead_members.inject(0) {|r, enemy| r += enemy.jp }
end
end # Game_Troop
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# new method: draw_actor_jp
#--------------------------------------------------------------------------
def draw_actor_jp(actor, dx, dy, dw = 112)
draw_icon(Icon.jp, dx + dw - 24, dy) if Icon.jp > 0
dw -= 24 if Icon.jp > 0
change_color(system_color)
draw_text(dx, dy, dw, line_height, Vocab::jp, 2)
dw -= text_size(Vocab::jp).width
change_color(normal_color)
draw_text(dx, dy, dw, line_height, actor.jp.group, 2)
end
#--------------------------------------------------------------------------
# new method: draw_actor_jp_class
#--------------------------------------------------------------------------
def draw_actor_jp_class(actor, class_id, dx, dy, dw = 112)
draw_icon(Icon.jp, dx + dw - 24, dy) if Icon.jp > 0
dw -= 24 if Icon.jp > 0
change_color(system_color)
draw_text(dx, dy, dw, line_height, Vocab::jp, 2)
dw -= text_size(Vocab::jp).width
change_color(normal_color)
draw_text(dx, dy, dw, line_height, actor.jp(class_id).group, 2)
end
end # Window_Base
#==============================================================================
#
# ▼ End of File
#
#==============================================================================;>;>
e qui il learn skill sempre di Yan
#==============================================================================
#
# ▼ Yanfly Engine Ace - Learn Skill Engine v1.00
# -- Last Updated: 2012.01.08
# -- Level: Normal, Hard
# -- Requires: n/a
#
#==============================================================================
$imported = {} if $imported.nil?
$imported["YEA-LearnSkillEngine"] = true
#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.01.08 - Started Script and Finished.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# For those who want an alternative for actors to learn skills outside of
# leveling, this script allows actors to learn skills through a learn skill
# menu. The actor can use acquired JP, EXP, or Gold to learn skills. Skills can
# also be hidden until certain requirements are met.
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Class Notetags - These notetags go in the class notebox in the database.
# -----------------------------------------------------------------------------
#
#
# Sets the class to be able to learn skills x through the Learn Skills menu.
# Insert multiple of these tags to increase the number of skills learned.
#
# -----------------------------------------------------------------------------
# Skill Notetags - These notetags go in the skill notebox in the database.
# -----------------------------------------------------------------------------
#
#
#
# Sets the learn for cost the skill to require x amounts of JP, x amounts of
# exp, or x amounts of gold. Only one type of cost can be used at a time. For
# JP costs, the Yanfly Engine Ace - JP Manager script must be installed.
#
#
# Sets the skill to require the actor's current level to be x before the skill
# will show up in the skill learning window.
#
#
#
# Sets the skill to require learning skill x (through any means) before the
# skill becomes visible in the skill learning window. Insert multiples of these
# tags to require more skills to be learned in order for the skill to show.
#
#
#
# Sets the skill to require switch x to be ON in order for it to show in the
# skill learning window. Insert multiple switches to to increase the number of
# switches needed to be ON before the skill is shown.
#
#
# string
# string
#
# For the more advanced users, replace string with lines of code to check for
# whether or not the skill will be shown in skill learning window. If multiple
# lines are used, they are all considered part of the same line.
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
# This script is compatible with Yanfly Engine Ace - JP Manager v1.00+. The
# placement of this script relative to the JP Manager script doesn't matter.
#
#==============================================================================
module YEA
module LEARN_SKILL
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - General Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Adjust the general settings here for your game. These adjust how the
# command name appears, a switch to show the Learn Command
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
COMMAND_NAME = "Impara Abilità" # Name used for Learn Skill command.
# This switch will hide the "Learn" command from view if the switch is OFF.
# The "Learn" command will be shown if the switch is ON. Set this switch to
# 0 to not use this effect and to always have the Learn command be shown.
SHOW_SWITCH = 0
# This adjusts the order the Skill Types appear in for the command window.
# Any Skill Types unlisted will not be shown.
STYPE_ORDER = [41..999, 1..40]
# For those who installed Yanfly Engine - Skill Restrictions, you can
# choose to display warmups or cooldowns inside of the menu here.
DRAW_WARMUP = true # Draw warmups for skills?
DRAW_COOLDOWN = true # Draw cooldowns for skills?
#-------------------------------------------------------------------------
# - Default Cost -
#-------------------------------------------------------------------------
# This sets the default costs for all skills. If the JP script isn't
# installed, the type will become :exp instead.
#
# Cost Type Description
# :jp - Requires YEA - JP Manager.
# :exp - Makes skill cost EXP.
# :gold - Makes skill cost gold.
#-------------------------------------------------------------------------
DEFAULT_COST = 0 # Sets the default cost of a skill.
DEFAULT_TYPE = :AP # Sets the default cost type.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Learn Window Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# These settings adjust the Learn Window's visual appearance. Adjust the
# way empty text appears, EXP cost suffixes appear, Learned text appears,
# font sizes, and cost colours here.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
EMPTY_TEXT = "-" # Text if no restricts used for the skill.
EXP_TEXT = "EXP" # Text used for EXP costs.
LEARNED_TEXT = "Learned" # Text to indicate skill has been learned.
LEARNED_SIZE = 20 # Font size used for learned skill text.
COLOUR_JP = 24 # Text colour used for JP Cost.
COLOUR_EXP = 5 # Text colour used for EXP Cost.
COLOUR_GOLD = 21 # Text colour used for Gold Cost.
COST_SIZE = 20 # Font size used for skill costs.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Cost Window Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# When a skill is selected to be learned, the cost window appears. Adjust
# the settings here to choose how your game's cost window looks. Change the
# maximum number of rows, the gold icon used for gold costs, the gold text,
# the learn skill text, the cancel text, and the cancel icon here.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
MAXIMUM_ROWS = 8 # Maximum number of rows displayed.
GOLD_ICON = 361 # Icon used for gold costs.
GOLD_TEXT = "Gold Cost" # Text used for gold costs.
LEARN_SKILL_TEXT = "Learn %s?" # Text used to learn skill.
LEARN_CANCEL_TEXT = "Cancel" # Text used for do not learn.
CANCEL_ICON = 187 # Icon used for cancel.
end # LEARN_SKILL
end # YEA
#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================
module YEA
module LEARN_SKILL
module_function
#--------------------------------------------------------------------------
# convert_integer_array
#--------------------------------------------------------------------------
def convert_integer_array(array)
result = []
array.each { |i|
case i
when Range; result |= i.to_a
when Integer; result |=
end }
return result
end
#--------------------------------------------------------------------------
# converted_contants
#--------------------------------------------------------------------------
STYPE_ORDER = convert_integer_array(STYPE_ORDER)
end # LEARN_SKILL
module REGEXP
module CLASS
LEARN_SKILLS = /<(?:LEARN_SKILLS|learn skills):[ ](\d+(?:\s*,\s*\d+)*)>/i
end # CLASS
module SKILL
LEARN_COST = /<(?:LEARN_COST|learn cost):[ ](.*)>/i
LEARN_REQUIRE_LEVEL =
/<(?:LEARN_REQUIRE_LEVEL|learn require level):[ ](\d+)>/i
LEARN_REQUIRE_SKILL =
/<(?:LEARN_REQUIRE_SKILL|learn require skill):[ ](\d+(?:\s*,\s*\d+)*)>/i
LEARN_REQUIRE_SWITCH =
/<(?:LEARN_REQUIRE_SWITCH|learn require switch):[ ](\d+(?:\s*,\s*\d+)*)>/i
LEARN_REQUIRE_EVAL_ON = /<(?:LEARN_REQUIRE_EVAL|learn require eval)>/i
LEARN_REQUIRE_EVAL_OFF = /<\/(?:LEARN_REQUIRE_EVAL|learn require eval)>/i
end # SKILL
end # REGEXP
end # YEA
#==============================================================================
# ■ Numeric
#==============================================================================
class Numeric
#--------------------------------------------------------------------------
# new method: group_digits
#--------------------------------------------------------------------------
unless $imported["YEA-CoreEngine"]
def group; return self.to_s; end
end # $imported["YEA-CoreEngine"]
end # Numeric
#==============================================================================
# ■ Icon
#==============================================================================
module Icon
#--------------------------------------------------------------------------
# self.cancel
#--------------------------------------------------------------------------
def self.cancel
return YEA::LEARN_SKILL::CANCEL_ICON
end
#--------------------------------------------------------------------------
# self.learn_skill_gold
#--------------------------------------------------------------------------
def self.learn_skill_gold
return YEA::LEARN_SKILL::GOLD_ICON
end
end # Icon
#==============================================================================
# ■ Switch
#==============================================================================
module Switch
#--------------------------------------------------------------------------
# self.show_learn_skill
#--------------------------------------------------------------------------
def self.show_learn_skill
return true if YEA::LEARN_SKILL::SHOW_SWITCH <= 0
return $game_switches[YEA::LEARN_SKILL::SHOW_SWITCH]
end
end # Switch
#==============================================================================
# ■ DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# alias method: load_database
#--------------------------------------------------------------------------
class < def self.load_database
load_database_lse
load_notetags_lse
end
#--------------------------------------------------------------------------
# new method: load_notetags_lse
#--------------------------------------------------------------------------
def self.load_notetags_lse
groups = [$data_classes, $data_skills]
for group in groups
for obj in group
next if obj.nil?
obj.load_notetags_lse
end
end
end
end # DataManager
#==============================================================================
# ■ RPG::Class
#==============================================================================
class RPG::Class < RPG::BaseItem
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :learn_skills
#--------------------------------------------------------------------------
# common cache: load_notetags_lse
#--------------------------------------------------------------------------
def load_notetags_lse
@learn_skills = []
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when YEA::REGEXP::CLASS::LEARN_SKILLS
$1.scan(/\d+/).each { |num|
@learn_skills.push(num.to_i) if num.to_i > 0 }
end
} # self.note.split
#---
end
end # RPG::Class
#==============================================================================
# ■ RPG::Skill
#==============================================================================
class RPG::Skill < RPG::UsableItem
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :learn_cost
attr_accessor :learn_require_level
attr_accessor :learn_require_skill
attr_accessor :learn_require_switch
attr_accessor :learn_require_eval
#--------------------------------------------------------------------------
# common cache: load_notetags_lse
#--------------------------------------------------------------------------
def load_notetags_lse
@learn_cost = [YEA::LEARN_SKILL::DEFAULT_COST]
@learn_cost.push(YEA::LEARN_SKILL::DEFAULT_TYPE)
@learn_require_level = 0
@learn_require_skill = []
@learn_require_switch = []
@learn_require_eval_on = false
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when YEA::REGEXP::SKILL::LEARN_COST
case $1.upcase
when /(\d+)[ ]JP/i
next unless $imported["YEA-JPManager"]
@learn_cost = [$1.to_i, :jp]
when /(\d+)[ ]EXP/i
@learn_cost = [$1.to_i, :exp]
when /(\d+)[ ]GOLD/i
@learn_cost = [$1.to_i, :gold]
end
#---
when YEA::REGEXP::SKILL::LEARN_REQUIRE_LEVEL
@learn_require_level = $1.to_i
when YEA::REGEXP::SKILL::LEARN_REQUIRE_SKILL
$1.scan(/\d+/).each { |num|
@learn_require_skill.push(num.to_i) if num.to_i > 0 }
when YEA::REGEXP::SKILL::LEARN_REQUIRE_SWITCH
$1.scan(/\d+/).each { |num|
@learn_require_switch.push(num.to_i) if num.to_i > 0 }
#---
when YEA::REGEXP::SKILL::LEARN_REQUIRE_EVAL_ON
@learn_require_eval_on = true
when YEA::REGEXP::SKILL::LEARN_REQUIRE_EVAL_OFF
@learn_require_eval_on = false
else
next unless @learn_require_eval_on
@learn_require_eval = "" if @learn_require_eval.nil?
@learn_require_eval += line.to_s
#---
end
} # self.note.split
#---
if !$imported["YEA-JPManager"] && @learn_cost[1] == :jp
@learn_cost[1] = :exp
end
end
end # RPG::Skill
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# alias method: skills
#--------------------------------------------------------------------------
alias game_actor_skills_lse skills
def skills
btest_add_learn_skills
game_actor_skills_lse
end
#--------------------------------------------------------------------------
# new method: btest_add_learn_skills
#--------------------------------------------------------------------------
def btest_add_learn_skills
return unless $BTEST
for skill_id in self.class.learn_skills; learn_skill(skill_id); end
end
#--------------------------------------------------------------------------
# new method: exp_class
#--------------------------------------------------------------------------
def exp_class(class_id)
@exp[class_id] = 0 if @exp[class_id].nil?
return @exp[class_id]
end
#--------------------------------------------------------------------------
# lose_exp_class
#--------------------------------------------------------------------------
def lose_exp_class(value, class_id)
exp = exp_class(class_id) - value
change_exp_class(exp, class_id)
end
#--------------------------------------------------------------------------
# change_exp_class
#--------------------------------------------------------------------------
def change_exp_class(exp, class_id)
return change_exp(exp, false) if class_id == @class_id
@exp[class_id] = [exp, 0].max
end
end # Game_Actor
#==============================================================================
# ■ Window_SkillCommand
#==============================================================================
class Window_SkillCommand < Window_Command
#--------------------------------------------------------------------------
# alias method: make_command_list
#--------------------------------------------------------------------------
alias window_skillcommand_make_command_list_lse make_command_list
def make_command_list
window_skillcommand_make_command_list_lse
return if @actor.nil?
add_learn_skill_command unless $imported["YEA-SkillMenu"]
end
#--------------------------------------------------------------------------
# new method: add_learn_skill_command
#--------------------------------------------------------------------------
def add_learn_skill_command
return unless Switch.show_learn_skill
name = YEA::LEARN_SKILL::COMMAND_NAME
add_command(name, :learn_skill, true, @actor.added_skill_types[0])
end
end # Window_SkillCommand
#==============================================================================
# ■ Window_LearnSkillCommand
#==============================================================================
class Window_LearnSkillCommand < Window_Command
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_reader :skill_window
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(dx, dy)
super(dx, dy)
@actor = nil
end
#--------------------------------------------------------------------------
# window_width
#--------------------------------------------------------------------------
def window_width; return 160; end
#--------------------------------------------------------------------------
# visible_line_number
#--------------------------------------------------------------------------
def visible_line_number; return 4; end
#--------------------------------------------------------------------------
# actor=
#--------------------------------------------------------------------------
def actor=(actor)
return if @actor == actor
@actor = actor
refresh
select(item_max - 1) if index >= item_max
end
#--------------------------------------------------------------------------
# make_command_list
#--------------------------------------------------------------------------
def make_command_list
return if @actor.nil?
make_unlocked_class_skill_types
correct_unlocked_class_learned_skills
for stype_id in YEA::LEARN_SKILL::STYPE_ORDER
next unless include?(stype_id)
name = $data_system.skill_types[stype_id]
add_command(name, :skill, true, stype_id)
end
end
#--------------------------------------------------------------------------
# make_unlocked_class_skill_types
#--------------------------------------------------------------------------
def make_unlocked_class_skill_types
return unless $imported["YEA-ClassSystem"]
@unlocked_types = []
unlocked_classes = @actor.unlocked_classes.clone
unlocked_classes |= YEA::CLASS_SYSTEM::DEFAULT_UNLOCKS
for class_id in unlocked_classes
next if $data_classes[class_id].nil?
for feature in $data_classes[class_id].features
next unless feature.code == 41
@unlocked_types.push(feature.data_id)
end
end
end
#--------------------------------------------------------------------------
# correct_unlocked_class_learned_skills
#--------------------------------------------------------------------------
def correct_unlocked_class_learned_skills
return unless $imported["YEA-ClassSystem"]
unlocked_classes = @actor.unlocked_classes.clone
unlocked_classes |= YEA::CLASS_SYSTEM::DEFAULT_UNLOCKS
for class_id in unlocked_classes
@actor.learn_class_skills(class_id)
end
end
#--------------------------------------------------------------------------
# include?
#--------------------------------------------------------------------------
def include?(stype_id)
return true if @actor.added_skill_types.include?(stype_id)
if $imported["YEA-ClassSystem"]
return true if @unlocked_types.include?(stype_id)
end
return false
end
#--------------------------------------------------------------------------
# update
#--------------------------------------------------------------------------
def update
super
@skill_window.stype_id = current_ext if @skill_window
end
#--------------------------------------------------------------------------
# skill_window=
#--------------------------------------------------------------------------
def skill_window=(skill_window)
@skill_window = skill_window
update
end
end # Window_LearnSkillCommand
#==============================================================================
# ■ Window_LearnSkillList
#==============================================================================
class Window_LearnSkillList < Window_SkillList
#--------------------------------------------------------------------------
# col_max
#--------------------------------------------------------------------------
def col_max; return 1; end
#--------------------------------------------------------------------------
# select_last
#--------------------------------------------------------------------------
def select_last; select(0); end
#--------------------------------------------------------------------------
# actor=
#--------------------------------------------------------------------------
def actor=(actor)
return if @actor == actor
super(actor)
make_learn_skills_list
end
#--------------------------------------------------------------------------
# make_learn_skills_list
#--------------------------------------------------------------------------
def make_learn_skills_list
@learn_skills = []
@skill_classes = {}
return if @actor.nil?
for skill_id in @actor.class.learn_skills
next if $data_skills[skill_id].nil?
next if @learn_skills.include?($data_skills[skill_id])
skill = $data_skills[skill_id]
@learn_skills.push(skill)
@skill_classes[skill] = [] if @skill_classes[skill].nil?
@skill_classes[skill].push(@actor.class.id)
end
make_unlocked_class_skills
end
#--------------------------------------------------------------------------
# make_unlocked_class_skills
#--------------------------------------------------------------------------
def make_unlocked_class_skills
return unless $imported["YEA-ClassSystem"]
@unlocked_types = []
unlocked_classes = @actor.unlocked_classes.clone
unlocked_classes |= YEA::CLASS_SYSTEM::DEFAULT_UNLOCKS
for class_id in unlocked_classes
next if $data_classes[class_id].nil?
for skill_id in $data_classes[class_id].learn_skills
next if $data_skills[skill_id].nil?
skill = $data_skills[skill_id]
@learn_skills.push(skill) unless @learn_skills.include?(skill)
@skill_classes[skill] = [] if @skill_classes[skill].nil?
@skill_classes[skill] |= [class_id]
end
end
end
#--------------------------------------------------------------------------
# skill_classes
#--------------------------------------------------------------------------
def skill_classes(skill)
return @skill_classes[skill]
end
#--------------------------------------------------------------------------
# make_item_list
#--------------------------------------------------------------------------
def make_item_list
return if @learn_skills.nil?
@data = @learn_skills.select {|skill| include?(skill) }
end
#--------------------------------------------------------------------------
# include?
#--------------------------------------------------------------------------
def include?(item)
return false if item.nil?
return false unless meet_requirements?(item)
return item.stype_id == @stype_id
end
#--------------------------------------------------------------------------
# meet_requirements?
#--------------------------------------------------------------------------
def meet_requirements?(item)
return false if @actor.nil?
return false unless meet_level_requirements?(item)
return false unless meet_skill_requirements?(item)
return false unless meet_switch_requirements?(item)
return false unless meet_eval_requirements?(item)
return true
end
#--------------------------------------------------------------------------
# meet_level_requirements?
#--------------------------------------------------------------------------
def meet_level_requirements?(item)
return @actor.level >= item.learn_require_level
end
#--------------------------------------------------------------------------
# meet_skill_requirements?
#--------------------------------------------------------------------------
def meet_skill_requirements?(item)
for skill_id in item.learn_require_skill
next if $data_skills[skill_id].nil?
return false unless @actor.skill_learn?($data_skills[skill_id])
end
return true
end
#--------------------------------------------------------------------------
# meet_switch_requirements?
#--------------------------------------------------------------------------
def meet_switch_requirements?(item)
for switch_id in item.learn_require_switch
return false unless $game_switches[switch_id]
end
return true
end
#--------------------------------------------------------------------------
# meet_eval_requirements?
#--------------------------------------------------------------------------
def meet_eval_requirements?(item)
return true if item.learn_require_eval.nil?
return eval(item.learn_require_eval)
end
#--------------------------------------------------------------------------
# enable?
#--------------------------------------------------------------------------
def enable?(skill)
return false if skill.nil?
return false unless enabled_jp?(skill)
return false unless enabled_exp?(skill)
return false unless enabled_gold?(skill)
return !@actor.skill_learn?(skill)
end
#--------------------------------------------------------------------------
# enabled_jp?
#--------------------------------------------------------------------------
def enabled_jp?(skill)
return true if skill.learn_cost[1] != :jp
cost = skill.learn_cost[0]
for class_id in @skill_classes[skill]
return true if @actor.jp(class_id) >= cost
end
return false
end
#--------------------------------------------------------------------------
# enabled_exp?
#--------------------------------------------------------------------------
def enabled_exp?(skill)
return true if skill.learn_cost[1] != :exp
cost = skill.learn_cost[0]
for class_id in @skill_classes[skill]
return true if @actor.exp_class(class_id) >= cost
end
return false
end
#--------------------------------------------------------------------------
# enabled_gold?
#--------------------------------------------------------------------------
def enabled_gold?(skill)
return true if skill.learn_cost[1] != :gold
cost = skill.learn_cost[0]
return $game_party.gold >= cost
end
#--------------------------------------------------------------------------
# draw_item
#--------------------------------------------------------------------------
def draw_item(index)
skill = @data[index]
return if skill.nil?
rect = item_rect(index)
rect.width = (contents.width - spacing) / 2 - 4
draw_item_name(skill, rect.x, rect.y, enable?(skill), rect.width - 24)
draw_skill_cost(rect, skill)
draw_restriction_info(skill, index)
draw_learn_cost(skill, index)
end
#--------------------------------------------------------------------------
# skill_restriction?
#--------------------------------------------------------------------------
def skill_restriction?(index)
return false
end
#--------------------------------------------------------------------------
# draw_restriction_info
#--------------------------------------------------------------------------
def draw_restriction_info(skill, index)
return unless $imported["YEA-SkillRestrictions"]
rect = item_rect(index)
rect.x = contents.width / 2
rect.width /= 2
rect.width /= 3
rect.width -= 8
draw_skill_warmup(skill, rect)
rect.x += rect.width + 4
draw_skill_cooldown(skill, rect)
end
#--------------------------------------------------------------------------
# draw_skill_warmup
#--------------------------------------------------------------------------
def draw_skill_warmup(skill, rect)
return unless YEA::LEARN_SKILL::DRAW_WARMUP
enabled = enable?(skill)
enabled = false if skill.warmup <= 0
change_color(warmup_colour, enabled)
icon = Icon.warmup
if icon > 0
draw_icon(icon, rect.x + rect.width-24, rect.y, enable?(skill))
rect.width -= 24
end
contents.font.size = YEA::SKILL_RESTRICT::WARMUP_SIZE
value = skill.warmup > 0 ? skill.warmup.group : empty_text
text = sprintf(YEA::SKILL_RESTRICT::WARMUP_SUFFIX, value)
draw_text(rect, text, 2)
reset_font_settings
end
#--------------------------------------------------------------------------
# draw_skill_cooldown
#--------------------------------------------------------------------------
def draw_skill_cooldown(skill, rect)
return unless YEA::LEARN_SKILL::DRAW_COOLDOWN
enabled = enable?(skill)
enabled = false if skill.cooldown <= 0
change_color(cooldown_colour, enabled)
icon = Icon.cooldown
if icon > 0
draw_icon(icon, rect.x + rect.width-24, rect.y, enable?(skill))
rect.width -= 24
end
contents.font.size = YEA::SKILL_RESTRICT::COOLDOWN_SIZE
value = skill.cooldown > 0 ? skill.cooldown.group : empty_text
text = sprintf(YEA::SKILL_RESTRICT::COOLDOWN_SUFFIX, value)
draw_text(rect, text, 2)
reset_font_settings
end
#--------------------------------------------------------------------------
# empty_text
#--------------------------------------------------------------------------
def empty_text
return YEA::LEARN_SKILL::EMPTY_TEXT
end
#--------------------------------------------------------------------------
# draw_learn_cost
#--------------------------------------------------------------------------
def draw_learn_cost(skill, index)
rect = item_rect(index)
rect.width -= 4
if @actor.skill_learn?(skill)
draw_learned_skill(rect)
else
draw_learn_skill_cost(skill, rect)
end
reset_font_settings
end
#--------------------------------------------------------------------------
# draw_learned_skill
#--------------------------------------------------------------------------
def draw_learned_skill(rect)
contents.font.size = YEA::LEARN_SKILL::LEARNED_SIZE
change_color(normal_color)
draw_text(rect, YEA::LEARN_SKILL::LEARNED_TEXT, 2)
end
#--------------------------------------------------------------------------
# draw_learn_skill_cost
#--------------------------------------------------------------------------
def draw_learn_skill_cost(skill, rect)
case skill.learn_cost[1]
when :jp
return unless $imported["YEA-JPManager"]
draw_jp_cost(skill, rect)
when :exp
draw_exp_cost(skill, rect)
when :gold
draw_gold_cost(skill, rect)
else; return
end
end
#--------------------------------------------------------------------------
# draw_jp_cost
#--------------------------------------------------------------------------
def draw_jp_cost(skill, rect)
enabled = enabled_jp?(skill)
if Icon.jp > 0
draw_icon(Icon.jp, rect.x + rect.width - 24, rect.y, enabled)
rect.width -= 24
end
contents.font.size = YEA::LEARN_SKILL::COST_SIZE
change_color(system_color, enabled)
draw_text(rect, Vocab::jp, 2)
rect.width -= text_size(Vocab::jp).width
cost = skill.learn_cost[0]
text = cost.group
change_color(text_color(YEA::LEARN_SKILL::COLOUR_JP), enabled)
draw_text(rect, text, 2)
end
#--------------------------------------------------------------------------
# draw_exp_cost
#--------------------------------------------------------------------------
def draw_exp_cost(skill, rect)
enabled = enabled_exp?(skill)
contents.font.size = YEA::LEARN_SKILL::COST_SIZE
change_color(system_color, enabled)
draw_text(rect, YEA::LEARN_SKILL::EXP_TEXT, 2)
rect.width -= text_size(YEA::LEARN_SKILL::EXP_TEXT).width
cost = skill.learn_cost[0]
text = cost.group
change_color(text_color(YEA::LEARN_SKILL::COLOUR_EXP), enabled)
draw_text(rect, text, 2)
end
#--------------------------------------------------------------------------
# draw_gold_cost
#--------------------------------------------------------------------------
def draw_gold_cost(skill, rect)
enabled = enabled_jp?(skill)
contents.font.size = YEA::LEARN_SKILL::COST_SIZE
change_color(system_color, enabled)
draw_text(rect, Vocab::currency_unit, 2)
rect.width -= text_size(Vocab::currency_unit).width
cost = skill.learn_cost[0]
text = cost.group
change_color(text_color(YEA::LEARN_SKILL::COLOUR_GOLD), enabled)
draw_text(rect, text, 2)
end
end # Window_LearnSkillList
#==============================================================================
# ■ Window_LearnSkillCostBack
#==============================================================================
class Window_LearnSkillCostBack < Window_Base
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(item_window)
dw = Graphics.width * 3 / 4
dx = (Graphics.width - dw) / 2
super(dx, 0, dw, fitting_height(2))
self.openness = 0
self.back_opacity = 255
@front_window = nil
@item_window = item_window
@skill = nil
end
#--------------------------------------------------------------------------
# reveal
#--------------------------------------------------------------------------
def reveal(skill, skill_classes)
@skill = skill
return if @skill.nil?
case @skill.learn_cost[1]
when :gold
self.height = fitting_height(3)
else
maximum = [skill_classes.size, YEA::LEARN_SKILL::MAXIMUM_ROWS].min
self.height = fitting_height(maximum + 2)
end
create_contents
self.y = (Graphics.height - self.height) / 2
refresh
open
end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
reset_font_settings
draw_learn_skill_text
rect = Rect.new(0, 0, contents.width - 4, line_height)
draw_learn_skill_cost(@skill, rect)
end
#--------------------------------------------------------------------------
# draw_learn_skill_text
#--------------------------------------------------------------------------
def draw_learn_skill_text
name = sprintf("\eI[%d]%s", @skill.icon_index, @skill.name)
fmt = YEA::LEARN_SKILL::LEARN_SKILL_TEXT
text = sprintf(fmt, name)
draw_text_ex(4, 0, text)
end
#--------------------------------------------------------------------------
# draw_learn_skill_cost
#--------------------------------------------------------------------------
def draw_learn_skill_cost(skill, rect)
case skill.learn_cost[1]
when :jp
return unless $imported["YEA-JPManager"]
draw_jp_cost(skill, rect)
when :exp
draw_exp_cost(skill, rect)
when :gold
draw_gold_cost(skill, rect)
else; return
end
end
#--------------------------------------------------------------------------
# draw_jp_cost
#--------------------------------------------------------------------------
def draw_jp_cost(skill, rect)
enabled = true
if Icon.jp > 0
draw_icon(Icon.jp, rect.x + rect.width - 24, rect.y, enabled)
rect.width -= 24
end
contents.font.size = YEA::LEARN_SKILL::COST_SIZE
change_color(system_color, enabled)
draw_text(rect, Vocab::jp, 2)
rect.width -= text_size(Vocab::jp).width
cost = skill.learn_cost[0]
text = cost.group
change_color(text_color(YEA::LEARN_SKILL::COLOUR_JP), enabled)
draw_text(rect, text, 2)
end
#--------------------------------------------------------------------------
# draw_exp_cost
#--------------------------------------------------------------------------
def draw_exp_cost(skill, rect)
enabled = true
contents.font.size = YEA::LEARN_SKILL::COST_SIZE
change_color(system_color, enabled)
draw_text(rect, YEA::LEARN_SKILL::EXP_TEXT, 2)
rect.width -= text_size(YEA::LEARN_SKILL::EXP_TEXT).width
cost = skill.learn_cost[0]
text = cost.group
change_color(text_color(YEA::LEARN_SKILL::COLOUR_EXP), enabled)
draw_text(rect, text, 2)
end
#--------------------------------------------------------------------------
# draw_gold_cost
#--------------------------------------------------------------------------
def draw_gold_cost(skill, rect)
enabled = true
contents.font.size = YEA::LEARN_SKILL::COST_SIZE
change_color(system_color, enabled)
draw_text(rect, Vocab::currency_unit, 2)
rect.width -= text_size(Vocab::currency_unit).width
cost = skill.learn_cost[0]
text = cost.group
change_color(text_color(YEA::LEARN_SKILL::COLOUR_GOLD), enabled)
draw_text(rect, text, 2)
end
end # Window_LearnSkillCostBack
#==============================================================================
# ■ Window_LearnSkillCostFront
#==============================================================================
class Window_LearnSkillCostFront < Window_Command
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(item_window, cost_window)
super((Graphics.width - window_width) / 2, 0)
self.openness = 0
self.opacity = 0
@item_window = item_window
@cost_window = cost_window
@skill = nil
@actor = nil
deactivate
end
#--------------------------------------------------------------------------
# window_width
#--------------------------------------------------------------------------
def window_width; return Graphics.width * 3 / 4; end
#--------------------------------------------------------------------------
# skill_class
#--------------------------------------------------------------------------
def skill_class
return @skill_classes.nil? ? nil : @skill_classes[index]
end
#--------------------------------------------------------------------------
# reveal
#--------------------------------------------------------------------------
def reveal(skill, skill_classes, actor)
@skill = skill
@skill_classes = skill_classes.clone
@actor = actor
return if @skill.nil?
case @skill.learn_cost[1]
when :gold
self.height = fitting_height(2)
else
maximum = [skill_classes.size, YEA::LEARN_SKILL::MAXIMUM_ROWS].min
self.height = fitting_height(maximum + 1)
end
create_contents
self.y = @cost_window.y + line_height
refresh
select(0)
open
activate
end
#--------------------------------------------------------------------------
# make_command_list
#--------------------------------------------------------------------------
def make_command_list
return if @skill_classes.nil?
if @skill.learn_cost[1] == :gold
add_command("GOLD", :gold, true)
add_command(YEA::LEARN_SKILL::LEARN_CANCEL_TEXT, :cancel, true)
return
end
for class_id in @skill_classes
name = $data_classes[class_id].name
add_command(name, :class, enabled?(class_id), class_id)
end
add_command(YEA::LEARN_SKILL::LEARN_CANCEL_TEXT, :cancel, true)
end
#--------------------------------------------------------------------------
# enabled?
#--------------------------------------------------------------------------
def enabled?(class_id)
cost = @skill.learn_cost[0]
case @skill.learn_cost[1]
when :jp
return @actor.jp(class_id) >= cost
when :exp
return @actor.exp_class(class_id) >= cost
end
return true
end
#--------------------------------------------------------------------------
# draw_item
#--------------------------------------------------------------------------
def draw_item(index)
reset_font_settings
rect = item_rect(index)
rect.x += 24
rect.width -= 28
return draw_cancel_text(index, rect) if @list[index][:symbol] == :cancel
draw_class_name(index, rect) if @skill.learn_cost[1] != :gold
draw_party_gold(rect) if @skill.learn_cost[1] == :gold
draw_learn_skill_cost(@skill, rect, index)
end
#--------------------------------------------------------------------------
# draw_cancel_text
#--------------------------------------------------------------------------
def draw_cancel_text(index, rect)
draw_icon(Icon.cancel, rect.x, rect.y)
text = command_name(index)
draw_text(rect.x+24, rect.y, rect.width-24, line_height, text)
end
#--------------------------------------------------------------------------
# draw_class_name
#--------------------------------------------------------------------------
def draw_class_name(index, rect)
class_id = @list[index][:ext]
return if $data_classes[class_id].nil?
enabled = enabled?(class_id)
if $imported["YEA-ClassSystem"]
draw_icon($data_classes[class_id].icon_index, rect.x, rect.y, enabled)
end
rect.x += 24
rect.width -= 24
change_color(normal_color, enabled)
draw_text(rect, "Conferma")#$data_classes[class_id].name)
end
#--------------------------------------------------------------------------
# draw_class_name
#--------------------------------------------------------------------------
def draw_party_gold(rect)
enabled = true
draw_icon(Icon.learn_skill_gold, rect.x, rect.y)
rect.x += 24
rect.width -= 24
change_color(normal_color, enabled)
draw_text(rect, YEA::LEARN_SKILL::GOLD_TEXT)
end
#--------------------------------------------------------------------------
# draw_learn_skill_cost
#--------------------------------------------------------------------------
def draw_learn_skill_cost(skill, rect, index)
case skill.learn_cost[1]
when :jp
return unless $imported["YEA-JPManager"]
draw_jp_cost(skill, rect, index)
when :exp
draw_exp_cost(skill, rect, index)
when :gold
draw_gold_cost(skill, rect)
else; return
end
end
#--------------------------------------------------------------------------
# draw_jp_cost
#--------------------------------------------------------------------------
def draw_jp_cost(skill, rect, index)
enabled = enabled?(@list[index][:ext])
if Icon.jp > 0
draw_icon(Icon.jp, rect.x + rect.width - 24, rect.y, enabled)
rect.width -= 24
end
contents.font.size = YEA::LEARN_SKILL::COST_SIZE
change_color(system_color, enabled)
draw_text(rect, Vocab::jp, 2)
rect.width -= text_size(Vocab::jp).width
cost = @actor.jp(@list[index][:ext])
text = cost.group
change_color(text_color(YEA::LEARN_SKILL::COLOUR_JP), enabled)
draw_text(rect, text, 2)
end
#--------------------------------------------------------------------------
# draw_exp_cost
#--------------------------------------------------------------------------
def draw_exp_cost(skill, rect, index)
enabled = enabled?(@list[index][:ext])
contents.font.size = YEA::LEARN_SKILL::COST_SIZE
change_color(system_color, enabled)
draw_text(rect, YEA::LEARN_SKILL::EXP_TEXT, 2)
rect.width -= text_size(YEA::LEARN_SKILL::EXP_TEXT).width
cost = @actor.exp_class(@list[index][:ext])
text = cost.group
change_color(text_color(YEA::LEARN_SKILL::COLOUR_EXP), enabled)
draw_text(rect, text, 2)
end
#--------------------------------------------------------------------------
# draw_gold_cost
#--------------------------------------------------------------------------
def draw_gold_cost(skill, rect)
enabled = $game_party.gold >= skill.learn_cost[0]
contents.font.size = YEA::LEARN_SKILL::COST_SIZE
change_color(system_color, enabled)
draw_text(rect, Vocab::currency_unit, 2)
rect.width -= text_size(Vocab::currency_unit).width
cost = $game_party.gold
text = cost.group
change_color(text_color(YEA::LEARN_SKILL::COLOUR_GOLD), enabled)
draw_text(rect, text, 2)
end
end # Window_LearnSkillCostFront
#==============================================================================
# ■ Scene_Skill
#==============================================================================
class Scene_Skill < Scene_ItemBase
#--------------------------------------------------------------------------
# alias method: create_command_window
#--------------------------------------------------------------------------
alias scene_skill_create_command_window_lse create_command_window
def create_command_window
scene_skill_create_command_window_lse
@command_window.set_handler(:learn_skill, method(:command_learn_skill))
end
#--------------------------------------------------------------------------
# new method: command_learn_skill
#--------------------------------------------------------------------------
def command_learn_skill
SceneManager.call(Scene_LearnSkill)
end
end # Scene_Skill
#==============================================================================
# ■ Scene_LearnSkill
#==============================================================================
class Scene_LearnSkill < Scene_Skill
#--------------------------------------------------------------------------
# start
#--------------------------------------------------------------------------
def start
super
create_cost_windows
end
#--------------------------------------------------------------------------
# create_command_window
#--------------------------------------------------------------------------
def create_command_window
wy = @help_window.height
@command_window = Window_LearnSkillCommand.new(0, wy)
@command_window.viewport = @viewport
@command_window.help_window = @help_window
@command_window.actor = @actor
@command_window.set_handler(:skill, method(:command_skill))
@command_window.set_handler(:cancel, method(:return_scene))
@command_window.set_handler(:pagedown, method(:next_actor))
@command_window.set_handler(:pageup, method(:prev_actor))
end
#--------------------------------------------------------------------------
# create_item_window
#--------------------------------------------------------------------------
def create_item_window
wx = 0
wy = @status_window.y + @status_window.height
ww = Graphics.width
wh = Graphics.height - wy
@item_window = Window_LearnSkillList.new(wx, wy, ww, wh)
@item_window.actor = @actor
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.set_handler(:ok, method(:on_item_ok))
@item_window.set_handler(:cancel, method(:on_item_cancel))
@command_window.skill_window = @item_window
end
#--------------------------------------------------------------------------
# create_cost_windows
#--------------------------------------------------------------------------
def create_cost_windows
@cost_window = Window_LearnSkillCostBack.new(@item_window)
@cost_front = Window_LearnSkillCostFront.new(@item_window, @cost_window)
@cost_window.viewport = @viewport
@cost_front.viewport = @viewport
@cost_front.set_handler(:ok, method(:on_cost_ok))
@cost_front.set_handler(:cancel, method(:on_cost_cancel))
end
#--------------------------------------------------------------------------
# on_item_ok
#--------------------------------------------------------------------------
def on_item_ok
skill = @item_window.item
@cost_window.reveal(skill, @item_window.skill_classes(skill))
@cost_front.reveal(skill, @item_window.skill_classes(skill), @actor)
end
#--------------------------------------------------------------------------
# on_cost_ok
#--------------------------------------------------------------------------
def on_cost_ok
Sound.play_use_skill
skill = @item_window.item
@actor.learn_skill(skill.id)
cost = skill.learn_cost[0]
case skill.learn_cost[1]
when :jp
@actor.lose_jp(cost, @cost_front.skill_class)
when :exp
@actor.lose_exp_class(cost, @cost_front.skill_class)
when :gold
$game_party.lose_gold(cost)
end
on_cost_cancel
refresh_windows
end
#--------------------------------------------------------------------------
# on_cost_cancel
#--------------------------------------------------------------------------
def on_cost_cancel
@cost_front.close
@cost_window.close
@item_window.activate
end
#--------------------------------------------------------------------------
# refresh_windows
#--------------------------------------------------------------------------
def refresh_windows
@item_window.refresh
@status_window.refresh
end
end # Scene_LearnSkill
#==============================================================================
#
# ▼ End of File
#
#==============================================================================, la domanda è ---> come faccio a inserire nel battle result i Jp che prendo in ogni battaglia nella schermata di fine battaglia....e un'altra domanda nel menu del learn skill non si vedono quanti Jp il giocatore ha guadagnato....si vedono solamente quando impara un abilità....spero di essere stato chiaro.....ty mille come sempre.... ^_^;>
-
Benvenuto ! ^_^
-
+7
non c'entra niente con il forum, ma a mio parare bello da vedere.....
-
-
allora io l'altro giorno ho provato il Crea evento veloce della porta di Vx Ace...si ti cre l'evento in 2 secondi ma è un evento che manca la metà della fine...io per fare una porta con l'animazione sia ovvio che si apra sia ovvio che chiuda...ho creato 2 eventi... cosi..
P.s se ho fatto una cagata ditemi pure ...
evento1
la prima prima pagina ho messo solo il controllo switch ON ( ho creato uno switch della porta che si apre)
la seconda pagina è cosi:
http://i60.tinypic.com/2ut6ujk.jpg
mentre quella dell'evento della porta chiusa è cosi...
http://i59.tinypic.com/2w1zdro.jpg
,
-
Cioe ti serve tipo un Pop Up ? non ho ben capito...
-
scusami mi sono espresso male, parlo dell'eroe....
-
Diamond si è unito al Progetto, ovviamente se qualcun'altro vuole unirsi è il benvenuto...di qualsiasi livello ovvio.... :) Per info contattatemi in privato ty ...

Linguaggio necessario x sviluppatore?
in Parlando del Making...
Posted