Firestalker5
Member
Code:
#------------------------------------------------------------------------------
# Training by Claimh
#==============================================================================
module Training
#==============================================================================
# â–¡ Customizing START
#==============================================================================
# StateID
TR_STATE = 17
# EXP(%)Increase
TR_PAR = 100
#==============================================================================
# â–¡ Customizing END
#==============================================================================
end
class Scene_Battle
#--------------------------------------------------------------------------
# ◠アフターãƒãƒˆãƒ«ãƒ•ã‚§ãƒ¼ã‚ºé–‹å§‹
#--------------------------------------------------------------------------
alias start_phase5_trainig start_phase5
def start_phase5
# EXPã‚’åˆæœŸåŒ–
exp = 0
# ループ
for enemy in $game_troop.enemies
# エãƒãƒŸãƒ¼ãŒéš れ状態ã§ãªã„å ´åˆ
unless enemy.hidden
# ç²å¾— EXPã€ã‚´ãƒ¼ãƒ«ãƒ‰ã‚’追åŠ
exp += enemy.exp
end
end
# EXP ç²å¾—
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor.cant_get_exp? == false and actor.states.include?(Training::TR_STATE)
last_level = actor.level
actor.exp += (exp * Training::TR_PAR / 100).truncate
if actor.level > last_level
@status_window.level_up(i)
end
end
end
start_phase5_trainig
end
end
Code:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ â—† リザルト画é¢ï¼’è¿½åŠ ã‚¹ã‚¯ãƒªãƒ—ãƒˆã€Œæˆ¦åˆ©å“〠- KGC_RS2[Rewards] â—†
#_/ â—‡ Last update : 2007/03/16 â—‡
#_/----------------------------------------------------------------------------
#_/ ≪リザルト画é¢ï¼’≫用ã®æˆ¦åˆ©å“確èªç”»é¢ã§ã™ã€‚
#_/ ç”»é¢ã‚³ãƒ¼ãƒ‰ : "KGC[Rewards]"
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#==============================================================================
# ★ ã‚«ã‚¹ã‚¿ãƒžã‚¤ã‚ºé …ç›® ★
#==============================================================================
module KGC
module RS2_Rewards
# ◆レベルアップ画åƒ
# "Graphics/Pictures" ã‹ã‚‰èªã¿è¾¼ã‚€ã€‚
LVUP_IMAGE = "Level_up"
# ◆スã‚ル習得画åƒ
NEWSKILL_IMAGE = "New_skill"
# ◆レベルアップ SE
LVUP_SE = RPG::AudioFile.new("116-Raise02")
# ◆レベルアップ時ã€çµŒé¨“値ã®ä»£ã‚ã‚Šã«è¡¨ç¤ºã™ã‚‹ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸
LVUP_MSG = "LEVEL UP!"
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
# â—‹ç”»é¢ã‚³ãƒ¼ãƒ‰å®šç¾©
module KGC::ResultScene2
SCENE_CODE["KGC[Rewards]"] = Proc.new { Scene_RS2_Rewards.new }
end
#==============================================================================
# â– Sprite_RewardPartyIcon
#==============================================================================
class Sprite_RewardPartyIcon < Sprite
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
# viewport : ビューãƒãƒ¼ãƒˆ
# filename : ç”»åƒãƒ•ã‚¡ã‚¤ãƒ«å
#--------------------------------------------------------------------------
def initialize(viewport = nil, filename = "")
super(viewport)
self.bitmap = RPG::Cache.picture(filename)
# 原点をä¸å¤®ã«ã™ã‚‹
self.ox = self.bitmap.width >> 1
self.oy = self.bitmap.height >> 1
self.zoom_x = self.zoom_y = 3.0
self.opacity = 150
self.color.set(255, 255, 255)
@duration = 80
end
#--------------------------------------------------------------------------
# ◠解放
#--------------------------------------------------------------------------
def dispose
if self.bitmap != nil
self.bitmap.dispose
end
super
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
def update
super
# アニメーション
if @duration > 0
@duration -= 1
case @duration
when 60..79 # 出ç¾
self.zoom_x = self.zoom_y = 1.0 + (@duration - 60) / 10.0
self.opacity = 255 - (@duration - 60) * 13
when 40..59
self.color.set(255, 255, 255, (@duration - 40) * 13)
when 0..19 # 消去
self.opacity = @duration * 13
end
if @duration == 0
self.visible = false
end
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# â– Window_BattleResult
#==============================================================================
class Window_BattleResult < Window_Base
#--------------------------------------------------------------------------
# ◠公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :exp # ç²å¾—経験値
attr_reader :gold # ç²å¾—金é¡
attr_reader :treasures # 戦利å“
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# â– Window_RS2_Rewards_Result
#------------------------------------------------------------------------------
# 戦闘çµæžœã‚’表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Window_RS2_Rewards_Result < Window_Base
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
@exp = $game_temp.battle_exp
@gold = $game_temp.battle_gold
@bp = $game_temp.battle_bp
@ap = $game_temp.battle_ap
super(0, 0, 320, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.z = 10000
self.contents.font.name = ["Mercurius Script MT Bold", Font.default_name]
self.contents.font.size = 20
self.contents.font.bold = true
self.contents.font.italic = true
refresh
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = text_color(3)
self.contents.font.size = 25
self.contents.draw_frame_text(4, 32, 256, 48, "Victory!", 1)
self.contents.font.size = 20
self.contents.font.color = normal_color
self.contents.draw_frame_text(4, 80, 160, 48, @exp.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_frame_text(176, 80, 96, 48, "EXP")
self.contents.font.color = normal_color
self.contents.draw_frame_text(4, 112, 160, 48, @gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_frame_text(176, 112, 96, 48, $data_system.words.gold)
if $imported["SkillCPSystem"]
self.contents.font.color = normal_color
self.contents.draw_frame_text(4, 160, 160, 48, @bp.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_frame_text(176, 160, 96, 48, KGC::BP_NAME)
end
if $imported["EquipLearnSkill"]
self.contents.font.color = normal_color
self.contents.draw_frame_text(4, 192, 160, 48, @ap.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_frame_text(176, 192, 96, 48, "AP")
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# â– Window_RS2_Rewards_Treasure
#------------------------------------------------------------------------------
# 戦利å“を表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Window_RS2_Rewards_Treasure < Window_Base
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
@treasures = $game_temp.battle_treasures
super(320, 0, 320, @treasures.size * 32 + 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 255
self.z = 10010
refresh
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_shadow_text(0, 0, 288, 32, "You Recieved:", 1)
@treasures.each_with_index { |item, i|
draw_item_name(item, 4, i * 32 + 32)
}
end
#--------------------------------------------------------------------------
# ◠アイテムåã®æç”»
# item : アイテãƒ
# x : æ画先 X 座標
# y : æ画先 Y 座標
#--------------------------------------------------------------------------
def draw_item_name(item, x, y)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_shadow_text(x + 28, y, 212, 32, item.name)
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# â– Window_RS2_Rewards_Party
#------------------------------------------------------------------------------
# パーティメンãƒãƒ¼ã‚’表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Window_RS2_Rewards_Party < Window_Base
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
@actors = $game_party.actors
@level_up_sprites = []
@new_skill_sprites = []
super(320, 0, 320, @actors.size * 64 + 32)
self.y = (480 - self.height) >> 1
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 255
self.z = 10000
refresh
end
#--------------------------------------------------------------------------
# â— ç ´æ£„
#--------------------------------------------------------------------------
def dispose
# ã‚¹ãƒ—ãƒ©ã‚¤ãƒˆã‚’ç ´æ£„
(@level_up_sprites + @new_skill_sprites).each { |s|
s.bitmap.dispose unless s.bitmap.disposed?
s.dispose
}
super
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
level_up_flag = false
new_skill_flag = false
self.contents.clear
@actors.each_with_index { |actor, i|
dy = i * 64
# パラメータをæç”»
self.contents.font.color = normal_color
draw_actor_name(actor, 4, dy)
draw_actor_level(actor, 128, dy)
# レベルアップã—ãŸå ´åˆ
if actor.level > $game_temp.actor_last_level[actor.id]
self.contents.font.color = text_color(6)
self.contents.draw_shadow_text(4, dy + 32, 288, 32,
KGC::RS2_Rewards::LVUP_MSG)
# レベルアップスプライトを作æˆ
sp = Sprite_RewardPartyIcon.new(nil, KGC::RS2_Rewards::LVUP_IMAGE)
sp.x = self.x + sp.ox + 16
sp.y = self.y + sp.oy + dy + 16
sp.z = 11000
@level_up_sprites << sp
level_up_flag = true
actor.recover_all
# レベルアップã—ã¦ã„ãªã„å ´åˆ
else
self.contents.font.color = system_color
self.contents.draw_shadow_text( 4, dy + 32, 64, 32, "NEXT LEVEL:")
self.contents.font.color = normal_color
self.contents.draw_shadow_text(80, dy + 32, 96, 32,
actor.next_rest_exp_s, 2)
end
# æ–°ã—ã„スã‚ルを習得ã—ãŸå ´åˆ
skills = ($imported["EquipLearnSkill"] || $imported["SkillCPSystem"]) ?
actor.learned_skills : actor.skills
if (skills - $game_temp.actor_last_skills[actor.id]).size > 0
# スã‚ル習得スプライトを作æˆ
sp = Sprite_RewardPartyIcon.new(nil, KGC::RS2_Rewards::NEWSKILL_IMAGE)
sp.x = self.x + sp.ox + 16
sp.y = self.y + sp.oy + dy + 48
sp.z = 11000
@new_skill_sprites << sp
new_skill_flag = true
end
}
# レベルアップ SE ã‚’æ¼”å¥
if level_up_flag || new_skill_flag
$game_system.se_play(KGC::RS2_Rewards::LVUP_SE)
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
def update
super
# スプライトを更新
(@level_up_sprites + @new_skill_sprites).each { |s|
s.update
}
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# â– Scene_RS2_Rewards
#------------------------------------------------------------------------------
# 戦利å“ç²å¾—ç”»é¢ã‚’制御ã™ã‚‹ã‚¯ãƒ©ã‚¹ã§ã™ã€‚
#==============================================================================
class Scene_RS2_Rewards < Scene_RS2
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super # ↠入れã¦ãŠã„ãŸæ–¹ãŒã€å¾Œã‹ã‚‰æ©Ÿèƒ½ã‚’è¿½åŠ ã™ã‚‹ã¨ãã«ä¾¿åˆ©ã€‚
@phase = 1
@treasures = $game_temp.battle_treasures
# ウィンドウを作æˆ
@result_window = Window_RS2_Rewards_Result.new
@treasure_window = Window_RS2_Rewards_Treasure.new
@treasure_window.opacity = @treasure_window.contents_opacity = 255
@party_window = Window_RS2_Rewards_Party.new
end
#--------------------------------------------------------------------------
# â— ç ´æ£„
#--------------------------------------------------------------------------
def dispose
super
# ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’ç ´æ£„
@result_window.dispose
@treasure_window.dispose
@party_window.dispose
end
#--------------------------------------------------------------------------
# â— æ›´æ–°
#--------------------------------------------------------------------------
def update
super
@result_window.update
@treasure_window.update
@party_window.update
case @phase
when 1
update_phase1
when 2
update_phase2
else
exit_scene
end
end
#--------------------------------------------------------------------------
# ◠フェーズ 1 更新
#--------------------------------------------------------------------------
def update_phase1
# C ボタンãŒæŠ¼ã•ã‚ŒãŸã‚‰æ¬¡ã®ãƒ•ã‚§ãƒ¼ã‚ºã¸
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
if @treasures.size > 0
@phase = 2
else
exit_scene
end
return
end
end
#--------------------------------------------------------------------------
# ◠フェーズ 2 更新
#--------------------------------------------------------------------------
def update_phase2
# C ボタンãŒæŠ¼ã•ã‚ŒãŸã‚‰çµ‚了
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
exit_scene
return
end
# 戦利å“ウィンドウをフェードイン
if @treasure_window.opacity < 255
@treasure_window.opacity += 16
@treasure_window.contents_opacity += 16
end
end
end
I would like so that when the above state is inflicted the EXP shows the end result.
Training by Claimh allows you to inlflict a state that will muliply the obtained exp by an integer you assign.
Battle_Trophey by KGC simply shows the amount of EXP gained from battle, but won;t show the multiplied amount when the state inflicted.
If someone can help thank you.