Game_Interpreter.prototype.LastBossEv1_Start = function () {
    NEnemy[0]._hp = Math.round(NEnemy[0].mhp * 0.5); 
    NEnemy[0]._NState = []; 
    this.BtlAutoChange(false); 
}
let LastBossEv1Frame = 0;
Game_Interpreter.prototype.LastBossEv1_Update = function () {
    let plPosX = NPlayer[0]._screenX - 30;
    let plPosY = NPlayer[0]._screenY - 30;
    if (LastBossEv1Frame == 0) {
        this.PlayPtcPic("Lb2AllDelete_Bef2", plPosX + 30, plPosY + 40);
    }
    if (LastBossEv1Frame == 60) {
        this.PlayPtcPic("Lb2AllDelete", plPosX + 30, plPosY + 40);
        for (let i = 0; i < CardData.length; i++) {
            this.HandCard_TrashMove(CardData[i].setPNo);
        }
        CardData = [];
        BtlDeck = [498];
        DeckCard = [498];
        this.DeckMaisuView();
        AccessFlg = false;
        this.Playerアクセスステート解除(); 
        this.RomaSpineSkinSet(); 
        this.PlayerHirumiEffect(true);
        this.AllBitDelete();
        this.BtlLive2Dパラメーター更新();
        this.NPicFlash(PNo_Ensyutu ,"White" , 30);
    }
    if (LastBossEv1Frame == 120) {
        return false;
    }
    LastBossEv1Frame++;
    return true; 
}
Game_Interpreter.prototype.LastBossEv1_CardDraw = function () {
    this.CardDrawSetting();
    this.CardDrawMove();
    this.BtlAutoChange(false); 
}
Game_Interpreter.prototype.LastBossEv1_CardDraw2 = function () {
    CardData = [];
    BtlDeck = [497];
    DeckCard = [497];
    this.DeckMaisuView();
    _NotSeCardDrawSetting = true;
    this.CardDrawSetting();
    ZeroMoveCardDrawMoveFlg = true;
    this.CardDrawMove();
}
let LastBossEv1Frame2 = 0;
let FinalFormFlg = false;
const LastBossEv1_Update2_StartFlame = 60;
Game_Interpreter.prototype.LastBossEv1_Update2 = function () {
    if (LastBossEv1Frame2 == 0) {
        this.SetSpriteFIn( PN_ECard + 0 , "last_pic1" , 0 , 0 , 0 , 0 , 30);
    }
    let baseFrame = LastBossEv1_Update2_StartFlame;
    if (LastBossEv1Frame2 == baseFrame) {
        this.NPicFlash(PNo_Ensyutu ,"White" , 30);
        this.PlaySe("zb_Feary");
    }
    if (LastBossEv1Frame2 == baseFrame + 60) {
        this.NPicFlash(PNo_Ensyutu ,"White" , 30);
        this.PlaySe("zb_Feary");
    }
    if (LastBossEv1Frame2 == baseFrame + 115) {
        this.PlayPtcPic("LastAccessCard",true,true);
    }
    if (LastBossEv1Frame2 == baseFrame + 150) {
        this.NPicFlash(PNo_Ensyutu ,"White" , 120);
        this.SetSprite(PN_ECard + 1 , "last_pic2" , 0 , 0);
        this.PlaySe("Up3");
        this.PlayPtcPic("CCRea2",true,true);
        this.DelPictSpan(PN_Card , PN_CHikari);
        this.LastBossEv1_CardDraw2(); 
    }
    if (LastBossEv1Frame2 == baseFrame + 150 + 180) {
        this.MoveSprite(PN_ECard + 0 , true , true , 30 , 0);
        this.MoveSprite(PN_ECard + 1 , true , true , 30 , 0);
        return false; 
    }
    LastBossEv1Frame2++;
    return true; 
}
Game_Interpreter.prototype.BtlCngFinalForm = function () {
    this.Btl味方削除(1);
    FinalFormFlg = true;
    this.RomaSpineSkinSet();
    L2dAutoFadeOut(MdlRomashaBattle, 2); 
    this.BtlLive2DStart();
    MdlRomashaBattle = "romasha_battale2"; 
    L2dIdleStart(MdlRomashaBattle,"batalle_bless");
    AddNState(NPlayer[0]._NState, 245, 99); 
    AccessFlg = true;   
    NPlayer[0]._hp = NPlayer[0].mhp;
    CardData = [];
    BtlDeckSetting(); 
    for (let i = 0; i < BtlDeck.length; i++) {
        if (BtlDeck[i] >= 376 && BtlDeck[i] <= 388) {
            BtlDeck.splice(i , 1); i--;
        }
    }
    this.SettingFinalAccessMode(); 
}
Game_Interpreter.prototype.Btl味方削除 = function (MNo) {
    if (NPlayer.length >= MNo) {
        NPlayer.splice(MNo , 1);
        for (let i = 0; i < TurnCard.length; i++) {
            if (NPlayer.length == 1) {
                if (TurnCard[i]._No == -2) {
                    TurnCard.splice(i , 1); i--;
                }
            }
        }
        this.DelPict(PN_CharacterPL + MNo);
        this.DelSprite(PN_hpBaP + MNo);
        this.DelSprite(PN_hpBrP + MNo);
        this.DelSprite(PN_T_hpP + MNo);
        this.DelSprite(PN_IjoP + MNo);
        this.DelSprite(PN_IjoPTn + MNo);
        this.DelSprite(PN_NextIcoPL + MNo);
        this.DelSprite(PN_NextPicPL  + MNo);
        this.BtlTCSetting(); 
        this.TCPicReDraw(); 
    }
}
Game_Interpreter.prototype.LastBossEv1_カードドロー = function () {
    CardData = []; BtlDeck = []; DeckCard = [];
    BtlDeckSetting(); 
    let drawCount = GetTurnStartDrawValue();
    for (let i = 0; i < drawCount; i++) {
        AddCardDrawStac();
    }
}
var LastBossFlame2 = 0;
const AN_Access = 136;
var LastBossPicNo = -1;
Game_Interpreter.prototype.LastBossCng2_Start = function () {
    this.BtlAutoChange(false); 
    LastBoss最初待機 = 30;
    LastBossFlame1 = 0;
    LastBossFlame2 = 0;
    LastBossPicNo = PN_Character + NEnemy[0]._PicNo;
    //this.SpineViewFOut(LastBossPicNo ,5);
    this.EnFadeOut(); 
}
Game_Interpreter.prototype.PLBtlEff_BaseBack = function () {
    this.EnFadeOut(); 
    this.BtlLive2DSet_CardEffectEnd();
    this.BasePLMove(); 
}
var LastBossFlame1 = 0; 
var LastBoss最初待機 = 45;
Game_Interpreter.prototype.LastBossCng2_Update = function () {
    if (LastBoss最初待機-- >= 0) return true; 
    LastBossFlame1++;
    var i間隔1 = 100;
    var emPosX = NEnemy[0]._screenX - 30;
    var emPosY = NEnemy[0]._screenY - 30;
    if (LastBossFlame1 == 1) {
        this.PlayAnime(AN_Access, emPosX, emPosY);
    }
    if (LastBossFlame1 == 40) this.PlayPtcPic("BtlAccessLb", emPosX + 30, emPosY + 40);
    if (LastBossFlame1 == i間隔1 * 1) {
        this.PlayAnime(AN_Access, emPosX, emPosY);
    }
    if (LastBossFlame1 == i間隔1 * 1 + 40) this.PlayPtcPic("BtlAccessLb", emPosX + 30, emPosY + 40);
    if (LastBossFlame1 == i間隔1 * 2 + 30) {
        this.PlayAnime(AN_Access, emPosX, emPosY);
    }
    if (LastBossFlame1 == i間隔1 * 2 + 40) {
        this.PlayPtcPic("BtlACngEffectLb", emPosX - 30, emPosY + 50);
        this.PlayPtcPic("DopingS", emPosX + 20, emPosY + 30);
    }
    var lbEndFlm = i間隔1 * 2 + 100;
    var lbWhiteOutFlame = 15;
    if (LastBossFlame1 == lbEndFlm) {
        this.SetPict(PN_NPicFlash, "White", 0, 0 , 0);
        this.MovePict(PN_NPicFlash, true, true, lbWhiteOutFlame, 255);
    }
    if (LastBossFlame1 < lbEndFlm + lbWhiteOutFlame) return true;
    if (IsSpineLoading()) { 
        return true;
    }
    LastBossFlame2++;
    if (LastBossFlame2 == 1) {
        this.PlayBgs("Quake");
        $gameScreen.startShake(1.5, 20, 180); 
        this.EnemyChange(0,108); 
        this.EnemyResetTurnData(0); 
    }
    if (LastBossFlame2 == 3) {
        this.MovePict(PN_NPicFlash, true, true, 10, 0);
        this.SetSpineColor(LastBossPicNo,0,0,0);
    }
    var lb2OpenFlame = 180;
    if (LastBossFlame2 == lb2OpenFlame) {
        TurnCard = [];
        this.BtlTCSetting(); 
        this.TCPicReDraw(); 
        AudioManager.fadeOutBgs(0.1); //(1)は秒数指定
        this.L2D_Flash("White" , 15);
        this.SetSpineColor(LastBossPicNo,1,1,1);
        $gameSwitches.setValue(BtlStatic.SW_戦闘用SW + 1 , true);
    }
    if (LastBossFlame2 == lb2OpenFlame + 30){
        AutoTurnEndFlg = true;
        return false;
    }
    return true;
}
Game_Interpreter.prototype.LastBossCng3_Start = function () {
    this.BtlAutoChange(false); 
    this.EnemyChange(0,109); 
    TurnCard = [];
    this.EnemyResetTurnData(0); 
    this.BtlTCSetting(); 
    TurnCard.splice(1, 0, TurnCard[0]); 
    this.TCPicReDraw(); 
    NEnemy[0]._hp = Math.floor(NEnemy[0].mhp * 0.6); 
    NEnemy[0]._NState = []; 
    NEnemy[0]._UsePtnNo = 0;
    AutoTurnEndFlg = true;
}
Game_Interpreter.prototype.LastBossCng3_Update = function () {
    return false; 
}
Game_Interpreter.prototype.LastBossCng4_Start = function () {
    this.BtlAutoChange(false); 
    this.EnemyChange(0,110); 
    TurnCard = [];
    this.EnemyResetTurnData(0); 
    this.BtlTCSetting(); 
    TurnCard.splice(1, 0, TurnCard[0]); 
    this.TCPicReDraw(); 
    NEnemy[0]._hp = Math.floor(NEnemy[0].mhp * 0.25); 
    NEnemy[0]._NState = []; 
    NEnemy[0]._TurnCount = 0;
    NEnemy[0]._UsePtnNo = 0;
    AutoTurnEndFlg = true;
}
Game_Interpreter.prototype.LastBossCng4_Update = function () {
    return false; 
}
Game_Interpreter.prototype.EnemyResetTurnData = function (ENo) {
    var enemyData = GetBtlChara_ENo(ENo);
    enemyData._TurnCount = 1;
    this.SetEnemyNextAction(ENo , true); 
}
