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

Project1

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

[已经过期] 如何改成在混乱时有可能攻击敌人

[复制链接]

Lv1.梦旅人

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

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

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

x
想请教一下,在版本1.00中,如何改成在混乱时有可能攻击同伴,但也有可能攻击敌人? (简单来讲就是不分敌盟随机目标攻击)

Lv4.逐梦者 (版主)

聪仔

梦石
0
星屑
6182
在线时间
3077 小时
注册时间
2013-12-26
帖子
3145
2
发表于 2017-10-10 16:38:56 | 只看该作者
本帖最后由 正太君 于 2017-10-10 16:42 编辑

应该是找到这个定义修改,未测试,目测可行...
RUBY 代码复制
  1. def make_basic_action_result
  2.     # 攻击的情况下
  3.     if @active_battler.current_action.basic == 0
  4.       # 设置攻击 ID
  5.       @animation1_id = @active_battler.animation1_id
  6.       @animation2_id = @active_battler.animation2_id
  7.       # 行动方的战斗者是敌人的情况下
  8.       if @active_battler.is_a?(Game_Enemy)
  9.         if @active_battler.restriction == 3 # 改了以下两行...
  10.           target = $game_troop.random_target_enemy
  11.           target = $game_party.random_target_actor if rand(2) == 0
  12.         elsif @active_battler.restriction == 2
  13.           target = $game_party.random_target_actor
  14.         else
  15.           index = @active_battler.current_action.target_index
  16.           target = $game_party.smooth_target_actor(index)
  17.         end
  18.       end
  19.       # 行动方的战斗者是角色的情况下
  20.       if @active_battler.is_a?(Game_Actor)
  21.         if @active_battler.restriction == 3 # 改了以下两行...
  22.           target = $game_troop.random_target_enemy
  23.           target = $game_party.random_target_actor if rand(2) == 0
  24.         elsif @active_battler.restriction == 2
  25.           target = $game_troop.random_target_enemy
  26.         else
  27.           index = @active_battler.current_action.target_index
  28.           target = $game_troop.smooth_target_enemy(index)
  29.         end
  30.       end
  31.       # 设置对像方的战斗者序列
  32.       @target_battlers = [target]
  33.       # 应用通常攻击效果
  34.       for target in @target_battlers
  35.         target.attack_effect(@active_battler)
  36.       end
  37.       return
  38.     end
  39.     # 防御的情况下
  40.     if @active_battler.current_action.basic == 1
  41.       # 帮助窗口显示"防御"
  42.       @help_window.set_text($data_system.words.guard, 1)
  43.       return
  44.     end
  45.     # 逃跑的情况下
  46.     if @active_battler.is_a?(Game_Enemy) and
  47.        @active_battler.current_action.basic == 2
  48.       #  帮助窗口显示"逃跑"
  49.       @help_window.set_text("逃跑", 1)
  50.       # 逃跑
  51.       @active_battler.escape
  52.       return
  53.     end
  54.     # 什么也不做的情况下
  55.     if @active_battler.current_action.basic == 3
  56.       # 清除强制行动对像的战斗者
  57.       $game_temp.forcing_battler = nil
  58.       # 移至步骤 1
  59.       @phase4_step = 1
  60.       return
  61.     end
  62.   end




评分

参与人数 1星屑 +20 收起 理由
RyanBern + 20 我很赞同

查看全部评分

聪聪全国第三帅...
他们都叫我【人赢聪】
我的RM能力雷达图:

回复 支持 1 反对 0

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-20 09:11

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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