let UseCard = null; 
let UseCard_SkillCounter = 0;         
let cardUseMoveTimer = 0;   
let cardUseEffTimer = 0;    
let moveTypeCng = -1;    
let damageWait = 0;         
let plNotHirumi = false;    
let Tgt男性Flg = false;
let BtlFstTargetENo = -1; 
let BtlFst攻撃Flg = false;
Game_Interpreter.prototype.EndCardEffect = function () {
    UseCard_SkillCounter = CardSkills.length;
    cardUseEffTimer = cardUseMoveTimer = 0;
}
class BtlCardUse_Class {
    constructor() {
        this.flame = 0;
        this.oneAnimeFlg = false;
        this.skipShakeArr = [];   
        this.moveAfterWaitFlame = 0;    
        this.cardUseAfterWaitFlame = 0;     
        this.firstMoveFlg = false;   
    }
}
let BtlCardUse = new BtlCardUse_Class();
Game_Interpreter.prototype.ChangePhase_CardUse = function () {
    BtlData.Mode = EnBtlMode.CardUse; 
    BtlFstTargetENo = -1; 
    BtlFst攻撃Flg = false;
    BtlCardUse.flame = 0; 
    _CmnGoFlg = false; 
    this.SetumeiDel(); 
    this.DelPict(PN_HandMax + 2); 
    BtlCardUse.oneAnimeFlg = false;
    if (MetaChecker(UseCard.CardData, "OneAnime", false)) {
        BtlCardUse.oneAnimeFlg = true;
    }
    if (CheckStateInType(NPlayer[0]._NState, StType.DefKantu)) { 
        CardSkills.push($dataSkills[KSkill.防御貫通]); 
    }
}
Game_Interpreter.prototype.CardUseCancel = function () {
    CardSkills = [];
}
let _エロカードの場合発動スキル調整 = function () {
    if ($gameVariables.value(VN_エロ戦闘敵種類) == -1) {
        if (MetaChecker(UseCard.CardData , "エロカード" , false) != false) {
            for (let i = 1; i < CardSkills.length; i++) {
                CardSkills.splice(i , 1);
                i--;
            }
        }
    }
}
let _カード効果強制終了 = function () {
    for (let i = 0; i < CardSkills.length; i++) {
        CardSkills.splice(i , 1);
        i--;
    }
}
let BtlCard_性感位置Str = "";
Game_Interpreter.prototype.BtlCardUse_Update = function () {
    this.CardOriginalEffectUpdate(UseCard.CardData.id);
    if (BtlCardUse.flame == 0) {
        var cardVoice = MetaChecker(UseCard.CardData , "ボイス" , false);
        if (cardVoice != false) {
            let voices = cardVoice.split(',');
            if (voices.length == 1) {
                if (voices[0] != "") {
                    this.PVoice("romasha" , voices[0]);
                }
            } else {
                this.PRandVoice("romasha",voices);
            }
        } else {
            switch (UseCard.CardData.wtypeId) {
                case 1: 
                    if ($gameSwitches.value(SW_ゴブリンパート)) {
                        this.PVoice("romasha","h1_487_iya");
                    } else
                        this.PRandVoice("romasha",["btl_381_kouge","btl_382_taa","btl_383_yaa","btl_384_sei","btl_385_ha","btl_386_fu","btl_387_sokoy","btl_388_osoi","btl_389_se","btl_390_syu"]);
                    break;
                case 2: 
                case 3: 
                    this.PRandVoice("romasha",["btl_402_kored","btl_402_kored_2","btl_403_kokoh","btl_404_tikar","btl_405_yosi"]);
                    break;
                default:
                    break
            }
        }
        this.CardUse_発動Draw();
        this.CardUse_EffStart(); 
        _エロカードの場合発動スキル調整();
        this.CardKoukaArr_Set(); 
        if (LastEffectUISelectUpdate) {
            this.MovePict(UseCard.setPNo, true, true, 10, 255, 0, 0);
        } else {
            if (UseCard.破棄Flg) {
                this.PicTranOut(UseCard.setPNo, "123"); 
            } else {
                $gameScreen.rotatePicture(UseCard.setPNo, 40);
                EasingStr = "easeOutQuad";
                this.MovePict(UseCard.setPNo, 977, 759, 45, 255, 0, 0);
                EasingStr = "";
            }
        }
        UseCard_SkillCounter = 0; 
        animeOneShotFlg = false;
        if (!LastEffectUISelectUpdate) {
            let setLogStr = "\\I[" + UseCard.CardData.iconIndex + "]" + UseCard.CardData.name;
            this.SkillLogAdd(setLogStr, 1); 
            this.BLogAdd(180, "ロマーシャは『" + UseCard.CardData.name + "』を発動");
        }
        BtlCardUse.moveAfterWaitFlame = Number(MetaChecker(UseCard.CardData, "WTimer", 0));
        BtlCardUse.cardUseAfterWaitFlame = Number(MetaChecker(UseCard.CardData, "AftTimer", 0));
        moveTypeCng = Number(MetaChecker(UseCard.CardData, "MoveType", -1));
        damageWait = Number(MetaChecker(UseCard.CardData, "DmgWait", 0));
        BtlCard_性感位置Str = MetaChecker(UseCard.CardData, "性感位置", "");
        GetSkillMemoData(UseCard.CardData, -1);
        BtlCardUse.skipShakeArr = [];
        let ckShakeSkip = MetaChecker(UseCard.CardData, "ShakeSkip", false);
        if (ckShakeSkip != false) {
            let ckSkipArr = ckShakeSkip.split(',');
            for (let i = 0; i <= ckSkipArr.length - 1; i++) {
                BtlCardUse.skipShakeArr.push(Number(ckSkipArr[i]));
            }
        }
        let _fstPtcName = MetaChecker(UseCard.CardData, "FstPLPtc", "");
        if (_fstPtcName != "") {
            let _ckStrArr = _fstPtcName.split(',');
            _fstPtcName = _ckStrArr[0];
            let _zureX = 0;
            let _zureY = 0;
            if (_ckStrArr.length > 1) { 
                _zureX += Number(_ckStrArr[1]);
            }
            if (_ckStrArr.length > 2) { 
                _zureY += Number(_ckStrArr[2]);
            }
            let _pX = NPlayer[0]._screenX + _zureX;
            let _pY = NPlayer[0]._screenY + _zureY;
            this.PlayPtcPic(_fstPtcName, _pX, _pY);
        }
        plNotHirumi = (MetaChecker(UseCard.CardData, "PLNotHirumi", "") != "");
    }
    if (BtlCardUse.flame == 1) { 
        let _CkCmn = Number(MetaChecker(UseCard.CardData, "SetCmn", 0));
        if (_CkCmn != 0 && !_CmnGoFlg) {
            this.SetCmnEventSc(_CkCmn); 
            _CmnGoFlg = true; 
            return; 
        }
    }
    if (BtlCardUse.flame > 6) { 
        if (cardUseEffTimer == 0 && cardUseMoveTimer == 0) {
            if (UseCard_SkillCounter > CardSkills.length - 1) {
                BtlCardUse.firstMoveFlg = false;
                plNotHirumi = false;
                if (BtlCardUse.cardUseAfterWaitFlame > 0) {
                    BtlCardUse.cardUseAfterWaitFlame--;
                    return;
                }
                this.CardOriginalEffectEnd(UseCard.CardData.id);
                this.CardSelect(-1);
                if (UseCard.Cost == "All") {
                    NPlayer[0]._mp = 0; 
                    this.MPKaihuku(0); 
                }
                this.BtlLive2DSet_CardEffectEnd(); 
                this.ChangePhase_CardSelect(); 
                this.BasePLMove(); 
                let _CkCmn = Number(MetaChecker(UseCard.CardData, "EndCmn", 0));
                if (_CkCmn != 0) {
                    $gameTemp.reserveCommonEvent(_CkCmn);
                    return; 
                }
                StateDelCheck_ENo(-1);
                this.BtlLive2DParamSet_State()
                for (let i = 0; i <= 11 - 1; i++) {
                    let _delFlg = true;
                    for (let j = 0; j <= CardData.length - 1; j++) {
                        if (CardData[j].setPNo == PN_Card + i) _delFlg = false;
                    }
                    if (_delFlg) {
                        this.DelPict(PN_Card + i);
                    }
                }
                this.DeckMaisuView();
            } else {
                this.CardPLMoveSet(); 
                let useSkillId = CardSkills[UseCard_SkillCounter].id; 
                if (TargetArr.length == 1 && $dataSkills[useSkillId].scope == EnAtkRange.敵単体) {
                    if (!BtlFst攻撃Flg) {
                        BtlFst攻撃Flg = true;
                        BtlFstTargetENo = TargetArr[0];
                    } else {
                        if (BtlFstTargetENo != TargetArr[0]) {
                            cardUseEffTimer = 0;
                            cardUseMoveTimer = 0;
                            UseCard_SkillCounter++; 
                            BtlCardUse.flame == 1;
                            return;
                        }
                    }
                }
            }
        }
        if (cardUseMoveTimer == 1) {
            this.CardPLEffSet();
            if (BtlCardUse.moveAfterWaitFlame > 0) cardUseMoveTimer++;
        }
        if (cardUseEffTimer == 1 && CardSkills[UseCard_SkillCounter] != undefined) {
            let useSkillId = CardSkills[UseCard_SkillCounter].id; 
            let skillValue = GetSkillCalcValue(-1, CardSkills[UseCard_SkillCounter].id);
            _BtlCardSelect_Cost = -1;
            let _eSkip = true; 
            let _elementId = CardSkills[UseCard_SkillCounter].damage.elementId;
            switch (_elementId) {
                case DType.CSHandTr: 
                    this.BtlCardSelectionSetting(DType.CSHandTr, skillValue);
                    break;
                case DType.CSCardGet: 
                case DType.CSTrCardGet: 
                    _BtlCardSelect_IdArr = [];
                    _BtlCardSelect_Cost = -1;
                    let _ckIdArr = MetaChecker(UseCard.CardData, "カード取得種類", "").split(',');
                    let _ckMaisu = Number(MetaChecker(UseCard.CardData, "カード取得枚数", "0"));
                    let _ckCngCost = MetaChecker(UseCard.CardData, "カード取得コスト", null);
                    if (_ckCngCost != null) {
                        _BtlCardSelect_Cost = Number(_ckCngCost);
                    }
                    for (let i = 0; i <= _ckMaisu - 1; i++) {
                        let _setRnNo = Math.floor(Math.random() * _ckIdArr.length);
                        _BtlCardSelect_IdArr.push(_ckIdArr[_setRnNo]);
                    }
                    this.BtlCardSelectionSetting(_elementId, skillValue);
                    break;
                default:
                    _eSkip = false;
            }
            if (!_eSkip) {
                let _shakeSkipFlg = false;
                if (BtlCardUse.skipShakeArr.indexOf(UseCard_SkillCounter + 1) != -1) { 
                    _shakeSkipFlg = true
                }
                let EstateList = GetStateList(CardSkills[UseCard_SkillCounter]); 
                if (EstateList.length > 0) {
                    for (let i = 0; i <= EstateList.length - 1; i++) {
                        if (EstateList[i]._Turn == 0) EstateList[i]._Turn = skillValue;
                        AddStateTarget(-1, damageWait, EstateList[i], _shakeSkipFlg);
                    }
                } else {
                    SetDmgStac_Damage(-1, useSkillId, damageWait, UseCard.CardData.id, _shakeSkipFlg);
                }
                damageWait = 0; 
            }
            UseCard_SkillCounter++; 
        }
        if (cardUseMoveTimer > 0) {
            cardUseMoveTimer--;
        }
        if (cardUseEffTimer > 0) {
            cardUseEffTimer--;
        }
    }
    BtlCardUse.flame++;
}
Game_Interpreter.prototype.CardUse_EffStart = function () {
    if (BtlRomashaFlg) {
        let L2DCardMtnStr = MetaChecker(UseCard.CardData, "L2DMtn", "");
        switch (L2DCardMtnStr) {
            case L2DCardMtn.L2DSlash: 
                let setBackModel = "romasha_battleback";
                if (MdlRomashaBattle == "romasha_battale2") {
                    setBackModel = "romasha_battleback2";
                    this.SetCmnEvent(CN_romasha_battleback2);
                } else {
                    this.SetCmnEvent(CN_romasha_battleback);
                }
                L2dAutoFadeOut(WaitMdlName, 15);
                L2dTop(setBackModel);
                if (Math.random() >= 0.5) {
                    L2dFadeMdl(setBackModel, "centerin", 15, "attack");
                } else {
                    L2dFadeMdl(setBackModel, "centerin", 15, "attack2");
                }
                break;
            case L2DCardMtn.L2DKick: 
                let setKickModel = "romasha_kick"; 
                if (MdlRomashaBattle == "romasha_battale2") {
                    setKickModel = "romasha_kick2";
                    this.SetCmnEvent(CN_romasha_kick2); 
                } else {
                    this.SetCmnEvent(CN_romasha_kick); 
                }
                L2dAutoFadeOut(WaitMdlName, 15);
                L2dTop(setKickModel);
                L2dFadeMdl(setKickModel, "centerin", 15, "kick", null, null, 0);
                break;
            case L2DCardMtn.L2DCard:
                L2dSetMotion(WaitMdlName, "battale_item");
                break;
            case L2DCardMtn.L2DFairy:
                L2dSetMotion(WaitMdlName, "battale_fairy");
                break;
            default:
                if (L2DCardMtnStr != "") {
                    L2dSetMotion(WaitMdlName, L2DCardMtnStr);
                }
                break;
/*            case L2DCardMtn.L2DYji: 
                this.SetCmnEvent(CN_romasha_kick);
                L2dAutoFadeOut(WaitMdlName, 15);
                L2dTop("romasha_kick");
                L2dFadeMdl("romasha_kick", "centerin", 15, "Y_blance1", null, null, -70);
                break;*/
        }
    }
}
Game_Interpreter.prototype.CardUse_発動Draw = function () {
    if (CardKoukaCk(UseCard.CardData, KSkill.ランダム発動)) {
        this.BLogAdd(180, "ロマーシャは『" + UseCard.CardData.name + "』を発動");
        let _RndCNoArr = MetaChecker(UseCard.CardData, "ランダム発動", [2]).split(',');
        let _RNo = Math.floor(Math.random() * _RndCNoArr.length);
        let _CNo = Number(_RndCNoArr[_RNo]);
        let _nCard = new Card($dataWeapons[_CNo]);
        let _PicNo = UseCard.setPNo;
        UseCard = _nCard; 
        UseCard.setPNo = _PicNo;
        this.CardTargetGet(UseCard.CardData); 
    }
}
let _CellDmg倍化Flg = false;
let _CellDmg倍率 = 2;
let _Skill狙撃Dmg = 0;
Game_Interpreter.prototype.CardKoukaArr_Set = function () {
    CardKoukaArr = [];
    NPlayer[0]._DmgCng = 0;
    let _ビット数効果発動Flg = false;
    _CellDmg倍化Flg = false;
    _Skill狙撃Dmg = 0;
    for (let i = 0; i <= CardSkills.length - 1; i++) {
        let _効果SkipFlg = true;
        switch (CardSkills[i].id) { 
            case KSkill.B型ワクチン:
            case KSkill.H型ワクチン:
                break;
            case KSkill.防御貫通: 
                break;
            case KSkill.ビット消費Tn: 
                console.log("KSkill.ビット消費Tn");
                let BitSyohiCheck = MetaChecker(UseCard.CardData , "フェアリー消費時移動しない" , false);
                this.BtlBit_突撃(BitSyohiCheck == false); 
                break;
            case KSkill.ビット数効果発動: 
                console.log("KSkill.ビット数効果発動");
                _ビット数効果発動Flg = true;
                break;
            case KSkill.破棄: 
            case KSkill.破棄Max:
                UseCard.破棄Flg = true;
                for (let di = 0; di <= BtlDeck.length - 1; di++) {
                    if (BtlDeck[di] == UseCard.CardData.id) {
                        BtlDeck.splice(di, 1);
                        break;
                    }
                }
                break;
            case KSkill.お金倍加:
                BtlData.EndGetGold倍率 = GetSkillCalcValue(-1, CardSkills[i].id);
                break;
            case KSkill.装甲回復:
                I装甲回復箇所指定No = UseCard.CardData.params[2];
                this.SetCmnEventSc(456); 
                break;
            case KSkill.アクセス解除:
            case KSkill.強化アクセス解除:
            case KSkill.裸になる:
                if (CardSkills[i].id == KSkill.裸になる) {
                    $gameVariables.setValue(VN_TL2DKigae, -1);
                    $gameSwitches.setValue(SW_BuraOFF, true);
                    $gameSwitches.setValue(SW_PantuOFF, true);
                }
                this.Playerアクセスステート解除(); 
                this.RomaSpineSkinSet(); 
                AccessFlg = false;
                this.PlayPtcPic("AssKaijo", 1189, 450);
                this.BtlLive2Dパラメーター更新();
                if (CardSkills[i].id == KSkill.強化アクセス解除) {
                    BtlDeck.push(1);
                }
                break;
            //     for (let i = 0; i <= TargetArr.length - 1; i++) {
            //         let _CkState = GetNState_ENo(TargetArr[i]);
            //         for (let j = 0; j <= _CkState.length - 1; j++) {
            //             if (_ckName.indexOf("リジェネ") != -1 ||
            //                 _ckName.indexOf("威力増加") != -1 ||
            //                 _ckName.indexOf("装甲") != -1) {
            //                 _CkState.splice(j, 1);
            case KSkill.デバフ全回復:
                this.ClearBadStateAll_Chara(NPlayer[0]._NState);
                break;
            case KSkill.以下発動_通常:
                if (AccessFlg) {
                    for (let j = i; j <= CardSkills.length - 1; j++) {
                        CardSkills.splice(j, 1);
                        j--;
                    }
                    continue; 
                }
                break;
            case KSkill.以下発動_ｱｸｾｽ:
                if (!AccessFlg) {
                    for (let j = i; j <= CardSkills.length - 1; j++) {
                        CardSkills.splice(j, 1);
                        j--;
                    }
                    continue; 
                }
                break;
            case KSkill.以下発動_相手男性:
                if (!Tgt男性Flg) {
                    for (let j = i; j <= CardSkills.length - 1; j++) {
                        CardSkills.splice(j, 1);
                        j--;
                    }
                    continue; 
                }
                break;
            case KSkill.以下発動_ｽﾃｰﾄ:
                let _StateId = GetSkillCalcValue(-1, CardSkills[i].id); 
                let _SkipFlg = CheckNStateInState(NPlayer[0]._NState, _StateId);
                if (!_SkipFlg) {
                    for (let j = i; j <= CardSkills.length - 1; j++) {
                        CardSkills.splice(j, 1);
                        j--;
                    }
                    continue; 
                }
                break;
            case KSkill.以下発動_手札枚数以下:
                let _CkMaisu = GetSkillCalcValue(-1, CardSkills[i].id); 
                if (_CkMaisu <= CardData.length) {
                    for (let j = i; j <= CardSkills.length - 1; j++) {
                        CardSkills.splice(j, 1);
                        j--;
                    }
                    continue; 
                }
                break;
            case KSkill.以下曜日効果変化:
                let _YoubiVar = 0;
                if ($gameSwitches.value(SW_Yobi + 0)) _YoubiVar = 0;
                if ($gameSwitches.value(SW_Yobi + 1)) _YoubiVar = 1;
                if ($gameSwitches.value(SW_Yobi + 2)) _YoubiVar = 2;
                if ($gameSwitches.value(SW_Yobi + 3)) _YoubiVar = 3;
                let _pls = 0;
                for (let j = 0; j <= 4 - 1; j++) {
                    if (_YoubiVar != j) {
                        CardSkills.splice(i + j + _pls, 1);
                        _pls--;
                    } else {
                        _pls++; 
                    }
                }
                break;
            case KSkill.対象セルDmg時威力2倍: 
                _CellDmg倍化Flg = true;
                _CellDmg倍率 = 2;
                break;
            case KSkill.対象セルDmg時威力3倍: 
                _CellDmg倍化Flg = true;
                _CellDmg倍率 = 3;
                break;
            default:
                _効果SkipFlg = false;
        }
        if (_効果SkipFlg) { 
            CardKoukaArr.push(CardSkills[i].id);
            CardSkills.splice(i, 1);
            i--;
            continue;
        }
        let _属性SkipFlg = true;
        switch (CardSkills[i].damage.elementId) {
            case DType.SkDmgCng: 
                var cngDmgValue = GetSkillCalcValue(-1, CardSkills[i].id);
                // if (cngDmgValue > 100) {
                //     cngDmgValue = 100 + Math.floor(AddValue / 3);
                NPlayer[0]._DmgCng += cngDmgValue; 
                break;
            case DType.TCMove: 
                this.TargetSelect(0, CardSkills[i].id);
                let _枚数 = 999;
                let _SetTc = CardSkills[i].meta["TC移動枚数"];
                if (_SetTc != undefined && _SetTc != "") {
                    _枚数 = Number(_SetTc);
                }
                let _moveTc = GetSkillCalcValue(-1, CardSkills[i].id);
                for (let i = 0; i <= TargetArr.length - 1; i++) {
                    this.TCShift_ENo(TargetArr[i], _moveTc, _枚数);
                }
                break;
            case DType.TCDelay: 
                for (let j = i + 1; j <= CardSkills.length - 1; j++) {
                    CardSkills.splice(j, 1);
                    j--;
                }
                _属性SkipFlg = false; 
                break;
            case DType.Sogeki: 
                _Skill狙撃Dmg = GetSkillCalcValue(-1, CardSkills[i].id);
                break;
            default:
                _属性SkipFlg = false;
        }
        if (_属性SkipFlg) {
            CardSkills.splice(i, 1);
            i--;
        }
    }
    if (UseCard._一時カード) { 
        UseCard.破棄Flg = true;
        // for (let di = 0; di <= BtlDeck.length - 1; di++) {
        //     if (BtlDeck[di] == UseCard.CardData.id) {
        //         BtlDeck.splice(di, 1);
    }
    if (_ビット数効果発動Flg) this.BtlBit_効果複製();
}
let GetStateList = function (cardSkillData) {
    let rtnArr = [];
    for (let i = 0; i <= cardSkillData.effects.length - 1; i++) {
        if (cardSkillData.effects[i].code == 21) {
            rtnArr.push(
                new BtlStateData(
                    cardSkillData.effects[i].dataId,
                    (cardSkillData.effects[i].value1 * 100) - 100
                )
            );
        }
    }
    return rtnArr;
}
let PLMoveBaseTime = 15; 
Game_Interpreter.prototype.CardPLMoveSet = function () {
    let ckMovetime = PLMoveBaseTime;
    let ckMvTime = CardSkills[UseCard_SkillCounter].meta["mvtime"];
    if (ckMvTime != undefined && ckMvTime != "") { 
        ckMovetime = Number(CardSkills[UseCard_SkillCounter].meta["mvtime"]);
    }
    if (moveTypeCng != -1) {
        this.TargetSelect(0, CardSkills[UseCard_SkillCounter].id, moveTypeCng);
        moveTypeCng = -2; 
    } else {
        this.TargetSelect(0, CardSkills[UseCard_SkillCounter].id);
    }
    this.MovePict(PN_CharacterPL, TgMoveX, TgMoveY, ckMovetime, 255, plSpineScaleX, plSpineScaleY);
    cardUseMoveTimer = ckMovetime;
    if (setMoveType == EnBtlMove.m_少し前) cardUseMoveTimer = 5;
    if (!BtlCardUse.firstMoveFlg) {
        BtlCardUse.firstMoveFlg = true
    } else {
        cardUseMoveTimer = 5;
    }
}
const Base_Eefftime = 30;
const AN_PtcNo = 200; 
const AN_KPtcNo = AN_PtcNo + 1; 
let animeOneShotFlg = false;
Game_Interpreter.prototype.CardPLEffSet = function () {
    if (!animeOneShotFlg) {
        if (CardSkills[UseCard_SkillCounter].meta["Anime"] != "") { 
            let _アニメ名 = CardSkills[UseCard_SkillCounter].meta["Anime"];
            if (Spn_AnimeCk($gameSystem.Btl_Chara.Name, _アニメ名)) { 
                this.SetSpineAnime(PN_CharacterPL, _アニメ名, false);
            } else {
                this.SetSpineAnime(PN_CharacterPL, "Atk", false);
            }
        }
        if (UseCard.CardData.meta["Anime"] != "") { 
            let _アニメ名 = UseCard.CardData.meta["Anime"];
            if (Spn_AnimeCk($gameSystem.Btl_Chara.Name, _アニメ名)) { 
                this.SetSpineAnime(PN_CharacterPL, _アニメ名, false);
            } else {
                this.SetSpineAnime(PN_CharacterPL, "Atk", false);
            }
            animeOneShotFlg = true; 
        }
    }
    if (BtlCardUse.moveAfterWaitFlame > 0) { 
        BtlCardUse.moveAfterWaitFlame--;
    } else {
        //MoveAfWTimer(動作後の待ち時間が終わった後に処理を行う)
        cardUseEffTimer = Base_Eefftime;
        let ckEffTime = MetaChecker(CardSkills[UseCard_SkillCounter], "efftime");
        if (ckEffTime != "") {
            cardUseEffTimer = Number(ckEffTime);
        }
        let EAnimeSID = 0;
        for (let i = 0; i <= CardSkills[UseCard_SkillCounter].effects.length - 1; i++) {
            let efcode = CardSkills[UseCard_SkillCounter].effects[i].code;
            if (efcode == 44) { 
                this.SetCmnEventSc(CardSkills[UseCard_SkillCounter].effects[i].dataId);
            }
        }
        let _CardAnimeFlg = false;
        if (CardSkills[UseCard_SkillCounter].animationId == -1) {
            EAnimeSID = UseCard.CardData.animationId;
            _CardAnimeFlg = true;
        } else {
            EAnimeSID = CardSkills.animationId;
        }
        if (UseCard_SkillCounter > 0 && BtlCardUse.oneAnimeFlg) return;
        if (MetaChecker(UseCard.CardData, "EffOFfNo" + (UseCard_SkillCounter + 1), false) != false) {
            EAnimeSID = 0;
        }
        if (EAnimeSID == 0) {
        } else {
            if (MetaChecker(UseCard.CardData, "PLShot", false) != false) {
                let _pX = NPlayer[0]._screenX;
                let _pY = NPlayer[0]._screenY;
                let _PtcStr = "";
                let _ckMemoStr = "Ptc";
                if (EAnimeSID == AN_KPtcNo) _ckMemoStr = "KPtc";
                if (_CardAnimeFlg) {
                    _PtcStr = MetaChecker(UseCard.CardData, _ckMemoStr, "");
                } else {
                    _PtcStr = MetaChecker(CardSkills[UseCard_SkillCounter], _ckMemoStr, "");
                }
                let _ckStrArr = _PtcStr.split(',');
                let _PtcName = _ckStrArr[0];
                if (_ckStrArr.length > 1) { 
                    _pX += Number(_ckStrArr[1]);
                }
                if (_ckStrArr.length > 2) { 
                    _pY += Number(_ckStrArr[2]);
                }
                if (EAnimeSID == AN_PtcNo) {
                    this.PlayPtcPic(_PtcName, _pX, _pY);
                } else {
                    this.NPtcComboSet(_PtcName, Ptc_CType.Pic, [_pX, _pY]);
                }
                return;
            }
            if (CardSkills[UseCard_SkillCounter].scope == 2) {
                if (EAnimeSID == AN_PtcNo || EAnimeSID == AN_KPtcNo) {
                    let _PtcStr = "";
                    let _ckMemoStr = "Ptc";
                    if (EAnimeSID == AN_KPtcNo) _ckMemoStr = "KPtc";
                    if (_CardAnimeFlg) {
                        _PtcStr = MetaChecker(UseCard.CardData, _ckMemoStr, "");
                    } else {
                        _PtcStr = MetaChecker(CardSkills[UseCard_SkillCounter], _ckMemoStr, "");
                    }
                    let _ckStrArr = _PtcStr.split(',');
                    let _PtcName = _ckStrArr[0];
                    let _zureX = 0;
                    let _zureY = 0;
                    if (_ckStrArr.length > 1) { 
                        _zureX += Number(_ckStrArr[1]);
                    }
                    if (_ckStrArr.length > 2) { 
                        _zureY += Number(_ckStrArr[2]);
                    }
                    this.PlayPtcAnimeEnemyAll(_PtcName, (EAnimeSID == AN_KPtcNo), _zureX, _zureY);
                } else {
                    this.PlayAnimeEnemyAll(EAnimeSID);
                }
            } else {
                for (let i = 0; i <= TgEffArr.length - 1; i++) {
                    let _pX = TgEffArr[i]._x;
                    let _pY = TgEffArr[i]._y;
                    if (EAnimeSID == AN_PtcNo || EAnimeSID == AN_KPtcNo) {
                        let _PtcStr = "";
                        let _ckMemoStr = "Ptc";
                        if (EAnimeSID == AN_KPtcNo) _ckMemoStr = "KPtc";
                        if (_CardAnimeFlg) {
                            _PtcStr = MetaChecker(UseCard.CardData, _ckMemoStr, "");
                        } else {
                            _PtcStr = MetaChecker(CardSkills[UseCard_SkillCounter], _ckMemoStr, "");
                        }
                        let _ckStrArr = _PtcStr.split(',');
                        let _PtcName = _ckStrArr[0];
                        if (_ckStrArr.length > 1) { 
                            _pX += Number(_ckStrArr[1]);
                        }
                        if (_ckStrArr.length > 2) { 
                            _pY += Number(_ckStrArr[2]);
                        }
                        if (EAnimeSID == AN_PtcNo) {
                            this.PlayPtcPic(_PtcName, _pX, _pY);
                        } else {
                            this.NPtcComboSet(_PtcName, Ptc_CType.Pic, [_pX, _pY]);
                        }
                    } else {
                        this.PlayAnime(EAnimeSID, _pX, _pY); 
                    }
                }
                TgEffArr = [];
            }
        }
    }
}
