Project1
标题: 在地图上升级怎么提示? [打印本页]
作者: 18925880845 时间: 2014-7-9 17:45
标题: 在地图上升级怎么提示?
#===============================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#===============================================================
# ———————————————————————————
# ▼▲▼ XRXS_BP10. LEVEL UP!能力上昇表示ウィンドウ plus ▼▲▼
# by 桜雅 在土
#——以下3个如果需要修改,直接输入文件名即可
$data_system_level_up_se = "Audio/SE/sj" #升级时的音效设置
$data_system_level_up_me = "" # 升级时播放的ME
$data_system_skilllearn_se = "Audio/SE/jn" # 学会特技时播放的声效。
#=============================================================
# ■ Window_LevelUpWindow
#-------------------------------------------------------------------
# バトル終了時、レベルアップした場合にステータスを表示するウィンドウです。
#=============================================================
class Window_LevelUpWindow < Window_Base
#---------------------------------------------------------
# ● オブジェクト初期化
#------------------------------------------------------
def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
super(0, 128, 160, 192)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.back_opacity = 160
refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
end
#-----------------------------------------------------------
# ● リフレッシュ
#---------------------------------------------------------
def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
self.contents.clear
self.contents.font.color = system_color
self.contents.font.size = 14
self.contents.draw_text( 0, 0, 160, 24, "升级啦!!")
self.contents.font.size = 18
self.contents.draw_text( 0, 28, 160, 24, $data_system.words.hp)
self.contents.draw_text( 0, 50, 160, 24, $data_system.words.sp)
self.contents.font.size = 14
self.contents.draw_text( 0, 72, 80, 24, $data_system.words.str)
self.contents.draw_text( 0, 94, 80, 24, $data_system.words.dex)
self.contents.draw_text( 0, 116, 80, 24, $data_system.words.agi)
self.contents.draw_text( 0, 138, 80, 24, $data_system.words.int)
self.contents.draw_text(92, 0, 128, 24, "→")
self.contents.draw_text(76, 28, 128, 24, "=")
self.contents.draw_text(76, 50, 128, 24, "=")
self.contents.draw_text(76, 72, 128, 24, "=")
self.contents.draw_text(76, 94, 128, 24, "=")
self.contents.draw_text(76, 116, 128, 24, "=")
self.contents.draw_text(76, 138, 128, 24, "=")
self.contents.font.color = normal_color
self.contents.draw_text( 0, 0, 88, 24, last_lv.to_s, 2)
self.contents.draw_text( 0, 28, 72, 24, "+" + up_hp.to_s, 2)
self.contents.draw_text( 0, 50, 72, 24, "+" + up_sp.to_s, 2)
self.contents.draw_text( 0, 72, 72, 24, "+" + up_str.to_s, 2)
self.contents.draw_text( 0, 94, 72, 24, "+" + up_dex.to_s, 2)
self.contents.draw_text( 0, 116, 72, 24, "+" + up_agi.to_s, 2)
self.contents.draw_text( 0, 138, 72, 24, "+" + up_int.to_s, 2)
self.contents.font.size = 20
self.contents.draw_text( 0, 0, 128, 24, actor.level.to_s, 2)
self.contents.draw_text( 0, 26, 128, 24, actor.maxhp.to_s, 2)
self.contents.draw_text( 0, 48, 128, 24, actor.maxsp.to_s, 2)
self.contents.draw_text( 0, 70, 128, 24, actor.str.to_s, 2)
self.contents.draw_text( 0, 92, 128, 24, actor.dex.to_s, 2)
self.contents.draw_text( 0, 114, 128, 24, actor.agi.to_s, 2)
self.contents.draw_text( 0, 136, 128, 24, actor.int.to_s, 2)
end
end
#===========================================================
# ■ Window_SkillLearning
#------------------------------------------------------------------------------
# レベルアップ時などにスキルを習得した場合にそれを表示するウィンドウです。
#=============================================================
class Window_SkillLearning < Window_Base
#-------------------------------------------------------------
# ● 公開インスタンス変数
#-----------------------------------------------------------
attr_reader :learned # スキルを習得したかどうか
#----------------------------------------------------------
# ● オブジェクト初期化
#----------------------------------------------------------
def initialize(class_id, last_lv, now_lv)
super(160, 64, 320, 64)
self.contents = Bitmap.new(width - 32, height - 28) # わざと▽を表示
self.visible = false
self.back_opacity = 160
@learned = false
refresh(class_id, last_lv, now_lv)
end
#------------------------------------------------------------
# ● リフレッシュ
#-------------------------------------------------------
def refresh(class_id, last_lv, now_lv)
for i in 0...$data_classes[class_id].learnings.size
learn_lv = $data_classes[class_id].learnings[i].level
# 今回のレベルアップ範囲で習得するスキルの場合
if learn_lv > last_lv and learn_lv <= now_lv
@learned = true
# SEの再生
if $data_system_skilllearn_se != ""
Audio.se_play($data_system_skilllearn_se)
end
# 各描写
skill_name = $data_skills[$data_classes[class_id].learnings[i].skill_id].name
self.contents.clear
self.contents.font.color = text_color(0)
self.contents.draw_text(0,0,448,32, "学会法术:"+skill_name)
self.contents.font.color = text_color(6)
self.contents.draw_text(0,0,448,32, " "+skill_name)
self.contents.font.color = text_color(0)
self.visible = true
# メインループ
loop do
# ゲーム画面を更新
Graphics.update
# 入力情報を更新
Input.update
# フレーム更新
update
# 画面が切り替わったらループを中断
if @learned == false
break
end
end
# メインループここまで
end
end
end
#-----------------------------------------------------------
# ● フレーム更新
#------------------------------------------------------------
def update
# C ボタンが押された場合
if Input.trigger?(Input::C)
@learned = false
self.visible = false
end
end
end
#===============================================================
# ■ Game_Battler
#===============================================================
class Game_Battler
#--------------------------------------------------------------
# ● 追加?公開インスタンス変数
#----------------------------------------------------------
attr_accessor :exp_gain_ban # EXP取得一時禁止
#------------------------------------------------------
# ● オブジェクト初期化
#-----------------------------------------------------
alias xrxs_bp10_initialize initialize
def initialize
@exp_gain_ban = false
xrxs_bp10_initialize
end
#-------------------------------------------------------
# ● ステート [EXP を獲得できない] 判定
#-----------------------------------------------------
alias xrxs_bp10_cant_get_exp? cant_get_exp?
def cant_get_exp?
if @exp_gain_ban == true
return true
else
return xrxs_bp10_cant_get_exp?
end
end
end
#==============================================================
# ■ Scene_Battle
#==============================================================
class Scene_Battle
#--------------------------------------------------
# ● アフターバトルフェーズ開始
#--------------------------------------------------
alias xrxs_bp10_start_phase5 start_phase5
def start_phase5
# EXP 獲得禁止
for i in 0...$game_party.actors.size
$game_party.actors[i].exp_gain_ban = true
end
xrxs_bp10_start_phase5
# EXP 獲得禁止の解除
for i in 0...$game_party.actors.size
$game_party.actors[i].exp_gain_ban = false
end
# EXPを初期化
@exp_gained = 0
for enemy in $game_troop.enemies
# 獲得 EXPを追加 # エネミーが隠れ状態でない場合
@exp_gained += enemy.exp if not enemy.hidden
end
# 設定
@phase5_step = 1
@exp_gain_actor = -1
# リザルトウィンドウを表示
@result_window.visible = true
end
#----------------------------------------------------------
# ● フレーム更新 (アフターバトルフェーズ)
#--------------------------------------------------------
#alias xrxs_bp10_update_phase5 update_phase5
def update_phase5
case @phase5_step
when 1
update_phase5_step1
else
# ウェイトカウントが 0 より大きい場合
if @phase5_wait_count > 0
# ウェイトカウントを減らす
@phase5_wait_count -= 1
# ウェイトカウントが 0 になった場合
if @phase5_wait_count == 0
# リザルトウィンドウを表示
#@result_window.visible = true
# メインフェーズフラグをクリア
$game_temp.battle_main_phase = false
# ステータスウィンドウをリフレッシュ
@status_window.refresh
end
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# バトル終了
battle_end(0)
end
# レベルアップしている場合は強制バトル終了
battle_end(0) if @levelup_window != nil and @phase5_wait_count <= 0
end
end
#-----------------------------------------------------------
# ● フレーム更新 (アフターバトルフェーズ 1 : レベルアップ)
#-----------------------------------------------------------
def update_phase5_step1
# C ボタンが押された場合
if Input.trigger?(Input::C)
# ウィンドウを閉じて次のアクターへ
@levelup_window.visible = false if @levelup_window != nil
@status_window.level_up_flags[@exp_gain_actor] = false
phase5_next_levelup
end
end
#---------------------------------------------------------
# ● 次のアクターのレベルアップ表示へ
#---------------------------------------------------------
def phase5_next_levelup
begin
# 次のアクターへ
@exp_gain_actor += 1
# 最後のアクターの場合
if @exp_gain_actor >= $game_party.actors.size
# アフターバトルフェーズ開始
@phase5_step = 0
return
end
actor = $game_party.actors[@exp_gain_actor]
if actor.cant_get_exp? == false
# 現在の能力値を保持
last_level = actor.level
last_maxhp = actor.maxhp
last_maxsp = actor.maxsp
last_str = actor.str
last_dex = actor.dex
last_agi = actor.agi
last_int = actor.int
# 経験値取得の決定的瞬間(謎
actor.exp += @exp_gained
# 判定
if actor.level > last_level
# レベルアップした場合
actor.hp = actor.maxhp; actor.sp = actor.maxsp
@status_window.level_up(@exp_gain_actor)
# リザルトウィンドウを消す
@result_window.visible = false
# SEの再生
if $data_system_level_up_se != ""
Audio.se_play($data_system_level_up_se)
end
# MEの再生
if $data_system_level_up_me != ""
Audio.me_stop
Audio.me_play($data_system_level_up_me)
end
# LEVEL-UPウィンドウの設定
@levelup_window = Window_LevelUpWindow.new(actor, last_level,
actor.maxhp - last_maxhp, actor.maxsp - last_maxsp, actor.str - last_str,
actor.dex - last_dex, actor.agi - last_agi, actor.int - last_int)
@levelup_window.x = 160 * @exp_gain_actor
@levelup_window.visible = true
# ステータスウィンドウをリフレッシュ
@status_window.refresh
# スキル習得ウィンドウの設定
@skilllearning_window = Window_SkillLearning.new(actor.class_id, last_level, actor.level)
# ウェイトカウントを設定
@phase5_wait_count = 40
@phase5_step = 1
return
end
end
end until false
end
end
#=============================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#=============================================================
#===============================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#===============================================================
# ———————————————————————————
# ▼▲▼ XRXS_BP10. LEVEL UP!能力上昇表示ウィンドウ plus ▼▲▼
# by 桜雅 在土
#——以下3个如果需要修改,直接输入文件名即可
$data_system_level_up_se = "Audio/SE/sj" #升级时的音效设置
$data_system_level_up_me = "" # 升级时播放的ME
$data_system_skilllearn_se = "Audio/SE/jn" # 学会特技时播放的声效。
#=============================================================
# ■ Window_LevelUpWindow
#-------------------------------------------------------------------
# バトル終了時、レベルアップした場合にステータスを表示するウィンドウです。
#=============================================================
class Window_LevelUpWindow < Window_Base
#---------------------------------------------------------
# ● オブジェクト初期化
#------------------------------------------------------
def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
super(0, 128, 160, 192)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.back_opacity = 160
refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
end
#-----------------------------------------------------------
# ● リフレッシュ
#---------------------------------------------------------
def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
self.contents.clear
self.contents.font.color = system_color
self.contents.font.size = 14
self.contents.draw_text( 0, 0, 160, 24, "升级啦!!")
self.contents.font.size = 18
self.contents.draw_text( 0, 28, 160, 24, $data_system.words.hp)
self.contents.draw_text( 0, 50, 160, 24, $data_system.words.sp)
self.contents.font.size = 14
self.contents.draw_text( 0, 72, 80, 24, $data_system.words.str)
self.contents.draw_text( 0, 94, 80, 24, $data_system.words.dex)
self.contents.draw_text( 0, 116, 80, 24, $data_system.words.agi)
self.contents.draw_text( 0, 138, 80, 24, $data_system.words.int)
self.contents.draw_text(92, 0, 128, 24, "→")
self.contents.draw_text(76, 28, 128, 24, "=")
self.contents.draw_text(76, 50, 128, 24, "=")
self.contents.draw_text(76, 72, 128, 24, "=")
self.contents.draw_text(76, 94, 128, 24, "=")
self.contents.draw_text(76, 116, 128, 24, "=")
self.contents.draw_text(76, 138, 128, 24, "=")
self.contents.font.color = normal_color
self.contents.draw_text( 0, 0, 88, 24, last_lv.to_s, 2)
self.contents.draw_text( 0, 28, 72, 24, "+" + up_hp.to_s, 2)
self.contents.draw_text( 0, 50, 72, 24, "+" + up_sp.to_s, 2)
self.contents.draw_text( 0, 72, 72, 24, "+" + up_str.to_s, 2)
self.contents.draw_text( 0, 94, 72, 24, "+" + up_dex.to_s, 2)
self.contents.draw_text( 0, 116, 72, 24, "+" + up_agi.to_s, 2)
self.contents.draw_text( 0, 138, 72, 24, "+" + up_int.to_s, 2)
self.contents.font.size = 20
self.contents.draw_text( 0, 0, 128, 24, actor.level.to_s, 2)
self.contents.draw_text( 0, 26, 128, 24, actor.maxhp.to_s, 2)
self.contents.draw_text( 0, 48, 128, 24, actor.maxsp.to_s, 2)
self.contents.draw_text( 0, 70, 128, 24, actor.str.to_s, 2)
self.contents.draw_text( 0, 92, 128, 24, actor.dex.to_s, 2)
self.contents.draw_text( 0, 114, 128, 24, actor.agi.to_s, 2)
self.contents.draw_text( 0, 136, 128, 24, actor.int.to_s, 2)
end
end
#===========================================================
# ■ Window_SkillLearning
#------------------------------------------------------------------------------
# レベルアップ時などにスキルを習得した場合にそれを表示するウィンドウです。
#=============================================================
class Window_SkillLearning < Window_Base
#-------------------------------------------------------------
# ● 公開インスタンス変数
#-----------------------------------------------------------
attr_reader :learned # スキルを習得したかどうか
#----------------------------------------------------------
# ● オブジェクト初期化
#----------------------------------------------------------
def initialize(class_id, last_lv, now_lv)
super(160, 64, 320, 64)
self.contents = Bitmap.new(width - 32, height - 28) # わざと▽を表示
self.visible = false
self.back_opacity = 160
@learned = false
refresh(class_id, last_lv, now_lv)
end
#------------------------------------------------------------
# ● リフレッシュ
#-------------------------------------------------------
def refresh(class_id, last_lv, now_lv)
for i in 0...$data_classes[class_id].learnings.size
learn_lv = $data_classes[class_id].learnings[i].level
# 今回のレベルアップ範囲で習得するスキルの場合
if learn_lv > last_lv and learn_lv <= now_lv
@learned = true
# SEの再生
if $data_system_skilllearn_se != ""
Audio.se_play($data_system_skilllearn_se)
end
# 各描写
skill_name = $data_skills[$data_classes[class_id].learnings[i].skill_id].name
self.contents.clear
self.contents.font.color = text_color(0)
self.contents.draw_text(0,0,448,32, "学会法术:"+skill_name)
self.contents.font.color = text_color(6)
self.contents.draw_text(0,0,448,32, " "+skill_name)
self.contents.font.color = text_color(0)
self.visible = true
# メインループ
loop do
# ゲーム画面を更新
Graphics.update
# 入力情報を更新
Input.update
# フレーム更新
update
# 画面が切り替わったらループを中断
if @learned == false
break
end
end
# メインループここまで
end
end
end
#-----------------------------------------------------------
# ● フレーム更新
#------------------------------------------------------------
def update
# C ボタンが押された場合
if Input.trigger?(Input::C)
@learned = false
self.visible = false
end
end
end
#===============================================================
# ■ Game_Battler
#===============================================================
class Game_Battler
#--------------------------------------------------------------
# ● 追加?公開インスタンス変数
#----------------------------------------------------------
attr_accessor :exp_gain_ban # EXP取得一時禁止
#------------------------------------------------------
# ● オブジェクト初期化
#-----------------------------------------------------
alias xrxs_bp10_initialize initialize
def initialize
@exp_gain_ban = false
xrxs_bp10_initialize
end
#-------------------------------------------------------
# ● ステート [EXP を獲得できない] 判定
#-----------------------------------------------------
alias xrxs_bp10_cant_get_exp? cant_get_exp?
def cant_get_exp?
if @exp_gain_ban == true
return true
else
return xrxs_bp10_cant_get_exp?
end
end
end
#==============================================================
# ■ Scene_Battle
#==============================================================
class Scene_Battle
#--------------------------------------------------
# ● アフターバトルフェーズ開始
#--------------------------------------------------
alias xrxs_bp10_start_phase5 start_phase5
def start_phase5
# EXP 獲得禁止
for i in 0...$game_party.actors.size
$game_party.actors[i].exp_gain_ban = true
end
xrxs_bp10_start_phase5
# EXP 獲得禁止の解除
for i in 0...$game_party.actors.size
$game_party.actors[i].exp_gain_ban = false
end
# EXPを初期化
@exp_gained = 0
for enemy in $game_troop.enemies
# 獲得 EXPを追加 # エネミーが隠れ状態でない場合
@exp_gained += enemy.exp if not enemy.hidden
end
# 設定
@phase5_step = 1
@exp_gain_actor = -1
# リザルトウィンドウを表示
@result_window.visible = true
end
#----------------------------------------------------------
# ● フレーム更新 (アフターバトルフェーズ)
#--------------------------------------------------------
#alias xrxs_bp10_update_phase5 update_phase5
def update_phase5
case @phase5_step
when 1
update_phase5_step1
else
# ウェイトカウントが 0 より大きい場合
if @phase5_wait_count > 0
# ウェイトカウントを減らす
@phase5_wait_count -= 1
# ウェイトカウントが 0 になった場合
if @phase5_wait_count == 0
# リザルトウィンドウを表示
#@result_window.visible = true
# メインフェーズフラグをクリア
$game_temp.battle_main_phase = false
# ステータスウィンドウをリフレッシュ
@status_window.refresh
end
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# バトル終了
battle_end(0)
end
# レベルアップしている場合は強制バトル終了
battle_end(0) if @levelup_window != nil and @phase5_wait_count <= 0
end
end
#-----------------------------------------------------------
# ● フレーム更新 (アフターバトルフェーズ 1 : レベルアップ)
#-----------------------------------------------------------
def update_phase5_step1
# C ボタンが押された場合
if Input.trigger?(Input::C)
# ウィンドウを閉じて次のアクターへ
@levelup_window.visible = false if @levelup_window != nil
@status_window.level_up_flags[@exp_gain_actor] = false
phase5_next_levelup
end
end
#---------------------------------------------------------
# ● 次のアクターのレベルアップ表示へ
#---------------------------------------------------------
def phase5_next_levelup
begin
# 次のアクターへ
@exp_gain_actor += 1
# 最後のアクターの場合
if @exp_gain_actor >= $game_party.actors.size
# アフターバトルフェーズ開始
@phase5_step = 0
return
end
actor = $game_party.actors[@exp_gain_actor]
if actor.cant_get_exp? == false
# 現在の能力値を保持
last_level = actor.level
last_maxhp = actor.maxhp
last_maxsp = actor.maxsp
last_str = actor.str
last_dex = actor.dex
last_agi = actor.agi
last_int = actor.int
# 経験値取得の決定的瞬間(謎
actor.exp += @exp_gained
# 判定
if actor.level > last_level
# レベルアップした場合
actor.hp = actor.maxhp; actor.sp = actor.maxsp
@status_window.level_up(@exp_gain_actor)
# リザルトウィンドウを消す
@result_window.visible = false
# SEの再生
if $data_system_level_up_se != ""
Audio.se_play($data_system_level_up_se)
end
# MEの再生
if $data_system_level_up_me != ""
Audio.me_stop
Audio.me_play($data_system_level_up_me)
end
# LEVEL-UPウィンドウの設定
@levelup_window = Window_LevelUpWindow.new(actor, last_level,
actor.maxhp - last_maxhp, actor.maxsp - last_maxsp, actor.str - last_str,
actor.dex - last_dex, actor.agi - last_agi, actor.int - last_int)
@levelup_window.x = 160 * @exp_gain_actor
@levelup_window.visible = true
# ステータスウィンドウをリフレッシュ
@status_window.refresh
# スキル習得ウィンドウの設定
@skilllearning_window = Window_SkillLearning.new(actor.class_id, last_level, actor.level)
# ウェイトカウントを設定
@phase5_wait_count = 40
@phase5_step = 1
return
end
end
end until false
end
end
#=============================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#=============================================================
这个升级提示就是只能在战斗中升级有提示,但是如果你在地图上给角色加经验升级,就没提示了。我想了好久都不知道怎么改,求大神。
作者: RyanBern 时间: 2014-7-9 17:49
本帖最后由 RyanBern 于 2014-7-9 17:52 编辑
用这个代码吧,好像是LZ那个代码的升级版。
抱歉,好像这个脚本我自己改过,LZ拿去试试,有问题的话通知我。
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#==============================================================================
# 泛用型升级提示 v1.1
#
# 核心部分 By 叶子
# 窗口部分 原作者:桜雅 在土 修改:叶子
#
# Date: 2-12-2006 -v1.0
# 3-2-2006 -v1.1
#==============================================================================
#
# 在对话时,调用“增加EXP”或“增减等级”指令前,请等待3帧以上,否则对话框来不及消失。
#
# 当打开此号数的开关的时候,等级上升将不会提示,比如默认打开45号开关,等级上升不再提示
$不显示升级窗口 = 88
#==============================================================================
class Game_Actor
#--------------------------------------------------------------------------
# ● 更改 EXP
# exp : 新的 EXP
#--------------------------------------------------------------------------
def exp=(exp)
# 记录旧等级
last_level = @level
@exp = [[exp, 9999999].min, 0].max
# 升级
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
if $game_switches[79] == false
@hp = maxhp
@sp = maxsp
end
# 学会特技
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
# 降级
while @exp < @exp_list[@level]
@level -= 1
end
# 修正当前的 HP 与 SP 超过最大值
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
# 升级了的话,升级显示处理
if @level > last_level and $game_switches[$不显示升级窗口] == false and
not $BTEST
show_level_up_result(last_level)
end
end
#--------------------------------------------------------------------------
# ● 升级显示处理
#--------------------------------------------------------------------------
def show_level_up_result(last_level)
actor_parameters = self.last_parameters(last_level)
last_maxhp = actor_parameters[0]
last_maxsp = actor_parameters[1]
last_str = actor_parameters[2]
last_dex = actor_parameters[3]
last_agi = actor_parameters[4]
last_int = actor_parameters[5]
level_up_window = Window_LevelUpWindow_A.new self,last_level,last_maxhp,
last_maxsp,last_str,last_dex,last_agi,last_int
level_up_window.visible = true
skill_learning_window = Window_SkillLearning_A.new(@class_id,
last_level, @level)
# 循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 按下C就关闭窗口
if Input.trigger?(Input::C)
unless skill_learning_window.refresh
level_up_window.dispose
skill_learning_window.dispose
return true
end
end
end
end
#--------------------------------------------------------------------------
# ● 一次取得全部旧属性
#--------------------------------------------------------------------------
def last_parameters(level)
#---------------------------
# maxhp
#---------------------------
n = [[$data_actors[@actor_id].parameters[0, level] + @maxhp_plus, 1].max, 9999].min
for i in @states
n *= $data_states[i].maxhp_rate / 100.0
end
n = [[Integer(n), 1].max, 9999].min
maxhp = n
#---------------------------
# maxsp
#---------------------------
n = [[$data_actors[@actor_id].parameters[1, level] + @maxsp_plus, 0].max, 9999].min
for i in @states
n *= $data_states[i].maxsp_rate / 100.0
end
n = [[Integer(n), 0].max, 9999].min
maxsp = n
#---------------------------
# str
#---------------------------
n = $data_actors[@actor_id].parameters[2, level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.str_plus : 0
n += armor1 != nil ? armor1.str_plus : 0
n += armor2 != nil ? armor2.str_plus : 0
n += armor3 != nil ? armor3.str_plus : 0
n += armor4 != nil ? armor4.str_plus : 0
n = [[n + @str_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].str_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
str = n
#---------------------------
# dex
#---------------------------
n = $data_actors[@actor_id].parameters[3, level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.dex_plus : 0
n += armor1 != nil ? armor1.dex_plus : 0
n += armor2 != nil ? armor2.dex_plus : 0
n += armor3 != nil ? armor3.dex_plus : 0
n += armor4 != nil ? armor4.dex_plus : 0
n = [[n + @dex_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].dex_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
dex = n
#---------------------------
# agi
#---------------------------
n = $data_actors[@actor_id].parameters[4, level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.agi_plus : 0
n += armor1 != nil ? armor1.agi_plus : 0
n += armor2 != nil ? armor2.agi_plus : 0
n += armor3 != nil ? armor3.agi_plus : 0
n += armor4 != nil ? armor4.agi_plus : 0
n = [[n + @agi_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].agi_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
agi = n
#---------------------------
# int
#---------------------------
n = $data_actors[@actor_id].parameters[5, level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.int_plus : 0
n += armor1 != nil ? armor1.int_plus : 0
n += armor2 != nil ? armor2.int_plus : 0
n += armor3 != nil ? armor3.int_plus : 0
n += armor4 != nil ? armor4.int_plus : 0
n = [[n + @int_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].int_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
int = n
return [maxhp, maxsp, str, dex, agi, int]
end
end
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
# ————————————————————————————————————
# ▼▲▼ XRXS_BP10. LEVEL UP!能力上昇表示ウィンドウ plus ▼▲▼
# by 桜雅 在土
#——以下3个如果需要修改,直接输入文件名即可
$data_system_level_up_se = "" #升级时的音效设置
$data_system_level_up_me = "Audio/ME/升级" # 升级时播放的ME
$data_system_skilllearn_se = "Audio/SE/105-Heal01" # 学会特技时播放的声效。
#==============================================================================
# ■ Window_LevelUpWindow
#------------------------------------------------------------------------------
# バトル終了時、レベルアップした場合にステータスを表示するウィンドウです。
#==============================================================================
class Window_LevelUpWindow_A < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
super(210, 100, 220, 222)
self.windowskin = RPG::Cache.windowskin("skin1")
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.back_opacity = 160
# 防止被对话框遮住
self.z = 9999
refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
# SEの再生
if $data_system_level_up_se != ""
Audio.se_play($data_system_level_up_se)
end
# MEの再生
if $data_system_level_up_me != ""
Audio.me_stop
Audio.me_play($data_system_level_up_me)
end
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
self.contents.clear
self.contents.font.color = system_color
self.contents.font.size = 20
self.contents.draw_text(0, 0, 160, 24, actor.name.to_s)
self.contents.font.color = system_color
self.contents.font.size = 18
self.contents.draw_text( 0, 26, 160, 24, "等级")
self.contents.font.size = 18
self.contents.draw_text( 0, 48, 80, 24, $data_system.words.hp)
self.contents.draw_text( 0, 70, 80, 24, $data_system.words.sp)
self.contents.draw_text( 0, 92, 80, 24, $data_system.words.str)
self.contents.draw_text( 0, 114, 80, 24, $data_system.words.dex)
self.contents.draw_text( 0, 136, 80, 24, $data_system.words.agi)
self.contents.draw_text( 0, 158, 80, 24, $data_system.words.int)
self.contents.draw_text(110, 26, 128, 24, "→")
self.contents.draw_text(110, 48, 128, 24, "→")
self.contents.draw_text(110, 70, 128, 24, "→")
self.contents.draw_text(110, 92, 128, 24, "→")
self.contents.draw_text(110, 114, 128, 24, "→")
self.contents.draw_text(110, 136, 128, 24, "→")
self.contents.draw_text(110, 158, 128, 24, "→")
self.contents.font.color = normal_color
self.contents.draw_text( 60, 26, 88, 24, last_lv.to_s)
self.contents.draw_text( 60, 48, 72, 24, up_hp.to_s)
self.contents.draw_text( 60, 70, 72, 24, up_sp.to_s)
self.contents.draw_text( 60, 92, 72, 24, up_str.to_s)
self.contents.draw_text( 60, 114, 72, 24, up_dex.to_s)
self.contents.draw_text( 60, 136, 72, 24, up_agi.to_s)
self.contents.draw_text( 60, 158, 72, 24, up_int.to_s)
self.contents.draw_text( 145, 26, 128, 24, actor.level.to_s)
self.contents.draw_text( 145, 48, 128, 24, actor.maxhp.to_s)
self.contents.draw_text( 145, 70, 128, 24, actor.maxsp.to_s)
self.contents.draw_text( 145, 92, 128, 24, actor.str.to_s)
self.contents.draw_text( 145, 114, 128, 24, actor.dex.to_s)
self.contents.draw_text( 145, 136, 128, 24, actor.agi.to_s)
self.contents.draw_text( 145, 158, 128, 24, actor.int.to_s)
end
end
#==============================================================================
# ■ Window_SkillLearning
#------------------------------------------------------------------------------
# レベルアップ時などにスキルを習得した場合にそれを表示するウィンドウです。
#==============================================================================
class Window_SkillLearning_A < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(class_id, last_lv, now_lv)
super(210, 322, 220, 56)
self.windowskin = RPG::Cache.windowskin("skin2")
self.contents = Bitmap.new(width - 32, height - 16) # わざと▽を表示
self.visible = false
self.back_opacity = 160
# 防止被对话框遮住
self.z = 9999
@learn_skills = []
for i in 0...$data_classes[class_id].learnings.size
learn_lv = $data_classes[class_id].learnings[i].level
# 今回のレベルアップ範囲で習得するスキルの場合
if learn_lv > last_lv and learn_lv <= now_lv
@learn_skills.push $data_skills[
$data_classes[class_id].learnings[i].skill_id].name
end
end
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
# 各描写
skill_name = @learn_skills.shift
if skill_name == nil
return false
end
# SEの再生
if $data_system_skilllearn_se != ""
Audio.se_play($data_system_skilllearn_se, 100, 70)
end
self.contents.clear
self.contents.font.size = 18
self.contents.font.color = text_color(7)
self.contents.draw_text(0,0,156,24, "学会特技:"+skill_name)
self.contents.font.color = text_color(1)
self.contents.draw_text(0,0,156,24, " "+skill_name)
self.contents.font.color = text_color(7)
self.visible = true
return true
end
end
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#==============================================================================
# 泛用型升级提示 v1.1
#
# 核心部分 By 叶子
# 窗口部分 原作者:桜雅 在土 修改:叶子
#
# Date: 2-12-2006 -v1.0
# 3-2-2006 -v1.1
#==============================================================================
#
# 在对话时,调用“增加EXP”或“增减等级”指令前,请等待3帧以上,否则对话框来不及消失。
#
# 当打开此号数的开关的时候,等级上升将不会提示,比如默认打开45号开关,等级上升不再提示
$不显示升级窗口 = 88
#==============================================================================
class Game_Actor
#--------------------------------------------------------------------------
# ● 更改 EXP
# exp : 新的 EXP
#--------------------------------------------------------------------------
def exp=(exp)
# 记录旧等级
last_level = @level
@exp = [[exp, 9999999].min, 0].max
# 升级
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
if $game_switches[79] == false
@hp = maxhp
@sp = maxsp
end
# 学会特技
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
# 降级
while @exp < @exp_list[@level]
@level -= 1
end
# 修正当前的 HP 与 SP 超过最大值
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
# 升级了的话,升级显示处理
if @level > last_level and $game_switches[$不显示升级窗口] == false and
not $BTEST
show_level_up_result(last_level)
end
end
#--------------------------------------------------------------------------
# ● 升级显示处理
#--------------------------------------------------------------------------
def show_level_up_result(last_level)
actor_parameters = self.last_parameters(last_level)
last_maxhp = actor_parameters[0]
last_maxsp = actor_parameters[1]
last_str = actor_parameters[2]
last_dex = actor_parameters[3]
last_agi = actor_parameters[4]
last_int = actor_parameters[5]
level_up_window = Window_LevelUpWindow_A.new self,last_level,last_maxhp,
last_maxsp,last_str,last_dex,last_agi,last_int
level_up_window.visible = true
skill_learning_window = Window_SkillLearning_A.new(@class_id,
last_level, @level)
# 循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 按下C就关闭窗口
if Input.trigger?(Input::C)
unless skill_learning_window.refresh
level_up_window.dispose
skill_learning_window.dispose
return true
end
end
end
end
#--------------------------------------------------------------------------
# ● 一次取得全部旧属性
#--------------------------------------------------------------------------
def last_parameters(level)
#---------------------------
# maxhp
#---------------------------
n = [[$data_actors[@actor_id].parameters[0, level] + @maxhp_plus, 1].max, 9999].min
for i in @states
n *= $data_states[i].maxhp_rate / 100.0
end
n = [[Integer(n), 1].max, 9999].min
maxhp = n
#---------------------------
# maxsp
#---------------------------
n = [[$data_actors[@actor_id].parameters[1, level] + @maxsp_plus, 0].max, 9999].min
for i in @states
n *= $data_states[i].maxsp_rate / 100.0
end
n = [[Integer(n), 0].max, 9999].min
maxsp = n
#---------------------------
# str
#---------------------------
n = $data_actors[@actor_id].parameters[2, level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.str_plus : 0
n += armor1 != nil ? armor1.str_plus : 0
n += armor2 != nil ? armor2.str_plus : 0
n += armor3 != nil ? armor3.str_plus : 0
n += armor4 != nil ? armor4.str_plus : 0
n = [[n + @str_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].str_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
str = n
#---------------------------
# dex
#---------------------------
n = $data_actors[@actor_id].parameters[3, level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.dex_plus : 0
n += armor1 != nil ? armor1.dex_plus : 0
n += armor2 != nil ? armor2.dex_plus : 0
n += armor3 != nil ? armor3.dex_plus : 0
n += armor4 != nil ? armor4.dex_plus : 0
n = [[n + @dex_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].dex_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
dex = n
#---------------------------
# agi
#---------------------------
n = $data_actors[@actor_id].parameters[4, level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.agi_plus : 0
n += armor1 != nil ? armor1.agi_plus : 0
n += armor2 != nil ? armor2.agi_plus : 0
n += armor3 != nil ? armor3.agi_plus : 0
n += armor4 != nil ? armor4.agi_plus : 0
n = [[n + @agi_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].agi_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
agi = n
#---------------------------
# int
#---------------------------
n = $data_actors[@actor_id].parameters[5, level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.int_plus : 0
n += armor1 != nil ? armor1.int_plus : 0
n += armor2 != nil ? armor2.int_plus : 0
n += armor3 != nil ? armor3.int_plus : 0
n += armor4 != nil ? armor4.int_plus : 0
n = [[n + @int_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].int_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
int = n
return [maxhp, maxsp, str, dex, agi, int]
end
end
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
# ————————————————————————————————————
# ▼▲▼ XRXS_BP10. LEVEL UP!能力上昇表示ウィンドウ plus ▼▲▼
# by 桜雅 在土
#——以下3个如果需要修改,直接输入文件名即可
$data_system_level_up_se = "" #升级时的音效设置
$data_system_level_up_me = "Audio/ME/升级" # 升级时播放的ME
$data_system_skilllearn_se = "Audio/SE/105-Heal01" # 学会特技时播放的声效。
#==============================================================================
# ■ Window_LevelUpWindow
#------------------------------------------------------------------------------
# バトル終了時、レベルアップした場合にステータスを表示するウィンドウです。
#==============================================================================
class Window_LevelUpWindow_A < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
super(210, 100, 220, 222)
self.windowskin = RPG::Cache.windowskin("skin1")
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.back_opacity = 160
# 防止被对话框遮住
self.z = 9999
refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
# SEの再生
if $data_system_level_up_se != ""
Audio.se_play($data_system_level_up_se)
end
# MEの再生
if $data_system_level_up_me != ""
Audio.me_stop
Audio.me_play($data_system_level_up_me)
end
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
self.contents.clear
self.contents.font.color = system_color
self.contents.font.size = 20
self.contents.draw_text(0, 0, 160, 24, actor.name.to_s)
self.contents.font.color = system_color
self.contents.font.size = 18
self.contents.draw_text( 0, 26, 160, 24, "等级")
self.contents.font.size = 18
self.contents.draw_text( 0, 48, 80, 24, $data_system.words.hp)
self.contents.draw_text( 0, 70, 80, 24, $data_system.words.sp)
self.contents.draw_text( 0, 92, 80, 24, $data_system.words.str)
self.contents.draw_text( 0, 114, 80, 24, $data_system.words.dex)
self.contents.draw_text( 0, 136, 80, 24, $data_system.words.agi)
self.contents.draw_text( 0, 158, 80, 24, $data_system.words.int)
self.contents.draw_text(110, 26, 128, 24, "→")
self.contents.draw_text(110, 48, 128, 24, "→")
self.contents.draw_text(110, 70, 128, 24, "→")
self.contents.draw_text(110, 92, 128, 24, "→")
self.contents.draw_text(110, 114, 128, 24, "→")
self.contents.draw_text(110, 136, 128, 24, "→")
self.contents.draw_text(110, 158, 128, 24, "→")
self.contents.font.color = normal_color
self.contents.draw_text( 60, 26, 88, 24, last_lv.to_s)
self.contents.draw_text( 60, 48, 72, 24, up_hp.to_s)
self.contents.draw_text( 60, 70, 72, 24, up_sp.to_s)
self.contents.draw_text( 60, 92, 72, 24, up_str.to_s)
self.contents.draw_text( 60, 114, 72, 24, up_dex.to_s)
self.contents.draw_text( 60, 136, 72, 24, up_agi.to_s)
self.contents.draw_text( 60, 158, 72, 24, up_int.to_s)
self.contents.draw_text( 145, 26, 128, 24, actor.level.to_s)
self.contents.draw_text( 145, 48, 128, 24, actor.maxhp.to_s)
self.contents.draw_text( 145, 70, 128, 24, actor.maxsp.to_s)
self.contents.draw_text( 145, 92, 128, 24, actor.str.to_s)
self.contents.draw_text( 145, 114, 128, 24, actor.dex.to_s)
self.contents.draw_text( 145, 136, 128, 24, actor.agi.to_s)
self.contents.draw_text( 145, 158, 128, 24, actor.int.to_s)
end
end
#==============================================================================
# ■ Window_SkillLearning
#------------------------------------------------------------------------------
# レベルアップ時などにスキルを習得した場合にそれを表示するウィンドウです。
#==============================================================================
class Window_SkillLearning_A < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(class_id, last_lv, now_lv)
super(210, 322, 220, 56)
self.windowskin = RPG::Cache.windowskin("skin2")
self.contents = Bitmap.new(width - 32, height - 16) # わざと▽を表示
self.visible = false
self.back_opacity = 160
# 防止被对话框遮住
self.z = 9999
@learn_skills = []
for i in 0...$data_classes[class_id].learnings.size
learn_lv = $data_classes[class_id].learnings[i].level
# 今回のレベルアップ範囲で習得するスキルの場合
if learn_lv > last_lv and learn_lv <= now_lv
@learn_skills.push $data_skills[
$data_classes[class_id].learnings[i].skill_id].name
end
end
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
# 各描写
skill_name = @learn_skills.shift
if skill_name == nil
return false
end
# SEの再生
if $data_system_skilllearn_se != ""
Audio.se_play($data_system_skilllearn_se, 100, 70)
end
self.contents.clear
self.contents.font.size = 18
self.contents.font.color = text_color(7)
self.contents.draw_text(0,0,156,24, "学会特技:"+skill_name)
self.contents.font.color = text_color(1)
self.contents.draw_text(0,0,156,24, " "+skill_name)
self.contents.font.color = text_color(7)
self.visible = true
return true
end
end
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
作者: 18925880845 时间: 2014-7-11 20:35
RyanBern 发表于 2014-7-9 17:49
用这个代码吧,好像是LZ那个代码的升级版。
抱歉,好像这个脚本我自己改过,LZ拿去试试,有问题的话通知我 ...
昨天出去了,刚刚才看到。用了你这个脚本后虽然地图上升级提示了,但是只显示了字体,外面的那个边框都不见了。
作者: RyanBern 时间: 2014-7-11 20:42
18925880845 发表于 2014-7-11 20:35
昨天出去了,刚刚才看到。用了你这个脚本后虽然地图上升级提示了,但是只显示了字体,外面的那个边框都不 ...
出现这种问题可能是哪里设置了self.opacity = 0,或者是窗口皮肤设置不正确的问题(好像我那个脚本默认是skin1吧)。能否截图来进一步说明问题?我从脚本上看不出来。
作者: 18925880845 时间: 2014-7-18 12:52
行了,我自己改好了
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |