조회 수 309 추천 수 0 댓글 0
Atachment
첨부 '1'
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄


블루님 말씀대로 일본판으로 하니까 실행은 되는데 중요한 건,
튕겨버리더군요

스크립트는 아래와 같고,
튕길때의 에러 메세지는 그림과 같습니다.
튕기는 시점은 연계 스킬을 시전 하기전, 7번스킬을 쓴 후 60번 스킬이 발동하기 전에 튕깁니다.


#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/  ◆連繋スキル - KGC_CooperationSkill◆
#_/----------------------------------------------------------------------------
#_/ 複数のスキルを組み合わせ、別のスキルを発動させる機能です。
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# ★ カスタマイズ項目 ★
#==============================================================================

module KGC
# ◆연계 스킬 배열
# ≪[발동 스킬 ID, [필요 스킬 ID1, 필요 스킬 ID2, ...]]≫
# 배열이므로, 잊지 않고 , 그리고 단락지어 주세요.
CS_SKILLS = [101, [7, 60]], # 고대의 마법
[101, [7, 60]], [101, [8, 60]], [101, [9, 60]], # 스파이럴 플레어
# ←이 ] 는 지우지 않는 것

# ◆적연계 스킬 허가
# true 로 하면, 적도 연계 스킬 판정을 실시한다.
CS_ENEMY_PERMIT = true
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

$imported["CooperationSkill"] = true

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_Battler (分割定義 3)
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # ● 連繋スキルの効果適用
  #     user  : スキルの使用者 (バトラー)
  #     skill : スキル
  #     actor : 使用者がアクター
  #--------------------------------------------------------------------------
  def cooperation_skill_effect(users, skill, actor)
    # クリティカルフラグをクリア
    self.critical = false
    # スキルの効果範囲が HP 1 以上の味方で、自分の HP が 0、
    # またはスキルの効果範囲が HP 0 の味方で、自分の HP が 1 以上の場合
    if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
       ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
      # メソッド終了
      return false
    end
    # 有効フラグをクリア
    effective = false
    # コモンイベント ID が有効の場合は有効フラグをセット
    effective |= skill.common_event_id > 0
    # 第一命中判定
    hit2 = 100 * users.size
    if skill.atk_f > 0
      for i in 0...users.size
        user = actor ? $game_party.actors[users[i][0]] : $game_troop.enemies[users[i][0]]
        hit2 += user.hit * skill.atk_f / 100
      end
    end
    hit2 /= users.size * 0.75
    hit = Integer(skill.hit * hit2 / 100)
    hit_result = (rand(100) < hit)
    # 不確実なスキルの場合は有効フラグをセット
    effective |= hit < 100
    # 命中の場合
    if hit_result == true
      # 威力を計算
      power = 0
      for i in 0...users.size
        user = actor ? $game_party.actors[users[i][0]] : $game_troop.enemies[users[i][0]]
        power += user.atk * skill.atk_f / 100
      end
      power /= users.size * 0.75
      power = Integer(power + skill.power)
      if power > 0
        power -= self.pdef * skill.pdef_f / 200
        power -= self.mdef * skill.mdef_f / 200
        power = [power, 0].max
      end
      # 倍率を計算
      rate = 0
      for i in 0...users.size
        user = actor ? $game_party.actors[users[i][0]] : $game_troop.enemies[users[i][0]]
        rate += (user.str * skill.str_f / 100)
        rate += (user.dex * skill.dex_f / 100)
        rate += (user.agi * skill.agi_f / 100)
        rate += (user.int * skill.int_f / 100)
      end
      rate /= users.size * 0.75
      rate = Integer(rate + 20)
      # 基本ダメージを計算
      self.damage = power * rate / 20
      # 属性修正
      self.damage *= elements_correct(skill.element_set)
      self.damage /= 100
      # ダメージの符号が正の場合
      if self.damage > 0
        # 防御修正
        if self.guarding?
          self.damage /= 2
        end
      end
      # 分散
      if skill.variance > 0 and self.damage.abs > 0
        amp = [self.damage.abs * skill.variance / 100, 1].max
        self.damage += rand(amp+1) + rand(amp+1) - amp
      end
      # 第二命中判定
      eva = 0; user_dex = 0
      for i in 0...users.size
        user = actor ? $game_party.actors[users[i][0]] : $game_troop.enemies[users[i][0]]
        user_dex += user.dex
      end
      user_dex /= users.size
      eva += 8 * self.agi / user_dex
      eva += self.eva
      hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
      hit = self.cant_evade? ? 100 : hit
      hit_result = (rand(100) < hit)
      # 不確実なスキルの場合は有効フラグをセット
      effective |= hit < 100
    end
    # 命中の場合
    if hit_result == true
      # 威力 0 以外の物理攻撃の場合
      if skill.power != 0 and skill.atk_f > 0
        # ステート衝撃解除
        remove_states_shock
        # 有効フラグをセット
        effective = true
      end
      # HP からダメージを減算
      last_hp = self.hp
      self.hp -= self.damage
      effective |= self.hp != last_hp
      # ステート変化
      @state_changed = false
      effective |= states_plus(skill.plus_state_set)
      effective |= states_minus(skill.minus_state_set)
      # 威力が 0 の場合
      if skill.power == 0
        # ダメージに空文字列を設定
        self.damage = ""
        # ステートに変化がない場合
        unless @state_changed
          # ダメージに "Miss" を設定
          self.damage = "Miss"
        end
      end
    # ミスの場合
    else
      # ダメージに "Miss" を設定
      self.damage = "Miss"
    end
    # 戦闘中でない場合
    unless $game_temp.in_battle
      # ダメージに nil を設定
      self.damage = nil
    end
    # メソッド終了
    return effective
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● スキルの使用可能判定
  #     skill_id : スキル ID
  #--------------------------------------------------------------------------
  def skill_can_use?(skill_id)
    return super(skill_id)
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_Battle (分割定義 1)
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  alias main_KGC_CooperationSkill main
  def main
    # 連繋スキル発動フラグを解除
    @cooperation_skill_exec = false
    # 連繋判定用配列を初期化
    @cooperate_actors, @cooperate_enemies = [], []

    # 元の処理を実行
    main_KGC_CooperationSkill
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_Battle (分割定義 2)
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ● パーティコマンドフェーズ開始
  #--------------------------------------------------------------------------
  alias start_phase2_KGC_CooperationSkill start_phase2
  def start_phase2
    # 連繋スキル発動フラグを解除
    @cooperation_skill_exec = false
    # 連繋判定用配列を初期化
    @cooperate_actors, @cooperate_enemies = [], []

    # 元の処理を実行
    start_phase2_KGC_CooperationSkill
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_Battle (分割定義 4)
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  #--------------------------------------------------------------------------
  alias update_phase4_step6_KGC_CooperationSkill update_phase4_step6
  def update_phase4_step6
    # 敵全滅判定
    target_all_dead = true
    for battler in (@active_battler.is_a?(Game_Actor) ? $game_troop.enemies : $game_party.actors)
      if battler.exist?
        target_all_dead = false
        break
      end
    end
    # 連繋スキル発動中の場合
    if @cooperation_skill_exec
      # 連繋スキル発動フラグを解除
      @cooperation_skill_exec = false
      # 判定用配列をクリア
      if @active_battler.is_a?(Game_Actor)
        @cooperate_actors = []
      elsif @active_battler.is_a?(Game_Enemy) && KGC::CS_ENEMY_PERMIT
        @cooperate_enemies = []
      end
    # 行動がスキルで、対象が残っている場合
    elsif @active_battler.current_action.kind == 1 && !target_all_dead
      # 判定用データ作成
      data = [@active_battler.index, @active_battler.current_action.skill_id]
      if @active_battler.is_a?(Game_Actor)
        if @cooperate_actors.size >= 1
          for i in 0...@cooperate_actors.size
            # 自身、及び異常データを削除
            if @cooperate_actors[i][0] == @active_battler.index ||
                @cooperate_actors[i].size != 2
              @cooperate_actors[i] = nil
            end
          end
          @cooperate_actors.compact!
        end
        # 判定用配列に追加
        @cooperate_actors << data
      elsif @active_battler.is_a?(Game_Enemy) && KGC::CS_ENEMY_PERMIT
        if @cooperate_enemies.size >= 1
          for i in 0...@cooperate_enemies.size
            # 自身、及び異常データを削除
            if @cooperate_enemies[i][0] == @active_battler.index ||
                @cooperate_enemies[i].size != 2
              @cooperate_enemies[i] = nil
            end
          end
          @cooperate_enemies.compact!
        end
        # 判定用配列に追加
        @cooperate_enemies << data
      end
      # 連繋スキル発動判定
      for i in 0...KGC::CS_SKILLS.size
        cs = KGC::CS_SKILLS[i]
        # アクター判定
        if @active_battler.is_a?(Game_Actor)
          exec, @exec_battlers = [], []
          for j in 0...cs[1].size
            exec[j] = false
            for k in 0...@cooperate_actors.size
              if @cooperate_actors[k] == nil || @cooperate_actors[k].size != 2
                @cooperate_actors.delete_at(k)
                next
              end
              if cs[1][j] == @cooperate_actors[k][1]
                exec[j] = true
                @exec_battlers << @cooperate_actors[k]
              end
            end
          end
          exec2 = true
          for j in 0...@exec_battlers.size
            unless $game_party.actors[@exec_battlers[j][0]].exist?
              exec2 = false
              break
            end
          end
          exec3 = true
          for j in 0...@exec_battlers.size
            unless $game_party.actors[@exec_battlers[j][0]].skill_can_use?(cs[0])
              exec3 = false
              break
            end
          end
          # 連繋スキル発動
          if exec.all? && exec2 && exec3
            # 発動フラグを立てる
            @cooperation_skill_exec = true
            if $imported["ActiveCountBattle"] && @input_battler != nil
              for j in 0...@exec_battlers.size
                if $game_party.actors[@exec_battlers[j][0]] == @input_battler
                  # コマンド入力を解除
                  command_input_cancel
                end
              end
            end
            # スキル取得
            skill = $data_skills[cs[0]]
            # SP消費
            for j in 0...@exec_battlers.size
              $game_party.actors[@exec_battlers[j][0]].sp -= skill.sp_cost
            end
            @status_window.refresh
            # ヘルプウィンドウにスキル名を表示
            @help_window.set_text(skill.name, 1)
            if $imported["SkillMessage"]
              # スキル使用メッセージ表示
              show_skill_message(@active_battler, skill)
            end
            # アニメーション ID を設定
            @animation1_id = skill.animation1_id
            @animation2_id = skill.animation2_id
            # 対象存在判定
            target_dead = false
            for target in @target_battlers
              unless target.exist?
                target_dead = true
                break
              end
            end
            # 攻撃対象取得
            if skill.scope == 2 || skill.scope == 4 || skill.scope == 6 || target_dead
              @target_battlers = []
              set_target_battlers(skill.scope)
            end
            for target in @target_battlers
              target.cooperation_skill_effect(@cooperate_actors, skill, true)
            end
            # 発動者全員に発動アニメを表示
            for j in 0...@exec_battlers.size
              $game_party.actors[@exec_battlers[j][0]].animation_id = @animation1_id
              $game_party.actors[@exec_battlers[j][0]].animation_hit = true
            end
            # ステップ 4 に移行
            @phase4_step = 4
            return
          end
        # エネミー判定
        elsif @active_battler.is_a?(Game_Enemy) && KGC::CS_ENEMY_PERMIT
          exec, @exec_battlers = [], []
          for j in 0...cs[1].size
            exec[j] = false
            for k in 0...@cooperate_enemies.size
              if @cooperate_enemies[k] == nil || @cooperate_enemies[k].size != 2
                @cooperate_enemies.delete_at(k)
                next
              end
              if cs[1][j] == @cooperate_enemies[k][1]
                exec[j] = true
                @exec_battlers << @cooperate_enemies[k]
              end
            end
          end
          exec2 = true
          for j in 0...@exec_battlers.size
            unless $game_troop.enemies[@exec_battlers[j][0]].exist?
              exec2 = false
              break
            end
          end
          exec3 = true
          for j in 0...@exec_battlers.size
            unless $game_troop.enemies[@exec_battlers[j][0]].skill_can_use?(cs[0])
              exec3 = false
              break
            end
          end
          # 連繋スキル発動
          if exec.all? && exec2 && exec3
            # 発動フラグを立てる
            @cooperation_skill_exec = true
            # スキル取得
            skill = $data_skills[cs[0]]
            # SP消費
            for j in 0...@exec_battlers.size
              $game_troop.enemies[@exec_battlers[j][0]].sp -= skill.sp_cost
            end
            # ヘルプウィンドウにスキル名を表示
            @help_window.set_text(skill.name, 1)
            if $imported["SkillMessage"]
              # スキル使用メッセージ表示
              show_skill_message(@active_battler, skill)
            end
            # アニメーション ID を設定
            @animation1_id = skill.animation1_id
            @animation2_id = skill.animation2_id
            # 対象存在判定
            target_dead = false
            for target in @target_battlers
              unless target.exist?
                target_dead = true
                break
              end
            end
            # 攻撃対象取得
            if skill.scope == 2 || skill.scope == 4 || skill.scope == 6 || target_dead
              @target_battlers = []
              set_target_battlers(skill.scope)
            end
            for battler in @target_battlers
              battler.cooperation_skill_effect(@cooperate_enemies, skill, false)
            end
            # 発動者全員に発動アニメを表示
            for j in 0...@exec_battlers.size
              $game_troop.enemies[@exec_battlers[j][0]].animation_id = @animation1_id
              $game_troop.enemies[@exec_battlers[j][0]].animation_hit = true
            end
            # ステップ 4 に移行
            @phase4_step = 4
            return
          end
        end
      end
    else
      # 判定用配列から削除
      if @active_battler.is_a?(Game_Actor) && @cooperate_actors.size > 1
        for i in 0...@cooperate_actors.size
          if @cooperate_actors[i][0] == @active_battler.index
            @cooperate_actors.delete_at(i)
            break
          end
        end
      elsif @active_battler.is_a?(Game_Enemy) && KGC::CS_ENEMY_PERMIT &&
          @cooperate_enemies.size > 1
        for i in 0...@cooperate_enemies.size
          if @cooperate_enemies[i][0] == @active_battler.index
            @cooperate_enemies.delete_at(i)
            break
          end
        end
      end
    end

    # 元の処理を実行
    update_phase4_step6_KGC_CooperationSkill
  end
  #--------------------------------------------------------------------------
  # ● 連繋スキル発動中判定
  #     battler : 判定するバトラー
  #--------------------------------------------------------------------------
  def cooperation_exec?(battler)
    if @cooperation_skill_exec
      if battler.is_a?(Game_Actor)
        # 発動者に含まれているか判定
        for i in 0...@exec_battlers.size
          if @exec_battlers[i][0] == battler.index
            return true
          end
        end
      elsif battler.is_a?(Game_Enemy) && KGC::CS_ENEMY_PERMIT
        # 発動者に含まれているか判定
        for i in 0...@exec_battlers.size
          if @exec_battlers[i][0] == battler.index
            return true
          end
        end
      end
    end
    return false
  end
end
?

List of Articles
번호 제목 글쓴이 날짜 조회 수
8828 쯔꾸르 mv 게임을 apk 파일로 변환했는데... 1 박하맛 2023.01.14 737
8827 쯔꾸르 젖소이야기 결혼 방법좀 알려주세요... 2 백지씨 2021.12.20 1981
8826 apk포팅 승인 어케 하나요? game메이커xp 2021.11.29 790
8825 Yanfly님의 Action Sequence Pack 질문드립니다 Neuromancer 2021.07.15 984
8824 싸게 MV 를 먼저? 아니면 돈을 더 들어서라도 MZ? 2 Xatra 2021.07.06 1268
8823 RMMV - 스탯창과 대화창 변견 관련 질문입니다. (초보입니다 도움좀 주세요 ㅜㅜ) 2 scribble 2021.01.22 1102
8822 아오오니를 하는 사람인데요 질문 두가지가 있어요 1 오니개무서워 2021.01.16 1118
8821 재밌는게임 land_tnt 2020.12.07 1023
8820 c언어 질문 세종기항19 2020.11.10 1192
8819 코딩 질문 1 세종기항19 2020.11.08 1044
8818 혹시나 물어보는데 드래곤규 2020.11.07 957
8817 오픈보 게임 더블드래곤 리로디드 얼티네이트에 대해 궁금 이부닝 2020.09.09 783
8816 상태이상 확률 결정 스트레이보우 2020.09.02 652
8815 다음 인디사이드 제작대회는 언제쯤 열릴까요? WOONAALAA 2020.05.23 625
8814 xp로 제작된 어플 실행자체가 안된다는 분이 있습니다.(제생각엔 apk로 변환하는 과정에서 버전자체가 낮은 것 같습니다) 1 라엔 2020.05.04 1042
8813 apk 포팅하는데 게임 이름이 필요합니다 뜨는데 1 kashu 2020.05.03 999
8812 쯔꾸르VX Ace렉먹음 도와주세요... 랖랖 2020.03.22 1315
8811 안녕하세요 1 청월령 2020.02.14 499
8810 포팅 중 '게임 이름이 필요합니다' 오류 2 아이비스 2020.02.11 449
8809 RPGMV 거리 추적 1 정욱 2020.01.19 517
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 442 Next
/ 442






[개인정보취급방침] | [이용약관] | [제휴문의] | [후원창구] | [인디사이드연혁]

Copyright © 1999 - 2016 INdiSide.com/(주)씨엘쓰리디 All Rights Reserved.
인디사이드 운영자 : 천무(이지선) | kernys(김원배) | 사신지(김병국)