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

Project1

 找回密码
 注册会员
搜索
楼主: 芯☆淡茹水
打印 上一主题 下一主题

[原创发布] ► 自动战斗 ◄ <<普通自动战斗 + AI 自动战斗>> 更新[13/10/02]

[复制链接]

Lv5.捕梦者 (版主)

梦石
1
星屑
23963
在线时间
3338 小时
注册时间
2011-7-8
帖子
3925

开拓者

1
发表于 2018-3-7 13:00:53 | 显示全部楼层
本帖最后由 guoxiaomi 于 2018-3-7 13:04 编辑

脚本这里提到了一个 @active_battlers.auto_battle_targets,但是在战斗结束和战斗前都没有进行 clear。

在行动的第一回合,如果 @active_battler.restriction 不等于 2 或 3,auto_battler_targets 会成为上一次战斗中选取的 Game_Enemy 对象,理论上这个对象应该在战斗结束后就会被释放掉的。

这个地方会与全动画脚本冲突,因为全动画脚本要在 Game_Enemy 上播放动画,不会显示相应的动画内容。

不知道是不是开了AI战斗就能避免。

RUBY 代码复制
  1. #--------------------------------------------------------------------------
  2.   def make_basic_auto
  3.     case @active_battler.current_action.basic
  4.     when 0
  5.       @animation1_id = @active_battler.animation1_id
  6.       @animation2_id = @active_battler.animation2_id
  7.       if @active_battler.restriction == 3
  8.         target = $game_party.random_target_actor
  9.         @active_battler.auto_battle_targets = []
  10.         @active_battler.auto_battle_targets.push(target)
  11.       elsif @active_battler.restriction == 2
  12.         target = $game_troop.random_target_enemy
  13.         @active_battler.auto_battle_targets = []
  14.         @active_battler.auto_battle_targets.push(target)
  15.       end
  16.       @target_battlers = @active_battler.auto_battle_targets
  17.       for target in @target_battlers
  18.         target.attack_effect(@active_battler)
  19.       end
  20.       return
  21.     when 1
  22.       @help_window.set_text($data_system.words.guard, 1)
  23.       return
  24.     end
  25.   end
  26.   #--------------------------------------------------------------------------

点评

因为我的游戏里用到了这个脚本啊@_@  发表于 2018-3-7 20:47
这么老的东西你都能翻出来,是不是很闲呐!  发表于 2018-3-7 13:24
熟悉rgss和ruby,xp区版主~
正在填坑:《膜拜组传奇》讲述膜拜组和学霸们的故事。
已上steam:与TXBD合作的Reformers《变革者》
* 战斗调用公共事件 *
* RGSOS 网络脚本 *
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-5 13:27

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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