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

Project1

 找回密码
 注册会员
搜索
查看: 6654|回复: 23

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

[复制链接]

Lv2.观梦者

梦石
0
星屑
701
在线时间
127 小时
注册时间
2013-2-16
帖子
428
发表于 2013-4-30 19:03:06 | 显示全部楼层 |阅读模式

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

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

x
前言                                                                                                                                                                                                     
自从来到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

Lv2.观梦者

梦石
0
星屑
701
在线时间
127 小时
注册时间
2013-2-16
帖子
428
 楼主| 发表于 2013-4-30 19:08:48 | 显示全部楼层
本帖最后由 1142881837 于 2013-4-30 19:13 编辑

1、显示气球消息                                                           

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

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

使用道具 举报

Lv2.观梦者

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

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

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



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






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

使用道具 举报

Lv2.观梦者

梦石
0
星屑
701
在线时间
127 小时
注册时间
2013-2-16
帖子
428
 楼主| 发表于 2013-4-30 19:23:56 | 显示全部楼层
3、图形变化几许                                                                 
[摘要]如果你移动的同时按下任意键,移动速度会增加。
如果已提供的图片几许当时的第一个字符,然后显示在使用它。
[脚本]
RUBY 代码复制
  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.  
  11. class Game_Player < Game_Character
  12.  
  13.   SPEED_DASH = 5          # ダッシュ時の移動速度
  14.   SPEED_NORMAL = 4          # 通常の移動速度
  15.  
  16.   # ダッシュに使うボタン(表記方法は、Input::(ボタン))
  17.   #(キーボードとの対応表はツクールのヘルプにあります)
  18.   KEY_DASH = Input::A
  19.  
  20.   # "_dash"グラフィックが存在しない場合ダッシュをするか( true:する / false:しない )
  21.   NO_FILE_DASH = true
  22.  
  23.   # 静止時はグラフィックを変更しない( true:変更しない / false:変更する )
  24.   CHANGE_IN_MOVING = false
  25.  
  26.   # ダッシュ禁止イベントスイッチID
  27.   # (イベントコマンド「スイッチの操作」でこの番号のスイッチをONにしている間は
  28.   #  ダッシュを機能を無効にします)
  29.   NO_DASH_SWITCH = 999
  30.  
  31. end
  32.  
  33. #==============================================================================
  34. # ■ Game_Player
  35. #==============================================================================
  36.  
  37. class Game_Player < Game_Character
  38.  
  39.   #--------------------------------------------------------------------------
  40.   # ● フレーム更新
  41.   #--------------------------------------------------------------------------
  42.   alias dash_update update
  43.   def update
  44.     # イベント実行中、移動ルート強制中、
  45.     # メッセージウィンドウ表示中のいずれでもない場合
  46.     unless $game_system.map_interpreter.running? or
  47.            @move_route_forcing or $game_temp.message_window_showing
  48.       if !($game_switches[NO_DASH_SWITCH])
  49.         # キー判定
  50.         if Input.press?(KEY_DASH) and (CHANGE_IN_MOVING == false or Input.dir8 != 0)
  51.           if (dash_graphic_exist?($game_party.actors[0]) or NO_FILE_DASH)
  52.             # ダッシュ中でなければダッシュ
  53.             if @move_speed != SPEED_DASH
  54.               @move_speed = SPEED_DASH
  55.               @dash_on = true
  56.               $game_player.refresh
  57.             end
  58.           end
  59.         elsif @dash_on == nil or @dash_on
  60.             @move_speed = SPEED_NORMAL
  61.             @dash_on = nil
  62.             $game_player.refresh
  63.         end
  64.       end
  65.     end
  66.     dash_update
  67.   end
  68.   #--------------------------------------------------------------------------
  69.   # ○ ダッシュグラフィックの有無をチェック
  70.   #--------------------------------------------------------------------------
  71.   def dash_graphic_exist?(actor)   
  72.     # 読み込みテスト
  73.     begin
  74.       RPG::Cache.character(actor.character_name.to_s + "_dash", actor.character_hue)
  75.     rescue
  76.       return false
  77.     end
  78.     return true
  79.   end
  80.   #--------------------------------------------------------------------------
  81.   # ● リフレッシュ
  82.   #--------------------------------------------------------------------------
  83.   alias dash_refresh refresh
  84.   def refresh
  85.     dash_refresh
  86.     # パーティ人数が 0 人でない場合
  87.     if $game_party.actors.size != 0
  88.       actor = $game_party.actors[0]
  89.       # キャラクターのファイル名と色相を設定
  90.       if @dash_on and dash_graphic_exist?(actor)
  91.         fileplus = "_dash"
  92.       else
  93.         fileplus = ""
  94.       end
  95.       @character_name = actor.character_name + fileplus
  96.       @character_hue = actor.character_hue
  97.     end
  98.   end
  99. end

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





正常运动

正常运动
dash_after.jpg

范例图片

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

使用道具 举报

Lv2.观梦者

梦石
0
星屑
701
在线时间
127 小时
注册时间
2013-2-16
帖子
428
 楼主| 发表于 2013-4-30 19:28:29 | 显示全部楼层
4、武器技能                                                                        
[摘要]确保你不都配备了“剑技术”和“矛术”,一种特定类型的武器,只有当你使用技能。
此功能相当于到200X厂商的“武器属性”。
[脚本]
RUBY 代码复制
  1. #==============================================================================
  2. # ++ 武器種別スキル ver. 1.10 ++
  3. #  Script by パラ犬
  4. #------------------------------------------------------------------------------
  5. # 武器の種類ごとに使用可能なスキルを制限します。
  6. #------------------------------------------------------------------------------
  7. #[使い方]
  8. # 武器の種類ごとに「剣」「槍」などの属性を設定し
  9. # 武器とスキルの両方に付加します。
  10. # この属性が一致しない場合、スキルを習得していても使用不可能となります。
  11. #==============================================================================
  12.  
  13. module PARA_WSKL
  14.  
  15.   # 素手の時のみ使用可能なスキル属性の名前
  16.   NO_WEAPON_NAME = "体術"
  17.  
  18.   # 武器によって制限されないスキル属性名
  19.   # (この属性が付加されているスキルは武器の影響を受けません)
  20.   VARIABLE_SKILL = "魔法"
  21.   # スキルを制限しない武器属性名
  22.   # (この属性が付加されている武器は全てのスキルを使うことができます)
  23.   VARIABLE_WEAPON = ""
  24.  
  25.   # 使用不可スキルの表示/非表示
  26.   # ( 0:常に表示 / 1:戦闘中は非表示 / 2:常に非表示 )
  27.   VISIBLE_TYPE = 1
  28.  
  29. end
  30.  
  31. # ↑ 設定項目ここまで
  32. #------------------------------------------------------------------------------
  33.  
  34. #==============================================================================
  35. # ■ Game_Actor
  36. #==============================================================================
  37.  
  38. class Game_Actor < Game_Battler
  39.   #--------------------------------------------------------------------------
  40.   # ● スキルの使用可能判定
  41.   #     skill_id : スキル ID
  42.   #--------------------------------------------------------------------------
  43.   def skill_can_use?(skill_id)
  44.     if not skill_learn?(skill_id)
  45.       return false
  46.     end
  47.     if not skill_w_can_use?(skill_id)
  48.       return false
  49.     end
  50.     return super
  51.   end
  52.   #--------------------------------------------------------------------------
  53.   # ● 武器スキルの使用可能判定
  54.   #     skill_id : スキル ID
  55.   #--------------------------------------------------------------------------
  56.   def skill_w_can_use?(skill_id)
  57.     if not skill_learn?(skill_id)
  58.       return false
  59.     end
  60.     # スキルと武器の属性がひとつでも一致するか
  61.     if $data_skills[skill_id].element_set & self.element_set != []
  62.       bool = true
  63.     else
  64.       # 武器の属性IDを名前に
  65.       weapon_elements_name = []
  66.       for element_id in self.element_set
  67.         weapon_elements_name.push($data_system.elements[element_id])
  68.       end
  69.       # スキルの属性IDを名前に
  70.       skill_elements_name = []
  71.       for element_id in $data_skills[skill_id].element_set
  72.         skill_elements_name.push($data_system.elements[element_id])
  73.       end
  74.       # 武器によって制限されないスキル属性
  75.       if skill_elements_name.include?(PARA_WSKL::VARIABLE_SKILL) and PARA_WSKL::VARIABLE_SKILL != ""
  76.         bool = true
  77.       end
  78.       # スキルを制限しない武器属性
  79.       if weapon_elements_name.include?(PARA_WSKL::VARIABLE_WEAPON) and PARA_WSKL::VARIABLE_WEAPON != ""
  80.         bool = true
  81.       end
  82.       # 素手スキル
  83.       if skill_elements_name.include?(PARA_WSKL::NO_WEAPON_NAME) and @weapon_id == 0
  84.         bool = true
  85.       end
  86.     end
  87.     bool = bool == nil ? false : bool
  88.     return bool
  89.   end
  90. end
  91.  
  92. #==============================================================================
  93. # ■ Window_Skill
  94. #==============================================================================
  95.  
  96. class Window_Skill < Window_Selectable
  97.   #--------------------------------------------------------------------------
  98.   # ● リフレッシュ
  99.   #--------------------------------------------------------------------------
  100.   def refresh
  101.     if self.contents != nil
  102.       self.contents.dispose
  103.       self.contents = nil
  104.     end
  105.     @data = []
  106.     for i in [email]0...@actor.skills.size[/email]
  107.       skill = $data_skills[@actor.skills[i]]
  108.       case PARA_WSKL::VISIBLE_TYPE
  109.       when 1
  110.         if skill != nil and !(!@actor.skill_w_can_use?(skill.id) and $game_temp.in_battle)
  111.           @data.push(skill)
  112.         end
  113.       when 2
  114.         if skill != nil and @actor.skill_w_can_use?(skill.id)
  115.           @data.push(skill)
  116.         end
  117.       else
  118.         if skill != nil
  119.           @data.push(skill)
  120.         end
  121.       end
  122.     end
  123.     # 項目数が 0 でなければビットマップを作成し、全項目を描画
  124.     @item_max = @data.size
  125.     if @item_max > 0
  126.       self.contents = Bitmap.new(width - 32, row_max * 32)
  127.       for i in 0...@item_max
  128.         draw_item(i)
  129.       end
  130.     end
  131.   end
  132. end

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

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

使用道具 举报

Lv2.观梦者

梦石
0
星屑
701
在线时间
127 小时
注册时间
2013-2-16
帖子
428
 楼主| 发表于 2013-4-30 19:33:28 | 显示全部楼层
5、8运动图形变化                                                               
[摘要]通过同时按下左右键和上下键,让您对角线移动。
如果图像的对角线运动中所提供的最佳字符,然后使用它显示。
它也支持在“设置的迁移路线”事件命令指定的倾斜方向。
[脚本]
RUBY 代码复制
  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. #==============================================================================
  16. # ■ Game_Player
  17. #==============================================================================
  18.  
  19. class Game_Player < Game_Character
  20.   #--------------------------------------------------------------------------
  21.   # ● フレーム更新
  22.   #--------------------------------------------------------------------------
  23.   alias update_para_quarter update
  24.   def update
  25.     update_para_quarter
  26.     unless moving? or $game_system.map_interpreter.running? or
  27.            @move_route_forcing or $game_temp.message_window_showing
  28.       # 方向ボタンが押されていれば、その方向へプレイヤーを移動
  29.       case Input.dir8
  30.       when 1  # 左下に移動
  31.         move_lower_left
  32.       when 3  # 右下に移動
  33.         move_lower_right
  34.       when 7  # 左上に移動
  35.         move_upper_left
  36.       when 9  # 右上に移動
  37.         move_upper_right
  38.       end
  39.     end
  40.   end
  41. end
  42.  
  43. #==============================================================================
  44. # ■ Sprite_Character
  45. #==============================================================================
  46.  
  47. class Sprite_Character < RPG::Sprite
  48.   #--------------------------------------------------------------------------
  49.   # ● フレーム更新
  50.   #--------------------------------------------------------------------------
  51.   alias update_para_quarter update
  52.   def update
  53.     update_para_quarter
  54.     if @tile_id == 0
  55.       if (@character.direction - 2) % 2 == 1
  56.         # 斜め画像の有無をチェック
  57.         if quarter_graphic_exist?(@character)
  58.           # 斜め画像をセット
  59.           if character.dash_on and dash_quarter_graphic_exist?(@character)
  60.             @character_name = @character.character_name + "_dash_quarter"
  61.           else
  62.             @character_name = @character.character_name + "_quarter"
  63.           end
  64.           self.bitmap = RPG::Cache.character(@character_name,
  65.             @character.character_hue)
  66.           # 向きを取得
  67.           case @character.direction
  68.             when 1
  69.               n = 0
  70.             when 3
  71.               n = 2
  72.             when 7
  73.               n = 1
  74.             when 9
  75.               n = 3
  76.           end
  77.         else
  78.           @character.direction = @character.sub_direction
  79.           # 斜め画像が存在しないときの向き
  80.           n = (@character.direction - 2) / 2
  81.         end
  82.         # 転送元の矩形を設定
  83.         sx = @character.pattern * @cw
  84.         sy = n * @ch
  85.         self.src_rect.set(sx, sy, @cw, @ch)
  86.       else
  87.         self.bitmap = RPG::Cache.character(@character.character_name,
  88.           @character.character_hue)
  89.         # 転送元の矩形を設定
  90.         sx = @character.pattern * @cw
  91.         sy = (@character.direction - 2) / 2 * @ch
  92.         self.src_rect.set(sx, sy, @cw, @ch)
  93.       end
  94.     end
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # ○ 斜め画像の有無をチェック
  98.   #--------------------------------------------------------------------------
  99.   def quarter_graphic_exist?(character)
  100.     # 読み込みテスト
  101.     begin
  102.       RPG::Cache.character(character.character_name.to_s + "_quarter", character.character_hue)
  103.     rescue
  104.       return false
  105.     end
  106.     return true
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # ○ 斜めダッシュ画像の有無をチェック
  110.   #--------------------------------------------------------------------------
  111.   def dash_quarter_graphic_exist?(character)
  112.     # 読み込みテスト
  113.     begin
  114.       RPG::Cache.character(character.character_name.to_s + "_dash_quarter", character.character_hue)
  115.     rescue
  116.       return false
  117.     end
  118.     return true
  119.   end
  120. end
  121.  
  122. #==============================================================================
  123. # ■ Game_Character
  124. #==============================================================================
  125.  
  126. class Game_Character
  127.   #--------------------------------------------------------------------------
  128.   # ● 公開インスタンス変数
  129.   #--------------------------------------------------------------------------
  130.   attr_accessor   :direction        # 向き
  131.   attr_accessor   :sub_direction    # 斜め画像が存在しないときの向き
  132.   #--------------------------------------------------------------------------
  133.   # ● 左下に移動
  134.   #--------------------------------------------------------------------------
  135.   def move_lower_left
  136.     # 向き固定でない場合
  137.     unless @direction_fix
  138.       @sub_direction = @direction
  139.       @direction = 1
  140.       # 右向きだった場合は左を、上向きだった場合は下を向く
  141.       @sub_direction = (@sub_direction == 6 ? 4 : @sub_direction == 8 ? 2 : @sub_direction)
  142.     end
  143.     # 下→左、左→下 のどちらかのコースが通行可能な場合
  144.     if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 4)) or
  145.        (passable?(@x, @y, 4) and passable?(@x - 1, @y, 2))
  146.       # 座標を更新
  147.       @x -= 1
  148.       @y += 1
  149.       # 歩数増加
  150.       increase_steps
  151.     end
  152.   end
  153.   #--------------------------------------------------------------------------
  154.   # ● 右下に移動
  155.   #--------------------------------------------------------------------------
  156.   def move_lower_right
  157.     # 向き固定でない場合
  158.     unless @direction_fix
  159.       @sub_direction = @direction
  160.       @direction = 3
  161.       # 左向きだった場合は右を、上向きだった場合は下を向く
  162.       @sub_direction = (@sub_direction == 4 ? 6 : @sub_direction == 8 ? 2 : @sub_direction)
  163.     end
  164.     # 下→右、右→下 のどちらかのコースが通行可能な場合
  165.     if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or
  166.        (passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))
  167.       # 座標を更新
  168.       @x += 1
  169.       @y += 1
  170.       # 歩数増加
  171.       increase_steps
  172.     end
  173.   end
  174.   #--------------------------------------------------------------------------
  175.   # ● 左上に移動
  176.   #--------------------------------------------------------------------------
  177.   def move_upper_left
  178.     # 向き固定でない場合
  179.     unless @direction_fix
  180.       @sub_direction = @direction
  181.       @direction = 7
  182.       # 右向きだった場合は左を、下向きだった場合は上を向く
  183.       @sub_direction = (@sub_direction == 6 ? 4 : @sub_direction == 2 ? 8 : @sub_direction)
  184.     end
  185.     # 上→左、左→上 のどちらかのコースが通行可能な場合
  186.     if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 4)) or
  187.        (passable?(@x, @y, 4) and passable?(@x - 1, @y, 8))
  188.       # 座標を更新
  189.       @x -= 1
  190.       @y -= 1
  191.       # 歩数増加
  192.       increase_steps
  193.     end
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # ● 右上に移動
  197.   #--------------------------------------------------------------------------
  198.   def move_upper_right
  199.     # 向き固定でない場合
  200.     unless @direction_fix
  201.       @sub_direction = @direction
  202.       @direction = 9
  203.       # 左向きだった場合は右を、下向きだった場合は上を向く
  204.       @sub_direction = (@sub_direction == 4 ? 6 : @sub_direction == 2 ? 8 : @sub_direction)
  205.     end
  206.     # 上→右、右→上 のどちらかのコースが通行可能な場合
  207.     if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 6)) or
  208.        (passable?(@x, @y, 6) and passable?(@x + 1, @y, 8))
  209.       # 座標を更新
  210.       @x += 1
  211.       @y -= 1
  212.       # 歩数増加
  213.       increase_steps
  214.     end
  215.   end
  216.   #--------------------------------------------------------------------------
  217.   # ○ ダッシュスクリプト導入判定
  218.   #--------------------------------------------------------------------------
  219.   def dash_on
  220.     if @dash_on != nil
  221.       return @dash_on
  222.     else
  223.       return false
  224.     end
  225.   end
  226. end

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

使用道具 举报

Lv2.观梦者

梦石
0
星屑
701
在线时间
127 小时
注册时间
2013-2-16
帖子
428
 楼主| 发表于 2013-4-30 19:37:24 | 显示全部楼层
6、中断保存                                                                        
[摘要] 我会加一点保存功能菜单中的“结束游戏”。
 数据中断的消失,从标题画面可以重新启动,一旦恢复。
[脚本]
RUBY 代码复制
  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.   # メニューに表示する文字
  12.   MENU_COMMAND_NAME = "中断セーブ"
  13.   # タイトル画面に表示する文字
  14.   TITLE_COMMAND_NAME = "中断データから再開"
  15.  
  16.   # 中断時の戻り先( 0:ゲーム終了 1:タイトル画面 )
  17.   RETURN_SCENE = 1
  18.  
  19.   # 確認メッセージ
  20.   DIALOG1 = "一時保存して中断"    # セーブして中断
  21.   DIALOG2 = "一時保存しないで中断"    # セーブしないで中断
  22.   DIALOG3 = "キャンセル"    # 戻る
  23.  
  24.   # ファイル名
  25.   FILENAME = "SaveTemp.rxdata"
  26.  
  27. end
  28.  
  29. #==============================================================================
  30. # ■ Scene_End
  31. #==============================================================================
  32.  
  33. class Scene_End
  34.   #--------------------------------------------------------------------------
  35.   # ● メイン処理
  36.   #--------------------------------------------------------------------------
  37.   def main
  38.     # コマンドウィンドウを作成
  39.     s1 = PARA_RESTART::DIALOG1
  40.     s2 = PARA_RESTART::DIALOG2
  41.     s3 = PARA_RESTART::DIALOG3
  42.     @command_window = Window_Command.new(192, [s1, s2, s3])
  43.     @command_window.x = 320 - @command_window.width / 2
  44.     @command_window.y = 240 - @command_window.height / 2
  45.     # トランジション実行
  46.     Graphics.transition
  47.     # メインループ
  48.     loop do
  49.       # ゲーム画面を更新
  50.       Graphics.update
  51.       # 入力情報を更新
  52.       Input.update
  53.       # フレーム更新
  54.       update
  55.       # 画面が切り替わったらループを中断
  56.       if $scene != self
  57.         break
  58.       end
  59.     end
  60.     # トランジション準備
  61.     Graphics.freeze
  62.     # ウィンドウを解放
  63.     @command_window.dispose
  64.     # タイトル画面に切り替え中の場合
  65.     if $scene.is_a?(Scene_Title)
  66.       # 画面をフェードアウト
  67.       Graphics.transition
  68.       Graphics.freeze
  69.     end
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # ● フレーム更新
  73.   #--------------------------------------------------------------------------
  74.   def update
  75.     # コマンドウィンドウを更新
  76.     @command_window.update
  77.     # B ボタンが押された場合
  78.     if Input.trigger?(Input::B)
  79.       # キャンセル SE を演奏
  80.       $game_system.se_play($data_system.cancel_se)
  81.       # メニュー画面に切り替え
  82.       $scene = Scene_Menu.new(5)
  83.       return
  84.     end
  85.     # C ボタンが押された場合
  86.     if Input.trigger?(Input::C)
  87.       # コマンドウィンドウのカーソル位置で分岐
  88.       case @command_window.index
  89.       when 0  # セーブして中断
  90.         command_save_and_end
  91.       when 1  # セーブしないで中断
  92.         command_no_save_and_end
  93.       when 2  # やめる
  94.         command_cancel
  95.       end
  96.       return
  97.     end
  98.   end
  99.   #--------------------------------------------------------------------------
  100.   # ○ コマンド [セーブして中断] 選択時の処理
  101.   #--------------------------------------------------------------------------
  102.   def command_save_and_end
  103.     # セーブデータの書き込み
  104.     file = File.open(PARA_RESTART::FILENAME, "wb")
  105.     write_save_data(file)
  106.     file.close
  107.     # 中断処理(セーブしないで中断と共通)
  108.     command_no_save_and_end
  109.   end
  110.   #--------------------------------------------------------------------------
  111.   # ○ コマンド [セーブしないで中断] 選択時の処理
  112.   #--------------------------------------------------------------------------
  113.   def command_no_save_and_end
  114.     case PARA_RESTART::RETURN_SCENE
  115.     when 0  # ゲーム終了
  116.       command_shutdown
  117.     when 1  # タイトル画面
  118.       command_to_title
  119.     end
  120.   end
  121.   #--------------------------------------------------------------------------
  122.   # ○ セーブデータの書き込み
  123.   #     file : 書き込み用ファイルオブジェクト (オープン済み)
  124.   #--------------------------------------------------------------------------
  125.   def write_save_data(file)
  126.     # セーブファイル描画用のキャラクターデータを作成
  127.     characters = []
  128.     for i in 0...$game_party.actors.size
  129.       actor = $game_party.actors[i]
  130.       characters.push([actor.character_name, actor.character_hue])
  131.     end
  132.     # セーブファイル描画用のキャラクターデータを書き込む
  133.     Marshal.dump(characters, file)
  134.     # プレイ時間計測用のフレームカウントを書き込む
  135.     Marshal.dump(Graphics.frame_count, file)
  136.     # セーブ回数を 1 増やす
  137.     $game_system.save_count += 1
  138.     # マジックナンバーを保存する
  139.     # (エディタで保存するたびにランダムな値に書き換えられる)
  140.     $game_system.magic_number = $data_system.magic_number
  141.     # 各種ゲームオブジェクトを書き込む
  142.     Marshal.dump($game_system, file)
  143.     Marshal.dump($game_switches, file)
  144.     Marshal.dump($game_variables, file)
  145.     Marshal.dump($game_self_switches, file)
  146.     Marshal.dump($game_screen, file)
  147.     Marshal.dump($game_actors, file)
  148.     Marshal.dump($game_party, file)
  149.     Marshal.dump($game_troop, file)
  150.     Marshal.dump($game_map, file)
  151.     Marshal.dump($game_player, file)
  152.   end
  153. end
  154.  
  155. #==============================================================================
  156. # ■ Scene_Menu
  157. #==============================================================================
  158.  
  159. class Scene_Menu
  160.   #--------------------------------------------------------------------------
  161.   # ● メイン処理
  162.   #--------------------------------------------------------------------------
  163.   def main
  164.     # コマンドウィンドウを作成
  165.     s1 = $data_system.words.item
  166.     s2 = $data_system.words.skill
  167.     s3 = $data_system.words.equip
  168.     s4 = "ステータス"
  169.     s5 = "セーブ"
  170.     s6 = PARA_RESTART::MENU_COMMAND_NAME
  171.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
  172.     @command_window.index = @menu_index
  173.     # パーティ人数が 0 人の場合
  174.     if $game_party.actors.size == 0
  175.       # アイテム、スキル、装備、ステータスを無効化
  176.       @command_window.disable_item(0)
  177.       @command_window.disable_item(1)
  178.       @command_window.disable_item(2)
  179.       @command_window.disable_item(3)
  180.     end
  181.     # セーブ禁止の場合
  182.     if $game_system.save_disabled
  183.       # セーブを無効にする
  184.       @command_window.disable_item(4)
  185.     end
  186.     # プレイ時間ウィンドウを作成
  187.     @playtime_window = Window_PlayTime.new
  188.     @playtime_window.x = 0
  189.     @playtime_window.y = 224
  190.     # 歩数ウィンドウを作成
  191.     @steps_window = Window_Steps.new
  192.     @steps_window.x = 0
  193.     @steps_window.y = 320
  194.     # ゴールドウィンドウを作成
  195.     @gold_window = Window_Gold.new
  196.     @gold_window.x = 0
  197.     @gold_window.y = 416
  198.     # ステータスウィンドウを作成
  199.     @status_window = Window_MenuStatus.new
  200.     @status_window.x = 160
  201.     @status_window.y = 0
  202.     # トランジション実行
  203.     Graphics.transition
  204.     # メインループ
  205.     loop do
  206.       # ゲーム画面を更新
  207.       Graphics.update
  208.       # 入力情報を更新
  209.       Input.update
  210.       # フレーム更新
  211.       update
  212.       # 画面が切り替わったらループを中断
  213.       if $scene != self
  214.         break
  215.       end
  216.     end
  217.     # トランジション準備
  218.     Graphics.freeze
  219.     # ウィンドウを解放
  220.     @command_window.dispose
  221.     @playtime_window.dispose
  222.     @steps_window.dispose
  223.     @gold_window.dispose
  224.     @status_window.dispose
  225.   end
  226. end
  227. #==============================================================================
  228. # ■ Scene_Title
  229. #------------------------------------------------------------------------------
  230. #  タイトル画面の処理を行うクラスです。
  231. #==============================================================================
  232.  
  233. class Scene_Title
  234.   #--------------------------------------------------------------------------
  235.   # ● メイン処理
  236.   #--------------------------------------------------------------------------
  237.   def main
  238.     # 戦闘テストの場合
  239.     if $BTEST
  240.       battle_test
  241.       return
  242.     end
  243.     # データベースをロード
  244.     $data_actors        = load_data("Data/Actors.rxdata")
  245.     $data_classes       = load_data("Data/Classes.rxdata")
  246.     $data_skills        = load_data("Data/Skills.rxdata")
  247.     $data_items         = load_data("Data/Items.rxdata")
  248.     $data_weapons       = load_data("Data/Weapons.rxdata")
  249.     $data_armors        = load_data("Data/Armors.rxdata")
  250.     $data_enemies       = load_data("Data/Enemies.rxdata")
  251.     $data_troops        = load_data("Data/Troops.rxdata")
  252.     $data_states        = load_data("Data/States.rxdata")
  253.     $data_animations    = load_data("Data/Animations.rxdata")
  254.     $data_tilesets      = load_data("Data/Tilesets.rxdata")
  255.     $data_common_events = load_data("Data/CommonEvents.rxdata")
  256.     $data_system        = load_data("Data/System.rxdata")
  257.     # システムオブジェクトを作成
  258.     $game_system = Game_System.new
  259.     # タイトルグラフィックを作成
  260.     [url=home.php?mod=space&uid=114926]@sprite[/url] = Sprite.new
  261.     @sprite.bitmap = RPG::Cache.title($data_system.title_name)
  262.     # コマンドウィンドウを作成
  263.     s1 = "ニューゲーム"
  264.     s2 = "コンティニュー"
  265.     s3 = "シャットダウン"
  266.     s4 = PARA_RESTART::TITLE_COMMAND_NAME
  267.     @command_window = Window_Command.new(192, [s1, s2 ,s4 ,s3])
  268.     @command_window.back_opacity = 160
  269.     @command_window.x = 320 - @command_window.width / 2
  270.     @command_window.y = 288
  271.     # コンティニュー有効判定
  272.     # セーブファイルがひとつでも存在するかどうかを調べる
  273.     # 有効なら @continue_enabled を true、無効なら false にする
  274.     @continue_enabled = false
  275.     for i in 0..3
  276.       if FileTest.exist?("Save#{i+1}.rxdata")
  277.         @continue_enabled = true
  278.       end
  279.     end
  280.     # コンティニューが有効な場合、カーソルをコンティニューに合わせる
  281.     # 無効な場合、コンティニューの文字をグレー表示にする
  282.     if @continue_enabled
  283.       @command_window.index = 1
  284.     else
  285.       @command_window.disable_item(1)
  286.     end
  287.     # 中断データ有効判定
  288.     # 中断セーブファイルが存在するかどうかを調べる
  289.     # 有効なら @restart_enabled を true、無効なら false にする
  290.     @restart_enabled = false
  291.     if FileTest.exist?(PARA_RESTART::FILENAME)
  292.       @restart_enabled = true
  293.     end
  294.     # コンティニューが有効な場合、カーソルをコンティニューに合わせる
  295.     # 無効な場合、コンティニューの文字をグレー表示にする
  296.     if @restart_enabled
  297.       @command_window.index = 2
  298.     else
  299.       @command_window.disable_item(2)
  300.     end
  301.     # タイトル BGM を演奏
  302.     $game_system.bgm_play($data_system.title_bgm)
  303.     # ME、BGS の演奏を停止
  304.     Audio.me_stop
  305.     Audio.bgs_stop
  306.     # トランジション実行
  307.     Graphics.transition
  308.     # メインループ
  309.     loop do
  310.       # ゲーム画面を更新
  311.       Graphics.update
  312.       # 入力情報を更新
  313.       Input.update
  314.       # フレーム更新
  315.       update
  316.       # 画面が切り替わったらループを中断
  317.       if $scene != self
  318.         break
  319.       end
  320.     end
  321.     # トランジション準備
  322.     Graphics.freeze
  323.     # コマンドウィンドウを解放
  324.     @command_window.dispose
  325.     # タイトルグラフィックを解放
  326.     @sprite.bitmap.dispose
  327.     @sprite.dispose
  328.   end
  329.   #--------------------------------------------------------------------------
  330.   # ● フレーム更新
  331.   #--------------------------------------------------------------------------
  332.   def update
  333.     # コマンドウィンドウを更新
  334.     @command_window.update
  335.     # C ボタンが押された場合
  336.     if Input.trigger?(Input::C)
  337.       # コマンドウィンドウのカーソル位置で分岐
  338.       case @command_window.index
  339.       when 0  # ニューゲーム
  340.         command_new_game
  341.       when 1  # コンティニュー
  342.         command_continue
  343.       when 2  # 再開
  344.         command_restart
  345.       when 3  # シャットダウン
  346.         command_shutdown
  347.       end
  348.     end
  349.   end
  350.   #--------------------------------------------------------------------------
  351.   # ○ コマンド : 再開
  352.   #--------------------------------------------------------------------------
  353.   def command_restart
  354.     # コンティニューが無効の場合
  355.     unless @restart_enabled
  356.       # ブザー SE を演奏
  357.       $game_system.se_play($data_system.buzzer_se)
  358.       return
  359.     end
  360.     # 決定 SE を演奏
  361.     $game_system.se_play($data_system.decision_se)
  362.     # ファイルが存在しない場合
  363.     unless FileTest.exist?(PARA_RESTART::FILENAME)
  364.       # ブザー SE を演奏
  365.       $game_system.se_play($data_system.buzzer_se)
  366.       return
  367.     end
  368.     # テンポラリオブジェクトを再作成
  369.     $game_temp = Game_Temp.new
  370.     # セーブデータの読み込み
  371.     file = File.open(PARA_RESTART::FILENAME, "rb")
  372.     read_save_data(file)
  373.     file.close
  374.     # ファイルの削除
  375.     File.delete(PARA_RESTART::FILENAME)
  376.     # BGM、BGS を復帰
  377.     $game_system.bgm_play($game_system.playing_bgm)
  378.     $game_system.bgs_play($game_system.playing_bgs)
  379.     # マップを更新 (並列イベント実行)
  380.     $game_map.update
  381.     # マップ画面に切り替え
  382.     $scene = Scene_Map.new
  383.   end
  384.   #--------------------------------------------------------------------------
  385.   # ○ セーブデータの読み込み
  386.   #     file : 読み込み用ファイルオブジェクト (オープン済み)
  387.   #--------------------------------------------------------------------------
  388.   def read_save_data(file)
  389.     # セーブファイル描画用のキャラクターデータを読み込む
  390.     characters = Marshal.load(file)
  391.     # プレイ時間計測用のフレームカウントを読み込む
  392.     Graphics.frame_count = Marshal.load(file)
  393.     # 各種ゲームオブジェクトを読み込む
  394.     $game_system        = Marshal.load(file)
  395.     $game_switches      = Marshal.load(file)
  396.     $game_variables     = Marshal.load(file)
  397.     $game_self_switches = Marshal.load(file)
  398.     $game_screen        = Marshal.load(file)
  399.     $game_actors        = Marshal.load(file)
  400.     $game_party         = Marshal.load(file)
  401.     $game_troop         = Marshal.load(file)
  402.     $game_map           = Marshal.load(file)
  403.     $game_player        = Marshal.load(file)
  404.     # マジックナンバーがセーブ時と異なる場合
  405.     # (エディタで編集が加えられている場合)
  406.     if $game_system.magic_number != $data_system.magic_number
  407.       # マップをリロード
  408.       $game_map.setup($game_map.map_id)
  409.       $game_player.center($game_player.x, $game_player.y)
  410.     end
  411.     # パーティメンバーをリフレッシュ
  412.     $game_party.refresh
  413.   end
  414. end

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

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

使用道具 举报

Lv2.观梦者

梦石
0
星屑
701
在线时间
127 小时
注册时间
2013-2-16
帖子
428
 楼主| 发表于 2013-4-30 19:44:55 | 显示全部楼层
7、状态显示增加                                                                    
[摘要] 详细状态画面中显示的全名,以显示你在数据库中设置一个不同的名字和演员名字。(2),巴特勒/图形显示图片  显示我的图片或图形的的巴特勒图形。
[脚本]
RUBY 代码复制
  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.  
  18. module PARA_STSW
  19.  
  20.   # アクターのフルネーム(書式は FULLNAME[ アクターID ] = "名前")
  21.   # {name}と入れると、そのアクターの名前を表示します。
  22.   FULLNAME=[]#この行は消さないでください
  23.   FULLNAME[1] = "{name}=モッチャリーノ"
  24.   FULLNAME[2] = "“タワシ頭のプリンス”バジル"
  25.  
  26.   # グラフィックの種類
  27.   #( 0:歩行グラフィック / 1:バトラーグラフィック /
  28.   #   2:ピクチャー(歩行グラフィックに依存) / 3:ピクチャー(バトラーに依存) )
  29.   STATUS_GRAPHIC_TYPE = 1
  30.  
  31.   # 文字位置を横にずらす
  32.   # (ピクチャーのサイズが大きすぎて文字と重なるときに設定。0で初期位置)
  33.   STATUS_SHIFT = 32
  34.  
  35.   # クラス名を非表示にする( true / false )
  36.   DRAW_SKIP_CLASS = false
  37.  
  38. end
  39.  
  40. # ↑ 設定項目ここまで
  41. #------------------------------------------------------------------------------
  42.  
  43. #==============================================================================
  44. # ■ Window_Status
  45. #==============================================================================
  46.  
  47. class Window_Status < Window_Base
  48.   #--------------------------------------------------------------------------
  49.   # ● リフレッシュ
  50.   #--------------------------------------------------------------------------
  51.   alias refresh_para_stsw refresh
  52.   def refresh
  53.     @draw_skip_graphic = true
  54.     @draw_skip_name = true
  55.     @draw_skip_class = true
  56.     refresh_para_stsw
  57.     # 詳細ステータスの文字位置を横にずらす
  58.     if PARA_STSW::STATUS_SHIFT != 0
  59.       @status_sprite = Sprite.new
  60.       @status_sprite.x = 16 + PARA_STSW::STATUS_SHIFT
  61.       @status_sprite.y = 16
  62.       @status_sprite.z = self.z + 1
  63.       @status_sprite.bitmap = self.contents.dup
  64.       self.contents.clear
  65.     end
  66.     # グラフィックを描画
  67.     @draw_skip_graphic = false
  68.     case PARA_STSW::STATUS_GRAPHIC_TYPE
  69.       when 0
  70.         draw_actor_graphic(@actor, 40, 112)
  71.       when 1
  72.         draw_battler_graphic_para(@actor, 0, 40)
  73.       when 2
  74.         draw_actor_picture_para(@actor, 0, 40)
  75.       when 3
  76.         draw_battler_picture_para(@actor, 0, 40)
  77.     end
  78.     # アクターの名前を描画
  79.     @draw_skip_name = false
  80.     @draw_skip_class = PARA_STSW::DRAW_SKIP_CLASS
  81.     if PARA_STSW::FULLNAME[@actor.id] != nil
  82.       text = PARA_STSW::FULLNAME[@actor.id].dup
  83.       name = @actor.name
  84.       begin
  85.         text[/{name}/] = "#{name}"
  86.       rescue
  87.       end
  88.       self.contents.draw_text(4, 0, 260, 32, text)
  89.       draw_actor_class(@actor, 4 + 284, 0)
  90.     else
  91.       draw_actor_name(@actor, 4, 0)
  92.       draw_actor_class(@actor, 4 + 144, 0)
  93.     end
  94.   end
  95.   #--------------------------------------------------------------------------
  96.   # ○ 破棄
  97.   #--------------------------------------------------------------------------
  98.   alias dispose_para_stsw dispose
  99.   def dispose
  100.     dispose_para_stsw
  101.     if @status_sprite != nil
  102.       @status_sprite.dispose
  103.     end
  104.   end
  105. end
  106.  
  107. #==============================================================================
  108. # ■ Window_Base
  109. #==============================================================================
  110.  
  111. class Window_Base < Window
  112.   #--------------------------------------------------------------------------
  113.   # ● オブジェクト初期化
  114.   #--------------------------------------------------------------------------
  115.   alias initialize_para_stsw initialize
  116.   def initialize(x, y, width, height)
  117.     initialize_para_stsw(x, y, width, height)
  118.     @draw_skip_graphic = false
  119.     @draw_skip_name = false
  120.     @draw_skip_class = PARA_STSW::DRAW_SKIP_CLASS
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # ● グラフィックの描画
  124.   #--------------------------------------------------------------------------
  125.   alias draw_actor_graphic_para_stsw draw_actor_graphic
  126.   def draw_actor_graphic(actor, x, y)
  127.     if !(@draw_skip_graphic)
  128.       draw_actor_graphic_para_stsw(actor, x, y)
  129.     end
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # ● 名前の描画
  133.   #--------------------------------------------------------------------------
  134.   alias draw_actor_name_para_stsw draw_actor_name
  135.   def draw_actor_name(actor, x, y)
  136.     if !(@draw_skip_name)
  137.       draw_actor_name_para_stsw(actor, x, y)
  138.     end
  139.   end
  140.   #--------------------------------------------------------------------------
  141.   # ● クラスの描画
  142.   #--------------------------------------------------------------------------
  143.   alias draw_actor_class_para_stsw draw_actor_class
  144.   def draw_actor_class(actor, x, y)
  145.     if !(@draw_skip_class)
  146.       draw_actor_class_para_stsw(actor, x, y)
  147.     end
  148.   end
  149.   #--------------------------------------------------------------------------
  150.   # ○ バトラーグラフィックの描画
  151.   #--------------------------------------------------------------------------
  152.   def draw_battler_graphic_para(actor, x, y)
  153.     bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
  154.     cw = bitmap.width
  155.     ch = bitmap.height
  156.     src_rect = Rect.new(0, 0, cw, ch)
  157.     self.contents.blt(x, y, bitmap, src_rect)
  158.   end
  159.   #--------------------------------------------------------------------------
  160.   # ○ ピクチャーの描画(アクター)
  161.   #--------------------------------------------------------------------------
  162.   def draw_actor_picture_para(actor, x, y)
  163.     bitmap = RPG::Cache.picture(actor.character_name)
  164.     cw = bitmap.width
  165.     ch = bitmap.height
  166.     src_rect = Rect.new(0, 0, cw, ch)
  167.     self.contents.blt(x, y, bitmap, src_rect)
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # ○ ピクチャーの描画(バトラー)
  171.   #--------------------------------------------------------------------------
  172.   def draw_battler_picture_para(actor, x, y)
  173.     bitmap = RPG::Cache.picture(actor.battler_name)
  174.     cw = bitmap.width
  175.     ch = bitmap.height
  176.     src_rect = Rect.new(0, 0, cw, ch)
  177.     self.contents.blt(x, y, bitmap, src_rect)
  178.   end
  179. end


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

使用道具 举报

Lv2.观梦者

梦石
0
星屑
701
在线时间
127 小时
注册时间
2013-2-16
帖子
428
 楼主| 发表于 2013-4-30 19:50:04 | 显示全部楼层
8、活动时间战斗                                                                 
[摘要]它与加点(CT)是基于每个巴特勒的速度,
是一个作战的格式,将继续担任巴特勒计成为最大。
此外,我要像一个侧面视图战斗状态屏幕布局。 因为它是一个结构,保持默认尽可能作战系统的结构, 其特点是,它是易于使用的配合作战系统的其他脚本。 ※我不保证相结合的材料和其他所有网站一样。 因为我不接受冲突所造成的麻烦问题,谢谢你承认。
[脚本]
RUBY 代码复制
  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.  
  26. module PARA_CTB
  27.  
  28.   # コマンド入力時にCTのカウントを止めるか(true:止める / false:止めない)
  29.   COMMAND_WAIT = false
  30.   # アイテム、スキル、ターゲット選択時にCTのカウントを止めるか(true:止める / false:止めない)
  31.   SELECT_WAIT = true
  32.   # アニメーション表示時にCTのカウントを止めるか(true:止める / false:止めない)
  33.   ANIMATION_WAIT = false
  34.  
  35.   # バトルスピード(数値が大きいほどCTの溜まりが速くなる)
  36.   BATTLE_SPEED = 3
  37.  
  38.   # バトルメンバーの最大数(多人数パーティスクリプトを導入している時に設定)
  39.   PARTY_SIZE = 4
  40.  
  41.   # 行動終了時のCT減少パーセンテージ
  42.   ACT_ATTACK_CT = 100   # 通常攻撃
  43.   ACT_GUARD_CT = 100    # 防御
  44.   ACT_ESCAPE_CT = 100   # 逃走失敗
  45.   ACT_SKILL_CT = 100    # スキル
  46.   ACT_ITEM_CT = 100     # アイテム
  47.  
  48.   # 逃走失敗時のメッセージ
  49.   UNESCAPE_MES = "逃走失敗"
  50.  
  51.   # CT満タン時の効果音(""で音を鳴らさない)
  52.   # 効果音は「Audio/SE」フォルダ内
  53.   FULL_CT_SE = "015-Jump01"
  54.   # 効果音のボリューム
  55.   FULL_CT_SE_VOL = 80
  56.  
  57.   # CT満タン時のバトラーの色調((0,0,0)で変化なし)
  58.   FULL_CT_COLOR = Tone.new(32,0,0)
  59.  
  60.   # HPゲージの色(グラデーション左端)
  61.   HP_COLOR_LEFT = Color.new(128, 0, 0, 255)
  62.   # HPゲージの色(グラデーション右端)
  63.   HP_COLOR_RIGHT= Color.new(255, 0, 0, 255)
  64.   # SPゲージの色(グラデーション左端)
  65.   SP_COLOR_LEFT = Color.new(0, 0, 128, 255)
  66.   # SPゲージの色(グラデーション右端)
  67.   SP_COLOR_RIGHT= Color.new(0, 0, 255, 255)
  68.   # CTゲージの色(グラデーション左端)
  69.   COLOR_LEFT = Color.new(128, 128, 64, 255)
  70.   # CTゲージの色(グラデーション右端)
  71.   COLOR_RIGHT= Color.new(255, 255, 128, 255)
  72.   # CTが満タンになったときのゲージの色
  73.   COLOR_FULL = Color.new(255, 225, 128, 255)
  74.  
  75.   # ゲージ枠の色
  76.   FRAME_COLOR = Color.new(192, 192, 192, 255)
  77.   # ゲージ枠の太さ
  78.   FRAME_BORDER = 1
  79.   # ゲージの背景色
  80.   BACK_COLOR = Color.new(128, 128, 128, 128)
  81.  
  82.   # 名前のフォントサイズ
  83.   NAME_FONT_SIZE = 16
  84.   # HP/SPのフォントサイズ
  85.   HPSP_FONT_SIZE = 18
  86.   # エネミー名のフォントサイズ
  87.   ENEMY_FONT_SIZE = 16
  88.   # 最大HP/SPを描画するか( true / false )
  89.   MAX_DRAW = false
  90.  
  91.   # エネミー名をグループ化( true / false )
  92.   # (trueにすると「ゴースト 2」のようにまとめて表示します)
  93.   ENEMY_GROUPING = false
  94.  
  95.   # エネミー名の下にゲージを表示( 0:なし / 1:HP / 2:CT )
  96.   # (エネミー名をグループ化している場合は無効)
  97.   ENEMY_DRAWING_MATER = 0
  98.  
  99.   # アクターのヘルプウインドウにHP/SPゲージを表示( true / false )
  100.   HELP_DRAWING_MATER_ACTOR = false
  101.   # エネミーのヘルプウインドウにHP/SPゲージを表示( true / false )
  102.   HELP_DRAWING_MATER_ENEMY = false
  103.  
  104.   # コマンドウインドウの位置を強制指定( true / false )
  105.   #(他の方のサイドビュースクリプトを併用していて
  106.   # コマンドウインドウの位置がどうしても不自然になるならtrueに)
  107.   # ※trueにしても適用されない場合、このスクリプトを
  108.   #  サイドビューよりも下に置いてみてください
  109.   WINDOWPOS_CHANGE = false
  110.   WINDOWPOS_X = 100   # X座標
  111.   WINDOWPOS_Y = 320   # Y座標
  112.  
  113.   # CTのカウント間隔。少ないほどゲージ描画がなめらかに。(最小値は0)
  114.   # 処理が重い場合は、この数値を上げてください。
  115.   CT_SKIP = 1
  116.  
  117.   # 行動順入れ替えボタン(表記方法は、Input::(ボタン))
  118.   #(キーボードとの対応表はツクールのヘルプにあります)
  119.   CHANGE_NEXT = Input::R  # 次のバトラーと順番を入れ替え
  120.   CHANGE_LAST = Input::L  # 行動順を最後に回す
  121.  
  122.   # コマンドウインドウの不透明度
  123.   WINDOW_OPACITY = 160
  124.  
  125.   # バトルステータスウインドウの不透明度
  126.   WINDOW_MAIN_OPACITY = 255
  127.  
  128.   # 逃走成功率補正。数値が大きいほど逃走しやすくなります。(最小値は1)
  129.   # 「敵の敏捷値合計」と「コマンド入力待ちの味方の敏捷値合計」が同じとき、
  130.   # [数値]×10%の確率で逃走が成功します。
  131.   # -1にすると敏捷値にかかわらず確実に成功します。
  132.   ESCAPEABLE = 10
  133.  
  134. end
  135.  
  136. # ↑ 設定項目ここまで
  137. #------------------------------------------------------------------------------
  138.  
  139. #==============================================================================
  140. # ■ Scene_Battle
  141. #==============================================================================
  142.  
  143. class Scene_Battle
  144.  
  145.   #--------------------------------------------------------------------------
  146.   # ○ CTのカウント
  147.   #--------------------------------------------------------------------------
  148.   def update_ct
  149.     # カウントアップが許可されているとき
  150.     if @countup
  151.       for actor in $game_party.actors
  152.         # 行動できるか
  153.         if actor.movable? == false and actor.ct_visible and @phase4_step != 5
  154.           # 不可視状態でカウントアップ
  155.           actor.ct_visible = false
  156.           actor.countup = true
  157.           actor.full_ct = false
  158.         elsif actor.movable? and actor.ct_visible == false
  159.           # 不可視カウントアップを解除
  160.           clear_ct(actor)
  161.           actor.ct_visible = true
  162.         end
  163.         # アクターの入れ替えに対応
  164.         if actor.max_ct == 0
  165.           actor.max_ct = @max_ct
  166.         end
  167.         # アクターのカウントアップ
  168.         if actor.countup
  169.           # CTがmaxになっており、コマンド入力待ちアクターに含まれない
  170.           if actor.now_ct >= @max_ct and !(@pre_action_battlers.include?(actor))
  171.             # コマンド入力待ちアクターに追加
  172.             @pre_action_battlers.push(actor)
  173.             @action_count += 1
  174.             # 効果音を鳴らす
  175.             if PARA_CTB::FULL_CT_SE != "" and actor.ct_visible
  176.               Audio.se_play("Audio/SE/" + PARA_CTB::FULL_CT_SE,PARA_CTB::FULL_CT_SE_VOL)
  177.             end
  178.             # それ以上カウントアップしない
  179.             actor.countup = false
  180.             actor.full_ct = true
  181.           else
  182.             # カウントアップ
  183.             actor.make_action_speed
  184.             ct_skip = PARA_CTB::CT_SKIP + 1
  185.             actor.now_ct += actor.current_action.speed * PARA_CTB::BATTLE_SPEED * ct_skip
  186.           end
  187.         end
  188.       end
  189.       for enemy in $game_troop.enemies
  190.         # 行動できるか
  191.         if enemy.movable? == false and enemy.ct_visible and @phase4_step == 5
  192.           # 不可視状態でカウントアップ
  193.           enemy.ct_visible = false
  194.           enemy.countup = true
  195.           enemy.full_ct = false
  196.         elsif enemy.movable? and enemy.ct_visible == false
  197.           # 不可視カウントアップを解除
  198.           clear_ct(enemy)
  199.           enemy.ct_visible = true
  200.         end
  201.         # エネミーのカウントアップ
  202.         if enemy.countup
  203.           # CTがmaxになっており、行動待ちエネミーに含まれない
  204.           if enemy.now_ct >= @max_ct and ! @pre_action_battlers.include?(enemy)
  205.             # 行動待ちエネミーに追加
  206.             @pre_action_battlers.push(enemy)
  207.             @action_count += 1
  208.             # それ以上カウントアップしない
  209.             enemy.countup = false
  210.             enemy.full_ct = true
  211.           else
  212.             # カウントアップ
  213.             enemy.make_action_speed
  214.             enemy.now_ct += enemy.current_action.speed * PARA_CTB::BATTLE_SPEED
  215.           end
  216.         end
  217.       end
  218.       # CTゲージを再描画
  219.       @status_window.refresh_ct
  220.       @status_window2.refresh_ct
  221.     end
  222.   end
  223.   #--------------------------------------------------------------------------
  224.   # ○ バトラーのCTを0に
  225.   #--------------------------------------------------------------------------
  226.   def clear_ct(battler)
  227.     battler.countup = true
  228.     battler.now_ct = 0
  229.     battler.full_ct = false
  230.   end
  231.   #--------------------------------------------------------------------------
  232.   # ○ バトラーのCTを任意のパーセンテージに
  233.   #--------------------------------------------------------------------------
  234.   def declease_ct(battler,percent)
  235.     battler.countup = true
  236.     battler.now_ct = battler.now_ct * percent / 100
  237.     battler.full_ct = false
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # ○ CTの初期化
  241.   #--------------------------------------------------------------------------
  242.   def initialize_ct
  243.     # CTの基準値を決定
  244.     max_ct
  245.     for battler in $game_party.actors + $game_troop.enemies
  246.       if battler.movable?
  247.         # 戦闘開始時にある程度のCTを溜めておく
  248.         battler.now_ct = battler.agi * 300
  249.         battler.ct_visible = true
  250.       else
  251.         clear_ct(battler)
  252.         battler.ct_visible = false
  253.       end
  254.       battler.countup = true
  255.       battler.full_ct = false
  256.       battler.max_ct = @max_ct
  257.     end
  258.   end
  259.   #--------------------------------------------------------------------------
  260.   # ○ バトラー全員の素早さからCTの基準値を決定
  261.   #--------------------------------------------------------------------------
  262.   def max_ct
  263.     for battler in $game_party.actors + $game_troop.enemies
  264.       @max_ct += battler.agi
  265.     end
  266.     @max_ct = @max_ct * 500 / ($game_party.actors.size + $game_troop.enemies.size )
  267.   end
  268.   #--------------------------------------------------------------------------
  269.   # ○ バトラーの行動順を変更
  270.   #--------------------------------------------------------------------------
  271.   def shift_activer(shift)
  272.     # 一つシフトする時で後ろのアクターが2人以上
  273.     if @pre_action_battlers != nil
  274.       if shift == 1 and @pre_action_battlers.size >= @actor_array_index + 3
  275.         # 現在のアクターを取得
  276.         act = @pre_action_battlers[@actor_array_index]
  277.         # 現在のアクターを二つ後ろに挿入
  278.         @pre_action_battlers.insert(@actor_array_index+2, act)
  279.         # 現在位置を消去
  280.         @pre_action_battlers.delete_at(@actor_array_index)
  281.         @actor_array_index -= 1
  282.         phase3_next_actor
  283.       else
  284.         act = @pre_action_battlers[@actor_array_index]
  285.         # 現在のアクターを一番後ろに追加
  286.         @pre_action_battlers.push(act)
  287.         # 現在位置を消去
  288.         @pre_action_battlers.delete_at(@actor_array_index)
  289.         @actor_array_index -= 1
  290.         phase3_next_actor
  291.       end
  292.     end
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # ● メイン処理
  296.   #--------------------------------------------------------------------------
  297.   alias main_ctb main
  298.   def main
  299.     # エネミー名ウインドウを作成
  300.     @status_window2 = Window_BattleStatus_enemy.new
  301.     @action_battlers = []
  302.     @pre_action_battlers = []
  303.     @max_ct = 0
  304.     @countup = false
  305.     @ct_wait = 0
  306.     @action_count = 0
  307.     main_ctb
  308.     # エネミー名ウインドウを破棄
  309.     @status_window2.dispose
  310.   end
  311.   #--------------------------------------------------------------------------
  312.   # ● フレーム更新
  313.   #--------------------------------------------------------------------------
  314.   alias ctb_update update
  315.   def update
  316.     # バトルイベント実行中の場合
  317.     if $game_system.battle_interpreter.running?
  318.       # インタプリタを更新
  319.       $game_system.battle_interpreter.update
  320.       # アクションを強制されているバトラーが存在しない場合
  321.       if $game_temp.forcing_battler == nil
  322.         # バトルイベントの実行が終わった場合
  323.         unless $game_system.battle_interpreter.running?
  324.           # 戦闘継続の場合、バトルイベントのセットアップを再実行
  325.           unless judge
  326.             setup_battle_event
  327.           end
  328.         end
  329.         # アフターバトルフェーズでなければ
  330.         if @phase != 5
  331.           # ステータスウィンドウをリフレッシュ
  332.           @status_window.refresh
  333.           # エネミー名リストを更新
  334.           @status_window2.refresh
  335.         end
  336.       end
  337.     else
  338.       if @ct_wait > 0
  339.         @ct_wait -= 1
  340.       else
  341.         update_ct
  342.         @ct_wait = PARA_CTB::CT_SKIP
  343.       end
  344.     end
  345.     ctb_update
  346.   end
  347.   #--------------------------------------------------------------------------
  348.   # ● プレバトルフェーズ開始
  349.   #--------------------------------------------------------------------------
  350.   alias ctb_start_phase1 start_phase1
  351.   def start_phase1
  352.     # CTを初期化
  353.     initialize_ct
  354.     # カウントアップ開始
  355.     @countup = true
  356.     ctb_start_phase1
  357.   end
  358.   #--------------------------------------------------------------------------
  359.   # ● フレーム更新 (プレバトルフェーズ)
  360.   #--------------------------------------------------------------------------
  361.   def update_phase1
  362.     # エネミー名リストを更新
  363.     @status_window2.refresh
  364.     # 勝敗判定
  365.     if judge
  366.       # 勝利または敗北の場合 : メソッド終了
  367.       return
  368.     end
  369.     # パーティーコマンドフェーズを飛ばしてアクターコマンドフェーズ開始
  370.     start_phase3
  371.   end
  372.   #--------------------------------------------------------------------------
  373.   # ● パーティコマンドフェーズ開始
  374.   #--------------------------------------------------------------------------
  375.   def start_phase2
  376.     # フェーズ 2 に移行
  377.     @phase = 2
  378.     # アクターを非選択状態に設定
  379.     @actor_index = -1
  380.     @active_battler = nil
  381.     # パーティコマンドウィンドウを有効化
  382.     @party_command_window.active = true
  383.     @party_command_window.visible = true
  384.     # アクターコマンドウィンドウを無効化
  385.     @actor_command_window.active = false
  386.     @actor_command_window.visible = false
  387.     # メインフェーズフラグをクリア
  388.     $game_temp.battle_main_phase = false
  389.     # コマンド入力不可能な場合
  390.     unless $game_party.inputable?
  391.       # メインフェーズ開始
  392.       start_phase4
  393.     end
  394.   end
  395.   #--------------------------------------------------------------------------
  396.   # ● フレーム更新 (パーティコマンドフェーズ : 逃げる)
  397.   #--------------------------------------------------------------------------
  398.   def update_phase2_escape
  399.     # エネミーの素早さ合計を計算
  400.     enemies_agi = 0
  401.     for enemy in $game_troop.enemies
  402.       if enemy.exist?
  403.         enemies_agi += enemy.agi
  404.       end
  405.     end
  406.     # 行動可能アクターの素早さ合計を計算
  407.     actors_agi = 0
  408.     for actor in @pre_action_battlers
  409.       if actor.is_a?(Game_Actor) and actor.exist?
  410.         actors_agi += actor.agi
  411.       end
  412.     end
  413.     # 逃走成功判定
  414.     if PARA_CTB::ESCAPEABLE < 0
  415.       success = true
  416.     else
  417.       success = rand(100) < PARA_CTB::ESCAPEABLE * 10 * actors_agi / enemies_agi
  418.    end
  419.     # 逃走成功の場合
  420.     if success
  421.       # 逃走 SE を演奏
  422.       $game_system.se_play($data_system.escape_se)
  423.       # バトル開始前の BGM に戻す
  424.       $game_system.bgm_play($game_temp.map_bgm)
  425.       # CTをクリア
  426.       for battler in $game_party.actors
  427.         clear_ct(battler)
  428.       end
  429.       # バトル終了
  430.       battle_end(1)
  431.     # 逃走失敗の場合
  432.     else
  433.       # ヘルプウィンドウに "逃走失敗" をセット
  434.       @help_window.set_text(PARA_CTB::UNESCAPE_MES, 1)
  435.       # アクターのアクションとCTをクリア
  436.       pre_action_battlers = @pre_action_battlers.clone
  437.       for act in pre_action_battlers
  438.         if act.is_a?(Game_Actor)
  439.           declease_ct(act, 100-PARA_CTB::ACT_ESCAPE_CT)
  440.           act.current_action.clear
  441.           @pre_action_battlers.delete(act)
  442.         end
  443.       end
  444.       @party_command_window.visible = false
  445.       # ヘルプウィンドウを表示
  446.       @help_window.visible = true
  447.       @wait_count = 20
  448.       # メインフェーズ開始
  449.       start_phase4
  450.     end
  451.   end
  452.   #--------------------------------------------------------------------------
  453.   # ● アクターコマンドフェーズ開始
  454.   #--------------------------------------------------------------------------
  455.   def start_phase3
  456.     # フェーズ 3 に移行
  457.     @phase = 3
  458.     # アクターを非選択状態に設定
  459.     @actor_index = -1
  460.     @active_battler = nil
  461.     @actor_array_index = -1
  462.     # 次のアクターのコマンド入力へ
  463.     if @pre_action_battlers != []
  464.       phase3_next_actor
  465.     else
  466.       start_phase4
  467.     end
  468.   end
  469.   #--------------------------------------------------------------------------
  470.   # ● 次のアクターのコマンド入力へ
  471.   #--------------------------------------------------------------------------
  472.   def phase3_next_actor
  473.     # ループ
  474.     begin
  475.       # アクターの明滅エフェクト OFF
  476.       if @active_battler != nil
  477.         @active_battler.blink = false
  478.       end
  479.       # 最後のアクターの場合
  480.       if @actor_array_index + 1 >= @pre_action_battlers.size
  481.         # メインフェーズ開始
  482.         start_phase4
  483.         return
  484.       #次がエネミーの場合
  485.       elsif $game_troop.enemies.include?(@pre_action_battlers[@actor_array_index + 1])
  486.         # メインフェーズ開始
  487.         start_phase4
  488.         return
  489.       end
  490.       # アクターのインデックスを進める
  491.       @actor_array_index += 1
  492.       @actor_index = @pre_action_battlers[@actor_array_index].index
  493.       @active_battler = $game_party.actors[@actor_index]
  494.       # バトルイベントが予約されている場合
  495.       if @active_battler.current_action.forcing
  496.         # メインフェーズ開始
  497.         start_phase4
  498.         return
  499.       end
  500.       @active_battler.blink = true
  501.       @active_battler.current_action.clear
  502.     # アクターがコマンド入力を受け付けない状態ならもう一度
  503.     end until @active_battler.inputable?
  504.     # アクターコマンドウィンドウをセットアップ
  505.     phase3_setup_command_window
  506.   end
  507.   #--------------------------------------------------------------------------
  508.   # ● 前のアクターのコマンド入力へ
  509.   #--------------------------------------------------------------------------
  510.   def phase3_prior_actor
  511.     # ループ
  512.     begin
  513.       # アクターの明滅エフェクト OFF
  514.       if @active_battler != nil
  515.         @active_battler.blink = false
  516.       end
  517.       # 最初のアクターの場合
  518.       if @actor_array_index <= 0
  519.         # アクターコマンドフェーズ開始
  520.         start_phase2
  521.         return
  522.       end
  523.       # アクターのインデックスを戻す
  524.       @actor_array_index -= 1
  525.       @actor_index = @pre_action_battlers[@actor_array_index].index
  526.       @active_battler = $game_party.actors[@actor_index]
  527.       @active_battler.blink = true
  528.       @active_battler.current_action.clear
  529.     # アクターがコマンド入力を受け付けない状態ならもう一度
  530.     end until @active_battler.inputable?
  531.     # アクターコマンドウィンドウをセットアップ
  532.     phase3_setup_command_window
  533.   end
  534.   #--------------------------------------------------------------------------
  535.   # ● アクターコマンドウィンドウのセットアップ
  536.   #--------------------------------------------------------------------------
  537.   alias phase3_setup_command_window_ctb phase3_setup_command_window
  538.   def phase3_setup_command_window
  539.     @actor_command_window.back_opacity = PARA_CTB::WINDOW_OPACITY
  540.     phase3_setup_command_window_ctb
  541.     if PARA_CTB::WINDOWPOS_CHANGE
  542.       # アクターコマンドウィンドウの位置を設定
  543.       @actor_command_window.x = PARA_CTB::WINDOWPOS_X
  544.       @actor_command_window.y = PARA_CTB::WINDOWPOS_Y
  545.       # ステータスウインドウに隠れないように
  546.       @actor_command_window.z = 9999
  547.     end
  548.   end
  549.   #--------------------------------------------------------------------------
  550.   # ● フレーム更新 (アクターコマンドフェーズ)
  551.   #--------------------------------------------------------------------------
  552.   def update_phase3
  553.     # エネミーアローが有効の場合
  554.     if @enemy_arrow != nil
  555.       @countup = PARA_CTB::SELECT_WAIT ? false : true
  556.       update_phase3_enemy_select
  557.     # アクターアローが有効の場合
  558.     elsif @actor_arrow != nil
  559.       @countup = PARA_CTB::SELECT_WAIT ? false : true
  560.       update_phase3_actor_select
  561.     # スキルウィンドウが有効の場合
  562.     elsif @skill_window != nil
  563.       @countup = PARA_CTB::SELECT_WAIT ? false : true
  564.       update_phase3_skill_select
  565.     # アイテムウィンドウが有効の場合
  566.     elsif @item_window != nil
  567.       @countup = PARA_CTB::SELECT_WAIT ? false : true
  568.       update_phase3_item_select
  569.     # アクターコマンドウィンドウが有効の場合
  570.     elsif @actor_command_window.active
  571.       @countup = PARA_CTB::COMMAND_WAIT ? false : true
  572.       update_phase3_basic_command
  573.     end
  574.   end
  575.   #--------------------------------------------------------------------------
  576.   # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
  577.   #--------------------------------------------------------------------------
  578.   alias ctb_update_phase3_basic_command update_phase3_basic_command
  579.   def update_phase3_basic_command
  580.     ctb_update_phase3_basic_command
  581.     # LRボタンで行動順を変更
  582.     if Input.trigger?(PARA_CTB::CHANGE_NEXT)
  583.       shift_activer(1)
  584.     end
  585.      if Input.trigger?(PARA_CTB::CHANGE_LAST)
  586.       shift_activer(-1)
  587.     end
  588.   end
  589.   #--------------------------------------------------------------------------
  590.   # ● メインフェーズ開始
  591.   #--------------------------------------------------------------------------
  592.   def start_phase4
  593.     # フェーズ 4 に移行
  594.     @phase = 4
  595.     battler_count = $game_party.actors.size + $game_troop.enemies.size
  596.     if @action_count >= battler_count or $game_temp.battle_turn == 0
  597.       # バトルイベントの全ページを検索
  598.       for index in 0...$data_troops[@troop_id].pages.size
  599.         # イベントページを取得
  600.         page = $data_troops[@troop_id].pages[index]
  601.         # このページのスパンが [ターン] の場合
  602.         if page.span == 1
  603.           # 実行済みフラグをクリア
  604.           $game_temp.battle_event_flags[index] = false
  605.         end
  606.       end
  607.       # ターン数カウント
  608.       $game_temp.battle_turn += 1
  609.       @action_count = 0
  610.     end
  611.     # アクターを非選択状態に設定
  612.     @actor_index = -1
  613.     @active_battler = nil
  614.     # パーティコマンドウィンドウを有効化
  615.     @party_command_window.active = false
  616.     @party_command_window.visible = false
  617.     # アクターコマンドウィンドウを無効化
  618.     @actor_command_window.active = false
  619.     @actor_command_window.visible = false
  620.     # メインフェーズフラグをセット
  621.     $game_temp.battle_main_phase = true
  622.     # エネミーアクション作成
  623.     for enemy in $game_troop.enemies
  624.       unless enemy.current_action.forcing
  625.         enemy.make_action
  626.       end
  627.     end
  628.     # 行動順序作成
  629.     make_action_orders
  630.     # ステップ 1 に移行
  631.     @phase4_step = 1
  632.   end
  633.   #--------------------------------------------------------------------------
  634.   # ● 行動順序作成
  635.   #--------------------------------------------------------------------------
  636.   def make_action_orders
  637.     # 配列 @action_battlers を初期化
  638.     @action_battlers = []
  639.     if @pre_action_battlers != []
  640.       for i in 0..@actor_array_index
  641.         # アクターを配列 @action_battlers に追加
  642.         @action_battlers.push(@pre_action_battlers[0])
  643.         @pre_action_battlers.shift
  644.       end
  645.       if @pre_action_battlers.size != 0
  646.       loop do
  647.         if $game_troop.enemies.include?(@pre_action_battlers[0])
  648.           # エネミーを配列 @action_battlers に追加
  649.           @action_battlers.push(@pre_action_battlers[0])
  650.           @pre_action_battlers.shift
  651.         else
  652.           break
  653.         end
  654.       end
  655.       end
  656.     end
  657.   end
  658.   #--------------------------------------------------------------------------
  659.   # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
  660.   #--------------------------------------------------------------------------
  661.   alias ctb_update_phase4_step1 update_phase4_step1
  662.   def update_phase4_step1
  663.     @countup = true
  664.     # ヘルプウィンドウを隠す
  665.     @help_window.visible = false
  666.     # 勝敗判定
  667.     if judge
  668.       # 勝利または敗北の場合 : メソッド終了
  669.       return
  670.     end
  671.     # 未行動バトラーが存在しない場合 (全員行動した)
  672.     if @action_battlers.size == 0
  673.       # アクターコマンドフェーズ開始
  674.       start_phase3
  675.       return
  676.     end
  677.     ctb_update_phase4_step1
  678.   end
  679.   #--------------------------------------------------------------------------
  680.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  681.   #--------------------------------------------------------------------------
  682.   alias ctb_update_phase4_step2 update_phase4_step2
  683.   def update_phase4_step2
  684.     # 強制アクションでなければ
  685.     unless @active_battler.current_action.forcing
  686.       # 制約が [行動できない] の場合
  687.       if @active_battler.restriction == 4
  688.         # CTをクリア
  689.         clear_ct(@active_battler)
  690.         # アクション強制対象のバトラーをクリア
  691.         $game_temp.forcing_battler = nil
  692.         # ステップ 1 に移行
  693.         @phase4_step = 1
  694.         return
  695.       end
  696.     end
  697.     # アニメーション再生中にCTをカウントするか
  698.     @countup = PARA_CTB::ANIMATION_WAIT ? false : true
  699.     ctb_update_phase4_step2
  700.   end
  701.   #--------------------------------------------------------------------------
  702.   # ● 基本アクション 結果作成
  703.   #--------------------------------------------------------------------------
  704.   alias make_basic_action_result_ctb make_basic_action_result
  705.   def make_basic_action_result
  706.     # 何もしないの場合
  707.     if @active_battler.current_action.basic == 3
  708.       # CTをクリア
  709.       clear_ct(@active_battler)
  710.       # アクション強制対象のバトラーをクリア
  711.       $game_temp.forcing_battler = nil
  712.       # ステップ 1 に移行
  713.       @phase4_step = 1
  714.       return
  715.     end
  716.     make_basic_action_result_ctb
  717.   end
  718.   #--------------------------------------------------------------------------
  719.   # ● スキルアクション 結果作成
  720.   #--------------------------------------------------------------------------
  721.   def make_skill_action_result
  722.     # スキルを取得
  723.     [url=home.php?mod=space&uid=260100]@skill[/url] = $data_skills[@active_battler.current_action.skill_id]
  724.     # 強制アクションでなければ
  725.     unless @active_battler.current_action.forcing
  726.       # SP 切れなどで使用できなくなった場合
  727.       unless @active_battler.skill_can_use?(@skill.id)
  728.         # アクション強制対象のバトラーをクリア
  729.         $game_temp.forcing_battler = nil
  730.         # CTをクリア
  731.         declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT)
  732.         # ステップ 1 に移行
  733.         @phase4_step = 1
  734.         return
  735.       end
  736.     end
  737.     # SP 消費
  738.     @active_battler.sp -= @skill.sp_cost
  739.     # ステータスウィンドウをリフレッシュ
  740.     @status_window.refresh
  741.     # ヘルプウィンドウにスキル名を表示
  742.     @help_window.set_text(@skill.name, 1)
  743.     # アニメーション ID を設定
  744.     @animation1_id = @skill.animation1_id
  745.     @animation2_id = @skill.animation2_id
  746.     # コモンイベント ID を設定
  747.     @common_event_id = @skill.common_event_id
  748.     # 対象側バトラーを設定
  749.     set_target_battlers(@skill.scope)
  750.     # スキルの効果を適用
  751.     for target in @target_battlers
  752.       target.skill_effect(@active_battler, @skill)
  753.     end
  754.   end
  755.   #--------------------------------------------------------------------------
  756.   # ● アイテムアクション 結果作成
  757.   #--------------------------------------------------------------------------
  758.   alias ctb_make_item_action_result make_item_action_result
  759.   def make_item_action_result
  760.     # アイテムを取得
  761.     @item = $data_items[@active_battler.current_action.item_id]
  762.     # アイテム切れなどで使用できなくなった場合
  763.     unless $game_party.item_can_use?(@item.id)
  764.       # CTをクリア
  765.       declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT)
  766.       # ステップ 1 に移行
  767.       @phase4_step = 1
  768.       return
  769.     end
  770.     ctb_make_item_action_result
  771.   end
  772.   #--------------------------------------------------------------------------
  773.   # ● フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
  774.   #--------------------------------------------------------------------------
  775.   alias update_phase4_step5_ctb update_phase4_step5
  776.   def update_phase4_step5
  777.     # ダメージを記録
  778.     for target in @target_battlers
  779.       if target.damage != nil
  780.         target.movable_backup = target.movable?
  781.       end
  782.     end
  783.     update_phase4_step5_ctb
  784.   end
  785.   #--------------------------------------------------------------------------
  786.   # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  787.   #--------------------------------------------------------------------------
  788.   alias update_phase4_step6_ctb update_phase4_step6
  789.   def update_phase4_step6
  790.     @active_battler.countup = true
  791.     if @active_battler.current_action.basic == 1
  792.       # 防御
  793.       declease_ct(@active_battler,100-PARA_CTB::ACT_GUARD_CT)
  794.     else
  795.       case @active_battler.current_action.kind
  796.       # 攻撃
  797.       when 0
  798.         declease_ct(@active_battler,100-PARA_CTB::ACT_ATTACK_CT)
  799.       # スキル
  800.       when 1
  801.         declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT)
  802.       # アイテム
  803.       when 2
  804.         declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT)
  805.       else
  806.         clear_ct(@active_battler)
  807.       end
  808.     end
  809.     # ターゲットが行動不能になったらCTを0に
  810.     for target in @target_battlers
  811.       if target.movable? == false and target.movable_backup == true
  812.         clear_ct(target)
  813.         @status_window.refresh_ct
  814.       end
  815.     end
  816.     update_phase4_step6_ctb
  817.     # エネミー名リストを更新
  818.     @status_window2.refresh
  819.     # アクションをクリア
  820.     if @active_battler.guarding? == false
  821.       @active_battler.current_action.clear
  822.     end
  823.   end
  824.   #--------------------------------------------------------------------------
  825.   # ● アフターバトルフェーズ開始
  826.   #--------------------------------------------------------------------------
  827.   alias ctb_start_phase5 start_phase5
  828.   def start_phase5
  829.     @countup = false
  830.     ctb_start_phase5
  831.   end
  832. end
  833.  
  834. #==============================================================================
  835. # ■ Window_BattleStatus
  836. #==============================================================================
  837.  
  838. class Window_BattleStatus < Window_Base
  839.   #--------------------------------------------------------------------------
  840.   # ● オブジェクト初期化
  841.   #--------------------------------------------------------------------------
  842.   def initialize
  843.     super(160, 320, 480, 160)
  844.     self.contents = Bitmap.new(width - 32, height - 32)
  845.     self.back_opacity = PARA_CTB::WINDOW_MAIN_OPACITY
  846.     @level_up_flags = [false, false, false, false]
  847.     @before_hp = []
  848.     @before_sp = []
  849.     @before_states = []
  850.     @now_hp = []
  851.     @now_sp = []
  852.     @now_states = []
  853.     refresh
  854.   end
  855.   #--------------------------------------------------------------------------
  856.   # ● リフレッシュ
  857.   #--------------------------------------------------------------------------
  858.   def refresh
  859.     @item_max = $game_party.actors.size
  860.     for i in 0...$game_party.actors.size
  861.       actor = $game_party.actors[i]
  862.       line_height = 120 / PARA_CTB::PARTY_SIZE
  863.       actor_y = i * line_height + 4
  864.       # 現在のステータスを配列に
  865.       @now_hp[i] = actor.hp
  866.       @now_sp[i] = actor.sp
  867.       @now_states[i] = actor.states
  868.       # レベルアップ
  869.       if @level_up_flags[i]
  870.         self.contents.fill_rect(344, actor_y+14, 100, 8, Color.new(0, 0, 0, 0))
  871.         self.contents.font.color = normal_color
  872.         self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!")
  873.       end
  874.     end
  875.     # バトルステータスの軽量化処理
  876.     # ステータスの配列が変化したときのみ描画処理
  877.     if @before_hp == nil or @before_sp == nil or @before_states == nil or
  878.     @before_hp != @now_hp or @before_sp != @now_sp or @before_states != @now_states
  879.       self.contents.clear
  880.       for j in 0...$game_party.actors.size
  881.         actor = $game_party.actors[j]
  882.         line_height = 120 / PARA_CTB::PARTY_SIZE
  883.         actor_y = j * line_height + 4
  884.         self.contents.font.size = PARA_CTB::NAME_FONT_SIZE
  885.         # 名前を描画
  886.         draw_actor_name(actor, 4, actor_y+16-PARA_CTB::NAME_FONT_SIZE)
  887.         # HPを描画
  888.         hp_color1 = PARA_CTB::HP_COLOR_LEFT
  889.         hp_color2 = PARA_CTB::HP_COLOR_RIGHT
  890.         draw_meter(actor.hp, actor.maxhp, 125, actor_y+14, 80, 8, hp_color1, hp_color2)
  891.         draw_actor_hp(actor, 102, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100)
  892.         # SPを描画
  893.         sp_color1 = PARA_CTB::SP_COLOR_LEFT
  894.         sp_color2 = PARA_CTB::SP_COLOR_RIGHT
  895.         draw_meter(actor.sp, actor.maxsp, 245, actor_y+14, 80, 8, sp_color1, sp_color2)
  896.         draw_actor_sp(actor, 222, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100)
  897.         # 変化後のステータスを配列に
  898.         @before_hp[j] = actor.hp
  899.         @before_sp[j] = actor.sp
  900.         @before_states[j] = actor.states
  901.         # レベルアップ
  902.         if @level_up_flags[j]
  903.           self.contents.fill_rect(344, actor_y, 100, 8, Color.new(0, 0, 0, 0))
  904.           self.contents.font.color = normal_color
  905.           self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!")
  906.         end
  907.       end
  908.     end
  909.     refresh_ct
  910.   end
  911.   #--------------------------------------------------------------------------
  912.   # ● CTゲージのリフレッシュ
  913.   #--------------------------------------------------------------------------
  914.   def refresh_ct
  915.     for i in 0...$game_party.actors.size
  916.       actor = $game_party.actors[i]
  917.       line_height = 120 / PARA_CTB::PARTY_SIZE
  918.       actor_y = i * line_height + 4
  919.       # CTが満タンになったときのゲージの色
  920.       ct_color_full = PARA_CTB::COLOR_FULL
  921.       # CTゲージの色(左端)
  922.       ct_color_start = actor.full_ct ? ct_color_full : PARA_CTB::COLOR_LEFT
  923.       # CTゲージの色(右端)
  924.       ct_color_end = actor.full_ct ? ct_color_full : PARA_CTB::COLOR_RIGHT
  925.       if @level_up_flags[i] != true and actor.ct_visible
  926.         draw_meter(actor.now_ct, actor.max_ct, 344, actor_y+14, 100, 8, ct_color_start, ct_color_end)
  927.       elsif @level_up_flags[i] != true
  928.         draw_meter(0, actor.max_ct, 344, actor_y+14, 100, 8, ct_color_start, ct_color_end)
  929.       end
  930.     end
  931.   end
  932.   #--------------------------------------------------------------------------
  933.   # ● フレーム更新
  934.   #--------------------------------------------------------------------------
  935.   def update
  936.     super
  937.   end
  938.   #--------------------------------------------------------------------------
  939.   # ● HP の描画
  940.   #     actor : アクター
  941.   #     x     : 描画先 X 座標
  942.   #     y     : 描画先 Y 座標
  943.   #     width : 描画先の幅
  944.   #--------------------------------------------------------------------------
  945.   def draw_actor_hp(actor, x, y, width = 144)
  946.     # 文字列 "HP" を描画
  947.     self.contents.font.color = system_color
  948.     self.contents.font.size = 16
  949.     self.contents.draw_text(x, y+2, 32, 32, $data_system.words.hp)
  950.     self.contents.font.color = normal_color
  951.     self.contents.font.size = PARA_CTB::HPSP_FONT_SIZE
  952.     if PARA_CTB::MAX_DRAW
  953.       # MaxHP を描画
  954.       self.contents.draw_text(x, y, width, 32, actor.maxhp.to_s, 2)
  955.       text_size = self.contents.text_size(actor.maxhp.to_s)
  956.       text_x = x + width - text_size.width - 12
  957.       self.contents.draw_text(text_x, y, 12, 32, "/", 1)
  958.       # HP を描画
  959.       self.contents.font.color = actor.hp == 0 ? knockout_color :
  960.         actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  961.       text_x = text_x - text_size.width
  962.       self.contents.draw_text(text_x, y, text_size.width, 32, actor.hp.to_s, 2)
  963.     else
  964.       self.contents.font.color = actor.hp == 0 ? knockout_color :
  965.         actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  966.       self.contents.draw_text(x, y, width, 32, actor.hp.to_s, 2)
  967.     end
  968.   end
  969.   #--------------------------------------------------------------------------
  970.   # ● SP の描画
  971.   #     actor : アクター
  972.   #     x     : 描画先 X 座標
  973.   #     y     : 描画先 Y 座標
  974.   #     width : 描画先の幅
  975.   #--------------------------------------------------------------------------
  976.   def draw_actor_sp(actor, x, y, width = 144)
  977.     # 文字列 "SP" を描画
  978.     self.contents.font.color = system_color
  979.     self.contents.font.size = 16
  980.     self.contents.draw_text(x, y+2, 32, 32, $data_system.words.sp)
  981.     self.contents.font.color = normal_color
  982.     self.contents.font.size = PARA_CTB::HPSP_FONT_SIZE
  983.     if PARA_CTB::MAX_DRAW
  984.     # MaxSP を描画
  985.       self.contents.draw_text(x, y, width, 32, actor.maxsp.to_s, 2)
  986.       text_size = self.contents.text_size(actor.maxsp.to_s)
  987.       text_x = x + width - text_size.width - 12
  988.       self.contents.draw_text(text_x, y, 12, 32, "/", 1)
  989.       # SP を描画
  990.       self.contents.font.color = actor.sp == 0 ? knockout_color :
  991.         actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  992.       text_x = text_x - text_size.width
  993.       self.contents.draw_text(text_x, y, text_size.width, 32, actor.sp.to_s, 2)
  994.     else
  995.       self.contents.font.color = actor.sp == 0 ? knockout_color :
  996.         actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  997.       self.contents.draw_text(x, y, width, 32, actor.sp.to_s, 2)
  998.     end
  999.   end
  1000. end
  1001.  
  1002. #==============================================================================
  1003. # □ 敵の名前を表示するウインドウ
  1004. #==============================================================================
  1005.  
  1006. class Window_BattleStatus_enemy < Window_Base
  1007.   #--------------------------------------------------------------------------
  1008.   # ○ オブジェクト初期化
  1009.   #--------------------------------------------------------------------------
  1010.   def initialize
  1011.     super(0, 320, 160, 160)
  1012.     self.contents = Bitmap.new(width - 32, height - 32)
  1013.     self.back_opacity = PARA_CTB::WINDOW_MAIN_OPACITY
  1014.     refresh
  1015.   end
  1016.   #--------------------------------------------------------------------------
  1017.   # ○ リフレッシュ
  1018.   #--------------------------------------------------------------------------
  1019.   def refresh
  1020.     self.contents.clear
  1021.     self.contents.font.color = normal_color
  1022.     self.contents.font.size = PARA_CTB::ENEMY_FONT_SIZE
  1023.     @exist_enemies = []
  1024.     if $game_troop.enemies != nil
  1025.       if PARA_CTB::ENEMY_GROUPING
  1026.         ememy_list = []
  1027.         ememy_list_index = []
  1028.         # エネミーをグループ化
  1029.         for i in 0...$game_troop.enemies.size
  1030.           enemy = $game_troop.enemies[i]
  1031.           if enemy.exist?
  1032.             if ememy_list.include?(enemy.name)
  1033.               ememy_list_index[ememy_list.index(enemy.name)] += 1
  1034.             else
  1035.               # エネミー名を記録
  1036.               ememy_list.push(enemy.name)
  1037.               ememy_list_index[ememy_list.index(enemy.name)] = 1
  1038.             end
  1039.           end
  1040.         end
  1041.         # エネミーの名前と数を描画
  1042.         enemy_index = 0
  1043.         for enemy_name in ememy_list
  1044.           enemy_y = enemy_index * (PARA_CTB::ENEMY_FONT_SIZE+6) + 4
  1045.           if ememy_list_index[enemy_index] > 1
  1046.             enemy_name = enemy_name + " " + ememy_list_index[enemy_index].to_s
  1047.           end
  1048.           self.contents.draw_text(4, enemy_y, 160, 20, enemy_name)
  1049.           enemy_index += 1
  1050.         end
  1051.       else
  1052.         # エネミーの名前を描画
  1053.         enemy_index = 0
  1054.         for i in 0...$game_troop.enemies.size
  1055.           enemy = $game_troop.enemies[i]
  1056.           if enemy.exist?
  1057.             @exist_enemies.push(enemy)
  1058.             line_height = PARA_CTB::ENEMY_FONT_SIZE + 6
  1059.             if PARA_CTB::ENEMY_DRAWING_MATER != 0
  1060.               line_height += 10
  1061.             end
  1062.             enemy_y = enemy_index * line_height + 4
  1063.             self.contents.draw_text(4, enemy_y, 160, 20, enemy.name)
  1064.             enemy_index += 1
  1065.             if PARA_CTB::ENEMY_DRAWING_MATER == 1
  1066.               hp_color1 = PARA_CTB::HP_COLOR_LEFT
  1067.               hp_color2 = PARA_CTB::HP_COLOR_RIGHT
  1068.               y = enemy_y + PARA_CTB::ENEMY_FONT_SIZE + 3
  1069.               draw_meter(enemy.hp, enemy.maxhp, 4, y, 80, 8, hp_color1, hp_color2)
  1070.             end
  1071.           end
  1072.         end
  1073.       end
  1074.     end
  1075.     refresh_ct
  1076.   end
  1077.   #--------------------------------------------------------------------------
  1078.   # ○ CTゲージのリフレッシュ
  1079.   #--------------------------------------------------------------------------
  1080.   def refresh_ct
  1081.     if PARA_CTB::ENEMY_DRAWING_MATER == 2 and @exist_enemies != nil
  1082.       enemy_index = 0
  1083.       for enemy in @exist_enemies
  1084.         line_height = PARA_CTB::ENEMY_FONT_SIZE + 16
  1085.         enemy_y = enemy_index * line_height + 4
  1086.         y = enemy_y + PARA_CTB::ENEMY_FONT_SIZE + 3
  1087.         # CTが満タンになったときのゲージの色
  1088.         ct_color_full = PARA_CTB::COLOR_FULL
  1089.         # CTゲージの色(左端)
  1090.         ct_color_start = enemy.full_ct ? ct_color_full : PARA_CTB::COLOR_LEFT
  1091.         # CTゲージの色(右端)
  1092.         ct_color_end = enemy.full_ct ? ct_color_full : PARA_CTB::COLOR_RIGHT
  1093.         if enemy.ct_visible
  1094.           draw_meter(enemy.now_ct, enemy.max_ct, 4, y, 100, 8, ct_color_start, ct_color_end)
  1095.         else
  1096.           draw_meter(0, enemy.max_ct, 4, y, 100, 8, ct_color_start, ct_color_end)
  1097.         end
  1098.         enemy_index += 1
  1099.       end
  1100.     end
  1101.   end
  1102. end
  1103.  
  1104. #==============================================================================
  1105. # ■ Window_Base
  1106. #==============================================================================
  1107.  
  1108. class Window_Base < Window
  1109.  
  1110.   #--------------------------------------------------------------------------
  1111.   # ○ ゲージを描画
  1112.   #--------------------------------------------------------------------------
  1113.   def draw_meter(now, max, x, y, width, height, start_color, end_color=start_color )
  1114.     self.contents.fill_rect(x, y, width, height, PARA_CTB::FRAME_COLOR)
  1115.     self.contents.fill_rect(x+PARA_CTB::FRAME_BORDER, y+PARA_CTB::FRAME_BORDER, width-
  1116.  
  1117. PARA_CTB::FRAME_BORDER*2, height-PARA_CTB::FRAME_BORDER*2, PARA_CTB::BACK_COLOR)
  1118.     now = now > max ? max : now
  1119.     percentage = max != 0 ? (width-2) * now / max.to_f : 0
  1120.     if start_color == end_color
  1121.       self.contents.fill_rect(x+1, y+1, percentage, height-2, start_color)
  1122.     else
  1123.       for i in 1..percentage
  1124.         r = start_color.red + (end_color.red - start_color.red) / percentage * i
  1125.         g = start_color.green + (end_color.green - start_color.green) / percentage * i
  1126.         b = start_color.blue + (end_color.blue - start_color.blue) / percentage * i
  1127.         a = start_color.alpha + (end_color.alpha - start_color.alpha) / percentage * i
  1128.         self.contents.fill_rect(x+i, y+1, 1, height-2, Color.new(r, g, b, a))
  1129.       end
  1130.     end
  1131.   end
  1132. end
  1133.  
  1134. #==============================================================================
  1135. # ■ Game_Battler
  1136. #==============================================================================
  1137.  
  1138. class Game_Battler
  1139.   #--------------------------------------------------------------------------
  1140.   # ● 公開インスタンス変数
  1141.   #--------------------------------------------------------------------------
  1142.   attr_accessor :max_ct
  1143.   attr_accessor :now_ct
  1144.   attr_accessor :full_ct
  1145.   attr_accessor :countup
  1146.   attr_accessor :ct_visible
  1147.   attr_accessor :movable_backup
  1148.   #--------------------------------------------------------------------------
  1149.   # ● オブジェクト初期化
  1150.   #--------------------------------------------------------------------------
  1151.   alias ctb_initialize initialize
  1152.   def initialize
  1153.     ctb_initialize
  1154.     @max_ct = 0
  1155.     @now_ct = 0
  1156.     @full_ct = false
  1157.     @countup = true
  1158.     @ct_visible = true
  1159.   end
  1160. end
  1161.  
  1162. #==============================================================================
  1163. # ■ Sprite_Battler
  1164. #==============================================================================
  1165.  
  1166. class Sprite_Battler < RPG::Sprite
  1167.   #--------------------------------------------------------------------------
  1168.   # ● フレーム更新
  1169.   #--------------------------------------------------------------------------
  1170.   alias ctb_update update
  1171.   def update
  1172.     ctb_update
  1173.     if @battler != nil
  1174.       if @battler.full_ct and @battler.ct_visible
  1175.         # CTが溜まったバトラーの色調を変化させる
  1176.         fullct_color = PARA_CTB::FULL_CT_COLOR
  1177.         self.tone = fullct_color
  1178.       else
  1179.         fullct_color = Tone.new(0,0,0)
  1180.         self.tone = fullct_color
  1181.       end
  1182.     end
  1183.   end
  1184. end
  1185.  
  1186. #==============================================================================
  1187. # ■ Window_Help
  1188. #==============================================================================
  1189.  
  1190. class Window_Help < Window_Base
  1191.   #--------------------------------------------------------------------------
  1192.   # ● アクター設定
  1193.   #     actor : ステータスを表示するアクター
  1194.   #--------------------------------------------------------------------------
  1195.   alias set_actor_ctb set_actor
  1196.   def set_actor(actor)
  1197.     if PARA_CTB::HELP_DRAWING_MATER_ACTOR
  1198.       self.contents.clear
  1199.       draw_actor_name(actor, 4, 0)
  1200.       draw_actor_state(actor, 140, 0)
  1201.       hp_color1 = PARA_CTB::HP_COLOR_LEFT
  1202.       hp_color2 = PARA_CTB::HP_COLOR_RIGHT
  1203.       draw_meter(actor.hp, actor.maxhp, 316, 18, 112, 8, hp_color1, hp_color2)
  1204.       draw_actor_hp(actor, 284, 0)
  1205.       sp_color1 = PARA_CTB::SP_COLOR_LEFT
  1206.       sp_color2 = PARA_CTB::SP_COLOR_RIGHT
  1207.       draw_meter(actor.sp, actor.maxsp, 492, 18, 112, 8, sp_color1, sp_color2)
  1208.       draw_actor_sp(actor, 460, 0)
  1209.       @actor = actor
  1210.       @text = nil
  1211.       self.visible = true
  1212.     else
  1213.       set_actor_ctb(actor)
  1214.     end
  1215.   end
  1216.   #--------------------------------------------------------------------------
  1217.   # ● エネミー設定
  1218.   #     enemy : 名前とステートを表示するエネミー
  1219.   #--------------------------------------------------------------------------
  1220.   alias set_enemy_ctb set_enemy
  1221.   def set_enemy(enemy)
  1222.     if PARA_CTB::HELP_DRAWING_MATER_ENEMY
  1223.       self.contents.clear
  1224.       draw_actor_name(enemy, 4, 0)
  1225.       draw_actor_state(enemy, 140, 0)
  1226.       hp_color1 = PARA_CTB::HP_COLOR_LEFT
  1227.       hp_color2 = PARA_CTB::HP_COLOR_RIGHT
  1228.       draw_meter(enemy.hp, enemy.maxhp, 316, 18, 112, 8, hp_color1, hp_color2)
  1229.       draw_actor_hp(enemy, 284, 0)
  1230.       sp_color1 = PARA_CTB::SP_COLOR_LEFT
  1231.       sp_color2 = PARA_CTB::SP_COLOR_RIGHT
  1232.       draw_meter(enemy.sp, enemy.maxsp, 492, 18, 112, 8, sp_color1, sp_color2)
  1233.       draw_actor_sp(enemy, 460, 0)
  1234.       self.visible = true
  1235.     else
  1236.       set_enemy_ctb(enemy)
  1237.     end
  1238.   end
  1239. end

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

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

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

使用道具 举报

Lv2.观梦者

梦石
0
星屑
701
在线时间
127 小时
注册时间
2013-2-16
帖子
428
 楼主| 发表于 2013-4-30 19:55:14 | 显示全部楼层
9、基于自定义窗口                                                                 
[摘要]改变字体和文本颜色的窗口,平铺背景。
我还可以更改消息窗口的透明度。
[脚本]
RUBY 代码复制
  1. #==============================================================================
  2. # ++ ウインドウベースカスタマイズ ver. 1.10 ++
  3. #  Script by パラ犬
  4. #  [url]http://2d6.parasite.jp/[/url]
  5. #------------------------------------------------------------------------------
  6. # ウインドウの文字色や背景のタイリングを変更します。
  7. #------------------------------------------------------------------------------
  8. #[設置上の注意]
  9. # できるだけリストの上のほうに置いてください。(Scene_Debugよりは下)
  10. #==============================================================================
  11.  
  12. module PARA_WINDOW_CUSTOM
  13.  
  14.   # ウインドウ背景を並べて表示( true / false )
  15.   SKIN_TILING = false
  16.  
  17.   # メッセージウインドウの不透明度
  18.   BACK_OPACITY = 160
  19.  
  20.   # 通常文字色
  21.   COLOR_NORMAL = Color.new(255, 255, 255, 255)
  22.   # 無効文字色
  23.   COLOR_DISABLED = Color.new(255, 255, 255, 128)
  24.   # システム文字色
  25.   COLOR_SYSTEM = Color.new(192, 224, 255, 255)
  26.   # ピンチ文字色
  27.   COLOR_CRISIS = Color.new(255, 255, 64, 255)
  28.   # 戦闘不能文字色
  29.   COLOR_KNOCKOUT = Color.new(255, 64, 0, 255)
  30.  
  31.   # 制御文字「\C[n]」で表示する色
  32.   # (書式は「COLOR_SET[n] = Color.new(赤, 緑, 青, 不透明度)。nは0~7)
  33.   COLOR_SET=[] #この行は消さないでください
  34.   COLOR_SET[0] = Color.new(255, 255, 255, 255)
  35.   COLOR_SET[1] = Color.new(128, 128, 255, 255)
  36.   COLOR_SET[2] = Color.new(255, 128, 128, 255)
  37.   COLOR_SET[3] = Color.new(128, 255, 128, 255)
  38.   COLOR_SET[4] = Color.new(128, 255, 255, 255)
  39.   COLOR_SET[5] = Color.new(255, 128, 255, 255)
  40.   COLOR_SET[6] = Color.new(255, 255, 128, 255)
  41.   COLOR_SET[7] = Color.new(192, 192, 192, 255)
  42.  
  43.   #フォント名(複数候補の場合は「,」で区切る。例:["HGP行書体", "MS Pゴシック"])
  44.   FONT_NAME = ["MS Pゴシック"]
  45.  
  46.   FONT_SIZE = 22        # デフォルトのフォントサイズ
  47.   FONT_BOLD = false     # 太字にするか(true/false)
  48.   FONT_ITALIC = false   # 斜体にするか(true/false)
  49.  
  50. end
  51.  
  52. # ↑ 設定項目ここまで
  53. #------------------------------------------------------------------------------
  54.  
  55. #==============================================================================
  56. # ■ Window_Base
  57. #==============================================================================
  58.  
  59. class Window_Base < Window
  60.  
  61.   Font.default_color = PARA_WINDOW_CUSTOM::COLOR_NORMAL
  62.   Font.default_name = PARA_WINDOW_CUSTOM::FONT_NAME + ["MS Pゴシック"]
  63.   Font.default_size = PARA_WINDOW_CUSTOM::FONT_SIZE
  64.   Font.default_bold = PARA_WINDOW_CUSTOM::FONT_BOLD
  65.   Font.default_italic = PARA_WINDOW_CUSTOM::FONT_ITALIC
  66.  
  67.   #--------------------------------------------------------------------------
  68.   # ● オブジェクト初期化
  69.   #--------------------------------------------------------------------------
  70.   alias initialize_para_window_custom initialize
  71.   def initialize(x, y, width, height)
  72.     initialize_para_window_custom(x, y, width, height)
  73.     self.stretch = !(PARA_WINDOW_CUSTOM::SKIN_TILING)
  74.   end
  75.   #--------------------------------------------------------------------------
  76.   # ● 文字色取得
  77.   #--------------------------------------------------------------------------
  78.   def text_color(n)
  79.     return PARA_WINDOW_CUSTOM::COLOR_SET[n]
  80.   end
  81.   #--------------------------------------------------------------------------
  82.   # ● 通常文字色の取得
  83.   #--------------------------------------------------------------------------
  84.   def normal_color
  85.     return PARA_WINDOW_CUSTOM::COLOR_NORMAL
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   # ● 無効文字色の取得
  89.   #--------------------------------------------------------------------------
  90.   def disabled_color
  91.     return PARA_WINDOW_CUSTOM::COLOR_DISABLED
  92.   end
  93.   #--------------------------------------------------------------------------
  94.   # ● システム文字色の取得
  95.   #--------------------------------------------------------------------------
  96.   def system_color
  97.     return PARA_WINDOW_CUSTOM::COLOR_SYSTEM
  98.   end
  99.   #--------------------------------------------------------------------------
  100.   # ● ピンチ文字色の取得
  101.   #--------------------------------------------------------------------------
  102.   def crisis_color
  103.     return PARA_WINDOW_CUSTOM::COLOR_CRISIS
  104.   end
  105.   #--------------------------------------------------------------------------
  106.   # ● 戦闘不能文字色の取得
  107.   #--------------------------------------------------------------------------
  108.   def knockout_color
  109.     return PARA_WINDOW_CUSTOM::COLOR_KNOCKOUT
  110.   end
  111. end
  112.  
  113. #==============================================================================
  114. # ■ Window_Message
  115. #==============================================================================
  116.  
  117. class Window_Message < Window_Selectable
  118.   #--------------------------------------------------------------------------
  119.   # ● ウィンドウの位置と不透明度の設定
  120.   #--------------------------------------------------------------------------
  121.   alias reset_window_para_window_custom reset_window
  122.   def reset_window
  123.     reset_window_para_window_custom
  124.     self.back_opacity = PARA_WINDOW_CUSTOM::BACK_OPACITY
  125.   end
  126. end

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

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

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-29 15:40

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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