赞 | 0 |
VIP | 1 |
好人卡 | 3 |
积分 | 1 |
经验 | 9739 |
最后登录 | 2014-6-3 |
在线时间 | 182 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 182 小时
- 注册时间
- 2011-2-17
- 帖子
- 518
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 小和尚 于 2013-3-4 23:54 编辑
刀王:可以和升级提示脚本一起使用,不冲突。如果要用叶子的那个,就把SCENE BATTLE的UPDATE和START PHASE5里面做记号的部分复制到修改后的地方相同位置下就可以了~
使用了刀王的美化exp和升级提示 但两个脚本不能同时起作用 看刀王的帖子里有这么一句话 但是一直不知道怎么改
脚本内容- #==============================================================================
- # 战斗结束动态增加EXP条 v0.1 作者:灯笼菜刀王
- #==============================================================================
- class Window_BattleResult < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # exp : EXP
- # gold : 金钱
- # treasures : 宝物
- #--------------------------------------------------------------------------
- def initialize(exp, gold, treasures)
- [url=home.php?mod=space&uid=13302]@exp[/url] = exp
- [url=home.php?mod=space&uid=236945]@gold[/url] = gold
- @treasures = treasures
- @expup = []
- @expnow = []
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- now = actor.now_exp
- max = actor.next_exp
- now = now > max ? max : now
- @expnow[i] = max != 0 ? 98 * now / max.to_f : 0
- now2 = actor.now_exp - @exp
- now2 = now2 > max ? max : now2
- @expup[i] = max != 0 ? 98 * now2 / max.to_f : 0
- end
- super(140, 0, 400, 8 * 32 + 64)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.y = 160 - height / 2
- self.back_opacity = 160
- self.visible = false
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- x = 6
- self.contents.font.color = normal_color
- cx = contents.text_size(@exp.to_s).width
- self.contents.draw_text(x, 0, cx, 32, @exp.to_s)
- x += cx + 4
- self.contents.font.color = system_color
- cx = contents.text_size("EXP").width
- self.contents.draw_text(x, 0, 64, 32, "EXP")
- x += cx + 16
- self.contents.font.color = normal_color
- cx = contents.text_size(@gold.to_s).width
- self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
- x += cx + 4
- self.contents.font.color = system_color
- self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
- cx = contents.text_size($data_system.words.gold).width
- self.contents.draw_text(208,0,128,32,"战利品")
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- draw_actor_graphic(actor, 20, i*60+92)
- draw_actor_name(actor, 34, i*60+42)
- self.contents.fill_rect(26, i*60+76, 100, 8,Color.new(192,192,192,255))
- self.contents.fill_rect(28, i*60+78, 96, 4, Color.new(128,128,128,128))
- now = actor.now_exp - @exp
- max = actor.next_exp
- now = now > max ? max : now
- a = max != 0 ? 78 * now / max.to_f : 0
- self.contents.fill_rect(27, i*60+77, @expup[i], 6, Color.new(150, 255, 150, 255))
- end
- y = 32
- for item in @treasures
- draw_item_name(item, 180, y)
- y += 32
- end
- end
- def update
- for i in 0...$game_party.actors.size
- if @expup[i] < @expnow[i]
- @expup[i] += 1
- end
- end
- refresh
- end
- end
- class Game_Actor < Game_Battler
- def now_exp
- return [url=home.php?mod=space&uid=13302]@exp[/url] - @exp_list[@level]
- end
- def next_exp
- return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
- end
- end
- class Scene_Battle
- def update
- # 执行战斗事件中的情况下
- if $game_system.battle_interpreter.running?
- # 刷新解释器
- $game_system.battle_interpreter.update
- # 强制行动的战斗者不存在的情况下
- if $game_temp.forcing_battler == nil
- # 执行战斗事件结束的情况下
- unless $game_system.battle_interpreter.running?
- # 继续战斗的情况下、再执行战斗事件的设置
- unless judge
- setup_battle_event
- end
- end
- # 如果不是结束战斗回合的情况下
- if @phase != 5
- # 刷新状态窗口
- @status_window.refresh
- end
- end
- end
- # 系统 (计时器)、刷新画面
- $game_system.update
- $game_screen.update
- # 计时器为 0 的情况下
- if $game_system.timer_working and $game_system.timer == 0
- # 中断战斗
- $game_temp.battle_abort = true
- end
- # 刷新窗口
- @help_window.update
- @party_command_window.update
- @actor_command_window.update
- @status_window.update
- @message_window.update
- #####菜刀王到此一游################
- if @result_window != nil
- @result_window.update
- end
- ###################################
- # 刷新活动块
- @spriteset.update
- # 处理过渡中的情况下
- if $game_temp.transition_processing
- # 清除处理过渡中标志
- $game_temp.transition_processing = false
- # 执行过渡
- if $game_temp.transition_name == ""
- Graphics.transition(20)
- else
- Graphics.transition(40, "Graphics/Transitions/" +
- $game_temp.transition_name)
- end
- end
- # 显示信息窗口中的情况下
- if $game_temp.message_window_showing
- return
- end
- # 显示效果中的情况下
- if @spriteset.effect?
- return
- end
- # 游戏结束的情况下
- if $game_temp.gameover
- # 切换到地图,并且调用公共事件1号
- $game_temp.battle_can_lose = true
- battle_end(1)
- $game_temp.gameover = false
- $game_temp.common_event_id = 1
- return
- end
- # 中断战斗的情况下
- if $game_temp.battle_abort
- # 还原为战斗前的 BGM
- $game_system.bgm_play($game_temp.map_bgm)
- # 战斗结束
- battle_end(1)
- return
- end
- # 等待中的情况下
- if @wait_count > 0
- # 减少等待计数
- @wait_count -= 1
- return
- end
- # 强制行动的角色存在、
- # 并且战斗事件正在执行的情况下
- if $game_temp.forcing_battler == nil and
- $game_system.battle_interpreter.running?
- return
- end
- # 回合分支
- case @phase
- when 1 # 自由战斗回合
- update_phase1
- when 2 # 同伴命令回合
- update_phase2
- when 3 # 角色命令回合
- update_phase3
- when 4 # 主回合
- update_phase4
- when 5 # 战斗结束回合
- update_phase5
- end
- end
- def start_phase5
- # 转移到回合 5
- @phase = 5
- # 演奏战斗结束 ME
- $game_system.me_play($game_system.battle_end_me)
- # 还原为战斗开始前的 BGM
- $game_system.bgm_play($game_temp.map_bgm)
- # 初始化 EXP、金钱、宝物
- exp = 0
- gold = 0
- treasures = []
- # 循环
- for enemy in $game_troop.enemies
- # 敌人不是隐藏状态的情况下
- unless enemy.hidden
- # 获得 EXP、增加金钱
- exp += enemy.exp
- gold += enemy.gold
- # 出现宝物判定
- if rand(100) < enemy.treasure_prob
- if enemy.item_id > 0
- treasures.push($data_items[enemy.item_id])
- end
- if enemy.weapon_id > 0
- treasures.push($data_weapons[enemy.weapon_id])
- end
- if enemy.armor_id > 0
- treasures.push($data_armors[enemy.armor_id])
- end
- end
- end
- end
- # 限制宝物数为 6 个
- treasures = treasures[0..10]
- # 获得 EXP
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- if actor.cant_get_exp? == false
- last_level = actor.level
- actor.exp += exp
- if actor.level > last_level
- @status_window.level_up(i)
- end
- end
- end
- # 获得金钱
- $game_party.gain_gold(gold)
- # 获得宝物
- for item in treasures
- case item
- when RPG::Item
- $game_party.gain_item(item.id, 1)
- when RPG::Weapon
- $game_party.gain_weapon(item.id, 1)
- when RPG::Armor
- $game_party.gain_armor(item.id, 1)
- end
- end
- # 生成战斗结果窗口
- @result_window = Window_BattleResult.new(exp, gold, treasures)
- ######菜刀王到此一游###############
- @result_window.visible = true
- ###################################
- # 设置等待计数
- @phase5_wait_count = 100
- end
- end
复制代码 这是升级提示
- #===============================================================
- # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
- #===============================================================
- # ———————————————————————————
- # ▼▲▼ XRXS_BP10. LEVEL UP!能力上昇表示ウィンドウ plus ▼▲▼
- # by 桜雅 在土
- #——以下3个如果需要修改,直接输入文件名即可
- $data_system_level_up_se = "" #升级时的音效设置
- $data_system_level_up_me = "Audio/ME/007-Fanfare01" # 升级时播放的ME
- $data_system_skilllearn_se = "Audio/SE/106-Heal02" # 学会特技时播放的声效。
- #=============================================================
- # ■ 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, "LEVEL UP!!")
- 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
- #==================================================================
- # ■ Window_BattleStatus
- #==================================================================
- class Window_BattleStatus < Window_Base
- #---------------------------------------------------------
- # ● 追加?公開インスタンス変数
- #-------------------------------------------------------
- attr_accessor :level_up_flags # LEVEL UP!表示
- 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
- # 設定
- @phase5_step = 1
- @exp_gain_actor = -1
- for enemy in $game_troop.enemies
- # 獲得 EXPを追加 # エネミーが隠れ状態でない場合
- @exp_gained += enemy.exp if not enemy.hidden
- end
- # リザルトウィンドウを表示
- @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
-
复制代码 |
|