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

Project1

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

[已经解决] 轮盘脚本

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
80 小时
注册时间
2009-10-11
帖子
22
跳转到指定楼层
1
发表于 2014-8-2 12:49:04 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 笑傲天 于 2014-8-2 12:58 编辑

这个脚本用了没效果,需要其他脚本配合?
  1. # ★ バトルレイアウト変更 (ヘルプウィンドウ通常版、少しだけ互換性が高い)
  2. #   バトルのレイアウトを変更します
  3. #   素材『ステートアイコンのアニメーション表示』の使用をお奨めします
  4. #     ▲ 入れるフォルダは Graphics/System へ

  5. #==============================================================================
  6. # ■ Ziifee
  7. #==============================================================================

  8. module Zii
  9.   # ▼ アイコンのナンバーです (縦 × 16 + 横 - 1)
  10.   FIGHT = 132                               # 戦斗
  11.   ESCAPE = 143                              # 逃跑
  12.   ATTACK = 116                                # 攻撃 (基本)
  13.   GUARD = 139                                # 防御
  14.   SKILL = 115                               # 战技
  15.   SKILL2 = 14                              # 体术
  16.   SKILL3 = 119                              # 魔法
  17.   SKILL4 = 143                              # 源术
  18.   ITEM = 260                                # アイテム
  19.   ESCAPE = 121
  20.   
  21.   # ▼ 回転方向 ( "正" か "逆" を入れる )
  22.   TURN = "正"
  23.   
  24.   # ▼ 顔グラフィック (使う場合 "使用" / 使わない場合は "")
  25.   STATUS_FACE = "使用"
  26.   
  27.   # ▼ 表示の設定 ( "名前" を "" にすると 名前を非表示)
  28.   STATUS_LINE = "名前"
  29.   
  30.   # ▼ △の大きさ ( VX 標準サイズ は 20)
  31.   LINE_SIZE = 14
  32.   
  33.   #--------------------------------------------------------------------------
  34.   # ● 通常回転 の判定
  35.   #--------------------------------------------------------------------------
  36.   def self.turn_normal?
  37.     return false if TURN == "逆"
  38.     return true  if TURN == "正"
  39.     return true
  40.   end
  41.   #--------------------------------------------------------------------------
  42.   # ● バトルオプション [顔グラフィック] の判定
  43.   #--------------------------------------------------------------------------
  44.   def self.battle_face?
  45.     return true if STATUS_FACE == "使用"
  46.     return false
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # ● バトルステートオプション [名前] の判定
  50.   #--------------------------------------------------------------------------
  51.   def self.line_name?
  52.     return true if STATUS_LINE == "名前"
  53.     return false
  54.   end
  55. end

  56. #==============================================================================
  57. # ■ Window_SpinCommand
  58. #------------------------------------------------------------------------------
  59. #  回転用コマンド選択を行うウィンドウです。
  60. #==============================================================================

  61. class Window_SpinCommand < Window_Command
  62.   #--------------------------------------------------------------------------
  63.   # ● 公開インスタンス変数
  64.   #--------------------------------------------------------------------------
  65.   attr_reader   :index                    # カーソル位置
  66.   attr_reader   :help_window              # ヘルプウィンドウ
  67.   #--------------------------------------------------------------------------
  68.   # ● オブジェクト初期化
  69.   #     cx / cy  : 中心の X座標 / Y座標
  70.   #     commands : コマンド配列 (内容 は [name, kind, pull, enabled?])
  71.   #     setting  : 設定ハッシュ ("R"=>半径 "S"=>速さ "G"=>背景 "L"=>文字)
  72.   #--------------------------------------------------------------------------
  73.   def initialize(cx, cy, commands, setting = {})
  74.     @radius    = 40#setting.has_key?("R") ? setting["R"] : 40  # 描画半径
  75.     @speed     = setting.has_key?("S") ? setting["S"] : 36  # 回転速さ
  76.     @spin_back = setting.has_key?("G") ? setting["G"] : ""  # 背景画像
  77.     @spin_line = setting.has_key?("L") ? setting["L"] : nil # 文字位置
  78.     x = cx - @radius - 28
  79.     y = cy - @radius - 28
  80.     width = height = @radius * 2 + 56 + 120
  81. #    super(x, y, width, height)
  82.     super(x, y)
  83.     self.opacity = 0
  84.     @index = 0
  85.     @commands = commands                                    # コマンド
  86.     @spin_right = true
  87.     @spin_count = 0
  88.     update_cursor
  89.   end
  90.   
  91.   def window_height
  92.     fitting_height(visible_line_number) + 120
  93.   end
  94.   def window_width
  95.     return 196
  96.   end
  97.   #--------------------------------------------------------------------------
  98.   # ▽ スピン画像を描画する (描画内容 強化用)
  99.   #     i  : インデックス
  100.   #     cx : 表示 中心位置 X座標
  101.   #     cy : 表示 中心位置 Y座標
  102.   #--------------------------------------------------------------------------
  103.   def draw_spin_graphic(i, cx, cy)
  104.     case command_kind(i)
  105.     when "icon"
  106.       draw_icon(command_pull(i), cx - 17, cy - 52, command_enabled?(i))
  107.     end
  108.   end
  109.   #--------------------------------------------------------------------------
  110.   # ★ リフレッシュ バグ回避用
  111.   #--------------------------------------------------------------------------
  112.   def refresh
  113.     set_spin
  114.   end
  115.   def refresh2(cx, cy, commands, setting = {})
  116.     @radius    = 44#setting.has_key?("R") ? setting["R"] : 40  # 描画半径
  117.     @speed     = setting.has_key?("S") ? setting["S"] : 36  # 回転速さ
  118.     @spin_back = setting.has_key?("G") ? setting["G"] : ""  # 背景画像
  119.     @spin_line = setting.has_key?("L") ? setting["L"] : nil # 文字位置
  120.     x = cx - @radius - 12
  121.     y = cy - @radius - 28
  122.     width = height = @radius * 2 + 56
  123.     #super(x, y)
  124.     self.opacity = 0
  125.     @index = 0
  126.     @commands = commands                                    # コマンド
  127.     @spin_right = true
  128.     @spin_count = 0
  129.     update_cursor
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # ★ 項目の描画 バグ回避用
  133.   #--------------------------------------------------------------------------
  134.   def draw_item(index, enabled = true)
  135.     @commands[index][3] = enabled
  136.     set_spin
  137.   end
  138.   #--------------------------------------------------------------------------
  139.   # ● 現在のコマンド名を取得する
  140.   #--------------------------------------------------------------------------
  141.   def command_name(index = @index)
  142.     return "" if index < 0
  143.     if @commands != nil
  144.     name = @commands[index][0]
  145.     end
  146.     return name != nil ? name : ""
  147.   end
  148.   #--------------------------------------------------------------------------
  149.   # ● コマンドの種類を取得
  150.   #--------------------------------------------------------------------------
  151.   def command_kind(index)
  152.     if @commands != nil
  153.     result = @commands[index][1]
  154.     end
  155.     return result != nil ? result : ""
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # ● コマンドの引数 を取得
  159.   #--------------------------------------------------------------------------
  160.   def command_pull(index)
  161.     if @commands != nil
  162.     result = @commands[index][2]
  163.     end
  164.     return result != nil ? result : ""
  165.   end
  166.   #--------------------------------------------------------------------------
  167.   # ● コマンドの有効フラグを取得
  168.   #--------------------------------------------------------------------------
  169.   def command_enabled?(index)
  170.     if @commands != nil
  171.     result = @commands[index][3]
  172.     end
  173.     return result != nil ? result : true
  174.   end
  175.   #--------------------------------------------------------------------------
  176.   # ● 名前の位置に index を設定する
  177.   #--------------------------------------------------------------------------
  178.   def set_index(name)
  179.     n = -1
  180.     for i in [email protected]
  181.       n = i if @commands[i][0] == name
  182.     end
  183.     @index = n if n >= 0
  184.     update_cursor
  185.     call_update_help
  186.     set_spin
  187.   end
  188.   #--------------------------------------------------------------------------
  189.   # ● カーソル位置の設定
  190.   #     index : 新しいカーソル位置
  191.   #--------------------------------------------------------------------------
  192.   def index=(index)
  193.     @index = index
  194.     update_cursor
  195.     call_update_help
  196.     set_spin
  197.   end
  198.   #--------------------------------------------------------------------------
  199.   # ● 中心のX座標を取得
  200.   #--------------------------------------------------------------------------
  201.   def center_x
  202.     return contents.width / 2
  203.   end
  204.   #--------------------------------------------------------------------------
  205.   # ● 中心のY座標を取得
  206.   #--------------------------------------------------------------------------
  207.   def center_y
  208.     return contents.height / 2
  209.   end
  210.   #--------------------------------------------------------------------------
  211.   # ● 項目数の取得
  212.   #--------------------------------------------------------------------------
  213.   def item_max
  214.     if @commands != nil
  215.     return @commands.size
  216.   else
  217.     return 1
  218.     end
  219.   end
  220.   #--------------------------------------------------------------------------
  221.   # ● 背景の設定 (再定義 向き)
  222.   #--------------------------------------------------------------------------
  223.   def set_background
  224.     return if @spin_back == ""
  225.     bitmap = Cache.system(@spin_back)
  226.     rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  227.     self.contents.blt(12 + 16 - 25, 12 + 8 -16, bitmap, rect)
  228.   end
  229.   #--------------------------------------------------------------------------
  230.   # ● 文章の設定 (再定義 向き)
  231.   #--------------------------------------------------------------------------
  232.   def set_text
  233.     return if @spin_line == nil
  234.     y = center_y - WLH / 2 + @spin_line
  235.     self.contents.draw_text(center_x - 56, y - 26 , 96, WLH, command_name, 1)
  236.   end
  237.   #--------------------------------------------------------------------------
  238.   # ● スピンアイコンの角度の差を取得する
  239.   #--------------------------------------------------------------------------
  240.   def angle_size
  241.     return (Math::PI * 2 / item_max) ###SR
  242.   end
  243.   #--------------------------------------------------------------------------
  244.   # ● スピンアイコン回転時のカウント を設定する
  245.   #--------------------------------------------------------------------------
  246.   def set_spin_count
  247.     @spin_count = angle_size * 360 / @speed
  248.     set_spin(true)
  249.   end
  250.   #--------------------------------------------------------------------------
  251.   # ● スピン設定 の実行
  252.   #     spin : 回転フラグ (true の時回転中)
  253.   #--------------------------------------------------------------------------
  254.   def set_spin(spin = false)
  255.     self.contents.clear
  256.     set_background
  257.     angle = spin ? @speed * @spin_count / 360 : 0
  258.     angle = @spin_right ? angle : -angle
  259.     for i in 0...item_max
  260.       n = (i - @index) * angle_size + angle ###SR OFFSET
  261.       cx = - @radius * Math.cos(n-44.67) + center_x#@radius * Math.sin(n) + center_x
  262.       cy = - @radius * Math.sin(n-44.67) + center_y#- @radius * Math.cos(n) + center_y
  263.       draw_spin_graphic(i, cx, cy)
  264.     end
  265.     set_text
  266.   end
  267.   #--------------------------------------------------------------------------
  268.   # ● フレーム更新
  269.   #--------------------------------------------------------------------------
  270.   def update
  271.     super
  272.     update_cursor
  273.     if @spin_count > 0
  274.       @spin_count -= 1
  275.       set_spin(@spin_count >= 1)
  276.       return
  277.     end
  278.     update_command
  279.   end
  280.   #--------------------------------------------------------------------------
  281.   # ● コマンドの移動可能判定
  282.   #--------------------------------------------------------------------------
  283.   def command_movable?
  284.     return false if @spin_count > 0
  285.     return false if (not visible or not active)
  286.     return false if (index < 0 or index > item_max or item_max == 0)
  287.     return false if (@opening or @closing)
  288.     return true
  289.   end
  290.   #--------------------------------------------------------------------------
  291.   # ● コマンドを右に移動
  292.   #--------------------------------------------------------------------------
  293.   def command_right
  294.     @index = (@index ) % item_max#(@index + 1) % item_max
  295.     @spin_right = true
  296.     set_spin_count
  297.   end
  298.   #--------------------------------------------------------------------------
  299.   # ● コマンドを左に移動
  300.   #--------------------------------------------------------------------------
  301.   def command_left
  302.     @index = (@index + item_max) % item_max#(@index - 1 + item_max) % item_max
  303.     @spin_right = false
  304.     set_spin_count
  305.   end
  306.   #--------------------------------------------------------------------------
  307.   # ● コマンド選択の更新
  308.   #--------------------------------------------------------------------------
  309.   def update_command
  310.     if command_movable?
  311.       if Input.press?(Input::UP)
  312.         Sound.play_cursor
  313.         Zii.turn_normal? ? command_left : command_right
  314.       end
  315.       if Input.press?(Input::DOWN)
  316.         Sound.play_cursor
  317.         Zii.turn_normal? ? command_right : command_left
  318.       end
  319.       # SR 1.04: 左右键切换菜单
  320.       if Input.press?(Input::LEFT)
  321.         @index -= 1
  322.         @index = 5 if @index == - 1
  323.         Sound.play_cursor
  324.         Zii.turn_normal? ? command_left : command_right
  325.       end
  326.       if Input.press?(Input::RIGHT)
  327.         @index += 1
  328.         @index = 0 if @index == 6
  329.         Sound.play_cursor
  330.         Zii.turn_normal? ? command_right : command_left
  331.       end
  332.       ###################
  333.     end
  334.     call_update_help
  335.   end
  336.   #--------------------------------------------------------------------------
  337.   # ● カーソルの更新
  338.   #--------------------------------------------------------------------------
  339.   def update_cursor
  340.     #if @index < 0
  341.     #  self.cursor_rect.empty
  342.     #else
  343.     #  rect = Rect.new(0, 0, 24, 24)
  344.     #  rect.x = center_x - rect.width / 2
  345.     #  rect.y = center_y - rect.height / 2 - @radius
  346.     #  self.cursor_rect = rect
  347.     #end
  348.   end
  349.   #--------------------------------------------------------------------------
  350.   # ● ヘルプウィンドウの設定
  351.   #     help_window : 新しいヘルプウィンドウ
  352.   #--------------------------------------------------------------------------
  353.   def help_window=(help_window)
  354.     @help_window = help_window
  355.     call_update_help
  356.   end
  357.   #--------------------------------------------------------------------------
  358.   # ● ヘルプウィンドウ更新メソッドの呼び出し
  359.   #--------------------------------------------------------------------------
  360.   def call_update_help
  361.     if self.active and @help_window != nil
  362.        update_help
  363.     end
  364.   end
  365.   #--------------------------------------------------------------------------
  366.   # ● ヘルプウィンドウの更新 (内容は継承先で定義する)
  367.   #--------------------------------------------------------------------------
  368.   def update_help
  369.   end
  370. end

  371. #==============================================================================
  372. # ■ Window_LineHelp
  373. #------------------------------------------------------------------------------
  374. #  スキルやアイテムの説明、アクターのステータスなどを表示するウィンドウです。
  375. #==============================================================================

  376. class Window_LineHelp < Window_Base
  377.   #--------------------------------------------------------------------------
  378.   # ● オブジェクト初期化
  379.   #--------------------------------------------------------------------------
  380.   def initialize
  381.     super(-16, 0, 576, WLH + 32)
  382.     self.opacity = 0
  383.   end
  384.   #--------------------------------------------------------------------------
  385.   # ● テキスト設定
  386.   #     text  : ウィンドウに表示する文字列
  387.   #     align : アラインメント (0..左揃え、1..中央揃え、2..右揃え)
  388.   #--------------------------------------------------------------------------
  389.   def set_text(text, align = 0)
  390.     if text != @text or align != @align
  391.       self.contents.clear
  392.       back_color = Color.new(0, 0, 0, 80)
  393.       self.contents.fill_rect(0, y = 12, contents.width, WLH - y, back_color)
  394.       self.contents.font.color = normal_color
  395.       self.contents.draw_text(20, 0, self.width - 72, WLH, text, align)
  396.       @text = text
  397.       @align = align
  398.     end
  399.   end
  400. end

  401. #==============================================================================
  402. # ■ Window_PartyCommand
  403. #==============================================================================

  404. class Window_PartyCommand2 < Window_SpinCommand
  405.   #--------------------------------------------------------------------------
  406.   # ● オブジェクト初期化
  407.   #--------------------------------------------------------------------------
  408.   def initialize
  409.     s1 = [Vocab::fight,  "icon", Zii::FIGHT,  true]
  410.     s2 = [Vocab::escape, "icon", Zii::ESCAPE, $game_troop.can_escape]
  411.     setting = {"R"=>40, "S"=>52, "G"=>"Spin40", "L"=>-12}
  412.     super(72, 356, [s1, s2], setting)
  413.     self.active = false
  414.     set_spin
  415.   end
  416. end

  417. #==============================================================================
  418. # ■ Window_ActorCommand
  419. #==============================================================================

  420. class Window_ActorCommand2 < Window_SpinCommand
  421.   #--------------------------------------------------------------------------
  422.   # ● オブジェクト初期化
  423.   #--------------------------------------------------------------------------
  424.   def initialize
  425.     s1 = [Vocab::attack, "icon", Zii::ATTACK, true]
  426.     s2 = [Vocab::skill,  "icon", Zii::SKILL,  true]
  427.     s3 = [Vocab::guard,  "icon", Zii::GUARD,  true]
  428.     s4 = [Vocab::item,   "icon", Zii::ITEM,   true]
  429.     s5 = [Vocab::escape,   "icon", Zii::ESCAPE,   true]
  430.     setting = {"R"=>40, "S"=>52, "G"=>"Spin40", "L"=>-12}
  431.     super(72 , 356, [s1, s2, s3, s4, s5], setting)
  432.     self.active = false
  433.     set_spin
  434.   end
  435.   
  436.   def refresh2
  437.     case @actor.id
  438.     when 1
  439.      s1 = [Vocab::attack, "icon", Zii::ATTACK, true]
  440.      s2 = ["战技",  "icon", Zii::SKILL,  true]
  441.      s3 = ["体术",  "icon", Zii::SKILL2,  true]
  442.      s4 = [Vocab::guard,  "icon", Zii::GUARD,  true]
  443.      s5 = [Vocab::item,   "icon", Zii::ITEM,   true]
  444.      s6 = [Vocab::escape,   "icon", Zii::ESCAPE,   true]
  445.      setting = {"R"=>40, "S"=>52, "G"=>"Spin40", "L"=>-12}
  446.      super(72, 356, [s1, s2, s3, s4, s5, s6], setting)
  447.      self.active = false
  448.      set_spin
  449.     when 2
  450.      s1 = [Vocab::attack, "icon", Zii::ATTACK, true]
  451.      s2 = ["战技",  "icon", Zii::SKILL,  true]
  452.      s3 = ["魔法",  "icon", Zii::SKILL3,  true]
  453.      s4 = [Vocab::guard,  "icon", Zii::GUARD,  true]
  454.      s5 = [Vocab::item,   "icon", Zii::ITEM,   true]
  455.      s6 = [Vocab::escape,   "icon", Zii::ESCAPE,   true]
  456.      setting = {"R"=>40, "S"=>52, "G"=>"Spin40", "L"=>-12}
  457.      super(72, 356, [s1, s2, s3, s4, s5, s6], setting)
  458.      self.active = false
  459.      set_spin
  460.     when 3
  461.      s1 = [Vocab::attack, "icon", Zii::ATTACK, true]
  462.      s2 = ["战技",  "icon", Zii::SKILL,  true]
  463.      s3 = ["体术",  "icon", Zii::SKILL2,  true]
  464.      s4 = [Vocab::guard,  "icon", Zii::GUARD,  true]
  465.      s5 = [Vocab::item,   "icon", Zii::ITEM,   true]
  466.      s6 = [Vocab::escape,   "icon", Zii::ESCAPE,   true]
  467.      setting = {"R"=>40, "S"=>52, "G"=>"Spin40", "L"=>-12}
  468.      super(72, 356, [s1, s2, s3, s4, s5, s6], setting)
  469.      self.active = false
  470.      set_spin
  471.     when 4
  472.      s1 = [Vocab::attack, "icon", Zii::ATTACK, true]
  473.      s2 = ["魔法",  "icon", Zii::SKILL3,  true]
  474.      s3 = ["源术",  "icon", Zii::SKILL4,  true]
  475.      s4 = [Vocab::guard,  "icon", Zii::GUARD,  true]
  476.      s5 = [Vocab::item,   "icon", Zii::ITEM,   true]
  477.      s6 = [Vocab::escape,   "icon", Zii::ESCAPE,   true]
  478.      setting = {"R"=>40, "S"=>52, "G"=>"Spin40", "L"=>-12}
  479.      super(72, 356, [s1, s2, s3, s4, s5, s6], setting)
  480.      self.active = false
  481.      set_spin
  482.     else
  483.      s1 = [Vocab::attack, "icon", Zii::ATTACK, true]
  484.      s2 = [Vocab::skill,  "icon", Zii::SKILL,  true]
  485.      s3 = [Vocab::guard,  "icon", Zii::GUARD,  true]
  486.      s4 = [Vocab::item,   "icon", Zii::ITEM,   true]
  487.      s5 = [Vocab::escape,   "icon", Zii::ESCAPE,   true]
  488.     setting = {"R"=>40, "S"=>52, "G"=>"Spin40", "L"=>-12}
  489.     super(72, 356, [s1, s2, s3, s4, s5], setting)
  490.     self.active = false
  491.     set_spin
  492.     end
  493.   end

  494.   #--------------------------------------------------------------------------
  495.   # ● 按下取消键时的处理
  496.   #--------------------------------------------------------------------------
  497.   def process_cancel
  498.     #Sound.play_cancel
  499.     #Input.update
  500.     #deactivate
  501.     #call_cancel_handler
  502.   end
  503.   #--------------------------------------------------------------------------
  504.   # ● 调用“取消”的处理方法
  505.   #--------------------------------------------------------------------------
  506.   def call_cancel_handler
  507.     #call_handler(:cancel)
  508.   end
  509.   
  510.   def clear_command_list
  511.     @list = []
  512.   end
  513.   def add_command(name, symbol, enabled = true, ext = nil)
  514.     @list.push({:name=>name, :symbol=>symbol, :enabled=>enabled, :ext=>ext})
  515.   end
  516.   #--------------------------------------------------------------------------
  517.   # ● 获取显示行数
  518.   #--------------------------------------------------------------------------
  519.   def visible_line_number
  520.     return 5#4
  521.   end
  522.   #--------------------------------------------------------------------------
  523.   # ● 生成指令列表
  524.   #--------------------------------------------------------------------------
  525.   def make_command_list
  526.     return unless @actor
  527.     add_attack_command
  528.     add_skill_commands
  529.     add_guard_command
  530.     add_item_command
  531.     add_escape_command
  532.   end
  533.   #--------------------------------------------------------------------------
  534.   # ☆ 添加逃跑指令
  535.   #--------------------------------------------------------------------------
  536.   def add_escape_command
  537.     add_command(Vocab::escape, :escape, BattleManager.can_escape?)
  538.   end
  539.   #--------------------------------------------------------------------------
  540.   # ● 添加攻击指令
  541.   #--------------------------------------------------------------------------
  542.   def add_attack_command
  543.     add_command(Zii::ATTACK, :attack, @actor.attack_usable?)
  544.   end
  545.   #--------------------------------------------------------------------------
  546.   # ● 添加技能指令
  547.   #--------------------------------------------------------------------------
  548.   def add_skill_commands
  549.     @actor.added_skill_types.sort.each do |stype_id|
  550.       name = $data_system.skill_types[stype_id]
  551.       add_command(name, :skill, true, stype_id)
  552.       refresh2
  553.     end
  554.   end
  555.   #--------------------------------------------------------------------------
  556.   # ● 添加防御指令
  557.   #--------------------------------------------------------------------------
  558.   def add_guard_command
  559.     add_command(Vocab::guard, :guard, @actor.guard_usable?)
  560.   end
  561.   #--------------------------------------------------------------------------
  562.   # ● 添加物品指令
  563.   #--------------------------------------------------------------------------
  564.   def add_item_command
  565.     add_command(Vocab::item, :item)
  566.   end
  567.   #--------------------------------------------------------------------------
  568.   # ● 设置
  569.   #--------------------------------------------------------------------------
  570.   def setup(actor)
  571.     @actor = actor
  572.     clear_command_list
  573.     make_command_list
  574.     refresh
  575.     #select(0)
  576.     activate
  577.     open
  578.     self.index = 0
  579.     set_spin
  580.   end
  581.   #--------------------------------------------------------------------------
  582.   # ● セットアップ
  583.   #     actor : アクター
  584.   #--------------------------------------------------------------------------
  585.   #def setup(actor)
  586.   #  @commands[0][2] = Zii::ATTACK
  587.   #  @commands[1][0] = Vocab::skill
  588.   #  if actor.weapons[0] != nil
  589.   #    n = actor.weapons[0].icon_index
  590.   #    @commands[0][2] = n if n > 0
  591.   #  end
  592.   #  #@commands[1][0] = actor.class.skill_name if actor.class.skill_name_valid
  593.   #  add_skill_commands
  594.   #  self.index = 0
  595.   #  set_spin
  596.   #end
  597. end
复制代码

点评

他的脚本放在這裏:http://neomemo-an.com/contents/rgss3/  发表于 2014-8-2 14:28
去谷歌了一下发现脚本原作者已经关闭博客消失了……  发表于 2014-8-2 13:16
脚本可以用工具栏的代码框<>发哦  发表于 2014-8-2 12:52

Lv5.捕梦者

梦石
0
星屑
22713
在线时间
8623 小时
注册时间
2011-12-31
帖子
3367
2
发表于 2014-8-2 13:46:44 | 只看该作者
本帖最后由 tseyik 于 2014-8-2 14:31 编辑

VX 用的巴,?Ace的在下面
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

3
发表于 2014-8-2 13:58:08 手机端发表。 | 只看该作者
本帖最后由 taroxd 于 2014-8-2 14:00 编辑

爪机看不到代码,不过看这图片是glimmer的吧。

glimmer都是直接修改原脚本来实现大量脚本的整合的,请不要直接使用里面的脚本。请寻找原版的脚本。

我没记错的话这个脚本是基于某个战斗系统的?
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
22713
在线时间
8623 小时
注册时间
2011-12-31
帖子
3367
4
发表于 2014-8-2 14:19:15 | 只看该作者
本帖最后由 VIPArcher 于 2014-8-2 16:55 编辑

把下面二個圖片導入至Graphics/System(要好看請自作圖片)
Ring96x88.png

RollIconCursor.png

@height  论坛卖萌,无视此行
脚本
RUBY 代码复制
  1. =begin ************************************************************************
  2.   ◆ 画像コマンドスクリプト (ベーススクリプト) Ver.1.82
  3.   ---------------------------------------------------------------------------
  4.     画像コマンドのベーススクリプトです。回転アイコンコマンドが使えます。
  5. =end # ************************************************************************
  6.  
  7. #-information------------------------------------------------------------------
  8. $ziifee ||= {}
  9. $ziifee[:SpriteCommand] = true
  10. #------------------------------------------------------------------------------
  11. #-memo-------------------------------------------------------------------------
  12. #  [必要画像] 以下の画像を Graphics/System にインポートしてください。
  13. #    回転コマンド用カーソル画像 ( ファイル名 : RollIconCursor )
  14. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  15. #  このスクリプトは可能な限り素材の中で上部に導入してください。
  16. #  回転アイコンコマンド選択を行いたいクラスに以下を記述します。
  17. #    include ZiifSpriteCommand_RollIcon  # 回転アイコンコマンド選択
  18. #------------------------------------------------------------------------------
  19.  
  20. #==============================================================================
  21. # ■ ZiifManager
  22. #==============================================================================
  23.  
  24. module ZiifManager
  25.   #--------------------------------------------------------------------------
  26.   # ▼ 定数 (アイコン番号)
  27.   #-memo---------------------------------------------------------------------
  28.   #  回転コマンド上に表示するアイコンはここで設定します。
  29.   #  以下の定義の symbol がここで設定するシンボルになります。
  30.   #    add_command(name, symbol, enabled, ext) # コマンドの追加
  31.   # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  32.   #  IconSet[シンボル] = Hash.new(アイコン番号)
  33.   #  IconSet[:skill][スキルタイプ番号] = アイコン番号  # スキルタイプ
  34.   #--------------------------------------------------------------------------
  35.   IconSet ||= Hash.new(Hash.new(16))           # デフォルト
  36.   IconSet[:fight]       = Hash.new(147)        # 戦う   (バトル)
  37.   IconSet[:escape]      = Hash.new(467)        # 逃げる (バトル)
  38.   IconSet[:attack]      = Hash.new(175)        # 攻撃   (バトル)
  39.   IconSet[:guard]       = Hash.new(506)        # 防御   (バトル)
  40.   IconSet[:item]        = Hash.new(260)        # アイテム
  41.   IconSet[:skill]       = Hash.new(112)        # スキル
  42.   IconSet[:skill][1]    = 115                  # スキルタイプ ID:01
  43.   IconSet[:skill][2]    = 117                  # スキルタイプ ID:02
  44.   IconSet[:equip]       = Hash.new(436)        # 装備
  45.   IconSet[:weapon]      = Hash.new(147)        # 武器
  46.   IconSet[:armor]       = Hash.new(506)        # 防具
  47.   IconSet[:key_item]    = Hash.new(243)        # キーアイテム
  48.   IconSet[:optimize]    = Hash.new(437)        # 最強装備
  49.   IconSet[:clear]       = Hash.new(143)        # 外す
  50.   IconSet[:status]      = Hash.new(121)        # ステータス
  51.   IconSet[:formation]   = Hash.new(183)        # 並び替え
  52.   IconSet[:save]        = Hash.new(224)        # セーブ
  53.   IconSet[:buy]         = Hash.new(270)        # 購入
  54.   IconSet[:sell]        = Hash.new(262)        # 売却
  55.   IconSet[:cancel]      = Hash.new(12)         # キャンセル
  56.   IconSet[:new_game]    = Hash.new(234)        # ニューゲーム
  57.   IconSet[:continue]    = Hash.new(224)        # コンティニュー
  58.   IconSet[:game_end]    = Hash.new(257)        # ゲーム終了
  59.   IconSet[:to_title]    = Hash.new(257)        # タイトルへ
  60.   IconSet[:shutdown]    = Hash.new(143)        # シャットダウン
  61.   #--------------------------------------------------------------------------
  62.   # ● コマンドアイコン番号の取得
  63.   #     command : ウィンドウのコマンド
  64.   #--------------------------------------------------------------------------
  65.   def self.command_icon_index(command)
  66.     IconSet[command[:symbol]][command[:ext]]
  67.   end
  68. end
  69.  
  70. #==============================================================================
  71. # ■ Game_System
  72. #==============================================================================
  73.  
  74. class Game_System
  75.   #--------------------------------------------------------------------------
  76.   # ● 公開インスタンス変数 (オプション拡張用)
  77.   #--------------------------------------------------------------------------
  78.   attr_writer   :ziifop_reverse_roll      # 逆回転 ( true / false )
  79.   attr_writer   :ziifop_roll_input_type   # 回転時 キー入力タイプ (0~2)
  80.   attr_writer   :ziifop_roll_speed        # 回転時 速度 (0~4)
  81.   #--------------------------------------------------------------------------
  82.   # ▼ 逆回転の取得
  83.   #--------------------------------------------------------------------------
  84.   def ziifop_reverse_roll
  85.     return false
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   # ▼ 回転キー入力タイプの取得 (0:プレス, 1:トリガー, 2:リピート)
  89.   #--------------------------------------------------------------------------
  90.   def ziifop_roll_input_type
  91.     return 0
  92.   end
  93.   #--------------------------------------------------------------------------
  94.   # ▼ 回転速度の取得 (0:遅い ~ 4:速い)
  95.   #--------------------------------------------------------------------------
  96.   def ziifop_roll_speed
  97.     return 1
  98.   end
  99. end
  100.  
  101. #******************************************************************************
  102. # ▼ 画像コマンド基本部
  103. #******************************************************************************
  104.  
  105. #==============================================================================
  106. # ■ Sprite_ZiifCommandSprite
  107. #------------------------------------------------------------------------------
  108. #  コマンド画像・背景・カーソル表示用スプライトのスーパークラスです。
  109. #==============================================================================
  110.  
  111. class Sprite_ZiifCommandSprite < Sprite
  112.   #--------------------------------------------------------------------------
  113.   # ● オブジェクト初期化
  114.   #--------------------------------------------------------------------------
  115.   def initialize(command_set)
  116.     super(command_set.viewport)
  117.     @command_set = command_set
  118.     init_basic_values
  119.     create_bitmap
  120.     update
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # ● 基本変数の初期化
  124.   #--------------------------------------------------------------------------
  125.   def init_basic_values
  126.   end
  127.   #--------------------------------------------------------------------------
  128.   # ● ビットマップの作成
  129.   #--------------------------------------------------------------------------
  130.   def create_bitmap
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # ● 内容の作成
  134.   #--------------------------------------------------------------------------
  135.   def create_contents
  136.   end
  137.   #--------------------------------------------------------------------------
  138.   # ● 内容の削除
  139.   #--------------------------------------------------------------------------
  140.   def clear_contents
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # ● スプライトコマンドの取得
  144.   #--------------------------------------------------------------------------
  145.   def command_set
  146.     return @command_set
  147.   end
  148.   #--------------------------------------------------------------------------
  149.   # ● 位置の取得
  150.   #--------------------------------------------------------------------------
  151.   def index
  152.     return command_set.sprite_index(self)
  153.   end
  154.   #--------------------------------------------------------------------------
  155.   # ● コマンドのビューポートの取得
  156.   #--------------------------------------------------------------------------
  157.   def command_set_viewport
  158.     return command_set.viewport
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # ● コマンドの可視状態の取得
  162.   #--------------------------------------------------------------------------
  163.   def command_set_visible
  164.     return command_set.visible && !command_set.close?
  165.   end
  166.   #--------------------------------------------------------------------------
  167.   # ● コマンドの透明度の取得
  168.   #--------------------------------------------------------------------------
  169.   def command_set_opacity
  170.     return command_set.contents_opacity
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # ● 位置情報の更新
  174.   #--------------------------------------------------------------------------
  175.   def update_position
  176.     self.viewport = command_set_viewport
  177.     self.visible  = command_set_visible
  178.     self.opacity  = command_set_opacity
  179.   end
  180. end
  181.  
  182. #==============================================================================
  183. # ■ ZiifSpriteCommand
  184. #------------------------------------------------------------------------------
  185. #  画像コマンド選択を行うためのモジュールです。Mix-Inにより使用します。
  186. #==============================================================================
  187.  
  188. module ZiifSpriteCommand
  189.   #--------------------------------------------------------------------------
  190.   # ● 公開インスタンス変数
  191.   #--------------------------------------------------------------------------
  192.   attr_reader   :windowskin               # ウィンドウスキン
  193.   attr_reader   :viewport                 # ビューポート
  194.   attr_reader   :active                   # 選択状態
  195.   attr_reader   :visible                  # 可視状態
  196.   attr_reader   :x                        # X座標
  197.   attr_reader   :y                        # Y座標
  198.   attr_reader   :width                    # 幅
  199.   attr_reader   :height                   # 高さ
  200.   attr_reader   :z                        # Z座標
  201.   attr_reader   :ox                       # 転送元原点 X座標
  202.   attr_reader   :oy                       # 転送元原点 Y座標
  203.   attr_reader   :padding                  # 余白の大きさ
  204.   attr_reader   :padding_bottom           # 下線余白の大きさ
  205.   attr_reader   :opacity                  # 不透明度
  206.   attr_reader   :back_opacity             # 背景の不透明度
  207.   attr_reader   :contents_opacity         # コマンドの不透明度
  208.   attr_reader   :openness                 # オープン度
  209.   attr_reader   :tone                     # 背景の色調
  210.   attr_reader   :index                    # カーソル位置
  211.   attr_reader   :help_window              # ヘルプウィンドウ
  212.   attr_accessor :cursor_fix               # カーソル固定フラグ
  213.   attr_accessor :cursor_all               # カーソル全選択フラグ
  214.   #--------------------------------------------------------------------------
  215.   # ● オブジェクト初期化
  216.   #--------------------------------------------------------------------------
  217.   def initialize(*args)
  218.     init_basic_values(*args)
  219.     init_sprite_command
  220.     update_tone
  221.     refresh
  222.     select(0)
  223.     activate
  224.   end
  225.   #--------------------------------------------------------------------------
  226.   # ● 基本変数の初期化
  227.   #--------------------------------------------------------------------------
  228.   def init_basic_values(x, y, width = window_width, height = window_height)
  229.     @windowskin       = Cache.system("Window")
  230.     @viewport         = nil
  231.     @active           = true
  232.     @visible          = true
  233.     @x                = x
  234.     @y                = y
  235.     @width            = width
  236.     @height = height
  237.     @z                = 100
  238.     @ox               = 0
  239.     @oy               = 0
  240.     @padding          = 12
  241.     @padding_bottom   = 12
  242.     @opacity          = 255
  243.     @back_opacity     = 255
  244.     @contents_opacity = 255
  245.     @openness         = 255
  246.     @tone             = Tone.new
  247.     @index            = -1
  248.     @handler          = {}
  249.     @cursor_fix       = false
  250.     @cursor_all       = false
  251.     @opening          = false
  252.     @closing          = false
  253.   end
  254.   #--------------------------------------------------------------------------
  255.   # ● スプライトコマンド変数の初期化
  256.   #--------------------------------------------------------------------------
  257.   def init_sprite_command
  258.     @command_sprites  = []
  259.     @object_sprites   = {}
  260.     create_dummy_bitmap
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ● 解放
  264.   #--------------------------------------------------------------------------
  265.   def dispose
  266.     dispose_dummy_bitmap
  267.     dispose_object_sprites
  268.     dispose_command_sprites
  269.   end
  270.   #--------------------------------------------------------------------------
  271.   # ● ウィンドウ幅の取得
  272.   #--------------------------------------------------------------------------
  273.   def window_width
  274.     return 96
  275.   end
  276.   #--------------------------------------------------------------------------
  277.   # ● ウィンドウ高さの取得
  278.   #--------------------------------------------------------------------------
  279.   def window_height
  280.     return 88
  281.   end
  282.   #--------------------------------------------------------------------------
  283.   # ● 項目数の取得
  284.   #--------------------------------------------------------------------------
  285.   def item_max
  286.     @list.size
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # ● コマンドリストのクリア
  290.   #--------------------------------------------------------------------------
  291.   def clear_command_list
  292.     @list = []
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # ● コマンドリストの作成
  296.   #--------------------------------------------------------------------------
  297.   def make_command_list
  298.   end
  299.   #--------------------------------------------------------------------------
  300.   # ● コマンドの追加
  301.   #     name    : コマンド名
  302.   #     symbol  : 対応するシンボル
  303.   #     enabled : 有効状態フラグ
  304.   #     ext     : 任意の拡張データ
  305.   #--------------------------------------------------------------------------
  306.   def add_command(name, symbol, enabled = true, ext = nil)
  307.     @list.push({:name=>name, :symbol=>symbol, :enabled=>enabled, :ext=>ext})
  308.   end
  309.   #--------------------------------------------------------------------------
  310.   # ● コマンド名の取得
  311.   #--------------------------------------------------------------------------
  312.   def command(index)
  313.     @list[index]
  314.   end
  315.   #--------------------------------------------------------------------------
  316.   # ● コマンド名の取得
  317.   #--------------------------------------------------------------------------
  318.   def command_name(index)
  319.     @list[index][:name]
  320.   end
  321.   #--------------------------------------------------------------------------
  322.   # ● コマンドの有効状態を取得
  323.   #--------------------------------------------------------------------------
  324.   def command_enabled?(index)
  325.     @list[index][:enabled]
  326.   end
  327.   #--------------------------------------------------------------------------
  328.   # ● コマンドシンボルの取得
  329.   #--------------------------------------------------------------------------
  330.   def command_symbol(index)
  331.     @list[index][:symbol]
  332.   end
  333.   #--------------------------------------------------------------------------
  334.   # ● コマンドの拡張データの取得
  335.   #--------------------------------------------------------------------------
  336.   def command_ext(index)
  337.     @list[index][:ext]
  338.   end
  339.   #--------------------------------------------------------------------------
  340.   # ● 選択項目のコマンドデータを取得
  341.   #--------------------------------------------------------------------------
  342.   def current_data
  343.     index >= 0 ? @list[index] : nil
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # ● 選択項目のコマンド名を取得
  347.   #--------------------------------------------------------------------------
  348.   def current_item_name
  349.     current_data ? current_data[:name] : ""
  350.   end
  351.   #--------------------------------------------------------------------------
  352.   # ● 選択項目の有効状態を取得
  353.   #--------------------------------------------------------------------------
  354.   def current_item_enabled?
  355.     current_data ? current_data[:enabled] : false
  356.   end
  357.   #--------------------------------------------------------------------------
  358.   # ● 選択項目のシンボルを取得
  359.   #--------------------------------------------------------------------------
  360.   def current_symbol
  361.     current_data ? current_data[:symbol] : nil
  362.   end
  363.   #--------------------------------------------------------------------------
  364.   # ● 選択項目の拡張データを取得
  365.   #--------------------------------------------------------------------------
  366.   def current_ext
  367.     current_data ? current_data[:ext] : nil
  368.   end
  369.   #--------------------------------------------------------------------------
  370.   # ● 指定されたシンボルを持つコマンドにカーソルを移動
  371.   #--------------------------------------------------------------------------
  372.   def select_symbol(symbol)
  373.     @list.each_index {|i| select(i) if @list[i][:symbol] == symbol }
  374.   end
  375.   #--------------------------------------------------------------------------
  376.   # ● 指定された拡張データを持つコマンドにカーソルを移動
  377.   #--------------------------------------------------------------------------
  378.   def select_ext(ext)
  379.     @list.each_index {|i| select(i) if @list[i][:ext] == ext }
  380.   end
  381.   #--------------------------------------------------------------------------
  382.   # ● スプライトコマンドクラスの取得
  383.   #--------------------------------------------------------------------------
  384.   def sprite_command_class
  385.     return Sprite_ZiifCommandSprite
  386.   end
  387.   #--------------------------------------------------------------------------
  388.   # ● コマンド背景クラスの取得
  389.   #--------------------------------------------------------------------------
  390.   def sprite_background_class
  391.     return Sprite_ZiifCommandSprite
  392.   end
  393.   #--------------------------------------------------------------------------
  394.   # ● コマンドカーソルクラスの取得
  395.   #--------------------------------------------------------------------------
  396.   def sprite_cursor_class
  397.     return Sprite_ZiifCommandSprite
  398.   end
  399.   #--------------------------------------------------------------------------
  400.   # ● コマンドスプライトの位置を取得
  401.   #--------------------------------------------------------------------------
  402.   def sprite_index(sprite)
  403.     @command_sprites.index(sprite)
  404.   end
  405.   #--------------------------------------------------------------------------
  406.   # ● コマンドスプライトの作成
  407.   #--------------------------------------------------------------------------
  408.   def make_command_sprites
  409.     item_max.times {|i| @command_sprites[i] = sprite_command_class.new(self) }
  410.   end
  411.   #--------------------------------------------------------------------------
  412.   # ● コマンドスプライトの解放
  413.   #--------------------------------------------------------------------------
  414.   def dispose_command_sprites
  415.     @command_sprites.each {|sprite| sprite.dispose }
  416.     @command_sprites.clear
  417.   end
  418.   #--------------------------------------------------------------------------
  419.   # ● コマンドスプライトの更新
  420.   #--------------------------------------------------------------------------
  421.   def update_command_sprites
  422.     @command_sprites.each {|sprite| sprite.update }
  423.   end
  424.   #--------------------------------------------------------------------------
  425.   # ● コマンドスプライトの位置情報を更新
  426.   #--------------------------------------------------------------------------
  427.   def update_command_sprites_position
  428.     @command_sprites.each {|sprite| sprite.update_position }
  429.   end
  430.   #--------------------------------------------------------------------------
  431.   # ● オブジェクトスプライトの作成
  432.   #--------------------------------------------------------------------------
  433.   def make_object_sprites
  434.     @object_sprites[:background] = sprite_background_class.new(self)
  435.     @object_sprites[:cursor]     = sprite_cursor_class.new(self)
  436.   end
  437.   #--------------------------------------------------------------------------
  438.   # ● オブジェクトスプライトの解放
  439.   #--------------------------------------------------------------------------
  440.   def dispose_object_sprites
  441.     @object_sprites.each_value {|sprite| sprite.dispose }
  442.     @object_sprites.clear
  443.   end
  444.   #--------------------------------------------------------------------------
  445.   # ● オブジェクトスプライトの更新
  446.   #--------------------------------------------------------------------------
  447.   def update_object_sprites
  448.     @object_sprites.each_value {|sprite| sprite.update }
  449.   end
  450.   #--------------------------------------------------------------------------
  451.   # ● オブジェクトスプライトの位置情報を更新
  452.   #--------------------------------------------------------------------------
  453.   def update_object_sprites_position
  454.     @object_sprites.each_value {|sprite| sprite.update_position }
  455.   end
  456.   #--------------------------------------------------------------------------
  457.   # ● コマンド内容の作成
  458.   #--------------------------------------------------------------------------
  459.   def create_contents
  460.     dispose_object_sprites
  461.     dispose_command_sprites
  462.     make_command_sprites
  463.     make_object_sprites
  464.   end
  465.   #--------------------------------------------------------------------------
  466.   # ● フレーム更新
  467.   #--------------------------------------------------------------------------
  468.   def update
  469.     update_tone
  470.     update_open if @opening
  471.     update_close if @closing
  472.     update_move
  473.     update_command_sprites
  474.     update_object_sprites
  475.     process_cursor_move
  476.     process_handling
  477.   end
  478.   #--------------------------------------------------------------------------
  479.   # ● 位置情報の更新
  480.   #--------------------------------------------------------------------------
  481.   def update_position
  482.     update_command_sprites_position
  483.     update_object_sprites_position
  484.   end
  485.   #--------------------------------------------------------------------------
  486.   # ● X座標の変更
  487.   #--------------------------------------------------------------------------
  488.   def x=(x)
  489.     @x = x
  490.     update_position
  491.   end
  492.   #--------------------------------------------------------------------------
  493.   # ● Y座標の変更
  494.   #--------------------------------------------------------------------------
  495.   def y=(y)
  496.     @y = y
  497.     update_position
  498.   end
  499.   #--------------------------------------------------------------------------
  500.   # ● 幅の変更
  501.   #--------------------------------------------------------------------------
  502.   def width=(width)
  503.     @width = width
  504.     update_position
  505.   end
  506.   #--------------------------------------------------------------------------
  507.   # ● 高さの変更
  508.   #--------------------------------------------------------------------------
  509.   def height=(height)
  510.     @height = height
  511.     update_position
  512.   end
  513.   #--------------------------------------------------------------------------
  514.   # ● Z座標の変更
  515.   #--------------------------------------------------------------------------
  516.   def z=(z)
  517.     @z = z
  518.     update_position
  519.   end
  520.   #--------------------------------------------------------------------------
  521.   # ● X座標、Y座標、幅、高さをまとめて変更
  522.   #--------------------------------------------------------------------------
  523.   def move(x, y, width, height)
  524.     @x      = x
  525.     @y      = y
  526.     @width  = width
  527.     @height = height
  528.     update_position
  529.   end
  530.   #--------------------------------------------------------------------------
  531.   # ● 転送元原点 X座標の変更
  532.   #--------------------------------------------------------------------------
  533.   def ox=(ox)
  534.     @ox = ox
  535.     update_position
  536.   end
  537.   #--------------------------------------------------------------------------
  538.   # ● 転送元原点 Y座標の変更
  539.   #--------------------------------------------------------------------------
  540.   def oy=(oy)
  541.     @oy = oy
  542.     update_position
  543.   end
  544.   #--------------------------------------------------------------------------
  545.   # ● 余白の大きさの変更
  546.   #--------------------------------------------------------------------------
  547.   def padding=(padding)
  548.     @padding        = padding
  549.     @padding_bottom = padding_bottom
  550.     update_position
  551.   end
  552.   #--------------------------------------------------------------------------
  553.   # ● 下線余白の大きさの変更
  554.   #--------------------------------------------------------------------------
  555.   def padding_bottom=(padding_bottom)
  556.     @padding_bottom = padding_bottom
  557.     update_position
  558.   end
  559.   #--------------------------------------------------------------------------
  560.   # ● ウィンドウスキンの変更
  561.   #--------------------------------------------------------------------------
  562.   def windowskin=(windowskin)
  563.     @windowskin = windowskin
  564.     update_position
  565.   end
  566.   #--------------------------------------------------------------------------
  567.   # ● ビューポートの変更
  568.   #--------------------------------------------------------------------------
  569.   def viewport=(viewport)
  570.     @viewport = viewport
  571.     update_position
  572.   end
  573.   #--------------------------------------------------------------------------
  574.   # ● 可視状態の変更
  575.   #--------------------------------------------------------------------------
  576.   def visible=(visible)
  577.     @visible = visible
  578.     update_position
  579.   end
  580.   #--------------------------------------------------------------------------
  581.   # ● 表示
  582.   #--------------------------------------------------------------------------
  583.   def show
  584.     self.visible = true
  585.     self
  586.   end
  587.   #--------------------------------------------------------------------------
  588.   # ● 非表示
  589.   #--------------------------------------------------------------------------
  590.   def hide
  591.     self.visible = false
  592.     self
  593.   end
  594.   #--------------------------------------------------------------------------
  595.   # ● アクティブ状態の変更
  596.   #--------------------------------------------------------------------------
  597.   def active=(active)
  598.     @active = active
  599.     update_cursor
  600.     call_update_help
  601.   end
  602.   #--------------------------------------------------------------------------
  603.   # ● アクティブ化
  604.   #--------------------------------------------------------------------------
  605.   def activate
  606.     self.active = true
  607.     self
  608.   end
  609.   #--------------------------------------------------------------------------
  610.   # ● 非アクティブ化
  611.   #--------------------------------------------------------------------------
  612.   def deactivate
  613.     self.active = false
  614.     self
  615.   end
  616.   #--------------------------------------------------------------------------
  617.   # ● 不透明度の変更
  618.   #--------------------------------------------------------------------------
  619.   def opacity=(opacity)
  620.     @opacity = [[opacity, 255].min, 0].max
  621.     update_position
  622.   end
  623.   #--------------------------------------------------------------------------
  624.   # ● 背景の不透明度の変更
  625.   #--------------------------------------------------------------------------
  626.   def back_opacity=(opacity)
  627.     @back_opacity = [[opacity, 255].min, 0].max
  628.     update_position
  629.   end
  630.   #--------------------------------------------------------------------------
  631.   # ● 内容の不透明度の変更
  632.   #--------------------------------------------------------------------------
  633.   def contents_opacity=(opacity)
  634.     @contents_opacity = [[opacity, 255].min, 0].max
  635.     update_position
  636.   end
  637.   #--------------------------------------------------------------------------
  638.   # ● オープン度の変更
  639.   #--------------------------------------------------------------------------
  640.   def openness=(openness)
  641.     @openness = [[openness, 255].min, 0].max
  642.     update_position
  643.   end
  644.   #--------------------------------------------------------------------------
  645.   # ● 完全に開いた状態かどうか?
  646.   #--------------------------------------------------------------------------
  647.   def open?
  648.     (@openness == 255)
  649.   end
  650.   #--------------------------------------------------------------------------
  651.   # ● 完全に閉じた状態かどうか?
  652.   #--------------------------------------------------------------------------
  653.   def close?
  654.     (@openness == 0)
  655.   end
  656.   #--------------------------------------------------------------------------
  657.   # ● 開く処理値の取得
  658.   #--------------------------------------------------------------------------
  659.   def opening_value
  660.     return 48
  661.   end
  662.   #--------------------------------------------------------------------------
  663.   # ● 閉じる処理値の取得
  664.   #--------------------------------------------------------------------------
  665.   def closing_value
  666.     return 48
  667.   end
  668.   #--------------------------------------------------------------------------
  669.   # ● 開く処理の更新
  670.   #--------------------------------------------------------------------------
  671.   def update_open
  672.     self.openness += opening_value
  673.     @opening = false if open?
  674.   end
  675.   #--------------------------------------------------------------------------
  676.   # ● 閉じる処理の更新
  677.   #--------------------------------------------------------------------------
  678.   def update_close
  679.     self.openness -= closing_value
  680.     @closing = false if close?
  681.   end
  682.   #--------------------------------------------------------------------------
  683.   # ● 開く
  684.   #--------------------------------------------------------------------------
  685.   def open
  686.     @opening = true unless open?
  687.     @closing = false
  688.     self
  689.   end
  690.   #--------------------------------------------------------------------------
  691.   # ● 閉じる
  692.   #--------------------------------------------------------------------------
  693.   def close
  694.     @closing = true unless close?
  695.     @opening = false
  696.     self
  697.   end
  698.   #--------------------------------------------------------------------------
  699.   # ● 色調の更新
  700.   #--------------------------------------------------------------------------
  701.   def update_tone
  702.   end
  703.   #--------------------------------------------------------------------------
  704.   # ● 移動中かどうか?
  705.   #--------------------------------------------------------------------------
  706.   def move?
  707.     return false
  708.   end
  709.   #--------------------------------------------------------------------------
  710.   # ● 停止中かどうか?
  711.   #--------------------------------------------------------------------------
  712.   def stop?
  713.     return true
  714.   end
  715.   #--------------------------------------------------------------------------
  716.   # ● 位置移動の更新
  717.   #--------------------------------------------------------------------------
  718.   def update_move
  719.   end
  720.   #--------------------------------------------------------------------------
  721.   # ● カーソル位置の設定
  722.   #--------------------------------------------------------------------------
  723.   def index=(index)
  724.     @index = index
  725.     update_cursor
  726.     call_update_help
  727.   end
  728.   #--------------------------------------------------------------------------
  729.   # ● 項目の選択
  730.   #--------------------------------------------------------------------------
  731.   def select(index)
  732.     self.index = index if index
  733.   end
  734.   #--------------------------------------------------------------------------
  735.   # ● 項目の選択解除
  736.   #--------------------------------------------------------------------------
  737.   def unselect
  738.     self.index = -1
  739.   end
  740.   #--------------------------------------------------------------------------
  741.   # ● 動作に対応するハンドラの設定
  742.   #     method : ハンドラとして設定するメソッド (Method オブジェクト)
  743.   #--------------------------------------------------------------------------
  744.   def set_handler(symbol, method)
  745.     @handler[symbol] = method
  746.   end
  747.   #--------------------------------------------------------------------------
  748.   # ● ハンドラの存在確認
  749.   #--------------------------------------------------------------------------
  750.   def handle?(symbol)
  751.     @handler.include?(symbol)
  752.   end
  753.   #--------------------------------------------------------------------------
  754.   # ● ハンドラの呼び出し
  755.   #--------------------------------------------------------------------------
  756.   def call_handler(symbol)
  757.     @handler[symbol].call if handle?(symbol)
  758.   end
  759.   #--------------------------------------------------------------------------
  760.   # ● カーソルの移動可能判定
  761.   #--------------------------------------------------------------------------
  762.   def cursor_movable?
  763.     stop? && active && open? && !@cursor_fix && !@cursor_all && item_max > 0
  764.   end
  765.   #--------------------------------------------------------------------------
  766.   # ● 下キーが押されているかどうか?
  767.   #--------------------------------------------------------------------------
  768.   def input_down?
  769.     Input.repeat?(:DOWN)
  770.   end
  771.   #--------------------------------------------------------------------------
  772.   # ● 上キーが押されているかどうか?
  773.   #--------------------------------------------------------------------------
  774.   def input_up?
  775.     Input.repeat?(:UP)
  776.   end
  777.   #--------------------------------------------------------------------------
  778.   # ● 右キーが押されているかどうか?
  779.   #--------------------------------------------------------------------------
  780.   def input_right?
  781.     Input.repeat?(:RIGHT)
  782.   end
  783.   #--------------------------------------------------------------------------
  784.   # ● 左キーが押されているかどうか?
  785.   #--------------------------------------------------------------------------
  786.   def input_left?
  787.     Input.repeat?(:LEFT)
  788.   end
  789.   #--------------------------------------------------------------------------
  790.   # ● カーソルを下に移動
  791.   #--------------------------------------------------------------------------
  792.   def cursor_down(wrap = false)
  793.   end
  794.   #--------------------------------------------------------------------------
  795.   # ● カーソルを上に移動
  796.   #--------------------------------------------------------------------------
  797.   def cursor_up(wrap = false)
  798.   end
  799.   #--------------------------------------------------------------------------
  800.   # ● カーソルを右に移動
  801.   #--------------------------------------------------------------------------
  802.   def cursor_right(wrap = false)
  803.   end
  804.   #--------------------------------------------------------------------------
  805.   # ● カーソルを左に移動
  806.   #--------------------------------------------------------------------------
  807.   def cursor_left(wrap = false)
  808.   end
  809.   #--------------------------------------------------------------------------
  810.   # ● カーソルの移動前処理
  811.   #--------------------------------------------------------------------------
  812.   def process_before_cursor_move
  813.     @cursor_sound_value = @index
  814.   end
  815.   #--------------------------------------------------------------------------
  816.   # ● カーソルの移動後処理
  817.   #--------------------------------------------------------------------------
  818.   def process_after_cursor_move
  819.     Sound.play_cursor if @index != @cursor_sound_value
  820.   end
  821.   #--------------------------------------------------------------------------
  822.   # ● カーソルの移動処理
  823.   #--------------------------------------------------------------------------
  824.   def process_cursor_move
  825.     return unless cursor_movable?
  826.     process_before_cursor_move
  827.     cursor_down (Input.trigger?(:DOWN))  if input_down?
  828.     cursor_up   (Input.trigger?(:UP))    if input_up?
  829.     cursor_right(Input.trigger?(:RIGHT)) if input_right?
  830.     cursor_left (Input.trigger?(:LEFT))  if input_left?
  831.     process_after_cursor_move
  832.   end
  833.   #--------------------------------------------------------------------------
  834.   # ● 決定やキャンセルなどのハンドリング処理
  835.   #--------------------------------------------------------------------------
  836.   def process_handling
  837.     return unless open? && active && stop?
  838.     return process_ok       if ok_enabled?        && Input.trigger?(:C)
  839.     return process_cancel   if cancel_enabled?    && Input.trigger?(:B)
  840.     return process_pagedown if handle?(:pagedown) && Input.trigger?(:R)
  841.     return process_pageup   if handle?(:pageup)   && Input.trigger?(:L)
  842.   end
  843.   #--------------------------------------------------------------------------
  844.   # ● 決定処理の有効状態を取得
  845.   #--------------------------------------------------------------------------
  846.   def ok_enabled?
  847.     return true
  848.   end
  849.   #--------------------------------------------------------------------------
  850.   # ● キャンセル処理の有効状態を取得
  851.   #--------------------------------------------------------------------------
  852.   def cancel_enabled?
  853.     handle?(:cancel)
  854.   end
  855.   #--------------------------------------------------------------------------
  856.   # ● 決定ボタンが押されたときの処理
  857.   #--------------------------------------------------------------------------
  858.   def process_ok
  859.     if current_item_enabled?
  860.       Sound.play_ok
  861.       Input.update
  862.       deactivate
  863.       call_ok_handler
  864.     else
  865.       Sound.play_buzzer
  866.     end
  867.   end
  868.   #--------------------------------------------------------------------------
  869.   # ● 決定ハンドラの呼び出し
  870.   #--------------------------------------------------------------------------
  871.   def call_ok_handler
  872.     if handle?(current_symbol)
  873.       call_handler(current_symbol)
  874.     elsif handle?(:ok)
  875.       call_ok_handler_default
  876.     else
  877.       activate
  878.     end
  879.   end
  880.   #--------------------------------------------------------------------------
  881.   # ● 決定ハンドラの呼び出し (デフォルト)
  882.   #--------------------------------------------------------------------------
  883.   def call_ok_handler_default
  884.     call_handler(:ok)
  885.   end
  886.   #--------------------------------------------------------------------------
  887.   # ● キャンセルボタンが押されたときの処理
  888.   #--------------------------------------------------------------------------
  889.   def process_cancel
  890.     Sound.play_cancel
  891.     Input.update
  892.     deactivate
  893.     call_cancel_handler
  894.   end
  895.   #--------------------------------------------------------------------------
  896.   # ● キャンセルハンドラの呼び出し
  897.   #--------------------------------------------------------------------------
  898.   def call_cancel_handler
  899.     call_handler(:cancel)
  900.   end
  901.   #--------------------------------------------------------------------------
  902.   # ● L ボタン(PageUp)が押されたときの処理
  903.   #--------------------------------------------------------------------------
  904.   def process_pageup
  905.     Sound.play_cursor
  906.     Input.update
  907.     deactivate
  908.     call_handler(:pageup)
  909.   end
  910.   #--------------------------------------------------------------------------
  911.   # ● R ボタン(PageDown)が押されたときの処理
  912.   #--------------------------------------------------------------------------
  913.   def process_pagedown
  914.     Sound.play_cursor
  915.     Input.update
  916.     deactivate
  917.     call_handler(:pagedown)
  918.   end
  919.   #--------------------------------------------------------------------------
  920.   # ● カーソルの更新
  921.   #--------------------------------------------------------------------------
  922.   def update_cursor
  923.     update_position
  924.   end
  925.   #--------------------------------------------------------------------------
  926.   # ● ヘルプウィンドウの設定
  927.   #--------------------------------------------------------------------------
  928.   def help_window=(help_window)
  929.     @help_window = help_window
  930.     call_update_help
  931.   end
  932.   #--------------------------------------------------------------------------
  933.   # ● ヘルプウィンドウ更新メソッドの呼び出し
  934.   #--------------------------------------------------------------------------
  935.   def call_update_help
  936.     update_help if active && @help_window
  937.   end
  938.   #--------------------------------------------------------------------------
  939.   # ● ヘルプウィンドウの更新
  940.   #--------------------------------------------------------------------------
  941.   def update_help
  942.     @help_window.clear
  943.   end
  944.   #--------------------------------------------------------------------------
  945.   # ● 全項目の描画
  946.   #--------------------------------------------------------------------------
  947.   def draw_all_items
  948.     item_max.times {|i| draw_item(i) }
  949.   end
  950.   #--------------------------------------------------------------------------
  951.   # ● 項目の描画
  952.   #--------------------------------------------------------------------------
  953.   def draw_item(index)
  954.     @command_sprites[index].create_contents
  955.   end
  956.   #--------------------------------------------------------------------------
  957.   # ● 項目の消去
  958.   #--------------------------------------------------------------------------
  959.   def clear_item(index)
  960.     @command_sprites[index].clear_contents
  961.   end
  962.   #--------------------------------------------------------------------------
  963.   # ● 項目の再描画
  964.   #--------------------------------------------------------------------------
  965.   def redraw_item(index)
  966.     clear_item(index) if index >= 0
  967.     draw_item(index)  if index >= 0
  968.   end
  969.   #--------------------------------------------------------------------------
  970.   # ● 選択項目の再描画
  971.   #--------------------------------------------------------------------------
  972.   def redraw_current_item
  973.     redraw_item(@index)
  974.   end
  975.   #--------------------------------------------------------------------------
  976.   # ● リフレッシュ
  977.   #--------------------------------------------------------------------------
  978.   def refresh
  979.     clear_command_list
  980.     make_command_list
  981.     create_contents
  982.     draw_all_items
  983.     update_position
  984.   end
  985.   #--------------------------------------------------------------------------
  986.   # ○ ダミービットマップの作成 (ウィンドウ互換用)
  987.   #--------------------------------------------------------------------------
  988.   def create_dummy_bitmap
  989.     @dummy_bitmap = Bitmap.new(32, 32)
  990.   end
  991.   #--------------------------------------------------------------------------
  992.   # ○ ダミービットマップの解放 (ウィンドウ互換用)
  993.   #--------------------------------------------------------------------------
  994.   def dispose_dummy_bitmap
  995.     @dummy_bitmap.dispose
  996.   end
  997.   #--------------------------------------------------------------------------
  998.   # ○ ウィンドウ内容の取得 (ウィンドウ互換用)
  999.   #--------------------------------------------------------------------------
  1000.   def contents
  1001.     @dummy_bitmap
  1002.   end
  1003.   #--------------------------------------------------------------------------
  1004.   # ○ カーソルの矩形 (ウィンドウ互換用)
  1005.   #--------------------------------------------------------------------------
  1006.   def cursor_rect
  1007.     Rect.new(self.x, self.y, self.width, self.height)
  1008.   end
  1009.   #--------------------------------------------------------------------------
  1010.   # ○ スクロール用矢印の可視状態 (ウィンドウ互換用)
  1011.   #--------------------------------------------------------------------------
  1012.   def arrows_visible
  1013.     return true
  1014.   end
  1015.   #--------------------------------------------------------------------------
  1016.   # ○ スクロール用矢印の可視状態の変更 (ウィンドウ互換用)
  1017.   #--------------------------------------------------------------------------
  1018.   def arrows_visible=(arrows_visible)
  1019.   end
  1020.   #--------------------------------------------------------------------------
  1021.   # ○ ポーズの可視状態 (ウィンドウ互換用)
  1022.   #--------------------------------------------------------------------------
  1023.   def pause
  1024.     return false
  1025.   end
  1026.   #--------------------------------------------------------------------------
  1027.   # ○ ポーズの可視状態の変更 (ウィンドウ互換用)
  1028.   #--------------------------------------------------------------------------
  1029.   def pause=(pause)
  1030.   end
  1031. end
  1032.  
  1033. #******************************************************************************
  1034. # ▼ 回転アイコンコマンド部
  1035. #******************************************************************************
  1036.  
  1037. #==============================================================================
  1038. # ■ Sprite_ZiifRollIconCommand
  1039. #------------------------------------------------------------------------------
  1040. #  回転コマンドアイコン表示用のスプライトです。
  1041. #==============================================================================
  1042.  
  1043. class Sprite_ZiifRollIconCommand < Sprite_ZiifCommandSprite
  1044.   #--------------------------------------------------------------------------
  1045.   # ● 解放
  1046.   #--------------------------------------------------------------------------
  1047.   def dispose
  1048.     self.bitmap.dispose
  1049.     super
  1050.   end
  1051.   #--------------------------------------------------------------------------
  1052.   # ● ビットマップの作成
  1053.   #--------------------------------------------------------------------------
  1054.   def create_bitmap
  1055.     self.bitmap = Bitmap.new(24, 24)
  1056.     self.ox     = self.bitmap.width / 2
  1057.     self.oy     = self.bitmap.height / 2
  1058.   end
  1059.   #--------------------------------------------------------------------------
  1060.   # ● アイコン番号の取得
  1061.   #--------------------------------------------------------------------------
  1062.   def icon_index
  1063.     ZiifManager.command_icon_index(command_set.command(self.index))
  1064.   end
  1065.   #--------------------------------------------------------------------------
  1066.   # ● アイコン番号の取得
  1067.   #--------------------------------------------------------------------------
  1068.   def enabled
  1069.     command_set.command_enabled?(self.index)
  1070.   end
  1071.   #--------------------------------------------------------------------------
  1072.   # ● 半透明描画用のアルファ値を取得
  1073.   #--------------------------------------------------------------------------
  1074.   def translucent_alpha
  1075.     return 160
  1076.   end
  1077.   #--------------------------------------------------------------------------
  1078.   # ● 内容の作成
  1079.   #--------------------------------------------------------------------------
  1080.   def create_contents
  1081.     draw_icon
  1082.   end
  1083.   #--------------------------------------------------------------------------
  1084.   # ● アイコンを描画
  1085.   #--------------------------------------------------------------------------
  1086.   def draw_icon
  1087.     bitmap     = Cache.system("Iconset")
  1088.     icon_index = self.icon_index
  1089.     rect       = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  1090.     self.bitmap.blt(0, 0, bitmap, rect, enabled ? 255 : translucent_alpha)
  1091.   end
  1092.   #--------------------------------------------------------------------------
  1093.   # ● 内容の削除
  1094.   #--------------------------------------------------------------------------
  1095.   def clear_contents
  1096.     self.bitmap.clear
  1097.   end
  1098.   #--------------------------------------------------------------------------
  1099.   # ● 位置情報の更新
  1100.   #--------------------------------------------------------------------------
  1101.   def update_position
  1102.     super
  1103.     update_roll
  1104.   end
  1105.   #--------------------------------------------------------------------------
  1106.   # ● 回転幅の取得
  1107.   #--------------------------------------------------------------------------
  1108.   def roll_width
  1109.     command_set.width * command_set.openness / 510
  1110.   end
  1111.   #--------------------------------------------------------------------------
  1112.   # ● 回転高さの取得
  1113.   #--------------------------------------------------------------------------
  1114.   def roll_height
  1115.     command_set.height * command_set.openness / 510
  1116.   end
  1117.   #--------------------------------------------------------------------------
  1118.   # ● 回転角度の取得
  1119.   #--------------------------------------------------------------------------
  1120.   def roll_angle
  1121.     angle  = (self.index - command_set.index) * command_set.move_size
  1122.     angle += command_set.roll_angle
  1123.   end
  1124.   #--------------------------------------------------------------------------
  1125.   # ● 回転位置の更新
  1126.   #--------------------------------------------------------------------------
  1127.   def update_roll
  1128.     angle  = roll_angle
  1129.     self.x = roll_width  * Math.sin(angle)    + command_set.x
  1130.     self.y = roll_height * (-Math.cos(angle)) + command_set.y
  1131.     self.z = command_set.z
  1132.   end
  1133. end
  1134.  
  1135. #==============================================================================
  1136. # ■ Sprite_ZiifRollIconBackground
  1137. #------------------------------------------------------------------------------
  1138. #  画像コマンド背景のスプライトです。
  1139. #==============================================================================
  1140.  
  1141. class Sprite_ZiifRollIconBackground < Sprite_ZiifCommandSprite
  1142.   #--------------------------------------------------------------------------
  1143.   # ● 解放
  1144.   #--------------------------------------------------------------------------
  1145.   def dispose
  1146.     self.bitmap.dispose if command_set.background_filename.empty?
  1147.     super
  1148.   end
  1149.   #--------------------------------------------------------------------------
  1150.   # ● ビットマップの作成
  1151.   #--------------------------------------------------------------------------
  1152.   def create_bitmap
  1153.     self.bitmap = Cache.system(command_set.background_filename)
  1154.     self.ox     = self.bitmap.width / 2
  1155.     self.oy     = self.bitmap.height / 2
  1156.   end
  1157.   #--------------------------------------------------------------------------
  1158.   # ● コマンドの透明度の取得
  1159.   #--------------------------------------------------------------------------
  1160.   def command_set_opacity
  1161.     opacity  = command_set.opacity
  1162.     opacity *= command_set.back_opacity
  1163.     opacity *= command_set.openness
  1164.     opacity /= 65025
  1165.   end
  1166.   #--------------------------------------------------------------------------
  1167.   # ● 位置情報の更新
  1168.   #--------------------------------------------------------------------------
  1169.   def update_position
  1170.     super
  1171.     self.x = command_set.x
  1172.     self.y = command_set.y
  1173.     self.z = command_set.z - 10
  1174.   end
  1175. end
  1176.  
  1177. #==============================================================================
  1178. # ■ Sprite_ZiifRollIconCursor
  1179. #------------------------------------------------------------------------------
  1180. #  画像コマンドカーソルのスプライトです。
  1181. #==============================================================================
  1182.  
  1183. class Sprite_ZiifRollIconCursor < Sprite_ZiifCommandSprite
  1184.   #--------------------------------------------------------------------------
  1185.   # ● 解放
  1186.   #--------------------------------------------------------------------------
  1187.   def dispose
  1188.     self.bitmap.dispose if command_set.cursor_filename.empty?
  1189.     super
  1190.   end
  1191.   #--------------------------------------------------------------------------
  1192.   # ● ビットマップの作成
  1193.   #--------------------------------------------------------------------------
  1194.   def create_bitmap
  1195.     self.bitmap   = Cache.system(command_set.cursor_filename)
  1196.     self.ox       = self.bitmap.width / 2
  1197.     self.oy       = self.bitmap.height / 2
  1198.     @effect_count = 0
  1199.   end
  1200.   #--------------------------------------------------------------------------
  1201.   # ● コマンドの透明度の取得
  1202.   #--------------------------------------------------------------------------
  1203.   def command_set_opacity
  1204.     if @effect_count < 32
  1205.       value = 176 + @effect_count * 4
  1206.     else
  1207.       value = 432 - @effect_count * 4
  1208.     end
  1209.     return (value * command_set.contents_opacity / 255)
  1210.   end
  1211.   #--------------------------------------------------------------------------
  1212.   # ● フレーム更新
  1213.   #--------------------------------------------------------------------------
  1214.   def update
  1215.     super
  1216.     update_effect
  1217.   end
  1218.   #--------------------------------------------------------------------------
  1219.   # ● 演出効果の更新
  1220.   #--------------------------------------------------------------------------
  1221.   def update_effect
  1222.     self.opacity   = command_set_opacity
  1223.     @effect_count  = 0 if @effect_count == 64
  1224.     @effect_count += 1
  1225.   end
  1226.   #--------------------------------------------------------------------------
  1227.   # ● 回転幅の取得
  1228.   #--------------------------------------------------------------------------
  1229.   def roll_width
  1230.     return 0
  1231.   end
  1232.   #--------------------------------------------------------------------------
  1233.   # ● 回転高さの取得
  1234.   #--------------------------------------------------------------------------
  1235.   def roll_height
  1236.     (- command_set.height * command_set.openness / 510)
  1237.   end
  1238.   #--------------------------------------------------------------------------
  1239.   # ● 位置情報の更新
  1240.   #--------------------------------------------------------------------------
  1241.   def update_position
  1242.     super
  1243.     self.x = command_set.x + roll_width
  1244.     self.y = command_set.y + roll_height
  1245.     self.z = command_set.z - 5
  1246.   end
  1247. end
  1248.  
  1249. #==============================================================================
  1250. # ■ Window_ZiifRollIconCommandName
  1251. #------------------------------------------------------------------------------
  1252. #  回転アイコンコマンドの選択コマンド名を表示するウィンドウです。
  1253. #==============================================================================
  1254.  
  1255. class Window_ZiifRollIconCommandName < Window_Base
  1256.   #--------------------------------------------------------------------------
  1257.   # ● オブジェクト初期化
  1258.   #--------------------------------------------------------------------------
  1259.   def initialize(command_set)
  1260.     super(0, 0, command_set.width, fitting_height(1))
  1261.     @command_set = command_set
  1262.     self.opacity = 0
  1263.   end
  1264.   #--------------------------------------------------------------------------
  1265.   # ● スプライトコマンドの取得
  1266.   #--------------------------------------------------------------------------
  1267.   def command_set
  1268.     return @command_set
  1269.   end
  1270.   #--------------------------------------------------------------------------
  1271.   # ● X座標の取得
  1272.   #--------------------------------------------------------------------------
  1273.   def window_x
  1274.     (command_set.x - self.width / 2)
  1275.   end
  1276.   #--------------------------------------------------------------------------
  1277.   # ● Y座標の取得
  1278.   #--------------------------------------------------------------------------
  1279.   def window_y
  1280.     (command_set.y - self.height / 2)
  1281.   end
  1282.   #--------------------------------------------------------------------------
  1283.   # ● コマンドのビューポートの取得
  1284.   #--------------------------------------------------------------------------
  1285.   def command_set_viewport
  1286.     return command_set.viewport
  1287.   end
  1288.   #--------------------------------------------------------------------------
  1289.   # ● コマンドの可視状態の取得
  1290.   #--------------------------------------------------------------------------
  1291.   def command_set_visible
  1292.     return command_set.visible && command_set.open?
  1293.   end
  1294.   #--------------------------------------------------------------------------
  1295.   # ● コマンドの透明度の取得
  1296.   #--------------------------------------------------------------------------
  1297.   def command_set_opacity
  1298.     return command_set.contents_opacity
  1299.   end
  1300.   #--------------------------------------------------------------------------
  1301.   # ● 位置情報の更新
  1302.   #--------------------------------------------------------------------------
  1303.   def update_position
  1304.     set_information
  1305.     update_base_position
  1306.   end
  1307.   #--------------------------------------------------------------------------
  1308.   # ● 基本の位置情報の更新
  1309.   #--------------------------------------------------------------------------
  1310.   def update_base_position
  1311.     self.viewport         = command_set_viewport
  1312.     self.visible          = command_set_visible
  1313.     self.contents_opacity = command_set_opacity
  1314.     self.x                = window_x + command_set.info_window_offset_x
  1315.     self.y                = window_y + command_set.info_window_offset_y
  1316.     self.z                = command_set.z + 10
  1317.   end
  1318.   #--------------------------------------------------------------------------
  1319.   # ● 表示情報の設定
  1320.   #--------------------------------------------------------------------------
  1321.   def set_information
  1322.     return if command_set.current_item_name == @name
  1323.     @name = command_set.current_item_name
  1324.     refresh
  1325.   end
  1326.   #--------------------------------------------------------------------------
  1327.   # ● リフレッシュ
  1328.   #--------------------------------------------------------------------------
  1329.   def refresh
  1330.     contents.clear
  1331.     texts = command_set.info_text_separate? ? @name.scan(/\S+/) : [@name]
  1332.     texts.push("") if texts.empty?
  1333.     self.width  = texts.collect {|text| text_size(text).width + 8 }.max
  1334.     self.width += standard_padding * 2
  1335.     self.height = fitting_height(texts.size)
  1336.     create_contents
  1337.     texts.each_with_index do |text, line|
  1338.       draw_text(0, line_height * line, contents.width, line_height, text, 1)
  1339.     end
  1340.   end
  1341. end
  1342.  
  1343. #==============================================================================
  1344. # ■ ZiifSpriteCommand_RollIcon
  1345. #------------------------------------------------------------------------------
  1346. #  回転アイコンコマンド選択を行うモジュールです。Mix-Inにより使用します。
  1347. #==============================================================================
  1348.  
  1349. module ZiifSpriteCommand_RollIcon
  1350.   #--------------------------------------------------------------------------
  1351.   # ● Mix-In
  1352.   #--------------------------------------------------------------------------
  1353.   include ZiifSpriteCommand               # 画像コマンド選択モジュール
  1354.   #--------------------------------------------------------------------------
  1355.   # ● 公開インスタンス変数
  1356.   #--------------------------------------------------------------------------
  1357.   attr_reader   :move_size                # 移動サイズ
  1358.   attr_reader   :move_speed               # 移動速度
  1359.   attr_reader   :move_count               # 移動カウント
  1360.   attr_reader   :move_type                # 移動タイプ
  1361.   #--------------------------------------------------------------------------
  1362.   # ● スプライトコマンド変数の初期化
  1363.   #--------------------------------------------------------------------------
  1364.   def init_sprite_command
  1365.     super
  1366.     @move_size  = 0
  1367.     @move_speed = 64
  1368.     @move_count = 0
  1369.     @move_type  = nil
  1370.   end
  1371.   #--------------------------------------------------------------------------
  1372.   # ● 逆回転の判定
  1373.   #--------------------------------------------------------------------------
  1374.   def reverse_roll?
  1375.     return $game_system.ziifop_reverse_roll
  1376.   end
  1377.   #--------------------------------------------------------------------------
  1378.   # ● 角度の差の取得
  1379.   #--------------------------------------------------------------------------
  1380.   def angle_difference
  1381.     (item_max > 0 ? Math::PI * 2 / item_max : 0)
  1382.   end
  1383.   #--------------------------------------------------------------------------
  1384.   # ● 回転速度の取得
  1385.   #--------------------------------------------------------------------------
  1386.   def roll_speed
  1387.     ([64 - item_max * 3, 16].max * correct_roll_speed)
  1388.   end
  1389.   #--------------------------------------------------------------------------
  1390.   # ● 回転速度の補正値の取得
  1391.   #--------------------------------------------------------------------------
  1392.   def correct_roll_speed
  1393.     case $game_system.ziifop_roll_speed
  1394.     when 0; return 0.6   # 遅い
  1395.     when 1; return 0.8   # やや遅い
  1396.     when 2; return 1     # 普通
  1397.     when 3; return 1.2   # やや速い
  1398.     when 4; return 1.4   # 速い
  1399.     end
  1400.   end
  1401.   #--------------------------------------------------------------------------
  1402.   # ● 回転動作時の角度の取得
  1403.   #--------------------------------------------------------------------------
  1404.   def roll_angle
  1405.     (move? ? move_count * move_speed * correct_roll_angle / 360 : 0)
  1406.   end
  1407.   #--------------------------------------------------------------------------
  1408.   # ● 回転方向の補正値の取得
  1409.   #--------------------------------------------------------------------------
  1410.   def correct_roll_angle
  1411.     case @move_type
  1412.     when :right ; return 1   # 右回転
  1413.     when :left  ; return -1  # 左回転
  1414.     else        ; return 0
  1415.     end
  1416.   end
  1417.   #--------------------------------------------------------------------------
  1418.   # ● 回転カウント値の設定
  1419.   #--------------------------------------------------------------------------
  1420.   def roll_count
  1421.     (move_size * 360 / move_speed)
  1422.   end
  1423.   #--------------------------------------------------------------------------
  1424.   # ● 背景画像のファイル名を取得
  1425.   #--------------------------------------------------------------------------
  1426.   def background_filename
  1427.     return ""
  1428.   end
  1429.   #--------------------------------------------------------------------------
  1430.   # ● カーソル画像のファイル名を取得
  1431.   #--------------------------------------------------------------------------
  1432.   def cursor_filename
  1433.     return "RollIconCursor"
  1434.   end
  1435.   #--------------------------------------------------------------------------
  1436.   # ● 情報ウィンドウの空白文字での改行判定
  1437.   #--------------------------------------------------------------------------
  1438.   def info_text_separate?
  1439.     return false
  1440.   end
  1441.   #--------------------------------------------------------------------------
  1442.   # ● 情報ウィンドウのX座標調整
  1443.   #--------------------------------------------------------------------------
  1444.   def info_window_offset_x
  1445.     return 0
  1446.   end
  1447.   #--------------------------------------------------------------------------
  1448.   # ● 情報ウィンドウのY座標調整
  1449.   #--------------------------------------------------------------------------
  1450.   def info_window_offset_y
  1451.     return 0
  1452.   end
  1453.   #--------------------------------------------------------------------------
  1454.   # ● スプライトコマンドクラスの取得
  1455.   #--------------------------------------------------------------------------
  1456.   def sprite_command_class
  1457.     return Sprite_ZiifRollIconCommand
  1458.   end
  1459.   #--------------------------------------------------------------------------
  1460.   # ● コマンド背景クラスの取得
  1461.   #--------------------------------------------------------------------------
  1462.   def sprite_background_class
  1463.     return Sprite_ZiifRollIconBackground
  1464.   end
  1465.   #--------------------------------------------------------------------------
  1466.   # ● コマンドカーソルクラスの取得
  1467.   #--------------------------------------------------------------------------
  1468.   def sprite_cursor_class
  1469.     return Sprite_ZiifRollIconCursor
  1470.   end
  1471.   #--------------------------------------------------------------------------
  1472.   # ● 情報ウィンドウクラスの取得
  1473.   #--------------------------------------------------------------------------
  1474.   def info_window_class
  1475.     return Window_ZiifRollIconCommandName
  1476.   end
  1477.   #--------------------------------------------------------------------------
  1478.   # ● オブジェクトスプライトの作成
  1479.   #--------------------------------------------------------------------------
  1480.   def make_object_sprites
  1481.     @object_sprites[:info_window] = info_window_class.new(self)
  1482.     super
  1483.   end
  1484.   #--------------------------------------------------------------------------
  1485.   # ● コマンド内容の作成
  1486.   #--------------------------------------------------------------------------
  1487.   def create_contents
  1488.     super
  1489.     set_roll_value
  1490.   end
  1491.   #--------------------------------------------------------------------------
  1492.   # ● 回転値の設定
  1493.   #--------------------------------------------------------------------------
  1494.   def set_roll_value
  1495.     @move_size  = angle_difference
  1496.     @move_speed = roll_speed
  1497.   end
  1498.   #--------------------------------------------------------------------------
  1499.   # ● 動作中かどうか?
  1500.   #--------------------------------------------------------------------------
  1501.   def move?
  1502.     @move_type
  1503.   end
  1504.   #--------------------------------------------------------------------------
  1505.   # ● 停止中かどうか?
  1506.   #--------------------------------------------------------------------------
  1507.   def stop?
  1508.     !@move_type
  1509.   end
  1510.   #--------------------------------------------------------------------------
  1511.   # ● 位置移動の更新
  1512.   #--------------------------------------------------------------------------
  1513.   def update_move
  1514.     if move?
  1515.       @move_count -= 1
  1516.       @move_type   = nil if @move_count <= 0
  1517.       update_cursor
  1518.     end
  1519.   end
  1520.   #--------------------------------------------------------------------------
  1521.   # ● コマンドを右に回転
  1522.   #--------------------------------------------------------------------------
  1523.   def roll_right
  1524.     @index      = (@index + 1) % item_max
  1525.     @move_type  = :right
  1526.     @move_count = roll_count
  1527.     call_update_help
  1528.   end
  1529.   #--------------------------------------------------------------------------
  1530.   # ● コマンドを左に回転
  1531.   #--------------------------------------------------------------------------
  1532.   def roll_left
  1533.     @index      = (@index - 1 + item_max) % item_max
  1534.     @move_type  = :left
  1535.     @move_count = roll_count
  1536.     call_update_help
  1537.   end
  1538.   #--------------------------------------------------------------------------
  1539.   # ● 回転キーが押されているかどうか?
  1540.   #--------------------------------------------------------------------------
  1541.   def input_roll?(symbol)
  1542.     case $game_system.ziifop_roll_input_type
  1543.     when 0; return Input.press?(symbol)     # プレス
  1544.     when 1; return Input.trigger?(symbol)   # トリガー
  1545.     when 2; return Input.repeat?(symbol)    # リピート
  1546.     else  ; return Input.repeat?(symbol)
  1547.     end
  1548.   end
  1549.   #--------------------------------------------------------------------------
  1550.   # ● カーソルの移動前処理
  1551.   #--------------------------------------------------------------------------
  1552.   def process_before_cursor_move
  1553.     @cursor_sound_value = false
  1554.   end
  1555.   #--------------------------------------------------------------------------
  1556.   # ● カーソルの移動後処理
  1557.   #--------------------------------------------------------------------------
  1558.   def process_after_cursor_move
  1559.     Sound.play_cursor if @cursor_sound_value
  1560.   end
  1561.   #--------------------------------------------------------------------------
  1562.   # ● 右キーが押されているかどうか?
  1563.   #--------------------------------------------------------------------------
  1564.   def input_right?
  1565.     input_roll?(:RIGHT)
  1566.   end
  1567.   #--------------------------------------------------------------------------
  1568.   # ● 左キーが押されているかどうか?
  1569.   #--------------------------------------------------------------------------
  1570.   def input_left?
  1571.     input_roll?(:LEFT)
  1572.   end
  1573.   #--------------------------------------------------------------------------
  1574.   # ● カーソルを右に移動
  1575.   #--------------------------------------------------------------------------
  1576.   def cursor_right(wrap = false)
  1577.     reverse_roll? ? roll_left : roll_right
  1578.     @cursor_sound_value = true
  1579.   end
  1580.   #--------------------------------------------------------------------------
  1581.   # ● カーソルを左に移動
  1582.   #--------------------------------------------------------------------------
  1583.   def cursor_left(wrap = false)
  1584.     reverse_roll? ? roll_right : roll_left
  1585.     @cursor_sound_value = true
  1586.   end
  1587. end

RUBY 代码复制
  1. =begin ************************************************************************
  2.   ◆ 回転式バトルコマンド Ver.1.11
  3.   ---------------------------------------------------------------------------
  4.     バトルコマンドを回転式アイコンコマンドに変更します。
  5. =end # ************************************************************************
  6.  
  7. #-information------------------------------------------------------------------
  8. $ziifee ||= {}
  9. $ziifee[:RollBattleCommand] = true
  10. #------------------------------------------------------------------------------
  11. #-memo-------------------------------------------------------------------------
  12. #  [必要スクリプト]
  13. #    画像コマンドスクリプト (Ver.1.50以上)
  14. #  [必要画像] 以下の画像を Graphics/System にインポートしてください。
  15. #    バトルコマンド用背景画像 ( ファイル名 : Ring96x88 )
  16. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  17. #  このスクリプトは、画像コマンドスクリプトの下に入れてください。
  18. #  アイコンの変更は、画像コマンドスクリプトの中で行えます。
  19. #------------------------------------------------------------------------------
  20.  
  21. module ZiifRollBattleCommand
  22.   # ▼ コマンド表示後に表示位置を調整する ( true / false )
  23.   AdjustPartyWindow = true      # パーティウィンドウ
  24.   AdjustActorWindow = true      # アクターウィンドウ
  25. end
  26.  
  27. #******************************************************************************
  28. # ▼ 回転式コマンド導入部
  29. #******************************************************************************
  30.  
  31. class Window_PartyCommand; include ZiifSpriteCommand_RollIcon; end
  32. class Window_ActorCommand; include ZiifSpriteCommand_RollIcon; end
  33.  
  34. #******************************************************************************
  35. # ▼ レイアウト部
  36. #******************************************************************************
  37.  
  38. #==============================================================================
  39. # ■ Sprite_ZiifRollIconActorBattleCommand
  40. #==============================================================================
  41.  
  42. class Sprite_ZiifRollIconActorBattleCommand < Sprite_ZiifRollIconCommand
  43.   #--------------------------------------------------------------------------
  44.   # ● アイコン番号の取得
  45.   #--------------------------------------------------------------------------
  46.   def icon_index
  47.     if command_set.command_symbol(self.index) == :attack
  48.       return command_set.attack_icon_index
  49.     end
  50.     return super
  51.   end
  52. end
  53.  
  54. #==============================================================================
  55. # ■ Window_PartyCommand
  56. #==============================================================================
  57.  
  58. class Window_PartyCommand
  59.   #--------------------------------------------------------------------------
  60.   # ● 幅の取得
  61.   #--------------------------------------------------------------------------
  62.   def window_width
  63.     return 96
  64.   end
  65.   #--------------------------------------------------------------------------
  66.   # ● 高さの取得
  67.   #--------------------------------------------------------------------------
  68.   def window_height
  69.     return 88
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # ● 背景画像のファイル名を取得
  73.   #--------------------------------------------------------------------------
  74.   def background_filename
  75.     return "Ring96x88"
  76.   end
  77. end
  78.  
  79. #==============================================================================
  80. # ■ Window_ActorCommand
  81. #==============================================================================
  82.  
  83. class Window_ActorCommand
  84.   #--------------------------------------------------------------------------
  85.   # ● 幅の取得
  86.   #--------------------------------------------------------------------------
  87.   def window_width
  88.     return 96
  89.   end
  90.   #--------------------------------------------------------------------------
  91.   # ● 高さの取得
  92.   #--------------------------------------------------------------------------
  93.   def window_height
  94.     return 88
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # ● 背景画像のファイル名を取得
  98.   #--------------------------------------------------------------------------
  99.   def background_filename
  100.     return "Ring96x88"
  101.   end
  102.   #--------------------------------------------------------------------------
  103.   # ● スプライトコマンドクラスの取得
  104.   #--------------------------------------------------------------------------
  105.   def sprite_command_class
  106.     return Sprite_ZiifRollIconActorBattleCommand
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # ● 攻撃アイコン番号を取得
  110.   #--------------------------------------------------------------------------
  111.   def attack_icon_index
  112.     if @actor && !@actor.weapons.compact.empty?
  113.       return @actor.weapons.compact.first.icon_index
  114.     end
  115.     ZiifManager::IconSet[:attack][nil]
  116.   end
  117. end
  118.  
  119. #==============================================================================
  120. # ■ Scene_Battle
  121. #==============================================================================
  122.  
  123. class Scene_Battle
  124.   #--------------------------------------------------------------------------
  125.   # ● パーティコマンドウィンドウの作成
  126.   #--------------------------------------------------------------------------
  127.   alias :ziif_roll_battle_command_create_party_command_window :create_party_command_window
  128.   def create_party_command_window
  129.     ziif_roll_battle_command_create_party_command_window
  130.     if ZiifRollBattleCommand::AdjustPartyWindow
  131.       @party_command_window.x += 64
  132.       @party_command_window.y += 60
  133.     end
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # ● アクターコマンドウィンドウの作成
  137.   #--------------------------------------------------------------------------
  138.   alias :ziif_roll_battle_command_create_actor_command_window :create_actor_command_window
  139.   def create_actor_command_window
  140.     ziif_roll_battle_command_create_actor_command_window
  141.     if ZiifRollBattleCommand::AdjustActorWindow
  142.       @actor_command_window.x += 64
  143.       @actor_command_window.y += 60
  144.     end
  145.   end
  146. end
  

评分

参与人数 2星屑 +270 收起 理由
VIPArcher + 150 哦哦,感谢!
喵呜喵5 + 120 哦哦,感谢!

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
80 小时
注册时间
2009-10-11
帖子
22
5
 楼主| 发表于 2014-8-2 16:45:37 | 只看该作者
tseyik 发表于 2014-8-2 14:19
把下面二個圖片導入至Graphics/System(要好看請自作圖片)
Ring96x88.png

谢谢4楼的,你给我的脚本我以前用过,记得当时有问题发帖子问过,万年沉水了,好像是脚本236行错误.

点评

现在能用吗?  发表于 2014-8-2 16:52
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
80 小时
注册时间
2009-10-11
帖子
22
6
 楼主| 发表于 2014-8-2 16:53:17 | 只看该作者
本帖最后由 笑傲天 于 2014-8-2 16:55 编辑

不行,提示我236错误 这个脚本原帖我看过,楼主给的解决办法不行,我试过。发过帖子问过没解决....

点评

[url=home.php?mod=space&uid=291977]@height[/url] = height 改成@height = height  发表于 2014-8-2 16:54
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
80 小时
注册时间
2009-10-11
帖子
22
7
 楼主| 发表于 2014-8-2 16:57:32 | 只看该作者
笑傲天 发表于 2014-8-2 16:53
不行,提示我236错误 这个脚本原帖我看过,楼主给的解决办法不行,我试过。发过帖子问过没解决.... ...

3Q用你的方法解决了{:2_276:}
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-25 19:20

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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