let AddStateTarget = function (atkENo, waitFlame, stateData, shakeSkipFlg) {
    shakeSkipFlg = typeof shakeSkipFlg !== 'undefined' ? shakeSkipFlg : false; 
    for (let i = 0; i <= TargetArr.length - 1; i++) {
        DmgESet_SkipFlg = shakeSkipFlg;
        let setTurn = GetAddStateTurn(atkENo, stateData._No, stateData._Turn);
        SetDmgStac_State(stateData._No, TargetArr[i], waitFlame, setTurn);
        if (TargetArr[i] == -1) $gameActors.actor(1).addState_N(stateData._No);
    }
    DmgESet_SkipFlg = false;
}
let GetAddStateTurn = function (attackENo, stateId, stateTurn) {
    switch (stateId) {
        case StOneType.CelDmg:
            let stValue = GetStateTypeSumValue_ENo(attackENo, StType.CelDmgBai);
            let bairitu = (stValue + 100) / 100;
            return Math.floor(stateTurn * bairitu);
    }
    return stateTurn;
}
let DmgESet_SkipFlg = false;
let SetDmgStac_State = function (stateId, targetENo, waitFlame, setTurn) {
    let _SetStac = new StacDmgData();
    _SetStac._Type = DType.SetState; 
    _SetStac._StId = stateId; 
    _SetStac._CNo = targetENo;   
    _SetStac._Flame = waitFlame; 
    _SetStac._Turn = setTurn; 
    _SetStac._ShakeSkipFlg = DmgESet_SkipFlg;
    _SetStac._Kouka = CopyArr(CardKoukaArr); 
    EnemyDmgStac.push(_SetStac);    
    DmgESet_SkipFlg = false;
}
let GetSkillCalcValue = function (atkENo, skillId) {
    let sikiStr = $dataSkills[skillId].damage.formula;
    let a = null; 
    try {
        if (atkENo == -1) {
            let _TurnCount = NPlayer[(-atkENo - 1)]._TurnCount;
            a = new CardStatus(UseCard.CardData, _TurnCount); 
        }
        if (atkENo < -1) a = new EnemyStatus(NPlayer[(-atkENo - 1)]);
        if (atkENo >= 0) a = new EnemyStatus(NEnemy[atkENo]);
    } catch (e) {
        let _TcCard = $dataWeapons[atkENo];
        a = new CardStatus(_TcCard, 0); 
    }
    if (sikiStr == "") return 0;
    return Math.floor(ReUseBtlFunc(sikiStr)(a));
}
let N_FuncArr = [];
let ReUseBtlFunc = function (_Siki) {
    for (let i = 0; i <= N_FuncArr.length - 1; i++) {
        if (N_FuncArr[i]._Siki == _Siki) {
            return N_FuncArr[i]._Func 
        }
    }
    N_FuncArr.push(new N_Func(_Siki, new Function('a', 'return (' + _Siki + ");")));
    return N_FuncArr[N_FuncArr.length - 1]._Func;
}
let GetChangeDamage_ENo = function (ENo) { 
    try {
        if (ENo <= -1) {
            let _rtnVar = NPlayer[(-ENo - 1)]._DmgCng;
            if (ENo == -1) _rtnVar += _手札AtkChange;
            return _rtnVar;
        }
        if (ENo >= 0) return NEnemy[ENo]._DmgCng;
    } catch (e) {
        return 0;
    }
}
let CardEditSkill; 
let UseCardId = -1; 
let SetDmgStac_Damage = function (atkENo, skillId, waitFlame, cardId, shakeSkipFlg) { 
    cardId = typeof cardId !== 'undefined' ? cardId : -1; 
    shakeSkipFlg = typeof shakeSkipFlg !== 'undefined' ? shakeSkipFlg : false; 
    DmgESet_SkipFlg = shakeSkipFlg 
    if (atkENo > 5) cardId = atkENo;
    UseCardId = cardId;
    let baseDmgType = $dataSkills[skillId].damage.type;
    if (baseDmgType == 0) return;
    let setDmgType = $dataSkills[skillId].damage.elementId;
    let ckNState = GetNState_ENo(atkENo);
    let changeDmgValue = GetChangeDamage_ENo(atkENo); 
    if (befTurnType == EnBefTurn.Skill) {
        ckNState = [];
        changeDmgValue = 0;
    }
    let baseDmgValue = GetSkillCalcValue(atkENo, skillId);
    let setDmgValue = baseDmgValue + changeDmgValue; 
    if (skillId == KSkill.妖刀ムラマサ) { 
        setDmgValue = NPlayer[0].mhp - NPlayer[0]._hp ;
        if (setDmgValue < 0) setDmgValue = 0;
        let _HpBairitu = 1 + (1 - (NPlayer[0]._hp / NPlayer[0].mhp)) * 2;
        setDmgValue = Math.floor(setDmgValue * _HpBairitu);
    }
    if (skillId != KSkill.自傷ダメージ) {
        setDmgValue = GetDmgValue_AtkState(setDmgType, setDmgValue, ckNState); 
    }
    CardEditSkillSetting(setDmgType, cardId, baseDmgValue); 
    switch (setDmgType) { 
        case DType.DefGet: 
            SetDmgStac_State(StOneType.Defense, atkENo, waitFlame, setDmgValue);
            break;
        case DType.Draw:    
        case DType.MpRecv:  
        case DType.DeckCAdd: 
        case DType.TrashAdd: 
        case DType.HandAdd: 
        case DType.HandCRecv: 
        case DType.Reload:  
        case DType.HandSute: 
        case DType.ItemAdd: 
        case DType.CmnEv:   
        case DType.SWCng:   
        case DType.Hirumi:  
        case DType.TCDelay: 
        case DType.HCostCng: 
        case DType.HCostHrfRnd: 
        case DType.HCostZeroRnd: 
        case DType.Bit_TurnCng: 
        case DType.Bit_VarCng: 
        case DType.SknCng: 
        case DType.ItemCoolTurnCng: 
            SetEnemyDmgStac(setDmgType, -1, waitFlame, setDmgValue, cardId, skillId);
            break;
        case DType.StateDel: 
            for (let i = 0; i <= TargetArr.length - 1; i++) {
                SetEnemyDmgStac(setDmgType, TargetArr[i], waitFlame, setDmgValue, cardId, skillId);
            }
            break;
        default:
            let _AtkToCelDmgVar = GetAtkToCellValue(ckNState);
            let _emCnt = 0;
            for (let i = 0; i <= NEnemy.length - 1; i++) {
                if (NEnemy[i]._hp > 0) _emCnt++;
            }
            if (_Skill狙撃Dmg > 0 && _emCnt > 1) {
                setDmgValue += _Skill狙撃Dmg; 
                //setDmgValue += GetDmgValue_AtkState(setDmgType, _Skill狙撃Dmg, ckNState);
            }
            for (let i = 0; i <= TargetArr.length - 1; i++) {
                if (setDmgType == DType.CelAtkDmg) {
                    setDmgValue = GetNStateTurn_ENo(TargetArr[i], StOneType.CelDmg);
                    setDmgValue = GetDmgValue_AtkState(setDmgType, setDmgValue, ckNState); 
                    setDmgType = DType.Dmg;
                }
                if (ENo_StateCk_Type(TargetArr[i], StType.CelDmg)) { 
                    if (_CellDmg倍化Flg) {
                        setDmgValue *= _CellDmg倍率;
                        _CellDmg倍化Flg = false; 
                    }
                }
                if (ENo_StateCk_Type(TargetArr[i], StType.CelBaria)) { 
                    if (GetNStateTurn_ENo(TargetArr[i], StOneType.Defense) > 0) {
                        let _TgtDef = GetNStateTurn_ENo(TargetArr[i], StOneType.Defense);
                        if (setDmgValue > 0) {
                            let ckDmg = setDmgValue;
                            if (ENo_StateCk_Type(TargetArr[i], StType.BaseDef)) {
                                ckDmg = Math.floor(ckDmg / 2);
                            }
                            if (_TgtDef < ckDmg) ckDmg = _TgtDef;
                            if (setDmgType == DType.Dmg) {
                                ckDmg = GetAddStateTurn(atkENo, StOneType.CelDmg, ckDmg);
                                SetDmgStac_State(StOneType.CelDmg, atkENo, waitFlame, ckDmg);
                            }
                        }
                    }
                }
                if (ENo_StateCk_Type(TargetArr[i], StType.Reflect)) { 
                    if (setDmgValue > 0) {
                        if (setDmgType == DType.Dmg) {
                            let refAtkENo = atkENo;
                            if (refAtkENo >= 0 && refAtkENo >= NEnemy.length) {
                                for (let j = 0; j < NEnemy.length; j++) {
                                    if (NEnemy[i]._hp != 0) {
                                        refAtkENo = j;
                                        break;
                                    }
                                }
                            }
                            SetEnemyDmgStac(setDmgType, refAtkENo, waitFlame, setDmgValue, cardId, skillId);
                        }
                    }
                }
                if (ENo_StateCk_Type(TargetArr[i], StType.Counter)) { 
                    if (setDmgValue > 0) {
                        if (setDmgType == DType.Dmg) {
                            let _HangekiVar = GetStateTypeSumValue_ENo(TargetArr[i], StType.Counter);
                            SetEnemyDmgStac(setDmgType, atkENo, waitFlame, _HangekiVar, cardId, skillId);
                        }
                    }
                }
                if (setDmgType == DType.Dmg) _St_攻撃解除Flg = true;
                if (atkENo == -1 && setDmgValue > 0) {
                    setDmgValue += _手札AtkCng;
                    if (setDmgValue < 0) setDmgValue = 0;
                }
                SetEnemyDmgStac(setDmgType, TargetArr[i], waitFlame, setDmgValue, cardId, skillId);
                if (_AtkToCelDmgVar > 0 && setDmgValue >= 0 && setDmgType == DType.Dmg) {
                    _AtkToCelDmgVar = GetAddStateTurn(atkENo, StOneType.CelDmg, _AtkToCelDmgVar);
                    SetDmgStac_State(StOneType.CelDmg, TargetArr[i], waitFlame, _AtkToCelDmgVar);
                }
            }
            _CellDmg倍率 = 1; 
            break;
    }
    UseStateCk(atkENo);
}
let UseStateCk = function (_ENo) {
    try {
        let _CkState;
        if (_ENo <= -1) _CkState = NPlayer[(-_ENo - 1)]._NState;
        if (_ENo > -1) _CkState = NEnemy[_ENo]._NState;
        for (let i = 0; i <= _CkNState.length - 1; i++) {
        }
    } catch (e) {
    }
}
let GetDmgValue_AtkState = function (dmgType, dmgValue, ckNState) {
    for (let i = 0; i <= ckNState.length - 1; i++) {
        let stateTraits = $dataStates[ckNState[i]._No].traits; 
        for (let j = 0; j <= stateTraits.length - 1; j++) {
            if (stateTraits[j].code != 11) continue; 
            switch (dmgType) {
                case DType.Dmg: 
                    dmgValue = ChangeDmgValue_Traits(dmgValue, stateTraits[j], ckNState[i]);
                    break;
            }
        }
    }
    return dmgValue;
}
let GetAtkToCellValue = function (ckNState) {
    let rtnDmgValue = 0;
    for (let i = 0; i <= ckNState.length - 1; i++) {
        let _ckTraits = $dataStates[ckNState[i]._No].traits; 
        for (let j = 0; j <= _ckTraits.length - 1; j++) {
            if (_ckTraits[j].code != 11) continue; 
            switch (_ckTraits[j].dataId) {
                case StType.AtkToCel:
                    rtnDmgValue += Math.floor(_ckTraits[j].value * 100 - 100);
                    break;
            }
        }
    }
    return rtnDmgValue;
}
let ChangeDmgValue_Traits = function (dmgValue, traits, ckNState) {
    ckNState = typeof ckNState !== 'undefined' ? ckNState : null;
    let _StVar = Math.round((traits.value - 1) * 100); 
    switch (traits.dataId) {
        case StType.ADmgCng: 
            dmgValue += _StVar;
            break;
        case StType.ADmgDbl: 
            dmgValue += (_StVar / 100) * dmgValue;
            dmgValue = Math.floor(dmgValue);
            break;
        case StType.CardBaika: 
            if (ckNState != null) {
                if (UseCardId == $dataStates[ckNState._No].stepsToRemove) {
                    dmgValue *= _StVar;
                }
            }
            break;
    }
    return dmgValue;
}
let CardEditSkillSetting = function (dmgType, cardId, dmgValue) {
    cardId = typeof cardId !== 'undefined' ? cardId : -1; 
    CardEditSkill = null; 
    switch (dmgType) {
        case DType.DeckCAdd:    
        case DType.TrashAdd:    
        case DType.HandAdd:     
            CardEditSkill = new CardEditSkillData();
            CardEditSkill._CardId = Number(memoSkillArr[1]);    
            CardEditSkill._Maisu = Number(memoSkillArr[2]);     
            break;
        case DType.SWCng:    
        case DType.CmnEv:    
            CardEditSkill = new CardEditSkillData();
            if (cardId != -1) {
                let _CdData = new CardStatus($dataWeapons[cardId]);
                if (dmgType == DType.SWCng) CardEditSkill._SWNo = dmgValue; 
                if (dmgType == DType.CmnEv) CardEditSkill._CmnNo = dmgValue;  
            } else {
                if (dmgType == DType.SWCng) CardEditSkill._SWNo = Number(memoSkillArr[1]); 
                if (dmgType == DType.CmnEv) CardEditSkill._CmnNo = Number(memoSkillArr[1]); 
            }
            break;
    }
}
let DmgMotionSkipFlg = false;
let SetEnemyDmgStac = function (dmgType, targetENo, waitFlame, dmgValue, cardId, skillId) {
    cardId = typeof cardId !== 'undefined' ? cardId : -1;
    skillId = typeof skillId !== 'undefined' ? skillId : -1;
    let _SetStac = new StacDmgData();
    _SetStac._Type = dmgType;     
    _SetStac._CNo = targetENo;        
    _SetStac._Flame = waitFlame; 
    _SetStac._Var = dmgValue;     
    _SetStac._CardId = cardId;  
    _SetStac._SkillId = skillId;  
    _SetStac._ShakeSkipFlg = DmgESet_SkipFlg;
    _SetStac._DmgMotionSkipFlg = DmgMotionSkipFlg;
    _SetStac._CardEditSkill = CardEditSkill; 
    _SetStac._Kouka = CopyArr(CardKoukaArr); 
    EnemyDmgStac.push(_SetStac);
    DmgESet_SkipFlg = false;
    DmgMotionSkipFlg = false;
}
Game_Interpreter.prototype.TextPopUp_ENo = function (ENo, textStr, textSize) {
    textSize = typeof textSize !== 'undefined' ? textSize : 25;
    let PopUpPosX = -50;
    if (ENo <= -1) {
        _C_Str = NPlayer[-ENo - 1]._name;
        _SSetX = NPlayer[-ENo - 1]._screenX + PopUpPosX;
        _SSetY = NPlayer[-ENo - 1]._screenY;
        _APosX = NPlayer[-ENo - 1]._screenX;
        _APosY = NPlayer[-ENo - 1]._screenY;
    } else {
        _C_Str = NEnemy[ENo]._name; 
        _SSetX = NEnemy[ENo]._screenX + NEnemy[ENo]._IcX - 40;
        _SSetY = NEnemy[ENo]._screenY - (NEnemy[ENo]._pHeight / 2) + NEnemy[ENo]._IcY;
        _APosX = NEnemy[ENo]._screenX;
        _APosY = NEnemy[ENo]._screenY;
    }
    this.SetDmgPicture(_SSetX, _SSetY, textStr, textSize);
}
Game_Interpreter.prototype.ChangeDmgValue_DefENo = function (targetENo, dmgValue, _防御貫通Flg) {
    _防御貫通Flg = typeof _防御貫通Flg !== 'undefined' ? _防御貫通Flg : false; 
    let _ckNState;
    if (targetENo <= -1) {
        _ckNState = NPlayer[-targetENo - 1]._NState;
    } else {
        _ckNState = NEnemy[targetENo]._NState;
    }
    for (let i = 0; i <= _ckNState.length - 1; i++) {
        let _Traits = $dataStates[_ckNState[i]._No].traits;
        for (let j = 0; j <= _Traits.length - 1; j++) {
            if (_Traits[j].code != 11) continue;
            switch (_Traits[j].dataId) {
                case StType.BaseDef: 
                    let _TVald = Math.round(dmgValue / 2);
                    if (dmgValue > 0) dmgValue -= _TVald;
                    break;
                case StType.HiDmgCng: 
                    let _TVal = Math.round(((_Traits[j].value - 1) * 100));
                    if (_TVal < 0 && _防御貫通Flg) _TVal = 0; 
                    dmgValue += _TVal;
                    break;
                case StType.CelHiDmgCng: 
                    let _CellTnVar = GetNStateTurn_ENo(targetENo, StOneType.CelDmg);
                    dmgValue -= Math.floor(_CellTnVar / 4);
            }
        }
    }
    if (dmgValue <= 0) dmgValue = 0;
    return dmgValue;
}
/**
 * 同じ位置にポップアップが出ないようにするための配列
 * @type {PopUpPosCheckData[]}　*/
let PopUpPosCheckArr = [];
class PopUpPosCheckData {
    constructor(setX , setY , ckFrame) {
        this.setX = setX;
        this.setY = setY;
        this.ckFrame = ckFrame; 
    }
}
let EnemyDmgStac = []; 
let DmgAnimeFlame = 0; 
let DmgAnimeName = "";
Game_Interpreter.prototype.DmgEffectUpdate = function () {
    for (let i = 0; i < PopUpPosCheckArr.length; i++) {
        if (PopUpPosCheckArr[i].ckFrame > 0) {
            PopUpPosCheckArr[i].ckFrame--;
            if (PopUpPosCheckArr[i].ckFrame <= 0) {
                PopUpPosCheckArr.splice(i, 1);
                i--;
            }
        }
    }
    if (DmgAnimeFlame > 0) {
        DmgAnimeFlame--; 
        if (DmgAnimeFlame <= 0) DmgAnimeName = "";
    }
    let popUpPosX = -50;
    for (let i = 0; i <= EnemyDmgStac.length - 1; i++) {
        EnemyDmgStac[i]._Flame--;
        if (EnemyDmgStac[i]._Flame <= 0) {
            let dmgType = EnemyDmgStac[i]._Type; 
            let targetENo = EnemyDmgStac[i]._CNo; //攻撃対象: 味方(-1以下) < 主人公(-1) < 敵(0以降)
            let dmgKouka = EnemyDmgStac[i]._Kouka; 
            this.SetPicStrFont("Arial Black");
            let continueFlg = false; 
            switch (dmgType) {
                case DType.Draw:    
                    let DrCounter = 0;
                    for (let j = 0; j <= EnemyDmgStac[i]._Var - 1; j++) {
                        if (CardData.length < BtlStatic._手札最大枚数) { 
                            AddCardDrawStac(); 
                            DrCounter++;
                        }
                    }
                    this.BLogAdd(180, "カードを" + DrCounter + "枚ドロー");
                    this.HandCardPicSort(-1); 
                    this.CardDrawMove(); 
                    continueFlg = true;
                    break; 
                case DType.DeckCAdd: 
                case DType.TrashAdd: 
                case DType.HandAdd:  
                    let cardId = EnemyDmgStac[i]._CardEditSkill._CardId;
                    let maisuValue = EnemyDmgStac[i]._CardEditSkill._Maisu;
                    if (dmgType == DType.DeckCAdd) this.DeckCardAdd(cardId, maisuValue);
                    if (dmgType == DType.TrashAdd) this.DeckTrashAdd(cardId, maisuValue);
                    if (dmgType == DType.HandAdd) this.DeckHandAdd(cardId, maisuValue);
                    continueFlg = true;
                    break; 
                case DType.HandCRecv:  
                    for (let j = 0; j <= CardData.length - 1; j++) {
                        if (CardData[j].CardData.wtypeId == CType.異常) {
                            this.HandCard_TrashMove(CardData[j].setPNo); 
                            CardData.splice(j, 1);
                            j--;
                        }
                    }
                    continueFlg = true;
                    break; 
                case DType.Reload:  
                    this.AllCardTrash_Move();
                    let drawCount = CardData.length;
                    for (let j = 0; j <= CardData.length - 1; j++) {
                        CardData.splice(j, 1);
                        j--;
                    }
                    SetEnemyDmgStac(DType.Draw, -1, 1, drawCount);
                    continueFlg = true;
                    break; 
                case DType.HandSute: 
                    this.AllCardTrash_Move();
                    for (let j = 0; j <= CardData.length - 1; j++) {
                        CardData.splice(j, 1);
                        j--;
                    }
                    continueFlg = true;
                    break; 
                case DType.SWCng:   
                    $gameSwitches.setValue(EnemyDmgStac[i]._CardEditSkill._SWNo, true)
                    continueFlg = true;
                    break; 
                case DType.CmnEv:   
                    console.log("戦闘行動コモン発動：" + EnemyDmgStac[i]._CardEditSkill._CmnNo);
                    this.SetCmnEventSc(EnemyDmgStac[i]._CardEditSkill._CmnNo);
                    continueFlg = true;
                    break; 
                case DType.TCDelay:  
                    this.SetTCPlayerSkill(EnemyDmgStac[i]._CardId, EnemyDmgStac[i]._Var);
                    continueFlg = true;
                    break; 
                case DType.Hirumi:  
                    this.PlayerHirumiEffect(); 
                    continueFlg = true;
                    break; 
                case DType.ItemAdd: 
                    let itemID = EnemyDmgStac[i]._Var;
                    let itemData = GetBtlItemData(itemID);
                    this.BtlItemAdd(itemID, 1);
                    this.BLogAdd(180, itemData._name + "を取得した");
                    this.BtlItemBtnDraw(); 
                    continueFlg = true;
                    break; 
                case DType.HCostCng:   
                    this.HandCardCost_Change(EnemyDmgStac[i]._Var);
                    continueFlg = true;
                    break; 
                case DType.HCostHrfRnd: 
                    this.HandCardCost_HrfRndCost(EnemyDmgStac[i]._Var);
                    continueFlg = true;
                    break; 
                case DType.HCostZeroRnd: 
                    this.HandCardCost_HrfRndCost(EnemyDmgStac[i]._Var, true); 
                    continueFlg = true;
                    break; 
                case DType.StateDel: 
                    let ckState = GetNState_ENo(targetENo);
                    for (let j = 0; j <= ckState.length - 1; j++) {
                        if (MetaChecker($dataStates[ckState[j]._No] , "有利" , false) != false) {
                            if (MetaChecker($dataStates[ckState[j]._No] , "剥がれない" , false) == false) {
                                this.BLogAdd(180, GetEnemyName_ENo(targetENo) + "の\\state[" + ckState[j]._No + "]は解除された");
                                ckState.splice(j, 1);
                                j--;
                            }
                        }
                    }
                    continueFlg = true;
                    break; 
                case DType.SknCng: 
                    if ($gameVariables._data[VN_Seikan] == undefined) $gameVariables._data[VN_Seikan] = 0;
                    let _CngVar = EnemyDmgStac[i]._Var;
                    if (CheckStateInType(NPlayer[0]._NState, StType.SeikanJoso)) { 
                        let _cngVar = GetStateTypeSumValue(NPlayer[0]._NState, StType.SeikanJoso); 
                        _CngVar = EnemyDmgStac[i]._Var * (1 + (_cngVar / 100));
                        _CngVar = Math.floor(_CngVar);
                    }
                    if (BtlCard_性感位置Str != "") {
                        let ck開発Mode = -1;
                        if (BtlCard_性感位置Str == "口") ck開発Mode = 0;
                        if (BtlCard_性感位置Str == "乳") ck開発Mode = 1;
                        if (BtlCard_性感位置Str == "尻") ck開発Mode = 2;
                        if (BtlCard_性感位置Str == "膣") ck開発Mode = 3;
                        if (ck開発Mode != -1) {
                            let _Keiken = $gameVariables.value(VN_Kaihatu + ck開発Mode); 
                            let _開発Rank = 1; 
                            if (_Keiken >= $Nupu_PSData.hStData.cRankValue) _開発Rank++; 
                            if (_Keiken >= $Nupu_PSData.hStData.bRankValue) _開発Rank++; 
                            if (_Keiken >= $Nupu_PSData.hStData.aRankValue) _開発Rank++; 
                            if (_Keiken >= H_MaxRank経験値) _開発Rank++; 
                            if (_開発Rank == 1) _CngVar *= 0.25;
                            if (_開発Rank == 2) _CngVar *= 0.5;
                            if (_開発Rank == 3) _CngVar *= 1;
                            if (_開発Rank == 4) _CngVar *= 2;
                            if (_開発Rank == 5) _CngVar *= 3;
                            _CngVar = Math.floor(_CngVar);
                        }
                    }
                    $gameVariables._data[VN_Seikan] = $gameVariables._data[VN_Seikan] + _CngVar;
                    if ($gameVariables._data[VN_Seikan] < 0) $gameVariables._data[VN_Seikan] = 0;
                    if ($gameVariables._data[VN_Seikan] > 100) $gameVariables._data[VN_Seikan] = 100;
                    continueFlg = true;
                    break; 
                case DType.Bit_TurnCng: 
                    this.Bit_TurnCng(EnemyDmgStac[i]._Var);
                    continueFlg = true;
                    break; 
                case DType.Bit_VarCng:  
                    this.Bit_VarCng(EnemyDmgStac[i]._Var);
                    continueFlg = true;
                    break; 
                case DType.BitSet_Atk:  
                    this.BtlBit_Set(EnemyDmgStac[i]._SkillId);
                    continueFlg = true;
                    break; 
                case DType.ItemCoolTurnCng:  
                    for (let i = 0; i < $gameSystem.AdSysCT.length; i++) {
                        if ($gameSystem.AdSysCT[i].ct > 0) {
                            $gameSystem.AdSysCT[i].ct--;
                        }
                    }
                    continueFlg = true;
                    this.BtlItemBtnDraw(); 
                    break; 
            }
            if (continueFlg) {  
                EnemyDmgStac.splice(i, 1);
                i--; 
                continue; 
            }
            let DmgShakeFlg = true; 
            let _C_Str = ""; 
            let _I_Str = ""; 
            let _B_Str = ""; 
            let _SSetX = 0;
            let _SSetY = 0;
            let _APosX = 0;
            let _APosY = 0;
            if (targetENo <= -1) { 
                if (NPlayer[-targetENo - 1] == undefined) return; 
                _C_Str = NPlayer[-targetENo - 1]._name;
                _SSetX = NPlayer[-targetENo - 1]._screenX + popUpPosX;
                _SSetY = NPlayer[-targetENo - 1]._screenY;
                _APosX = NPlayer[-targetENo - 1]._screenX;
                _APosY = NPlayer[-targetENo - 1]._screenY;
            } else {
                if (NEnemy[targetENo] == undefined) {
                    EnemyDmgStac.splice(i, 1); 
                    i--;
                    continue;
                }
                _C_Str = NEnemy[targetENo]._name; 
                _SSetX = NEnemy[targetENo]._screenX + NEnemy[targetENo]._IcX - 40;
                _SSetY = NEnemy[targetENo]._screenY - (NEnemy[targetENo]._pHeight / 2) + NEnemy[targetENo]._IcY;
                _APosX = NEnemy[targetENo]._screenX;
                _APosY = NEnemy[targetENo]._screenY;
            }
            if (dmgType == DType.SetState) { 
                _SSetY -= 40; 
                let _ckStId = EnemyDmgStac[i]._StId;
                let _ckSTurn = EnemyDmgStac[i]._Turn;
                let _StateMsg = $dataStates[_ckStId].message1;
                _I_Str = "\\I[" + $dataStates[_ckStId].iconIndex + "]"; 
                _B_Str = EnemyDmgStac[i]._Turn; 
                _StateMsg = _StateMsg.replace("<C>", _C_Str).replace("<I>", _I_Str).replace("<B>", _B_Str);
                this.BLogAdd(180, _StateMsg);
                let _PosStr = ""; 
                if ($dataStates[_ckStId].meta["有利"]) {
                    _PosStr = "\\state[" + _ckStId + "]"
                    this.SetDmgPicture(_SSetX, _SSetY, _PosStr);
                    DmgShakeFlg = false;
                } else {
                    switch (_ckStId) { 
                        case StOneType.Defense: 
                            _PosStr = "\\I[" + $dataStates[_ckStId].iconIndex + "] 防御値+" + EnemyDmgStac[i]._Turn;
                            this.SetDmgPicture(_SSetX, _SSetY, _PosStr);
                            DmgShakeFlg = false;
                            break;
                        case StOneType.CelDmg: 
                            this.SetDmgPicture(_SSetX, _SSetY, _ckSTurn, 31);
                            break;
                        default: 
                            _PosStr = "\\state[" + _ckStId + "]"
                            this.SetDmgPicture(_SSetX, _SSetY, _PosStr);
                    }
                }
                if (targetENo <= -1) {
                    sateAddPlayerFlg = -targetENo - 1 == 0;
                    AddNState(NPlayer[-targetENo - 1]._NState, _ckStId, _ckSTurn);
                    if (-targetENo - 1 == 0) {
                        $gameActors.actor(1).addState(_ckStId);
                    }
                } else {
                    AddNState(NEnemy[targetENo]._NState, _ckStId, _ckSTurn);
                }
            } else {
                let setDmgValue = EnemyDmgStac[i]._Var; 
                let _BLogStr = "";
                let _SetCol = 29;
                let _dmgSkipFlg = false; 
                switch (dmgType) {
                    case DType.HpRecv:  
                    case DType.HpKyuketu:  
                        if (dmgType == DType.HpKyuketu)
                            setDmgValue = _Skill吸血Dmg;
                        DmgShakeFlg = false;
                        _BLogStr = _C_Str + "は" + setDmgValue + "点回復した";
                        this.BLogAdd(180, _BLogStr, _SetCol);
                        this.SetDmgPicture(_SSetX, _SSetY, setDmgValue, _SetCol);
                        setDmgValue *= -1;
                        break;
                    case DType.MpRecv:  
                        DmgShakeFlg = false;
                        _BLogStr = _C_Str + "はMPが" + setDmgValue + "点回復した";
                        this.BLogAdd(180, _BLogStr, _SetCol);
                        this.MPKaihuku(setDmgValue);
                        _SetCol = 23;
                        this.SetDmgPicture(_SSetX, _SSetY, setDmgValue, _SetCol);
                        setDmgValue = 0;
                        break;
                    case DType.HPMstCng:  
                        var _grvdFlg = false;
                        try {
                            if (MetaChecker($dataSkills[EnemyDmgStac[i]._SkillId] , "グラビデ" , false) != false) {
                                _grvdFlg = true;
                            }
                        } catch (e) { }
                        if (targetENo <= -1) {
                            if (_grvdFlg)
                                NPlayer[(-targetENo - 1)]._hp = Math.round(NPlayer[(-targetENo - 1)]._hp / setDmgValue);
                            else
                                NPlayer[(-targetENo - 1)]._hp = setDmgValue; 
                        } else {
                            if (_grvdFlg)
                                NEnemy[targetENo]._hp = Math.round(NEnemy[targetENo]._hp / setDmgValue);
                            else
                                NEnemy[targetENo]._hp = setDmgValue; 
                        }
                        _dmgSkipFlg = true; 
                        break;
                    default:            
                        let _DefBrakeFlg = (dmgKouka.indexOf(KSkill.防御貫通) != -1); 
                        setDmgValue = this.ChangeDmgValue_DefENo(targetENo, setDmgValue, _DefBrakeFlg);
                        let _DefPoint = GetNStateTurn_ENo(targetENo, StOneType.Defense); 
                        if (_DefPoint != -1) { 
                            _DefPoint -= setDmgValue; 
                            CngStateTurn_ENo(targetENo, StOneType.Defense, -setDmgValue); 
                            if (dmgType == DType.DefBrake) { 
                                this.BLogAdd(180, _C_Str + "の防御値を" + setDmgValue + "削った");
                                EnemyDmgStac.splice(i, 1);
                                i--; 
                                continue;
                            }
                            if (_DefPoint >= 0 && !_DefBrakeFlg) { 
                                _DefCmpFlg = true;
                                this.BLogAdd(180, _C_Str + "は" + setDmgValue + "ダメージを軽減した");
                                this.PlayAnime(GardAnimeId, _APosX, _APosY); 
                                EnemyDmgStac.splice(i, 1);
                                i--;
                                continue;
                            } else {
                                if (!_DefBrakeFlg) { 
                                    setDmgValue = -_DefPoint; 
                                }
                            }
                        }
                        if (dmgType == DType.DefBrake) {
                            EnemyDmgStac.splice(i, 1);
                            i--;
                            continue;
                        }
                        this.BLogAdd(180, _C_Str + "に" + setDmgValue + "ダメージ!!");
                        this.SetDmgPicture(_SSetX, _SSetY, setDmgValue);
                        if (setDmgValue > 0) _Skill吸血Dmg += setDmgValue; 
                }
                if (!_dmgSkipFlg) {
                    if (targetENo <= -1) {
                        NPlayer[-targetENo - 1]._hp -= setDmgValue;
                        if (targetENo == -1) {
                            if (NPlayer[0]._hp > NPlayer[0].mhp) NPlayer[0]._hp = NPlayer[0].mhp;
                            if (NPlayer[0]._hp <= 0) {
                                NPlayer[0]._hp = 0;
                                if (ENo_StateCk_Type(targetENo, StType.Kuisibari)) {
                                    this.BLogAdd(180, _C_Str + "は" + setDmgValue + "食いしばった!!");
                                    NPlayer[0]._hp = 1;
                                    DelStateType_ENo(-1 , StType.Kuisibari);
                                }
                            }
                        } else {
                            this.DownCheck_Mikata(EnemyDmgStac[i]);
                        }
                    } else {
                        NEnemy[targetENo]._hp -= setDmgValue;
                        if ($gameSwitches.value(BtlStatic.SW_ラスボス演出)) {
                            let par50_1 = 0.5;
                            if (NEnemy[targetENo]._hp < Math.floor(NEnemy[targetENo].mhp * par50_1) && !$gameSwitches.value(841)
                                && !$gameSwitches.value(1346)) {
                                NEnemy[targetENo]._hp = Math.floor(NEnemy[targetENo].mhp * par50_1);
                                NEnemy[targetENo]._NState = []; 
                            }
                            let par60 = 0.6;
                            if (NEnemy[targetENo]._hp < Math.floor(NEnemy[targetENo].mhp * par60) && $gameSwitches.value(841)
                                && !$gameSwitches.value(1344)) {
                                NEnemy[targetENo]._hp = Math.floor(NEnemy[targetENo].mhp * par60); 
                                NEnemy[targetENo]._NState = []; 
                            }
                            let par25 = 0.25;
                            if (NEnemy[targetENo]._hp < Math.floor(NEnemy[targetENo].mhp * par25) && $gameSwitches.value(1344)
                                && !$gameSwitches.value(1345)) {
                                NEnemy[targetENo]._hp = Math.floor(NEnemy[targetENo].mhp * par25); 
                                NEnemy[targetENo]._NState = []; 
                            }
                        }
                        if (NEnemy[targetENo]._hp > NEnemy[targetENo].mhp) NEnemy[targetENo]._hp = NEnemy[targetENo].mhp;
                        if (setDmgValue > 0) this.DownCheck_Enemy(EnemyDmgStac[i]);
                    }
                }
            }
            if (DmgShakeFlg && StateSyoriEnd && (targetENo == -1)) {
                if (!EnemyDmgStac[i]._DmgMotionSkipFlg) this.PlayerHirumiEffect();
            }
            if (DmgShakeFlg && !EnemyDmgStac[i]._ShakeSkipFlg) { 
                $gameScreen.startShake(3, 20, 5); 
            }
        }
        if (EnemyDmgStac[i]._Flame <= 0) {
            EnemyDmgStac.splice(i, 1);
            i--;
        }
    }
    this.DmgPicMove_Update();
}
Game_Interpreter.prototype.HandCardCost_Change = function (cngValue) {
    for (let i = 0; i <= CardData.length - 1; i++) {
        if (CardData[i].Cost != "All") {
            CardData[i].Cost += cngValue;
        }
        if (cngValue < 0) CardData[i].MoveAftPtc = "BtlCostCng_Up";
        if (cngValue > 0) CardData[i].MoveAftPtc = "BtlCostCng_Down";
        if (CardData[i].Cost < 0) CardData[i].Cost = 0;
        if (CardData[i].Cost > 9) CardData[i].Cost = 9;
        this.CardReDrawC(i);
        CardData[i].KeepPicData = this.PicObjGet(CardData[i].setPNo);
    }
}
Game_Interpreter.prototype.HandCardCost_HrfRndCost = function (_CngVar, _ZeroFlg) {
    _ZeroFlg = typeof _ZeroFlg !== 'undefined' ? _ZeroFlg : false;
    let _HarfArr = [];
    for (let i = 0; i <= _CngVar - 1; i++) {
        if (_HarfArr.length >= CardData.length) break;
        let _SetNo = NRandGet(CardData.length - 1);
        if (_HarfArr.indexOf(_SetNo) != -1) {
            i--;
            continue;
        }
        _HarfArr.push(_SetNo);
    }
    for (let i = 0; i <= _HarfArr.length - 1; i++) {
        let _ckNo = _HarfArr[i];
        if (CardData[_ckNo].Cost != "All") {
            if (_ZeroFlg) {
                CardData[_ckNo].Cost = 0;
            } else {
                CardData[_ckNo].Cost = Math.floor(CardData[_ckNo].Cost / 2);
            }
        }
        if (CardData[_ckNo].Cost < 0) CardData[_ckNo].Cost = 0;
        CardData[_ckNo].MoveAftPtc = "BtlCostCng_Up";
        this.CardReDrawC(_ckNo);
        CardData[_ckNo].KeepPicData = this.PicObjGet(CardData[_ckNo].setPNo);
    }
}
let _SetBitType = "";
Game_Interpreter.prototype.BtlBit_Set = function (_SkillId) {
    let _SetTurn = 3;
    let _BitFType = MetaChecker($dataSkills[_SkillId], "FType", "Atk");
    if (_所持レリック確認(Itm_Reric.ビットTn増加)) _SetTurn += 4;
    NPlayer[0]._BtlBit.unshift(new BtlBitData(_BitFType, 10, _SetTurn));
}
Game_Interpreter.prototype.PlayerHirumiEffect = function (voiceOffFlg) {
    voiceOffFlg = typeof voiceOffFlg !== 'undefined' ? voiceOffFlg : false;
    if (plNotHirumi) return;
    Live2D_WaitSetTime = 40;
    spainWaitAnimeFlame = 30;
    if (!this.IsPlayerメタル化()) this.SetSpineAnime(PN_CharacterPL, "Dmg", false);
    if (BtlRomashaFlg && !this.IsPlayerメタル化()) {
        if (!voiceOffFlg) {
            if (NPlayer[0].hp <= 0) {
                this.PRandVoice("romasha",["h1_505_tuuan","h1_506_nnfuu","h1_510_hiiuu","h1_511_kufuu","h1_514_afuu"]);
            } else {
                this.PRandVoice("romasha",["btl_395_kyaa","btl_396_ngu","btl_397","btl_398_ita","btl_398_ita_2","btl_399_au","btl_400_damee","btl_401_iyaaa"]);
            }
        }
        if (DmgAnimeName != "") {
            // let nowPlayAnime = PlayL2DAnimeName(MdlRomashaBattle , 0);
            // if (nowPlayAnime != "battale_bottomdamage" && nowPlayAnime != "battale_topdamage") {
            //     L2dSetMotion(MdlRomashaBattle, DmgAnimeName);
            if (!this.IsPlayerメタル化()) L2dSetMotion(MdlRomashaBattle, DmgAnimeName);
        } else {
            DmgAnimeFlame = 20;
            if (Math.random() >= 0.5) { 
                L2dSetMotion(MdlRomashaBattle, "battale_bottomdamage");
                DmgAnimeName = "battale_bottomdamage";
            } else {
                L2dSetMotion(MdlRomashaBattle, "battale_topdamage");
                DmgAnimeName = "battale_topdamage";
            }
        }
        this.BtlLive2DParamSet_State();
    }
}
Game_Interpreter.prototype.DownCheck_Mikata = function (dmgStacData) {
    let charaNo = -dmgStacData._CNo - 1;
    let pictureNo = NPlayer[charaNo]._PicNo;
    if (NPlayer[charaNo].SpineFlg) {
        let idlName = GetEnemyIdlName(NPlayer[charaNo]);
        this.SetSpineAnime(PN_CharacterPL + pictureNo, "Dmg", false, 0, 100);
        this.AddSpineAnime(PN_CharacterPL + pictureNo, idlName, true, 0, 100);
    }
    if (btl味方VoiceData.isVoice) {
        if (NPlayer[charaNo]._hp <= 0) { 
            if (btl味方VoiceData.DownVoice.length > 0) {
                this.PRandVoice(btl味方VoiceData.charaName, btl味方VoiceData.DownVoice);
            }
        } else {
            if (btl味方VoiceData.DmgVoice.length > 0) {
                this.PRandVoice(btl味方VoiceData.charaName, btl味方VoiceData.DmgVoice);
            }
        }
    }
    if (NPlayer[charaNo]._hp <= 0) { 
        NPlayer[charaNo]._hp = 0;
        this.PicCngColor(PN_CharacterPL + pictureNo, [220, 220, 220, 0], 20);
        this.MovePict(PN_CharacterPL + pictureNo,
            NPlayer[charaNo]._screenX, NPlayer[charaNo]._screenY - 10, 25, 0 ,
            -100 * NPlayer[charaNo].SpineXScale , 100 * Math.abs(NPlayer[charaNo].SpineXScale)); 
        this.DelSprite(PN_NextIcoPL + pictureNo);
        this.DelSprite(PN_NextPicPL + pictureNo);
        let enemyData = GetEnemyData_ENo(-charaNo - 1);
        if (MetaChecker(enemyData, "残骸", "Not") != "Not") {
            this.SetPictC(PN_CharacterPL + pictureNo, "enemies/" + enemyData.battlerName + "_Down",
                NPlayer[charaNo]._screenX, NPlayer[charaNo]._screenY, 255, -100);
        }
        let metaStr = MetaChecker(enemyData, "死時SW", "");
        if (metaStr != "") $gameSwitches.setValue(BtlSwCk(metaStr), true);
        let deadAnime = MetaChecker(enemyData, "SpineDead", false);
        if (deadAnime != false) {
            this.SetSpineAnime(PN_CharacterPL + pictureNo, deadAnime, false, 0, 100);
        }
        this.BLogAdd(180, NPlayer[charaNo]._name + "は倒れた!!");
        this.RemoveTCData_ENo(dmgStacData._CNo); 
        N_Sprite_DLayer = 1;
        this.DelSprite(PN_DifNum_PL + pictureNo);
        N_Sprite_DLayer = 0;
    }
    if (NPlayer[charaNo]._hp > NPlayer[charaNo].mhp) {
        NPlayer[charaNo]._hp = NPlayer[charaNo].mhp;
    }
}
Game_Interpreter.prototype.DownCheck_Enemy = function (dmgStacData) {
    let ENo = dmgStacData._CNo;
    let pictureNo = NEnemy[ENo]._PicNo;
    if (NEnemy[ENo].SpineFlg) {
        let idlName = GetEnemyIdlName(NEnemy[ENo]);
        this.SetSpineAnime(PN_Character + pictureNo, "Dmg", false, 0, 100);
        this.AddSpineAnime(PN_Character + pictureNo, idlName, true, 0, 100);
    }
    if (NEnemy[ENo]._hp <= 0) this.EnemyDown_ENo(ENo);
    if (NEnemy[ENo]._hp > NEnemy[ENo].mhp) {
        NEnemy[ENo]._hp = NEnemy[ENo].mhp;
    }
}
var bラスボス撃破 = false;
Game_Interpreter.prototype.EnemyDown_ENo = function (ENo) {
    let pictureNo = NEnemy[ENo]._PicNo;
    NEnemy[ENo]._hp = 0;
    var _第２形態BtlSw = MetaChecker(NEnemy[ENo].enemy() , "第２形態BtlSw" , false);
    if (_第２形態BtlSw != false) {
        $gameSwitches.setValue(BtlStatic.SW_戦闘用SW - 1 + Number(_第２形態BtlSw) , true);
        NEnemy[ENo]._hp = 1;
        return;
    }
    if ($gameSwitches.value(BtlStatic.SW_ラスボス演出)) {
        bラスボス撃破 = true;
        return;
    }
    this.SpriteCngColor(PN_Character + pictureNo, [220, 220, 220, 0], 20);
    if (NEnemy[ENo].SpineFlg) {
        this.MovePict(PN_Character + pictureNo,
            NEnemy[ENo]._screenX, NEnemy[ENo]._screenY - 10, 25, 0, true, true);
    } else {
        this.MoveSprite(PN_Character + pictureNo,
            NEnemy[ENo]._screenX, NEnemy[ENo]._screenY - 10, 25, 0, true, true);
    }
    let enemyData = GetEnemyData_ENo(ENo);
    if (MetaChecker(enemyData, "残骸", "Not") != "Not") {
        this.SetSpriteC(PN_Character + pictureNo, "enemies/" + enemyData.battlerName + "_Down",
            NEnemy[ENo]._screenX, NEnemy[ENo]._screenY);
    } else {
        this.DelSprite(PN_NextIco + pictureNo); 
        this.DelSprite(PN_NextDmg + pictureNo);
    }
    let deathStr = MetaChecker(enemyData, "死時SW", "Not");
    if (deathStr != "Not") $gameSwitches.setValue(Number(deathStr), true);
    let deadAnime = MetaChecker(enemyData, "SpineDead", false);
    if (deadAnime != false) {
        this.SetSpineAnime(PN_Character + pictureNo, deadAnime, false, 0, 100);
    }
    this.DelSprite(PN_NextPic + pictureNo); 
    this.BLogAdd(180, NEnemy[ENo]._name + "は倒れた!!");
    this.RemoveTCData_ENo(ENo); 
    if (BtlEnemyCellDmgFlg) {
        BtlEnemyCellDmgFlg = false;
        NextTurnCardMoveSkip = true; 
    }
    N_Sprite_DLayer = 1;
    this.DelSprite(PN_DifNum + pictureNo);
    N_Sprite_DLayer = 0;
}
class DmgPicMover {
    constructor() {
        this._x = 0; 
        this._y = 0; 
        this._colId = 0; 
        this._flame = 0; 
        this._Val = 0; 
        this._MStr = []; 
        this._MStrC = 0;
        this._CSpace = 30; 
        this._StrSize = 25; 
    }
}
let _DmgPicArr = [
    new DmgPicMover(), new DmgPicMover(), new DmgPicMover(),
    new DmgPicMover(), new DmgPicMover(), new DmgPicMover(),
    new DmgPicMover(), new DmgPicMover(), new DmgPicMover()
];
let DmCounter = 0;
Game_Interpreter.prototype.SetDmgPicture = function (setX, setY, dmgValue, colorId) {
    colorId = typeof colorId !== 'undefined' ? colorId : 0;
    if (dmgValue == undefined) {
        return;
    }
    if (dmgValue.indexOf != undefined) {
        if (dmgValue.indexOf("\\state[") != -1) {
            for (let i = 0; i < PopUpPosCheckArr.length; i++) {
                if (PopUpPosCheckArr[i].setX == setX && PopUpPosCheckArr[i].setY == setY) {
                    setY -= 32;
                    i = 0; 
                }
            }
            PopUpPosCheckArr.push(new PopUpPosCheckData(setX, setY, 15));
        }
    }
    let randHani = 50;
    let randX = Math.random() * randHani - (randHani / 2);
    let randY = Math.random() * randHani - (randHani / 2);
    _DmgPicArr[DmCounter]._colId = colorId;
    _DmgPicArr[DmCounter]._Val = dmgValue;
    _DmgPicArr[DmCounter]._MStr = []; 
    if (dmgValue.length > 3) { 
        randX = 0;
        randY = 0;
        _DmgPicArr[DmCounter]._StrSize = 25; 
        _DmgPicArr[DmCounter]._MStr.push(dmgValue);
    } else {
        if (dmgValue < 10) _DmgPicArr[DmCounter]._StrSize = 25; 
        if (dmgValue >= 10) { 
            _DmgPicArr[DmCounter]._StrSize = 30;
            _DmgPicArr[DmCounter]._CSpace = 23
        }
        if (dmgValue > 60) { 
            _DmgPicArr[DmCounter]._StrSize = 40;
            _DmgPicArr[DmCounter]._CSpace = 30;
            if (_DmgPicArr[DmCounter]._colId == 0) _DmgPicArr[DmCounter]._colId = 6;
        }
        if (dmgValue > 100) {
            _DmgPicArr[DmCounter]._StrSize = 50; 
            _DmgPicArr[DmCounter]._CSpace = 40;
            if (_DmgPicArr[DmCounter]._colId == 0) _DmgPicArr[DmCounter]._colId = 14;
        }
        for (let i = 0; i <= String(dmgValue).length - 1; i++) {
            _DmgPicArr[DmCounter]._MStr.push(String(dmgValue).substr(i, 1));
        }
    }
    _DmgPicArr[DmCounter]._x = setX + randX;
    _DmgPicArr[DmCounter]._y = setY + randY;
    _DmgPicArr[DmCounter]._MStrC = 0; 
    _DmgPicArr[DmCounter]._flame = 1; 
    DmCounter++;
    if (DmCounter >= 8) DmCounter = 0;
}
const OneMojiFlame = 5; 
Game_Interpreter.prototype.DmgPicMove_Update = function () {
    for (di = 0; di <= _DmgPicArr.length - 1; di++) {
        if (_DmgPicArr[di]._flame != 0) { 
            let strSpace = _DmgPicArr[di]._CSpace; 
            if (_DmgPicArr[di]._flame == 1) {
                let outLineCng = "\\oc[rgb(0,0,0)]\\ow[6] "; 
                let colCng = ""; 
                if (_DmgPicArr[di]._colId != 0) colCng = "\\C[" + _DmgPicArr[di]._colId + "]";
                for (let mi = 0; mi <= _DmgPicArr[di]._MStr.length - 1; mi++) {
                    this.SetPicStrFont("Arial Black");
                    this.SpriteStr(PN_DmgTxtE + mi + (3 * di), outLineCng + colCng + _DmgPicArr[di]._MStr[mi] + "　",
                        _DmgPicArr[di]._StrSize, _DmgPicArr[di]._x + mi * strSpace, _DmgPicArr[di]._y, 0);
                }
            }
            if (_DmgPicArr[di]._flame < 60) { 
                if (_DmgPicArr[di]._flame % 6 == 2 && _DmgPicArr[di]._MStrC != _DmgPicArr[di]._MStr.length) {
                    this.EMoveSet("easeOutBack");
                    this.MoveSprite(PN_DmgTxtE + _DmgPicArr[di]._MStrC + (3 * di),
                        _DmgPicArr[di]._x + _DmgPicArr[di]._MStrC * strSpace, _DmgPicArr[di]._y - 20, 10, 255);
                    _DmgPicArr[di]._MStrC++;
                    this.EMoveSet("");
                }
            } else {
                if (_DmgPicArr[di]._flame == 61) {
                    _DmgPicArr[di]._MStrC = 0;
                }
                if (_DmgPicArr[di]._flame % 6 == 2 && _DmgPicArr[di]._MStrC != _DmgPicArr[di]._MStr.length) {
                    this.EMoveSet("easeOutBack");
                    this.MoveSprite(PN_DmgTxtE + _DmgPicArr[di]._MStrC + (3 * di),
                        _DmgPicArr[di]._x + _DmgPicArr[di]._MStrC * strSpace, _DmgPicArr[di]._y - 40, 10, 0);
                    _DmgPicArr[di]._MStrC++;
                    this.EMoveSet("");
                }
                if (_DmgPicArr[di]._flame == 90) {
                    _DmgPicArr[di]._flame = 0; 
                    continue; 
                }
            }
            _DmgPicArr[di]._flame++;
        }
    }
}
