Hello, i am using KGCs Cooperation Skills and i have a problem: The damage for the coop attacks is not shown. It does not say "Miss" or "0", it just shows nothing...the enemy takes damage nevertheless, since he dies after the coop-attack.
I'll post the script so you can look over it:
Oh, and I am using the DBS.
I'll post the script so you can look over it:
Code:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ â—† 連繋スã‚ル - KGC_CooperationSkill â—†
#_/ â—‡ Last update : 2007/05/28 â—‡
#_/----------------------------------------------------------------------------
#_/ 複数ã®ã‚¹ã‚ルを組ã¿åˆã‚ã›ã€åˆ¥ã®ã‚¹ã‚ルを発動ã•ã›ã‚‹æ©Ÿèƒ½ã§ã™ã€‚
#_/ It is a function to combine some skills, and to execute another skill.
#_/============================================================================
#_/ ≪個別戦闘コマンド[SeparationCommand]≫より下
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#==============================================================================
# ★ ã‚«ã‚¹ã‚¿ãƒžã‚¤ã‚ºé …ç›® - Customize ★
#==============================================================================
module KGC
# ◆連繋スã‚ルé…列
# ≪[発動スã‚ルID, [å¿…è¦ã‚¹ã‚ルID1, å¿…è¦ã‚¹ã‚ルID2, ...]]≫
# é…列ãªã®ã§ã€å¿˜ã‚Œãšã« , ã§åŒºåˆ‡ã£ã¦ãã ã•ã„。
CS_SKILLS = [
# スパイラルフレア
[83, [88, 7]],
[84, [88, 10]],
[85, [88, 13]],
] # -- Don't delete this line! --
# ◆敵連繋スã‚ル許å¯
# true ã«ã™ã‚‹ã¨ã€æ•µã‚‚連繋スã‚ル判定を行ã†ã€‚
CS_PERMIT_ENEMY = true
# ◆連繋元スã‚ル発動許å¯
# true ã«ã™ã‚‹ã¨ã€é€£ç¹‹å…ƒã¨ãªã‚‹ã‚¹ã‚ルもã™ã¹ã¦ç™ºå‹•ã™ã‚‹ã€‚
# false ã«ã™ã‚‹ã¨ã€é€£ç¹‹ã‚¹ã‚ルã®ã¿ç™ºå‹•ã™ã‚‹ã€‚
# (≪Active Count Battle≫ã§ã¯ã€æœ€å¾Œã®é€£ç¹‹å…ƒã‚¹ã‚ルã«ã®ã¿å½±éŸ¿)
CS_EXECUTE_ORIGIN_SKILL = false
end
#### CS_SKILLS
### Array of "Cooperation Skill".
# << ["Cooperation Skill" ID, [Necessary skill ID 1, ID 2, ...]] >>
#### CS_PERMIT_ENEMY
### Enables enemy to execute "Cooperation Skill".
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
$imported = {} if $imported == nil
$imported["CooperationSkill"] = true
#==============================================================================
# ■Game_Battler (分割定義 3)
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ◠連繋スã‚ルã®åŠ¹æžœé©ç”¨
# users : スã‚ルã®ä½¿ç”¨è€…リスト (ãƒãƒˆãƒ©ãƒ¼)
# users[i] : Game_CooperationSkillUser
# skill : スã‚ル
# is_actor : 使用者ãŒã‚¢ã‚¯ã‚¿ãƒ¼
#--------------------------------------------------------------------------
def cooperation_skill_effect(users, skill, is_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
user_list = (is_actor ? $game_party.actors : $game_troop.enemies).compact
# 有効フラグをクリア
effective = false
# コモンイベント ID ãŒæœ‰åŠ¹ã®å ´åˆã¯æœ‰åŠ¹ãƒ•ãƒ©ã‚°ã‚’セット
effective |= skill.common_event_id > 0
# 第一命ä¸åˆ¤å®š
hit2 = 100 * users.size
if skill.atk_f > 0
users.each { |u|
user = user_list[u.index]
hit2 += user.hit * skill.atk_f / 100
}
end
hit = users.size * 0.75
hit = Integer(skill.hit * hit2 / 100)
hit_result = (rand(100) < hit)
# ä¸ç¢ºå®Ÿãªã‚¹ã‚ルã®å ´åˆã¯æœ‰åŠ¹ãƒ•ãƒ©ã‚°ã‚’セット
effective |= hit < 100
# 命ä¸ã®å ´åˆ
if hit_result
# å¨åŠ›ã‚’計算
power = 0
users.each { |u|
user = user_list[u.index]
power += user.atk * skill.atk_f / 100
}
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
users.each { |u|
user = user_list[u.index]
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)
}
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
users.each { |u|
user = user_list[u.index]
user_dex += user.dex
}
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
# å¨åŠ› 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 = "Daneben"
end
end
# ミスã®å ´åˆ
else
# ダメージ㫠"Miss" ã‚’è¨å®š
self.damage = "Daneben"
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
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# â– Game_CooperationSkillUser
#==============================================================================
class Game_CooperationSkillUser
attr_reader :index, :skill_id
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize(index, skill_id)
@index = index
@skill_id = skill_id
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■Scene_Battle (分割定義 1)
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ◠メイン処ç†
#--------------------------------------------------------------------------
alias main_KGC_CooperationSkill main
def main
# 連繋スã‚ル発動フラグを解除
@cooperation_skill_exec = false
@cooperation_skill_id = 0
# 連繋判定用é…列をåˆæœŸåŒ–
@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
@cooperation_skill_id = 0
# 連繋判定用é…列をåˆæœŸåŒ–
@cooperate_actors.clear
@cooperate_enemies.clear
start_phase2_KGC_CooperationSkill
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■Scene_Battle (分割定義 4)
#==============================================================================
class Scene_Battle
unless KGC::CS_EXECUTE_ORIGIN_SKILL || $imported["ActiveCountBattle"]
#--------------------------------------------------------------------------
# ◠メインフェーズ開始
#--------------------------------------------------------------------------
alias start_phase4_KGC_CooperationSkill start_phase4
def start_phase4
start_phase4_KGC_CooperationSkill
# 判定用データ作æˆ
@cooperate_actors.clear
@cooperate_enemies.clear
$game_party.actors.each { |actor|
if actor.current_action.kind == 1
user = Game_CooperationSkillUser.new(actor.index,
actor.current_action.skill_id)
@cooperate_actors << user
end
}
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
#--------------------------------------------------------------------------
alias update_phase4_step2_KGC_CooperationSkill update_phase4_step2
def update_phase4_step2
@judged = false
unless KGC::CS_EXECUTE_ORIGIN_SKILL
# 発動判定
judge_cooperation_skill(@active_battler)
if @cooperation_skill_exec
@phase4_step = 6
return
end
end
update_phase4_step2_KGC_CooperationSkill
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
alias update_phase4_step6_KGC_CooperationSkill update_phase4_step6
def update_phase4_step6
if @cooperation_skill_exec && !@judged
# 連繋スã‚ル終了
@cooperation_skill_exec = false
@cooperation_skill_id = 0
@exec_battlers.clear
# 発動判定
elsif KGC::CS_EXECUTE_ORIGIN_SKILL
judge_cooperation_skill(@active_battler)
end
if @cooperation_skill_exec
execute_cooperation_skill
@judged = false
return
end
update_phase4_step6_KGC_CooperationSkill
end
#--------------------------------------------------------------------------
# ◠連繋スã‚ル第一発動判定
# battler : 判定対象
#--------------------------------------------------------------------------
def judge_cooperation_skill(battler)
return false if @judged
@judged = true
# 行動ãŒã‚¹ã‚ルã®å ´åˆ
if battler.current_action.kind == 1
# 敵全滅判定
target_all_dead = true
enemy_list = battler.is_a?(Game_Actor) ?
$game_troop.enemies : $game_party.actors
enemy_list.each { |e|
if e.exist?
target_all_dead = false
break
end
}
# 対象ãŒæ®‹ã£ã¦ã„ã‚Œã°ç¬¬äºŒç™ºå‹•åˆ¤å®š
unless target_all_dead
return judge_cooperation_skill_second(battler)
end
else
# 判定用é…列ã‹ã‚‰å‰Šé™¤
if battler.is_a?(Game_Actor)
remove_cooperate_battler(0, battler)
elsif battler.is_a?(Game_Enemy)
remove_cooperate_battler(1, battler)
end
end
return false
end
#--------------------------------------------------------------------------
# ◠連繋スã‚ル第二発動判定
#--------------------------------------------------------------------------
def judge_cooperation_skill_second(battler)
# 判定用データ作æˆ
user = Game_CooperationSkillUser.new(battler.index,
battler.current_action.skill_id)
if battler.is_a?(Game_Actor)
remove_cooperate_battler(0, battler)
@cooperate_actors << user
elsif battler.is_a?(Game_Enemy) && KGC::CS_PERMIT_ENEMY
remove_cooperate_battler(1, battler)
@cooperate_enemies << user
end
# 連繋スã‚ル発動判定
KGC::CS_SKILLS.each { |cs|
# アクター判定
if battler.is_a?(Game_Actor)
check_cooperation_exec_battlers(0, cs)
if @cooperation_skill_exec
break
end
# エãƒãƒŸãƒ¼åˆ¤å®š
elsif battler.is_a?(Game_Enemy) && KGC::CS_PERMIT_ENEMY
check_cooperation_exec_battlers(1, cs)
if @cooperation_skill_exec
break
end
end
}
return @cooperation_skill_exec
end
#--------------------------------------------------------------------------
# ◠連繋スã‚ル発動ãƒãƒˆãƒ©ãƒ¼åˆ¤å®š
# type : 0..Actor 1..Enemy
# cs_data : Cooperation skill data
#--------------------------------------------------------------------------
def check_cooperation_exec_battlers(type, cs_data)
case type
when 0 # Actor
cooperate_battlers = @cooperate_actors
battler_list = $game_party.actors
when 1 # Enemy
cooperate_battlers = @cooperate_enemies
battler_list = $game_troop.enemies
end
exec = true
# 発動者リストを作æˆ
@exec_battlers = []
cs_data[1].each { |sid|
user = cooperate_battlers.find { |cb|
sid == cb.skill_id && !@exec_battlers.include?(cb)
}
exec &= user != nil
if exec
@exec_battlers << user
else
break
end
}
if exec
# 発動者全員ãŒç™ºå‹•æ¡ä»¶ã‚’満ãŸã™ã‹åˆ¤å®š
@exec_battlers.each { |eb|
unless battler_list[eb.index].exist? &&
battler_list[eb.index].skill_can_use?(cs_data[0])
exec = false
break
end
}
end
# 連繋スã‚ル発動
if exec
# 発動フラグを立ã¦ã‚‹
@cooperation_skill_exec = true
@cooperation_skill_id = cs_data[0]
@cooperation_skill_user = type
# 発動者を削除
cooperate_battlers.each_with_index { |cb, i|
if @exec_battlers.include?(cb)
@action_battlers.delete(battler_list[cb.index])
cooperate_battlers[i] = nil
end
}
cooperate_battlers.compact!
end
end
#--------------------------------------------------------------------------
# â— é€£ç¹‹åŠ æ‹…è€…å‰Šé™¤
# type : 0..アクター 1..エãƒãƒŸãƒ¼
# battler : 削除対象
#--------------------------------------------------------------------------
def remove_cooperate_battler(type, battler)
case type
when 0 # アクター
if @cooperate_actors.size > 1
@cooperate_actors.each_index { |i|
if @cooperate_actors[i].index == battler.index
@cooperate_actors[i] = nil
end
}
@cooperate_actors.compact!
end
when 1 # エãƒãƒŸãƒ¼
if KGC::CS_PERMIT_ENEMY && @cooperate_enemies.size > 1
@cooperate_enemies.each_index { |i|
if @cooperate_enemies[i].index == battler.index
@cooperate_enemies[i] = nil
end
}
@cooperate_enemies.compact!
end
end
end
#--------------------------------------------------------------------------
# ◠連繋スã‚ル発動
#--------------------------------------------------------------------------
def execute_cooperation_skill
# スã‚ルå–å¾—
skill = $data_skills[@cooperation_skill_id]
# ヘルプウィンドウã«ã‚¹ã‚ルåを表示
@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
# コモンイベント ID ã‚’è¨å®š
@common_event_id = skill.common_event_id
# 攻撃対象å–å¾—
@target_battlers = []
set_target_battlers(skill.scope)
case @cooperation_skill_user
when 0 # アクター
user_list = $game_party.actors
if $imported["ActiveCountBattle"] && @input_battler != nil
@exec_battlers.each_index { |j|
if $game_party.actors[@exec_battlers[j].index] == @input_battler
# コマンド入力を解除
command_input_cancel
end
}
end
@status_window.refresh
when 1 # エãƒãƒŸãƒ¼
user_list = $game_troop.enemies
end
# SP消費
@exec_battlers.each_index { |i|
user_list[@exec_battlers[i].index].sp -= skill.sp_cost
}
# 発動者全員ã«ç™ºå‹•ã‚¢ãƒ‹ãƒ¡ã‚’表示
@exec_battlers.each_index { |i|
user_list[@exec_battlers[i].index].animation_id = @animation1_id
user_list[@exec_battlers[i].index].animation_hit = true
}
# スã‚ルé©ç”¨
@target_battlers.each { |target|
target.cooperation_skill_effect(@exec_battlers, skill,
@cooperation_skill_user == 0)
}
# ステップ 4 ã«ç§»è¡Œ
@phase4_step = 4
end
#--------------------------------------------------------------------------
# ◠連繋スã‚ãƒ«åŠ æ‹…åˆ¤å®š
# battler : 判定ã™ã‚‹ãƒãƒˆãƒ©ãƒ¼
#--------------------------------------------------------------------------
def cooperation_exec?(battler)
if @cooperation_skill_exec
if !battler.is_a?(Game_Enemy) || KGC::CS_PERMIT_ENEMY
# 発動者ã«å«ã¾ã‚Œã¦ã„ã‚‹ã‹åˆ¤å®š
@exec_battlers.each_index { |i|
return true if @exec_battlers[i].index == battler.index
}
end
end
return false
end
end
Oh, and I am using the DBS.