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

Project1

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

【RMXP】战斗菜单图标化

 关闭 [复制链接]

Lv1.梦旅人

魔星

梦石
0
星屑
50
在线时间
82 小时
注册时间
2007-7-29
帖子
707
跳转到指定楼层
1
发表于 2008-7-5 23:37:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我的游戏中逃跑也是一个选项(即 攻击 特技 防御 物品 逃跑 五个选项)

但是图标的战斗菜单脚本中只支持 攻击 特技 防御 物品 四个选项,脚本如下:

  1. #==========================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==========================================================================

  4. module Momo_IconCommand
  5.   # 图标名称设定
  6.   ATTACK_ICON_NAME = "001-Weapon01" # 攻撃
  7.   SKILL_ICON_NAME = "044-Skill01"   # 特技
  8.   GUARD_ICON_NAME = "009-Shield01"  # 防御
  9.   ITEM_ICON_NAME = "032-Item01"     # 物品
  10.   # X坐标修正
  11.   X_PLUS = -40
  12.   # Y坐标修正
  13.   Y_PLUS = -180
  14.   # 选择时图标的动作
  15.   # 0:静止 1:放大
  16.   SELECT_TYPE = 0
  17.   # 闪烁时光芒的颜色
  18.   FLASH_COLOR = Color.new(255, 255, 255, 128)
  19.   # 闪烁时间
  20.   FLASH_DURATION = 10
  21.   # 闪烁间隔
  22.   FLASH_INTERVAL = 20
  23.   # 是否写出文字的名称
  24.   COM_NAME_DROW = true
  25.   # 文字名称是否移动
  26.   COM_NAME_MOVE = true
  27.   # 文字内容
  28.   ATTACK_NAME = "攻击"    # 攻击
  29.   SKILL_NAME = "必杀技"   # 必杀技
  30.   GUARD_NAME = "防御"     # 防御
  31.   ITEM_NAME = "物品"     # 物品
  32.   # 文字颜色
  33.   COM_NAME_COLOR = Color.new(255, 255, 255, 255)
  34.   # 文字坐标修正
  35.   COM_NAME_X_PLUS = 0
  36.   COM_NAME_Y_PLUS = 0
  37. end

  38. class Window_CommandIcon < Window_Selectable
  39.   attr_accessor :last_index
  40.   #------------------------------------------------------------------------
  41.   # ● オブジェクト初期化
  42.   #------------------------------------------------------------------------
  43.   def initialize(x, y, commands)
  44.     super(x, y, 32, 32)
  45.     # ウィンドウスキンに空文字列を指定してウィンドウを描画しないようにする
  46.     self.windowskin = RPG::Cache.windowskin("")
  47.     @item_max = commands.size
  48.     @commands = commands
  49.     @column_max = commands.size
  50.     @index = 0
  51.     @last_index = nil
  52.     @name_sprite = nil
  53.     @sprite = []
  54.     refresh
  55.   end
  56.   def dispose
  57.     super
  58.     for sprite in @sprite
  59.       sprite.dispose unless sprite.nil?
  60.     end
  61.     @name_sprite.dispose unless @name_sprite.nil?
  62.   end
  63.   #------------------------------------------------------------------------
  64.   # ● リフレッシュ
  65.   #------------------------------------------------------------------------
  66.   def refresh
  67.     @name_sprite.dispose unless @name_sprite.nil?
  68.     for sprite in @sprite
  69.       sprite.dispose unless sprite.nil?
  70.     end
  71.     @name_sprite = nil
  72.     draw_com_name if Momo_IconCommand::COM_NAME_DROW
  73.     @sprite = []
  74.     for i in 0...@item_max
  75.       draw_item(i)
  76.     end
  77.   end
  78.   #------------------------------------------------------------------------
  79.   # ● 項目の描画
  80.   #------------------------------------------------------------------------
  81.   def draw_item(index)
  82.     @sprite[index] = Sprite_Icon.new(nil, @commands[index])
  83.     @sprite[index].z = self.z + 1
  84.   end
  85.   def draw_com_name
  86.     @name_sprite = Sprite_Comm_Name.new(nil, get_com_name)
  87.    
  88.   end
  89.   
  90.   # 更新
  91.   def update
  92.     super
  93.     icon_update
  94.     com_name_update if Momo_IconCommand::COM_NAME_DROW
  95.     if move_index?
  96.       @last_index = self.index
  97.     end
  98.   end
  99.   # アイコンの更新
  100.   def icon_update
  101.     for i in [email protected]
  102.       @sprite[i].active = (self.index == i)
  103.       @sprite[i].x = self.x + i * 24
  104.       @sprite[i].y = self.y + 0
  105.       @sprite[i].z = (self.index == i) ? self.z + 2 : self.z + 1
  106.       @sprite[i].visible = self.visible
  107.       @sprite[i].update
  108.     end
  109.   end
  110.   # コマンドネームの更新
  111.   def com_name_update
  112.     if move_index?
  113.       @name_sprite.name = get_com_name
  114.     end
  115.     @name_sprite.x = self.x - 12 + Momo_IconCommand::COM_NAME_X_PLUS
  116.     @name_sprite.y = self.y - 40 + Momo_IconCommand::COM_NAME_Y_PLUS
  117.     @name_sprite.z = self.z + 1
  118.     @name_sprite.active = self.active
  119.     @name_sprite.visible = self.visible
  120.     @name_sprite.update
  121.   end
  122.   def get_com_name
  123.     make_name_set if @name_set.nil?
  124.     name = @name_set[self.index]
  125.     name = "" if name.nil?
  126.     return name
  127.   end
  128.   def make_name_set
  129.     @name_set = []
  130.     @name_set[0] = Momo_IconCommand::ATTACK_NAME
  131.     @name_set[1] = Momo_IconCommand::SKILL_NAME
  132.     @name_set[2] = Momo_IconCommand::GUARD_NAME
  133.     @name_set[3] = Momo_IconCommand::ITEM_NAME
  134.   end
  135.   def move_index?
  136.     return self.index != @last_index
  137.   end
  138.   def need_reset
  139.     @name_sprite.need_reset = true if Momo_IconCommand::COM_NAME_DROW
  140.   end
  141. end

  142. # アイコン用スプライト
  143. class Sprite_Icon < Sprite
  144.   attr_accessor :active
  145.   attr_accessor :icon_name
  146.   #------------------------------------------------------------------------
  147.   # ● オブジェクト初期化
  148.   #------------------------------------------------------------------------
  149.   def initialize(viewport, icon_name)
  150.     super(viewport)
  151.     @icon_name = icon_name
  152.     @last_icon = @icon_name
  153.     @count = 0
  154.     self.bitmap = RPG::Cache.icon(@icon_name)
  155.     self.ox = self.bitmap.width / 2
  156.     self.oy = self.bitmap.height / 2
  157.     @active = false
  158.   end
  159.   #------------------------------------------------------------------------
  160.   # ● 解放
  161.   #------------------------------------------------------------------------
  162.   def dispose
  163.     if self.bitmap != nil
  164.       self.bitmap.dispose
  165.     end
  166.     super
  167.   end
  168.   #------------------------------------------------------------------------
  169.   # ● フレーム更新
  170.   #------------------------------------------------------------------------
  171.   def update
  172.     super
  173.     if @icon_name != @last_icon
  174.       @last_icon = @icon_name
  175.       self.bitmap = RPG::Cache.icon(@icon_name)
  176.     end
  177.     if @active
  178.       @count += 1
  179.       case Momo_IconCommand::SELECT_TYPE
  180.       when 0
  181.         icon_flash
  182.       when 1
  183.         icon_zoom
  184.       end
  185.       @count = 0 if @count == 20
  186.     else
  187.       icon_reset
  188.     end
  189.   end
  190.   def icon_flash
  191.     if @count % Momo_IconCommand::FLASH_INTERVAL == 0 or @count == 1
  192.       self.flash(Momo_IconCommand::FLASH_COLOR, Momo_IconCommand::FLASH_DURATION)
  193.     end
  194.   end
  195.   def icon_zoom
  196.     case @count
  197.     when 1..10
  198.       zoom = 1.0 + @count / 10.0
  199.     when 11..20
  200.       zoom = 2.0 - (@count - 10) / 10.0
  201.     end
  202.     self.zoom_x = zoom
  203.     self.zoom_y = zoom
  204.   end
  205.   def icon_reset
  206.     @count = 0
  207.     self.zoom_x = 1.0
  208.     self.zoom_y = 1.0
  209.   end
  210. end

  211. # コマンドネーム用スプライト
  212. class Sprite_Comm_Name < Sprite
  213.   attr_accessor :active
  214.   attr_accessor :name
  215.   attr_accessor :need_reset
  216.   #------------------------------------------------------------------------
  217.   # ● オブジェクト初期化
  218.   #------------------------------------------------------------------------
  219.   def initialize(viewport, name)
  220.     super(viewport)
  221.     @name = name
  222.     @last_name = nil
  223.     @count = 0
  224.     @x_plus = 0
  225.     @opa_plus = 0
  226.     @need_reset = false
  227.     @active = false
  228.     self.bitmap = Bitmap.new(160, 32)
  229.   end
  230.   #------------------------------------------------------------------------
  231.   # ● 解放
  232.   #------------------------------------------------------------------------
  233.   def dispose
  234.     if self.bitmap != nil
  235.       self.bitmap.dispose
  236.     end
  237.     super
  238.   end
  239.   #------------------------------------------------------------------------
  240.   # ● フレーム更新
  241.   #------------------------------------------------------------------------
  242.   def update
  243.     super
  244.     if @active
  245.       if need_reset?
  246.         @need_reset = false
  247.         @last_name = @name
  248.         text_reset
  249.       end
  250.       move_text if Momo_IconCommand::COM_NAME_MOVE
  251.     end
  252.   end
  253.   def move_text
  254.     @count += 1
  255.     @x_plus = [@count * 8, 80].min
  256.     self.x = self.x - 80 + @x_plus
  257.     self.opacity = @count * 25
  258.   end
  259.   def text_reset
  260.     @count = 0
  261.     @x_plus = 0
  262.     self.bitmap.clear
  263.     self.bitmap.font.color = Momo_IconCommand::COM_NAME_COLOR
  264.     self.bitmap.draw_text(0, 0, 160, 32, @name)
  265.   end
  266.   def need_reset?
  267.     return (@name != @last_name or @need_reset)
  268.   end
  269. end

  270. class Scene_Battle
  271.   #------------------------------------------------------------------------
  272.   # ● プレバトルフェーズ開始
  273.   #------------------------------------------------------------------------
  274.   alias scene_battle_icon_command_start_phase1 start_phase1
  275.   def start_phase1
  276.     com1 = Momo_IconCommand::ATTACK_ICON_NAME
  277.     com2 = Momo_IconCommand::SKILL_ICON_NAME
  278.     com3 = Momo_IconCommand::GUARD_ICON_NAME
  279.     com4 = Momo_IconCommand::ITEM_ICON_NAME
  280.     @actor_command_window = Window_CommandIcon.new(0, 0, [com1, com2, com3, com4])
  281.     @actor_command_window.y = 160
  282.     @actor_command_window.back_opacity = 160
  283.     @actor_command_window.active = false
  284.     @actor_command_window.visible = false
  285.     @actor_command_window.update
  286.     scene_battle_icon_command_start_phase1
  287.   end
  288.   #------------------------------------------------------------------------
  289.   # ● アクターコマンドウィンドウのセットアップ
  290.   #------------------------------------------------------------------------
  291.   alias scene_battle_icon_command_phase3_setup_command_window phase3_setup_command_window
  292.   def phase3_setup_command_window
  293.     scene_battle_icon_command_phase3_setup_command_window
  294.     # アクターコマンドウィンドウの位置を設定
  295.     @actor_command_window.x = command_window_actor_x(@actor_index)
  296.     @actor_command_window.y = command_window_actor_y(@actor_index)
  297.     @actor_command_window.need_reset
  298.   end
  299.   def command_window_actor_x(index)
  300.     $game_party.actors[index].screen_x + Momo_IconCommand::X_PLUS
  301.   end
  302.   def command_window_actor_y(index)
  303.     $game_party.actors[index].screen_y + Momo_IconCommand::Y_PLUS
  304.   end
  305. end

  306. #==========================================================================
  307. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  308. #==========================================================================
复制代码


有没有哪个脚本高手能帮我给改成支持五个选项的?或者告诉我方法?

我的QQ:274804163
版务信息:本贴由楼主自主结贴~

                                                             『点击图片进入周小瑜的个人空间』

Lv1.梦旅人

魔星

梦石
0
星屑
50
在线时间
82 小时
注册时间
2007-7-29
帖子
707
2
 楼主| 发表于 2008-7-5 23:40:34 | 只看该作者
另外  我的逃跑选项使用CP制御脚本加进来的  大家懂的可以看看

  1. …………
  2. #==============================================================================
  3. # ■ Scene_Battle
  4. #==============================================================================
  5. class Scene_Battle
  6.   #--------------------------------------------------------------------------
  7.   # ● メイン処理
  8.   #--------------------------------------------------------------------------
  9.   alias xrxs65_main main
  10.   def main
  11.     # エクストラスプライトの初期化
  12.     @extra_sprites = [] if @extra_sprites == nil
  13.     # CP の初期化
  14.     cp_preset_party
  15.     # CP メーターの作成
  16.     @cp_meters = CP_Meters.new
  17.     # CP メーターをエクストラスプライトへ登録
  18.     @extra_sprites.push(@cp_meters)
  19.     # 呼び戻す
  20.     xrxs65_main
  21.     # メーターの解放
  22.     @cp_meters.dispose
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   # ● プレバトルフェーズ開始
  26.   #--------------------------------------------------------------------------
  27.   alias xrxs65_start_phase1 start_phase1
  28.   def start_phase1
  29.     # 呼び戻す
  30.     xrxs65_start_phase1
  31.     # CP の初期化
  32.     cp_preset_troop
  33.     # CP メーターの更新
  34.     @cp_meters.refresh
  35.     # インデックスを計算
  36.     @cp_escape_actor_command_index = @actor_command_window.height/32 - 1
  37.     # アクターコマンドウィンドウに追加
  38.     @actor_command_window.add_command("逃跑")
  39.     if !$game_temp.battle_can_escape
  40.       @actor_command_window.disable_item(@cp_escape_actor_command_index)
  41.     end
  42.   end
  43. …………
复制代码

                                                             『点击图片进入周小瑜的个人空间』
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

喵,小柯的宠物

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-4-6
帖子
1277
3
发表于 2008-7-5 23:43:10 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

蚂蚁卡卡

梦石
0
星屑
116
在线时间
66 小时
注册时间
2007-12-16
帖子
3081
4
发表于 2008-7-6 00:07:31 | 只看该作者
  1. #==========================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==========================================================================

  4. module Momo_IconCommand
  5.   # 图标名称设定
  6.   ATTACK_ICON_NAME = "atk" # 攻撃
  7.   SKILL_ICON_NAME = "mag"   # 特技
  8.   GUARD_ICON_NAME = "def"  # 防御
  9.   ITEM_ICON_NAME = "itm"     # 物品
  10.   ESCAPE_ICON_NAME = "esc"   # 逃跑
  11.   # X坐标修正
  12.   X_PLUS = -40
  13.   # Y坐标修正
  14.   Y_PLUS = -180
  15.   # 选择时图标的动作
  16.   # 0:静止 1:放大
  17.   SELECT_TYPE = 0
  18.   # 闪烁时光芒的颜色
  19.   FLASH_COLOR = Color.new(255, 255, 255, 128)
  20.   # 闪烁时间
  21.   FLASH_DURATION = 10
  22.   # 闪烁间隔
  23.   FLASH_INTERVAL = 20
  24.   # 是否写出文字的名称
  25.   COM_NAME_DROW = true
  26.   # 文字名称是否移动
  27.   COM_NAME_MOVE = true
  28.   # 文字内容
  29.   ATTACK_NAME = "攻击"    # 攻击
  30.   SKILL_NAME = "仙术"   # 特技
  31.   GUARD_NAME = "防御"     # 防御
  32.   ITEM_NAME = "物品"  # 物品
  33.   ESCAPE_NAME = "逃跑"  #逃跑
  34.   # 文字颜色
  35.   COM_NAME_COLOR = Color.new(255, 255, 255, 255)
  36.   # 文字坐标修正
  37.   COM_NAME_X_PLUS = 0
  38.   COM_NAME_Y_PLUS = 0
  39. end

  40. class Window_CommandIcon < Window_Selectable
  41.   attr_accessor :last_index
  42.   #------------------------------------------------------------------------
  43.   # ● オブジェクト初期化
  44.   #------------------------------------------------------------------------
  45.   def initialize(x, y, commands)
  46.     super(x, y, 32, 32)
  47.     # ウィンドウスキンに空文字列を指定してウィンドウを描画しないようにする
  48.     self.windowskin = RPG::Cache.windowskin("")
  49.     @item_max = commands.size
  50.     @commands = commands
  51.     @column_max = 1
  52.     @index_max = 0
  53.     @last_index = nil
  54.     @name_sprite = nil
  55.     @sprite = []
  56.     refresh
  57.   end
  58.   def dispose
  59.     super
  60.     for sprite in @sprite
  61.       sprite.dispose unless sprite.nil?
  62.     end
  63.     @name_sprite.dispose unless @name_sprite.nil?
  64.   end
  65.   #------------------------------------------------------------------------
  66.   # ● リフレッシュ
  67.   #------------------------------------------------------------------------
  68.   def refresh
  69.     @name_sprite.dispose unless @name_sprite.nil?
  70.     for sprite in @sprite
  71.       sprite.dispose unless sprite.nil?
  72.     end
  73.     @name_sprite = nil
  74.     draw_com_name if Momo_IconCommand::COM_NAME_DROW
  75.     @sprite = []
  76.     for i in 0...@item_max
  77.       draw_item(i)
  78.     end
  79.   end
  80.   #------------------------------------------------------------------------
  81.   # ● 項目の描画
  82.   #------------------------------------------------------------------------
  83.   def draw_item(index)
  84.     @sprite[index] = Sprite_Icon.new(nil, @commands[index])
  85.     @sprite[index].z = self.z + 1
  86.   end
  87.   def draw_com_name
  88.     @name_sprite = Sprite_Comm_Name.new(nil, get_com_name)
  89.   end
  90.   
  91.   # 更新
  92.   def update
  93.     super
  94.     icon_update
  95.     com_name_update if Momo_IconCommand::COM_NAME_DROW
  96. #    if move_index?
  97.     # 判断当前光标位置
  98.     case @last_index
  99.      when 0 # 攻击
  100.       # 方向键下被按下的情况下
  101.       if Input.repeat?(Input::DOWN)
  102.           # 光标指向物品
  103.           $game_system.se_play($data_system.cursor_se)
  104.           @index = 3      
  105.       end
  106.       # 方向键上被按下的情况下
  107.       if Input.repeat?(Input::UP)
  108.         # 光标指向逃跑
  109.           $game_system.se_play($data_system.cursor_se)
  110.           @index = 4      
  111.       end
  112.       # 方向键右被按下的情况下
  113.       if Input.repeat?(Input::RIGHT)
  114.           # 光标指向防御
  115.           $game_system.se_play($data_system.cursor_se)
  116.           @index = 2      
  117.       end
  118.       # 方向键左被按下的情况下
  119.       if Input.repeat?(Input::LEFT)
  120.         # 光标指向法术
  121.           $game_system.se_play($data_system.cursor_se)
  122.           @index = 1
  123.       end
  124.      when 1 # 法术
  125.       # 方向键下被按下的情况下
  126.       if Input.repeat?(Input::DOWN)
  127.           # 光标指向物品
  128.           $game_system.se_play($data_system.cursor_se)
  129.           @index = 3      
  130.       end
  131.       # 方向键上被按下的情况下
  132.       if Input.repeat?(Input::UP)
  133.         # 光标指向逃跑
  134.           $game_system.se_play($data_system.cursor_se)
  135.           @index = 4      
  136.       end
  137.       # 方向键右被按下的情况下
  138.       if Input.repeat?(Input::RIGHT)
  139.           # 光标指向攻击
  140.           $game_system.se_play($data_system.cursor_se)
  141.           @index = 0      
  142.       end
  143.       # 方向键左被按下的情况下
  144.       if Input.repeat?(Input::LEFT)
  145.         # 光标指向法术
  146.           $game_system.se_play($data_system.cursor_se)
  147.           @index = 1
  148.       end
  149.      when 2 # 防御
  150.       # 方向键下被按下的情况下
  151.       if Input.repeat?(Input::DOWN)
  152.           # 光标指向物品
  153.           $game_system.se_play($data_system.cursor_se)
  154.           @index = 3      
  155.       end
  156.       # 方向键上被按下的情况下
  157.       if Input.repeat?(Input::UP)
  158.         # 光标指向逃跑
  159.           $game_system.se_play($data_system.cursor_se)
  160.           @index = 4      
  161.       end
  162.       # 方向键右被按下的情况下
  163.       if Input.repeat?(Input::RIGHT)
  164.           # 光标指向防御
  165.           $game_system.se_play($data_system.cursor_se)
  166.           @index = 2      
  167.       end
  168.       # 方向键左被按下的情况下
  169.       if Input.repeat?(Input::LEFT)
  170.         # 光标指向攻击
  171.           $game_system.se_play($data_system.cursor_se)
  172.           @index = 0
  173.       end
  174.      when 3 # 物品
  175.       # 方向键下被按下的情况下
  176.       if Input.repeat?(Input::DOWN)
  177.           # 光标指向物品
  178.           $game_system.se_play($data_system.cursor_se)
  179.           @index = 3      
  180.       end
  181.       # 方向键上被按下的情况下
  182.       if Input.repeat?(Input::UP)
  183.         # 光标指向攻击
  184.           $game_system.se_play($data_system.cursor_se)
  185.           @index = 0      
  186.       end
  187.       # 方向键右被按下的情况下
  188.       if Input.repeat?(Input::RIGHT)
  189.           # 光标指向防御
  190.           $game_system.se_play($data_system.cursor_se)
  191.           @index = 2      
  192.       end
  193.       # 方向键左被按下的情况下
  194.       if Input.repeat?(Input::LEFT)
  195.         # 光标指向法术
  196.           $game_system.se_play($data_system.cursor_se)
  197.           @index = 1
  198.       end
  199.      when 4 # 逃跑
  200.       # 方向键下被按下的情况下
  201.       if Input.repeat?(Input::DOWN)
  202.           # 光标指向攻击
  203.           $game_system.se_play($data_system.cursor_se)
  204.           @index = 0      
  205.       end
  206.       # 方向键上被按下的情况下
  207.       if Input.repeat?(Input::UP)
  208.         # 光标指向逃跑
  209.           $game_system.se_play($data_system.cursor_se)
  210.           @index = 4      
  211.       end
  212.       # 方向键右被按下的情况下
  213.       if Input.repeat?(Input::RIGHT)
  214.           # 光标指向防御
  215.           $game_system.se_play($data_system.cursor_se)
  216.           @index = 2      
  217.       end
  218.       # 方向键左被按下的情况下
  219.       if Input.repeat?(Input::LEFT)
  220.         # 光标指向法术
  221.           $game_system.se_play($data_system.cursor_se)
  222.           @index = 1
  223.       end
  224.     end      
  225.       @last_index = self.index
  226. #    end
  227.   end

  228.   # アイコンの更新
  229.   def icon_update
  230.     for i in [email protected]
  231.       @sprite[i].active = (self.index == i)
  232.       @sprite[0].x = 104 #self.x + i * 24
  233.       @sprite[0].y = 280         #self.y + 0
  234.       @sprite[1].x = 40
  235.       @sprite[1].y = 280
  236.       @sprite[2].x = 168
  237.       @sprite[2].y = 280      
  238.       @sprite[3].x = 104
  239.       @sprite[3].y = 330      
  240.       @sprite[4].x = 104
  241.       @sprite[4].y = 230
  242.       @sprite[i].z = 9999
  243.       #      @sprite[i].z = (self.index == i) ? self.z + 2 : self.z + 1
  244.       @sprite[i].visible = self.visible
  245.       @sprite[i].update
  246.     end
  247.   end
  248.   # コマンドネームの更新
  249.   def com_name_update
  250. #    if move_index?
  251.       @name_sprite.name = get_com_name
  252. #    end
  253.     @name_sprite.x = 80 #self.x - 12 + Momo_IconCommand::COM_NAME_X_PLUS
  254.     @name_sprite.y = 350 #self.y - 40 + Momo_IconCommand::COM_NAME_Y_PLUS
  255.     @name_sprite.z = 9998 #self.z + 1
  256.     @name_sprite.active = self.active
  257.     @name_sprite.visible = self.visible
  258.     @name_sprite.update
  259.   end
  260.   def get_com_name
  261.     make_name_set if @name_set.nil?
  262.     name = @name_set[self.index]   
  263.     name = "" if name.nil?
  264.     return name
  265.   end
  266.   def make_name_set
  267.     @name_set = []
  268.     @name_set[0] = Momo_IconCommand::ATTACK_NAME
  269.     @name_set[1] = Momo_IconCommand::SKILL_NAME
  270.     @name_set[2] = Momo_IconCommand::GUARD_NAME
  271.     @name_set[3] = Momo_IconCommand::ITEM_NAME
  272.     @name_set[4] = Momo_IconCommand::ESCAPE_NAME
  273.   end
  274.   def move_index?
  275.     return self.index != @last_index
  276.   end
  277.   def need_reset
  278.     @name_sprite.need_reset = true if Momo_IconCommand::COM_NAME_DROW
  279.   end
  280. end

  281. # アイコン用スプライト
  282. class Sprite_Icon < Sprite
  283.   attr_accessor :active
  284.   attr_accessor :icon_name
  285.   #------------------------------------------------------------------------
  286.   # ● オブジェクト初期化
  287.   #------------------------------------------------------------------------
  288.   def initialize(viewport, icon_name)
  289.     super(viewport)
  290.     @icon_name = icon_name
  291.     @last_icon = @icon_name
  292.     @count = 0
  293.     self.bitmap = RPG::Cache.icon(@icon_name)
  294.     self.ox = self.bitmap.width / 2
  295.     self.oy = self.bitmap.height / 2
  296.     @active = false
  297.   end
  298.   #------------------------------------------------------------------------
  299.   # ● 解放
  300.   #------------------------------------------------------------------------
  301.   def dispose
  302.     if self.bitmap != nil
  303.       self.bitmap.dispose
  304.     end
  305.     super
  306.   end
  307.   #------------------------------------------------------------------------
  308.   # ● フレーム更新
  309.   #------------------------------------------------------------------------
  310.   def update
  311.     super
  312.     if @icon_name != @last_icon
  313.       @last_icon = @icon_name
  314.       self.bitmap = RPG::Cache.icon(@icon_name)
  315.     end
  316.     if @active
  317.       @count += 1
  318.       case Momo_IconCommand::SELECT_TYPE
  319.       when 0
  320.         icon_flash
  321.       when 1
  322.         icon_zoom
  323.       end
  324.       @count = 0 if @count == 20
  325.     else
  326.       icon_reset
  327.     end
  328.   end
  329.   def icon_flash
  330.     if @count % Momo_IconCommand::FLASH_INTERVAL == 0 or @count == 2
  331.       self.flash(Momo_IconCommand::FLASH_COLOR, Momo_IconCommand::FLASH_DURATION)
  332.     end
  333.   end
  334.   def icon_zoom
  335.     case @count
  336.     when 1..10
  337.       zoom = 1.0 + @count / 10.0
  338.     when 11..20
  339.       zoom = 2.0 - (@count - 10) / 10.0
  340.     end
  341.     self.zoom_x = zoom
  342.     self.zoom_y = zoom
  343.   end
  344.   def icon_reset
  345.     @count = 0
  346.     self.zoom_x = 1.0
  347.     self.zoom_y = 1.0
  348.   end
  349. end

  350. # コマンドネーム用スプライト
  351. class Sprite_Comm_Name < Sprite
  352.   attr_accessor :active
  353.   attr_accessor :name
  354.   attr_accessor :need_reset
  355.   #------------------------------------------------------------------------
  356.   # ● オブジェクト初期化
  357.   #------------------------------------------------------------------------
  358.   def initialize(viewport, name)
  359.     super(viewport)
  360.     @name = name
  361.     @last_name = nil
  362.     @count = 0
  363.     @x_plus = 0
  364.     @opa_plus = 0
  365.     @need_reset = false
  366.     @active = false
  367.     self.bitmap = Bitmap.new(160, 32)
  368.   end
  369.   #------------------------------------------------------------------------
  370.   # ● 解放
  371.   #------------------------------------------------------------------------
  372.   def dispose
  373.     if self.bitmap != nil
  374.       self.bitmap.dispose
  375.     end
  376.     super
  377.   end

  378.   #------------------------------------------------------------------------
  379.   # ● フレーム更新
  380.   #------------------------------------------------------------------------
  381.   def update
  382.     super
  383.     if @active
  384.       if need_reset?
  385.         @need_reset = false
  386.         @last_name = @name
  387.         text_reset
  388.       end
  389.       move_text if Momo_IconCommand::COM_NAME_MOVE
  390.     end
  391.   end
  392.   def move_text
  393.     @count += 1
  394.     @x_plus = [@count * 8, 80].min
  395.     self.x = self.x - 80 + @x_plus
  396.     self.opacity = @count * 25
  397.   end
  398.   def text_reset
  399.     @count = 0
  400.     @x_plus = 0
  401.     self.bitmap.clear
  402.     self.bitmap.font.color = Momo_IconCommand::COM_NAME_COLOR
  403.     self.bitmap.draw_text(0, 0, 160, 32, @name)
  404.   end
  405.   def need_reset?
  406.     return (@name != @last_name or @need_reset)
  407.   end
  408. end

  409. class Scene_Battle
  410.   #------------------------------------------------------------------------
  411.   # ● プレバトルフェーズ開始
  412.   #------------------------------------------------------------------------
  413.   alias scene_battle_icon_command_start_phase1 start_phase1
  414.   def start_phase1
  415.     com1 = Momo_IconCommand::ATTACK_ICON_NAME
  416.     com2 = Momo_IconCommand::SKILL_ICON_NAME
  417.     com3 = Momo_IconCommand::GUARD_ICON_NAME
  418.     com4 = Momo_IconCommand::ITEM_ICON_NAME
  419.     com5 = Momo_IconCommand::ESCAPE_ICON_NAME
  420.     @actor_command_window = Window_CommandIcon.new(0, 0, [com1, com2, com3, com4, com5])
  421.     @actor_command_window.y = 128
  422.     @actor_command_window.back_opacity = 160
  423.     @actor_command_window.active = false
  424.     @actor_command_window.visible = false
  425.     @actor_command_window.update
  426.     scene_battle_icon_command_start_phase1
  427.   end
  428.   #------------------------------------------------------------------------
  429.   # ● アクターコマンドウィンドウのセットアップ
  430.   #------------------------------------------------------------------------
  431.   alias scene_battle_icon_command_phase3_setup_command_window phase3_setup_command_window
  432.   def phase3_setup_command_window
  433.     scene_battle_icon_command_phase3_setup_command_window
  434.     # アクターコマンドウィンドウの位置を設定
  435.     @actor_command_window.x = command_window_actor_x(@actor_index)
  436.     @actor_command_window.y = command_window_actor_y(@actor_index)
  437.     @actor_command_window.need_reset
  438.   end
  439.   def command_window_actor_x(index)
  440.     $game_party.actors[index].screen_x + Momo_IconCommand::X_PLUS
  441.   end
  442.   def command_window_actor_y(index)
  443.     $game_party.actors[index].screen_y + Momo_IconCommand::Y_PLUS
  444.   end
  445. end
  446. #==========================================================================
  447. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  448. #==========================================================================
复制代码


来自游戏度尘凡

系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
《隋唐乱》完整解密版点击进入
米兰,让我怎么说离开……

曾经我也是一个有志青年,直到我膝盖中了一箭……

《隋唐乱》博客地址
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

精灵族の天使

梦石
0
星屑
1707
在线时间
3039 小时
注册时间
2007-3-16
帖子
33731

开拓者贵宾

5
发表于 2008-7-6 03:30:17 | 只看该作者
精灵:以前我曾经用过添加逃跑选项的图标脚本的,可惜偏偏和那个cp的冲突- -
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-23
帖子
675
6
发表于 2008-7-6 04:29:37 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

魔星

梦石
0
星屑
50
在线时间
82 小时
注册时间
2007-7-29
帖子
707
7
 楼主| 发表于 2008-7-6 04:41:54 | 只看该作者
谢谢大家
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

精灵族の天使

梦石
0
星屑
1707
在线时间
3039 小时
注册时间
2007-3-16
帖子
33731

开拓者贵宾

8
发表于 2008-7-6 04:42:33 | 只看该作者
别忘记结帖啊。
已帮你转移。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-8-8 13:51

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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