code:
;-------------------------------------------------
; 単体ターゲットへのトークン追加スキル
;-------------------------------------------------
@CC_ACTIVESKILL_ADD_TOKEN(ATTACKER_DID, DEFENDER_DID, XML_SKILL)
; #region
#DIM ATTACKER_DID
#DIM DEFENDER_DID
#DIMS XML_SKILL

#DIM TRIGGER_ID
#DIM DYNAMIC SEQUENCE

;スキル処理用パラメータの初期化と取得
CALL CC_SKILL_TRIGGER_INIT(ATTACKER_DID, DEFENDER_DID, XML_SKILL, "ADD_NEW_BLOCK_TO_BOTTOM")
TRIGGER_ID = RESULT

;発動メッセージ

SELECTCASE CCS_SKILL_DEF_NAME
        ;◆剣の舞
    CASE "ACT_DANCE_OF_ADDITIONAL_ATTACK"
        ;コスト消費
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "Speed_0.mp3"
        ;トークン付与
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "ADD_ATTACK"
                ,"VALUE", CCS_EFFECT_RATE2
        }

        ;◆アルカナミラージュ
    CASE "ACT_CAST_ADD_DECOY"
        ;コスト消費
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "Speed_0.mp3"
        ;トークン付与
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "DECOY"
                ,"VALUE", CCS_EFFECT_RATE2
        }

        ;◆アルカナクローク
    CASE "ACT_CAST_ADD_HIDE"
        ;コスト消費
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "Speed_0.mp3"
        ;トークン付与
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "HIDE"
                ,"VALUE", CCS_EFFECT_RATE2
        }

        ;◆穿孔
    CASE "WPN_ADD_FRAGILE"
        CC_SE '= "HeavySlash_1.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100
        }
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "FRAGILE"
                ,"VALUE", CCS_EFFECT_RATE
                ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, 0, \"ATTACK_SUCCEEDED\") == 0}"
        }
        ;◆揺ぎ無き言葉
    CASE "ACT_VOICE_OF_FRAGILE"
        CC_SE '= "Hit_1.mp3"
        ;トークン付与
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "FRAGILE"
                ,"VALUE", CCS_EFFECT_RATE
        }

        ;スキル攻撃指令の追加処理
        IF HAS_SKILL(CCS_ATK_CHARA_ID, "PSV_ATTACK_ORDER")
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"TOKEN_NAME", "PROVOKE"
                    ,"VALUE", CCS_EFFECT_RATE
            }
        ENDIF

        ;◆加護の唄
    CASE "ACT_SONG_OF_ADD_BARRIER"
        ;コスト消費
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "Hit_1.mp3"
        ;トークン付与
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "BARRIER"
                ,"VALUE", CCS_EFFECT_RATE2
        }

        ;◆おまかせします
    CASE "ACT_REACT_OTHER"
        ;コスト消費
        CC_SE '= "Hit_1.mp3"
        ;トークン付与
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "REACT"
                ,"VALUE", CCS_EFFECT_RATE
        }

        ;◆追跡
    CASE "ACT_TRACKING"
        ;コスト消費
        CC_SE '= "Hit_1.mp3"
        ;トークン付与
		{
			DT_ROW_ADD "CC_ACTION"
				,"TRIGGER_ID", TRIGGER_ID
				,"SEQUENCE", SEQUENCE++
				,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
				,"ACTOR_DID", ATTACKER_DID
				,"TARGET_DID", ATTACKER_DID
				,"TOKEN_NAME", "TRACKING"
				,"VALUE", CCS_EFFECT_RATE
		}
		{
			DT_ROW_ADD "CC_ACTION"
				,"TRIGGER_ID", TRIGGER_ID
				,"SEQUENCE", SEQUENCE++
				,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
				,"ACTOR_DID", ATTACKER_DID
				,"TARGET_DID", DEFENDER_DID
				,"TOKEN_NAME", "TARGET"
				,"VALUE", CCS_EFFECT_RATE
		}
    ;◆くくり罠
    CASE "ACT_BINDINGTRAP"
        ;スキル効果のみで攻撃は行わない
        CC_ダメージ処理非実施フラグ = 1
        CC_SE '= "Switch_0.mp3"
        ;トークン付与
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_SET_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "BINDINGTRAP"
                ,"VALUE", CCS_EFFECT_RATE
        }

        ;◆スポッティング
    CASE "K28_UNIQUE_SKILL_SPOTTING"
        ;自身に発動した場合トークン+1
        VARI TOKEN_VALUE = CCS_EFFECT_RATE
        SIF ATTACKER_DID == DEFENDER_DID
            TOKEN_VALUE++
        ;コスト消費
        CC_SE '= "Hit_1.mp3"
        ;トークン付与
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "SEE_THROUGH"
                ,"VALUE", TOKEN_VALUE
        }
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_SET_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "BLIND"
                ,"VALUE", 0
        }

    ;◆ベアトラップ
    CASE "WPN_BEARTRAP"
        ;スキル効果のみで攻撃は行わない
        CC_ダメージ処理非実施フラグ = 1
        CC_SE '= "Switch_0.mp3"
        ;トークン付与
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_SET_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "BEARTRAP"
                ,"VALUE", CCS_EFFECT_RATE
        }

        ;◆スピリトーゾ
    CASE "K24_UNIQUE_SKILL_SPIRITOSO"
        ;コスト消費
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "Skill_0.mp3"
        ;トークン付与
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "CAST"
                ,"VALUE", CCS_EFFECT_RATE2
        }

ENDSELECT

;クールタイム処理
CALL CCS_ADD_COOLTIME()

RETURN TRIGGER_ID

;-------------------------------------------------
; ターゲット全体に作用するトークン追加スキル
;-------------------------------------------------
@CC_ACTIVESKILL_ADD_TOKEN_TO_ALL_ENEMY(ATTACKER_DID, DEFENDER_DID, XML_SKILL)
; #region
#DIM  ATTACKER_DID
#DIM  DEFENDER_DID
#DIMS XML_SKILL

#DIM TRIGGER_ID
#DIM BLOCK
#DIM DYNAMIC SEQUENCE

#DIM MEM_CNT
#DIM IDX, CC_MAX_MEMBER_NUM /2

;スキル処理用パラメータの初期化と取得
CALL CC_SKILL_TRIGGER_INIT(ATTACKER_DID, DEFENDER_DID, XML_SKILL, "ADD_NEW_BLOCK_TO_BOTTOM")
TRIGGER_ID = RESULT

SELECTCASE CCS_SKILL_DEF_NAME
    CASE "ACT_SONG_OF_FRAGILE"
        ;コスト消費
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "Skill_0.mp3"
        ;トークン付与
        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        FOR LOCAL, 0, MEM_CNT
            DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"TOKEN_NAME", "FRAGILE"
                    ,"VALUE", CCS_EFFECT_RATE2
            }
            CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "TARGET_HEADCOUNT", TOSTR(MEM_CNT))
        NEXT
    ;◆モレンド
    CASE "K24_UNIQUE_SKILL_MORENDO"
        ;コスト消費
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "Skill_0.mp3"
        ;トークン付与
        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        FOR LOCAL, 0, MEM_CNT
            DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"TOKEN_NAME", "WEAKNESS"
                    ,"VALUE", CCS_EFFECT_RATE2
            }
            CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "TARGET_HEADCOUNT", TOSTR(MEM_CNT))
        NEXT
    ;◆阻め茨
    CASE "K30_UNIQUE_BLOCK_THORN"
        ;コスト消費
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "Skill_0.mp3"
        ;敵にトークン付与
        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        FOR LOCAL, 0, MEM_CNT
            DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
            {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "TRAPPED"
                ,"VALUE", CCS_EFFECT_RATE2
            }
        NEXT
        ;味方にトークン付与
        DT_SELECT "CC_ACTOR", @"SIDE = {CCS_ATK_SIDE} AND NOT STATE = '戦闘不能'",, IDX
        FOR LOCAL, 0, RESULT
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", IDX:LOCAL
                    ,"TOKEN_NAME", "BARRIER"
                    ,"VALUE", CCS_EFFECT_RATE3
            }
        NEXT

ENDSELECT

;クールタイム処理
CALL CCS_ADD_COOLTIME()

RETURN TRIGGER_ID

;-------------------------------------------------
; パーティー全体に作用するトークン追加スキル
;-------------------------------------------------
@CC_ACTIVESKILL_ADD_TOKEN_TO_ALL_ALLY(ATTACKER_DID, DEFENDER_DID, XML_SKILL)
; #region
#DIM  ATTACKER_DID
#DIM  DEFENDER_DID
#DIMS XML_SKILL

#DIM TRIGGER_ID
#DIM BLOCK
#DIM DYNAMIC SEQUENCE

#DIM MEM_CNT
#DIM IDX, CC_MAX_MEMBER_NUM /2

;スキル処理用パラメータの初期化と取得
CALL CC_SKILL_TRIGGER_INIT(ATTACKER_DID, DEFENDER_DID, XML_SKILL, "ADD_NEW_BLOCK_TO_BOTTOM")
TRIGGER_ID = RESULT

SELECTCASE CCS_SKILL_DEF_NAME
    ;◆グラーヴェ
    CASE "K24_UNIQUE_SKILL_GRAVE"
        ;コスト消費
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "Skill_0.mp3"
        ;トークン付与
        DT_SELECT "CC_ACTOR", @"SIDE = {CCS_ATK_SIDE} AND NOT STATE = '戦闘不能'",, IDX
        FOR LOCAL, 0, RESULT
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", IDX:LOCAL
                    ,"TOKEN_NAME", "GUARD"
                    ,"VALUE", CCS_EFFECT_RATE2
            }
        NEXT

ENDSELECT

;クールタイム処理
CALL CCS_ADD_COOLTIME()

RETURN TRIGGER_ID


code:
;-------------------------------------------------
; バッドステータス付与系スキル
;-------------------------------------------------
@CC_ACTIVESKILL_INFLICT_STUN(ATTACKER_DID, DEFENDER_DID, XML_SKILL)
; #region
#DIM ATTACKER_DID
#DIM DEFENDER_DID
#DIMS XML_SKILL

#DIM TRIGGER_ID
#DIM BLOCK
#DIM DYNAMIC SEQUENCE

#DIM ACTION_DID
#DIM MEM_CNT
#DIM IDX, CC_MAX_MEMBER_NUM /2
#DIM COLLATERAL_DAMAGE_TARGET, CC_MAX_MEMBER_NUM /2
#DIM COLLATERAL_DAMAGE_RANGE, CC_MAX_MEMBER_NUM /2

;スキル処理用パラメータの初期化と取得
CALL CC_SKILL_TRIGGER_INIT(ATTACKER_DID, DEFENDER_DID, XML_SKILL, "ADD_NEW_BLOCK_TO_BOTTOM")
TRIGGER_ID = RESULT

;効果
SELECTCASE CCS_SKILL_DEF_NAME
    CASE "STUN_ROAR"
        CC_SE '= "Roar_0.mp3"
        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        FOR LOCAL, 0, MEM_CNT
            DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ADD_ABNORMALITY"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"TOKEN_NAME", "STUN"
                    ,"VALUE", 1
                    ,"SUCCESS_RATE", CCS_EFFECT_RATE
                    ,"ENHANCE_REGIST_AFTER_INFLICT", 5
            }
        NEXT

        ;ショックボルト
    CASE "ACT_SHOCK_BOLT"
        CC_SE '= "Shot_0.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100
        }
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_ABNORMALITY"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "STUN"
                ,"VALUE", 1
                ,"SUCCESS_RATE", CCS_EFFECT_RATE
                ,"ENHANCE_REGIST_AFTER_INFLICT", 10
                ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
        }

        ;影縫いの術
    CASE "ACT_SHADOW_SEWING"
        CC_SE '= "Wind_0.mp3"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE2
        }
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_ABNORMALITY"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "STUN"
                ,"VALUE", 1
                ,"SUCCESS_RATE", 120
                ,"ENHANCE_REGIST_AFTER_INFLICT", 10
                ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
        }

        ;ハンマーフォール
    CASE "ACT_HAMMER_FALL"
        CC_SE '= "Shot_0.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE2
        }
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_ABNORMALITY"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "STUN"
                ,"VALUE", 1
                ,"SUCCESS_RATE", CCS_EFFECT_RATE
                ,"ENHANCE_REGIST_AFTER_INFLICT", 10
                ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
        }

        ;牽制攻撃
    CASE "ACT_STUN_ENEMY"
        CC_SE '= "Whip_2.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100
        }
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_ABNORMALITY"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "STUN"
                ,"VALUE", 1
                ,"SUCCESS_RATE", CCS_EFFECT_RATE
                ,"ENHANCE_REGIST_AFTER_INFLICT", 20
                ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
        }
        ;竜の戦吼
    CASE "K26_UNIQUE_SKILL_STUN_ROAR", "ENEMY_SKILL_DRAGON_ROAR"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "Roar_1.mp3"
        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        FOR LOCAL, 0, MEM_CNT
            DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ADD_ABNORMALITY"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"TOKEN_NAME", "STUN"
                    ,"VALUE", 1
                    ,"SUCCESS_RATE", CCS_EFFECT_RATE2
                    ,"ENHANCE_REGIST_AFTER_INFLICT", 5
            }
        NEXT

        ;縛霊返し
    CASE "ENEMY_STUN_REBOUND"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "Ice_0.mp3"
        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        FOR LOCAL, 0, MEM_CNT
            DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"DAMAGE_MODIFIER", CCS_EFFECT_RATE2
            }
            CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "COUNTER_PROHIBITED", "1")
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ADD_ABNORMALITY"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"TOKEN_NAME", "STUN"
                    ,"VALUE", 1
                    ,"SUCCESS_RATE", CCS_EFFECT_RATE3
                    ,"ENHANCE_REGIST_AFTER_INFLICT", 5
            }
        NEXT

    CASEELSE
ENDSELECT

;クールタイム処理
CALL CCS_ADD_COOLTIME()

RETURN TRIGGER_ID
; #endregion

;-------------------------------------------------
;毒攻撃
;-------------------------------------------------
@CC_ACTIVESKILL_INFLICT_POISON(ATTACKER_DID, DEFENDER_DID, XML_SKILL)
; #region
#DIM  ATTACKER_DID
#DIM  DEFENDER_DID
#DIMS XML_SKILL

#DIM TRIGGER_ID
#DIM BLOCK
#DIM DYNAMIC SEQUENCE

#DIM MEM_CNT
#DIM IDX, CC_MAX_MEMBER_NUM /2

;スキル処理用パラメータの初期化と取得
CALL CC_SKILL_TRIGGER_INIT(ATTACKER_DID, DEFENDER_DID, XML_SKILL, "ADD_NEW_BLOCK_TO_BOTTOM")
TRIGGER_ID = RESULT

;効果
CC_SE '= "Slash_5.mp3"
SELECTCASE CCS_SKILL_DEF_NAME
    CASE "POISON_ATTACK"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100
        }
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "POISON"
                ,"VALUE", CCS_EFFECT_RATE
                ,"SUCCESS_RATE", 90
                ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
        }

    CASE "WRAITHLORD_POISON"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 180
        }
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "POISON"
                ,"VALUE", CCS_EFFECT_RATE
                ,"SUCCESS_RATE", 150
                ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
        }

        ;◆燻毒の術
    CASE "ACT_SHINOBI_POISON"
        CALL CC_COST_ITEM_TOCAST(ATTACKER_DID, CCS_SKILL_DEF_NAME)
        IF RESULT
            MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
            FOR LOCAL, 0, MEM_CNT
                DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
                {
                    DT_ROW_ADD "CC_ACTION"
                        ,"TRIGGER_ID", TRIGGER_ID

                        ,"SEQUENCE", SEQUENCE++
                        ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                        ,"ACTOR_DID", ATTACKER_DID
                        ,"TARGET_DID", DEFENDER_DID
                        ,"DAMAGE_MODIFIER", 100
                }
                {
                    DT_ROW_ADD "CC_ACTION"
                        ,"TRIGGER_ID", TRIGGER_ID

                        ,"SEQUENCE", SEQUENCE++
                        ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                        ,"ACTOR_DID", ATTACKER_DID
                        ,"TARGET_DID", DEFENDER_DID
                        ,"TOKEN_NAME", "POISON"
                        ,"VALUE", CCS_EFFECT_RATE
                        ,"SUCCESS_RATE", 100
                        ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
                }
            NEXT
        ELSE
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_MESSAGE"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
            }
            CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "LACK_ITEM", "1")
            RETURN TRIGGER_ID
        ENDIF
        ;◆燻毒の術（エネミー）
    CASE "ACT_ENEMY_SHINOBI_POISON"
        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        FOR LOCAL, 0, MEM_CNT
            DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"DAMAGE_MODIFIER", 100
            }
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"TOKEN_NAME", "POISON"
                    ,"VALUE", CCS_EFFECT_RATE
                    ,"SUCCESS_RATE", 100
                    ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
            }
        NEXT

        ;◆オレの肉の味
    CASE "K18_UNIQUE_MY_POISON"
        CALL CC_COST_ITEM_TOCAST(ATTACKER_DID, CCS_SKILL_DEF_NAME)
        IF RESULT
            CC_SE '= "Poison_0.mp3"
            ;全体に毒を付与するブロック
            MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
            FOR LOCAL, 0, MEM_CNT
                DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
                {
                    DT_ROW_ADD "CC_ACTION"
                        ,"TRIGGER_ID", TRIGGER_ID

                        ,"SEQUENCE", SEQUENCE++
                        ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                        ,"ACTOR_DID", ATTACKER_DID
                        ,"TARGET_DID", DEFENDER_DID
                        ,"TOKEN_NAME", "POISON"
                        ,"VALUE", CCS_EFFECT_RATE
                        ,"SUCCESS_RATE", 100
                }
            NEXT
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", ATTACKER_DID
                    ,"TOKEN_NAME", "GUARD"
                    ,"VALUE", CCS_EFFECT_RATE2
            }
        ELSE
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_MESSAGE"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
            }
            CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "LACK_ITEM", "1")
            RETURN TRIGGER_ID
        ENDIF
        ;◆引き撃ち
    CASE "ENEMY_PARTHIAN_SHOT"
        CC_SE '= "Hit_0.mp3"
        ;いったん一撃離脱トークンをゼロに戻してから改めて付与
        CALL CC_SET_SP_TOKEN(ATTACKER_DID, "HIT_AND_RUN", 0)
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE2
        }
        CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "COUNTER_PROHIBITED", "1")
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "POISON"
                ,"VALUE", CCS_EFFECT_RATE
                ,"SUCCESS_RATE", 100
                ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
        }
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", ATTACKER_DID
                ,"TOKEN_NAME", "HIT_AND_RUN"
                ,"VALUE", CCS_EFFECT_RATE3
        }
        ;◆枯れろ華よ
    CASE "UNIQUE_WITHER_FLOWER"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "POISON"
                ,"VALUE", CCS_EFFECT_RATE2
                ,"SUCCESS_RATE", 100
                ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
        }
		{
			DT_ROW_ADD "CC_ACTION"
				,"TRIGGER_ID", TRIGGER_ID
				,"SEQUENCE", SEQUENCE++
				,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
				,"TOKEN_NAME", "FRAGILE"
				,"VALUE", CCS_EFFECT_RATE2
		}
ENDSELECT

;クールタイム処理
CALL CCS_ADD_COOLTIME()

RETURN TRIGGER_ID
; #endregion

;-------------------------------------------------
;燃焼攻撃
;-------------------------------------------------
@CC_ACTIVESKILL_INFLICT_BURN(ATTACKER_DID, DEFENDER_DID, XML_SKILL)
; #region
#DIM  ATTACKER_DID
#DIM  DEFENDER_DID
#DIMS XML_SKILL

#DIM TRIGGER_ID
#DIM BLOCK
#DIM DYNAMIC SEQUENCE

#DIM ACTION_DID
#DIM MEM_CNT
#DIM IDX, CC_MAX_MEMBER_NUM /2
#DIM COLLATERAL_DAMAGE_TARGET, CC_MAX_MEMBER_NUM /2
#DIM COLLATERAL_TARGET_RANGE, CC_MAX_MEMBER_NUM /2

;スキル処理用パラメータの初期化と取得
CALL CC_SKILL_TRIGGER_INIT(ATTACKER_DID, DEFENDER_DID, XML_SKILL, "ADD_NEW_BLOCK_TO_BOTTOM")
TRIGGER_ID = RESULT

;効果
CC_SE '= "Slash_5.mp3"
SELECTCASE CCS_SKILL_DEF_NAME
    CASE "LAVA_FIELD", "BURN_ATTACK"
        CC_SE '= "Fire_0.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100
        }
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "BURN"
                ,"VALUE", CCS_EFFECT_RATE
                ,"SUCCESS_RATE", 100
                ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
        }

    CASE "ACT_IGNITE"
        CC_SE '= "Fire_0.mp3"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100
        }
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "BURN"
                ,"VALUE", CCS_EFFECT_RATE2
                ,"SUCCESS_RATE", 100
                ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
        }
        ;◆火遁の術
    CASE "ACT_SHINOBI_FIRE"
        CALL CC_COST_ITEM_TOCAST(ATTACKER_DID, CCS_SKILL_DEF_NAME)
        IF RESULT
            CC_SE '= "Fire_1.mp3"
            MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
            FOR LOCAL, 0, MEM_CNT
                DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
                {
                    DT_ROW_ADD "CC_ACTION"
                        ,"TRIGGER_ID", TRIGGER_ID

                        ,"SEQUENCE", SEQUENCE++
                        ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                        ,"ACTOR_DID", ATTACKER_DID
                        ,"TARGET_DID", DEFENDER_DID
                        ,"DAMAGE_MODIFIER", 100
                }
                {
                    DT_ROW_ADD "CC_ACTION"
                        ,"TRIGGER_ID", TRIGGER_ID

                        ,"SEQUENCE", SEQUENCE++
                        ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                        ,"ACTOR_DID", ATTACKER_DID
                        ,"TARGET_DID", DEFENDER_DID
                        ,"TOKEN_NAME", "BURN"
                        ,"VALUE", CCS_EFFECT_RATE
                        ,"SUCCESS_RATE", 100
                        ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
                }
            NEXT
        ELSE
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_MESSAGE"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
            }
            CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "LACK_ITEM", "1")
            RETURN TRIGGER_ID
        ENDIF
        ;◆竜の爪雷  デメリットとして攻撃者「自身」に燃焼を付与する仕様
    CASE "K26_UNIQUE_SKILL_THUNDER_CROW", "ENEMY_SKILL_THUNDER_CROW"
        VARS TARGET_LIST
        CC_SE '= "Thunder_0.mp3"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE2
        }
        ACTION_DID = RESULT

        ;巻き添えターゲットの取得
        MEM_CNT = CC_GET_COLLATERAL_DAMAGE_TARGETS(COLLATERAL_DAMAGE_TARGET, COLLATERAL_TARGET_RANGE)
        CALL CC_SET_ACT_FLAG_BY_ID(ACTION_DID, "TARGET_HEADCOUNT", TOSTR(MEM_CNT + 1))

        FOR LOCAL, 0, MEM_CNT
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", COLLATERAL_DAMAGE_TARGET:LOCAL
                    ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE2
            }
            CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "COUNTER_PROHIBITED", "1")
        NEXT
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", ATTACKER_DID
                ,"TOKEN_NAME", "BURN"
                ,"VALUE", CCS_EFFECT_RATE3
                ,"SUCCESS_RATE", 100
        }
        ;◆火だるま 燃焼が付与されると、それを消費して発動するカウンター型スキル
    CASE "ENEMY_SELF_IGNITON"
        CC_SE '= "Fire_0.mp3"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE2
        }
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "BURN"
                ,"VALUE", CCS_EFFECT_RATE3
                ,"SUCCESS_RATE", 100
                ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
        }
        CALL CC_SET_SP_TOKEN(ATTACKER_DID, "BURN", 0)
    CASEELSE
ENDSELECT

;クールタイム処理
CALL CCS_ADD_COOLTIME()

RETURN TRIGGER_ID
; #endregion

;-------------------------------------------------
;魅了攻撃
;-------------------------------------------------
@CC_ACTIVESKILL_INFLICT_ESTRUS(ATTACKER_DID, DEFENDER_DID, XML_SKILL)
; #region
#DIM  ATTACKER_DID
#DIM  DEFENDER_DID
#DIMS XML_SKILL

#DIM TRIGGER_ID
#DIM BLOCK
#DIM DYNAMIC SEQUENCE

;スキル処理用パラメータの初期化と取得
CALL CC_SKILL_TRIGGER_INIT(ATTACKER_DID, DEFENDER_DID, XML_SKILL, "ADD_NEW_BLOCK_TO_BOTTOM")
TRIGGER_ID = RESULT

;効果
SELECTCASE CCS_SKILL_DEF_NAME
    CASE "ACT_TEMPTATION"
        CC_SE '= "Poison_0.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ESTRUS"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"VALUE", 1
                ,"SUCCESS_RATE", CCS_EFFECT_RATE
        }

    CASEELSE
ENDSELECT

;クールタイム処理
CALL CCS_ADD_COOLTIME()

RETURN TRIGGER_ID
; #endregion

;-------------------------------------------------
;盲目攻撃
;-------------------------------------------------
@CC_ACTIVESKILL_INFLICT_BLIND(ATTACKER_DID, DEFENDER_DID, XML_SKILL)
; #region
#DIM  ATTACKER_DID
#DIM  DEFENDER_DID
#DIMS XML_SKILL

#DIM TRIGGER_ID
#DIM BLOCK
#DIM DYNAMIC SEQUENCE

#DIM ACTION_DID
#DIM MEM_CNT
#DIM IDX, CC_MAX_MEMBER_NUM /2
#DIM COLLATERAL_DAMAGE_TARGET, CC_MAX_MEMBER_NUM /2
#DIM COLLATERAL_TARGET_RANGE, CC_MAX_MEMBER_NUM /2

;スキル処理用パラメータの初期化と取得
CALL CC_SKILL_TRIGGER_INIT(ATTACKER_DID, DEFENDER_DID, XML_SKILL, "ADD_NEW_BLOCK_TO_BOTTOM")
TRIGGER_ID = RESULT

;効果
SELECTCASE CCS_SKILL_DEF_NAME
        ;◆砂塵嵐
    CASE "ENEMY_ACT_SAND_STORM"
        CC_SE '= "Wind_0.mp3"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        FOR LOCAL, 0, MEM_CNT
            DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"DAMAGE_MODIFIER", 100
            }
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"TOKEN_NAME", "BLIND"
                    ,"VALUE", CCS_EFFECT_RATE3
                    ,"SUCCESS_RATE", CCS_EFFECT_RATE2
                    ,"ENHANCE_REGIST_AFTER_INFLICT", 15
                    ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
            }
        NEXT
        ;◆煙炬の術
    CASE "ACT_SHINOBI_SMOKE"
        VARS TARGET_LIST
        CALL CC_COST_ITEM_TOCAST(ATTACKER_DID, CCS_SKILL_DEF_NAME)
        IF RESULT
            CC_SE '= "Explode_3.mp3"
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"TOKEN_NAME", "BLIND"
                    ,"VALUE", CCS_EFFECT_RATE
                    ,"SUCCESS_RATE", 100
                    ,"ENHANCE_REGIST_AFTER_INFLICT", 15
            }
            ACTION_DID = RESULT

            ;巻き添えターゲットの取得
            MEM_CNT = CC_GET_COLLATERAL_DAMAGE_TARGETS(COLLATERAL_DAMAGE_TARGET, COLLATERAL_TARGET_RANGE)
            CALL CC_SET_ACT_FLAG_BY_ID(ACTION_DID, "TARGET_HEADCOUNT", TOSTR(MEM_CNT + 1))

            FOR LOCAL, 0, MEM_CNT
                {
                    DT_ROW_ADD "CC_ACTION"
                        ,"TRIGGER_ID", TRIGGER_ID

                        ,"SEQUENCE", SEQUENCE++
                        ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                        ,"ACTOR_DID", ATTACKER_DID
                        ,"TARGET_DID", COLLATERAL_DAMAGE_TARGET:LOCAL
                        ,"TOKEN_NAME", "BLIND"
                        ,"VALUE", CCS_EFFECT_RATE
                        ,"SUCCESS_RATE", 100
                        ,"ENHANCE_REGIST_AFTER_INFLICT", 15
                }
                CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "COUNTER_PROHIBITED", "1")
            NEXT
        ELSE
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_MESSAGE"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
            }
            CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "LACK_ITEM", "1")
            RETURN TRIGGER_ID
        ENDIF
        ;◆アルカナフラッシュ
    CASE "ACT_CAST_ADD_BLIND"
        CC_SE '= "Skill_0.mp3"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "BLIND"
                ,"VALUE", CCS_EFFECT_RATE2
                ,"SUCCESS_RATE", CCS_EFFECT_RATE3
                ,"ENHANCE_REGIST_AFTER_INFLICT", 15
                ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
        }

    CASEELSE
ENDSELECT

;クールタイム処理
CALL CCS_ADD_COOLTIME()

RETURN TRIGGER_ID

; #endregion

repo_name: pervysquirrelz/erafl

license: unknown


code:
;-------------------------------------------------
; スキル処理：性的な攻撃
;-------------------------------------------------
;-------------------------------------------------
;@CC_ACTIVESKILL_TORN_CLOTH
;衣装破壊攻撃
;-------------------------------------------------
;region @CC_ACTIVESKILL_TORN_CLOTH
@CC_ACTIVESKILL_TORN_CLOTH(ATTACKER_DID, DEFENDER_DID, _XML_SKILL)
#DIM ATTACKER_DID
#DIM DEFENDER_DID
#DIMS _XML_SKILL
;キャラ情報
#DIMS DYNAMIC ATK_CHARA_NAME
#DIMS DYNAMIC DEF_CHARA_NAME
#DIM DYNAMIC ATK_CHARA_ID
#DIM DYNAMIC DEF_CHARA_ID
;装備情報
#DIM  DYNAMIC EQUIP_DID
;スキル情報
#DIMS DYNAMIC SKILL_DEF_NAME
#DIMS DYNAMIC SKILL_NAME
#DIM  DYNAMIC SKILL_LV
#DIM  DYNAMIC SKILL_COOLTIME
#DIM  DYNAMIC EFFECT_RATE
#DIM  DYNAMIC SKILL_SLOT
#DIM  DYNAMIC SKILL_SLOT_DID
;スキル固有の変数
#DIMS DYNAMIC 衣装描写

;キャラ名を取得
ATK_CHARA_NAME = %DT_CELL_GETS("CC_ACTOR", ATTACKER_DID, "CHARA_NAME", 1)%
DEF_CHARA_NAME = %DT_CELL_GETS("CC_ACTOR", DEFENDER_DID, "CHARA_NAME", 1)%
;キャラ登録番号を取得
ATK_CHARA_ID = DT_CELL_GET("CC_ACTOR", ATTACKER_DID, "CHARA_ID", 1)
DEF_CHARA_ID = DT_CELL_GET("CC_ACTOR", DEFENDER_DID, "CHARA_ID", 1)
;アクティブスキルのスロット番号を取得
SKILL_SLOT = DT_CELL_GET("CC_ACTOR", ATTACKER_DID, "SELECTED_SKILL_SLOT", 1)
;スキル発動に使用した装備情報を取得、装備スキルでなければ0
IF ATK_CHARA_ID != -1
    DT_SELECT "CC_SKILL_SLOT",@"CHARA_ID = {ATK_CHARA_ID} AND SKILL_SLOT_IDX = {SKILL_SLOT}",, SKILL_SLOT_DID
    EQUIP_DID = DT_CELL_GET("CC_SKILL_SLOT", SKILL_SLOT_DID, "EQUIP_DID", 1)
ENDIF

;スキル定義情報の取得
CALL SKILL_GET_PARAMS_TO_TABLE(_XML_SKILL, ATTACKER_DID)
SIF !RESULT
    RETURN 0
SKILL_DEF_NAME       =  %DT_CELL_GETS("SKILL_PARAMS", 0, "SKILL_DEF_NAME")%
SKILL_NAME       =  %DT_CELL_GETS("SKILL_PARAMS", 0, "SKILL_NAME")%
EFFECT_RATE      = DT_CELL_GET("SKILL_PARAMS", 0, "EFFECT_RATE")
SKILL_COOLTIME   = DT_CELL_GET("SKILL_PARAMS", 0, "COOLTIME")

;盲目による命中判定
IF CC_SP_TOKEN_NUM(ATTACKER_DID, "BLIND")
    SELECTCASE RAND:2
        CASE 0
            CALL CC_PRINT(@"%ATK_CHARA_NAME%の攻撃は%DEF_CHARA_NAME%に命中しなかった…（@C:{カラー_オリーブ}@盲目状態によるミス！@/C@）")
            GOTO SKIPTORNCLOTH
        CASEELSE
    ENDSELECT
ENDIF

;効果
SELECTCASE SKILL_DEF_NAME
    CASE "ACT_TORN_CLOTH"
        SIF DEF_CHARA_ID == -1
            RETURN 0
        SIF C_COND("露出_胸:露出",,DEF_CHARA_ID) && C_COND("露出_秘部:露出",,DEF_CHARA_ID)
            RETURN 0
        CALL CC_PRINT(@"%ATK_CHARA_NAME%のスキル：@C:{カラー_注意}@<%SKILL_NAME%>@/C@が発動！")
        IF RAND:2 && !C_COND("露出_胸:露出",,DEF_CHARA_ID)
            衣装描写 = %C_COND_MAP_GETS(DEF_CHARA_ID, "被覆衣装描写_胸")%
            CALL CC_PRINT(@"%ATK_CHARA_NAME%の攻撃によって%DEF_CHARA_NAME%の@C:{カラー_ピンク}@%衣装描写%@/C@は無惨に引き裂かれてしまった…！")
            CALL HO_STRIP(DEF_CHARA_ID, 被覆部位_乳首, 衣装状態_破, 1)
            SIF C_COND("露出_胸:露出",,DEF_CHARA_ID)
                CALL CC_SET_SP_TOKEN(DEFENDER_DID, "CHEST_EXPOSE", 1)
        ELSE
            衣装描写 = %C_COND_MAP_GETS(DEF_CHARA_ID, "被覆衣装描写_秘部")%
            CALL CC_PRINT(@"%ATK_CHARA_NAME%の攻撃によって%DEF_CHARA_NAME%の@C:{カラー_ピンク}@%衣装描写%@/C@は無惨に引き裂かれてしまった…！")
            CALL HO_STRIP(DEF_CHARA_ID, 被覆部位_秘部, 衣装状態_破, 1)
            SIF C_COND("露出_秘部:露出",,DEF_CHARA_ID)
                CALL CC_SET_SP_TOKEN(DEFENDER_DID, "GENITAL_EXPOSE", 1)
        ENDIF
ENDSELECT
CC_SE '= "Tear_0.mp3"

$SKIPTORNCLOTH

;クールタイム
IF ATK_CHARA_ID != -1 && SKILL_SLOT != -1
    DT_CELL_SET "CC_SKILL_SLOT", SKILL_SLOT_DID, "COOLTIME", SKILL_COOLTIME, 1
ENDIF

RETURN 1
;#endregion

;-------------------------------------------------
;@CC_ACTIVESKILL_MOLESTATION
;愛撫攻撃
;-------------------------------------------------
;region @CC_ACTIVESKILL_MOLESTATION
@CC_ACTIVESKILL_MOLESTATION(ATTACKER_DID, DEFENDER_DID, XML_SKILL)
; #region
#DIM ATTACKER_DID
#DIM DEFENDER_DID
#DIMS XML_SKILL

;スキル固有の変数
#DIM  DYNAMIC 性攻撃ダメージ
#DIMS DYNAMIC 衣装描写
#DIM  DYNAMIC HP
#DIM  CONST 抽選_衣装破壊_胸 = 1
#DIM  CONST 抽選_衣装破壊_秘部 = 2
#DIM  CONST 抽選_愛撫_秘部 = 3
#DIM  CONST 抽選_愛撫_胸 = 4
#DIM  CONST 抽選_愛撫_乳首 = 5
#DIM  CONST 抽選_愛撫_手コキ = 6
#DIM  CONST 抽選_愛撫_玉 = 7

;スキル処理用パラメータの初期化と取得
CALL CCS_INIT_PARAM()
CALL CCS_SET_PARAM(ATTACKER_DID, DEFENDER_DID, XML_SKILL)

SIF CCS_DEF_CHARA_ID == -1
    RETURN 0

;行動抽選の設定
CALL RAND_WT_INIT()
SIF !C_COND("露出_胸:露出",,CCS_DEF_CHARA_ID)
    CALL RAND_WT_SET(抽選_衣装破壊_胸, 100)
SIF !C_COND("露出_秘部:露出",,CCS_DEF_CHARA_ID)
    CALL RAND_WT_SET(抽選_衣装破壊_秘部, 100)
SIF HAS_VAGINA(CCS_DEF_CHARA_ID)
    CALL RAND_WT_SET(抽選_愛撫_秘部, 75)
IF HAS_PENIS(CCS_DEF_CHARA_ID)
    CALL RAND_WT_SET(抽選_愛撫_手コキ, 75)
    CALL RAND_WT_SET(抽選_愛撫_玉, 45)
ENDIF

CALL RAND_WT_SET(抽選_愛撫_乳首, 75)
CALL RAND_WT_SET(抽選_愛撫_胸, 75)

CALL CC_PRINT(@"%CCS_ATK_CHARA_NAME%のスキル：@C:{カラー_注意}@<%CCS_SKILL_NAME%>@/C@が発動！")

;盲目による命中判定
IF CC_SP_TOKEN_NUM(ATTACKER_DID, "BLIND")
    SELECTCASE RAND:2
        CASE 0
            CALL CC_PRINT(@"%CCS_ATK_CHARA_NAME%の攻撃は%CCS_DEF_CHARA_NAME%に命中しなかった…（@C:{カラー_オリーブ}@盲目状態によるミス！@/C@）")
            GOTO SKIPMOLESTATION
        CASEELSE
    ENDSELECT
ENDIF

;効果処理
SELECTCASE RAND_WT_RESULT()
    CASE 抽選_衣装破壊_胸
        衣装描写 = %C_COND_MAP_GETS(CCS_DEF_CHARA_ID, "被覆衣装描写_胸")%
        CALL CC_PRINT(@"%CCS_ATK_CHARA_NAME%の攻撃によって%CCS_DEF_CHARA_NAME%の@C:{カラー_ピンク}@%衣装描写%@/C@は無惨に引き裂かれてしまった…！")
        CALL HO_STRIP(CCS_DEF_CHARA_ID, 被覆部位_乳首, 衣装状態_破, 1)
        SIF C_COND("露出_胸:露出",,CCS_DEF_CHARA_ID)
            CALL CC_SET_SP_TOKEN(DEFENDER_DID, "CHEST_EXPOSE", 1)
        CC_SE '= "Tear_0.mp3"
    CASE 抽選_衣装破壊_秘部
        衣装描写 = %C_COND_MAP_GETS(CCS_DEF_CHARA_ID, "被覆衣装描写_秘部")%
        CALL CC_PRINT(@"%CCS_ATK_CHARA_NAME%の攻撃によって%CCS_DEF_CHARA_NAME%の@C:{カラー_ピンク}@%衣装描写%@/C@は無惨に引き裂かれてしまった…！")
        CALL HO_STRIP(CCS_DEF_CHARA_ID, 被覆部位_秘部, 衣装状態_破, 1)
        SIF C_COND("露出_秘部:露出",,CCS_DEF_CHARA_ID)
            CALL CC_SET_SP_TOKEN(DEFENDER_DID, "GENITAL_EXPOSE", 1)
        CC_SE '= "Tear_0.mp3"
    CASE 抽選_愛撫_胸
        CALL CLOSE_COMBAT_MOLESTATION_NIPPLE_SUCK(ATTACKER_DID, DEFENDER_DID)
        性攻撃ダメージ = RESULT
        CC_SE '= "Poison_0.mp3"
    CASE 抽選_愛撫_秘部
        CALL CLOSE_COMBAT_MOLESTATION_PUSSY(ATTACKER_DID, DEFENDER_DID)
        性攻撃ダメージ = RESULT
        CC_SE '= "Poison_0.mp3"
    CASE 抽選_愛撫_乳首
        CALL CLOSE_COMBAT_MOLESTATION_BREAST(ATTACKER_DID, DEFENDER_DID)
        性攻撃ダメージ = RESULT
        CC_SE '= "Poison_0.mp3"
    CASE 抽選_愛撫_手コキ
        CALL CLOSE_COMBAT_HANDJOB(ATTACKER_DID, DEFENDER_DID)
        性攻撃ダメージ = RESULT
        CC_SE '= "Poison_0.mp3"
    CASE 抽選_愛撫_玉
        CALL CLOSE_COMBAT_MOLESTATION_TAMA(ATTACKER_DID, DEFENDER_DID)
        性攻撃ダメージ = RESULT
        CC_SE '= "Poison_0.mp3"
    CASEELSE
        RETURN 0
ENDSELECT

IF 性攻撃ダメージ > 0
    ;防御側HP取得
    HP = DT_CELL_GET("CC_ACTOR", DEFENDER_DID, "HP", 1)
    HP = MAX(HP - 性攻撃ダメージ, 0)
    DT_CELL_SET "CC_ACTOR", DEFENDER_DID, "HP", HP, 1
    CALL CC_PRINT(@"%CCS_ATK_CHARA_NAME%の性攻撃は%CCS_DEF_CHARA_NAME%に@C:{カラー_ピンク}@{性攻撃ダメージ}@/C@ダメージを与えた")
    CALL CC_CHECK_KNOCKED_OUT(DEFENDER_DID)
ENDIF

$SKIPMOLESTATION

;クールタイム加算
CALL CCS_ADD_COOLTIME()
;性攻撃用ソースチェック
CALL CC_SOURCE_CHECK(DEFENDER_DID)

RETURN 1
;#endregion


code:
;-------------------------------------------------
;通常攻撃
;-------------------------------------------------
@CC_ACTIVESKILL_NORMAL_ATTACK_INIT(ATTACKER_DID)
#DIM  ATTACKER_DID
;攻撃前の初期処理
;通常攻撃の基礎補正
CC_FLAG_NORMAL_ATTACK_ALL = 0
CC_NUMBER_OF_NORMAL_ATTACKS = 1
CC_NORMAL_ATTACK_BASE_DAMAGE_RATE = 100
CC_NORMAL_ATTACK_BASE_CRITICAL_RATE = DT_CELL_GET("CC_ACTOR", ATTACKER_DID, "CRITICAL_RATE", 1)
CC_NORMAL_ATTACK_BASE_CRITICAL_DAMAGE_RATE = DT_CELL_GET("CC_ACTOR", ATTACKER_DID, "CRITICAL_DAMAGE_RATE", 1)
SIF CC_NORMAL_ATTACK_BASE_CRITICAL_DAMAGE_RATE == 0
    CC_NORMAL_ATTACK_BASE_CRITICAL_DAMAGE_RATE = 120

@CC_EXEC_NORMAL_ATTACK(ATTACKER_DID, DEFENDER_DID)
; #region
#DIM  ATTACKER_DID
#DIM  DEFENDER_DID

#DIM TRIGGER_ID
#DIM DYNAMIC SEQUENCE
#DIM ACTION_DID

#DIM TARGET_LIST, CC_MAX_MEMBER_NUM
#DIM TARGET_NUM

;トークン[追撃]による攻撃回数加算
SIF CC_SP_TOKEN_NUM(ATTACKER_DID, "ADD_ATTACK") > 0
    CC_NUMBER_OF_NORMAL_ATTACKS ++

;ダメージ処理前攻撃側パッシブスキル処理
CALL CC_EXEC_PASSIVE_SKILL("BEFORE_NORMAL_ATTACK", ATTACKER_DID, DEFENDER_DID)
; 武器パッシブスキル処理
CALL CC_EXEC_WPN_PASSIVE_SKILL("BEFORE_NORMAL_ATTACK", ATTACKER_DID, DEFENDER_DID)

CALL CC_ACTION_MANAGER_("RESOLVE")

IF CC_FLAG_NORMAL_ATTACK_ALL
    TARGET_NUM = DT_SELECT("CC_ACTOR", @"SIDE = {DT_CELL_GET("CC_ACTOR", DEFENDER_DID, "SIDE", 1)} AND STATE <> '戦闘不能'",, TARGET_LIST)
ELSE
    TARGET_NUM = 1
    TARGET_LIST:0 = DEFENDER_DID
ENDIF

;通常攻撃本体
VARI ITER_I
VARI ITER_J
FOR ITER_I, 0, CC_NUMBER_OF_NORMAL_ATTACKS
    CALL CC_PRINT(@"@S:1@<%DT_CELL_GETS("CC_ACTOR", ATTACKER_DID, "CHARA_NAME", 1)%の%CC_FLAG_NORMAL_ATTACK_ALL ? "全体" # ""%%ITER_I == 0 ? "攻撃" # @"追撃({ITER_I})"%>@/S@")

    ;ON_NORMAL_ATTACKパッシブでいじる通常攻撃毎の補正値。
    CC_NORMAL_ATTACK_DAMAGE_MODIFIER = 0
    CC_NORMAL_ATTACK_CRITICAL_RATE_MODIFIER = 0
    CC_NORMAL_ATTACK_CRITICAL_DAMAGE_MODIFIER = 0

    ;全体攻撃か否かに関わらず、通常攻撃/追撃ごとに1回発動(ATTACKER自身へのバフを想定)。
    ;攻撃成功時の追加効果(各TARGETへのデバフを想定)はCC_ACTION_ATTACK内のAFTER_NORMAL_ATTACKから発動
    CALL CC_EXEC_PASSIVE_SKILL("ON_NORMAL_ATTACK", ATTACKER_DID, DEFENDER_DID)

    ;通常攻撃は1発毎に別スキル扱い。
    CALL CC_ACTION_MANAGER_("ADD_NEW_BLOCK_TO_BOTTOM")
    {
        DT_ROW_ADD "CC_TRIGGERED_SKILL"
            ,"BLOCK", RESULT
            ,"SKILL_SEQUENCE", RESULT:1
            ,"SKILL_DEF_NAME", "NORMAL_ATTACK"
            ,"SKILL_NAME", "通常攻撃"
    }
    TRIGGER_ID = RESULT
    SEQUENCE = 0
    FOR ITER_J, 0, TARGET_NUM
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", TARGET_LIST:ITER_J
                ,"DAMAGE_MODIFIER", CC_NORMAL_ATTACK_BASE_DAMAGE_RATE + CC_NORMAL_ATTACK_DAMAGE_MODIFIER
                ,"CRITICAL_RATE", CC_NORMAL_ATTACK_BASE_CRITICAL_RATE + CC_NORMAL_ATTACK_CRITICAL_RATE_MODIFIER
                ,"CRITICAL_DAMAGE_RATE", CC_NORMAL_ATTACK_BASE_CRITICAL_DAMAGE_RATE + CC_NORMAL_ATTACK_CRITICAL_DAMAGE_MODIFIER
        }
        ACTION_DID = RESULT
        CALL CC_SET_ACT_FLAG_BY_ID(ACTION_DID, "IS_NORMAL_ATTACK", "1")
        SIF LOCAL > 0
            CALL CC_SET_ACT_FLAG_BY_ID(ACTION_DID, "IS_ADDITIONAL_ATTACK", TOSTR(ITER_I))
    NEXT
    ;CALL KOJO_XML_COMBAT_BY_TRIGGER_ID(TRIGGER_ID, "TRIGGER")
    CALL CC_ACTION_MANAGER_("RESOLVE")
    CALL CLOSE_COMBAT_DRAW_WINDOW(ATTACKER_DID)

    SIF DT_CELL_GETS("CC_ACTOR", ATTACKER_DID, "STATE", 1) == "戦闘不能"
        BREAK
    SIF DT_SELECT("CC_ACTOR", @"SIDE = {DT_CELL_GET("CC_ACTOR", DEFENDER_DID, "SIDE", 1)} AND STATE <> '戦闘不能'") == 0
        BREAK
NEXT

; #endregion


code:
;-------------------------------------------------
; スキル処理：未分類
;-------------------------------------------------
;-------------------------------------------------
;回復スキル
;-------------------------------------------------
@CC_ACTIVESKILL_HEAL(ATTACKER_DID, DEFENDER_DID, _XML_SKILL)
; #region
#DIM ATTACKER_DID
#DIM DEFENDER_DID
#DIMS _XML_SKILL

#DIM TRIGGER_ID
#DIM BLOCK
#DIM DYNAMIC SEQUENCE

;スキル固有の変数
#DIM DYNAMIC MAX_HP

;スキル処理用パラメータの初期化と取得
CALL CC_SKILL_TRIGGER_INIT(ATTACKER_DID, DEFENDER_DID, _XML_SKILL, "ADD_NEW_BLOCK_TO_BOTTOM")
TRIGGER_ID = RESULT

;防御側最大HPを取得
MAX_HP = DT_CELL_GET("CC_ACTOR", DEFENDER_DID, "MAX_HP", 1)

SELECTCASE CCS_SKILL_DEF_NAME
    CASE "ACT_ENEMY_HEAL"
        CC_SE '= "Heal_0.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_HEAL"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"VALUE", FTIMES(MAX_HP, CCS_EFFECT_RATE)
        }
ENDSELECT

;クールタイム
CALL CCS_ADD_COOLTIME()

RETURN TRIGGER_ID
; #endregion

;-------------------------------------------------
;キャラクター固有スキル
;将来的には別ファイルに外出したほうがよい
;-------------------------------------------------
;エル固有スキル
@CC_ACTIVESKILL_K7_UNIQUE_SKILL(ATTACKER_DID, DEFENDER_DID, _XML_SKILL)
; #region
#DIM ATTACKER_DID
#DIM DEFENDER_DID
#DIMS _XML_SKILL

#DIM TRIGGER_ID
#DIM BLOCK
#DIM DYNAMIC SEQUENCE

;スキル処理用パラメータの初期化と取得
CALL CC_SKILL_TRIGGER_INIT(ATTACKER_DID, DEFENDER_DID, _XML_SKILL, "ADD_NEW_BLOCK_TO_BOTTOM")
TRIGGER_ID = RESULT

CC_SE '= "Charge_1.mp3"
;攻撃後にガードは1点減算されるので3点付与する
{
    DT_ROW_ADD "CC_ACTION"
        ,"TRIGGER_ID", TRIGGER_ID

        ,"SEQUENCE", SEQUENCE++
        ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
        ,"ACTOR_DID", ATTACKER_DID
        ,"TARGET_DID", ATTACKER_DID
        ,"TOKEN_NAME", "GUARD"
        ,"VALUE", 3
}
{
    DT_ROW_ADD "CC_ACTION"
        ,"TRIGGER_ID", TRIGGER_ID

        ,"SEQUENCE", SEQUENCE++
        ,"FUNCTION_NAME", "CC_ACTION_MODIFY_ABLITY"
        ,"ACTOR_DID", ATTACKER_DID
        ,"TARGET_DID", ATTACKER_DID
        ,"ABLITY_NAME", "MAG"
        ,"VALUE", ABL:CCS_ATK_CHARA_ID:知識
}
{
    DT_ROW_ADD "CC_ACTION"
        ,"TRIGGER_ID", TRIGGER_ID

        ,"SEQUENCE", SEQUENCE++
        ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
        ,"ACTOR_DID", ATTACKER_DID
        ,"TARGET_DID", DEFENDER_DID
        ,"DAMAGE_MODIFIER", 100
}

;クールタイム処理
CALL CCS_ADD_COOLTIME()

RETURN TRIGGER_ID

;シルフィーユ固有スキル
@CC_ACTIVESKILL_K9_UNIQUE_SKILL(ATTACKER_DID, DEFENDER_DID, _XML_SKILL)
; #region
#DIM ATTACKER_DID
#DIM DEFENDER_DID
#DIMS _XML_SKILL

#DIM TRIGGER_ID
#DIM BLOCK
#DIM DYNAMIC SEQUENCE

;スキル処理用パラメータの初期化と取得
CALL CC_SKILL_TRIGGER_INIT(ATTACKER_DID, DEFENDER_DID, _XML_SKILL, "ADD_NEW_BLOCK_TO_BOTTOM")
TRIGGER_ID = RESULT
;効果処理

;破魔の剣
SELECTCASE CCS_SKILL_DEF_NAME
    CASE "K9_UNIQUE_SKILL_MAGIC_BREAK_SWORD"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "Charge_1.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", ATTACKER_DID
                ,"TOKEN_NAME", "STRENGTH"
                ,"VALUE", CCS_EFFECT_RATE2
        }
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", ATTACKER_DID
                ,"TOKEN_NAME", "MAG_BREAK"
                ,"VALUE", CCS_EFFECT_RATE2
        }
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100
        }
ENDSELECT

;クールタイム処理
CALL CCS_ADD_COOLTIME()

RETURN TRIGGER_ID

;アステ固有スキル
@CC_ACTIVESKILL_K26_UNIQUE_SKILL(ATTACKER_DID, DEFENDER_DID, _XML_SKILL)
; #region
#DIM  ATTACKER_DID
#DIM  DEFENDER_DID
#DIMS _XML_SKILL

;ダメージ再計算用
#DIM  DYNAMIC HP
#DIM  DYNAMIC MAX_HP

#DIM TRIGGER_ID
#DIM DYNAMIC SEQUENCE

#DIM MEM_CNT
#DIM IDX, CC_MAX_MEMBER_NUM /2
#DIM DYNAMIC DAMAGE_RATE
#DIM DYNAMIC BURN_RATE

;スキル処理用パラメータの初期化と取得
CALL CC_SKILL_TRIGGER_INIT(ATTACKER_DID, DEFENDER_DID, _XML_SKILL, "ADD_NEW_BLOCK_TO_BOTTOM")
TRIGGER_ID = RESULT
;竜気トークンでダメージ補正 X=1で2倍、X=4で4倍、X=9で6倍くらい
DAMAGE_RATE = 100 * SQRT(CC_SP_TOKEN_NUM(ATTACKER_DID, "DRAGONIC_EFFECT") * 4)
;燃焼トークン数はCCS_EFFECT_RATE1*√竜気トークン、MAX6
BURN_RATE = LIMIT(100 * SQRT(CC_SP_TOKEN_NUM(ATTACKER_DID, "DRAGONIC_EFFECT")), 1, 6)

CC_SE '= "Charge_1.mp3"
MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
FOR LOCAL, 0, MEM_CNT
    DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
    {
        DT_ROW_ADD "CC_ACTION"
            ,"TRIGGER_ID", TRIGGER_ID

            ,"SEQUENCE", SEQUENCE++
            ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
            ,"ACTOR_DID", ATTACKER_DID
            ,"TARGET_DID", DEFENDER_DID
            ,"DAMAGE_MODIFIER", DAMAGE_RATE
    }
NEXT
;スタン処理と燃焼処理を付記
{
    DT_ROW_ADD "CC_ACTION"
        ,"TRIGGER_ID", TRIGGER_ID

        ,"SEQUENCE", SEQUENCE++
        ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
        ,"ACTOR_DID", ATTACKER_DID
        ,"TARGET_DID", ATTACKER_DID
        ,"TOKEN_NAME", "STUN"
        ,"VALUE", 1
        ,"SUCCESS_RATE", 100
}
{
    DT_ROW_ADD "CC_ACTION"
        ,"TRIGGER_ID", TRIGGER_ID

        ,"SEQUENCE", SEQUENCE++
        ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
        ,"ACTOR_DID", ATTACKER_DID
        ,"TARGET_DID", ATTACKER_DID
        ,"TOKEN_NAME", "BURN"
        ,"VALUE", BURN_RATE
        ,"SUCCESS_RATE", 100
}
CALL CC_SET_SP_TOKEN(ATTACKER_DID, "DRAGONIC_EFFECT", 0)

;クールタイム処理
CALL CCS_ADD_COOLTIME()

RETURN TRIGGER_ID

@CC_ACTIVESKILL_DEBUG(ATTACKER_DID, DEFENDER_DID, _XML_SKILL)
; #region
#DIM ATTACKER_DID
#DIM DEFENDER_DID
#DIMS _XML_SKILL

#DIM TRIGGER_ID
#DIM BLOCK
#DIM DYNAMIC SEQUENCE

;スキル処理用パラメータの初期化と取得
CALL CC_SKILL_TRIGGER_INIT(ATTACKER_DID, DEFENDER_DID, _XML_SKILL, "ADD_NEW_BLOCK_TO_BOTTOM")
TRIGGER_ID = RESULT

VARI SKILL_NUM
VARS DEFNAMES, 100

VARI MEM_CNT
VARI IDX, 12

SKILL_NUM = XML_GET(XMLID_SKILL_BATTLE, @"//defname[.//func='ACTIVESKILL_ADD_TOKEN_TO_ALL_ENEMY']/@parentname", DEFNAMES, 1)
FOR LOCAL, 0, SKILL_NUM
    DEBUGPRINTFORML DEFNAMES:{LOCAL}= %DEFNAMES:LOCAL%
    CALL CC_EXEC_SKILL_DEBUG(ATTACKER_DID, DEFENDER_DID, DEFNAMES:LOCAL)
NEXT

SKILL_NUM = XML_GET(XMLID_SKILL_BATTLE, @"//defname[.//func='ACTIVESKILL_SMITE']/@parentname", DEFNAMES, 1)
FOR LOCAL, 0, SKILL_NUM
    CALL CC_SET_SP_TOKEN(ATTACKER_DID, "CAST", 4)
    DEBUGPRINTFORML DEFNAMES:{LOCAL}= %DEFNAMES:LOCAL%
    CALL CC_EXEC_SKILL_DEBUG(ATTACKER_DID, DEFENDER_DID, DEFNAMES:LOCAL)
NEXT

;クールタイム処理
CALL CCS_ADD_COOLTIME()

RETURN TRIGGER_ID

;-------------------------------------------------
;テスト用簡易スキル呼び出し
;スキルスロットからCCSを取得できないのでCC_TRIGGER_TABLE_内などで別途指定
;-------------------------------------------------
@CC_EXEC_SKILL_DEBUG(ATTACKER_DID, DEFENDER_DID, SKILL_DEF_NAME)
#DIM ATTACKER_DID
#DIM DEFENDER_DID
#DIMS SKILL_DEF_NAME

#DIMS DYNAMIC _XML_SKILL

IF STRFIND(SKILL_DEF_NAME, "WPN_") != 0
    XML_GET XMLID_SKILL_BATTLE, @"//defname[@parentname='%SKILL_DEF_NAME%']", _XML_SKILL, 3
ELSE
    XML_GET XMLID_WPN_SKILL_ACTIVE, @"//defname[@parentname='%SKILL_DEF_NAME%']", _XML_SKILL, 3
ENDIF
DEBUGPRINTFORML _XML_SKILL %_XML_SKILL%
XML_GET _XML_SKILL, @"//func", RESULTS, 1
TRYCCALLFORM CC_%RESULTS%(ATTACKER_DID, DEFENDER_DID, _XML_SKILL)
    CALL KOJO_XML_COMBAT_BY_TRIGGER_ID(RESULT, "TRIGGER")
    CALL CC_ACTION_MANAGER_("RESOLVE")
    RETURN 1
CATCH
    DEBUGPRINTFORML CAUTION:@CC_EXEC_SKILL_DEBUG
    DEBUGPRINTFORML スキル<%SKILL_DEF_NAME%>が呼ばれましたが、対応するスキル処理関数が見つかりませんでした
    RETURN 0
ENDCATCH

;-------------------------------------------------
;テスト用スキル
;-------------------------------------------------
@CC_ACTIVESKILL_TEST(ATTACKER_DID, DEFENDER_DID, _XML_SKILL)
; #region
#DIM ATTACKER_DID
#DIM DEFENDER_DID
#DIMS _XML_SKILL
;キャラ情報
#DIMS DYNAMIC ATK_CHARA_NAME
#DIMS DYNAMIC DEF_CHARA_NAME
#DIM DYNAMIC ATK_CHARA_ID
#DIM DYNAMIC DEF_CHARA_ID
;装備情報
#DIM  DYNAMIC EQUIP_DID
;スキル情報
#DIMS DYNAMIC SKILL_DEF_NAME
#DIMS DYNAMIC SKILL_NAME
#DIM  DYNAMIC SKILL_LV
#DIM  DYNAMIC SKILL_COOLTIME
#DIM  DYNAMIC EFFECT_RATE
#DIMS DYNAMIC REQTOKEN_TOCAST
#DIM  DYNAMIC SKILL_SLOT
#DIM  DYNAMIC SKILL_SLOT_DID
;スキル固有の変数
#DIM DYNAMIC MAX_HP

;キャラ名を取得
ATK_CHARA_NAME = %DT_CELL_GETS("CC_ACTOR", ATTACKER_DID, "CHARA_NAME", 1)%
DEF_CHARA_NAME = %DT_CELL_GETS("CC_ACTOR", DEFENDER_DID, "CHARA_NAME", 1)%
;キャラ登録番号を取得
ATK_CHARA_ID = DT_CELL_GET("CC_ACTOR", ATTACKER_DID, "CHARA_ID", 1)
DEF_CHARA_ID = DT_CELL_GET("CC_ACTOR", DEFENDER_DID, "CHARA_ID", 1)
;アクティブスキルのスロット番号を取得
SKILL_SLOT = DT_CELL_GET("CC_ACTOR", ATTACKER_DID, "SELECTED_SKILL_SLOT", 1)
;スキル発動に使用した装備情報を取得、装備スキルでなければ0
IF ATK_CHARA_ID != -1
    DT_SELECT "CC_SKILL_SLOT",@"CHARA_ID = {ATK_CHARA_ID} AND SKILL_SLOT_IDX = {SKILL_SLOT}",, SKILL_SLOT_DID
    EQUIP_DID = DT_CELL_GET("CC_SKILL_SLOT", SKILL_SLOT_DID, "EQUIP_DID", 1)
ENDIF

;スキル定義情報の取得
CALL SKILL_GET_PARAMS_TO_TABLE(_XML_SKILL, ATTACKER_DID, EQUIP_DID)
SIF !RESULT
    RETURN 0
SKILL_DEF_NAME       =  %DT_CELL_GETS("SKILL_PARAMS", 0, "SKILL_DEF_NAME")%
SKILL_NAME       =  %DT_CELL_GETS("SKILL_PARAMS", 0, "SKILL_NAME")%
EFFECT_RATE      = DT_CELL_GET("SKILL_PARAMS", 0, "EFFECT_RATE")
SKILL_COOLTIME   = DT_CELL_GET("SKILL_PARAMS", 0, "COOLTIME")
REQTOKEN_TOCAST   = %DT_CELL_GETS("SKILL_PARAMS", 0, "REQTOKEN_TOCAST")%

;防御側最大HPを取得
MAX_HP = DT_CELL_GET("CC_ACTOR", DEFENDER_DID, "MAX_HP", 1)

;効果
IF CC_MULTI_TARGET_ATTACKED_COUNT == 0
    CALL CC_PRINT(@"%ATK_CHARA_NAME%のスキル：@C:{カラー_注意}@<%SKILL_NAME%>@/C@が発動！")
ENDIF
SELECTCASE SKILL_DEF_NAME
    CASE "ACT_ENEMY_HEAL"
        CC_DAMAGE = FTIMES(MAX_HP, EFFECT_RATE) * -1
        CC_SE '= "Heal_0.mp3"
ENDSELECT

;クールタイム
IF ATK_CHARA_ID != -1 && SKILL_SLOT != -1
    DT_CELL_SET "CC_SKILL_SLOT", SKILL_SLOT_DID, "COOLTIME", SKILL_COOLTIME, 1
ENDIF

RETURN 1


code:
;-------------------------------------------------
;全体に作用するトークン減少スキル
;スタンを回復する鼓舞など
;-------------------------------------------------
@CC_ACTIVESKILL_REMOVE_TOKEN_ALL(ATTACKER_DID, DEFENDER_DID, XML_SKILL)
; #region
#DIM  ATTACKER_DID
#DIM  DEFENDER_DID
#DIMS XML_SKILL

;スキル固有の変数
#DIM  DYNAMIC  SIDE
#DIM  DYNAMIC IDX, CC_MAX_MEMBER_NUM
#DIM  DYNAMIC TOKEN_COUNT

#DIM TRIGGER_ID
#DIM BLOCK
#DIM DYNAMIC SEQUENCE

;スキル処理用パラメータの初期化と取得
CALL CC_SKILL_TRIGGER_INIT(ATTACKER_DID, DEFENDER_DID, XML_SKILL, "ADD_NEW_BLOCK_TO_BOTTOM")
TRIGGER_ID = RESULT

;発動メッセージ
CC_SE '= "Skill_0.mp3"

SELECTCASE CCS_SKILL_DEF_NAME
        ;鼓舞、勇気の歌
    CASE "WPN_RECOVER_STUN_ALL", "ACT_SONG_OF_RECOVER_STUN_ALL"
        ;スキル:チアリングの有無を確認
        VARI CHEERING_LV
        VARI TOKEN_NUM
        CHEERING_LV = HAS_SKILL(CCS_ATK_CHARA_ID, "WPN_CHEERING", スキル_大分類_武器)
        IF CHEERING_LV
            CALL WPN_SKILL_GET_EFFECT_RATE("WPN_CHEERING", CHEERING_LV)
            TOKEN_NUM = RESULT
        ENDIF
        ;スキル発動者と同じ側のメンバーを全員取得(戦闘不能除く)
        DT_SELECT "CC_ACTOR", @"SIDE = {CCS_ATK_SIDE} AND NOT STATE = '戦闘不能'",, IDX
        FOR LOCAL, 0, RESULT
            IF CCS_SKILL_DEF_NAME == "WPN_RECOVER_STUN_ALL"
                ;鼓舞
                {
                    DT_ROW_ADD "CC_ACTION"
                        ,"TRIGGER_ID", TRIGGER_ID
                        ,"SEQUENCE", SEQUENCE++
                        ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                        ,"ACTOR_DID", ATTACKER_DID
                        ,"TARGET_DID", IDX:LOCAL
                        ,"TOKEN_NAME", "REGIST_STUN"
                        ,"VALUE", CCS_EFFECT_RATE
                }
            ELSE
                ;勇気の歌
                CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
                {
                    DT_ROW_ADD "CC_ACTION"
                        ,"TRIGGER_ID", TRIGGER_ID
                        ,"SEQUENCE", SEQUENCE++
                        ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                        ,"ACTOR_DID", ATTACKER_DID
                        ,"TARGET_DID", IDX:LOCAL
                        ,"TOKEN_NAME", "REGIST_STUN"
                        ,"VALUE", CCS_EFFECT_RATE2
                }
            ENDIF
            TOKEN_COUNT = CC_SP_TOKEN_NUM(IDX:LOCAL, "STUN")
            IF TOKEN_COUNT > 0
                {
                    DT_ROW_ADD "CC_ACTION"
                        ,"TRIGGER_ID", TRIGGER_ID
                        ,"SEQUENCE", SEQUENCE++
                        ,"FUNCTION_NAME", "CC_ACTION_SUB_SP_TOKEN"
                        ,"ACTOR_DID", ATTACKER_DID
                        ,"TARGET_DID", IDX:LOCAL
                        ,"TOKEN_NAME", "STUN"
                        ,"VALUE", 1
                }
            ELSE
                {
                    DT_ROW_ADD "CC_ACTION"
                        ,"TRIGGER_ID", TRIGGER_ID
                        ,"SEQUENCE", SEQUENCE++
                        ,"FUNCTION_NAME", "CC_ACTION_MESSAGE"
                        ,"ACTOR_DID", ATTACKER_DID
                        ,"TARGET_DID", IDX:LOCAL
                }
            ENDIF
            ;チアリング効果があるなら強靭トークンを追加
            IF CHEERING_LV > 0
                {
                    DT_ROW_ADD "CC_ACTION"
                        ,"TRIGGER_ID", TRIGGER_ID
                        ,"SEQUENCE", SEQUENCE++
                        ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                        ,"ACTOR_DID", ATTACKER_DID
                        ,"TARGET_DID", IDX:LOCAL
                        ,"TOKEN_NAME", "STRENGTH"
                        ,"VALUE", TOKEN_NUM
                }
            ENDIF
        NEXT

        ;浄化の光
    CASE "K9_UNIQUE_SKILL_LIGHT_PURFICATION"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        ;スキル発動者と同じ側のメンバーを全員取得(戦闘不能除く)
        DT_SELECT "CC_ACTOR", @"SIDE = {CCS_ATK_SIDE} AND NOT STATE = '戦闘不能'",, IDX
        FOR LOCAL, 0, RESULT
            ;Lv1以上、毒
            TOKEN_COUNT = CC_SP_TOKEN_NUM(IDX:LOCAL, "POISON")
            IF TOKEN_COUNT > 0
                {
                    DT_ROW_ADD "CC_ACTION"
                        ,"TRIGGER_ID", TRIGGER_ID
                        ,"SEQUENCE", SEQUENCE++
                        ,"FUNCTION_NAME", "CC_ACTION_SUB_SP_TOKEN"
                        ,"ACTOR_DID", ATTACKER_DID
                        ,"TARGET_DID", IDX:LOCAL
                        ,"TOKEN_NAME", "POISON"
                        ,"VALUE", CCS_EFFECT_RATE2
                }
            ENDIF
            ;Lv2以上、盲目
            IF CCS_SKILL_LV >= 2
                TOKEN_COUNT = CC_SP_TOKEN_NUM(IDX:LOCAL, "BLIND")
                IF TOKEN_COUNT > 0
                    {
                        DT_ROW_ADD "CC_ACTION"
                            ,"TRIGGER_ID", TRIGGER_ID
                            ,"SEQUENCE", SEQUENCE++
                            ,"FUNCTION_NAME", "CC_ACTION_SUB_SP_TOKEN"
                            ,"ACTOR_DID", ATTACKER_DID
                            ,"TARGET_DID", IDX:LOCAL
                            ,"TOKEN_NAME", "BLIND"
                            ,"VALUE", CCS_EFFECT_RATE2
                    }
                ENDIF
            ENDIF
        NEXT
ENDSELECT

;クールタイム処理
CALL CCS_ADD_COOLTIME()

RETURN TRIGGER_ID
; #endregion


code:
;-------------------------------------------------
;強打　他単純な攻撃強化系処理
;-------------------------------------------------
@CC_ACTIVESKILL_SMITE(ATTACKER_DID, DEFENDER_DID, XML_SKILL)
; #region
#DIM  ATTACKER_DID
#DIM  DEFENDER_DID
#DIMS XML_SKILL

;ダメージ再計算用
#DIM  DYNAMIC HP
#DIM  DYNAMIC MAX_HP

#DIM TRIGGER_ID
#DIM DYNAMIC SEQUENCE

#DIM ACTION_DID
#DIM MEM_CNT
#DIM IDX, CC_MAX_MEMBER_NUM /2
#DIM COLLATERAL_DAMAGE_TARGET, CC_MAX_MEMBER_NUM /2
#DIM COLLATERAL_TARGET_RANGE, CC_MAX_MEMBER_NUM /2
#DIM DYNAMIC TOKEN_COUNT
#DIM DYNAMIC SKILL_LV

;スキル処理用パラメータの初期化と取得
CALL CC_SKILL_TRIGGER_INIT(ATTACKER_DID, DEFENDER_DID, XML_SKILL, "ADD_NEW_BLOCK_TO_BOTTOM")
TRIGGER_ID = RESULT

SELECTCASE CCS_SKILL_DEF_NAME
        ;強打
    CASE "SMITE", "WPN_SMITE"
        ;リナのスキル固有処理　対象がスタンかよろめきを所持していると威力増加
        VARI NEKO_SMITE_FLG
        SKILL_LV = CC_HAS_SKILL(ATTACKER_DID, "PSV_UNIQUE_LINA_SMITE")
        IF SKILL_LV > 0 && ((CC_SP_TOKEN_NUM(DEFENDER_DID, "STUN") > 0) || (CC_SP_TOKEN_NUM(DEFENDER_DID, "STAGGER") > 0))
            NEKO_SMITE_FLG = 1
            CCS_EFFECT_RATE += CC_SKILL_GET_LABELED_VALUE_FROM_XML("PSV_UNIQUE_LINA_SMITE", SKILL_LV, "DAMAGE_MODIFIER")
        ENDIF

        CC_SE '= "HeavySlash_0.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE
        }

        ;リナの口上フラグセット
        SIF NEKO_SMITE_FLG
            CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "PSV_UNIQUE_LINA_SMITE", "1")

        ;リュミエールのスキル固有処理
        IF HAS_SKILL(CCS_ATK_CHARA_ID, "K1_UNIQUE_SKILL_SMITE_TWICE")
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE
                    ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, 0, \"ATTACK_SUCCEEDED\") == 0}"
            }
            CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "K1_UNIQUE_SKILL_SMITE_TWICE", "1")
        ENDIF
    CASE "CLEAVE_ATTACK"
        CC_SE '= "HeavySlash_0.mp3"
        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        FOR LOCAL, 0, MEM_CNT
            DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"DAMAGE_MODIFIER", CCS_SKILL_GET_LABELED_VALUE("DAMAGE_MODIFIER") / MEM_CNT
            }
        NEXT
        ;強装弾
    CASE "WPN_HARDSHOT"
        CC_SE '= "Shot_0.mp3"
        CALL CC_COST_ITEM_TOCAST(ATTACKER_DID, CCS_SKILL_DEF_NAME)
        IF RESULT
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE
            }

        ELSE
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_MESSAGE"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
            }
            CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "LACK_ITEM", "1")
            RETURN TRIGGER_ID
        ENDIF
        ;マナボルト
    CASE "ACT_CAST_SMITE"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "Slash_5.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE2
        }

        ;ソーニャユニークスキル固有処理
        IF HAS_SKILL(CCS_ATK_CHARA_ID, "K3_UNIQUE_SKILL_REACT_AFTER_CAST")
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", ATTACKER_DID
                    ,"TOKEN_NAME", "REACT"
                    ,"VALUE", 1
            }
        ENDIF
        ;霜の一閃
    CASE "WPN_FROST_SMITE"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "HeavySlash_1.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE
        }

        ;閃電の矢
    CASE "WPN_ELECTRIC_ARROW"
        ;防御側軽減値無視
        CC_SE '= "HeavySlash_1.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE
                ,"OPTION", "[IGNORE_ARMOR:1]"
        }

        ;致命の一撃
    CASE "ACT_FATAL_ATTACK","WPN_FATAL_ATTACK"
        VARI FATAL
        VARI SKILL_LV
        VARI ACTION_DID
        CC_SE '= "HeavySlash_1.mp3"
        HP = DT_CELL_GET("CC_ACTOR", DEFENDER_DID, "HP", 1)
        MAX_HP = DT_CELL_GET("CC_ACTOR", DEFENDER_DID, "MAX_HP", 1)
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        TOKEN_COUNT = CC_SP_TOKEN_NUM(ATTACKER_DID, "HIDE")
        SIF TOKEN_COUNT > 0
            FATAL = 1
        SIF (HP * 100) / MAX_HP <= 50
            FATAL = 1
        ;俘者への致命打の処理
        IF (CC_SP_TOKEN_NUM(DEFENDER_DID, "TRAPPED") > 0) && (HAS_SKILL(CCS_ATK_CHARA_ID, "TRAPPED_FATAL_ATTACK")  > 0)
            CALL SKILL_GET_EFFECT_RATE(スキル_ジャンル_戦闘, "TRAPPED_FATAL_ATTACK", HAS_SKILL(CCS_ATK_CHARA_ID, "TRAPPED_FATAL_ATTACK"))
            ;致命フラグ判定
            SIF RAND:100 < RESULT
                FATAL = 1
        ENDIF
        IF FATAL
            ;アルノー固有スキルによる補正
            SKILL_LV = HAS_SKILL(CCS_ATK_CHARA_ID, "K17_UNIQUE_FATAL_STING", スキル_大分類_冒険)
            IF SKILL_LV
                CALL SKILL_GET_EFFECT_RATE(スキル_ジャンル_戦闘, "K17_UNIQUE_FATAL_STING", SKILL_LV)
                CCS_EFFECT_RATE += RESULT
                CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "K17_UNIQUE_FATAL_STING", "1")
            ENDIF
            ;俘者への致命打の処理
            SKILL_LV = HAS_SKILL(CCS_ATK_CHARA_ID, "TRAPPED_FATAL_ATTACK", スキル_大分類_冒険)
            IF SKILL_LV
                CALL SKILL_GET_EFFECT_RATE(スキル_ジャンル_戦闘, "TRAPPED_FATAL_ATTACK", SKILL_LV)
                ;よろめき付与判定
                IF RAND:100 < RESULT:1
                    {
                        DT_ROW_ADD "CC_ACTION"
                            ,"TRIGGER_ID", TRIGGER_ID
                            ,"SEQUENCE", SEQUENCE++
                            ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                            ,"ACTOR_DID", ATTACKER_DID
                            ,"TARGET_DID", DEFENDER_DID
                            ,"TOKEN_NAME", "STAGGER"
                            ,"VALUE", 1
                    }
                ENDIF
            ENDIF
        ENDIF
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", FATAL == 1 ? 100 + CCS_EFFECT_RATE # 100
        }
        ACTION_DID = RESULT
        SIF FATAL == 1
            CALL CC_SET_ACT_FLAG_BY_ID(ACTION_DID, "FATAL_ATTACK", "1")
        SIF HAS_SKILL(CCS_ATK_CHARA_ID, "K17_UNIQUE_FATAL_STING")
            CALL CC_SET_ACT_FLAG_BY_ID(ACTION_DID, "K17_UNIQUE_FATAL_STING", "1")
        ;魔刃一閃
    CASE "WPN_MANA_SMITE"
        CC_SE '= "HeavySlash_1.mp3"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)

        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        FOR LOCAL, 0, MEM_CNT
            DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE2
            }
        NEXT

        ;マナストーム
    CASE "ACT_CAST_ATTACK_ALL"
        CC_SE '= "Explode_0.mp3"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)

        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        FOR LOCAL, 0, MEM_CNT
            DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"DAMAGE_MODIFIER", 100
            }
        NEXT

        ;サンダーストーム
    CASE "ACT_THUNDER_STORM"
        CC_SE '= "Explode_0.mp3"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)

        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        FOR LOCAL, 0, MEM_CNT
            DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"DAMAGE_MODIFIER", CCS_EFFECT_RATE2
            }
        NEXT

    CASE "ACT_FIRE_BREATH"
        CC_SE '= "Explode_0.mp3"
        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        FOR LOCAL, 0, MEM_CNT
            DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"DAMAGE_MODIFIER", CCS_EFFECT_RATE
            }
        NEXT

        ;サンドダイブ
    CASE "ENEMY_ACT_SAND_DIVE"
        CC_SE '= "Explode_0.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", ATTACKER_DID
                ,"TOKEN_NAME", "BARRIER"
                ,"VALUE", CCS_EFFECT_RATE2
        }

        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE
        }
    CASE "ACT_CAST_FIRE_BALL"
        VARS TARGET_LIST
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "Explode_0.mp3"

        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", CCS_EFFECT_RATE2
        }
        ACTION_DID = RESULT

        ;巻き添えターゲットの取得
        MEM_CNT = CC_GET_COLLATERAL_DAMAGE_TARGETS(COLLATERAL_DAMAGE_TARGET, COLLATERAL_TARGET_RANGE)
        CALL CC_SET_ACT_FLAG_BY_ID(ACTION_DID, "TARGET_HEADCOUNT", TOSTR(MEM_CNT + 1))

        FOR LOCAL, 0, MEM_CNT
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", COLLATERAL_DAMAGE_TARGET:LOCAL
                    ,"DAMAGE_MODIFIER", CCS_EFFECT_RATE3
            }
            CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "COUNTER_PROHIBITED", "1")
        NEXT

    CASE "ACT_CAST_STONE_RAIN"
        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        TOKEN_COUNT = MIN(CC_SP_TOKEN_NUM(ATTACKER_DID, "CAST"), 10)
        FOR LOCAL, 0, MEM_CNT
            DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
            ;真ん中ぐらいの回数を出やすく
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_MULTIPLE_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"DAMAGE_MODIFIER", CCS_EFFECT_RATE2
                    ,"NUMBER_OF_ATTACKS", (RAND(CCS_EFFECT_RATE3, TOKEN_COUNT + 1) + RAND(CCS_EFFECT_RATE3, 1 + TOKEN_COUNT + 1)) / 2
            }
        NEXT
        CALL CC_SUB_SP_TOKEN(ATTACKER_DID, "CAST", TOKEN_COUNT)

        ;おぞましき鉄槌
    CASE "ACT_ENEMY_WRAITHLORD_CRUSH"
        CC_SE '= "HeavySlash_0.mp3"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        FOR LOCAL, 0, CCS_EFFECT_RATE2
            CALL CLOSE_COMBAT_SET_TARGET(ATTACKER_DID)
            DEFENDER_DID = RESULT
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"DAMAGE_MODIFIER", CCS_EFFECT_RATE
            }
        NEXT

    CASE "WPN_FLAME_THROW"
        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        FOR LOCAL, 0, MEM_CNT
            DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"DAMAGE_MODIFIER", CCS_EFFECT_RATE
            }

            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_INFLICT_ABNORMALITY"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"TOKEN_NAME", "BURN"
                    ,"VALUE", CCS_EFFECT_RATE2
                    ,"SUCCESS_RATE", CCS_EFFECT_RATE3
                    ,"ABORT_CONDITION", "{CC_GET_ACT_FLAG(TRIGGER_ID, SEQUENCE - 1, \"ATTACK_SUCCEEDED\") == 0}"
            }
        NEXT
        ;総威力100%の連続攻撃
[SKIPSTART]
    CASE "EMEMY_MULTI_ATTACK"
        VARI DAMAGE_MODIFIER = 100 / CCS_EFFECT_RATE
        CALL CC_PRINT(@"%CCS_ATK_CHARA_NAME%の連続攻撃！")

        FOR LOCAL, 0, CCS_EFFECT_RATE
            CALL CC_ACTION_MANAGER_("ADD_NEW_BLOCK_TO_BOTTOM")
            BLOCK = RESULT
            SEQUENCE = 0
            CALL CLOSE_COMBAT_SET_TARGET(ATTACKER_DID)
            DEFENDER_DID = RESULT
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID

                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"DAMAGE_MODIFIER", DAMAGE_MODIFIER
            }
        NEXT
[SKIPEND]
        ;榴弾砲
    CASE "ENEMY_ACT_HOWITZER"
        VARS TARGET_LIST
        CC_SE '= "Cannon_0.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", CCS_EFFECT_RATE
        }
        ACTION_DID = RESULT

        ;巻き添えターゲットの取得
        MEM_CNT = CC_GET_COLLATERAL_DAMAGE_TARGETS(COLLATERAL_DAMAGE_TARGET, COLLATERAL_TARGET_RANGE)
        CALL CC_SET_ACT_FLAG_BY_ID(ACTION_DID, "TARGET_HEADCOUNT", TOSTR(MEM_CNT + 1))

        FOR LOCAL, 0, MEM_CNT
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", COLLATERAL_DAMAGE_TARGET:LOCAL
                    ,"DAMAGE_MODIFIER", CCS_EFFECT_RATE2
            }
            CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "COUNTER_PROHIBITED", "1")
        NEXT

        ;◆ランベルス槍殺法
    CASE "K18_UNIQUE_LANCE_DANCE"
        CC_SE '= "HeavySlash_1.mp3"
        ;脆弱トークン付与ブロック
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "FRAGILE"
                ,"VALUE", CCS_EFFECT_RATE
        }
        ;一時的に武器の攻撃力の半分を武器の魔力にも乗せる(機能していなかったので一旦コメントアウト)
        ;脆弱付きの連続攻撃でもそれなりに強力なので、ここに魔力を乗せるとOP気味かもしれない
        ;WPN_STATUS:WPN_魔力 = FTIMES(WPN_STATUS:WPN_魔力, (WPN_STATUS:WPN_攻撃力 / 2))

        ;CCS_EFFECT_RATE3の回数だけ攻撃処理を実行
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_MULTIPLE_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", CCS_EFFECT_RATE2
                ,"NUMBER_OF_ATTACKS", CCS_EFFECT_RATE3
        }

        ;秘剣・蒼星
    CASE "K9_UNIQUE_SKILL_BLUE_STAR"

        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "HeavySlash_1.mp3"
        ;命中対象の[ガード]減算処理
        IF CC_SP_TOKEN_NUM(DEFENDER_DID, "GUARD") > 0
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_SUB_SP_TOKEN"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"TOKEN_NAME", "GUARD"
                    ,"VALUE", CCS_EFFECT_RATE
            }
            ACTION_DID = RESULT
            CALL CC_SET_ACT_FLAG_BY_ID(ACTION_DID, "SUB_GUARD_BY_BLUE_STAR", "1")
        ENDIF
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE2
        }

        ;蒼刃一閃
    CASE "K9_UNIQUE_SKILL_BLUE_SLASH"
        CALL CC_COST_SP_TOKEN_TOCAST(ATTACKER_DID, CCS_REQTOKEN_TOCAST)
        CC_SE '= "HeavySlash_1.mp3"

        MEM_CNT = LIST_COUNT(CC_MULTI_TARGET_LIST)
        FOR LOCAL, 0, MEM_CNT
            DEFENDER_DID = LIST_GETINT(CC_MULTI_TARGET_LIST, LOCAL)
            {
                DT_ROW_ADD "CC_ACTION"
                    ,"TRIGGER_ID", TRIGGER_ID
                    ,"SEQUENCE", SEQUENCE++
                    ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                    ,"ACTOR_DID", ATTACKER_DID
                    ,"TARGET_DID", DEFENDER_DID
                    ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE2
            }
        NEXT

        ;◆双剣乱舞
    CASE "K21_UNIQUE_TWIN_DANCE"
        CC_SE '= "HeavySlash_1.mp3"
        ;相手に脆弱トークン付与ブロック
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "FRAGILE"
                ,"VALUE", CCS_EFFECT_RATE
        }
        ;自身に脆弱トークン付与ブロック
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", ATTACKER_DID
                ,"TOKEN_NAME", "FRAGILE"
                ,"VALUE", CCS_EFFECT_RATE2
        }
        ;威力アップでの２回攻撃
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_MULTIPLE_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE3
                ,"NUMBER_OF_ATTACKS", 2
        }
        ;◆ついてきな！
    CASE "K21_UNIQUE_FOLLOW_ME"
        CC_SE '= "HeavySlash_1.mp3"
        ;指定した味方にリアクトを付与する
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", DEFENDER_DID
                ,"TOKEN_NAME", "REACT"
                ,"VALUE", CCS_EFFECT_RATE
        }
        ;自身に脆弱トークン付与する(デメリット)
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ADD_SP_TOKEN"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", ATTACKER_DID
                ,"TOKEN_NAME", "FRAGILE"
                ,"VALUE", CCS_EFFECT_RATE2
        }
        ;威力アップでの１回攻撃
        ;初回ターゲット選定でCC_MULTI_TARGET_LISTに値が入っているとスキップされるのでリセット
        CC_MULTI_TARGET_LIST '= ""
        CALL CC_PRINT(@"@C:{カラー_注釈}@*攻撃対象を選択*@/C@")
        CALL CLOSE_COMBAT_TARGET_SELECT(ATTACKER_DID, CCS_ATK_SIDE == 0 ? 1 # 0, 1)
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID
                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_ATTACK"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", RESULT
                ,"DAMAGE_MODIFIER", 100 + CCS_EFFECT_RATE3
        }

    CASEELSE
        RETURN 0
ENDSELECT

;クールタイム処理
CALL CCS_ADD_COOLTIME()

RETURN TRIGGER_ID
; #endregion


code:
;-------------------------------------------------
;テスト用スキル
;-------------------------------------------------
@CC_ACTIVESKILL_SUMMON_ACTOR(ATTACKER_DID, DEFENDER_DID, XML_SKILL)
; #region
#DIM ATTACKER_DID
#DIM DEFENDER_DID
#DIMS XML_SKILL

#DIM TRIGGER_ID
#DIM BLOCK
#DIM DYNAMIC SEQUENCE

;スキル固有の変数
#DIM DYNAMIC MAX_HP
;スキル処理用パラメータの初期化と取得
CALL CC_SKILL_TRIGGER_INIT(ATTACKER_DID, DEFENDER_DID, XML_SKILL, "ADD_NEW_BLOCK_TO_BOTTOM")
TRIGGER_ID = RESULT

;効果
CALL CCS_CAN_SUMMON(ATTACKER_DID, CCS_SKILL_DEF_NAME)
IF !RESULT
    ;CALL CC_PRINT(@"……しかし指揮可能なメンバーの余剰がない！")
    {
        DT_ROW_ADD "CC_ACTION"
            ,"TRIGGER_ID", TRIGGER_ID
            ,"SEQUENCE", SEQUENCE++
            ,"FUNCTION_NAME", "CC_ACTION_MESSAGE"
            ,"ACTOR_DID", ATTACKER_DID
            ,"TARGET_DID", DEFENDER_DID
    }
    CALL CC_SET_ACT_FLAG_BY_ID(RESULT, "NO_SUMMON_CAPACITY", "1")
    RETURN TRIGGER_ID
ENDIF
SELECTCASE CCS_SKILL_DEF_NAME
    CASE "TESTSKILL"
        CC_SE '= "Heal_0.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_SUMMON_ACTOR"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", ATTACKER_DID
                ,"SIDE", CCS_ATK_SIDE
                ,"DEF_NAME", "壊乱の狂鹿"
                ,"DISP_NAME", "壊乱の狂鹿"
        }

        ;傭兵呼集
    CASE "ACT_SUMMON_MERCENARY"
        CC_SE '= "Speed_0.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_SUMMON_ACTOR"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", ATTACKER_DID
                ,"SIDE", CCS_ATK_SIDE
                ,"DEF_NAME", "傭兵"
                ,"DISP_NAME", "傭兵"
                ,"EFFECT_RATE", CCS_EFFECT_RATE
        }
        ;オリヴィアのユニークスキル
    CASE "ACT_MARE_NOSTRUM"
        CC_SE '= "Speed_0.mp3"
        {
            DT_ROW_ADD "CC_ACTION"
                ,"TRIGGER_ID", TRIGGER_ID

                ,"SEQUENCE", SEQUENCE++
                ,"FUNCTION_NAME", "CC_ACTION_SUMMON_ACTOR"
                ,"ACTOR_DID", ATTACKER_DID
                ,"TARGET_DID", ATTACKER_DID
                ,"SIDE", CCS_ATK_SIDE
                ,"DEF_NAME", "リヴィエラ精鋭海兵"
                ,"DISP_NAME", "リヴィエラ精鋭海兵"
                ,"EFFECT_RATE", CCS_EFFECT_RATE
        }
ENDSELECT

;クールタイム処理
CALL CCS_ADD_COOLTIME()

RETURN TRIGGER_ID
; #endregion


code:
;-------------------------------------------------
;テスト用スキル
;-------------------------------------------------
@CC_ACTIVESKILL_TESTSKILL(ATTACKER_DID, DEFENDER_DID, XML_SKILL)
; #region
#DIM ATTACKER_DID
#DIM DEFENDER_DID
#DIMS XML_SKILL

;スキル固有の変数
#DIM DYNAMIC MAX_HP
;スキル処理用パラメータの初期化と取得
CALL CCS_INIT_PARAM()
CALL CCS_SET_PARAM(ATTACKER_DID, DEFENDER_DID, XML_SKILL)

;効果
CALL CC_PRINT(@"%CCS_ATK_CHARA_NAME%のスキル：@C:{カラー_注意}@<%CCS_SKILL_NAME%>@/C@が発動！")
CALL CCS_CAN_SUMMON()
SELECTCASE CCS_SKILL_DEF_NAME
    CASE "TESTSKILL"
        CALL CC_PRINT(@"@C:{カラー_注意}@%CCS_ATK_CHARA_NAME%は何処からともなく壊乱の狂鹿を呼び寄せた！@/C@")
        CALL CC_ADDMOB_FROM_TABLE(TOSTR(CCS_ATK_SIDE), "壊乱の狂鹿", "壊乱の狂鹿")
        DT_CELL_SET "CC_ACTOR", RESULT, "EFFECT", "増援", 1
        CC_SE '= "Heal_0.mp3"
ENDSELECT

;クールタイム処理
CALL CCS_ADD_COOLTIME()

RETURN 1
; #endregion