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

Project1

 找回密码
 注册会员
搜索
12
返回列表 发新帖
楼主: linwsh123
打印 上一主题 下一主题

[已经过期] 求大神添加一个 特技,关于普通攻击,

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
15 小时
注册时间
2015-7-7
帖子
23
11
 楼主| 发表于 2015-7-13 10:27:40 | 只看该作者
冰水金刚 发表于 2015-7-8 17:02
脚本修改后重发
#==============================================================================
#     ...

如图所示

111.jpg (38.09 KB, 下载次数: 2)

如图

如图
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
15 小时
注册时间
2015-7-7
帖子
23
12
 楼主| 发表于 2015-7-13 10:32:27 | 只看该作者
邪月长啸 发表于 2015-7-8 12:38

谢谢,  你这个是攻击同一个人2次的。  我想要的效果是 数据库中某个“职业”的普通攻击能攻击2次且不是攻击同一个人。

点评

就是类似吞食改版(猛将传)里的刀,弓类武器,可以依次攻击3-5次?  发表于 2015-7-13 13:04
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
15 小时
注册时间
2015-7-7
帖子
23
13
 楼主| 发表于 2015-7-13 10:33:15 | 只看该作者
冰水金刚 发表于 2015-7-8 17:02
脚本修改后重发
#==============================================================================
#     ...

  我想要的效果是 数据库中某个“职业”的普通攻击能攻击2次且不是攻击同一个人。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
165
在线时间
809 小时
注册时间
2013-8-23
帖子
804

开拓者

14
发表于 2015-7-13 11:30:46 | 只看该作者
RUBY 代码复制
  1. #用于角色特定职业普通攻击可攻击2个对象(1个选定,另一个随机)by 冰水金刚
  2. #复制脚本,插入到 main 前。
  3. #脚本第38行填写职业id
  4. class Scene_Battle
  5.   #--------------------------------------------------------------------------
  6.   # ● 生成基本行动结果
  7.   #--------------------------------------------------------------------------
  8.   def make_basic_action_result
  9.     # 攻击的情况下
  10.     if @active_battler.current_action.basic == 0
  11.       # 设置攻击 ID
  12.       @animation1_id = @active_battler.animation1_id
  13.       @animation2_id = @active_battler.animation2_id
  14.       # 行动方的战斗者是敌人的情况下
  15.       if @active_battler.is_a?(Game_Enemy)
  16.         if @active_battler.restriction == 3
  17.           target = $game_troop.random_target_enemy
  18.         elsif @active_battler.restriction == 2
  19.           target = $game_party.random_target_actor
  20.         else
  21.           index = @active_battler.current_action.target_index
  22.           target = $game_party.smooth_target_actor(index)
  23.         end
  24.       end
  25.       # 行动方的战斗者是角色的情况下
  26.       if @active_battler.is_a?(Game_Actor)
  27.         if @active_battler.restriction == 3
  28.           target = $game_party.random_target_actor
  29.         elsif @active_battler.restriction == 2
  30.           target = $game_troop.random_target_enemy
  31.         else
  32.           index = @active_battler.current_action.target_index
  33.           target = $game_troop.smooth_target_enemy(index)
  34.           target2 = $game_troop.random_target_enemy2(index)
  35.         end
  36.       end
  37.       # 职业判定
  38.       if @active_battler.class_id == 1    #(这行输入职业id)
  39.         # 设置对像方的战斗者序列
  40.         @target_battlers = [target,target2]
  41.         # 应用通常攻击效果
  42.         a = 1
  43.         for target in @target_battlers
  44.           if a == 2
  45.             break
  46.           end
  47.           a += 1
  48.           if target2 == nil
  49.             if target != nil
  50.               target.attack_effect(@active_battler)
  51.             end
  52.           else
  53.             if target != nil
  54.               target.attack_effect(@active_battler)
  55.             end
  56.             target2.attack_effect(@active_battler)
  57.           end
  58.         end
  59.         return
  60.       else
  61.         # 设置对像方的战斗者序列
  62.         @target_battlers = [target]
  63.         # 应用通常攻击效果
  64.         for target in @target_battlers
  65.           target.attack_effect(@active_battler)
  66.         end
  67.         return
  68.       end
  69.     end
  70.     # 防御的情况下
  71.     if @active_battler.current_action.basic == 1
  72.       # 帮助窗口显示"防御"
  73.       @help_window.set_text($data_system.words.guard, 1)
  74.       return
  75.     end
  76.     # 逃跑的情况下
  77.     if @active_battler.is_a?(Game_Enemy) and
  78.        @active_battler.current_action.basic == 2
  79.       #  帮助窗口显示"逃跑"
  80.       @help_window.set_text("逃跑", 1)
  81.       # 逃跑
  82.       @active_battler.escape
  83.       return
  84.     end
  85.     # 什么也不做的情况下
  86.     if @active_battler.current_action.basic == 3
  87.       # 清除强制行动对像的战斗者
  88.       $game_temp.forcing_battler = nil
  89.       # 移至步骤 1
  90.       @phase4_step = 1
  91.       return
  92.     end
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # ● 刷新画面 (主回合步骤 4 : 对像方动画)
  96.   #--------------------------------------------------------------------------
  97.   def update_phase4_step4
  98.     # 对像方动画
  99.     for target in @target_battlers
  100.       if target != nil
  101.         target.animation_id = @animation2_id
  102.         target.animation_hit = (target.damage != "Miss")
  103.       end
  104.     end
  105.     # 限制动画长度、最低 8 帧
  106.     @wait_count = 8
  107.     # 移至步骤 5
  108.     @phase4_step = 5
  109.   end
  110.   def update_phase4_step5
  111.     # 隐藏帮助窗口
  112.     @help_window.visible = false
  113.     # 刷新状态窗口
  114.     @status_window.refresh
  115.     # 显示伤害
  116.     for target in @target_battlers
  117.       if target != nil
  118.         if target.damage != nil
  119.           target.damage_pop = true
  120.         end
  121.       end
  122.     end
  123.     # 移至步骤 6
  124.     @phase4_step = 6
  125.   end
  126. end
  127. class Game_Troop
  128.   #--------------------------------------------------------------------------
  129.   # ● 对像敌人的除本次随机确定
  130.   #     hp0 : 限制 HP 0 的敌人
  131.   #--------------------------------------------------------------------------
  132.   def random_target_enemy2(index2,hp0 = false)
  133.     # 初始化轮流
  134.     roulette = []
  135.     # 循环
  136.     for enemy in @enemies
  137.       # 条件符合的情况下
  138.       if (not hp0 and enemy.exist?) or (hp0 and enemy.hp0?)
  139.         if enemy != @enemies[index2]
  140.           # 添加敌人到轮流
  141.           roulette.push(enemy)
  142.         end
  143.       end
  144.     end
  145.     # 轮流尺寸为 0 的情况下
  146.     if roulette.size == 0
  147.       return nil
  148.     end
  149.     # 转轮盘赌,决定敌人
  150.     return roulette[rand(roulette.size)]
  151.   end
  152. end
  153.  
  154.  
  155. #                        敌人职业无效化
  156.  
  157.  
  158. class Game_Enemy < Game_Battler
  159.   attr_accessor :class_id
  160. end
遗失的签名。。。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
15 小时
注册时间
2015-7-7
帖子
23
15
 楼主| 发表于 2015-7-13 16:57:03 | 只看该作者
linwsh123 发表于 2015-7-13 10:32
谢谢,  你这个是攻击同一个人2次的。  我想要的效果是 数据库中某个“职业”的普通攻击能攻击2次且不是 ...

类似,但不是要这种效果。(ΦωΦ)
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-20 17:57

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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