Project1

标题: 诚心求教人物为何只静默升级? [打印本页]

作者: sxak009    时间: 2011-8-6 12:25
提示: 作者被禁止或删除 内容自动屏蔽
作者: 小⑨    时间: 2011-8-6 13:06
战斗升级可以提示,如果是手动增减等级啥的建议加个对话框提示下
作者: 未命名    时间: 2011-8-6 17:41
以前就有人出过这种脚本,在站内搜索“升级提示”就有不少。
作者: PCNinja    时间: 2011-8-6 17:54
  1. #==============================================================================
  2. # 本腳本來自www.66RPG.com,使用和轉載請保留此信息
  3. #==============================================================================
  4. # 泛用型升級提示 v1.1
  5. #
  6. # 核心部分 By 葉子
  7. # 窗口部分 原作者:櫻雅 在土 修改:葉子
  8. #
  9. # Date: 2-12-2006 -v1.0
  10. #       3-2-2006 -v1.1
  11. #==============================================================================
  12. #
  13. # 在對話時,調用「增加EXP」或「增減等級」指令前,請等待3幀以上,否則對話框來不及消失。
  14. #
  15. # 當打開此號數的開關的時候,等級上升將不會提示,比如默認打開45號開關,等級上升不再提示
  16. #
  17. $不顯示升級窗口 = 45 #要改開關ID就改這行吧
  18. #==============================================================================

  19. class Game_Actor
  20. #--------------------------------------------------------------------------
  21. # ● 更改 EXP
  22. #     exp : 新的 EXP
  23. #--------------------------------------------------------------------------
  24. def exp=(exp)
  25.    # 記錄舊等級
  26.    last_level = @level
  27.    @exp = [[exp, 9999999].min, 0].max
  28.    # 升級
  29.    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  30.      @level += 1
  31.      # 學會特技
  32.      for j in $data_classes[@class_id].learnings
  33.        if j.level == @level
  34.          learn_skill(j.skill_id)
  35.        end
  36.      end
  37.    end
  38.    # 降級
  39.    while @exp < @exp_list[@level]
  40.      @level -= 1
  41.    end
  42.    # 修正當前的 HP 與 SP 超過最大值
  43.    @hp = [@hp, self.maxhp].min
  44.    @sp = [@sp, self.maxsp].min
  45.    # 升級了的話,升級顯示處理
  46.    if @level > last_level and $game_switches[$不顯示升級窗口] == false and
  47.      not $BTEST
  48.      show_level_up_result(last_level)
  49.    end
  50. end
  51. #--------------------------------------------------------------------------
  52. # ● 升級顯示處理
  53. #--------------------------------------------------------------------------
  54. def show_level_up_result(last_level)
  55.    actor_parameters = self.last_parameters(last_level)
  56.    last_maxhp = actor_parameters[0]
  57.    last_maxsp = actor_parameters[1]
  58.    last_str = actor_parameters[2]
  59.    last_dex = actor_parameters[3]
  60.    last_agi = actor_parameters[4]
  61.    last_int = actor_parameters[5]
  62.    level_up_window = Window_LevelUpWindow_A.new self,last_level,last_maxhp,
  63.    last_maxsp,last_str,last_dex,last_agi,last_int
  64.    level_up_window.visible = true
  65.    skill_learning_window = Window_SkillLearning_A.new(@class_id,
  66.    last_level, @level)
  67.    # 循環
  68.    loop do
  69.      # 刷新遊戲畫面
  70.      Graphics.update
  71.      # 刷新輸入信息
  72.      Input.update
  73.      # 按下C就關閉窗口
  74.      if Input.trigger?(Input::C)
  75.        unless skill_learning_window.refresh
  76.          level_up_window.dispose
  77.          skill_learning_window.dispose
  78.          return true
  79.        end
  80.      end
  81.    end
  82. end
  83. #--------------------------------------------------------------------------
  84. # ● 一次取得全部舊屬性
  85. #--------------------------------------------------------------------------
  86. def last_parameters(level)
  87.    #---------------------------
  88.    # maxhp
  89.    #---------------------------
  90.    n = [[$data_actors[@actor_id].parameters[0, level] + @maxhp_plus, 1].max, 9999].min
  91.    for i in @states
  92.      n *= $data_states[i].maxhp_rate / 100.0
  93.    end
  94.    n = [[Integer(n), 1].max, 9999].min
  95.    maxhp = n
  96.    #---------------------------
  97.    # maxsp
  98.    #---------------------------
  99.    n = [[$data_actors[@actor_id].parameters[1, level] + @maxsp_plus, 0].max, 9999].min
  100.    for i in @states
  101.      n *= $data_states[i].maxsp_rate / 100.0
  102.    end
  103.    n = [[Integer(n), 0].max, 9999].min
  104.    maxsp = n
  105.    #---------------------------
  106.    # str
  107.    #---------------------------
  108.    n = $data_actors[@actor_id].parameters[2, level]
  109.    weapon = $data_weapons[@weapon_id]
  110.    armor1 = $data_armors[@armor1_id]
  111.    armor2 = $data_armors[@armor2_id]
  112.    armor3 = $data_armors[@armor3_id]
  113.    armor4 = $data_armors[@armor4_id]
  114.    n += weapon != nil ? weapon.str_plus : 0
  115.    n += armor1 != nil ? armor1.str_plus : 0
  116.    n += armor2 != nil ? armor2.str_plus : 0
  117.    n += armor3 != nil ? armor3.str_plus : 0
  118.    n += armor4 != nil ? armor4.str_plus : 0
  119.    n = [[n + @str_plus, 1].max, 999].min
  120.    for i in @states
  121.      n *= $data_states[i].str_rate / 100.0
  122.    end
  123.    n = [[Integer(n), 1].max, 999].min
  124.    str = n
  125.    #---------------------------
  126.    # dex
  127.    #---------------------------
  128.    n = $data_actors[@actor_id].parameters[3, level]
  129.    weapon = $data_weapons[@weapon_id]
  130.    armor1 = $data_armors[@armor1_id]
  131.    armor2 = $data_armors[@armor2_id]
  132.    armor3 = $data_armors[@armor3_id]
  133.    armor4 = $data_armors[@armor4_id]
  134.    n += weapon != nil ? weapon.dex_plus : 0
  135.    n += armor1 != nil ? armor1.dex_plus : 0
  136.    n += armor2 != nil ? armor2.dex_plus : 0
  137.    n += armor3 != nil ? armor3.dex_plus : 0
  138.    n += armor4 != nil ? armor4.dex_plus : 0
  139.    n = [[n + @dex_plus, 1].max, 999].min
  140.    for i in @states
  141.      n *= $data_states[i].dex_rate / 100.0
  142.    end
  143.    n = [[Integer(n), 1].max, 999].min
  144.    dex = n
  145.    #---------------------------
  146.    # agi
  147.    #---------------------------
  148.    n = $data_actors[@actor_id].parameters[4, level]
  149.    weapon = $data_weapons[@weapon_id]
  150.    armor1 = $data_armors[@armor1_id]
  151.    armor2 = $data_armors[@armor2_id]
  152.    armor3 = $data_armors[@armor3_id]
  153.    armor4 = $data_armors[@armor4_id]
  154.    n += weapon != nil ? weapon.agi_plus : 0
  155.    n += armor1 != nil ? armor1.agi_plus : 0
  156.    n += armor2 != nil ? armor2.agi_plus : 0
  157.    n += armor3 != nil ? armor3.agi_plus : 0
  158.    n += armor4 != nil ? armor4.agi_plus : 0
  159.    n = [[n + @agi_plus, 1].max, 999].min
  160.    for i in @states
  161.      n *= $data_states[i].agi_rate / 100.0
  162.    end
  163.    n = [[Integer(n), 1].max, 999].min
  164.    agi = n
  165.    #---------------------------
  166.    # int
  167.    #---------------------------
  168.    n = $data_actors[@actor_id].parameters[5, level]
  169.    weapon = $data_weapons[@weapon_id]
  170.    armor1 = $data_armors[@armor1_id]
  171.    armor2 = $data_armors[@armor2_id]
  172.    armor3 = $data_armors[@armor3_id]
  173.    armor4 = $data_armors[@armor4_id]
  174.    n += weapon != nil ? weapon.int_plus : 0
  175.    n += armor1 != nil ? armor1.int_plus : 0
  176.    n += armor2 != nil ? armor2.int_plus : 0
  177.    n += armor3 != nil ? armor3.int_plus : 0
  178.    n += armor4 != nil ? armor4.int_plus : 0
  179.    n = [[n + @int_plus, 1].max, 999].min
  180.    for i in @states
  181.      n *= $data_states[i].int_rate / 100.0
  182.    end
  183.    n = [[Integer(n), 1].max, 999].min
  184.    int = n
  185.    return [maxhp, maxsp, str, dex, agi, int]
  186. end
  187. end


  188. #==============================================================================
  189. # 本腳本來自www.66RPG.com,使用和轉載請保留此信息
  190. #==============================================================================


  191. #==============================================================================
  192. # 本腳本來自www.66RPG.com,使用和轉載請保留此信息
  193. #==============================================================================

  194. # ————————————————————————————————————

  195. # ▼▲▼ XRXS_BP10. LEVEL UP!能力上昇表示ウィンドウ plus ▼▲▼
  196. # by 櫻雅 在土

  197. #——以下3個如果需要修改,直接輸入文件名即可
  198. $data_system_level_up_se = "" #升級時的音效設置
  199. $data_system_level_up_me = "Audio/ME/007-Fanfare01" # 升級時播放的ME
  200. $data_system_skilllearn_se = "" # 學會特技時播放的聲效。

  201. #==============================================================================
  202. # ■ Window_LevelUpWindow
  203. #------------------------------------------------------------------------------
  204. #  バトル終了時、レベルアップした場合にステータスを表示するウィンドウです。
  205. #==============================================================================
  206. class Window_LevelUpWindow_A < Window_Base
  207. #--------------------------------------------------------------------------
  208. # ● オブジェクト初期化
  209. #--------------------------------------------------------------------------
  210. def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
  211.    super(210, 100, 220, 222)
  212.    self.contents = Bitmap.new(width - 32, height - 32)
  213.    self.visible = false
  214.    self.back_opacity = 160
  215.    # 防止被對話框遮住
  216.    self.z = 9999
  217.    refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
  218.    # SEの再生
  219.    if $data_system_level_up_se != ""
  220.      Audio.se_play($data_system_level_up_se)
  221.    end
  222.    # MEの再生
  223.    if $data_system_level_up_me != ""
  224.      Audio.me_stop
  225.      Audio.me_play($data_system_level_up_me)
  226.    end
  227. end
  228. #--------------------------------------------------------------------------
  229. # ● リフレッシュ
  230. #--------------------------------------------------------------------------
  231. def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
  232.    self.contents.clear
  233.    self.contents.font.color = text_color(6)
  234.    self.contents.font.size = 20
  235.    self.contents.draw_text(0, 0, 160, 24, actor.name.to_s)
  236.    self.contents.font.color = system_color
  237.    self.contents.font.size = 18
  238.    self.contents.draw_text( 0, 26, 160, 24, "等級")
  239.    self.contents.font.size = 18
  240.    self.contents.draw_text( 0, 48, 80, 24, $data_system.words.hp)
  241.    self.contents.draw_text( 0, 70, 80, 24, $data_system.words.sp)
  242.    self.contents.draw_text( 0, 92, 80, 24, $data_system.words.str)
  243.    self.contents.draw_text( 0, 114, 80, 24, $data_system.words.dex)
  244.    self.contents.draw_text( 0, 136, 80, 24, $data_system.words.agi)
  245.    self.contents.draw_text( 0, 158, 80, 24, $data_system.words.int)
  246.    self.contents.draw_text(110, 26, 128, 24, "→")
  247.    self.contents.draw_text(110, 48, 128, 24, "→")
  248.    self.contents.draw_text(110, 70, 128, 24, "→")
  249.    self.contents.draw_text(110, 92, 128, 24, "→")
  250.    self.contents.draw_text(110, 114, 128, 24, "→")
  251.    self.contents.draw_text(110, 136, 128, 24, "→")
  252.    self.contents.draw_text(110, 158, 128, 24, "→")
  253.    self.contents.font.color = normal_color
  254.    self.contents.draw_text( 60, 26, 88, 24, last_lv.to_s)
  255.    self.contents.draw_text( 60, 48, 72, 24, up_hp.to_s)
  256.    self.contents.draw_text( 60, 70, 72, 24, up_sp.to_s)
  257.    self.contents.draw_text( 60, 92, 72, 24, up_str.to_s)
  258.    self.contents.draw_text( 60, 114, 72, 24, up_dex.to_s)
  259.    self.contents.draw_text( 60, 136, 72, 24, up_agi.to_s)
  260.    self.contents.draw_text( 60, 158, 72, 24, up_int.to_s)
  261.    self.contents.draw_text( 145, 26, 128, 24, actor.level.to_s)
  262.    self.contents.draw_text( 145, 48, 128, 24, actor.maxhp.to_s)
  263.    self.contents.draw_text( 145, 70, 128, 24, actor.maxsp.to_s)
  264.    self.contents.draw_text( 145, 92, 128, 24, actor.str.to_s)
  265.    self.contents.draw_text( 145, 114, 128, 24, actor.dex.to_s)
  266.    self.contents.draw_text( 145, 136, 128, 24, actor.agi.to_s)
  267.    self.contents.draw_text( 145, 158, 128, 24, actor.int.to_s)
  268. end
  269. end
  270. #==============================================================================
  271. # ■ Window_SkillLearning
  272. #------------------------------------------------------------------------------
  273. #  レベルアップ時などにスキルを習得した場合にそれを表示するウィンドウです。
  274. #==============================================================================
  275. class Window_SkillLearning_A < Window_Base
  276. #--------------------------------------------------------------------------
  277. # ● オブジェクト初期化
  278. #--------------------------------------------------------------------------
  279. def initialize(class_id, last_lv, now_lv)
  280.    super(210, 322, 220, 56)
  281.    self.contents = Bitmap.new(width - 32, height - 16) # わざと▽を表示
  282.    self.visible = false
  283.    self.back_opacity = 160
  284.    # 防止被對話框遮住
  285.    self.z = 9999
  286.    @learn_skills = []
  287.    for i in 0...$data_classes[class_id].learnings.size
  288.      learn_lv = $data_classes[class_id].learnings[i].level
  289.      # 今回のレベルアップ範圍で習得するスキルの場合
  290.      if learn_lv > last_lv and learn_lv <= now_lv
  291.        @learn_skills.push $data_skills[
  292.        $data_classes[class_id].learnings[i].skill_id].name
  293.      end
  294.    end
  295.    refresh
  296. end
  297. #--------------------------------------------------------------------------
  298. # ● リフレッシュ
  299. #--------------------------------------------------------------------------
  300. def refresh
  301.    # 各描寫
  302.    skill_name = @learn_skills.shift
  303.    if skill_name == nil
  304.      return false
  305.    end
  306.    # SEの再生
  307.    if $data_system_skilllearn_se != ""
  308.      Audio.se_play($data_system_skilllearn_se, 100, 70)
  309.    end
  310.    self.contents.clear
  311.    self.contents.font.size = 18
  312.    self.contents.font.color = text_color(0)
  313.    self.contents.draw_text(0,0,156,24, "學會特技:"+skill_name)
  314.    self.contents.font.color = text_color(6)
  315.    self.contents.draw_text(0,0,156,24, "          "+skill_name)
  316.    self.contents.font.color = text_color(0)
  317.    self.visible = true
  318.    return true
  319. end
  320. end
  321. #==============================================================================
  322. # 本腳本來自www.66RPG.com,使用和轉載請保留此信息
  323. #==============================================================================
复制代码
基本的升級提醒,用法看腳本內的註釋吧
作者: sxak009    时间: 2011-8-6 23:55
提示: 作者被禁止或删除 内容自动屏蔽




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1