查看: 8866|回复: 23

[原创发布] 【小天搬运】RMXP、VX的几个脚本。

[复制链接]
梦石
0
星屑
1166
在线时间
127 小时
注册时间
2013-2-16
回帖
368
发表于 2013-4-30 19:03:06 | 显示全部楼层 |阅读模式

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

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

×
前言                                                                                                                                                                                                     
自从来到66rpg,就没有对这个站带来多大的贡献,于是今天我看到了一个RPG脚本日站,发现里面有很多66里没有的脚
本,所以就把他们的脚本借鉴一下。
然后呢,我想把这些脚本分享给大家使用,有些字翻译的不对,望多多原谅!
我终于上传完成了,一共用了1个多小时,大家不表示表示吗?@eve592370698 @guaneva @Mic_洛洛 @protosssonny @后知后觉 @失落迷白 @小小刀886
XP脚本                                                                                             脚本                                                                                                
1、显示气球消息               √      
介绍:卡通气球消息窗口显示。
 我有自动调整大小和字符以下功能。
2、显示气球对话                √     
介绍:尽可能加装任何消息窗口几乎
 显示气球。
 功能依赖于消息显示系统结合使用的脚本。
3、图形变化几许           √         
介绍:要执行任何关键的冲刺移动,
 你可以改变的第一个字符的图形划线时间。
4、武器技能                     √      
介绍:限制可用的技能,每种类型的武器装备。
5、8运动图形变化         √          
介绍:它使8方向移动的同时按下左右键和向上和向下箭头键,
 你可以改变的第一个字符的图形对角线移动时。
6、中断保存            √                
介绍:这是一个功能来结束暂时存储的数据播放。
 重新启动中断的数据可以从标题画面,
 然后消失,一旦恢复。
7、状态显示增加        √             
介绍:“状态全部名称显示”,“巴特勒/图形显示图片” 三件套“类名隐藏”。
8、活动时间战斗          √           
介绍:继续加点(CT)是基于巴特勒实时的速度,战斗形式从巴特勒CT计行事积累。改   
9、基于自定义窗口       √           
介绍:修改的背景和文字颜色的窗口平铺。   
10、一块画面的背景    √            
介绍:通过使用全景,让你可以使用作为背景图像一块图片。
11、伤害个性订制        √           
介绍:改变的伤害显示的字体。
12、垂直类型的战斗状态   √      
介绍:这是一个独立的状态显示部的活动时间的战斗。   
VX脚本                                                                                                                                                                                                  
13、标题画面订制         √          
介绍:改变的菜单或使用,信的标题屏幕上的图像的菜单命令。
14、字体变化             √            
介绍:可以更改使用的字体的字符显示。
小天说明                                                                                                                                                                                       
现在什么都弄好了,我会定期更新的,而更新的都会是一些6R里没有的内容,也可能有,但是有点不同。还有我的这个
帖子和图书馆不同,因为我的内容不全面,不整齐等等,只不过是自己搜的一些脚本。谢谢大家使用。
还有,请人来支持一下是必须的!
@sprite @零の使魔 @草莓 @后知后觉 @Mic_洛洛 @失落迷白 @柳之一 @永远の路克酱 @eve592370698 @guaneva @protosssonny @小小刀886 @紫英晓狼 @论坛助理

  
QQ截图20130430204444_副本.png

点评

LBQ
继续吐槽。。这个不叫做原创=-=  发表于 2013-5-1 09:49
LBQ
阁下不要用机器翻译误导大众好不好。。。  发表于 2013-5-1 09:48
LBQ
character=>字符 真的大丈夫?  发表于 2013-5-1 09:48

评分

参与人数 1星屑 +15 收起 理由
紫英晓狼1130 + 15 很好

查看全部评分

小天终于要填个新坑了,这个游戏的名字是《欲望恶魔~游侠传记》
剧情:★☆☆☆☆☆☆☆☆☆
脚本:★☆☆☆☆☆☆☆☆☆
素材:☆☆☆☆☆☆☆☆☆☆
预计明年这一个浩大的工程既可以完工了。。有木有支持的!?制作工具:RMVA
梦石
0
星屑
1166
在线时间
127 小时
注册时间
2013-2-16
回帖
368
 楼主| 发表于 2013-4-30 19:08:48 | 显示全部楼层
本帖最后由 1142881837 于 2013-4-30 19:13 编辑

1、显示气球消息                                                           

[摘要]它会自动调整的消息窗口,可以显示您指定的字符上。
还有一个功能,您可以在一个小窗口中显示的字符名称,逐个字符显示一条消息。

[脚本]
  1. #==============================================================================
  2. # ++ メッセージふきだし表示 ver. 2.01 ++
  3. #  Script by パラ犬
  4. #  [url=http://2d6.parasite.jp/]http://2d6.parasite.jp/[/url]
  5. #------------------------------------------------------------------------------
  6. # ふきだし表示をするには、
  7. # テール用画像「(スキン名)-top」「(スキン名)-under」を
  8. # 「Graphics/Windowskins」フォルダにインポートしておく必要があります。
  9. #------------------------------------------------------------------------------
  10. #
  11. # [ふきだし表示の使い方]
  12. # イベントコマンド「スクリプト」で「$mes_id」にイベントIDを代入することで
  13. # そのイベントにふきだしがポップするようになります。
  14. # (記述例: $mes_id=4 )
  15. # IDに-1を代入するとプレイヤー、0でそのイベント自身。
  16. # nilまたは""を代入すると、通常のメッセージ表示に戻ります。
  17. # 表示位置はイベント「文章オプション」で変更できます。
  18. # 表示位置に「中央」を指定すると、イベントの位置に関係なく
  19. # 画面中央に表示されます。
  20. #
  21. # [名前ウインドウの使い方]
  22. # イベントコマンド「スクリプト」で「$mes_name」に文字列を代入することで
  23. # 名前ウインドウを表示します。
  24. # (記述例: $mes_name="アルシェス" )
  25. # 制御文字 \N[n] を使用する場合、\は\\と記述してください。
  26. # (記述例: $mes_name="\\N[1]"  $mes_name="\\N[\\V[1]]")
  27. # ""またはnilを代入すると、非表示になります。
  28. #
  29. # 二つの機能は独立していますので、それぞれ単体で使えます。
  30. #  $mes_id=(ID) + $mes_name="名前"  :ふきだし表示 + 名前ウインドウ
  31. #  $mes_id=(ID) + $mes_name=""      :ふきだし表示 (名前なし)
  32. #  $mes_id=nil + $mes_name="名前"   :デフォルトウインドウ + 名前ウインドウ
  33. #  $mes_id=nil + $mes_name=""       :デフォルトウインドウ (名前なし)
  34. #
  35. # [メッセージ表示スピードの変更法]
  36. # イベントコマンド「スクリプト」で「$mes_speed」に数値を代入します。
  37. # 0を代入すると瞬間表示になります。
  38. # (記述例: $mes_speed = 1 )
  39. #
  40. # [オートメッセージ送り]
  41. # イベントコマンド「スクリプト」で「$mes_auto」に数値を代入します。
  42. # 数値はメッセージ描画終了後のウエイトのフレーム数です。
  43. # nilを代入すると、オートモードが解除されます。
  44. #
  45. # [追加制御文字]
  46. # \I[ファイル名]   アイコンの描画
  47. #     「Graphics/Icons」内の画像を表示します。( 記述例:\I[001-Weapon01] )
  48. # \S[n]     メッセージスピードの変更
  49. # \size[n]  フォントサイズの変更
  50. #
  51. #==============================================================================

  52. module FUKI
  53.   
  54.   # スキンの設定
  55.   # ウインドウスキンと同じものを使うときは「""」
  56.   FUKI_SKIN_NAME = "001-Blue01"   # ふきだし用スキン
  57.   NAME_SKIN_NAME = "001-Blue01"   # 名前表示用スキン
  58.   
  59.   # フォントサイズ
  60.   MES_FONT_SIZE = 22    # ふきだし
  61.   NAME_FONT_SIZE = 14   # 名前ウインドウ
  62.   
  63.   # 文字色
  64.   #( Color.new(0, 0, 0, 0)を指定すると、通常文字色を使用します )
  65.   FUKI_COLOR = Color.new(255, 255, 255, 255)  # ふきだしウインドウ
  66.   NAME_COLOR = Color.new(255, 255, 255, 255)  # 名前ウインドウ
  67.   
  68.   # ウインドウの透明度
  69.   FUKI_OPACITY = 255    # ふきだしウインドウ
  70.   MES_OPACITY = 255     # 通常のメッセージウインドウ
  71.   NAME_OPACITY = 255    # 名前ウインドウ
  72.   
  73.   # 名前ウインドウの相対位置
  74.   NAME_SHIFT_X = 0    # 横位置
  75.   NAME_SHIFT_Y = 16   # 縦位置
  76.   
  77.   # 画面上下からウインドウがはみ出す時は、
  78.   # 自動で表示位置(上下)をチェンジ( true / false )
  79.   POS_FIX = true

  80.   # 画面の一番端ではふきだしを少しずらす
  81.   # 角の丸いスキンを使っていて、枠の角がふきだしと重なる場合に true にする
  82.   CORNER_SHIFT = false
  83.   SHIFT_PIXEL = 4   # trueの時にずらすピクセル数
  84.   
  85.   # キャラクターの縦のサイズ
  86.   CHARACTOR_HEIGHT = 48
  87.   # ふきだしの相対位置(縦位置)
  88.   POP_SHIFT_TOP = 0     # 表示位置が上のとき
  89.   POP_SHIFT_UNDER = -16   # 表示位置が下のとき
  90.   
  91.   # メッセージ表示速度(数字が小さいほど速い。0で瞬間表示)
  92.   # $mes_speedに数値を代入することで、ゲーム中に変更可。
  93.   MES_SPEED = 1
  94.   
  95.   # メッセージスキップを使用するか
  96.   MES_SKIP = true     #( true:有効 / false:無効 )
  97.   # メッセージスキップに使うボタン(表記方法は、Input::(ボタン))
  98.   #(キーボードとの対応表はツクールのヘルプ「ゲームの操作方法」にあります)
  99.   MES_SKIP_KEY = Input::A
  100.   # メッセージスキップ禁止イベントスイッチID
  101.   # (イベントコマンド「スイッチの操作」でこの番号のスイッチをONにしている間は
  102.   #  メッセージスキップを機能を無効にします)
  103.   NO_MES_SKIP_SWITCH = 999

  104. end

  105. #==============================================================================
  106. # ■ Window_Message
  107. #------------------------------------------------------------------------------
  108. #  文章表示に使うメッセージウィンドウです。
  109. #==============================================================================

  110. class Window_Message < Window_Selectable
  111.   #--------------------------------------------------------------------------
  112.   # ● オブジェクト初期化
  113.   #--------------------------------------------------------------------------
  114.   alias alias_para_fuki_initialize initialize
  115.   def initialize
  116.     # エイリアスを呼び戻す
  117.     alias_para_fuki_initialize
  118.     # 変数をセット
  119.     [url=home.php?mod=space&uid=133944]@w[/url] = 0
  120.     @h = 0
  121.     [url=home.php?mod=space&uid=36110]@Wait[/url] = 0
  122.     @dx = 0
  123.     @dy = 0
  124.     @dh = 0
  125.     $mes_speed = FUKI::MES_SPEED
  126.   end
  127.   #--------------------------------------------------------------------------
  128.   # ● ウィンドウの位置と不透明度の設定
  129.   #--------------------------------------------------------------------------
  130.   alias alias_para_fuki_reset_window reset_window
  131.   def reset_window
  132.     # エイリアスを呼び戻す
  133.     alias_para_fuki_reset_window
  134.     self.back_opacity = FUKI::MES_OPACITY
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # ● フレーム更新
  138.   #--------------------------------------------------------------------------
  139.   def update
  140.     super
  141.     # ふきだしモードではイベントの動きに追従
  142.     if @tale != nil
  143.       pos = get_fuki_pos(self.width, self.height)
  144.       self.x = pos[0]
  145.       self.y = pos[1]
  146.       tale_pos = get_tale_pos
  147.       @tale.x = tale_pos[0]
  148.       @tale.y = tale_pos[1]
  149.       if @name_win != nil
  150.         name_height = FUKI::NAME_FONT_SIZE
  151.         @name_win.x = self.x + FUKI::NAME_SHIFT_X
  152.         @name_win.y = self.y - name_height - 16 + FUKI::NAME_SHIFT_Y
  153.         @name_contents.x = @name_win.x + 12
  154.         @name_contents.y = @name_win.y + 8
  155.       end
  156.     end
  157.     # メッセージスキップ
  158.     if mes_skip?
  159.       self.contents_opacity = 255
  160.       if @name_win != nil
  161.         @name_win.opacity = 255
  162.       end
  163.       if @tale != nil
  164.         @tale.opacity = 255
  165.       end
  166.       if @input_number_window != nil
  167.         @input_number_window.contents_opacity = 255
  168.       end
  169.       @fade_in = false
  170.     end
  171.     # フェードインの場合
  172.     if @fade_in
  173.       self.contents_opacity += 24
  174.       if @name_win != nil
  175.         @name_win.opacity += 24
  176.       end
  177.       if @tale != nil
  178.         @tale.opacity += 24
  179.       end
  180.       if @input_number_window != nil
  181.         @input_number_window.contents_opacity += 24
  182.       end
  183.       if self.contents_opacity == 255
  184.         @fade_in = false
  185.       end
  186.       return
  187.     end
  188.     # メッセージ表示中の場合
  189.     if @contents_drawing
  190.         # 一文字ずつ描画
  191.         refresh_drawtext
  192.       return
  193.     end
  194.     # 数値入力中の場合
  195.     if @input_number_window != nil
  196.       @input_number_window.update
  197.       # 決定
  198.       if Input.trigger?(Input::C)
  199.         $game_system.se_play($data_system.decision_se)
  200.         $game_variables[$game_temp.num_input_variable_id] =
  201.           @input_number_window.number
  202.         $game_map.need_refresh = true
  203.         # 数値入力ウィンドウを解放
  204.         @input_number_window.dispose
  205.         @input_number_window = nil
  206.         terminate_message
  207.       end
  208.       return
  209.     end
  210.     # メッセージ表示終了の場合
  211.     if @contents_showing_end
  212.       # メッセージスキップ判定
  213.       if mes_skip?
  214.         # 選択肢の表示中でなければメッセージウインドウを閉じる
  215.         if $game_temp.choice_max == 0
  216.           terminate_message
  217.           # ふきだしを破棄
  218.           del_fukidasi
  219.           return
  220.         end
  221.       end
  222.       # オートモード
  223.       if @mes_auto != nil
  224.         if @mes_auto <= 0
  225.           terminate_message
  226.           # ふきだしを破棄
  227.           del_fukidasi
  228.           @mes_auto = nil
  229.         else
  230.           @mes_auto -= 1
  231.         end
  232.       end
  233.       # 選択肢の表示中でなければポーズサインを表示
  234.       # ふきだしモードでは非表示
  235.       if $game_temp.choice_max == 0 and @tale == nil
  236.         self.pause = true
  237.       else
  238.         self.pause = false
  239.       end
  240.       # キャンセル
  241.       if Input.trigger?(Input::B)
  242.         if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  243.           $game_system.se_play($data_system.cancel_se)
  244.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  245.           terminate_message
  246.         end
  247.       end
  248.       # 決定
  249.       if Input.trigger?(Input::C) and $mes_auto == nil
  250.         if $game_temp.choice_max > 0
  251.           $game_system.se_play($data_system.decision_se)
  252.           $game_temp.choice_proc.call(self.index)
  253.         end
  254.         terminate_message
  255.         # ふきだしを破棄
  256.         del_fukidasi
  257.       end
  258.       return
  259.     end
  260.     # フェードアウト中以外で表示待ちのメッセージか選択肢がある場合
  261.     if @fade_out == false and $game_temp.message_text != nil
  262.       @contents_showing = true
  263.       $game_temp.message_window_showing = true
  264.       reset_window
  265.       refresh_create
  266.       if @name_win != nil
  267.         @name_win.opacity = 0
  268.       end
  269.       if @tale != nil
  270.         @tale.opacity = 0
  271.       end
  272.       Graphics.frame_reset
  273.       self.visible = true
  274.       self.contents_opacity = 0
  275.       if @input_number_window != nil
  276.         @input_number_window.contents_opacity = 0
  277.       end
  278.       @fade_in = true
  279.       @mes_auto = $mes_auto
  280.       return
  281.     end
  282.     # 表示すべきメッセージがないが、ウィンドウが可視状態の場合
  283.     if self.visible
  284.       @fade_out = true
  285.       self.opacity -= 48
  286.       if @name_win != nil
  287.         @name_win.opacity -= 48
  288.       end
  289.       if @tale != nil
  290.         @tale.opacity -= 48
  291.       end
  292.       if self.opacity == 0
  293.         self.visible = false
  294.         @fade_out = false
  295.         $game_temp.message_window_showing = false
  296.         del_fukidasi
  297.       end
  298.       return
  299.     end
  300.   end
  301.   #--------------------------------------------------------------------------
  302.   # ● メッセージ終了処理
  303.   #--------------------------------------------------------------------------
  304.   alias alias_para_fuki_terminate_message terminate_message
  305.   def terminate_message
  306.     # エイリアスを呼び戻す
  307.     alias_para_fuki_terminate_message
  308.     @contents_showing_end = false
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   # ● カーソルの矩形更新
  312.   #--------------------------------------------------------------------------
  313.   def update_cursor_rect
  314.     if @index >= 0
  315.       n = $game_temp.choice_start + @index
  316.       font_size = self.contents.font.size
  317.       self.cursor_rect.set(8, n*(font_size+10)-5, @cursor_width, (font_size+10))
  318.     else
  319.       self.cursor_rect.empty
  320.     end
  321.   end
  322.   #--------------------------------------------------------------------------
  323.   # ○ メッセージスキップ有効判定
  324.   #--------------------------------------------------------------------------
  325.   def mes_skip?
  326.     if FUKI::MES_SKIP == true and Input.repeat?(FUKI::MES_SKIP_KEY) and $game_switches[FUKI::NO_MES_SKIP_SWITCH] == false
  327.       return true
  328.     else
  329.       return false
  330.     end
  331.   end
  332.   #--------------------------------------------------------------------------
  333.   # ○ サイズを決定してウインドウを作成
  334.   #--------------------------------------------------------------------------
  335.   def refresh_create
  336.     self.contents.clear
  337.     self.contents.font.color = normal_color
  338.     self.contents.font.size = FUKI::MES_FONT_SIZE
  339.     # ウインドウサイズを取得
  340.     get_windowsize
  341.     w = [url=home.php?mod=space&uid=133944]@w[/url] + 32 + 8
  342.     h = @h + 26
  343.     # ふきだしウインドウを作成
  344.     set_fukidasi(self.x, self.y, w, h)
  345.     # 名前ウインドウを作成
  346.     set_namewindow
  347.     # メッセージ表示用変数の初期化
  348.     @dx = @dy = @dh = @max_font_h = 0
  349.     @cursor_width = 0
  350.     @contents_drawing = true
  351.     # メッセージスピードの初期化
  352.     @mes_speed = $mes_speed
  353.     # フォントサイズの初期化
  354.     self.contents.font.size = FUKI::MES_FONT_SIZE
  355.     @max_font_h = self.contents.font.size
  356.     # 文字描画
  357.     refresh_drawtext
  358.   end
  359.   #--------------------------------------------------------------------------
  360.   # ○ 一文字ずつ描画
  361.   #--------------------------------------------------------------------------
  362.   def refresh_drawtext
  363.     if $game_temp.message_text != nil
  364.       # メッセージスキップがオンなら
  365.       if mes_skip?
  366.         # 描画が終わるまで描画処理をループ
  367.         while $game_temp.message_text != ""
  368.           draw_massage
  369.         end
  370.       # メッセージスピードが0なら
  371.       elsif @mes_speed == 0
  372.         # 描画が終わるかメッセージスピードが変更されるまで描画処理をループ
  373.         while $game_temp.message_text != "" and @mes_speed == 0
  374.           draw_massage
  375.         end
  376.       else
  377.         if [url=home.php?mod=space&uid=36110]@Wait[/url] > 0
  378.           @wait -= 1
  379.         elsif @wait == 0
  380.           # 描画処理
  381.           draw_massage
  382.           @wait = @mes_speed
  383.         end
  384.       end
  385.     end
  386.     # 描画終了
  387.     if $game_temp.message_text == ""
  388.       draw_opt_text
  389.       @contents_showing_end = true
  390.       @contents_drawing = false
  391.     end
  392.   end
  393.   #--------------------------------------------------------------------------
  394.   # ○ ウインドウサイズを取得
  395.   #--------------------------------------------------------------------------
  396.   def get_windowsize
  397.     x = y = 0
  398.     @h = @w = 0
  399.     max_font_h = self.contents.font.size
  400.     @cursor_width = 0
  401.     # 選択肢なら字下げを行う
  402.     if $game_temp.choice_start == 0
  403.       x = 16
  404.     end
  405.     # 表示待ちのメッセージがある場合
  406.     if $game_temp.message_text != nil
  407.     text = $game_temp.message_text.clone
  408.       # 制御文字処理
  409.       begin
  410.         last_text = text.clone
  411.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  412.       end until text == last_text
  413.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  414.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  415.       end
  416.       # 便宜上、"\\\" を "\000" に変換
  417.       text.gsub!(/\\\\/) { "\000" }
  418.       # "\\C" を "\001" に、"\\G" を "\002" に変換
  419.       text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001" }
  420.       text.gsub!(/\\[Gg]/) { "\002" }
  421.       # "\\I" を "\003" に変換
  422.       text.gsub!(/\\[Ii]\[(.*?)\]/) { "\003[#{$1}]" }
  423.       # "\\S" を "\004" に変換
  424.       text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\004[#{$1}]" }
  425.       # "\\size" を "\005" に変換
  426.       text.gsub!(/\\size\[([0-9]+)\]/) { "\005[#{$1}]" }
  427.       # c に 1 文字を取得 (文字が取得できなくなるまでループ)
  428.       while ((c = text.slice!(/./m)) != nil)
  429.         # \\ の場合
  430.         if c == "\000"
  431.           # 本来の文字に戻す
  432.           c = "\"
  433.         end
  434.         # \C[n] または \G の場合 または \S[n] のとき
  435.         if c == "\001" or c == "\002" or c == "\004"
  436.           # 次の文字へ
  437.           next
  438.         end
  439.         # 改行文字の場合
  440.         if c == "\n"
  441.           # y に 1 を加算
  442.           y += 1
  443.           # 縦横サイズを取得
  444.           @h += max_font_h + 10
  445.           max_font_h = 0
  446.           @w = x > @w ? x : @w
  447.           if y >= $game_temp.choice_start
  448.             @w = x + 8 > @w ? x + 8 : @w
  449.           end
  450.           x = 0
  451.           # 選択肢なら字下げを行う
  452.           if y >= $game_temp.choice_start
  453.             x = 8
  454.           end
  455.           # 次の文字へ
  456.           next
  457.         end
  458.         # \I[ファイル名] の場合
  459.         if c == "\003"
  460.           text.sub!(/\[(.*?)\]/, "")
  461.           bitmap = RPG::Cache.icon($1)
  462.           # x にアイコンの幅を加算
  463.           x += bitmap.width
  464.           # 次の文字へ
  465.           next
  466.         end
  467.         # \size[n] の場合
  468.         if c == "\005"
  469.           text.sub!(/\[([0-9]+)\]/, "")
  470.           # 文字サイズを変更
  471.           self.contents.font.size = $1.to_i
  472.           # 最大縦幅を取得
  473.           if self.contents.font.size > max_font_h
  474.             max_font_h = self.contents.font.size
  475.           end
  476.         end
  477.         # x に文字の幅を加算
  478.         x += self.contents.text_size(c).width
  479.         # 最大縦幅を取得
  480.         if self.contents.font.size > max_font_h
  481.           max_font_h = self.contents.font.size
  482.         end
  483.       end
  484.     end
  485.     # 文字サイズを戻す
  486.     self.contents.font.size = FUKI::MES_FONT_SIZE
  487.     # 数値入力の場合
  488.     if $game_temp.num_input_variable_id > 0
  489.       digits_max = $game_temp.num_input_digits_max
  490.       number = $game_variables[$game_temp.num_input_variable_id]
  491.       @h += 1
  492.       x = digits_max * self.contents.font.size + 16
  493.       @w = x > @w ? x : @w
  494.     end
  495.   end
  496.   #--------------------------------------------------------------------------
  497.   # ○ 描画処理
  498.   #--------------------------------------------------------------------------
  499.   def draw_massage
  500.     # 表示待ちのメッセージがある場合
  501.     if $game_temp.message_text != nil
  502.       text = $game_temp.message_text
  503.       # 制御文字処理
  504.       begin
  505.         last_text = text.clone
  506.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  507.       end until text == last_text
  508.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  509.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  510.       end
  511.       # 便宜上、"\\\" を "\000" に変換
  512.       text.gsub!(/\\\\/) { "\000" }
  513.       # "\\C" を "\001" に、"\\G" を "\002" に変換
  514.       text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  515.       text.gsub!(/\\[Gg]/) { "\002" }
  516.       # "\\I" を "\003" に変換
  517.       text.gsub!(/\\[Ii]\[(.*?)\]/) { "\003[#{$1}]" }
  518.       # "\\S" を "\004" に変換
  519.       text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\004[#{$1}]" }
  520.       # "\\size" を "\005" に変換
  521.       text.gsub!(/\\size\[([0-9]+)\]/) { "\005[#{$1}]" }
  522.       # c に 1 文字を取得
  523.       if ((c = text.slice!(/./m)) != nil)
  524.         # 選択肢の場合
  525.         if @dy >= $game_temp.choice_start
  526.           # 字下げを行う
  527.           @dx = 8
  528.           # 文字を描画
  529.           font_size = self.contents.font.size
  530.           self.contents.draw_text(4+@dx, @dh, font_size, font_size, c)
  531.           # x に描画した文字の幅を加算
  532.           @dx += self.contents.text_size(c).width
  533.           # ループ
  534.           while ((c = text.slice!(/./m)) != "\n")
  535.             # 文字を描画
  536.             font_size = self.contents.font.size
  537.             self.contents.draw_text(4+@dx, @dh, font_size, font_size, c)
  538.             @max_font_h = font_size
  539.             # x に描画した文字の幅を加算
  540.             @dx += self.contents.text_size(c).width
  541.           end
  542.           if c == "\n"
  543.             # カーソルの幅を更新
  544.             @cursor_width = [@cursor_width, @dx].max
  545.             # フォントの最大の高さを加算
  546.             @dh += @max_font_h + 10
  547.             @max_font_h = self.contents.font.size
  548.             @dx = 0
  549.           end
  550.           return
  551.         end
  552.         # \\ の場合
  553.         if c == "\000"
  554.           # 本来の文字に戻す
  555.           c = "\"
  556.         end
  557.         # \C[n] の場合
  558.         if c == "\001"
  559.           # 文字色を変更
  560.           text.sub!(/\[([0-9]+)\]/, "")
  561.           color = $1.to_i
  562.           if color >= 0 and color <= 7
  563.             self.contents.font.color = text_color(color)
  564.           end
  565.           return
  566.         end
  567.         # \G の場合
  568.         if c == "\002"
  569.           # ゴールドウィンドウを作成
  570.           if @gold_window == nil
  571.             @gold_window = Window_Gold.new
  572.             @gold_window.x = 560 - @gold_window.width
  573.             if $game_temp.in_battle
  574.               @gold_window.y = 192
  575.             else
  576.               @gold_window.y = self.y >= 128 ? 32 : 384
  577.             end
  578.             @gold_window.opacity = self.opacity
  579.             @gold_window.back_opacity = self.back_opacity
  580.           end
  581.           return
  582.         end
  583.         # 改行文字の場合
  584.         if c == "\n"
  585.           # y に 1 を加算
  586.           @dy += 1
  587.           @dx = 0
  588.           # フォントの最大の高さを加算
  589.           @dh += @max_font_h + 10
  590.           @max_font_h = 0
  591.           return
  592.         end
  593.         # \I[ファイル名] の場合
  594.         if c == "\003"
  595.           text.sub!(/\[(.*?)\]/, "")
  596.           bitmap = RPG::Cache.icon($1)
  597.           font_size = FUKI::MES_FONT_SIZE
  598.           # アイコンを描画
  599.           self.contents.blt(4+@dx, 5+@dh, bitmap, Rect.new(0, 0, bitmap.width, bitmap.height))
  600.           # x に描画したアイコンの幅を加算
  601.           @dx += bitmap.width
  602.           # 最大縦幅を取得
  603.           if self.contents.font.size > @max_font_h
  604.             @max_font_h = bitmap.height
  605.           end
  606.           return
  607.         end
  608.         # \S[n] の場合
  609.         if c == "\004"
  610.           text.sub!(/\[([0-9]+)\]/, "")
  611.           # 描画スピードを変更
  612.           @mes_speed = $1.to_i
  613.           return
  614.         end
  615.         # \size[n] の場合
  616.         if c == "\005"
  617.           text.sub!(/\[([0-9]+)\]/, "")
  618.           c = ""
  619.           # 文字サイズを変更
  620.           self.contents.font.size = $1.to_i
  621.         end
  622.         # 文字を描画
  623.         font_size = self.contents.font.size
  624.         self.contents.draw_text(4+@dx, @dh, font_size, font_size, c)
  625.         # x に描画した文字の幅を加算
  626.         @dx += self.contents.text_size(c).width
  627.         # 文字の最大縦幅を取得
  628.         if self.contents.font.size > @max_font_h
  629.           @max_font_h = self.contents.font.size
  630.         end
  631.       end
  632.     end
  633.   end
  634.   #--------------------------------------------------------------------------
  635.   # ○ 選択肢と数値入力を有効に
  636.   #--------------------------------------------------------------------------
  637.   def draw_opt_text
  638.     # 選択肢の場合
  639.     if $game_temp.choice_max > 0
  640.       @item_max = $game_temp.choice_max
  641.       self.active = true
  642.       self.index = 0
  643.     end
  644.     # 数値入力の場合
  645.     if $game_temp.num_input_variable_id > 0
  646.       digits_max = $game_temp.num_input_digits_max
  647.       number = $game_variables[$game_temp.num_input_variable_id]
  648.       @input_number_window = Window_InputNumber.new(digits_max)
  649.       @input_number_window.number = number
  650.       @input_number_window.x = self.x + 8
  651.       @input_number_window.y = self.y + $game_temp.num_input_start * 32
  652.     end
  653.   end
  654.   #--------------------------------------------------------------------------
  655.   # ○ ふきだしを表示
  656.   #--------------------------------------------------------------------------
  657.   def set_fukidasi(x, y, width, height)
  658.     # $mes_id が空のときはふきだしを表示しない
  659.     if $mes_id == nil or $mes_id == ""
  660.       del_fukidasi
  661.       reset_window
  662.     else
  663.       # ポーズサインを非表示
  664.       self.pause = false
  665.       # 位置を取得
  666.       pos = get_fuki_pos(width, height)
  667.       x = pos[0]
  668.       y = pos[1]
  669.       skin = FUKI::FUKI_SKIN_NAME != "" ? FUKI::FUKI_SKIN_NAME : $game_system.windowskin_name
  670.       # ふきだし用メッセージウインドウを作成
  671.       self.windowskin = RPG::Cache.windowskin(skin)
  672.       self.x = x
  673.       self.y = y
  674.       self.height = height
  675.       self.width = width
  676.       self.contents.dispose
  677.       self.contents = Bitmap.new(width - 32, height - 32)
  678.       self.back_opacity = FUKI::FUKI_OPACITY
  679.       self.contents.clear
  680.       self.contents.font.color = normal_color
  681.       self.contents.font.size = FUKI::MES_FONT_SIZE
  682.       # ふきだしのテールを描画
  683.       if $game_system.message_frame == 0
  684.         # 位置を取得
  685.         tale_pos = get_tale_pos
  686.         @tale = Sprite.new
  687.         case @message_position
  688.           when 0  # 上
  689.             @tale.bitmap = RPG::Cache.windowskin(skin + "-top")
  690.             @tale.x = tale_pos[0]
  691.             @tale.y = tale_pos[1]
  692.             @tale.z = self.z + 1
  693.           when 1  # 中
  694.             @tale.dispose
  695.             @tale = nil
  696.           when 2  # 下
  697.             @tale.bitmap = RPG::Cache.windowskin(skin + "-under")
  698.             @tale.x = tale_pos[0]
  699.             @tale.y = tale_pos[1]
  700.             @tale.z = self.z + 1
  701.         end
  702.       end
  703.     end
  704.   end
  705.   #--------------------------------------------------------------------------
  706.   # ○ ふきだしの位置を計算
  707.   #--------------------------------------------------------------------------
  708.   def get_fuki_pos(width, height)
  709.     # キャラクターを取得
  710.     @character = get_character($mes_id)
  711.     if @character == nil
  712.       # キャラクターが存在しないときは通常のメッセージウインドウに
  713.       del_fukidasi
  714.       reset_window
  715.       return
  716.     end
  717.     # 座標処理
  718.     x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - (width / 2)
  719.     # はみ出すときは画面内に収まるように移動
  720.     if x + width > 640
  721.       x = 640 - width
  722.     elsif x < 0
  723.       x = 0
  724.     end
  725.     # ウインドウの位置を決定
  726.     case $game_system.message_position
  727.       when 0  # 上
  728.         y = ( @character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
  729.       when 1  # 中
  730.         y = (480 - height) / 2
  731.         x = (640 - width) / 2
  732.       when 2  # 下
  733.         y =  ( @character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
  734.     end
  735.     #メッセージポジション一時記憶
  736.     @message_position = $game_system.message_position
  737.     # 画面外にはみ出す時はウインドウの上下をチェンジ
  738.     if FUKI::POS_FIX
  739.       case @message_position
  740.         when 0  # 上
  741.           if y <= 0
  742.             @message_position = 2
  743.             y =  ( @character.real_y - $game_map.display_y + 64) * 32 / 128 + FUKI::POP_SHIFT_UNDER
  744.           end
  745.         when 2  # 下
  746.           if y + height >= 480
  747.             @message_position = 0
  748.             y = ( @character.real_y - $game_map.display_y + 64) * 32 / 128 - height + 32 - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
  749.           end
  750.       end
  751.     end
  752.     return [x,y]
  753.   end
  754.   #--------------------------------------------------------------------------
  755.   # ○ テールの位置を計算
  756.   #--------------------------------------------------------------------------
  757.   def get_tale_pos
  758.     case @message_position
  759.       when 0  # 上
  760.         # 座標処理
  761.         x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  762.         # 画面端では位置をずらす
  763.         if FUKI::CORNER_SHIFT
  764.           if x == 0
  765.             x = FUKI::SHIFT_PIXEL
  766.           elsif x == 640 - 32
  767.             x = 640 - 32 - FUKI::SHIFT_PIXEL
  768.           end
  769.         end
  770.         y = self.y + self.height - 16
  771.       when 1  # 中
  772.         x = nil
  773.         y = nil
  774.       when 2  # 下
  775.         # 座標処理
  776.         x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  777.         # 画面端では位置をずらす
  778.         if FUKI::CORNER_SHIFT
  779.           if x == 0
  780.             x = FUKI::SHIFT_PIXEL
  781.           elsif @tale.x == 640 - 32
  782.             x = 640 - 32 - FUKI::SHIFT_PIXEL
  783.           end
  784.         end
  785.         y = self.y - 16
  786.     end
  787.     return [x,y]
  788.   end
  789.   #--------------------------------------------------------------------------
  790.   # ○ 名前ウインドウを表示
  791.   #--------------------------------------------------------------------------
  792.   def set_namewindow
  793.     # $mes_name が空のときは名前ウインドウを表示しない
  794.     if $mes_name == nil or $mes_name == ""
  795.       return
  796.     else
  797.       # 変数をセット
  798.       mes_name = $mes_name
  799.       # 制御文字処理
  800.       begin
  801.         last_text = mes_name.clone
  802.         mes_name.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  803.       end until mes_name == last_text
  804.       mes_name.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  805.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  806.       end
  807.       name_width = mes_name.size / 2 * FUKI::NAME_FONT_SIZE
  808.       name_height = FUKI::NAME_FONT_SIZE
  809.       name_x = self.x + FUKI::NAME_SHIFT_X
  810.       name_y = self.y - name_height - 16 + FUKI::NAME_SHIFT_Y
  811.       # 名前ウインドウ(枠のみ)を作成
  812.       @name_win = Window_Base.new(name_x, name_y, name_width + 16, name_height + 16)
  813.       skin = FUKI::NAME_SKIN_NAME != "" ? FUKI::NAME_SKIN_NAME : $game_system.windowskin_name
  814.       @name_win.windowskin = RPG::Cache.windowskin(skin)
  815.       @name_win.back_opacity = FUKI::NAME_OPACITY
  816.       @name_win.z = self.z + 1
  817.       # 余白をwindowクラスの限界よりも小さくするため、二重構造に
  818.       @name_contents = Sprite.new
  819.       @name_contents.x = name_x + 12
  820.       @name_contents.y = name_y + 8
  821.       @name_contents.bitmap = Bitmap.new(name_width, name_height)
  822.       @name_contents.z = @name_win.z + 2
  823.       # 文字色の設定
  824.       nil_color = Color.new(0,0,0,0)
  825.       if FUKI::NAME_COLOR != nil_color
  826.         @name_contents.bitmap.font.color = FUKI::NAME_COLOR
  827.       else
  828.         @name_contents.bitmap.font.color = normal_color
  829.       end
  830.       @name_contents.bitmap.font.size = FUKI::NAME_FONT_SIZE
  831.       # ウインドウサイズを調整
  832.       rect = @name_contents.bitmap.text_size(mes_name)
  833.       @name_win.width = rect.width + 32
  834.       # 名前を描画
  835.       @name_contents.bitmap.draw_text(rect, mes_name)
  836.     end
  837.   end
  838.   #--------------------------------------------------------------------------
  839.   # ○ ふきだしと名前ウインドウを破棄
  840.   #--------------------------------------------------------------------------
  841.   def del_fukidasi
  842.     if @tale != nil
  843.       @tale.dispose
  844.       @tale = nil
  845.     end
  846.     if @name_win != nil
  847.       @name_win.dispose
  848.       @name_win = nil
  849.       @name_contents.dispose
  850.       @name_contents = nil
  851.     end
  852.     self.opacity = 0
  853.     self.x = 80
  854.     self.width = 480
  855.     self.height = 160
  856.     self.contents.dispose
  857.     self.contents = Bitmap.new(width - 32, height - 32)
  858.     self.pause = true
  859.   end
  860.   #--------------------------------------------------------------------------
  861.   # ○ キャラクターの取得
  862.   #     parameter : パラメータ
  863.   #--------------------------------------------------------------------------
  864.   def get_character(parameter)
  865.     # パラメータで分岐
  866.     case parameter
  867.     when -1  # プレイヤー
  868.       return $game_player
  869.     when 0  # このイベント
  870.       events = $game_map.events
  871.       return events == nil ? nil : events[$active_event_id]
  872.     else  # 特定のイベント
  873.       events = $game_map.events
  874.       return events == nil ? nil : events[parameter]
  875.     end
  876.   end
  877.   #--------------------------------------------------------------------------
  878.   # ● 通常文字色の取得
  879.   #--------------------------------------------------------------------------
  880.   def normal_color
  881.     # ふきだしモード時に設定を適用
  882.     if $mes_id != nil and $mes_id != ""
  883.       nil_color = Color.new(0,0,0,0)
  884.       if FUKI::FUKI_COLOR != nil_color
  885.         color = FUKI::FUKI_COLOR
  886.       else
  887.         color = super
  888.       end
  889.       return color
  890.     else
  891.       # 非ふきだし時には通常文字色
  892.       return super
  893.     end
  894.   end
  895. end

  896. #==============================================================================
  897. # ■ Window_InputNumber
  898. #==============================================================================

  899. class Window_InputNumber < Window_Base
  900.   #--------------------------------------------------------------------------
  901.   # ● オブジェクト初期化
  902.   #     digits_max : 桁数
  903.   #--------------------------------------------------------------------------
  904.   def initialize(digits_max)
  905.     @digits_max = digits_max
  906.     [url=home.php?mod=space&uid=27178]@Number[/url] = 0
  907.     # 数字の幅からカーソルの幅を計算 (0~9 は等幅と仮定)
  908.     dummy_bitmap = Bitmap.new(32, 32)
  909.     dummy_bitmap.font.size = FUKI::MES_FONT_SIZE
  910.     @cursor_width = dummy_bitmap.text_size("0").width + 8
  911.     dummy_bitmap.dispose
  912.     super(0, 0, @cursor_width * @digits_max + 32, 64)
  913.     self.contents = Bitmap.new(width - 32, height - 32)
  914.     self.contents.font.size = FUKI::MES_FONT_SIZE
  915.     self.z += 9999
  916.     self.opacity = 0
  917.     @index = 0
  918.     refresh
  919.     update_cursor_rect
  920.   end
  921. end

  922. #==============================================================================
  923. # ■ Interpreter
  924. #==============================================================================

  925. class Interpreter
  926.   #--------------------------------------------------------------------------
  927.   # ● イベントのセットアップ
  928.   #     event_id : イベント ID
  929.   #--------------------------------------------------------------------------
  930.   alias setup_fuki setup
  931.   def setup(list, event_id)
  932.     setup_fuki(list, event_id)
  933.     # 戦闘中でなければ
  934.     if !($game_temp.in_battle)
  935.       # イベントIDを記録
  936.       $active_event_id = event_id
  937.     end
  938.   end
  939. end
复制代码

[用法]【用法
代的事件ID“$ mes_id命令,在”脚本“
气球“事件显示供应]现在会弹出该事件。:($ Mes_id = 4的描述示例)
事件本身的球员,如果您分配的ID -1。
如果分配“或未缴,然后返回到正常显示消息。:($ Mes_id =无说明的例子), 我可以改变事件中的“文字选项”显示位置。 如果指定了“中央”的显示位置,它会被显示在屏幕的中心,不管该事件的位置的。[用法的名称窗口] 在“脚本”代“$ mes_name。”事件命令字符串 显示窗口的名称。(说明例如:$ mes_name =“Arushesu”), 如果指定一个零或“” $ Mes_name。,它是隐藏的。 \ \ [(演员ID)当你写N,它显示的ID对应的演员的名字。 \此功能相当于是N [N],但请注意,你所描述的“\ \”。 :($ Mes_name =“\ \ n [1]”$ mes_name =“\ \ V [1] \ \ N”的描述为例) 两个名称窗口的功能,显示电源是独立的,所以, 能单独使用,。
在之前使用]准备等于气球的尾巴的部分图像,
然后导入“图形/ Windowskins的文件夹。 图像尺寸为16×16(像素)。 似乎8pixel重叠和窗口它们。 两个图案的气球和顶气球低, 请把名字“(皮肤名称)顶”和“(皮肤名称)下”,分别。 :样品  尾巴RTP材料气球“001 Blue01”  (在“图片另存为”右键单击→)下载
如果你改变窗口的透明度,气球,它不通过尾巴气球。
当使用一个半透明的窗口,使其成为一体地与帧尾。  (下载后,请删除尾随“_B”)样本
[其它功能]更改的消息的显示速度
  通过分配数值事件“$ mes_speed”命令中的“脚本”
  是可以改变的消息的显示速度。
  此刻见受让人0。自动发送消息,   如果你分配一个数值   自动讯息显示指定数量的帧结束后关闭窗口“$ mes_auto”命令,在“脚本”事件已过。   如果你分配一个零,自动模式将被取消。   只要你按任意键跳过消息,我会快速显示该消息。控制字符   图\我的[文件名]图标     显示我的形象“图形/图标”内。:([001-Weapon01] \我描述的例子)     [ 心的表情 (下载“目标另存为”右键单击→)] 是,它并没有看起来在白色背景上的浏览器中出现一个风险这么※白色字符那里。   \ S [N]消息的速度   变化\ [N]字体大小尺寸变化
更多图片 小图 大图
组图打开中,请稍候......
小天终于要填个新坑了,这个游戏的名字是《欲望恶魔~游侠传记》
剧情:★☆☆☆☆☆☆☆☆☆
脚本:★☆☆☆☆☆☆☆☆☆
素材:☆☆☆☆☆☆☆☆☆☆
预计明年这一个浩大的工程既可以完工了。。有木有支持的!?制作工具:RMVA
回复

使用道具 举报

梦石
0
星屑
1166
在线时间
127 小时
注册时间
2013-2-16
回帖
368
 楼主| 发表于 2013-4-30 19:17:13 | 显示全部楼层
2、显示气球对话                                                            
[摘要]我将添加一个气球消息窗口显示功能。
该功能是改装到几乎任何系统消息窗口脚本。
我将朝着“气球+”也是孤单。

操作验证结束脚本
 (重新发布→脚本像一家小书店像货架
   ): “消息显示全面升级” 城堡的装备,如:“消息控制字符加入” KGC软件,如:“消息窗口重塑”
 
 

(字符跟踪等大小),取决于脚本,消息窗口组合功能。
固定脚本的情况下,只有尾巴会自动跟踪的字符窗口位置。 该脚本已合作与樱花雅土像“XMS脚本保质”。
[脚本]
  1. #==============================================================================
  2. # +++ コラボレーション「+ふきだし表示」 ver.1.13 +++
  3. # Script by
  4. #    パラ犬  [url]http://2d6.parasite.jp/[/url]
  5. #      ×
  6. #    桜雅 在土 [url]http://xms.rdy.jp/[/url]
  7. #
  8. #------------------------------------------------------------------------------
  9. #   ほぼどんなメッセージウィンドウに対しても後付け可能な「ふきだし表示」です。
  10. #  また、テール部分のみの自動追尾機能を持ちます。
  11. #==============================================================================
  12. # ふきだし表示をするには、
  13. # テール用画像「(スキン名)-top」「(スキン名)-under」を
  14. # 「Graphics/Windowskins」フォルダにインポートしておく必要があります。
  15. #------------------------------------------------------------------------------
  16. #
  17. # [ふきだし表示の使い方]
  18. # イベントコマンド「スクリプト」で「$mes_id」にイベントIDを代入することで
  19. # そのイベントにふきだしがポップするようになります。
  20. # (記述例: $mes_id=4 )
  21. # IDに0を代入するとプレイヤー、 nil代入すると、通常のメッセージ表示に戻ります。
  22. # 表示位置はイベント「文章オプション」で変更できます。
  23. # 表示位置に「中央」を指定すると、イベントの位置に関係なく
  24. # 画面中央に表示されます。
  25. #
  26. #==============================================================================

  27. #==============================================================================
  28. # □ カスタマイズポイント
  29. #==============================================================================
  30. class Window_Message < Window_Selectable
  31.   #--------------------------------------------------------------------------
  32.   # ふきだしモード時のスキン設定
  33.   #--------------------------------------------------------------------------
  34.   # スキン名(元のウインドウスキンと同じものを使うときは「""」)
  35.   FUKI_SKIN_NAME = "001-Blue01"
  36.   # ウインドウ背景の不透明度(デフォルトは160)
  37.   FUKI_OPACITY = 255
  38. end

  39. #==============================================================================
  40. # ■ Window_Message
  41. #==============================================================================
  42. class Window_Message < Window_Selectable
  43.   #--------------------------------------------------------------------------
  44.   # ● メッセージ終了処理
  45.   #--------------------------------------------------------------------------
  46.   alias parashelf_terminate_message terminate_message
  47.   def terminate_message
  48.     # 呼び戻す
  49.     parashelf_terminate_message
  50.     # ふきだしの消去
  51.     del_tail
  52.   end
  53.   #--------------------------------------------------------------------------
  54.   # ● リフレッシュ
  55.   #--------------------------------------------------------------------------
  56.   alias parashelf_refresh refresh
  57.   def refresh
  58.     # 呼び戻す
  59.     parashelf_refresh
  60.     # ふきだしの再設定
  61.     del_tail
  62.     set_tail
  63.   end
  64.   #--------------------------------------------------------------------------
  65.   # ● ウィンドウの位置と不透明度の設定
  66.   #--------------------------------------------------------------------------
  67.   alias parashelf_reset_window reset_window
  68.   def reset_window
  69.     # 呼び戻す
  70.     parashelf_reset_window
  71.     # テールの位置を変更
  72.     if $mes_id != nil and @tail != nil
  73.       tale_pos = get_tale_pos
  74.       @tail.x = tale_pos[0]
  75.       @tail.y = tale_pos[1]
  76.     end
  77.   end
  78.   #--------------------------------------------------------------------------
  79.   # ● フレーム更新
  80.   #--------------------------------------------------------------------------
  81.   alias parashelf_update update
  82.   def update
  83.     # 呼び戻す
  84.     parashelf_update
  85.     # ふきだしテールの更新
  86.     update_tail
  87.     # メッセージ表示中の場合
  88.     if @contents_showing
  89.       # テールがある場合はポーズサインを非表示
  90.       if @tail != nil
  91.         self.pause = false
  92.       end
  93.     end
  94.     # メッージ終了時にスキン設定が戻っていない場合
  95.     if $game_temp.message_window_showing == false and @def_skin_name != nil
  96.       # スキンを戻す
  97.       reset_fuki_skin
  98.     end
  99.   end
  100.   #--------------------------------------------------------------------------
  101.   # ○ フレーム更新 (ふきだしテール)
  102.   #--------------------------------------------------------------------------
  103.   def update_tail
  104.     # ふきだしモードではイベントの動きに追従
  105.     if $mes_id != nil and @tail != nil
  106.       tale_pos = get_tale_pos
  107.       @tail.x = tale_pos[0]
  108.       @tail.y = tale_pos[1]
  109.       skin = $game_system.windowskin_name
  110.       case @message_position
  111.       when 0  # 上
  112.         @tail.bitmap = RPG::Cache.windowskin(skin + "-top")
  113.       when 2  # 下
  114.         @tail.bitmap = RPG::Cache.windowskin(skin + "-under")
  115.       end
  116.     end
  117.   end
  118.   #--------------------------------------------------------------------------
  119.   # ○ ふきだしテールを表示
  120.   #--------------------------------------------------------------------------
  121.   def set_tail
  122.     # $mes_id が空のときと戦闘中はふきだしを表示しない
  123.     if $mes_id == nil or $game_temp.in_battle
  124.       del_tail
  125.       # スキンを戻す
  126.       reset_fuki_skin
  127.     else
  128.       # スキンをセット
  129.       set_fuki_skin
  130.       # ふきだしのテールを描画
  131.       skin = $game_system.windowskin_name
  132.       if $game_system.message_frame == 0
  133.         # 位置を取得
  134.         tale_pos = get_tale_pos
  135.         @tail = Sprite.new
  136.         case $game_system.message_position
  137.         when 0  # 上
  138.           @tail.bitmap = RPG::Cache.windowskin(skin + "-top")
  139.           @tail.x = tale_pos[0]
  140.           @tail.y = tale_pos[1]
  141.           @tail.z = self.z + 1
  142.         when 1  # 中
  143.           @tail.dispose
  144.           @tail = nil
  145.         when 2  # 下
  146.           @tail.bitmap = RPG::Cache.windowskin(skin + "-under")
  147.           @tail.x = tale_pos[0]
  148.           @tail.y = tale_pos[1]
  149.           @tail.z = self.z + 1
  150.         end
  151.         # エクストラスプライトに登録
  152.         @extra_sprites = [] if @extra_sprites.nil?
  153.         @extra_sprites.push(@tail) if @tail != nil
  154.       end
  155.     end
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # ○ テールの位置を計算
  159.   #--------------------------------------------------------------------------
  160.   def get_tale_pos
  161.     character = get_character($mes_id)
  162.     x = [[character.screen_x - 16, self.x].max, self.x + self.width - 32].min
  163.     case $game_system.message_position
  164.     when 0
  165.       y = self.y + self.height - 16
  166.     else
  167.       y = self.y - 16
  168.     end
  169.     return [x, y]
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # ○ キャラクターの取得
  173.   #     parameter : パラメータ
  174.   #--------------------------------------------------------------------------
  175.   def get_character(parameter)
  176.     # パラメータで分岐
  177.     case parameter
  178.     when 0  # プレイヤー
  179.       return $game_player
  180.     else  # 特定のイベント
  181.       events = $game_map.events
  182.       return events == nil ? nil : events[parameter]
  183.     end
  184.   end
  185.   #--------------------------------------------------------------------------
  186.   # ○ ふきだしを破棄
  187.   #--------------------------------------------------------------------------
  188.   def del_tail
  189.     if @tail != nil
  190.       @tail.dispose
  191.       @tail = nil
  192.     end
  193.   end
  194.   #--------------------------------------------------------------------------
  195.   # ○ スキンの設定
  196.   #--------------------------------------------------------------------------
  197.   def set_fuki_skin
  198.     # ウインドウスキンを変更
  199.     if FUKI_SKIN_NAME != "" and FUKI_SKIN_NAME != $game_system.windowskin_name
  200.       @def_skin_name = $game_system.windowskin_name
  201.       $game_system.windowskin_name = FUKI_SKIN_NAME
  202.       self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name)
  203.     end
  204.     # 不透明度を変更
  205.     if self.back_opacity != FUKI_OPACITY
  206.       @def_back_opacity = self.back_opacity
  207.       self.back_opacity = FUKI_OPACITY
  208.     end
  209.   end
  210.   #--------------------------------------------------------------------------
  211.   # ○ スキンを戻す
  212.   #--------------------------------------------------------------------------
  213.   def reset_fuki_skin
  214.     # ウインドウスキンを戻す
  215.     if @def_skin_name != nil
  216.       $game_system.windowskin_name = @def_skin_name
  217.       self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name)
  218.       @def_skin_name = nil
  219.     end
  220.     # 不透明度を戻す
  221.     if @def_back_opacity != nil
  222.       self.back_opacity = @def_back_opacity
  223.       @def_back_opacity = nil
  224.     end
  225.   end
  226. end
复制代码



[用法]尾部图像表格,以及如何指定事件ID,显示供应消息是一样的。
(这是一个不支持“(事件本身)$ mes_id = -1”) 的XMS脚本架状“消息显示全面升级”,通过使用扩展的CO-X 控制字符\ P您可以申请$ mes_id设置[自动]。 换句话说,可以引入,而不需要重写的事件,从弹出的命令字符。






[差异外部脚本结合版(旧)]外部脚本组合版(旧)是唯一的字符图“显示气球消息”脚本的一部分
,因为它是由脚本取代其它网站,
你有这样的字符跟踪功能和外观被迫或调整。
因为我给一个比较积极的治疗,是一个困难的某种组合。 “显示气球+”为基的脚本组合的目的地 是可选的部分气球添加到窗口中, 被已成为灵活组合。 它被视为以前的版本,因为它是完全不同的功能支持的要求或错误报告继续。 [ 外部脚本组合版(旧)]
fuki_plus.jpg
小天终于要填个新坑了,这个游戏的名字是《欲望恶魔~游侠传记》
剧情:★☆☆☆☆☆☆☆☆☆
脚本:★☆☆☆☆☆☆☆☆☆
素材:☆☆☆☆☆☆☆☆☆☆
预计明年这一个浩大的工程既可以完工了。。有木有支持的!?制作工具:RMVA
回复

使用道具 举报

梦石
0
星屑
1166
在线时间
127 小时
注册时间
2013-2-16
回帖
368
 楼主| 发表于 2013-4-30 19:23:56 | 显示全部楼层
3、图形变化几许                                                                 
[摘要]如果你移动的同时按下任意键,移动速度会增加。
如果已提供的图片几许当时的第一个字符,然后显示在使用它。
[脚本]
  1. #==============================================================================
  2. # ++ グラフィック変更ダッシュ ver. 1.21 ++
  3. #  Script by パラ犬
  4. #  [url=http://2d6.parasite.jp/]http://2d6.parasite.jp/[/url]
  5. #------------------------------------------------------------------------------
  6. # 「Graphics/Characters」フォルダに
  7. # 「(先頭キャラの歩行グラフィック名)+_dash」という名前のファイルがある場合
  8. # ダッシュ時のグラフィックとして使用します。(例:001-Fighter01_dash)
  9. #==============================================================================

  10. class Game_Player < Game_Character

  11.   SPEED_DASH = 5          # ダッシュ時の移動速度
  12.   SPEED_NORMAL = 4          # 通常の移動速度

  13.   # ダッシュに使うボタン(表記方法は、Input::(ボタン))
  14.   #(キーボードとの対応表はツクールのヘルプにあります)
  15.   KEY_DASH = Input::A

  16.   # "_dash"グラフィックが存在しない場合ダッシュをするか( true:する / false:しない )
  17.   NO_FILE_DASH = true
  18.   
  19.   # 静止時はグラフィックを変更しない( true:変更しない / false:変更する )
  20.   CHANGE_IN_MOVING = false
  21.   
  22.   # ダッシュ禁止イベントスイッチID
  23.   # (イベントコマンド「スイッチの操作」でこの番号のスイッチをONにしている間は
  24.   #  ダッシュを機能を無効にします)
  25.   NO_DASH_SWITCH = 999

  26. end

  27. #==============================================================================
  28. # ■ Game_Player
  29. #==============================================================================

  30. class Game_Player < Game_Character

  31.   #--------------------------------------------------------------------------
  32.   # ● フレーム更新
  33.   #--------------------------------------------------------------------------
  34.   alias dash_update update
  35.   def update
  36.     # イベント実行中、移動ルート強制中、
  37.     # メッセージウィンドウ表示中のいずれでもない場合
  38.     unless $game_system.map_interpreter.running? or
  39.            @move_route_forcing or $game_temp.message_window_showing
  40.       if !($game_switches[NO_DASH_SWITCH])
  41.         # キー判定
  42.         if Input.press?(KEY_DASH) and (CHANGE_IN_MOVING == false or Input.dir8 != 0)
  43.           if (dash_graphic_exist?($game_party.actors[0]) or NO_FILE_DASH)
  44.             # ダッシュ中でなければダッシュ
  45.             if @move_speed != SPEED_DASH
  46.               @move_speed = SPEED_DASH
  47.               @dash_on = true
  48.               $game_player.refresh
  49.             end
  50.           end
  51.         elsif @dash_on == nil or @dash_on
  52.             @move_speed = SPEED_NORMAL
  53.             @dash_on = nil
  54.             $game_player.refresh
  55.         end
  56.       end
  57.     end
  58.     dash_update
  59.   end
  60.   #--------------------------------------------------------------------------
  61.   # ○ ダッシュグラフィックの有無をチェック
  62.   #--------------------------------------------------------------------------
  63.   def dash_graphic_exist?(actor)   
  64.     # 読み込みテスト
  65.     begin
  66.       RPG::Cache.character(actor.character_name.to_s + "_dash", actor.character_hue)
  67.     rescue
  68.       return false
  69.     end
  70.     return true
  71.   end
  72.   #--------------------------------------------------------------------------
  73.   # ● リフレッシュ
  74.   #--------------------------------------------------------------------------
  75.   alias dash_refresh refresh
  76.   def refresh
  77.     dash_refresh
  78.     # パーティ人数が 0 人でない場合
  79.     if $game_party.actors.size != 0
  80.       actor = $game_party.actors[0]
  81.       # キャラクターのファイル名と色相を設定
  82.       if @dash_on and dash_graphic_exist?(actor)
  83.         fileplus = "_dash"
  84.       else
  85.         fileplus = ""
  86.       end
  87.       @character_name = actor.character_name + fileplus
  88.       @character_hue = actor.character_hue
  89.     end
  90.   end
  91. end
复制代码

在之前使用]提供的照片的时候,破折号的名称“+ _dash(行走字符图形名称)”
导入“图形/字符”文件夹。
即使是没有图像,虚线功能是可用的。 样本的  RTP材料“001-Fighter01的”冲刺图像  (“图像另存为”右击→下载)





正常运动

正常运动
dash_after.jpg

范例图片

范例图片
小天终于要填个新坑了,这个游戏的名字是《欲望恶魔~游侠传记》
剧情:★☆☆☆☆☆☆☆☆☆
脚本:★☆☆☆☆☆☆☆☆☆
素材:☆☆☆☆☆☆☆☆☆☆
预计明年这一个浩大的工程既可以完工了。。有木有支持的!?制作工具:RMVA
回复

使用道具 举报

梦石
0
星屑
1166
在线时间
127 小时
注册时间
2013-2-16
回帖
368
 楼主| 发表于 2013-4-30 19:28:29 | 显示全部楼层
4、武器技能                                                                        
[摘要]确保你不都配备了“剑技术”和“矛术”,一种特定类型的武器,只有当你使用技能。
此功能相当于到200X厂商的“武器属性”。
[脚本]
  1. #==============================================================================
  2. # ++ 武器種別スキル ver. 1.10 ++
  3. #  Script by パラ犬
  4. #------------------------------------------------------------------------------
  5. # 武器の種類ごとに使用可能なスキルを制限します。
  6. #------------------------------------------------------------------------------
  7. #[使い方]
  8. # 武器の種類ごとに「剣」「槍」などの属性を設定し
  9. # 武器とスキルの両方に付加します。
  10. # この属性が一致しない場合、スキルを習得していても使用不可能となります。
  11. #==============================================================================

  12. module PARA_WSKL
  13.   
  14.   # 素手の時のみ使用可能なスキル属性の名前
  15.   NO_WEAPON_NAME = "体術"

  16.   # 武器によって制限されないスキル属性名
  17.   # (この属性が付加されているスキルは武器の影響を受けません)
  18.   VARIABLE_SKILL = "魔法"
  19.   # スキルを制限しない武器属性名
  20.   # (この属性が付加されている武器は全てのスキルを使うことができます)
  21.   VARIABLE_WEAPON = ""

  22.   # 使用不可スキルの表示/非表示
  23.   # ( 0:常に表示 / 1:戦闘中は非表示 / 2:常に非表示 )
  24.   VISIBLE_TYPE = 1

  25. end

  26. # ↑ 設定項目ここまで
  27. #------------------------------------------------------------------------------

  28. #==============================================================================
  29. # ■ Game_Actor
  30. #==============================================================================

  31. class Game_Actor < Game_Battler
  32.   #--------------------------------------------------------------------------
  33.   # ● スキルの使用可能判定
  34.   #     skill_id : スキル ID
  35.   #--------------------------------------------------------------------------
  36.   def skill_can_use?(skill_id)
  37.     if not skill_learn?(skill_id)
  38.       return false
  39.     end
  40.     if not skill_w_can_use?(skill_id)
  41.       return false
  42.     end
  43.     return super
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # ● 武器スキルの使用可能判定
  47.   #     skill_id : スキル ID
  48.   #--------------------------------------------------------------------------
  49.   def skill_w_can_use?(skill_id)
  50.     if not skill_learn?(skill_id)
  51.       return false
  52.     end
  53.     # スキルと武器の属性がひとつでも一致するか
  54.     if $data_skills[skill_id].element_set & self.element_set != []
  55.       bool = true
  56.     else
  57.       # 武器の属性IDを名前に
  58.       weapon_elements_name = []
  59.       for element_id in self.element_set
  60.         weapon_elements_name.push($data_system.elements[element_id])
  61.       end
  62.       # スキルの属性IDを名前に
  63.       skill_elements_name = []
  64.       for element_id in $data_skills[skill_id].element_set
  65.         skill_elements_name.push($data_system.elements[element_id])
  66.       end
  67.       # 武器によって制限されないスキル属性
  68.       if skill_elements_name.include?(PARA_WSKL::VARIABLE_SKILL) and PARA_WSKL::VARIABLE_SKILL != ""
  69.         bool = true
  70.       end
  71.       # スキルを制限しない武器属性
  72.       if weapon_elements_name.include?(PARA_WSKL::VARIABLE_WEAPON) and PARA_WSKL::VARIABLE_WEAPON != ""
  73.         bool = true
  74.       end
  75.       # 素手スキル
  76.       if skill_elements_name.include?(PARA_WSKL::NO_WEAPON_NAME) and @weapon_id == 0
  77.         bool = true
  78.       end
  79.     end
  80.     bool = bool == nil ? false : bool
  81.     return bool
  82.   end
  83. end

  84. #==============================================================================
  85. # ■ Window_Skill
  86. #==============================================================================

  87. class Window_Skill < Window_Selectable
  88.   #--------------------------------------------------------------------------
  89.   # ● リフレッシュ
  90.   #--------------------------------------------------------------------------
  91.   def refresh
  92.     if self.contents != nil
  93.       self.contents.dispose
  94.       self.contents = nil
  95.     end
  96.     @data = []
  97.     for i in [email]0...@actor.skills.size[/email]
  98.       skill = $data_skills[@actor.skills[i]]
  99.       case PARA_WSKL::VISIBLE_TYPE
  100.       when 1
  101.         if skill != nil and !(!@actor.skill_w_can_use?(skill.id) and $game_temp.in_battle)
  102.           @data.push(skill)
  103.         end
  104.       when 2
  105.         if skill != nil and @actor.skill_w_can_use?(skill.id)
  106.           @data.push(skill)
  107.         end
  108.       else
  109.         if skill != nil
  110.           @data.push(skill)
  111.         end
  112.       end
  113.     end
  114.     # 項目数が 0 でなければビットマップを作成し、全項目を描画
  115.     @item_max = @data.size
  116.     if @item_max > 0
  117.       self.contents = Bitmap.new(width - 32, row_max * 32)
  118.       for i in 0...@item_max
  119.         draw_item(i)
  120.       end
  121.     end
  122.   end
  123. end
复制代码

[用法]
创建“剑”和“矛”,在数据库中的任何属性,
它被设置为两者的技能和武器,它们的属性。 如果该属性的武器的属性和技能不匹配,则 技能不能被使用。

weapon_skill.jpg
小天终于要填个新坑了,这个游戏的名字是《欲望恶魔~游侠传记》
剧情:★☆☆☆☆☆☆☆☆☆
脚本:★☆☆☆☆☆☆☆☆☆
素材:☆☆☆☆☆☆☆☆☆☆
预计明年这一个浩大的工程既可以完工了。。有木有支持的!?制作工具:RMVA
回复

使用道具 举报

梦石
0
星屑
1166
在线时间
127 小时
注册时间
2013-2-16
回帖
368
 楼主| 发表于 2013-4-30 19:33:28 | 显示全部楼层
5、8运动图形变化                                                               
[摘要]通过同时按下左右键和上下键,让您对角线移动。
如果图像的对角线运动中所提供的最佳字符,然后使用它显示。
它也支持在“设置的迁移路线”事件命令指定的倾斜方向。
[脚本]
  1. #==============================================================================[/font][/color][/b]# ++ グラフィック変更8方向移動 ver. 1.01 ++
  2. #------------------------------------------------------------------------------
  3. # 上下キーと左右キーを同時押しすることにより斜め移動を可能にし、
  4. # 「Graphics/Characters」フォルダに
  5. # 「(先頭キャラクター名)+_quarter」という名前のファイルがある場合
  6. # 斜め移動時のグラフィックとして使用します。(例:001-Fighter01_quarter)
  7. #------------------------------------------------------------------------------
  8. #[設置上の注意]
  9. # 「グラフィック変更ダッシュ」と併用する場合、このスクリプトを
  10. # ダッシュスクリプトよりも下に置いてください。
  11. # 斜め方向ダッシュの画像ファイル名は「(先頭キャラクター名)+_dash_quarter」に
  12. # なります。
  13. #==============================================================================

  14. #==============================================================================
  15. # ■ Game_Player
  16. #==============================================================================

  17. class Game_Player < Game_Character
  18.   #--------------------------------------------------------------------------
  19.   # ● フレーム更新
  20.   #--------------------------------------------------------------------------
  21.   alias update_para_quarter update
  22.   def update
  23.     update_para_quarter
  24.     unless moving? or $game_system.map_interpreter.running? or
  25.            @move_route_forcing or $game_temp.message_window_showing
  26.       # 方向ボタンが押されていれば、その方向へプレイヤーを移動
  27.       case Input.dir8
  28.       when 1  # 左下に移動
  29.         move_lower_left
  30.       when 3  # 右下に移動
  31.         move_lower_right
  32.       when 7  # 左上に移動
  33.         move_upper_left
  34.       when 9  # 右上に移動
  35.         move_upper_right
  36.       end
  37.     end
  38.   end
  39. end

  40. #==============================================================================
  41. # ■ Sprite_Character
  42. #==============================================================================

  43. class Sprite_Character < RPG::Sprite
  44.   #--------------------------------------------------------------------------
  45.   # ● フレーム更新
  46.   #--------------------------------------------------------------------------
  47.   alias update_para_quarter update
  48.   def update
  49.     update_para_quarter
  50.     if @tile_id == 0
  51.       if (@character.direction - 2) % 2 == 1
  52.         # 斜め画像の有無をチェック
  53.         if quarter_graphic_exist?(@character)
  54.           # 斜め画像をセット
  55.           if character.dash_on and dash_quarter_graphic_exist?(@character)
  56.             @character_name = @character.character_name + "_dash_quarter"
  57.           else
  58.             @character_name = @character.character_name + "_quarter"
  59.           end
  60.           self.bitmap = RPG::Cache.character(@character_name,
  61.             @character.character_hue)
  62.           # 向きを取得
  63.           case @character.direction
  64.             when 1
  65.               n = 0
  66.             when 3
  67.               n = 2
  68.             when 7
  69.               n = 1
  70.             when 9
  71.               n = 3
  72.           end
  73.         else
  74.           @character.direction = @character.sub_direction
  75.           # 斜め画像が存在しないときの向き
  76.           n = (@character.direction - 2) / 2
  77.         end
  78.         # 転送元の矩形を設定
  79.         sx = @character.pattern * @cw
  80.         sy = n * @ch
  81.         self.src_rect.set(sx, sy, @cw, @ch)
  82.       else
  83.         self.bitmap = RPG::Cache.character(@character.character_name,
  84.           @character.character_hue)
  85.         # 転送元の矩形を設定
  86.         sx = @character.pattern * @cw
  87.         sy = (@character.direction - 2) / 2 * @ch
  88.         self.src_rect.set(sx, sy, @cw, @ch)
  89.       end
  90.     end
  91.   end
  92.   #--------------------------------------------------------------------------
  93.   # ○ 斜め画像の有無をチェック
  94.   #--------------------------------------------------------------------------
  95.   def quarter_graphic_exist?(character)
  96.     # 読み込みテスト
  97.     begin
  98.       RPG::Cache.character(character.character_name.to_s + "_quarter", character.character_hue)
  99.     rescue
  100.       return false
  101.     end
  102.     return true
  103.   end
  104.   #--------------------------------------------------------------------------
  105.   # ○ 斜めダッシュ画像の有無をチェック
  106.   #--------------------------------------------------------------------------
  107.   def dash_quarter_graphic_exist?(character)
  108.     # 読み込みテスト
  109.     begin
  110.       RPG::Cache.character(character.character_name.to_s + "_dash_quarter", character.character_hue)
  111.     rescue
  112.       return false
  113.     end
  114.     return true
  115.   end
  116. end

  117. #==============================================================================
  118. # ■ Game_Character
  119. #==============================================================================

  120. class Game_Character
  121.   #--------------------------------------------------------------------------
  122.   # ● 公開インスタンス変数
  123.   #--------------------------------------------------------------------------
  124.   attr_accessor   :direction        # 向き
  125.   attr_accessor   :sub_direction    # 斜め画像が存在しないときの向き
  126.   #--------------------------------------------------------------------------
  127.   # ● 左下に移動
  128.   #--------------------------------------------------------------------------
  129.   def move_lower_left
  130.     # 向き固定でない場合
  131.     unless @direction_fix
  132.       @sub_direction = @direction
  133.       @direction = 1
  134.       # 右向きだった場合は左を、上向きだった場合は下を向く
  135.       @sub_direction = (@sub_direction == 6 ? 4 : @sub_direction == 8 ? 2 : @sub_direction)
  136.     end
  137.     # 下→左、左→下 のどちらかのコースが通行可能な場合
  138.     if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 4)) or
  139.        (passable?(@x, @y, 4) and passable?(@x - 1, @y, 2))
  140.       # 座標を更新
  141.       @x -= 1
  142.       @y += 1
  143.       # 歩数増加
  144.       increase_steps
  145.     end
  146.   end
  147.   #--------------------------------------------------------------------------
  148.   # ● 右下に移動
  149.   #--------------------------------------------------------------------------
  150.   def move_lower_right
  151.     # 向き固定でない場合
  152.     unless @direction_fix
  153.       @sub_direction = @direction
  154.       @direction = 3
  155.       # 左向きだった場合は右を、上向きだった場合は下を向く
  156.       @sub_direction = (@sub_direction == 4 ? 6 : @sub_direction == 8 ? 2 : @sub_direction)
  157.     end
  158.     # 下→右、右→下 のどちらかのコースが通行可能な場合
  159.     if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or
  160.        (passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))
  161.       # 座標を更新
  162.       @x += 1
  163.       @y += 1
  164.       # 歩数増加
  165.       increase_steps
  166.     end
  167.   end
  168.   #--------------------------------------------------------------------------
  169.   # ● 左上に移動
  170.   #--------------------------------------------------------------------------
  171.   def move_upper_left
  172.     # 向き固定でない場合
  173.     unless @direction_fix
  174.       @sub_direction = @direction
  175.       @direction = 7
  176.       # 右向きだった場合は左を、下向きだった場合は上を向く
  177.       @sub_direction = (@sub_direction == 6 ? 4 : @sub_direction == 2 ? 8 : @sub_direction)
  178.     end
  179.     # 上→左、左→上 のどちらかのコースが通行可能な場合
  180.     if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 4)) or
  181.        (passable?(@x, @y, 4) and passable?(@x - 1, @y, 8))
  182.       # 座標を更新
  183.       @x -= 1
  184.       @y -= 1
  185.       # 歩数増加
  186.       increase_steps
  187.     end
  188.   end
  189.   #--------------------------------------------------------------------------
  190.   # ● 右上に移動
  191.   #--------------------------------------------------------------------------
  192.   def move_upper_right
  193.     # 向き固定でない場合
  194.     unless @direction_fix
  195.       @sub_direction = @direction
  196.       @direction = 9
  197.       # 左向きだった場合は右を、下向きだった場合は上を向く
  198.       @sub_direction = (@sub_direction == 4 ? 6 : @sub_direction == 2 ? 8 : @sub_direction)
  199.     end
  200.     # 上→右、右→上 のどちらかのコースが通行可能な場合
  201.     if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 6)) or
  202.        (passable?(@x, @y, 6) and passable?(@x + 1, @y, 8))
  203.       # 座標を更新
  204.       @x += 1
  205.       @y -= 1
  206.       # 歩数増加
  207.       increase_steps
  208.     end
  209.   end
  210.   #--------------------------------------------------------------------------
  211.   # ○ ダッシュスクリプト導入判定
  212.   #--------------------------------------------------------------------------
  213.   def dash_on
  214.     if @dash_on != nil
  215.       return @dash_on
  216.     else
  217.       return false
  218.     end
  219.   end
  220. end
复制代码

在使用之前]准备斜向运动的形象,名称“+ _quarter(行走字符图形名称)”
导入“图形/字符”文件夹。
即使是没有图像,8方向移动的功能都可以使用。 样本的  RTP材料“001-Fighter01”对角线图像 (“图像另存为”右击→下载) (001-Fighter01_quarter.Png)
[关于使用]脚本“ 图形的变化冲刺时使用“,
请把它破折号脚本下面这个脚本。
对角线方向冲刺的图像文件名,将“(第一个字符的名称)+ _dash_quarter”。
quarter.jpg
001-Fighter01_quarter.png
小天终于要填个新坑了,这个游戏的名字是《欲望恶魔~游侠传记》
剧情:★☆☆☆☆☆☆☆☆☆
脚本:★☆☆☆☆☆☆☆☆☆
素材:☆☆☆☆☆☆☆☆☆☆
预计明年这一个浩大的工程既可以完工了。。有木有支持的!?制作工具:RMVA
回复

使用道具 举报

梦石
0
星屑
1166
在线时间
127 小时
注册时间
2013-2-16
回帖
368
 楼主| 发表于 2013-4-30 19:37:24 | 显示全部楼层
6、中断保存                                                                        
[摘要] 我会加一点保存功能菜单中的“结束游戏”。
 数据中断的消失,从标题画面可以重新启动,一旦恢复。
[脚本]
  1. #==============================================================================
  2. # ++ 中断セーブ ver. 1.00 ++
  3. #  Script by パラ犬
  4. #  [url]http://2d6.parasite.jp/[/url]
  5. #------------------------------------------------------------------------------
  6. # メニューの「ゲーム終了」に中断セーブ機能を追加します。
  7. # 中断セーブデータは一度呼び出すと消滅します。
  8. #==============================================================================
  9. module PARA_RESTART

  10.   # メニューに表示する文字
  11.   MENU_COMMAND_NAME = "中断セーブ"
  12.   # タイトル画面に表示する文字
  13.   TITLE_COMMAND_NAME = "中断データから再開"

  14.   # 中断時の戻り先( 0:ゲーム終了 1:タイトル画面 )
  15.   RETURN_SCENE = 1
  16.   
  17.   # 確認メッセージ
  18.   DIALOG1 = "一時保存して中断"    # セーブして中断
  19.   DIALOG2 = "一時保存しないで中断"    # セーブしないで中断
  20.   DIALOG3 = "キャンセル"    # 戻る

  21.   # ファイル名
  22.   FILENAME = "SaveTemp.rxdata"
  23.   
  24. end

  25. #==============================================================================
  26. # ■ Scene_End
  27. #==============================================================================

  28. class Scene_End
  29.   #--------------------------------------------------------------------------
  30.   # ● メイン処理
  31.   #--------------------------------------------------------------------------
  32.   def main
  33.     # コマンドウィンドウを作成
  34.     s1 = PARA_RESTART::DIALOG1
  35.     s2 = PARA_RESTART::DIALOG2
  36.     s3 = PARA_RESTART::DIALOG3
  37.     @command_window = Window_Command.new(192, [s1, s2, s3])
  38.     @command_window.x = 320 - @command_window.width / 2
  39.     @command_window.y = 240 - @command_window.height / 2
  40.     # トランジション実行
  41.     Graphics.transition
  42.     # メインループ
  43.     loop do
  44.       # ゲーム画面を更新
  45.       Graphics.update
  46.       # 入力情報を更新
  47.       Input.update
  48.       # フレーム更新
  49.       update
  50.       # 画面が切り替わったらループを中断
  51.       if $scene != self
  52.         break
  53.       end
  54.     end
  55.     # トランジション準備
  56.     Graphics.freeze
  57.     # ウィンドウを解放
  58.     @command_window.dispose
  59.     # タイトル画面に切り替え中の場合
  60.     if $scene.is_a?(Scene_Title)
  61.       # 画面をフェードアウト
  62.       Graphics.transition
  63.       Graphics.freeze
  64.     end
  65.   end
  66.   #--------------------------------------------------------------------------
  67.   # ● フレーム更新
  68.   #--------------------------------------------------------------------------
  69.   def update
  70.     # コマンドウィンドウを更新
  71.     @command_window.update
  72.     # B ボタンが押された場合
  73.     if Input.trigger?(Input::B)
  74.       # キャンセル SE を演奏
  75.       $game_system.se_play($data_system.cancel_se)
  76.       # メニュー画面に切り替え
  77.       $scene = Scene_Menu.new(5)
  78.       return
  79.     end
  80.     # C ボタンが押された場合
  81.     if Input.trigger?(Input::C)
  82.       # コマンドウィンドウのカーソル位置で分岐
  83.       case @command_window.index
  84.       when 0  # セーブして中断
  85.         command_save_and_end
  86.       when 1  # セーブしないで中断
  87.         command_no_save_and_end
  88.       when 2  # やめる
  89.         command_cancel
  90.       end
  91.       return
  92.     end
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # ○ コマンド [セーブして中断] 選択時の処理
  96.   #--------------------------------------------------------------------------
  97.   def command_save_and_end
  98.     # セーブデータの書き込み
  99.     file = File.open(PARA_RESTART::FILENAME, "wb")
  100.     write_save_data(file)
  101.     file.close
  102.     # 中断処理(セーブしないで中断と共通)
  103.     command_no_save_and_end
  104.   end
  105.   #--------------------------------------------------------------------------
  106.   # ○ コマンド [セーブしないで中断] 選択時の処理
  107.   #--------------------------------------------------------------------------
  108.   def command_no_save_and_end
  109.     case PARA_RESTART::RETURN_SCENE
  110.     when 0  # ゲーム終了
  111.       command_shutdown
  112.     when 1  # タイトル画面
  113.       command_to_title
  114.     end
  115.   end
  116.   #--------------------------------------------------------------------------
  117.   # ○ セーブデータの書き込み
  118.   #     file : 書き込み用ファイルオブジェクト (オープン済み)
  119.   #--------------------------------------------------------------------------
  120.   def write_save_data(file)
  121.     # セーブファイル描画用のキャラクターデータを作成
  122.     characters = []
  123.     for i in 0...$game_party.actors.size
  124.       actor = $game_party.actors[i]
  125.       characters.push([actor.character_name, actor.character_hue])
  126.     end
  127.     # セーブファイル描画用のキャラクターデータを書き込む
  128.     Marshal.dump(characters, file)
  129.     # プレイ時間計測用のフレームカウントを書き込む
  130.     Marshal.dump(Graphics.frame_count, file)
  131.     # セーブ回数を 1 増やす
  132.     $game_system.save_count += 1
  133.     # マジックナンバーを保存する
  134.     # (エディタで保存するたびにランダムな値に書き換えられる)
  135.     $game_system.magic_number = $data_system.magic_number
  136.     # 各種ゲームオブジェクトを書き込む
  137.     Marshal.dump($game_system, file)
  138.     Marshal.dump($game_switches, file)
  139.     Marshal.dump($game_variables, file)
  140.     Marshal.dump($game_self_switches, file)
  141.     Marshal.dump($game_screen, file)
  142.     Marshal.dump($game_actors, file)
  143.     Marshal.dump($game_party, file)
  144.     Marshal.dump($game_troop, file)
  145.     Marshal.dump($game_map, file)
  146.     Marshal.dump($game_player, file)
  147.   end
  148. end

  149. #==============================================================================
  150. # ■ Scene_Menu
  151. #==============================================================================

  152. class Scene_Menu
  153.   #--------------------------------------------------------------------------
  154.   # ● メイン処理
  155.   #--------------------------------------------------------------------------
  156.   def main
  157.     # コマンドウィンドウを作成
  158.     s1 = $data_system.words.item
  159.     s2 = $data_system.words.skill
  160.     s3 = $data_system.words.equip
  161.     s4 = "ステータス"
  162.     s5 = "セーブ"
  163.     s6 = PARA_RESTART::MENU_COMMAND_NAME
  164.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
  165.     @command_window.index = @menu_index
  166.     # パーティ人数が 0 人の場合
  167.     if $game_party.actors.size == 0
  168.       # アイテム、スキル、装備、ステータスを無効化
  169.       @command_window.disable_item(0)
  170.       @command_window.disable_item(1)
  171.       @command_window.disable_item(2)
  172.       @command_window.disable_item(3)
  173.     end
  174.     # セーブ禁止の場合
  175.     if $game_system.save_disabled
  176.       # セーブを無効にする
  177.       @command_window.disable_item(4)
  178.     end
  179.     # プレイ時間ウィンドウを作成
  180.     @playtime_window = Window_PlayTime.new
  181.     @playtime_window.x = 0
  182.     @playtime_window.y = 224
  183.     # 歩数ウィンドウを作成
  184.     @steps_window = Window_Steps.new
  185.     @steps_window.x = 0
  186.     @steps_window.y = 320
  187.     # ゴールドウィンドウを作成
  188.     @gold_window = Window_Gold.new
  189.     @gold_window.x = 0
  190.     @gold_window.y = 416
  191.     # ステータスウィンドウを作成
  192.     @status_window = Window_MenuStatus.new
  193.     @status_window.x = 160
  194.     @status_window.y = 0
  195.     # トランジション実行
  196.     Graphics.transition
  197.     # メインループ
  198.     loop do
  199.       # ゲーム画面を更新
  200.       Graphics.update
  201.       # 入力情報を更新
  202.       Input.update
  203.       # フレーム更新
  204.       update
  205.       # 画面が切り替わったらループを中断
  206.       if $scene != self
  207.         break
  208.       end
  209.     end
  210.     # トランジション準備
  211.     Graphics.freeze
  212.     # ウィンドウを解放
  213.     @command_window.dispose
  214.     @playtime_window.dispose
  215.     @steps_window.dispose
  216.     @gold_window.dispose
  217.     @status_window.dispose
  218.   end
  219. end
  220. #==============================================================================
  221. # ■ Scene_Title
  222. #------------------------------------------------------------------------------
  223. #  タイトル画面の処理を行うクラスです。
  224. #==============================================================================

  225. class Scene_Title
  226.   #--------------------------------------------------------------------------
  227.   # ● メイン処理
  228.   #--------------------------------------------------------------------------
  229.   def main
  230.     # 戦闘テストの場合
  231.     if $BTEST
  232.       battle_test
  233.       return
  234.     end
  235.     # データベースをロード
  236.     $data_actors        = load_data("Data/Actors.rxdata")
  237.     $data_classes       = load_data("Data/Classes.rxdata")
  238.     $data_skills        = load_data("Data/Skills.rxdata")
  239.     $data_items         = load_data("Data/Items.rxdata")
  240.     $data_weapons       = load_data("Data/Weapons.rxdata")
  241.     $data_armors        = load_data("Data/Armors.rxdata")
  242.     $data_enemies       = load_data("Data/Enemies.rxdata")
  243.     $data_troops        = load_data("Data/Troops.rxdata")
  244.     $data_states        = load_data("Data/States.rxdata")
  245.     $data_animations    = load_data("Data/Animations.rxdata")
  246.     $data_tilesets      = load_data("Data/Tilesets.rxdata")
  247.     $data_common_events = load_data("Data/CommonEvents.rxdata")
  248.     $data_system        = load_data("Data/System.rxdata")
  249.     # システムオブジェクトを作成
  250.     $game_system = Game_System.new
  251.     # タイトルグラフィックを作成
  252.     [url=home.php?mod=space&uid=114926]@sprite[/url] = Sprite.new
  253.     @sprite.bitmap = RPG::Cache.title($data_system.title_name)
  254.     # コマンドウィンドウを作成
  255.     s1 = "ニューゲーム"
  256.     s2 = "コンティニュー"
  257.     s3 = "シャットダウン"
  258.     s4 = PARA_RESTART::TITLE_COMMAND_NAME
  259.     @command_window = Window_Command.new(192, [s1, s2 ,s4 ,s3])
  260.     @command_window.back_opacity = 160
  261.     @command_window.x = 320 - @command_window.width / 2
  262.     @command_window.y = 288
  263.     # コンティニュー有効判定
  264.     # セーブファイルがひとつでも存在するかどうかを調べる
  265.     # 有効なら @continue_enabled を true、無効なら false にする
  266.     @continue_enabled = false
  267.     for i in 0..3
  268.       if FileTest.exist?("Save#{i+1}.rxdata")
  269.         @continue_enabled = true
  270.       end
  271.     end
  272.     # コンティニューが有効な場合、カーソルをコンティニューに合わせる
  273.     # 無効な場合、コンティニューの文字をグレー表示にする
  274.     if @continue_enabled
  275.       @command_window.index = 1
  276.     else
  277.       @command_window.disable_item(1)
  278.     end
  279.     # 中断データ有効判定
  280.     # 中断セーブファイルが存在するかどうかを調べる
  281.     # 有効なら @restart_enabled を true、無効なら false にする
  282.     @restart_enabled = false
  283.     if FileTest.exist?(PARA_RESTART::FILENAME)
  284.       @restart_enabled = true
  285.     end
  286.     # コンティニューが有効な場合、カーソルをコンティニューに合わせる
  287.     # 無効な場合、コンティニューの文字をグレー表示にする
  288.     if @restart_enabled
  289.       @command_window.index = 2
  290.     else
  291.       @command_window.disable_item(2)
  292.     end
  293.     # タイトル BGM を演奏
  294.     $game_system.bgm_play($data_system.title_bgm)
  295.     # ME、BGS の演奏を停止
  296.     Audio.me_stop
  297.     Audio.bgs_stop
  298.     # トランジション実行
  299.     Graphics.transition
  300.     # メインループ
  301.     loop do
  302.       # ゲーム画面を更新
  303.       Graphics.update
  304.       # 入力情報を更新
  305.       Input.update
  306.       # フレーム更新
  307.       update
  308.       # 画面が切り替わったらループを中断
  309.       if $scene != self
  310.         break
  311.       end
  312.     end
  313.     # トランジション準備
  314.     Graphics.freeze
  315.     # コマンドウィンドウを解放
  316.     @command_window.dispose
  317.     # タイトルグラフィックを解放
  318.     @sprite.bitmap.dispose
  319.     @sprite.dispose
  320.   end
  321.   #--------------------------------------------------------------------------
  322.   # ● フレーム更新
  323.   #--------------------------------------------------------------------------
  324.   def update
  325.     # コマンドウィンドウを更新
  326.     @command_window.update
  327.     # C ボタンが押された場合
  328.     if Input.trigger?(Input::C)
  329.       # コマンドウィンドウのカーソル位置で分岐
  330.       case @command_window.index
  331.       when 0  # ニューゲーム
  332.         command_new_game
  333.       when 1  # コンティニュー
  334.         command_continue
  335.       when 2  # 再開
  336.         command_restart
  337.       when 3  # シャットダウン
  338.         command_shutdown
  339.       end
  340.     end
  341.   end
  342.   #--------------------------------------------------------------------------
  343.   # ○ コマンド : 再開
  344.   #--------------------------------------------------------------------------
  345.   def command_restart
  346.     # コンティニューが無効の場合
  347.     unless @restart_enabled
  348.       # ブザー SE を演奏
  349.       $game_system.se_play($data_system.buzzer_se)
  350.       return
  351.     end
  352.     # 決定 SE を演奏
  353.     $game_system.se_play($data_system.decision_se)
  354.     # ファイルが存在しない場合
  355.     unless FileTest.exist?(PARA_RESTART::FILENAME)
  356.       # ブザー SE を演奏
  357.       $game_system.se_play($data_system.buzzer_se)
  358.       return
  359.     end
  360.     # テンポラリオブジェクトを再作成
  361.     $game_temp = Game_Temp.new
  362.     # セーブデータの読み込み
  363.     file = File.open(PARA_RESTART::FILENAME, "rb")
  364.     read_save_data(file)
  365.     file.close
  366.     # ファイルの削除
  367.     File.delete(PARA_RESTART::FILENAME)
  368.     # BGM、BGS を復帰
  369.     $game_system.bgm_play($game_system.playing_bgm)
  370.     $game_system.bgs_play($game_system.playing_bgs)
  371.     # マップを更新 (並列イベント実行)
  372.     $game_map.update
  373.     # マップ画面に切り替え
  374.     $scene = Scene_Map.new
  375.   end
  376.   #--------------------------------------------------------------------------
  377.   # ○ セーブデータの読み込み
  378.   #     file : 読み込み用ファイルオブジェクト (オープン済み)
  379.   #--------------------------------------------------------------------------
  380.   def read_save_data(file)
  381.     # セーブファイル描画用のキャラクターデータを読み込む
  382.     characters = Marshal.load(file)
  383.     # プレイ時間計測用のフレームカウントを読み込む
  384.     Graphics.frame_count = Marshal.load(file)
  385.     # 各種ゲームオブジェクトを読み込む
  386.     $game_system        = Marshal.load(file)
  387.     $game_switches      = Marshal.load(file)
  388.     $game_variables     = Marshal.load(file)
  389.     $game_self_switches = Marshal.load(file)
  390.     $game_screen        = Marshal.load(file)
  391.     $game_actors        = Marshal.load(file)
  392.     $game_party         = Marshal.load(file)
  393.     $game_troop         = Marshal.load(file)
  394.     $game_map           = Marshal.load(file)
  395.     $game_player        = Marshal.load(file)
  396.     # マジックナンバーがセーブ時と異なる場合
  397.     # (エディタで編集が加えられている場合)
  398.     if $game_system.magic_number != $data_system.magic_number
  399.       # マップをリロード
  400.       $game_map.setup($game_map.map_id)
  401.       $game_player.center($game_player.x, $game_player.y)
  402.     end
  403.     # パーティメンバーをリフレッシュ
  404.     $game_party.refresh
  405.   end
  406. end
复制代码

[长三角文件]
- 标题画面定制组合的补丁 -
 标题画面定制,菜单命令中断保存,
 我想是能够使用图像。

restert_2.jpg
restert_1.jpg
小天终于要填个新坑了,这个游戏的名字是《欲望恶魔~游侠传记》
剧情:★☆☆☆☆☆☆☆☆☆
脚本:★☆☆☆☆☆☆☆☆☆
素材:☆☆☆☆☆☆☆☆☆☆
预计明年这一个浩大的工程既可以完工了。。有木有支持的!?制作工具:RMVA
回复

使用道具 举报

梦石
0
星屑
1166
在线时间
127 小时
注册时间
2013-2-16
回帖
368
 楼主| 发表于 2013-4-30 19:44:55 | 显示全部楼层
7、状态显示增加                                                                    
[摘要] 详细状态画面中显示的全名,以显示你在数据库中设置一个不同的名字和演员名字。(2),巴特勒/图形显示图片  显示我的图片或图形的的巴特勒图形。
[脚本]
  1. #==============================================================================
  2. # ++ ステータス表示プラス ver. 1.10 ++
  3. #  Script by パラ犬
  4. #  [url]http://2d6.parasite.jp/[/url]
  5. #------------------------------------------------------------------------------
  6. # [機能1] ステータス画面のアクター名をフルネームで表示
  7. # [機能2] ステータス画面のグラフィックを変更
  8. # [機能3] クラス名を非表示
  9. #------------------------------------------------------------------------------
  10. # [グラフィックの種類『ピクチャー』の使い方]
  11. # 「Graphics/Pictures」フォルダに、アクターグラフィックと同名の画像ファイルを
  12. # インポートします。
  13. # 『歩行グラフィックに依存』の場合は歩行グラフィック名が、
  14. # 『バトラーに依存』の場合はバトラーグラフィック名が
  15. # ピクチャーのファイル名となります。
  16. #==============================================================================

  17. module PARA_STSW

  18.   # アクターのフルネーム(書式は FULLNAME[ アクターID ] = "名前")
  19.   # {name}と入れると、そのアクターの名前を表示します。
  20.   FULLNAME=[]#この行は消さないでください
  21.   FULLNAME[1] = "{name}=モッチャリーノ"
  22.   FULLNAME[2] = "“タワシ頭のプリンス”バジル"
  23.   
  24.   # グラフィックの種類
  25.   #( 0:歩行グラフィック / 1:バトラーグラフィック /
  26.   #   2:ピクチャー(歩行グラフィックに依存) / 3:ピクチャー(バトラーに依存) )
  27.   STATUS_GRAPHIC_TYPE = 1
  28.   
  29.   # 文字位置を横にずらす
  30.   # (ピクチャーのサイズが大きすぎて文字と重なるときに設定。0で初期位置)
  31.   STATUS_SHIFT = 32
  32.   
  33.   # クラス名を非表示にする( true / false )
  34.   DRAW_SKIP_CLASS = false

  35. end

  36. # ↑ 設定項目ここまで
  37. #------------------------------------------------------------------------------

  38. #==============================================================================
  39. # ■ Window_Status
  40. #==============================================================================

  41. class Window_Status < Window_Base
  42.   #--------------------------------------------------------------------------
  43.   # ● リフレッシュ
  44.   #--------------------------------------------------------------------------
  45.   alias refresh_para_stsw refresh
  46.   def refresh
  47.     @draw_skip_graphic = true
  48.     @draw_skip_name = true
  49.     @draw_skip_class = true
  50.     refresh_para_stsw
  51.     # 詳細ステータスの文字位置を横にずらす
  52.     if PARA_STSW::STATUS_SHIFT != 0
  53.       @status_sprite = Sprite.new
  54.       @status_sprite.x = 16 + PARA_STSW::STATUS_SHIFT
  55.       @status_sprite.y = 16
  56.       @status_sprite.z = self.z + 1
  57.       @status_sprite.bitmap = self.contents.dup
  58.       self.contents.clear
  59.     end
  60.     # グラフィックを描画
  61.     @draw_skip_graphic = false
  62.     case PARA_STSW::STATUS_GRAPHIC_TYPE
  63.       when 0
  64.         draw_actor_graphic(@actor, 40, 112)
  65.       when 1
  66.         draw_battler_graphic_para(@actor, 0, 40)
  67.       when 2
  68.         draw_actor_picture_para(@actor, 0, 40)
  69.       when 3
  70.         draw_battler_picture_para(@actor, 0, 40)
  71.     end
  72.     # アクターの名前を描画
  73.     @draw_skip_name = false
  74.     @draw_skip_class = PARA_STSW::DRAW_SKIP_CLASS
  75.     if PARA_STSW::FULLNAME[@actor.id] != nil
  76.       text = PARA_STSW::FULLNAME[@actor.id].dup
  77.       name = @actor.name
  78.       begin
  79.         text[/{name}/] = "#{name}"
  80.       rescue
  81.       end
  82.       self.contents.draw_text(4, 0, 260, 32, text)
  83.       draw_actor_class(@actor, 4 + 284, 0)
  84.     else
  85.       draw_actor_name(@actor, 4, 0)
  86.       draw_actor_class(@actor, 4 + 144, 0)
  87.     end
  88.   end
  89.   #--------------------------------------------------------------------------
  90.   # ○ 破棄
  91.   #--------------------------------------------------------------------------
  92.   alias dispose_para_stsw dispose
  93.   def dispose
  94.     dispose_para_stsw
  95.     if @status_sprite != nil
  96.       @status_sprite.dispose
  97.     end
  98.   end
  99. end

  100. #==============================================================================
  101. # ■ Window_Base
  102. #==============================================================================

  103. class Window_Base < Window
  104.   #--------------------------------------------------------------------------
  105.   # ● オブジェクト初期化
  106.   #--------------------------------------------------------------------------
  107.   alias initialize_para_stsw initialize
  108.   def initialize(x, y, width, height)
  109.     initialize_para_stsw(x, y, width, height)
  110.     @draw_skip_graphic = false
  111.     @draw_skip_name = false
  112.     @draw_skip_class = PARA_STSW::DRAW_SKIP_CLASS
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ● グラフィックの描画
  116.   #--------------------------------------------------------------------------
  117.   alias draw_actor_graphic_para_stsw draw_actor_graphic
  118.   def draw_actor_graphic(actor, x, y)
  119.     if !(@draw_skip_graphic)
  120.       draw_actor_graphic_para_stsw(actor, x, y)
  121.     end
  122.   end
  123.   #--------------------------------------------------------------------------
  124.   # ● 名前の描画
  125.   #--------------------------------------------------------------------------
  126.   alias draw_actor_name_para_stsw draw_actor_name
  127.   def draw_actor_name(actor, x, y)
  128.     if !(@draw_skip_name)
  129.       draw_actor_name_para_stsw(actor, x, y)
  130.     end
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # ● クラスの描画
  134.   #--------------------------------------------------------------------------
  135.   alias draw_actor_class_para_stsw draw_actor_class
  136.   def draw_actor_class(actor, x, y)
  137.     if !(@draw_skip_class)
  138.       draw_actor_class_para_stsw(actor, x, y)
  139.     end
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ○ バトラーグラフィックの描画
  143.   #--------------------------------------------------------------------------
  144.   def draw_battler_graphic_para(actor, x, y)
  145.     bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
  146.     cw = bitmap.width
  147.     ch = bitmap.height
  148.     src_rect = Rect.new(0, 0, cw, ch)
  149.     self.contents.blt(x, y, bitmap, src_rect)
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # ○ ピクチャーの描画(アクター)
  153.   #--------------------------------------------------------------------------
  154.   def draw_actor_picture_para(actor, x, y)
  155.     bitmap = RPG::Cache.picture(actor.character_name)
  156.     cw = bitmap.width
  157.     ch = bitmap.height
  158.     src_rect = Rect.new(0, 0, cw, ch)
  159.     self.contents.blt(x, y, bitmap, src_rect)
  160.   end
  161.   #--------------------------------------------------------------------------
  162.   # ○ ピクチャーの描画(バトラー)
  163.   #--------------------------------------------------------------------------
  164.   def draw_battler_picture_para(actor, x, y)
  165.     bitmap = RPG::Cache.picture(actor.battler_name)
  166.     cw = bitmap.width
  167.     ch = bitmap.height
  168.     src_rect = Rect.new(0, 0, cw, ch)
  169.     self.contents.blt(x, y, bitmap, src_rect)
  170.   end
  171. end
复制代码


status_plus.jpg
小天终于要填个新坑了,这个游戏的名字是《欲望恶魔~游侠传记》
剧情:★☆☆☆☆☆☆☆☆☆
脚本:★☆☆☆☆☆☆☆☆☆
素材:☆☆☆☆☆☆☆☆☆☆
预计明年这一个浩大的工程既可以完工了。。有木有支持的!?制作工具:RMVA
回复

使用道具 举报

梦石
0
星屑
1166
在线时间
127 小时
注册时间
2013-2-16
回帖
368
 楼主| 发表于 2013-4-30 19:50:04 | 显示全部楼层
8、活动时间战斗                                                                 
[摘要]它与加点(CT)是基于每个巴特勒的速度,
是一个作战的格式,将继续担任巴特勒计成为最大。
此外,我要像一个侧面视图战斗状态屏幕布局。 因为它是一个结构,保持默认尽可能作战系统的结构, 其特点是,它是易于使用的配合作战系统的其他脚本。 ※我不保证相结合的材料和其他所有网站一样。 因为我不接受冲突所造成的麻烦问题,谢谢你承认。
[脚本]
  1. #==============================================================================
  2. # ++ アクティブタイムバトル ver. 2.62 ++
  3. #------------------------------------------------------------------------------
  4. # CTゲージが溜まったバトラーから順にコマンド入力する戦闘形式。
  5. # バトルステータス画面をサイドビューらしくする機能もあります。
  6. # バトラーをサイドビュータイプに表示するスクリプトは、お好きなものを
  7. # 用意してください。
  8. #------------------------------------------------------------------------------
  9. #[設置上の注意]
  10. # 戦闘拡張系スクリプトを併用するときは、
  11. # できるだけこのスクリプトより下に置いてください。
  12. #------------------------------------------------------------------------------
  13. #[操作]
  14. #・逃走
  15. # 味方バトラーの一人以上がコマンド入力待ちのときにキャンセルボタンを押すことで
  16. # 「逃げる」コマンドが選択できます。
  17. # 敵の数が多かったり、コマンド入力待ちのバトラーが少ないと、
  18. # 逃走成功率が低くなります。
  19. #
  20. #・行動順の入れ替え
  21. # 複数のバトラーが行動可能のとき、
  22. # Rボタン(PageDownキー)で次のバトラーと順番を入れ替え、
  23. # Lボタン(PageUpキー)で行動順をいちばん最後に回します。(ボタン変更可)
  24. #==============================================================================

  25. module PARA_CTB
  26.   
  27.   # コマンド入力時にCTのカウントを止めるか(true:止める / false:止めない)
  28.   COMMAND_WAIT = false
  29.   # アイテム、スキル、ターゲット選択時にCTのカウントを止めるか(true:止める / false:止めない)
  30.   SELECT_WAIT = true
  31.   # アニメーション表示時にCTのカウントを止めるか(true:止める / false:止めない)
  32.   ANIMATION_WAIT = false
  33.   
  34.   # バトルスピード(数値が大きいほどCTの溜まりが速くなる)
  35.   BATTLE_SPEED = 3

  36.   # バトルメンバーの最大数(多人数パーティスクリプトを導入している時に設定)
  37.   PARTY_SIZE = 4
  38.   
  39.   # 行動終了時のCT減少パーセンテージ
  40.   ACT_ATTACK_CT = 100   # 通常攻撃
  41.   ACT_GUARD_CT = 100    # 防御
  42.   ACT_ESCAPE_CT = 100   # 逃走失敗
  43.   ACT_SKILL_CT = 100    # スキル
  44.   ACT_ITEM_CT = 100     # アイテム
  45.   
  46.   # 逃走失敗時のメッセージ
  47.   UNESCAPE_MES = "逃走失敗"

  48.   # CT満タン時の効果音(""で音を鳴らさない)
  49.   # 効果音は「Audio/SE」フォルダ内
  50.   FULL_CT_SE = "015-Jump01"
  51.   # 効果音のボリューム
  52.   FULL_CT_SE_VOL = 80

  53.   # CT満タン時のバトラーの色調((0,0,0)で変化なし)
  54.   FULL_CT_COLOR = Tone.new(32,0,0)
  55.   
  56.   # HPゲージの色(グラデーション左端)
  57.   HP_COLOR_LEFT = Color.new(128, 0, 0, 255)
  58.   # HPゲージの色(グラデーション右端)
  59.   HP_COLOR_RIGHT= Color.new(255, 0, 0, 255)
  60.   # SPゲージの色(グラデーション左端)
  61.   SP_COLOR_LEFT = Color.new(0, 0, 128, 255)
  62.   # SPゲージの色(グラデーション右端)
  63.   SP_COLOR_RIGHT= Color.new(0, 0, 255, 255)
  64.   # CTゲージの色(グラデーション左端)
  65.   COLOR_LEFT = Color.new(128, 128, 64, 255)
  66.   # CTゲージの色(グラデーション右端)
  67.   COLOR_RIGHT= Color.new(255, 255, 128, 255)
  68.   # CTが満タンになったときのゲージの色
  69.   COLOR_FULL = Color.new(255, 225, 128, 255)
  70.   
  71.   # ゲージ枠の色
  72.   FRAME_COLOR = Color.new(192, 192, 192, 255)
  73.   # ゲージ枠の太さ
  74.   FRAME_BORDER = 1
  75.   # ゲージの背景色
  76.   BACK_COLOR = Color.new(128, 128, 128, 128)

  77.   # 名前のフォントサイズ
  78.   NAME_FONT_SIZE = 16
  79.   # HP/SPのフォントサイズ
  80.   HPSP_FONT_SIZE = 18
  81.   # エネミー名のフォントサイズ
  82.   ENEMY_FONT_SIZE = 16
  83.   # 最大HP/SPを描画するか( true / false )
  84.   MAX_DRAW = false

  85.   # エネミー名をグループ化( true / false )
  86.   # (trueにすると「ゴースト 2」のようにまとめて表示します)
  87.   ENEMY_GROUPING = false

  88.   # エネミー名の下にゲージを表示( 0:なし / 1:HP / 2:CT )
  89.   # (エネミー名をグループ化している場合は無効)
  90.   ENEMY_DRAWING_MATER = 0
  91.   
  92.   # アクターのヘルプウインドウにHP/SPゲージを表示( true / false )
  93.   HELP_DRAWING_MATER_ACTOR = false
  94.   # エネミーのヘルプウインドウにHP/SPゲージを表示( true / false )
  95.   HELP_DRAWING_MATER_ENEMY = false
  96.   
  97.   # コマンドウインドウの位置を強制指定( true / false )
  98.   #(他の方のサイドビュースクリプトを併用していて
  99.   # コマンドウインドウの位置がどうしても不自然になるならtrueに)
  100.   # ※trueにしても適用されない場合、このスクリプトを
  101.   #  サイドビューよりも下に置いてみてください
  102.   WINDOWPOS_CHANGE = false
  103.   WINDOWPOS_X = 100   # X座標
  104.   WINDOWPOS_Y = 320   # Y座標

  105.   # CTのカウント間隔。少ないほどゲージ描画がなめらかに。(最小値は0)
  106.   # 処理が重い場合は、この数値を上げてください。
  107.   CT_SKIP = 1
  108.   
  109.   # 行動順入れ替えボタン(表記方法は、Input::(ボタン))
  110.   #(キーボードとの対応表はツクールのヘルプにあります)
  111.   CHANGE_NEXT = Input::R  # 次のバトラーと順番を入れ替え
  112.   CHANGE_LAST = Input::L  # 行動順を最後に回す

  113.   # コマンドウインドウの不透明度
  114.   WINDOW_OPACITY = 160

  115.   # バトルステータスウインドウの不透明度
  116.   WINDOW_MAIN_OPACITY = 255

  117.   # 逃走成功率補正。数値が大きいほど逃走しやすくなります。(最小値は1)
  118.   # 「敵の敏捷値合計」と「コマンド入力待ちの味方の敏捷値合計」が同じとき、
  119.   # [数値]×10%の確率で逃走が成功します。
  120.   # -1にすると敏捷値にかかわらず確実に成功します。
  121.   ESCAPEABLE = 10

  122. end

  123. # ↑ 設定項目ここまで
  124. #------------------------------------------------------------------------------

  125. #==============================================================================
  126. # ■ Scene_Battle
  127. #==============================================================================

  128. class Scene_Battle

  129.   #--------------------------------------------------------------------------
  130.   # ○ CTのカウント
  131.   #--------------------------------------------------------------------------
  132.   def update_ct
  133.     # カウントアップが許可されているとき
  134.     if @countup
  135.       for actor in $game_party.actors
  136.         # 行動できるか
  137.         if actor.movable? == false and actor.ct_visible and @phase4_step != 5
  138.           # 不可視状態でカウントアップ
  139.           actor.ct_visible = false
  140.           actor.countup = true
  141.           actor.full_ct = false
  142.         elsif actor.movable? and actor.ct_visible == false
  143.           # 不可視カウントアップを解除
  144.           clear_ct(actor)
  145.           actor.ct_visible = true
  146.         end
  147.         # アクターの入れ替えに対応
  148.         if actor.max_ct == 0
  149.           actor.max_ct = @max_ct
  150.         end
  151.         # アクターのカウントアップ
  152.         if actor.countup
  153.           # CTがmaxになっており、コマンド入力待ちアクターに含まれない
  154.           if actor.now_ct >= @max_ct and !(@pre_action_battlers.include?(actor))
  155.             # コマンド入力待ちアクターに追加
  156.             @pre_action_battlers.push(actor)
  157.             @action_count += 1
  158.             # 効果音を鳴らす
  159.             if PARA_CTB::FULL_CT_SE != "" and actor.ct_visible
  160.               Audio.se_play("Audio/SE/" + PARA_CTB::FULL_CT_SE,PARA_CTB::FULL_CT_SE_VOL)
  161.             end
  162.             # それ以上カウントアップしない
  163.             actor.countup = false
  164.             actor.full_ct = true
  165.           else
  166.             # カウントアップ
  167.             actor.make_action_speed
  168.             ct_skip = PARA_CTB::CT_SKIP + 1
  169.             actor.now_ct += actor.current_action.speed * PARA_CTB::BATTLE_SPEED * ct_skip
  170.           end
  171.         end
  172.       end
  173.       for enemy in $game_troop.enemies
  174.         # 行動できるか
  175.         if enemy.movable? == false and enemy.ct_visible and @phase4_step == 5
  176.           # 不可視状態でカウントアップ
  177.           enemy.ct_visible = false
  178.           enemy.countup = true
  179.           enemy.full_ct = false
  180.         elsif enemy.movable? and enemy.ct_visible == false
  181.           # 不可視カウントアップを解除
  182.           clear_ct(enemy)
  183.           enemy.ct_visible = true
  184.         end
  185.         # エネミーのカウントアップ
  186.         if enemy.countup
  187.           # CTがmaxになっており、行動待ちエネミーに含まれない
  188.           if enemy.now_ct >= @max_ct and ! @pre_action_battlers.include?(enemy)
  189.             # 行動待ちエネミーに追加
  190.             @pre_action_battlers.push(enemy)
  191.             @action_count += 1
  192.             # それ以上カウントアップしない
  193.             enemy.countup = false
  194.             enemy.full_ct = true
  195.           else
  196.             # カウントアップ
  197.             enemy.make_action_speed
  198.             enemy.now_ct += enemy.current_action.speed * PARA_CTB::BATTLE_SPEED
  199.           end
  200.         end
  201.       end
  202.       # CTゲージを再描画
  203.       @status_window.refresh_ct
  204.       @status_window2.refresh_ct
  205.     end
  206.   end
  207.   #--------------------------------------------------------------------------
  208.   # ○ バトラーのCTを0に
  209.   #--------------------------------------------------------------------------
  210.   def clear_ct(battler)
  211.     battler.countup = true
  212.     battler.now_ct = 0
  213.     battler.full_ct = false
  214.   end
  215.   #--------------------------------------------------------------------------
  216.   # ○ バトラーのCTを任意のパーセンテージに
  217.   #--------------------------------------------------------------------------
  218.   def declease_ct(battler,percent)
  219.     battler.countup = true
  220.     battler.now_ct = battler.now_ct * percent / 100
  221.     battler.full_ct = false
  222.   end
  223.   #--------------------------------------------------------------------------
  224.   # ○ CTの初期化
  225.   #--------------------------------------------------------------------------
  226.   def initialize_ct
  227.     # CTの基準値を決定
  228.     max_ct
  229.     for battler in $game_party.actors + $game_troop.enemies
  230.       if battler.movable?
  231.         # 戦闘開始時にある程度のCTを溜めておく
  232.         battler.now_ct = battler.agi * 300
  233.         battler.ct_visible = true
  234.       else
  235.         clear_ct(battler)
  236.         battler.ct_visible = false
  237.       end
  238.       battler.countup = true
  239.       battler.full_ct = false
  240.       battler.max_ct = @max_ct
  241.     end
  242.   end
  243.   #--------------------------------------------------------------------------
  244.   # ○ バトラー全員の素早さからCTの基準値を決定
  245.   #--------------------------------------------------------------------------
  246.   def max_ct
  247.     for battler in $game_party.actors + $game_troop.enemies
  248.       @max_ct += battler.agi
  249.     end
  250.     @max_ct = @max_ct * 500 / ($game_party.actors.size + $game_troop.enemies.size )
  251.   end
  252.   #--------------------------------------------------------------------------
  253.   # ○ バトラーの行動順を変更
  254.   #--------------------------------------------------------------------------
  255.   def shift_activer(shift)
  256.     # 一つシフトする時で後ろのアクターが2人以上
  257.     if @pre_action_battlers != nil
  258.       if shift == 1 and @pre_action_battlers.size >= @actor_array_index + 3
  259.         # 現在のアクターを取得
  260.         act = @pre_action_battlers[@actor_array_index]
  261.         # 現在のアクターを二つ後ろに挿入
  262.         @pre_action_battlers.insert(@actor_array_index+2, act)
  263.         # 現在位置を消去
  264.         @pre_action_battlers.delete_at(@actor_array_index)
  265.         @actor_array_index -= 1
  266.         phase3_next_actor
  267.       else
  268.         act = @pre_action_battlers[@actor_array_index]
  269.         # 現在のアクターを一番後ろに追加
  270.         @pre_action_battlers.push(act)
  271.         # 現在位置を消去
  272.         @pre_action_battlers.delete_at(@actor_array_index)
  273.         @actor_array_index -= 1
  274.         phase3_next_actor
  275.       end
  276.     end
  277.   end
  278.   #--------------------------------------------------------------------------
  279.   # ● メイン処理
  280.   #--------------------------------------------------------------------------
  281.   alias main_ctb main
  282.   def main
  283.     # エネミー名ウインドウを作成
  284.     @status_window2 = Window_BattleStatus_enemy.new
  285.     @action_battlers = []
  286.     @pre_action_battlers = []
  287.     @max_ct = 0
  288.     @countup = false
  289.     @ct_wait = 0
  290.     @action_count = 0
  291.     main_ctb
  292.     # エネミー名ウインドウを破棄
  293.     @status_window2.dispose
  294.   end
  295.   #--------------------------------------------------------------------------
  296.   # ● フレーム更新
  297.   #--------------------------------------------------------------------------
  298.   alias ctb_update update
  299.   def update
  300.     # バトルイベント実行中の場合
  301.     if $game_system.battle_interpreter.running?
  302.       # インタプリタを更新
  303.       $game_system.battle_interpreter.update
  304.       # アクションを強制されているバトラーが存在しない場合
  305.       if $game_temp.forcing_battler == nil
  306.         # バトルイベントの実行が終わった場合
  307.         unless $game_system.battle_interpreter.running?
  308.           # 戦闘継続の場合、バトルイベントのセットアップを再実行
  309.           unless judge
  310.             setup_battle_event
  311.           end
  312.         end
  313.         # アフターバトルフェーズでなければ
  314.         if @phase != 5
  315.           # ステータスウィンドウをリフレッシュ
  316.           @status_window.refresh
  317.           # エネミー名リストを更新
  318.           @status_window2.refresh
  319.         end
  320.       end
  321.     else
  322.       if @ct_wait > 0
  323.         @ct_wait -= 1
  324.       else
  325.         update_ct
  326.         @ct_wait = PARA_CTB::CT_SKIP
  327.       end
  328.     end
  329.     ctb_update
  330.   end
  331.   #--------------------------------------------------------------------------
  332.   # ● プレバトルフェーズ開始
  333.   #--------------------------------------------------------------------------
  334.   alias ctb_start_phase1 start_phase1
  335.   def start_phase1
  336.     # CTを初期化
  337.     initialize_ct
  338.     # カウントアップ開始
  339.     @countup = true
  340.     ctb_start_phase1
  341.   end
  342.   #--------------------------------------------------------------------------
  343.   # ● フレーム更新 (プレバトルフェーズ)
  344.   #--------------------------------------------------------------------------
  345.   def update_phase1
  346.     # エネミー名リストを更新
  347.     @status_window2.refresh
  348.     # 勝敗判定
  349.     if judge
  350.       # 勝利または敗北の場合 : メソッド終了
  351.       return
  352.     end
  353.     # パーティーコマンドフェーズを飛ばしてアクターコマンドフェーズ開始
  354.     start_phase3
  355.   end
  356.   #--------------------------------------------------------------------------
  357.   # ● パーティコマンドフェーズ開始
  358.   #--------------------------------------------------------------------------
  359.   def start_phase2
  360.     # フェーズ 2 に移行
  361.     @phase = 2
  362.     # アクターを非選択状態に設定
  363.     @actor_index = -1
  364.     @active_battler = nil
  365.     # パーティコマンドウィンドウを有効化
  366.     @party_command_window.active = true
  367.     @party_command_window.visible = true
  368.     # アクターコマンドウィンドウを無効化
  369.     @actor_command_window.active = false
  370.     @actor_command_window.visible = false
  371.     # メインフェーズフラグをクリア
  372.     $game_temp.battle_main_phase = false
  373.     # コマンド入力不可能な場合
  374.     unless $game_party.inputable?
  375.       # メインフェーズ開始
  376.       start_phase4
  377.     end
  378.   end
  379.   #--------------------------------------------------------------------------
  380.   # ● フレーム更新 (パーティコマンドフェーズ : 逃げる)
  381.   #--------------------------------------------------------------------------
  382.   def update_phase2_escape
  383.     # エネミーの素早さ合計を計算
  384.     enemies_agi = 0
  385.     for enemy in $game_troop.enemies
  386.       if enemy.exist?
  387.         enemies_agi += enemy.agi
  388.       end
  389.     end
  390.     # 行動可能アクターの素早さ合計を計算
  391.     actors_agi = 0
  392.     for actor in @pre_action_battlers
  393.       if actor.is_a?(Game_Actor) and actor.exist?
  394.         actors_agi += actor.agi
  395.       end
  396.     end
  397.     # 逃走成功判定
  398.     if PARA_CTB::ESCAPEABLE < 0
  399.       success = true
  400.     else
  401.       success = rand(100) < PARA_CTB::ESCAPEABLE * 10 * actors_agi / enemies_agi
  402.    end
  403.     # 逃走成功の場合
  404.     if success
  405.       # 逃走 SE を演奏
  406.       $game_system.se_play($data_system.escape_se)
  407.       # バトル開始前の BGM に戻す
  408.       $game_system.bgm_play($game_temp.map_bgm)
  409.       # CTをクリア
  410.       for battler in $game_party.actors
  411.         clear_ct(battler)
  412.       end
  413.       # バトル終了
  414.       battle_end(1)
  415.     # 逃走失敗の場合
  416.     else
  417.       # ヘルプウィンドウに "逃走失敗" をセット
  418.       @help_window.set_text(PARA_CTB::UNESCAPE_MES, 1)
  419.       # アクターのアクションとCTをクリア
  420.       pre_action_battlers = @pre_action_battlers.clone
  421.       for act in pre_action_battlers
  422.         if act.is_a?(Game_Actor)
  423.           declease_ct(act, 100-PARA_CTB::ACT_ESCAPE_CT)
  424.           act.current_action.clear
  425.           @pre_action_battlers.delete(act)
  426.         end
  427.       end
  428.       @party_command_window.visible = false
  429.       # ヘルプウィンドウを表示
  430.       @help_window.visible = true
  431.       @wait_count = 20
  432.       # メインフェーズ開始
  433.       start_phase4
  434.     end
  435.   end
  436.   #--------------------------------------------------------------------------
  437.   # ● アクターコマンドフェーズ開始
  438.   #--------------------------------------------------------------------------
  439.   def start_phase3
  440.     # フェーズ 3 に移行
  441.     @phase = 3
  442.     # アクターを非選択状態に設定
  443.     @actor_index = -1
  444.     @active_battler = nil
  445.     @actor_array_index = -1
  446.     # 次のアクターのコマンド入力へ
  447.     if @pre_action_battlers != []
  448.       phase3_next_actor
  449.     else
  450.       start_phase4
  451.     end
  452.   end
  453.   #--------------------------------------------------------------------------
  454.   # ● 次のアクターのコマンド入力へ
  455.   #--------------------------------------------------------------------------
  456.   def phase3_next_actor
  457.     # ループ
  458.     begin
  459.       # アクターの明滅エフェクト OFF
  460.       if @active_battler != nil
  461.         @active_battler.blink = false
  462.       end
  463.       # 最後のアクターの場合
  464.       if @actor_array_index + 1 >= @pre_action_battlers.size
  465.         # メインフェーズ開始
  466.         start_phase4
  467.         return
  468.       #次がエネミーの場合
  469.       elsif $game_troop.enemies.include?(@pre_action_battlers[@actor_array_index + 1])
  470.         # メインフェーズ開始
  471.         start_phase4
  472.         return
  473.       end
  474.       # アクターのインデックスを進める
  475.       @actor_array_index += 1
  476.       @actor_index = @pre_action_battlers[@actor_array_index].index
  477.       @active_battler = $game_party.actors[@actor_index]
  478.       # バトルイベントが予約されている場合
  479.       if @active_battler.current_action.forcing
  480.         # メインフェーズ開始
  481.         start_phase4
  482.         return
  483.       end
  484.       @active_battler.blink = true
  485.       @active_battler.current_action.clear
  486.     # アクターがコマンド入力を受け付けない状態ならもう一度
  487.     end until @active_battler.inputable?
  488.     # アクターコマンドウィンドウをセットアップ
  489.     phase3_setup_command_window
  490.   end
  491.   #--------------------------------------------------------------------------
  492.   # ● 前のアクターのコマンド入力へ
  493.   #--------------------------------------------------------------------------
  494.   def phase3_prior_actor
  495.     # ループ
  496.     begin
  497.       # アクターの明滅エフェクト OFF
  498.       if @active_battler != nil
  499.         @active_battler.blink = false
  500.       end
  501.       # 最初のアクターの場合
  502.       if @actor_array_index <= 0
  503.         # アクターコマンドフェーズ開始
  504.         start_phase2
  505.         return
  506.       end
  507.       # アクターのインデックスを戻す
  508.       @actor_array_index -= 1
  509.       @actor_index = @pre_action_battlers[@actor_array_index].index
  510.       @active_battler = $game_party.actors[@actor_index]
  511.       @active_battler.blink = true
  512.       @active_battler.current_action.clear
  513.     # アクターがコマンド入力を受け付けない状態ならもう一度
  514.     end until @active_battler.inputable?
  515.     # アクターコマンドウィンドウをセットアップ
  516.     phase3_setup_command_window
  517.   end
  518.   #--------------------------------------------------------------------------
  519.   # ● アクターコマンドウィンドウのセットアップ
  520.   #--------------------------------------------------------------------------
  521.   alias phase3_setup_command_window_ctb phase3_setup_command_window
  522.   def phase3_setup_command_window
  523.     @actor_command_window.back_opacity = PARA_CTB::WINDOW_OPACITY
  524.     phase3_setup_command_window_ctb
  525.     if PARA_CTB::WINDOWPOS_CHANGE
  526.       # アクターコマンドウィンドウの位置を設定
  527.       @actor_command_window.x = PARA_CTB::WINDOWPOS_X
  528.       @actor_command_window.y = PARA_CTB::WINDOWPOS_Y
  529.       # ステータスウインドウに隠れないように
  530.       @actor_command_window.z = 9999
  531.     end
  532.   end
  533.   #--------------------------------------------------------------------------
  534.   # ● フレーム更新 (アクターコマンドフェーズ)
  535.   #--------------------------------------------------------------------------
  536.   def update_phase3
  537.     # エネミーアローが有効の場合
  538.     if @enemy_arrow != nil
  539.       @countup = PARA_CTB::SELECT_WAIT ? false : true
  540.       update_phase3_enemy_select
  541.     # アクターアローが有効の場合
  542.     elsif @actor_arrow != nil
  543.       @countup = PARA_CTB::SELECT_WAIT ? false : true
  544.       update_phase3_actor_select
  545.     # スキルウィンドウが有効の場合
  546.     elsif @skill_window != nil
  547.       @countup = PARA_CTB::SELECT_WAIT ? false : true
  548.       update_phase3_skill_select
  549.     # アイテムウィンドウが有効の場合
  550.     elsif @item_window != nil
  551.       @countup = PARA_CTB::SELECT_WAIT ? false : true
  552.       update_phase3_item_select
  553.     # アクターコマンドウィンドウが有効の場合
  554.     elsif @actor_command_window.active
  555.       @countup = PARA_CTB::COMMAND_WAIT ? false : true
  556.       update_phase3_basic_command
  557.     end
  558.   end
  559.   #--------------------------------------------------------------------------
  560.   # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
  561.   #--------------------------------------------------------------------------
  562.   alias ctb_update_phase3_basic_command update_phase3_basic_command
  563.   def update_phase3_basic_command
  564.     ctb_update_phase3_basic_command
  565.     # LRボタンで行動順を変更
  566.     if Input.trigger?(PARA_CTB::CHANGE_NEXT)
  567.       shift_activer(1)
  568.     end
  569.      if Input.trigger?(PARA_CTB::CHANGE_LAST)
  570.       shift_activer(-1)
  571.     end
  572.   end
  573.   #--------------------------------------------------------------------------
  574.   # ● メインフェーズ開始
  575.   #--------------------------------------------------------------------------
  576.   def start_phase4
  577.     # フェーズ 4 に移行
  578.     @phase = 4
  579.     battler_count = $game_party.actors.size + $game_troop.enemies.size
  580.     if @action_count >= battler_count or $game_temp.battle_turn == 0
  581.       # バトルイベントの全ページを検索
  582.       for index in 0...$data_troops[@troop_id].pages.size
  583.         # イベントページを取得
  584.         page = $data_troops[@troop_id].pages[index]
  585.         # このページのスパンが [ターン] の場合
  586.         if page.span == 1
  587.           # 実行済みフラグをクリア
  588.           $game_temp.battle_event_flags[index] = false
  589.         end
  590.       end
  591.       # ターン数カウント
  592.       $game_temp.battle_turn += 1
  593.       @action_count = 0
  594.     end
  595.     # アクターを非選択状態に設定
  596.     @actor_index = -1
  597.     @active_battler = nil
  598.     # パーティコマンドウィンドウを有効化
  599.     @party_command_window.active = false
  600.     @party_command_window.visible = false
  601.     # アクターコマンドウィンドウを無効化
  602.     @actor_command_window.active = false
  603.     @actor_command_window.visible = false
  604.     # メインフェーズフラグをセット
  605.     $game_temp.battle_main_phase = true
  606.     # エネミーアクション作成
  607.     for enemy in $game_troop.enemies
  608.       unless enemy.current_action.forcing
  609.         enemy.make_action
  610.       end
  611.     end
  612.     # 行動順序作成
  613.     make_action_orders
  614.     # ステップ 1 に移行
  615.     @phase4_step = 1
  616.   end
  617.   #--------------------------------------------------------------------------
  618.   # ● 行動順序作成
  619.   #--------------------------------------------------------------------------
  620.   def make_action_orders
  621.     # 配列 @action_battlers を初期化
  622.     @action_battlers = []
  623.     if @pre_action_battlers != []
  624.       for i in 0..@actor_array_index
  625.         # アクターを配列 @action_battlers に追加
  626.         @action_battlers.push(@pre_action_battlers[0])
  627.         @pre_action_battlers.shift
  628.       end
  629.       if @pre_action_battlers.size != 0
  630.       loop do
  631.         if $game_troop.enemies.include?(@pre_action_battlers[0])
  632.           # エネミーを配列 @action_battlers に追加
  633.           @action_battlers.push(@pre_action_battlers[0])
  634.           @pre_action_battlers.shift
  635.         else
  636.           break
  637.         end
  638.       end
  639.       end
  640.     end
  641.   end
  642.   #--------------------------------------------------------------------------
  643.   # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
  644.   #--------------------------------------------------------------------------
  645.   alias ctb_update_phase4_step1 update_phase4_step1
  646.   def update_phase4_step1
  647.     @countup = true
  648.     # ヘルプウィンドウを隠す
  649.     @help_window.visible = false
  650.     # 勝敗判定
  651.     if judge
  652.       # 勝利または敗北の場合 : メソッド終了
  653.       return
  654.     end
  655.     # 未行動バトラーが存在しない場合 (全員行動した)
  656.     if @action_battlers.size == 0
  657.       # アクターコマンドフェーズ開始
  658.       start_phase3
  659.       return
  660.     end
  661.     ctb_update_phase4_step1
  662.   end
  663.   #--------------------------------------------------------------------------
  664.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  665.   #--------------------------------------------------------------------------
  666.   alias ctb_update_phase4_step2 update_phase4_step2
  667.   def update_phase4_step2
  668.     # 強制アクションでなければ
  669.     unless @active_battler.current_action.forcing
  670.       # 制約が [行動できない] の場合
  671.       if @active_battler.restriction == 4
  672.         # CTをクリア
  673.         clear_ct(@active_battler)
  674.         # アクション強制対象のバトラーをクリア
  675.         $game_temp.forcing_battler = nil
  676.         # ステップ 1 に移行
  677.         @phase4_step = 1
  678.         return
  679.       end
  680.     end
  681.     # アニメーション再生中にCTをカウントするか
  682.     @countup = PARA_CTB::ANIMATION_WAIT ? false : true
  683.     ctb_update_phase4_step2
  684.   end
  685.   #--------------------------------------------------------------------------
  686.   # ● 基本アクション 結果作成
  687.   #--------------------------------------------------------------------------
  688.   alias make_basic_action_result_ctb make_basic_action_result
  689.   def make_basic_action_result
  690.     # 何もしないの場合
  691.     if @active_battler.current_action.basic == 3
  692.       # CTをクリア
  693.       clear_ct(@active_battler)
  694.       # アクション強制対象のバトラーをクリア
  695.       $game_temp.forcing_battler = nil
  696.       # ステップ 1 に移行
  697.       @phase4_step = 1
  698.       return
  699.     end
  700.     make_basic_action_result_ctb
  701.   end
  702.   #--------------------------------------------------------------------------
  703.   # ● スキルアクション 結果作成
  704.   #--------------------------------------------------------------------------
  705.   def make_skill_action_result
  706.     # スキルを取得
  707.     [url=home.php?mod=space&uid=260100]@skill[/url] = $data_skills[@active_battler.current_action.skill_id]
  708.     # 強制アクションでなければ
  709.     unless @active_battler.current_action.forcing
  710.       # SP 切れなどで使用できなくなった場合
  711.       unless @active_battler.skill_can_use?(@skill.id)
  712.         # アクション強制対象のバトラーをクリア
  713.         $game_temp.forcing_battler = nil
  714.         # CTをクリア
  715.         declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT)
  716.         # ステップ 1 に移行
  717.         @phase4_step = 1
  718.         return
  719.       end
  720.     end
  721.     # SP 消費
  722.     @active_battler.sp -= @skill.sp_cost
  723.     # ステータスウィンドウをリフレッシュ
  724.     @status_window.refresh
  725.     # ヘルプウィンドウにスキル名を表示
  726.     @help_window.set_text(@skill.name, 1)
  727.     # アニメーション ID を設定
  728.     @animation1_id = @skill.animation1_id
  729.     @animation2_id = @skill.animation2_id
  730.     # コモンイベント ID を設定
  731.     @common_event_id = @skill.common_event_id
  732.     # 対象側バトラーを設定
  733.     set_target_battlers(@skill.scope)
  734.     # スキルの効果を適用
  735.     for target in @target_battlers
  736.       target.skill_effect(@active_battler, @skill)
  737.     end
  738.   end
  739.   #--------------------------------------------------------------------------
  740.   # ● アイテムアクション 結果作成
  741.   #--------------------------------------------------------------------------
  742.   alias ctb_make_item_action_result make_item_action_result
  743.   def make_item_action_result
  744.     # アイテムを取得
  745.     @item = $data_items[@active_battler.current_action.item_id]
  746.     # アイテム切れなどで使用できなくなった場合
  747.     unless $game_party.item_can_use?(@item.id)
  748.       # CTをクリア
  749.       declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT)
  750.       # ステップ 1 に移行
  751.       @phase4_step = 1
  752.       return
  753.     end
  754.     ctb_make_item_action_result
  755.   end
  756.   #--------------------------------------------------------------------------
  757.   # ● フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
  758.   #--------------------------------------------------------------------------
  759.   alias update_phase4_step5_ctb update_phase4_step5
  760.   def update_phase4_step5
  761.     # ダメージを記録
  762.     for target in @target_battlers
  763.       if target.damage != nil
  764.         target.movable_backup = target.movable?
  765.       end
  766.     end
  767.     update_phase4_step5_ctb
  768.   end
  769.   #--------------------------------------------------------------------------
  770.   # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  771.   #--------------------------------------------------------------------------
  772.   alias update_phase4_step6_ctb update_phase4_step6
  773.   def update_phase4_step6
  774.     @active_battler.countup = true
  775.     if @active_battler.current_action.basic == 1
  776.       # 防御
  777.       declease_ct(@active_battler,100-PARA_CTB::ACT_GUARD_CT)
  778.     else
  779.       case @active_battler.current_action.kind
  780.       # 攻撃
  781.       when 0
  782.         declease_ct(@active_battler,100-PARA_CTB::ACT_ATTACK_CT)
  783.       # スキル
  784.       when 1
  785.         declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT)
  786.       # アイテム
  787.       when 2
  788.         declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT)
  789.       else
  790.         clear_ct(@active_battler)
  791.       end
  792.     end
  793.     # ターゲットが行動不能になったらCTを0に
  794.     for target in @target_battlers
  795.       if target.movable? == false and target.movable_backup == true
  796.         clear_ct(target)
  797.         @status_window.refresh_ct
  798.       end
  799.     end
  800.     update_phase4_step6_ctb
  801.     # エネミー名リストを更新
  802.     @status_window2.refresh
  803.     # アクションをクリア
  804.     if @active_battler.guarding? == false
  805.       @active_battler.current_action.clear
  806.     end
  807.   end
  808.   #--------------------------------------------------------------------------
  809.   # ● アフターバトルフェーズ開始
  810.   #--------------------------------------------------------------------------
  811.   alias ctb_start_phase5 start_phase5
  812.   def start_phase5
  813.     @countup = false
  814.     ctb_start_phase5
  815.   end
  816. end

  817. #==============================================================================
  818. # ■ Window_BattleStatus
  819. #==============================================================================

  820. class Window_BattleStatus < Window_Base
  821.   #--------------------------------------------------------------------------
  822.   # ● オブジェクト初期化
  823.   #--------------------------------------------------------------------------
  824.   def initialize
  825.     super(160, 320, 480, 160)
  826.     self.contents = Bitmap.new(width - 32, height - 32)
  827.     self.back_opacity = PARA_CTB::WINDOW_MAIN_OPACITY
  828.     @level_up_flags = [false, false, false, false]
  829.     @before_hp = []
  830.     @before_sp = []
  831.     @before_states = []
  832.     @now_hp = []
  833.     @now_sp = []
  834.     @now_states = []
  835.     refresh
  836.   end
  837.   #--------------------------------------------------------------------------
  838.   # ● リフレッシュ
  839.   #--------------------------------------------------------------------------
  840.   def refresh
  841.     @item_max = $game_party.actors.size
  842.     for i in 0...$game_party.actors.size
  843.       actor = $game_party.actors[i]
  844.       line_height = 120 / PARA_CTB::PARTY_SIZE
  845.       actor_y = i * line_height + 4
  846.       # 現在のステータスを配列に
  847.       @now_hp[i] = actor.hp
  848.       @now_sp[i] = actor.sp
  849.       @now_states[i] = actor.states
  850.       # レベルアップ
  851.       if @level_up_flags[i]
  852.         self.contents.fill_rect(344, actor_y+14, 100, 8, Color.new(0, 0, 0, 0))
  853.         self.contents.font.color = normal_color
  854.         self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!")
  855.       end
  856.     end
  857.     # バトルステータスの軽量化処理
  858.     # ステータスの配列が変化したときのみ描画処理
  859.     if @before_hp == nil or @before_sp == nil or @before_states == nil or
  860.     @before_hp != @now_hp or @before_sp != @now_sp or @before_states != @now_states
  861.       self.contents.clear
  862.       for j in 0...$game_party.actors.size
  863.         actor = $game_party.actors[j]
  864.         line_height = 120 / PARA_CTB::PARTY_SIZE
  865.         actor_y = j * line_height + 4
  866.         self.contents.font.size = PARA_CTB::NAME_FONT_SIZE
  867.         # 名前を描画
  868.         draw_actor_name(actor, 4, actor_y+16-PARA_CTB::NAME_FONT_SIZE)
  869.         # HPを描画
  870.         hp_color1 = PARA_CTB::HP_COLOR_LEFT
  871.         hp_color2 = PARA_CTB::HP_COLOR_RIGHT
  872.         draw_meter(actor.hp, actor.maxhp, 125, actor_y+14, 80, 8, hp_color1, hp_color2)
  873.         draw_actor_hp(actor, 102, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100)
  874.         # SPを描画
  875.         sp_color1 = PARA_CTB::SP_COLOR_LEFT
  876.         sp_color2 = PARA_CTB::SP_COLOR_RIGHT
  877.         draw_meter(actor.sp, actor.maxsp, 245, actor_y+14, 80, 8, sp_color1, sp_color2)
  878.         draw_actor_sp(actor, 222, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100)
  879.         # 変化後のステータスを配列に
  880.         @before_hp[j] = actor.hp
  881.         @before_sp[j] = actor.sp
  882.         @before_states[j] = actor.states
  883.         # レベルアップ
  884.         if @level_up_flags[j]
  885.           self.contents.fill_rect(344, actor_y, 100, 8, Color.new(0, 0, 0, 0))
  886.           self.contents.font.color = normal_color
  887.           self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!")
  888.         end
  889.       end
  890.     end
  891.     refresh_ct
  892.   end
  893.   #--------------------------------------------------------------------------
  894.   # ● CTゲージのリフレッシュ
  895.   #--------------------------------------------------------------------------
  896.   def refresh_ct
  897.     for i in 0...$game_party.actors.size
  898.       actor = $game_party.actors[i]
  899.       line_height = 120 / PARA_CTB::PARTY_SIZE
  900.       actor_y = i * line_height + 4
  901.       # CTが満タンになったときのゲージの色
  902.       ct_color_full = PARA_CTB::COLOR_FULL
  903.       # CTゲージの色(左端)
  904.       ct_color_start = actor.full_ct ? ct_color_full : PARA_CTB::COLOR_LEFT
  905.       # CTゲージの色(右端)
  906.       ct_color_end = actor.full_ct ? ct_color_full : PARA_CTB::COLOR_RIGHT
  907.       if @level_up_flags[i] != true and actor.ct_visible
  908.         draw_meter(actor.now_ct, actor.max_ct, 344, actor_y+14, 100, 8, ct_color_start, ct_color_end)
  909.       elsif @level_up_flags[i] != true
  910.         draw_meter(0, actor.max_ct, 344, actor_y+14, 100, 8, ct_color_start, ct_color_end)
  911.       end
  912.     end
  913.   end
  914.   #--------------------------------------------------------------------------
  915.   # ● フレーム更新
  916.   #--------------------------------------------------------------------------
  917.   def update
  918.     super
  919.   end
  920.   #--------------------------------------------------------------------------
  921.   # ● HP の描画
  922.   #     actor : アクター
  923.   #     x     : 描画先 X 座標
  924.   #     y     : 描画先 Y 座標
  925.   #     width : 描画先の幅
  926.   #--------------------------------------------------------------------------
  927.   def draw_actor_hp(actor, x, y, width = 144)
  928.     # 文字列 "HP" を描画
  929.     self.contents.font.color = system_color
  930.     self.contents.font.size = 16
  931.     self.contents.draw_text(x, y+2, 32, 32, $data_system.words.hp)
  932.     self.contents.font.color = normal_color
  933.     self.contents.font.size = PARA_CTB::HPSP_FONT_SIZE
  934.     if PARA_CTB::MAX_DRAW
  935.       # MaxHP を描画
  936.       self.contents.draw_text(x, y, width, 32, actor.maxhp.to_s, 2)
  937.       text_size = self.contents.text_size(actor.maxhp.to_s)
  938.       text_x = x + width - text_size.width - 12
  939.       self.contents.draw_text(text_x, y, 12, 32, "/", 1)
  940.       # HP を描画
  941.       self.contents.font.color = actor.hp == 0 ? knockout_color :
  942.         actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  943.       text_x = text_x - text_size.width
  944.       self.contents.draw_text(text_x, y, text_size.width, 32, actor.hp.to_s, 2)
  945.     else
  946.       self.contents.font.color = actor.hp == 0 ? knockout_color :
  947.         actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  948.       self.contents.draw_text(x, y, width, 32, actor.hp.to_s, 2)
  949.     end
  950.   end
  951.   #--------------------------------------------------------------------------
  952.   # ● SP の描画
  953.   #     actor : アクター
  954.   #     x     : 描画先 X 座標
  955.   #     y     : 描画先 Y 座標
  956.   #     width : 描画先の幅
  957.   #--------------------------------------------------------------------------
  958.   def draw_actor_sp(actor, x, y, width = 144)
  959.     # 文字列 "SP" を描画
  960.     self.contents.font.color = system_color
  961.     self.contents.font.size = 16
  962.     self.contents.draw_text(x, y+2, 32, 32, $data_system.words.sp)
  963.     self.contents.font.color = normal_color
  964.     self.contents.font.size = PARA_CTB::HPSP_FONT_SIZE
  965.     if PARA_CTB::MAX_DRAW
  966.     # MaxSP を描画
  967.       self.contents.draw_text(x, y, width, 32, actor.maxsp.to_s, 2)
  968.       text_size = self.contents.text_size(actor.maxsp.to_s)
  969.       text_x = x + width - text_size.width - 12
  970.       self.contents.draw_text(text_x, y, 12, 32, "/", 1)
  971.       # SP を描画
  972.       self.contents.font.color = actor.sp == 0 ? knockout_color :
  973.         actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  974.       text_x = text_x - text_size.width
  975.       self.contents.draw_text(text_x, y, text_size.width, 32, actor.sp.to_s, 2)
  976.     else
  977.       self.contents.font.color = actor.sp == 0 ? knockout_color :
  978.         actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  979.       self.contents.draw_text(x, y, width, 32, actor.sp.to_s, 2)
  980.     end
  981.   end
  982. end

  983. #==============================================================================
  984. # □ 敵の名前を表示するウインドウ
  985. #==============================================================================

  986. class Window_BattleStatus_enemy < Window_Base
  987.   #--------------------------------------------------------------------------
  988.   # ○ オブジェクト初期化
  989.   #--------------------------------------------------------------------------
  990.   def initialize
  991.     super(0, 320, 160, 160)
  992.     self.contents = Bitmap.new(width - 32, height - 32)
  993.     self.back_opacity = PARA_CTB::WINDOW_MAIN_OPACITY
  994.     refresh
  995.   end
  996.   #--------------------------------------------------------------------------
  997.   # ○ リフレッシュ
  998.   #--------------------------------------------------------------------------
  999.   def refresh
  1000.     self.contents.clear
  1001.     self.contents.font.color = normal_color
  1002.     self.contents.font.size = PARA_CTB::ENEMY_FONT_SIZE
  1003.     @exist_enemies = []
  1004.     if $game_troop.enemies != nil
  1005.       if PARA_CTB::ENEMY_GROUPING
  1006.         ememy_list = []
  1007.         ememy_list_index = []
  1008.         # エネミーをグループ化
  1009.         for i in 0...$game_troop.enemies.size
  1010.           enemy = $game_troop.enemies[i]
  1011.           if enemy.exist?
  1012.             if ememy_list.include?(enemy.name)
  1013.               ememy_list_index[ememy_list.index(enemy.name)] += 1
  1014.             else
  1015.               # エネミー名を記録
  1016.               ememy_list.push(enemy.name)
  1017.               ememy_list_index[ememy_list.index(enemy.name)] = 1
  1018.             end
  1019.           end
  1020.         end
  1021.         # エネミーの名前と数を描画
  1022.         enemy_index = 0
  1023.         for enemy_name in ememy_list
  1024.           enemy_y = enemy_index * (PARA_CTB::ENEMY_FONT_SIZE+6) + 4
  1025.           if ememy_list_index[enemy_index] > 1
  1026.             enemy_name = enemy_name + " " + ememy_list_index[enemy_index].to_s
  1027.           end
  1028.           self.contents.draw_text(4, enemy_y, 160, 20, enemy_name)
  1029.           enemy_index += 1
  1030.         end
  1031.       else
  1032.         # エネミーの名前を描画
  1033.         enemy_index = 0
  1034.         for i in 0...$game_troop.enemies.size
  1035.           enemy = $game_troop.enemies[i]
  1036.           if enemy.exist?
  1037.             @exist_enemies.push(enemy)
  1038.             line_height = PARA_CTB::ENEMY_FONT_SIZE + 6
  1039.             if PARA_CTB::ENEMY_DRAWING_MATER != 0
  1040.               line_height += 10
  1041.             end
  1042.             enemy_y = enemy_index * line_height + 4
  1043.             self.contents.draw_text(4, enemy_y, 160, 20, enemy.name)
  1044.             enemy_index += 1
  1045.             if PARA_CTB::ENEMY_DRAWING_MATER == 1
  1046.               hp_color1 = PARA_CTB::HP_COLOR_LEFT
  1047.               hp_color2 = PARA_CTB::HP_COLOR_RIGHT
  1048.               y = enemy_y + PARA_CTB::ENEMY_FONT_SIZE + 3
  1049.               draw_meter(enemy.hp, enemy.maxhp, 4, y, 80, 8, hp_color1, hp_color2)
  1050.             end
  1051.           end
  1052.         end
  1053.       end
  1054.     end
  1055.     refresh_ct
  1056.   end
  1057.   #--------------------------------------------------------------------------
  1058.   # ○ CTゲージのリフレッシュ
  1059.   #--------------------------------------------------------------------------
  1060.   def refresh_ct
  1061.     if PARA_CTB::ENEMY_DRAWING_MATER == 2 and @exist_enemies != nil
  1062.       enemy_index = 0
  1063.       for enemy in @exist_enemies
  1064.         line_height = PARA_CTB::ENEMY_FONT_SIZE + 16
  1065.         enemy_y = enemy_index * line_height + 4
  1066.         y = enemy_y + PARA_CTB::ENEMY_FONT_SIZE + 3
  1067.         # CTが満タンになったときのゲージの色
  1068.         ct_color_full = PARA_CTB::COLOR_FULL
  1069.         # CTゲージの色(左端)
  1070.         ct_color_start = enemy.full_ct ? ct_color_full : PARA_CTB::COLOR_LEFT
  1071.         # CTゲージの色(右端)
  1072.         ct_color_end = enemy.full_ct ? ct_color_full : PARA_CTB::COLOR_RIGHT
  1073.         if enemy.ct_visible
  1074.           draw_meter(enemy.now_ct, enemy.max_ct, 4, y, 100, 8, ct_color_start, ct_color_end)
  1075.         else
  1076.           draw_meter(0, enemy.max_ct, 4, y, 100, 8, ct_color_start, ct_color_end)
  1077.         end
  1078.         enemy_index += 1
  1079.       end
  1080.     end
  1081.   end
  1082. end

  1083. #==============================================================================
  1084. # ■ Window_Base
  1085. #==============================================================================

  1086. class Window_Base < Window
  1087.   
  1088.   #--------------------------------------------------------------------------
  1089.   # ○ ゲージを描画
  1090.   #--------------------------------------------------------------------------
  1091.   def draw_meter(now, max, x, y, width, height, start_color, end_color=start_color )
  1092.     self.contents.fill_rect(x, y, width, height, PARA_CTB::FRAME_COLOR)
  1093.     self.contents.fill_rect(x+PARA_CTB::FRAME_BORDER, y+PARA_CTB::FRAME_BORDER, width-

  1094. PARA_CTB::FRAME_BORDER*2, height-PARA_CTB::FRAME_BORDER*2, PARA_CTB::BACK_COLOR)
  1095.     now = now > max ? max : now
  1096.     percentage = max != 0 ? (width-2) * now / max.to_f : 0
  1097.     if start_color == end_color
  1098.       self.contents.fill_rect(x+1, y+1, percentage, height-2, start_color)
  1099.     else
  1100.       for i in 1..percentage
  1101.         r = start_color.red + (end_color.red - start_color.red) / percentage * i
  1102.         g = start_color.green + (end_color.green - start_color.green) / percentage * i
  1103.         b = start_color.blue + (end_color.blue - start_color.blue) / percentage * i
  1104.         a = start_color.alpha + (end_color.alpha - start_color.alpha) / percentage * i
  1105.         self.contents.fill_rect(x+i, y+1, 1, height-2, Color.new(r, g, b, a))
  1106.       end
  1107.     end
  1108.   end
  1109. end

  1110. #==============================================================================
  1111. # ■ Game_Battler
  1112. #==============================================================================

  1113. class Game_Battler
  1114.   #--------------------------------------------------------------------------
  1115.   # ● 公開インスタンス変数
  1116.   #--------------------------------------------------------------------------
  1117.   attr_accessor :max_ct
  1118.   attr_accessor :now_ct
  1119.   attr_accessor :full_ct
  1120.   attr_accessor :countup
  1121.   attr_accessor :ct_visible
  1122.   attr_accessor :movable_backup
  1123.   #--------------------------------------------------------------------------
  1124.   # ● オブジェクト初期化
  1125.   #--------------------------------------------------------------------------
  1126.   alias ctb_initialize initialize
  1127.   def initialize
  1128.     ctb_initialize
  1129.     @max_ct = 0
  1130.     @now_ct = 0
  1131.     @full_ct = false
  1132.     @countup = true
  1133.     @ct_visible = true
  1134.   end
  1135. end

  1136. #==============================================================================
  1137. # ■ Sprite_Battler
  1138. #==============================================================================

  1139. class Sprite_Battler < RPG::Sprite
  1140.   #--------------------------------------------------------------------------
  1141.   # ● フレーム更新
  1142.   #--------------------------------------------------------------------------
  1143.   alias ctb_update update
  1144.   def update
  1145.     ctb_update
  1146.     if @battler != nil
  1147.       if @battler.full_ct and @battler.ct_visible
  1148.         # CTが溜まったバトラーの色調を変化させる
  1149.         fullct_color = PARA_CTB::FULL_CT_COLOR
  1150.         self.tone = fullct_color
  1151.       else
  1152.         fullct_color = Tone.new(0,0,0)
  1153.         self.tone = fullct_color
  1154.       end
  1155.     end
  1156.   end
  1157. end

  1158. #==============================================================================
  1159. # ■ Window_Help
  1160. #==============================================================================

  1161. class Window_Help < Window_Base
  1162.   #--------------------------------------------------------------------------
  1163.   # ● アクター設定
  1164.   #     actor : ステータスを表示するアクター
  1165.   #--------------------------------------------------------------------------
  1166.   alias set_actor_ctb set_actor
  1167.   def set_actor(actor)
  1168.     if PARA_CTB::HELP_DRAWING_MATER_ACTOR
  1169.       self.contents.clear
  1170.       draw_actor_name(actor, 4, 0)
  1171.       draw_actor_state(actor, 140, 0)
  1172.       hp_color1 = PARA_CTB::HP_COLOR_LEFT
  1173.       hp_color2 = PARA_CTB::HP_COLOR_RIGHT
  1174.       draw_meter(actor.hp, actor.maxhp, 316, 18, 112, 8, hp_color1, hp_color2)
  1175.       draw_actor_hp(actor, 284, 0)
  1176.       sp_color1 = PARA_CTB::SP_COLOR_LEFT
  1177.       sp_color2 = PARA_CTB::SP_COLOR_RIGHT
  1178.       draw_meter(actor.sp, actor.maxsp, 492, 18, 112, 8, sp_color1, sp_color2)
  1179.       draw_actor_sp(actor, 460, 0)
  1180.       @actor = actor
  1181.       @text = nil
  1182.       self.visible = true
  1183.     else
  1184.       set_actor_ctb(actor)
  1185.     end
  1186.   end
  1187.   #--------------------------------------------------------------------------
  1188.   # ● エネミー設定
  1189.   #     enemy : 名前とステートを表示するエネミー
  1190.   #--------------------------------------------------------------------------
  1191.   alias set_enemy_ctb set_enemy
  1192.   def set_enemy(enemy)
  1193.     if PARA_CTB::HELP_DRAWING_MATER_ENEMY
  1194.       self.contents.clear
  1195.       draw_actor_name(enemy, 4, 0)
  1196.       draw_actor_state(enemy, 140, 0)
  1197.       hp_color1 = PARA_CTB::HP_COLOR_LEFT
  1198.       hp_color2 = PARA_CTB::HP_COLOR_RIGHT
  1199.       draw_meter(enemy.hp, enemy.maxhp, 316, 18, 112, 8, hp_color1, hp_color2)
  1200.       draw_actor_hp(enemy, 284, 0)
  1201.       sp_color1 = PARA_CTB::SP_COLOR_LEFT
  1202.       sp_color2 = PARA_CTB::SP_COLOR_RIGHT
  1203.       draw_meter(enemy.sp, enemy.maxsp, 492, 18, 112, 8, sp_color1, sp_color2)
  1204.       draw_actor_sp(enemy, 460, 0)
  1205.       self.visible = true
  1206.     else
  1207.       set_enemy_ctb(enemy)
  1208.     end
  1209.   end
  1210. end
复制代码

[操作]或飞行中的
 由巴特勒盟友按时间等待命令的输入
 ,可以选择“取消”按钮,在“私奔”是命令中的一个或多个。
 敌人还是很多的,巴特勒等待命令输入的号码是小,逃走的成功率是很低的。或取代秩序的行动, 行动时一个以上的可能,巴特勒  和更改的顺序巴特勒和下面的R键(PageDown键),  打开按钮的顺序L(PageUp键)结束动作。按钮,可以改变设置。

[长三角文件]
- 活动时间战斗&ActionEX头号敌人的行动相结合的补丁,
 用于组合搁板状和“ActionEX头号敌人的动作脚本时,”
 我会解决这个问题,结束敌人行动无限期。

ctb.jpg
小天终于要填个新坑了,这个游戏的名字是《欲望恶魔~游侠传记》
剧情:★☆☆☆☆☆☆☆☆☆
脚本:★☆☆☆☆☆☆☆☆☆
素材:☆☆☆☆☆☆☆☆☆☆
预计明年这一个浩大的工程既可以完工了。。有木有支持的!?制作工具:RMVA
回复

使用道具 举报

梦石
0
星屑
1166
在线时间
127 小时
注册时间
2013-2-16
回帖
368
 楼主| 发表于 2013-4-30 19:55:14 | 显示全部楼层
9、基于自定义窗口                                                                 
[摘要]改变字体和文本颜色的窗口,平铺背景。
我还可以更改消息窗口的透明度。
[脚本]
  1. #==============================================================================
  2. # ++ ウインドウベースカスタマイズ ver. 1.10 ++
  3. #  Script by パラ犬
  4. #  [url]http://2d6.parasite.jp/[/url]
  5. #------------------------------------------------------------------------------
  6. # ウインドウの文字色や背景のタイリングを変更します。
  7. #------------------------------------------------------------------------------
  8. #[設置上の注意]
  9. # できるだけリストの上のほうに置いてください。(Scene_Debugよりは下)
  10. #==============================================================================

  11. module PARA_WINDOW_CUSTOM
  12.   
  13.   # ウインドウ背景を並べて表示( true / false )
  14.   SKIN_TILING = false

  15.   # メッセージウインドウの不透明度
  16.   BACK_OPACITY = 160
  17.   
  18.   # 通常文字色
  19.   COLOR_NORMAL = Color.new(255, 255, 255, 255)
  20.   # 無効文字色
  21.   COLOR_DISABLED = Color.new(255, 255, 255, 128)
  22.   # システム文字色
  23.   COLOR_SYSTEM = Color.new(192, 224, 255, 255)
  24.   # ピンチ文字色
  25.   COLOR_CRISIS = Color.new(255, 255, 64, 255)
  26.   # 戦闘不能文字色
  27.   COLOR_KNOCKOUT = Color.new(255, 64, 0, 255)

  28.   # 制御文字「\C[n]」で表示する色
  29.   # (書式は「COLOR_SET[n] = Color.new(赤, 緑, 青, 不透明度)。nは0~7)
  30.   COLOR_SET=[] #この行は消さないでください
  31.   COLOR_SET[0] = Color.new(255, 255, 255, 255)
  32.   COLOR_SET[1] = Color.new(128, 128, 255, 255)
  33.   COLOR_SET[2] = Color.new(255, 128, 128, 255)
  34.   COLOR_SET[3] = Color.new(128, 255, 128, 255)
  35.   COLOR_SET[4] = Color.new(128, 255, 255, 255)
  36.   COLOR_SET[5] = Color.new(255, 128, 255, 255)
  37.   COLOR_SET[6] = Color.new(255, 255, 128, 255)
  38.   COLOR_SET[7] = Color.new(192, 192, 192, 255)
  39.   
  40.   #フォント名(複数候補の場合は「,」で区切る。例:["HGP行書体", "MS Pゴシック"])
  41.   FONT_NAME = ["MS Pゴシック"]
  42.   
  43.   FONT_SIZE = 22        # デフォルトのフォントサイズ
  44.   FONT_BOLD = false     # 太字にするか(true/false)
  45.   FONT_ITALIC = false   # 斜体にするか(true/false)
  46.   
  47. end

  48. # ↑ 設定項目ここまで
  49. #------------------------------------------------------------------------------

  50. #==============================================================================
  51. # ■ Window_Base
  52. #==============================================================================

  53. class Window_Base < Window

  54.   Font.default_color = PARA_WINDOW_CUSTOM::COLOR_NORMAL
  55.   Font.default_name = PARA_WINDOW_CUSTOM::FONT_NAME + ["MS Pゴシック"]
  56.   Font.default_size = PARA_WINDOW_CUSTOM::FONT_SIZE
  57.   Font.default_bold = PARA_WINDOW_CUSTOM::FONT_BOLD
  58.   Font.default_italic = PARA_WINDOW_CUSTOM::FONT_ITALIC
  59.   
  60.   #--------------------------------------------------------------------------
  61.   # ● オブジェクト初期化
  62.   #--------------------------------------------------------------------------
  63.   alias initialize_para_window_custom initialize
  64.   def initialize(x, y, width, height)
  65.     initialize_para_window_custom(x, y, width, height)
  66.     self.stretch = !(PARA_WINDOW_CUSTOM::SKIN_TILING)
  67.   end
  68.   #--------------------------------------------------------------------------
  69.   # ● 文字色取得
  70.   #--------------------------------------------------------------------------
  71.   def text_color(n)
  72.     return PARA_WINDOW_CUSTOM::COLOR_SET[n]
  73.   end
  74.   #--------------------------------------------------------------------------
  75.   # ● 通常文字色の取得
  76.   #--------------------------------------------------------------------------
  77.   def normal_color
  78.     return PARA_WINDOW_CUSTOM::COLOR_NORMAL
  79.   end
  80.   #--------------------------------------------------------------------------
  81.   # ● 無効文字色の取得
  82.   #--------------------------------------------------------------------------
  83.   def disabled_color
  84.     return PARA_WINDOW_CUSTOM::COLOR_DISABLED
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # ● システム文字色の取得
  88.   #--------------------------------------------------------------------------
  89.   def system_color
  90.     return PARA_WINDOW_CUSTOM::COLOR_SYSTEM
  91.   end
  92.   #--------------------------------------------------------------------------
  93.   # ● ピンチ文字色の取得
  94.   #--------------------------------------------------------------------------
  95.   def crisis_color
  96.     return PARA_WINDOW_CUSTOM::COLOR_CRISIS
  97.   end
  98.   #--------------------------------------------------------------------------
  99.   # ● 戦闘不能文字色の取得
  100.   #--------------------------------------------------------------------------
  101.   def knockout_color
  102.     return PARA_WINDOW_CUSTOM::COLOR_KNOCKOUT
  103.   end
  104. end

  105. #==============================================================================
  106. # ■ Window_Message
  107. #==============================================================================

  108. class Window_Message < Window_Selectable
  109.   #--------------------------------------------------------------------------
  110.   # ● ウィンドウの位置と不透明度の設定
  111.   #--------------------------------------------------------------------------
  112.   alias reset_window_para_window_custom reset_window
  113.   def reset_window
  114.     reset_window_para_window_custom
  115.     self.back_opacity = PARA_WINDOW_CUSTOM::BACK_OPACITY
  116.   end
  117. end
复制代码

[补充]“显示并排窗口背景”
设置为缺省状态,皮肤被拉伸以适应窗口大小自动。
如果真正的“瓷砖窗口背景”设置,同时保持原来的大小
显示图像中的传播。 = false(默认值SKIN_TILING因素) SKIN_TILING =真

window_custom2.jpg
window_custom.jpg
window_custom1.jpg
小天终于要填个新坑了,这个游戏的名字是《欲望恶魔~游侠传记》
剧情:★☆☆☆☆☆☆☆☆☆
脚本:★☆☆☆☆☆☆☆☆☆
素材:☆☆☆☆☆☆☆☆☆☆
预计明年这一个浩大的工程既可以完工了。。有木有支持的!?制作工具:RMVA
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部