查看: 71|回复: 0

[转载发布] 仿仙剑的群体攻击(鞭)、仙风云体步(仙女剑)以及敌人

[复制链接]
  • TA的每日心情
    开心
    5 天前
  • 签到天数: 33 天

    连续签到: 1 天

    [LV.5]常住居民I

    2022

    主题

    32

    回帖

    7144

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    0
    卡币
    5074
    OK点
    16
    积分
    7144
    发表于 同元一千年八月七日(秋) | 显示全部楼层 |阅读模式
    两天前我曾发布过自己关于敌人双次攻击效果的处女教程,今天继续贴上整合的群攻(物理攻击伤害全体)、仙风云体步(每回合物理攻击两次)以及敌人的双次攻击效果整合脚本
    其中群攻有敌人的群攻效果与武器装备附带的群攻效果,仙风云体步分武器附带的仙风效果与仙术添加的仙风步状态,双次攻击指敌人每回合行动两次
    具体的使用方法请见脚本内部或参考范例~谢谢大家捧场~
    1. #==============================================================================# ■仿仙剑的群体攻击(鞭)、仙风云体步(仙女剑)以及敌人的双次攻击效果 #------------------------------------------------------------------------------# 实现角色的攻击特点、武器的攻击特点、敌人的攻击特点  Ver 1.00#==============================================================================#用前须知#首先请搞清楚,群攻是指林月如的鞭系那种攻击对方全体的普通攻击;#仙风云体步是指赵灵儿用双剑攻击的每回合对同一敌人的两次普通攻击;#在这个仿仙剑一的版本中,敌人的仙风云体步设置为双次攻击效果#1.设置群体攻击的敌人,只需要在数据库敌人属性名字后面加后缀"@群攻"#2.设置仙风云体步的敌人,需要在数据库敌人属性名字后面加后缀"@@仙风"注意是两个"@"#3.如果一个敌人既是群攻又是仙风云体步,敌人属性名字后面加后缀"@群攻@仙风"#4.设置群体攻击的武器,只需要在数据库武器属性名字后面加后缀"@群攻"#5.设置仙风云体步的武器,需要在数据库敌人属性名字后面加后缀"@@仙风"同样注意是两个"@"#6.如果一件武器既是群攻又是仙风云体术,武器属性名字后面加后缀"@群攻@仙风"#7.如果有一个状态的效果是仙风云体术,请用下面的这个变量存储该状态的IDXianfengstate = 18  #--------------------------------------------------------------------------  # ● 去后缀处理  #--------------------------------------------------------------------------class Window_Base < Window  def draw_item_name(item, x, y)    if item == nil      return    end    bitmap = RPG::Cache.icon(item.icon_name)    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))    self.contents.font.color = normal_color    self.contents.draw_text(x + 28, y, 212, 32, item.name.split("@")[0])  endendclass Game_Enemy < Game_Battler  def name    return $data_enemies[@enemy_id].name.split("@")[0]  end  def ifQungong    ###如果要改变敌人群体攻击属性的后缀,改下面    return $data_enemies[@enemy_id].name.split("@")[1] == "群攻"  end    def ifXianfeng    ###如果要改变敌人双次攻击属性的后缀,改下面    return $data_enemies[@enemy_id].name.split("@")[2] == "仙风"  endend  #--------------------------------------------------------------------------  # ● 重写攻击情况下的脚本  #--------------------------------------------------------------------------class Scene_Battle  #--------------------------------------------------------------------------  # ● 生成行动循序  #--------------------------------------------------------------------------  def make_action_orders    # 初始化序列 @action_battlers    @action_battlers = []    # 添加敌人到 @action_battlers 序列    for enemy in $game_troop.enemies      @action_battlers.push(enemy)      if enemy.ifXianfeng        @action_battlers.push(enemy)      end    end    # 添加角色到 @action_battlers 序列    for actor in $game_party.actors      @action_battlers.push(actor)      if (actor.current_action.basic == 0 and actor.restriction == 0 and  $data_weapons[actor.weapon_id].name.split("@")[2] == "仙风")        @action_battlers.push(actor)      else         if actor.state?(Xianfengstate)          @action_battlers.push(actor)        end      end    end    # 确定全体的行动速度    for battler in @action_battlers      battler.make_action_speed    end    # 按照行动速度从大到小排列    @action_battlers.sort! {|a,b|      b.current_action.speed - a.current_action.speed }  end  #--------------------------------------------------------------------------  # ● 生成基本行动结果  #--------------------------------------------------------------------------  def make_basic_action_result    # 攻击的情况下    if @active_battler.current_action.basic == 0      # 设置攻击 ID      @animation1_id = @active_battler.animation1_id      @animation2_id = @active_battler.animation2_id      # 行动方的战斗者是敌人的情况下      if @active_battler.is_a?(Game_Enemy)        if @active_battler.restriction == 3          target = $game_troop.random_target_enemy        elsif @active_battler.restriction == 2          target = $game_party.random_target_actor        else          index = @active_battler.current_action.target_index          target = $game_party.smooth_target_actor(index)        end      end      # 行动方的战斗者是角色的情况下      if @active_battler.is_a?(Game_Actor)        if @active_battler.restriction == 3          target = $game_party.random_target_actor        elsif @active_battler.restriction == 2          target = $game_troop.random_target_enemy        else          index = @active_battler.current_action.target_index          target = $game_troop.smooth_target_enemy(index)        end      end      # 设置对像方的战斗者序列      @target_battlers = [target]      # 如果敌人有“群攻”标记      if @active_battler.is_a?(Game_Enemy)        if @active_battler.ifQungong          if @active_battler.restriction == 0             @target_battlers = []            for target in $game_party.actors              if target.exist?                 @target_battlers.push(target)              end            end          end        end      end      # 如果角色标有群攻或者武器含有“群攻”标记      if @active_battler.is_a?(Game_Actor)        ###如果要改变武器群体攻击属性的后缀,改下面        if $data_weapons[@active_battler.weapon_id].name.split("@")[1] == "群攻"          if @active_battler.restriction == 0             @target_battlers = []            for target in $game_troop.enemies              if target.exist?                 @target_battlers.push(target)              end            end          end        end      end      # 应用通常攻击效果      for target in @target_battlers        target.attack_effect(@active_battler)      end      return    end    # 防御的情况下    if @active_battler.current_action.basic == 1      # 帮助窗口显示"防御"      @help_window.set_text($data_system.words.guard, 1)      return    end    # 逃跑的情况下    if @active_battler.is_a?(Game_Enemy) and       @active_battler.current_action.basic == 2      #  帮助窗口显示"逃跑"      @help_window.set_text("逃跑", 1)      # 逃跑      @active_battler.escape      return    end    # 什么也不做的情况下    if @active_battler.current_action.basic == 3      # 清除强制行动对像的战斗者      $game_temp.forcing_battler = nil      # 移至步骤 1      @phase4_step = 1      return    end  end  #--------------------------------------------------------------------------  # ● 刷新画面 (主回合步骤 6 : 刷新)  #--------------------------------------------------------------------------  def update_phase4_step6    # 清除强制行动对像的战斗者    $game_temp.forcing_battler = nil    # 公共事件 ID 有效的情况下    if @common_event_id > 0      # 设置事件      common_event = $data_common_events[@common_event_id]      $game_system.battle_interpreter.setup(common_event.list, 0)    end        ###为二次攻击者重新设置动作    if @active_battler.is_a?(Game_Enemy)      @active_battler.make_action    end        # 移至步骤 1    @phase4_step = 1  endend复制代码
    复制代码
    #######################华丽的分割线###############################
    以下是范例~


                 本帖来自P1论坛作者唐门草楹,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=222709  若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 论坛版权

    使用道具 举报

    ahome_bigavatar:guest
    ahome_bigavatar:welcomelogin
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2024-5-3 08:36 , Processed in 0.049164 second(s), 44 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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