设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1188|回复: 0
打印 上一主题 下一主题

[已经过期] 我想把这个脚本的一个音效提出来该如何写?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
840
在线时间
8 小时
注册时间
2014-2-8
帖子
1
跳转到指定楼层
1
发表于 2014-2-12 23:23:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
  1. =begin
  2.       RGSS3
  3.       
  4.       ★ バトルボイス ★
  5.       
  6.       戦闘中の行動に応じてボイスを再生します。
  7.       
  8.       ● 使い方 ●========================================================
  9.       Audioフォルダ配下に「VOICE」というフォルダを作成し、
  10.       そこにボイスファイルを保存してください。
  11.       --------------------------------------------------------------------
  12.       アイテム・スキルの使用前にボイスを再生する機能がありますが、
  13.       メモ欄に「使用ボイス無し」と記述されたアイテム・スキルを使用した
  14.       際には、その機能は無効化されます。
  15.       ====================================================================
  16.       
  17.       ● イベントコマンド ●==============================================
  18.       初期状態ではアクターにはアクターIDと等しいIDのボイス設定が適応されています。
  19.         例) アクターIDが 2 のアクターには ボイス設定の 2 が対応
  20.       --------------------------------------------------------------------
  21.       イベントコマンドのスクリプトより下記のコードを実行することで、
  22.       アクターが使用するボイス設定を任意のものに変更できます。
  23.       --------------------------------------------------------------------
  24.       change_voice(actor_id, voice_id)
  25.       --------------------------------------------------------------------
  26.       actor_id : ボイス設定を変更したいアクターID
  27.       voice_id : 利用したいボイス設定ID
  28.       --------------------------------------------------------------------
  29.         例) change_voice(2, 14)
  30.           上記スクリプトを実行すると、
  31.           「アクターIDが 2 のアクターには ボイス設定の 14 が対応」
  32.           といったように設定が変更されます。
  33.       ====================================================================
  34.       
  35.       ● 注意 ●==========================================================
  36.       ニューゲームから始めないとエラーを吐きます。
  37.       ====================================================================
  38.       
  39.       ver1.00
  40.       
  41.       Last Update : 2012/06/10
  42.       06/10 : 新規
  43.       
  44.       ろかん   http://kaisou-ryouiki.sakura.ne.jp/
  45. =end

  46. #===========================================
  47. #   設定箇所
  48. #===========================================
  49. module BattleVoice
  50. #-----------------------------------------------------------------------------
  51. # 各戦闘行動に対してボイスを設定してください。
  52. # 設定のないバトラーのボイスは再生されません。
  53. # 設定の基本形式は以下のとおりです。
  54. #【形式】
  55. # ① => [②, ②, ②.....],
  56. #   ① ボイス設定ID(数値)
  57. #      初期状態ではこの値はアクターID もしくは エネミーIDに対応しています。
  58. #      エネミーのボイスを設定する場合には ID を"負の値にして"設定してください。
  59. #      例) IDが 4 のエネミーを設定する場合、-4 とする。
  60. #
  61. #   ② ボイスファイル名(文字列,拡張子不要)
  62. #      同キャラクターに複数のボイスが設定されている場合、
  63. #      ランダムで再生されるファイルが選択されます。
  64. #-----------------------------------------------------------------------------
  65. VOICE_LIST = {
  66.   :battle_start_normal => {
  67.   # ◆ 戦闘開始時:通常(生存メンバーからランダムで一人選んで再生されます)
  68.   # エネミー未対応
  69.     1 => [],
  70.   },
  71.   
  72.   :battle_start_pinch => {
  73.   # ◆ 戦闘開始時:ピンチ(生存メンバーからランダムで一人選んで再生されます)
  74.   # 戦闘開始時に戦闘不能のメンバーが一人でもいる場合に再生
  75.   # エネミー未対応
  76.     1 => [],
  77.   },
  78.   
  79.   :battle_start_surprise => {
  80.   # ◆ 戦闘開始時:不意打ち(生存メンバーからランダムで一人選んで再生されます)
  81.   # ピンチよりも優先されます。
  82.   # エネミー未対応
  83.     1 => [],
  84.   },
  85.   
  86.   :battle_start_preemptive => {
  87.   # ◆ 戦闘開始時:先制攻撃(生存メンバーからランダムで一人選んで再生されます)
  88.   # ピンチよりも優先されます。
  89.   # エネミー未対応
  90.     1 => [],
  91.   },
  92.   
  93.   :attack => {
  94.   # ◆ 通常攻撃
  95.     1 => [],
  96.   },
  97.   
  98.   :guard => {
  99.   # ◆ 防御
  100.     1 => [],
  101.   },
  102.   
  103.   :damage => {
  104.   # ◆ 被ダメージ
  105.     1 => [],
  106.     -3=> ["fm8","fm25","fm33","fm34","fn7","fn22"],#オボ
  107.     -4=> ["bm1","bm8","bm11","bm17","bm19","bm21","bm28","bm29"],#ウィスパ
  108.     -5=> ["bn1","bn2","bn5","bn6","bn9","bn11","bn16","bn19","bn21"],#ウィスパ
  109.     -6=> ["fm1","fm8","fm16","fm19","fm22","fm32","fm34","fn7","fn22"],#ゴス
  110.     -8=> ["cm2","cm4","cm8","cm10","cm12","cm16","cm22","cm23","cm32"],#ミミック
  111.     -9=> ["cm2","cm4","cm8","cm10","cm12","cm16","cm22","cm23","cm32"],#ミミック
  112.     -10=>["em22","en1","en2","en3","en7","en22","en23"],#エンジェ
  113.     -11=> ["gm8","gm15","gm19","gm33","gm34"],#ハイシーフホム
  114.     -12=> ["gn7","gn12","gn22","gn23"],#ハイシーフホム
  115.     -13=> ["gm8","gm15","gm19","gm33","gm34"],#ハイシーフホム
  116.     -14=> ["gm8","gm15","gm19","gm33","gm34"],#騎士ホム
  117.     -15=> ["gn7","gn12","gn22","gn23"],#騎士ホム
  118.     -16=> ["gm8","gm15","gm19","gm33","gm34"],#オーラ騎士ホム
  119.     -17=> ["gn7","gn12","gn22","gn23"],#オーラ騎士ホム
  120.     -18=> ["cm1","cm7","cm9","cm11","cm19","cm33"],#ルーン
  121.     -19=> ["cm1","cm7","cm8","cm9","cm11","cm16","cm19","cm24","cm33","cm34"],#ルーン
  122.     -20=> ["cn3","cn4","cn8","cn14","cn22","cn23"],#ルーン
  123.     -21=> ["am1","am2","am3","am4","am5","am10","am22","am32","am33"],#マリオ
  124.     -22=> ["an1","an2","an7","an10","an22","an23"],#マリオ
  125.     -23=> ["am1","am2","am3","am4","am5","am10","am22","am32","am33"],#マリオ
  126.     -24=> ["an1","an2","an7","an10","an22","an23"],#マリオ
  127.     -25=> ["bn1","bn2","bn5","bn6","bn9","bn11","bn16","bn19","bn21"],#ウィスパ
  128.     -26=> ["fm1","fm8","fm16","fm19","fm22","fm32","fm34","fn7","fn22"],#ゴス
  129.     -27=> ["gm8","gm15","gm19","gm33","gm34"],#ハイシーフホム
  130.     -33=> ["bm1","bm2","bm34","bn1","bn2","bn20","bn23"],#ポリン
  131.     -34=> ["gm8","gm15","gm19","gm33","gm34"],#シーフホム
  132.     -35=> ["am1","am2","am4","am9","am13","am15","am33","am34"],#ファミリア
  133.     -36=> ["em1","em2","em8","em13","em33","em34"],#クルセコ
  134.     -37=> ["em2","em34","en1","en2","en3","en4","en7","en10","en22","en23"],#クルセコ
  135.     -38=> ["em2","em34","en1","en2","en3","en4","en7","en10","en22","en23"],#クルセコ
  136.     -39=> ["an1","an2","an9","an12","an22","an23"],#ファミリア
  137.     -40=> ["gn7","gn12","gn22","gn23"],#シーフホム
  138.     -41=> ["am1","am2","am8","am13","am14","am18","am25","am33","am34"],#ドレイン
  139.     -42=> ["bm1","bm8","bm33","bn1","bn2","bn22"],#ポポリン
  140.     -43=> ["an1","an2","an7","an16","an22","an23"],#ドレイン
  141.     -44=> ["cm2","cm11","cm7","cm8","cm15","cm17","cm33","cm34"],#シーフ
  142.     -45=> ["cn1","cn21","cn7","cn9","cn11","cn16","cn18","cn22","cn23"],#シーフ
  143.     -46=> ["dm33","dm34","dn22","dn23"],#ゾンビ
  144.     -47=> ["dm33","dm34","dn22","dn23"],#ゾンビ
  145.     -48=> ["em1","em2","em4","em10","em22","em30","em32"],#ヒドラ
  146.     -49=> ["em1","em2","em4","em10","em22","em30","em32"],#ヒドラ
  147.     -50=> ["cn1","cn2","cm7","cm33","cm34","cn3","cn4","cn14"],#ドロップ
  148.     -51=>["em22","em1","em2","em4","en7","em10","en20"],#マスタリン
  149.     -52=> ["dm1","dm8","dm18","dm19","dm24","dn12"],#アンドレ
  150.     -53=> ["dm2","dm13","dm20","dn2","dn10","dn22"],#アンドレ
  151.     -54=> ["em1","em4","em5","em10","em22","em30","em32"],#ピエール
  152.     -55=> ["en1","en2","en3","en4","en7","en18","en20","en23","em2","em16","em26"],#ピエール
  153.     -56=> ["cm2","cm7","cm8","cm13","cm15","cm24","cn1","cn2","cn12"],#デニーロ
  154.     -57=> ["fm1","fm2","fm8","fm13","fm18","fm33","fm34"],#オーク
  155.     -58=> ["fn1","fn2","fn7","fn10","fn22","fn23"],#オーク
  156.     -60=> ["fm1","fm2","fm34","fn2","fn3","fn4","fn23"],#アルゴス
  157.     -61=> ["am1","am3","am4","am10","am18","am22","am23","am32"],#バフォ子
  158.     -62=> ["fm1","fm2","fm34","fn2","fn3","fn4","fn23"],#アルゴス
  159.     -63=> ["bm1","bm2","bm8","bm11","bm19","bm33","bm34"],#プリコ
  160.     -64=> ["bm2","bm6","bm11","bm17","bm21","bm28","bm29","bm30","bm31"],#プリコ
  161.     -65=> ["bn2","bn3","bn5","bn7","bn11","bn14","bn16","bn18","bn19","bn21","bn23"],#プリコ
  162.     -66=> ["fm1","fm2","fm8","fm13","fm14","fm33","fm34"],#クスミ
  163.     -67=> ["fm1","fm2","fm8","fm13","fm14","fm33","fm34"],#クスミ
  164.     -68=> ["fn1","fn2","fn7","fn10","fn22","fn23"],#クスミ
  165.     -69=> ["cm1","cm3","cm7","cm8","cm14","cm17","cm20","cm28"],#ヒメプ
  166.     -70=> ["cm1","cm7","cm8","cm15","cm17","cm23","cn1"],#ヒメプ
  167.     -71=> ["cn1","cn2","cn9","cn11","cn16","cn23"],#ヒメプ
  168.     -72=> ["gm8","gm15","gm19","gm33","gm34"],#ムナ
  169.     -73=> ["cn1","cn2","cn3","cn12","cn22","cn23"],#ムナ
  170.     -74=> ["bm1","bm2","bm6","bm7","bm8","bm11","bm17","bm19","bm33"],#ソヒー
  171.     -75=> ["bm2","bm6","bm8","bm17","bm21","bm29","bm30","bm34"],#ソヒー
  172.     -76=> ["bn2","bn5","bn6","bn11","bn12","bn16","bn18","bn19","bn21","bn23"],#ソヒー
  173.     -77=> ["am1","am2","am8","am19","am30","am33","am34"],#ナインテイル
  174.     -78=> ["an13","an17","am4","am10","am12","am16","am22","am26","am32"],#ナインテイル
  175.     -80=> ["am1","am8","am10","am14","am25","am30","am33","am34"],#バスリ
  176.     -81=> ["am1","am2","am8","am14","am25","am30","am34"],#バスリ
  177.     -82=> ["an2","an3","an10","an12","an16","an23","am31"],#バスリ
  178.     -83=> ["dm1","dm2","dm33","dm34"],#グール
  179.     -84=> ["dn1","dn2","dn7","dn22","dn23"],#グール
  180.     -85=> ["fm1","fm2","fm8","fm13","fm19","fm20","fm25","fm33","fn1"],#メア
  181.     -86=> ["fm22","fm23","fm32","fm33"],#DOP
  182.     -87=> ["fm8","fm19","fm22","fm23","fm25","fm32","fm33","fm34"],#DOP
  183.     -88=> ["fm1","fm34","fn1","fn7","fn10","fn22","fn23"],#DOP
  184.     -89=> ["fm1","fm8","fm22","fm23","fm25","fm34","fn7","fn12","fn22"],#マヤパ
  185.     -90=> ["fm1","fm8","fm22","fm23","fm25","fm34","fn7","fn12","fn22"],#マヤパ
  186.     -91=> ["cm1","cm2","cm7","cm8","cm19","cm24","cm33","cm34"],#エイミー
  187.     -92=> ["cn1","cn2","cn7","cn10","cn12","cn22","cn23"],#エイミー
  188.     -93=> ["fm1","fm2","fm8","fm13","fm18","fm33","fm34"],#廃屋
  189.     -94=> ["fn1","fn2","fn7","fn10","fn22","fn23"],#廃屋
  190.     -95=>["dm33","dn1","dn22","dn23","dm18","dm25"],#暗殺者
  191.     -96=>["dm1","dm8","dm13","dm20","dm34"],#暗殺者
  192.     -98=> ["em1","em2","em4","em5","em10","em12","em14","em22","em23","em30","em32"],#イシス
  193.     -99=> ["am1","am2","am8","am13","am15","am19","am27","am32","am33"],#ミノ
  194.     -100=> ["an1","an2","an3","an4","an8","an10","an12","an14","an21","an23"],#ミノ
  195.     -101=>  ["dm1","dm2","dm19","dm23","dm33","dm34","dn12"],#マミー
  196.     -102=> ["dn1","dn2","dn3","dn7","dn22","dn23"],#マミー
  197.     -103=> ["fm8","fm33","fm34"],#古代
  198.     -104=> ["fm8","fm33","fm34","fn1","fn7","fn12","fn22"],#古代
  199.     -105=> ["em4","em5","em10","em12","em14","em22","em23","em30","em32"],#イシス
  200.     -106=> ["am1","am6","am7","am11","am13","am17","am21","am28","am29","am30"],#花売り
  201.     -107=> ["am2","am6","am7","am13","am17","am21","am28","am29","am30","am31"],#花売り
  202.     -108=> ["an5","an6","an11","an12","an15","an18","an19","an20"],#花売り
  203.     -109=> ["an5","an6","an11","an12","an15","an18","an19","an20"],#花売り
  204.     -110=> ["am1","am3","am4","am5","am10","am12","am22","am23","am32","am33"],#ヤファ
  205.     -111=> ["an1","an3","an4","an13","an16","an17","an23"],#ヤファ
  206.     -112=> ["cm2","cm11","cm7","cm8","cm15","cm17","cm33","cm34"],#シーフ
  207.     -113=> ["cn1","cn21","cn7","cn9","cn11","cn16","cn18","cn22","cn23"],#シーフ
  208.     -114=> ["cm1","cm2","cm7","cm8","cm19","cm24","cm33","cm34"],#エイミー
  209.     -115=> ["cn1","cn2","cn7","cn10","cn12","cn22","cn23"],#エイミー
  210.     -116=> ["em1","em2","em4","em10","em22","em32"],#シロップ
  211.     -117=> ["em2","em34","en1","en2","en4","en7","en11","en22","en23"],#シロップ
  212.     -118=> ["em1","em2","em8","em13","em33","em34"],#クルセコ
  213.     -119=> ["em2","em34","en1","en2","en3","en4","en7","en10","en22","en23"],#クルセコ
  214.     -120=> ["em2","em34","en1","en2","en3","en4","en7","en10","en22","en23"],#クルセコ
  215.     -121=> ["dn12","dm1","dm8","dm18","dm19","dm25","dm33"],#ヒュッケ
  216.     -122=> ["dn1","dn2","dn10","dn13","dn22","dn23","dm24","dm20"],#ヒュッケ
  217.     -123=> ["dn1","dn2","dn10","dn13","dn22","dn23"],#ヒュッケ
  218.     -124=> ["fm1","fm2","fm8","fm13","fm18","fm22","fm23","fm33","fm34"],#JK
  219.     -125=> ["fn1","fn2","fn7","fn10","fn22","fn23"],#JK
  220.     -126=> ["fm1","fm2","fm8","fm13","fm18","fm22","fm23","fm33","fm34"],#JK
  221.     -127=> ["fm1","fm2","fm8","fm13","fm18","fm19","fm25","fm33","fm34"],#レイド
  222.     -128=> ["fn1","fn2","fn3","fn4","fn7","fn10","fn12","fm20","fn22","fn23"],#レイド
  223.     -130=> ["am1","am3","am8","am18","am19","am25","am33"],#深淵
  224.     -131=> ["am2","am9","am11","am14","am15","am17","am20","am24","am31"],#深淵
  225.     -132=> ["an2","an3","an4","an12","an14","an16","an17","an21"],#深淵
  226.     -133=> ["fm1","fm2","fm8","fm13","fm18","fm19","fm23","fm25","fm33","fm34"],#ジルタス
  227.     -134=> ["fn1","fn2","fn7","fn10","fn12","fn22","fn23"],#ジルタス
  228.     -135=> ["bm1","bm2","bm6","bm7","bm11","bm17","bm21","bm28","bm29","bm30","bm31"],#アリス
  229.     -136=> ["bn1","bn2","bn5","bn6","bn11","bn12","bn16","bn18","bn19","bn21"],#アリス
  230.     -137=> ["em4","em5","em10","em12","em14","em22","em23","em30","em32","en20"],#ペノメナ
  231.     -138=> ["em4","em5","em10","em12","em14","em22","em23","em30","em32","en20"],#ペノメナ
  232.     -139=> ["dm1","dm2","dm13","dm18","dm19","dm23","dm24","dm25","dm33","dn10","dn12"],#ごつ
  233.     -140=> ["fm2","fm16","fn1","fn2","fn3","fn4","fn23"],#Gスパ
  234.     -141=> ["fm2","fm16","fn1","fn2","fn3","fn4","fn23"],#Gスパ
  235.     -142=> ["em1","em7","em11","em12","em16","em19","em24","em26","em33","em34"],#オシリス
  236.     -143=> ["en1","en2","en3","en6","en11","en16","en22","en23","em24","em26"],#オシリス
  237.     -144=> ["am1","am7","am11","am13","am14","am18","am25","am27","am33"],#ミストレス
  238.     -145=> ["am1","am7","am11","am13","am14","am18","am25","am27","am33"],#ミストレス
  239.     -146=> ["am2","am9","am15","an1","an2","an9","an22","an23"],#ミストレス
  240.     -147=> ["em1","em4","em5","em10","em14","em22","em23","em27","em30","em32"],#マヤー
  241.     -148=> ["em1","em2","em8","em13","em19","em23","em24","em33","en2","en3","en10","en22","en23"],#マヤー
  242.     -149=> ["em1","em2","em8","em13","em19","em23","em24","em33","en2","en3","en10","en22","en23"],#マヤー
  243.     -150=> ["dm1","dm8","dm18","dm19","dm24","dn12"],#アンドレ
  244.     -151=> ["dm2","dm13","dm20","dn2","dn10","dn22"],#アンドレ
  245.     -152=> ["em1","em4","em5","em10","em22","em30","em32"],#ピエール
  246.     -153=> ["en1","en2","en3","en4","en7","en18","en20","en23","em2","em16","em26"],#ピエール
  247.     -154=> ["cm2","cm7","cm8","cm13","cm15","cm24","cn1","cn2","cn12"],#デニーロ
  248.     -155=> ["fm1","fm8","fm13","fm18","fm19","fm25","fm33"],#DL
  249.     -156=> ["fm1","fm2","fm8","fm13","fm18","fm19","fm25","fm33","fm34"],#DL
  250.     -157=> ["fn1","fn7","fn10","fn12","fn22"],#DL
  251.     -158=> ["fn1","fn2","fn7","fn10","fn12","fn22","fn23"],#DL
  252.     -159=> ["fn2","fn3","fn4","fn7","fn10","fn23"],#DL
  253.     -160=> ["em1","em4","em7","em10","em11","em16","em22","em32","em33"],#DI
  254.     -161=> ["em1","em4","em2","em10","em17","em16","em22","em26","em34"],#DI
  255.     -162=> ["en1","en2","en6","en7","en12","en22","em26"],#DI
  256.     -163=> ["en3","en2","en5","en9","en11","en16","en23"],#DI
  257.     -164=> ["en3","en2","en5","en9","en11","en16","en23"],#DI
  258.     -165=> ["fm1","fm2","fm3","fm8","fm18","fm22","fm23","fm32","fm33","fm34"],#バフォ
  259.     -166=> ["fm1","fm2","fm8","fm18","fm22","fm23","fm32","fm33","fm34"],#バフォ
  260.     -167=> ["fm1","fm2","fm8","fm13","fm14","fm33","fm34"],#クスミ
  261.     -170=> ["bm2","bm6","bm11","bm17","bm21","bm28","bm29","bm30","bm31"],#アリス
  262.     -176=> ["fm8","fm19","fm22","fm23","fm25","fm32","fm33","fm34"],#剣士子
  263.     -177=> ["fm1","fm34","fn1","fn7","fn10","fn22","fn23"],#剣士子
  264.     -178=> ["dm1","dm8","dm13","dm19","dm23","dm33","dm34"],#グラリス
  265.     -179=> ["dn1","dn2","dn7","dn22","dn23"],#グラリス
  266.     -180=> ["gm8","gm15","gm33","gm34"],#テリン
  267.     -181=> ["gm15","gm19","gm33","gm34"],#テリン
  268.     -182=> ["gn7","gn12","gn22","gn23"],#テリン
  269.     -183=> ["cm1","cm3","cm6","cm7","cm8","cm11","cm13","cm14","cm15","cm19"],#ビニット
  270.     -184=> ["cm2","cm16","cm24","cm28","cm29","cm31","cm34","cn5","cn22"],#ビニット
  271.     -185=> ["em1","em4","em10","em12","em14","em22","em32"],#ソリン
  272.     -186=> ["em2","em11","em16","em17","em24","em26","em30","em34"],#ソリン
  273.     -187=> ["em1","em4","em10","em11","em17","em19","em27","em34","em33"],#ディフォルテ
  274.     -188=> ["en1","en2","en3","en4","en7","en11","en22","en23"],#ディフォルテ
  275.     -192=> ["gm8","gm15","gm33","gm34"],#アラーム
  276.     -193=> ["fm1","fm2","fm8","fm13","fm18","fm33","fm34"],#廃屋
  277.     -194=> ["fn1","fn2","fn7","fn10","fn22","fn23"],#廃屋
  278.     -195=> ["dm1","dm2","dm8","dm13","dm19","dm20","dm23","dm24","dm25","dm33"],#アノリアン
  279.     -196=> ["dn1","dn2","dn3","dn7","dn10","dn22","dn23"],#アノリアン
  280.     -197=> ["fm8","fm13","fm25","fm34","fn7","fn22"],#ギオペ
  281.     -198=> ["em1","em4","em5","em10","em12","em16","em22","em23","em26","em30"],#デューク
  282.     -199=> ["em1","em4","em8","em14","em19","em30","em32","em34"],#バロン
  283.     -200=> ["en1","en2","en4","en7","en12","en22","en23"],#バロン
  284.     -201=> ["dm1","dm8","dm18","dm19","dm23","dm25","dm33"],#ヒーロー
  285.     -202=> ["dm1","dm2","dm8","dm13","dm19","dm20","dm24","dm25","dm34"],#ヒーロー
  286.     -203=> ["dn1","dn2","dn3","dn7","dn10","dn12","dn22","dn23"],#ヒーロー
  287.     -204=> ["dm1","dm8","dm16","dm18","dm19","dm23","dm25","dm33"],#ヒーロー
  288.     -205=> ["dm2","dm19","dn2","dn3","dn7","dn10","dn12","dn23"],#ヒーロー
  289.     -207=> ["am3","am4","am5","am10","am12","am22","am23","am32"],#W
  290.     -208=> ["am3","am4","am5","am10","am12","am18","am22","am23","am27","am32"],#W
  291.     -209=> ["an1","an2","an3","an4","an9","an12","an13","an16","an17","an22","an23"],#W
  292.     -214=> ["fm3","fm19","fm18","fm23","fn12","fn22"],#エンシ
  293.     -215=> ["fm3","fm19","fm18","fm23","fn12","fn22"],#エンシ
  294.     -216=> ["em1","em7","em8","em11","em13","em16","em17","em19","em34"],#雅
  295.     -217=> ["em24","em6","en1","en7","en22","en23"],#雅
  296.     -218=> ["em1","em7","em8","em11","em13","em16","em17","em19","em34"],#雅
  297.     -219=> ["em24","em6","en1","en7","en22","en23"],#雅
  298.     -220=> ["dm1","dm8","dm18","dm19","dm24","dm25","dm33","dn12"],#忍者
  299.     -221=> ["dm2","dm13","dm20","dn2","dn7","dn10","dn22"],#忍者
  300.     -222=> ["cm1","cm2","cm4","cm8","cm19","cm23","cm33","cm34"],#河童
  301.     -223=> ["cn1","cn3","cn7","cn10","cn12","cn22","cn20"],#河童
  302.     -224=> ["am1","am8","am13","am19","am21","am30"],#怨霊
  303.     -225=> ["an1","an7","an10","an12","an22"],#怨霊
  304.     -226=> ["em1","em7","em8","em11","em17","em19","em30"],#武士子
  305.     -227=> ["en1","en2","en4","en7","en10","en22","en23"],#武士子
  306.     },
  307.   
  308.   :evasion => {
  309.   # ◆ 回避
  310.   },
  311.   
  312.   :miss => {
  313.   # ◆ ミス
  314.     1 => [],
  315.   },
  316.   
  317.   :use_item => {
  318.   # ◆ アイテム使用
  319.   # エネミー未対応
  320.     1 => [],
  321.   },
  322.   
  323.   :use_skill => {
  324.   # ◆ スキル使用
  325.     1 => [],
  326.   },
  327.   
  328.   :dead => {
  329.   # ◆ 戦闘不能
  330.     1 => [],
  331.   },
  332.   
  333.   :recovery => {
  334.   # ◆ 自分以外の仲間からの回復
  335.   # HP の回復, バッドステートの解除
  336.     1 => [],
  337.   },
  338.   
  339.   :support_state => {
  340.   # ◆ 自分以外の仲間からのサポートステート付加
  341.     1 => [],
  342.   },
  343.   
  344.   :bad_state => {
  345.   # ◆ バッドステートが付加
  346.   # バッドステート解除、サポートステート付加よりも優先されます。
  347.     1 => [],
  348.     -33=> [],
  349.   },
  350.   
  351.   :victory_normal => {
  352.   # ◆ 勝利:通常(生存メンバーからランダムで一人選んで再生されます)
  353.   # エネミー未対応
  354.     1 => [],
  355.   },
  356.   
  357.   :victory_pinch => {
  358.   # ◆ 勝利:ピンチ(生存メンバーからランダムで一人選んで再生されます)
  359.   # 勝利時にピ戦闘不能のメンバーが一人でもいる場合に再生
  360.   # エネミー未対応
  361.     1 => [],
  362.   },
  363.   
  364.   :victory_perfect => {
  365.   # ◆ 勝利:ノーダメージ(生存メンバーからランダムで一人選んで再生されます)
  366.   # ピンチよりも優先されます。
  367.   # エネミー未対応
  368.     1 => [],
  369.   },
  370.   
  371.   :escape => {
  372.   # ◆ 逃走(アクター側は生存メンバーからランダムで一人選んで再生されます)
  373.     1 => [],
  374.   },
  375. }

  376. # ◆ 沈黙ステートID
  377. # ここに登録されたステートが付加しているキャラクターのボイスは
  378. # 再生されなくなります。(沈黙や睡眠など....)
  379. SILENT_STATES = []

  380. # ◆ ボイス再生を無効化するスイッチ番号
  381. # ここで指定したスイッチが ON の場合、全てのボイスが再生されなくなります。
  382. SILENT_SWITCH = 13

  383. # ◆ ボイスの音量
  384. VOICE_VOLUME = 90

  385. # ◆ ボイス再生直後に挟むウェイト
  386. # ボイスファイルの頭に無音帯がある等の理由で
  387. # タイミングが合わない場合に利用してください(0~15程度が無難)。
  388. # 必要ない場合は 0 に。
  389. VOICE_WAIT = 10

  390. end
  391. class Window_BattleLog < Window_Selectable
  392. # ◆ サポートステート定義 (パラメーター上昇系など....)
  393. SUPPORT_STATES = [14, 15, 16, 21, 22, 23]

  394. # ◆ バッドステート定義 (毒や麻痺など....)
  395. BAD_STATES = [2, 3, 4, 5, 6, 7, 8]

  396. end
  397. #===========================================
  398. #   ここまで
  399. #===========================================

  400. $rsi ||= {}
  401. $rsi["バトルボイス"] = true

  402. class RPG::UsableItem < RPG::BaseItem
  403.   def play_voice?
  404.     [email protected]?("使用ボイス無し")
  405.   end
  406. end

  407. module BattleVoice
  408.   module_function
  409.   #--------------------------------------------------------------------------
  410.   # ● 生存しておりボイス再生可能なメンバーからランダムで取得
  411.   #--------------------------------------------------------------------------
  412.   def get_rand_member_id(scene_symbol)
  413.     battler = $game_party.alive_members.select{|member|
  414.       if !VOICE_LIST[scene_symbol].has_key?(member.voice_id)
  415.         false
  416.       elsif SILENT_STATES.empty?
  417.         true
  418.       else
  419.         !silent_battler?(member)
  420.       end
  421.     }.sample
  422.     battler ? battler.voice_id : 0
  423.   end
  424.   #--------------------------------------------------------------------------
  425.   # ● ボイス再生不可判定
  426.   #--------------------------------------------------------------------------
  427.   def silent_battler?(battler)
  428.     SILENT_STATES.any?{|state_id| battler.state?(state_id)}
  429.   end
  430.   #--------------------------------------------------------------------------
  431.   # ● 再生するファイル名の取得(nilが返る場合は再生されません)
  432.   #--------------------------------------------------------------------------
  433.   def get_filename(scene_symbol, key)
  434.     if VOICE_LIST[scene_symbol][key]
  435.       VOICE_LIST[scene_symbol][key].sample
  436.     else
  437.       nil
  438.     end
  439.   end
  440.   #--------------------------------------------------------------------------
  441.   # ● バトルボイスの再生
  442.   #--------------------------------------------------------------------------
  443.   def play(scene_symbol, battler = nil)
  444.     unless $game_switches[SILENT_SWITCH]
  445.       if battler
  446.         key = battler.actor? ? battler.voice_id : (battler.enemy_id * -1)
  447.         return if silent_battler?(battler)
  448.       else
  449.         key = get_rand_member_id(scene_symbol)
  450.       end
  451.       filename = get_filename(scene_symbol, key)
  452.       if filename
  453.         Audio.se_play('Audio/VOICE/' + filename, VOICE_VOLUME, 100)
  454.         wait(VOICE_WAIT)
  455.       end
  456.     end
  457.   end
  458.   #--------------------------------------------------------------------------
  459.   # ● ウェイト
  460.   #--------------------------------------------------------------------------
  461.   def wait(duration)
  462.     SceneManager.scene.wait(VOICE_WAIT)
  463.   end
  464. end

  465. class << BattleManager
  466.   #--------------------------------------------------------------------------
  467.   # ● 戦闘開始
  468.   #--------------------------------------------------------------------------
  469.   alias battle_start_voice_plus battle_start
  470.   def battle_start
  471.     $game_temp.no_damage = true
  472.     $game_party.on_battle_start
  473.     if @preemptive
  474.       BattleVoice.play(:battle_start_preemptive)
  475.     elsif @surprise
  476.       BattleVoice.play(:battle_start_surprise)
  477.     elsif $game_party.pinch?
  478.       BattleVoice.play(:battle_start_pinch)
  479.     else
  480.       BattleVoice.play(:battle_start_normal)
  481.     end
  482.     battle_start_voice_plus
  483.   end
  484.   #--------------------------------------------------------------------------
  485.   # ● 勝利の処理
  486.   #--------------------------------------------------------------------------
  487.   alias process_victory_voice_plus process_victory
  488.   def process_victory
  489.     if $game_temp.no_damage
  490.       BattleVoice.play(:victory_perfect)
  491.     elsif $game_party.pinch?
  492.       BattleVoice.play(:victory_pinch)
  493.     else
  494.       BattleVoice.play(:victory_normal)
  495.     end
  496.     process_victory_voice_plus
  497.   end
  498.   #--------------------------------------------------------------------------
  499.   # ● 逃走の処理   ※再定義
  500.   #--------------------------------------------------------------------------
  501.   def process_escape
  502.     $game_message.add(sprintf(Vocab::EscapeStart, $game_party.name))
  503.     success = @preemptive ? true : (rand < @escape_ratio)
  504.     Sound.play_escape
  505.     if success
  506.       BattleVoice.play(:escape)
  507.       process_abort
  508.     else
  509.       @escape_ratio += 0.1
  510.       $game_message.add('\.' + Vocab::EscapeFailure)
  511.       $game_party.clear_actions
  512.     end
  513.     wait_for_message
  514.     return success
  515.   end
  516. end

  517. class Game_Temp
  518.   #--------------------------------------------------------------------------
  519.   # ● 公開インスタンス変数
  520.   #--------------------------------------------------------------------------
  521.   attr_accessor :no_damage  # 戦闘中ノーダメージフラグ
  522.   #--------------------------------------------------------------------------
  523.   # ● オブジェクト初期化
  524.   #--------------------------------------------------------------------------
  525.   alias initialize_voice_plus initialize
  526.   def initialize
  527.     initialize_voice_plus
  528.     @no_damage = true
  529.   end
  530. end

  531. class Game_Action
  532.   #--------------------------------------------------------------------------
  533.   # ● 防御判定
  534.   #--------------------------------------------------------------------------
  535.   def guard?
  536.     item == $data_skills[subject.guard_skill_id]
  537.   end
  538. end

  539. class Game_ActionResult
  540.   #--------------------------------------------------------------------------
  541.   # ● 公開インスタンス変数
  542.   #--------------------------------------------------------------------------
  543.   attr_accessor :added_new_states
  544.   #--------------------------------------------------------------------------
  545.   # ● ステータス効果のクリア
  546.   #--------------------------------------------------------------------------
  547.   alias clear_status_effects_voice_plus clear_status_effects
  548.   def clear_status_effects
  549.     @added_new_states = []
  550.     clear_status_effects_voice_plus
  551.   end
  552. end

  553. class Game_Battler < Game_BattlerBase
  554.   #--------------------------------------------------------------------------
  555.   # ● 新しいステートの付加
  556.   #--------------------------------------------------------------------------
  557.   alias add_new_state_voice_plus add_new_state
  558.   def add_new_state(state_id)
  559.     @result.added_new_states.push(state_id).uniq!
  560.     add_new_state_voice_plus(state_id)
  561.   end
  562. end

  563. class Game_Actor < Game_Battler
  564.   #--------------------------------------------------------------------------
  565.   # ● 公開インスタンス変数
  566.   #--------------------------------------------------------------------------
  567.   attr_accessor :voice_id
  568.   #--------------------------------------------------------------------------
  569.   # ● セットアップ
  570.   #--------------------------------------------------------------------------
  571.   alias setup_voice_plus setup
  572.   def setup(actor_id)
  573.     setup_voice_plus(actor_id)
  574.     @voice_id = @actor_id
  575.   end
  576.   #--------------------------------------------------------------------------
  577.   # ● 被ダメージ時の処理
  578.   #--------------------------------------------------------------------------
  579.   def on_damage(value)
  580.     super(value)
  581.     $game_temp.no_damage = false
  582.   end
  583.   #--------------------------------------------------------------------------
  584.   # ● ダメージ効果の実行
  585.   #--------------------------------------------------------------------------
  586.   alias perform_damage_effect_voice_plus perform_damage_effect
  587.   def perform_damage_effect
  588.     BattleVoice.play(:damage, self) unless dead?
  589.     perform_damage_effect_voice_plus
  590.   end
  591.   #--------------------------------------------------------------------------
  592.   # ● HP の再生
  593.   #--------------------------------------------------------------------------
  594.   def regenerate_hp
  595.     super
  596.     $game_temp.no_damage = false if @result.hp_damage > 0
  597.   end
  598.   #--------------------------------------------------------------------------
  599.   # ● コラプス効果の実行
  600.   #--------------------------------------------------------------------------
  601.   alias perform_collapse_effect_voice_plus perform_collapse_effect
  602.   def perform_collapse_effect
  603.     perform_collapse_effect_voice_plus
  604.     BattleVoice.play(:dead, self) if $game_party.in_battle
  605.   end
  606. end

  607. class Game_Enemy < Game_Battler
  608.   #--------------------------------------------------------------------------
  609.   # ● ダメージ効果の実行
  610.   #--------------------------------------------------------------------------
  611.   alias perform_damage_effect_voice_plus perform_damage_effect
  612.   def perform_damage_effect
  613.     BattleVoice.play(:damage, self) unless dead?
  614.     perform_damage_effect_voice_plus
  615.   end
  616.   #--------------------------------------------------------------------------
  617.   # ● コラプス効果の実行
  618.   #--------------------------------------------------------------------------
  619.   alias perform_collapse_effect_voice_plus perform_collapse_effect
  620.   def perform_collapse_effect
  621.     perform_collapse_effect_voice_plus
  622.     BattleVoice.play(:dead, self)
  623.   end
  624.   #--------------------------------------------------------------------------
  625.   # ● 逃げる
  626.   #--------------------------------------------------------------------------
  627.   def escape
  628.     BattleVoice.play(:escape, self)
  629.     super
  630.   end
  631. end

  632. class Game_Party < Game_Unit
  633.   #--------------------------------------------------------------------------
  634.   # ● ピンチ状態判定
  635.   #--------------------------------------------------------------------------
  636.   def pinch?
  637.     !dead_members.empty?
  638.   end
  639. end

  640. class Game_Interpreter
  641.   #--------------------------------------------------------------------------
  642.   # ● アクターのボイス変更
  643.   #--------------------------------------------------------------------------
  644.   def change_voice(actor_id, voice_id)
  645.     $game_actors[actor_id].voice_id = voice_id
  646.   end
  647. end

  648. class Window_BattleLog < Window_Selectable  
  649.   #--------------------------------------------------------------------------
  650.   # ● ダメージの表示
  651.   #--------------------------------------------------------------------------
  652.   alias display_damage_voice_plus display_damage
  653.   def display_damage(target, item)
  654.     subject = SceneManager.scene.subject
  655.     if target.result.missed
  656.       BattleVoice.play(:miss, subject)
  657.     elsif target.result.evaded
  658.       BattleVoice.play(:evasion, target)
  659.     else
  660.       if subject != target && subject.actor? == target.actor? && !target.dead? &&
  661.         (target.result.hp_damage < 0 || target.result.mp_damage < 0 || target.result.tp_damage < 0)
  662.         BattleVoice.play(:recovery, target)
  663.       end
  664.     end
  665.     display_damage_voice_plus(target, item)
  666.   end
  667.   #--------------------------------------------------------------------------
  668.   # ● 影響を受けたステータスの表示
  669.   #--------------------------------------------------------------------------
  670.   alias display_affected_status_voice_plus display_affected_status
  671.   def display_affected_status(target, item)
  672.     if item && target.result.status_affected?
  673.       subject = SceneManager.scene.subject
  674.       if subject != target
  675.         if target.result.added_new_states.any?{|id| BAD_STATES.include?(id)}
  676.           BattleVoice.play(:bad_state, target)
  677.         elsif subject.actor? == target.actor?
  678.           if target.result.removed_states.any?{|id| BAD_STATES.include?(id)}
  679.             BattleVoice.play(:recovery, target)
  680.           elsif target.result.added_new_states.any?{|id| SUPPORT_STATES.include?(id)}
  681.             BattleVoice.play(:support_state, target)
  682.           end
  683.         end
  684.       end
  685.     end
  686.     display_affected_status_voice_plus(target, item)
  687.   end
  688. end

  689. class Scene_Battle < Scene_Base
  690.   #--------------------------------------------------------------------------
  691.   # ● 公開インスタンス変数
  692.   #--------------------------------------------------------------------------
  693.   attr_reader   :subject
  694.   #--------------------------------------------------------------------------
  695.   # ● スキル/アイテムの使用
  696.   #--------------------------------------------------------------------------
  697.   alias use_item_voice_plus use_item
  698.   def use_item
  699.     if @subject.current_action.attack?
  700.       BattleVoice.play(:attack, @subject)
  701.     elsif @subject.current_action.guard?
  702.       BattleVoice.play(:guard, @subject)
  703.     else
  704.       if @subject.current_action.item.play_voice?
  705.         case @subject.current_action.item
  706.         when RPG::Item
  707.           BattleVoice.play(:use_item, @subject)
  708.         when RPG::Skill
  709.           BattleVoice.play(:use_skill, @subject)
  710.         end
  711.       end
  712.     end
  713.     use_item_voice_plus
  714.   end
  715. end
复制代码
请问我想在一个事件后面播放出一次
BattleVoice.play(:damage  的音效,该如何用脚本调用
这里的damage音效已经分配了按ID的随机,不能用Audio.bgs_play达到目的了
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-16 16:17

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表