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

Project1

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

技能分类中,DISABLE_ATTACK=[5,7,8]

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
0 小时
注册时间
2008-3-13
帖子
84
跳转到指定楼层
1
发表于 2008-3-18 02:35:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
DISABLE_ATTACK=[5,7,8]#无法攻击的战斗者


请问数字代表是什么意思?谢谢
版务信息:本贴由楼主自主结贴~

Lv1.梦旅人

WG后援团
此人已死 有事烧纸

梦石
0
星屑
69
在线时间
12 小时
注册时间
2008-1-12
帖子
1829

贵宾

2
发表于 2008-3-18 02:49:39 | 只看该作者
脚本拿出来晒下
郑重声明:
1.本人是文盲,以上内容文字均不认识,也看不懂是什么意思。
2.此事与本人一点关系都没有,只是本着“看贴(虽然看不懂)回贴,利人利己的中华民族优秀传统美德”,顺便赚1个RP。
3. 本人在此留言均为网络上复制,并不代表本人同意、支持或者反对楼主观点。  
4. 如本人留言违反国家有关法律,请网络管理员及时删除本人跟贴。  
5. 因删贴不及时所产生的任何法律(包括宪法,民法,刑法,书法,公检法,基本法,劳动法,婚姻法,输入法,没办法,国际法,今日说法,吸星大-法,与台湾关系法及文中涉及或可能涉及以及未涉及之法,各地治安管理条例)纠纷或责任本人概不负责。
6. 本人谢绝任何跨省追捕行为,如有需要请直接联系楼主、原作者以及网络管理员或法人代表。  
7. 此声明最终解释权归本人所有。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
0 小时
注册时间
2008-3-13
帖子
84
3
 楼主| 发表于 2008-3-18 03:09:46 | 只看该作者
DISABLE_ATTACK=[5,7,8]#无法攻击的战斗者
DISABLE_ITEM=[2,3,5]#无法使用物品的战斗者
DISABLE_ESCAPE=[3,2,5]#无法逃跑的战斗者,可以令比如说队长才能下令逃跑...


#==============================================================================
# ■ RPG追加定义,使用@符号分类
#==============================================================================

module RPG
class Skill
   def description
     description = @description.split(/@/)[0]
     return description != nil ? description : ''
   end
   def desc
     desc = @description.split(/@/)[1]
     return desc != nil ? desc : "技能"#普通技能的名字。可以改
   end
end
end

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


class Window_BattleCommand < Window_Selectable
  #--------------------------------------------------------------------------
  def initialize(actor=$game_party.actors[0])
    # 由命令的个数计算出窗口的高
    super(240, 240 , 160, 160)
    @actor=actor
    @item_max = 0
    @commands = []
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    if !DISABLE_ATTACK.include?(@actor.id)
      @commands.push "攻击"
    end
    for i in [email protected]
      skill = $data_skills[@actor.skills].desc
      if skill != nil and [email protected]?(skill)
        desc = ""
        desc += skill
        @commands.push(desc)
      end
    end
    @commands.push "防御"
    if !DISABLE_ITEM.include?(@actor.id)
      @commands.push "物品"
    end
    if !DISABLE_ESCAPE.include?(@actor.id)
      @commands.push "逃跑"
    end
    @item_max = @commands.size
    height = @item_max  * 32 + 32
    if height > 320
      height = 320
    end
    self.y = 320 - height
    self.height= height
    self.contents = Bitmap.new(width - 32, @item_max * 32)
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  def command
    return @commands[self.index]
  end
  #--------------------------------------------------------------------------
  # ● 描绘项目
  #     index : 项目编号
  #     color : 文字色
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index])
  end
  #--------------------------------------------------------------------------
  # ● 项目无效化
  #     index : 项目编号
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
end
#==============================================================================
# ■ Window_Skill
#------------------------------------------------------------------------------
#  战斗画面显示可以使用的特技浏览的窗口。
#==============================================================================

class Window_Skill_1 < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     actor : 角色
  #--------------------------------------------------------------------------
  def initialize(actor,desc)
     super(0, 128, 640, 352)
    @desc = desc
    @actor = actor
    @column_max = 2
    refresh
    self.index = 0
    # 战斗中的情况下将窗口移至中央并将其半透明化
    if $game_temp.in_battle
      self.y = 64
      self.height = 256
      self.back_opacity = 160
    end
  end
  #--------------------------------------------------------------------------
  # ● 获取特技
  #--------------------------------------------------------------------------
  def skill
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in [email protected]
      skill = $data_skills[@actor.skills]
      if skill != nil and $data_skills[@actor.skills].desc == @desc
        @data.push(skill)
      end
    end
    # 如果项目数不是 0 就生成位图、重新描绘全部项目
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 描绘项目
  #     index : 项目编号
  #--------------------------------------------------------------------------
  def draw_item(index)
    skill = @data[index]
    if @actor.skill_can_use?(skill.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(skill.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
    self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # ● 刷新帮助文本
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.skill == nil ? "" : self.skill.description)
  end
end


class Scene_Battle
    def main
    # 初始化战斗用的各种暂时数据
    $game_temp.in_battle = true
    $game_temp.battle_turn = 0
    $game_temp.battle_event_flags.clear
    $game_temp.battle_abort = false
    $game_temp.battle_main_phase = false
    $game_temp.battleback_name = $game_map.battleback_name
    $game_temp.forcing_battler = nil
    # 初始化战斗用事件解释器
    $game_system.battle_interpreter.setup(nil, 0)
    # 准备队伍
    @troop_id = $game_temp.battle_troop_id
    $game_troop.setup(@troop_id)
    # 生成角色命令窗口
    s1 = $data_system.words.attack
    s2 = $data_system.words.skill
    s3 = $data_system.words.guard
    s4 = $data_system.words.item
    @actor_command_window = Window_BattleCommand.new###只改这行……
    @actor_command_window.y = 160
    @actor_command_window.back_opacity = 160
    @actor_command_window.active = false
    @actor_command_window.visible = false
    # 生成其它窗口
    @party_command_window = Window_PartyCommand.new
    @help_window = Window_Help.new
    @help_window.back_opacity = 160
    @help_window.visible = false
    @status_window = Window_BattleStatus.new
    @message_window = Window_Message.new
    # 生成活动块
    @spriteset = Spriteset_Battle.new
    # 初始化等待计数
    @wait_count = 0
    # 执行过渡
    if $data_system.battle_transition == ""
      Graphics.transition(20)
    else
      Graphics.transition(40, "Graphics/Transitions/" +
        $data_system.battle_transition)
    end
    # 开始自由战斗回合
    start_phase1
    # 主循环
    loop do
      # 刷新游戏画面
      Graphics.update
      # 刷新输入信息
      Input.update
      # 刷新画面
      update
      # 如果画面切换的话就中断循环
      if $scene != self
        break
      end
    end
    # 刷新地图
    $game_map.refresh
    # 准备过渡
    Graphics.freeze
    # 释放窗口
    @actor_command_window.dispose
    @party_command_window.dispose
    @help_window.dispose
    @status_window.dispose
    @message_window.dispose
    if @skill_window != nil
      @skill_window.dispose
    end
    if @item_window != nil
      @item_window.dispose
    end
    if @result_window != nil
      @result_window.dispose
    end
    # 释放活动块
    @spriteset.dispose
    # 标题画面切换中的情况
    if $scene.is_a?(Scene_Title)
      # 淡入淡出画面
      Graphics.transition
      Graphics.freeze
    end
    # 战斗测试或者游戏结束以外的画面切换中的情况
    if $BTEST and not $scene.is_a?(Scene_Gameover)
      $scene = nil
    end
  end
  def phase3_setup_command_window
    # 同伴指令窗口无效化
    @party_command_window.active = false
    @party_command_window.visible = false
    @actor_command_window.dispose
    @actor_command_window=Window_BattleCommand.new(@active_battler)
    @actor_command_window.active = true
    @actor_command_window.visible = true
    # 设置角色指令窗口的位置
    @actor_command_window.x =  @actor_index * 160
    # 设置索引为 0
    @actor_command_window.index = 0
  end

  def update_phase3_basic_command
    # 按下 B 键的情况下
    if Input.trigger?(Input::B)
      # 演奏取消 SE
      $game_system.se_play($data_system.cancel_se)
      # 转向前一个角色的指令输入
      phase3_prior_actor
      return
    end
    # 按下 C 键的情况下
    if Input.trigger?(Input::C)
      # 角色指令窗口光标位置分之
      if @actor_command_window.command == "攻击"
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 设置行动
        @active_battler.current_action.kind = 0
        @active_battler.current_action.basic = 0
        # 开始选择敌人
        start_enemy_select
      elsif @actor_command_window.command == "防御"
       # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 设置行动
        @active_battler.current_action.kind = 0
        @active_battler.current_action.basic = 1
        # 转向下一位角色的指令输入
        phase3_next_actor
      elsif  @actor_command_window.command == "逃跑"
       # 不能逃跑的情况下
        if $game_temp.battle_can_escape == false
          # 演奏冻结 SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 逃走处理
        update_phase2_escape
      elsif @actor_command_window.command == "物品"
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 设置行动
        @active_battler.current_action.kind = 2
        # 开始选择物品
        start_item_select
      else
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 设置行动
        @active_battler.current_action.kind = 1
        # 开始选择特技
        start_skill_select
      end
      return
    end
  end
  def start_skill_select
    # 生成特技窗口
    @skill_window=Window_Skill_1.new(@active_battler, @actor_command_window.command)
    # 关联帮助窗口
    @skill_window.help_window = @help_window
    # 无效化角色指令窗口
    @actor_command_window.active = false
    @actor_command_window.visible = false
  end
end
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
0 小时
注册时间
2008-3-13
帖子
84
4
 楼主| 发表于 2008-3-18 03:10:12 | 只看该作者
谢谢
回复 支持 反对

使用道具 举报

Lv5.捕梦者

御灵的宠物

梦石
12
星屑
8481
在线时间
94 小时
注册时间
2006-12-11
帖子
3156

第2届TG大赛亚军

5
发表于 2008-3-18 03:12:17 | 只看该作者
代表5号,7号,8号角色不能使用普通攻击
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
我的Lofter:http://nightoye.lofter.com/

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
27 小时
注册时间
2008-2-13
帖子
1740
6
发表于 2008-3-18 03:14:50 | 只看该作者
楼上正解
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
0 小时
注册时间
2008-3-13
帖子
84
7
 楼主| 发表于 2008-3-18 03:19:23 | 只看该作者
谢谢,今天问了不少问题,大家都这么热情。

我感动,也超级喜欢这里的气氛。我也要加油。尽快能够解答别人的问题
回复 支持 反对

使用道具 举报

Lv5.捕梦者

御灵的宠物

梦石
12
星屑
8481
在线时间
94 小时
注册时间
2006-12-11
帖子
3156

第2届TG大赛亚军

8
发表于 2008-3-18 03:22:16 | 只看该作者
呵呵,LZ努力吧~
先期待你能做出够好的游戏
我的Lofter:http://nightoye.lofter.com/

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-25 20:39

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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