/*:ja
 * @plugindesc 
 */
let Fz_戻しVNNos = []; 
for (let setVn = 62; setVn <= 82; setVn++) Fz_戻しVNNos.push(setVn);
for (let setVn = 93; setVn <= 96; setVn++) Fz_戻しVNNos.push(setVn);
for (let setVn = 441; setVn <= 498; setVn++) Fz_戻しVNNos.push(setVn);
for (let setVn = 600; setVn <= 640; setVn++) Fz_戻しVNNos.push(setVn);
Fz_戻しVNNos.push(VN_MemorySave); 
let Fz_戻しSWNos = [74]; 
for (let setSw = 807; setSw <= 830; setSw++) Fz_戻しSWNos.push(setSw);
class Fz_CardDt {
    constructor(_CNo, _FlgArr, _Cost, _Setu1, _Setu2, _CardName) {
        this.CNo = _CNo;
        this.FlgArr = _FlgArr;
        this.Cost = _Cost;
        this.Setu1 = _Setu1;
        this.Setu2 = _Setu2;
        this.KeepPicData = null; 
    }
}
let _Fz_CardData = [];
let _Fz_DeckData = [];
class Fz_DeckDt {
    constructor(_Name, _Deck , _Desc) {
        _Desc = typeof _Desc !== 'undefined' ? _Desc : "";
        this.Name = _Name;
        this.Desc = _Desc;
        this.Deck = _Deck;
    }
}
let FzDeck_Initialize = Game_System.prototype.initialize;
Game_System.prototype.initialize = function () { 
    FzDeck_Initialize.call(this);
    _Fz_DeckData = [];
    for (let i = 0; i < $Nupu_GameSetting.fzDeckDatas.length; i++) {
        _Fz_DeckData.push(
            new Fz_DeckDt(
                $Nupu_GameSetting.fzDeckDatas[i].name ,
                $Nupu_GameSetting.fzDeckDatas[i].cardIds.concat() ,
                $Nupu_GameSetting.fzDeckDatas[i].desc
            ));
    }
    _Fz_CardData = [];
    for (let i = 0; i < $Nupu_GameSetting.fzCardDatas.length; i++) {
        _Fz_CardData.push(
            new Fz_CardDt(
                $Nupu_GameSetting.fzCardDatas[i].id,
                $Nupu_GameSetting.fzCardDatas[i].posFlgs.concat(),
                $Nupu_GameSetting.fzCardDatas[i].cost,
                $Nupu_GameSetting.fzCardDatas[i].desc1,
                $Nupu_GameSetting.fzCardDatas[i].desc2
            )
        );
    }
};
let _AddFzDeckArr = [];
for (let i = 0; i <= _Fz_CardData.length - 1; i++) {
    _AddFzDeckArr.push(_Fz_CardData[i].CNo);
}
_Fz_DeckData.push(new Fz_DeckDt("DbgDeck", _AddFzDeckArr));
const Fz_Path = "pictures/UI_Fuzoku/"; 
const Fz_CardPath = "pictures/UI_Fuzoku/Card/"; 
const VN_Fz部屋ランク = 162;
const VN_お客No = 163;
const VN_Fz手札枚数 = 164;
const VN_FzMP回復 = 165;
const VN_Fz残ターン = 166;
const VN_Fz満足度 = 167;
const VN_Fz射精ゲージ = 168;
const VN_Fz部屋ランクボーナス = 196;
const Fz_CScale = 40;     
const Fz_CScaleSel = 57;  
const FuzokuMapId = 162;
const CN_風俗開始演出 = 746;
const CN_風俗コモン = 750;
const CN_風俗終了 = 751;
const CN_風俗ターン終了 = 747;
let PN_FzDeckPs = new Pos2D(15, 675); 
let Fz_handCardBasePostion = new Pos2D(250, 700);
let fuzokuFlg = false; 
let 風俗CardNo = -1; 
let _Fz_Mp = 0; 
let _FzYoku_RPs = new Pos2D(1370, 152);
let _FzYoku_R = -1;    
let _FzYoku_LPs = new Pos2D(13, 152);
let _FzYoku_L = -1;  
let _FzDbgFlg = false;
class FzCardData {
    constructor(CNo) {
        this.CNo = CNo;
        this.Cost;
        this.setPNo;
        this.XPos;
        this.YPos;
        this.selectFlg = false;
        for (let i = 0; i <= _Fz_CardData.length - 1; i++) {
            if (_Fz_CardData[i].CNo == this.CNo) this.Cost = _Fz_CardData[i].Cost;
        }
    }
}
let _FzSaveFunc = Game_System.prototype.initialize;
Game_System.prototype.initialize = function () { 
    _FzSaveFunc.call(this);
    this.Fzお風呂Deck = []; 
    this.FzベットDeck = []; 
    this.FzアフターDeck = []; 
    for (let i = 0; i <= _Fz_CardData.length - 1; i++) {
        if (_Fz_CardData[i].FlgArr[2]) this.FzアフターDeck.push(_Fz_CardData[i].CNo);
    }
};
let _FzRzBef_VN_風俗人気度 = 0;
Game_Interpreter.prototype.Fuzoku_Deck_Start = function () {
    _FzMasterDeck = [];
    $gameSystem.Fzお風呂Deck = []; 
    $gameSystem.FzベットDeck = []; 
    _FzRzBef_VN_風俗人気度 = $gameVariables.value(VN_風俗人気度);
    let _SelDeck = $gameSystem.FzDeckSel;
    if (_FzDbgFlg) {
        _SelDeck = _Fz_DeckData.length - 1;
    }
    let _ckDeck;
    if (_SelDeck == 9 - 1) {
        _ckDeck = $gameSystem.FzFreeDeck; 
        if ($gameSystem.FzFreeDeck.length == 0) {
            _ckDeck = _Fz_DeckData[0].Deck; 
        }
    } else {
        _ckDeck = _Fz_DeckData[_SelDeck].Deck;
    }
    for (let i = 0; i <= _ckDeck.length - 1; i++) {
        let _CkCard = this._Fz_CardData_Get(_ckDeck[i]);
        if (_CkCard.FlgArr[0]) $gameSystem.Fzお風呂Deck.push(_CkCard.CNo);
        if (_CkCard.FlgArr[1]) $gameSystem.FzベットDeck.push(_CkCard.CNo);
    }
    if ($gameSystem.Fzお風呂Deck.length == 0) {
        $gameSystem.Fzお風呂Deck.push(2); 
    }
    if ($gameSystem.FzベットDeck.length == 0) {
        $gameSystem.FzベットDeck.push(2); 
    }
}
Game_Interpreter.prototype._Fz_CardData_Get = function (_CNo) {
    for (let i = 0; i <= _Fz_CardData.length - 1; i++) {
        if ((_Fz_CardData[i].CNo == _CNo)) {
            return _Fz_CardData[i];
        }
    }
}
let _FzHand = []; 
let _FzMasterDeck = []; 
let _FzDeck = []; 
let _BedInPls = false;
Game_Interpreter.prototype.Fuzoku_Open = function () {
    _Fz_flame = 0;
    this.Fuzoku_Deck_Start();
    Fz_アフターFlg = false;
    while (_FzMasterDeck.length < 99) {
        let _CpyArr = $gameSystem.Fzお風呂Deck.slice();
        for (let i = 0; i <= _CpyArr.length - 1; i++) {
            _FzMasterDeck.push(_CpyArr[i]);
        }
    }
    this.Fz_DeckSetting();
    _BedInPls = true;
    _FzHand = []; 
    _Fz_Mp = $gameVariables.value(VN_FzMP回復);
    _Fz_Turn = $gameVariables.value(VN_Fz残ターン);
    this.FzStart_Cng(); 
    this.ALLDelPict([PNo_Ensyutu]);
}
Game_Interpreter.prototype.風俗再開Keep = function () {
    this.InstantSave(); 
    if (!fuzokuFlg) {
        fuzokuFlg = true;
        this._index = this._list.length; 
        this._list = null; 
        $gamePlayer.reserveTransfer(FuzokuMapId, 0, 0, 0, 2); 
    } else {
        fuzokuFlg = false;
        //this.DelPict(PNo_Ensyutu);
        this.BtlKeepLoad(); 
        this.Fz_ちょいす設定ReEnd();
    }
}
let FzMode = {
    Start: 1,
    TnCng: 2,
    Select: 3,
    CmnEv: 4,
    End: 5
};
let _FzMode = FzMode.Start;
let _Fz_flame = 0;
Game_Interpreter.prototype.Fuzoku_Update = function () {
    this.Fz_UIDrawer(); 
    if (btlWaitFlame >= 0) { 
        btlWaitFlame--;
        return;
    }
    switch (_FzMode) {
        case FzMode.Start:
            this.FzStart_Update();
            break;
        case FzMode.TnCng:
            this.FzTnCng_Update();
            break;
        case FzMode.Select:
            if (btl操作不能Flame <= 0) { 
                this.FzSelect_Update();
            }
            break;
        case FzMode.CmnEv:
            this.FzCmnEv_Update();
            break;
        case FzMode.End:
            this.FzEnd_Update();
            break;
    }
    btl操作不能Flame--;
    _Fz_flame++;
}
Game_Interpreter.prototype.Fz_UIDrawer = function () {
    this.FzYoku_RDraw($gameVariables.value(VN_Seikan));
    this.FzYoku_LDraw($gameVariables.value(VN_Fz射精ゲージ));
    this.SetSprite(PN_FzMPTxt, Fz_Path + GetFzMpPic(), 745, 643);
    this.SpriteStrR(PN_MzTxt, " " + $gameVariables.value(VN_Fz満足度) + "", 26, 175, 22);
    if (reloadDeckPicDelFlame == 0) {
        this.DelSprite(PN_DeckReload);
    }
    reloadDeckPicDelFlame--;
}
let _FzStart_flame = 0;
Game_Interpreter.prototype.FzStart_Cng = function () {
    _FzStart_flame = 0;
    _FzMode = FzMode.Start;
}
Game_Interpreter.prototype.FzStart_Update = function () {
    if (_FzStart_flame == 0) {
        this.SetCmnEventSc(CN_風俗開始演出);
        this.Fuzoku_View();
    }
    if (_FzStart_flame == 60) {
        this.FzTnCng_Cng();
    }
    _FzStart_flame++;
}
Game_Interpreter.prototype.Fuzoku_View = function () {
    L2dAutoFadeOut("romasha_talk", 2);
    //this.SetSpriteFIn( PN_FzBackBlack , "Black" , 0 , 0 , 0 , 0 , 10);
    this.SetSprite(PN_FzBase, Fz_Path + "PN_FzBase", 0, 0);
    this.Fz_DeckMaisuView();
    this.SetSprite(PN_FzEdBtn + 0, Fz_Path + "PN_EdBtn", 715, 723);
    this.SetSprite(PN_FzEdBtn + 1, Fz_Path + "PN_FzEdBtn", 705, 615);
    this.Fz_残TurnDraw();
    this.FzYoku_RDraw(-1);
    this.FzYoku_LDraw(-1);
    this.SetSprite(PN_FzMPTxt, Fz_Path + GetFzMpPic(), 745, 643);
    this.Fuzoku_Draw高速化Btn();
    this.MovePict(PNo_Ensyutu, true, true, 60, 0);
}
Game_Interpreter.prototype.Fuzoku_Draw高速化Btn = function (){
    let setPicSSS = "PN_FzSpeedBtn";
    if ($gameSwitches.value(SW_Fz高速化)) setPicSSS = "PN_FzSpeedBtnOff";
    this.SetSprite(PN_FzSpeedBtn, Fz_Path + setPicSSS, 99, 666);
}
let GetFzMpPic = function () {
    return "PN_EdCount" + Math.max(0, Math.min(_Fz_Mp, 10));
}
Game_Interpreter.prototype.Fz_残TurnDraw = function () {
    this.SetSprite(PN_FzTurnBack + 0, Fz_Path + "PN_FzTurnBack_" + $gameVariables.value(VN_Fz部屋ランク), 832, 717);
    let _TurnTxt = "\\ow[4]\\oc[rgb(0,0,0)]" + " " + _Fz_Turn + " ";
    this.SpriteStrC(PN_FzTurnBack + 1, _TurnTxt, 50, 882, 775);
}
Game_Interpreter.prototype.Fz_DeckMaisuView = function () {
    this.SetSprite(PN_FzDeck, BtlPicPath + "PN_Deck4", PN_FzDeckPs._x, PN_FzDeckPs._y);
    if (_FzDeck.length > 1) this.SetSprite(PN_FzDeck, BtlPicPath + "PN_Deck3", PN_FzDeckPs._x, PN_FzDeckPs._y);
    if (_FzDeck.length > 7) this.SetSprite(PN_FzDeck, BtlPicPath + "PN_Deck2", PN_FzDeckPs._x, PN_FzDeckPs._y);
    if (_FzDeck.length > 14) this.SetSprite(PN_FzDeck, BtlPicPath + "PN_Deck1", PN_FzDeckPs._x, PN_FzDeckPs._y);
    let _maisu = _FzDeck.length;
    this.SpriteStrC(PN_FzDeck_Txt, " " + _maisu + " ", 21, PN_FzDeckPs._x + 109, PN_FzDeckPs._y + 105);
}
Game_Interpreter.prototype.FzYoku_RDraw = function (_SetYoku) {
    this.SetSprite(PN_SGWaku_Fz + 0, Fz_Path + "PN_SGWaku", _FzYoku_RPs._x, _FzYoku_RPs._y);
    this.SetSprite(PN_SGbase_Fz + 0, Fz_Path + "PN_SGbase", _FzYoku_RPs._x + 18, _FzYoku_RPs._y + 13);
    if (_SetYoku == -1) {
        _FzYoku_R = $gameVariables.value(VN_Seikan); 
        this.SetSprite(PN_SGgage_Fz + 0, Fz_Path + "PN_SGgage",
            _FzYoku_RPs._x + 18, _FzYoku_RPs._y + 493, 255, 100, -_FzYoku_R);
    } else {
        if (_FzYoku_R != _SetYoku) {
            _FzYoku_R = _SetYoku;
            this.MoveSprite(PN_SGgage_Fz + 0, _FzYoku_RPs._x + 18, _FzYoku_RPs._y + 493,
                10, 255, 100, -_FzYoku_R);
        }
    }
    let _RomaNo = 0;
    if ($gameVariables.value(VN_TL2DKami) == 30) _RomaNo = 1;
    let _OkyakuStr = Fz_Path + "PN_Roma_" + _RomaNo;
    this.SetSprite(PN_FzOpeFace + 0, _OkyakuStr, _FzYoku_RPs._x, _FzYoku_RPs._y - 58);
}
Game_Interpreter.prototype.FzYoku_LDraw = function (_SetYoku) {
    this.SetSprite(PN_SGWaku_Fz + 1, Fz_Path + "PN_SGWaku", _FzYoku_LPs._x, _FzYoku_LPs._y);
    this.SetSprite(PN_SGbase_Fz + 1, Fz_Path + "PN_SGbase", _FzYoku_LPs._x + 18, _FzYoku_LPs._y + 13);
    if (_SetYoku == -1) {
        _FzYoku_L = $gameVariables.value(VN_Fz射精ゲージ);
        this.SetSprite(PN_SGgage_Fz + 1, Fz_Path + "PN_SGgageM",
            _FzYoku_LPs._x + 18, _FzYoku_LPs._y + 493, 255, 100, -_FzYoku_L);
    } else {
        if (_FzYoku_L != _SetYoku) {
            _FzYoku_L = _SetYoku;
            this.MoveSprite(PN_SGgage_Fz + 1, _FzYoku_LPs._x + 18, _FzYoku_LPs._y + 493,
                10, 255, 100, -_FzYoku_L);
        }
    }
    let kyakuImg = "";
    if ($gameSwitches.value(SW_Fuzoku_Oji)) {
        if ($gameSwitches.value(SW_Youbi_Kaze)) kyakuImg = "PN_OpeKyaku_2";
        if ($gameSwitches.value(SW_Youbi_Hi)) kyakuImg = "PN_OpeKyaku_2B";
        if ($gameSwitches.value(SW_Youbi_Mizu)) kyakuImg = "PN_OpeKyaku_2";
        if ($gameSwitches.value(SW_Youbi_Tuti)) kyakuImg = "PN_OpeKyaku_2B";
    }
    if ($gameSwitches.value(SW_Fuzoku_Syota)) {
        if ($gameSwitches.value(SW_Youbi_Kaze)) kyakuImg = "PN_OpeKyaku_0";
        if ($gameSwitches.value(SW_Youbi_Hi)) kyakuImg = "PN_OpeKyaku_0B";
        if ($gameSwitches.value(SW_Youbi_Mizu)) kyakuImg = "PN_OpeKyaku_0";
        if ($gameSwitches.value(SW_Youbi_Tuti)) kyakuImg = "PN_OpeKyaku_0B";
    }
    if ($gameSwitches.value(SW_Fuzoku_Seinen)) {
        if ($gameSwitches.value(SW_Youbi_Kaze)) kyakuImg = "PN_OpeKyaku_1";
        if ($gameSwitches.value(SW_Youbi_Hi)) kyakuImg = "PN_OpeKyaku_1B";
        if ($gameSwitches.value(SW_Youbi_Mizu)) kyakuImg = "PN_OpeKyaku_1C";
        if ($gameSwitches.value(SW_Youbi_Tuti)) kyakuImg = "PN_OpeKyaku_1";
    }
    let _OkyakuStr = Fz_Path + kyakuImg;
    this.SetSprite(PN_FzOpeFace + 1, _OkyakuStr, _FzYoku_LPs._x, _FzYoku_LPs._y - 58);
}
let _FzTnCng_flame = 0;
let _FzDrawCnt = 0;
Game_Interpreter.prototype.FzTnCng_Cng = function () {
    if (Fz_CostCngTurn > 0) { 
        Fz_CostCngTurn--;
        if (Fz_CostCngTurn == 0) Fz_CostCng = 0;
    }
    this.Fz_ちょいす設定TnCng();
    _FzTnCng_flame = _FzDrawCnt = 0;
    _FzMode = FzMode.TnCng;
    if (_Fz_Mp < $gameVariables.value(VN_FzMP回復)) _Fz_Mp = $gameVariables.value(VN_FzMP回復);
    this.Fz_残TurnDraw();
    if (_BedInPls) {
        _BedInPls = false;
        _FzDeck.unshift(0);
    }
}
Game_Interpreter.prototype.FzTnCng_Update = function () {
    let _手札DrawCnt = $gameVariables.value(VN_Fz手札枚数);
    if (Fz_アフターFlg) _手札DrawCnt = 7; 
    if (_FzTnCng_flame == 1 && _FzDrawCnt < _手札DrawCnt) {
        let _Bef_Fz_CostCngTurn = Fz_CostCngTurn
        this.Fz_CardSetting();  
        this.Fz_CardDrawMove(); 
        _FzDrawCnt++;
    }
    if (_FzTnCng_flame == 10 && _FzDrawCnt < _手札DrawCnt) {
        _FzTnCng_flame = -1;
    }
    if (_FzTnCng_flame >= 15) {
        this.FzSelect_Cng();
    }
    _FzTnCng_flame++;
}
Game_Interpreter.prototype.Fz_DeckSetting = function () {
    ShuffleArr(_FzMasterDeck); 
    _FzDeck = _FzMasterDeck.concat();
}
let CheckFzHand緊張 = function () {
    for (let i = 0; i < _FzHand.length; i++) {
        if (_FzHand[i].CNo == 1) return true;
    }
    return false;
}
Game_Interpreter.prototype.Fz_CardSetting = function (_CardNo) {
    _CardNo = typeof _CardNo !== 'undefined' ? _CardNo : -1;
    if (_FzHand.length >= 7) {
        return;
    }
    let _StartXPos = 31;
    let _StartYPos = 643;
    if (_FzDeck.length == 0 && Fz_アフターFlg) return;
    if (_FzDeck.length == 0) { 
        SpriteAnimeLoopFlg = false;
        reloadDeckPicDelFlame = 50;
        this.PlaySpriteAnime(PN_DeckReload, BtlPicPath + "BAnime/DeckReload", 18, 2, 64 - 131, 705 - 90);
        this.Fz_DeckSetting();
    }
    let _CardId = _FzDeck[0];
    if (_CardNo != -1) _CardId = _CardNo;
    _FzDeck.shift(); 
    let _SetCard = new FzCardData(_CardId);
    _SetCard.setPNo = PN_FzCard + _FzHand.length;
    for (let i = 0; i < _FzHand.length; i++) {
        if (_SetCard.CNo == 1) {
            _FzHand[i].Cost += 1;
            if (_FzHand[i].Cost > 9) _FzHand[i].Cost = 9;
            this.Fz_CngCard(i);
        }
    }
    _FzHand.push(_SetCard);
    let befFz_CostCngTurn = Fz_CostCngTurn;
    if (CheckFzHand緊張()) {
        Fz_CostCng += 1;
        Fz_CostCngTurn = 1;
    }
    _seti = _FzHand.length - 1;
    if (Fz_CostCngTurn > 0) {
        _FzHand[_seti].Cost += Fz_CostCng;
        if (_FzHand[_seti].Cost < 0) _FzHand[_seti].Cost = 0;
        if (_FzHand[_seti].Cost > 9) _FzHand[_seti].Cost = 9;
    }
    if (CheckFzHand緊張()) {
        Fz_CostCng -= 1;
        Fz_CostCngTurn = befFz_CostCngTurn;
    }
    let ccOpi = 200;
    _FzHand[_seti].XPos = _StartXPos;
    _FzHand[_seti].YPos = _StartYPos;
    this.Fz_SetCard(_seti, ccOpi, 5);
    _FzHand[_seti].KeepPicData = this.PicObjGet(_FzHand[_seti].setPNo);
    $gameScreen.tintPicture(_FzHand[_seti].setPNo, [-20, -20, -20, 0], 0);
    this.PlaySe("card");
    this.Fz_DeckMaisuView(); 
}
Game_Interpreter.prototype.Fz_SetCard = function (_HandNo, _Opi, _拡大率) {
    let _SetCost = _FzHand[_HandNo].Cost;
    this.SetPictC(_FzHand[_HandNo].setPNo, Fz_CardPath + "Card_" + _FzHand[_HandNo].CNo,
        _FzHand[_HandNo].XPos, _FzHand[_HandNo].YPos, _Opi, _拡大率, _拡大率);
    this.SetPict(PN_Cmp, BtlPicPath + "PN_Cost" + _SetCost + "_H");
    this.CmpPict(_FzHand[_HandNo].setPNo, PN_Cmp);
}
Game_Interpreter.prototype.Fz_CngCard = function (_HandNo) {
    let _Scale = $gameScreen._pictures[_FzHand[_HandNo].setPNo]._scaleX;
    this.SetPictC(_FzHand[_HandNo].setPNo, Fz_CardPath + "Card_" + _FzHand[_HandNo].CNo,
        _FzHand[_HandNo].XPos, _FzHand[_HandNo].YPos, 0, _Scale, _Scale);
    this.SetPict(PN_Cmp, BtlPicPath + "PN_Cost" + _FzHand[_HandNo].Cost + "_H");
    this.CmpPict(_FzHand[_HandNo].setPNo, PN_Cmp);
    _FzHand[_HandNo].KeepPicData = this.PicObjGet(_FzHand[_HandNo].setPNo);
}
Game_Interpreter.prototype.Fz_CardDrawMove = function () {
    let Cardxset = Fz_HandZureX();
    let ccOpi = 200;
    for (let i = 0; i <= _FzHand.length - 1; i++) {
        let _cardKakudo = (_FzHand.length / 2) * -Cardkakudo;
        _FzHand[i].XPos = Fz_handCardBasePostion._x + (Cardxset * i);
        _FzHand[i].YPos = Fz_handCardBasePostion._y + Math.abs(_cardKakudo + (Cardkakudo * i) * 1.4);
        this.MovePict(_FzHand[i].setPNo, _FzHand[i].XPos, _FzHand[i].YPos, 15, ccOpi, Fz_CScale, Fz_CScale);
        $gameScreen.tintPicture(_FzHand[i].setPNo, [-20, -20, -20, 0], 0);
        btlWaitFlame = 3;    
        btl操作不能Flame = 15; 
        this.AnglePict(_FzHand[i].setPNo, _cardKakudo + (Cardkakudo * i));
    }
}
let Fz_HandZureX = function () {
    let _chZureX = 7;
    if (_FzHand.length > 5) _chZureX = 9;
    return 114 - ((_FzHand.length - 1) * _chZureX);
}
let _FzSelect_flame = 0;
let _FzTurnEnd_wait = 0;
let _FzTurnEnd_Cmn = false; 
Game_Interpreter.prototype.FzSelect_Cng = function () {
    _FzSelect_flame = 0;
    _FzMode = FzMode.Select;
    UseCard = null;
}
Game_Interpreter.prototype.FzSelect_Update = function () {
    if (_FzTurnEnd_Cmn) return; 
    if (DbgFlg) { 
        if (FzkDbgMode) {
            this.Btl_FzkDbg_Update();
            return;
        } else {
            if (Input.isTriggered('dbg_BtlEff')) {
                this.Btl_FzkDbg_Start();
                return;
            }
        }
    } 
    this.SpriteCngColor( PN_FzSpeedBtn);
    if (overPointerSpCkTm(PN_FzSpeedBtn)) { 
        this.SpriteCngColor( PN_FzSpeedBtn , [70,70,70,0]);
        if (TouchInput.isTriggered()) {
            $gameSwitches.setValue(SW_Fz高速化 , !$gameSwitches.value(SW_Fz高速化))
            this.Fuzoku_Draw高速化Btn();
        }
    }
    let OverPC = [];
    let MaxCi = [];
    if (_FzTurnEnd_wait > 0) {
        _FzTurnEnd_wait--;
        if (_FzTurnEnd_wait == 0) {
            if (_Fz_Turn < 0) {
                this.FzCmnEv_Cng();
            } else {
                this.FzTnCng_Cng();
            }
        }
        return;
    }
    for (let i = 0; i <= _FzHand.length - 1; i++) {
        if (overPointerCkTm(_FzHand[i].setPNo)) { 
            OverPC.push(_FzHand[i]); 
            MaxCi.push(i);
        }
    }
    let maxPNo = -1;
    let max_i = -1;
    for (let i = 0; i <= OverPC.length - 1; i++) {
        if (maxPNo < OverPC[i].setPNo) {
            maxPNo = OverPC[i].setPNo; 
            UseCard = OverPC[i];
            max_i = MaxCi[i];
        }
    }
    if (PN_FzCard + _FzHand.length - 1 != maxPNo && maxPNo != -1) {
        BefSelectNo = -2; 
    }
    this.SpriteCngColor(PN_FzEdBtn);
    if (overPointerSpCk(PN_FzEdBtn + 0)) {
        this.SpriteCngColor(PN_FzEdBtn, [100, 100, 100]);
        if (TouchInput.isTriggered()) {
            SoundManager.playOk();
            this.FzSelect_TurnEnd();
            this.SpriteCngColor(PN_FzEdBtn);
        }
    }
    if (maxPNo != -1) { 
        if (befSelectCardPicNo != maxPNo) {
            befSelectCardPicNo = maxPNo;
        }
        this.Fz_CardSetu_Draw(UseCard.CNo, UseCard.XPos - 150, UseCard.YPos - 210);
        this.Fz_CardSelect(maxPNo);
        if (TouchInput.isTriggered()) {
            if (Number(UseCard.Cost) > _Fz_Mp) {
                this.SetPicStrPopC(PN_ExText, SCol.Red + "コストが足りません", 20, UseCard.XPos, UseCard.YPos - 100);
                return;
            }
            _Fz_Mp -= Number(UseCard.Cost);
            this.SetSprite(PN_FzMPTxt, Fz_Path + GetFzMpPic(), 745, 643);
            this.DelSpriteSpan(PN_FzSetu, PN_FzSetu + 2);
            _FzHand.splice(max_i, 1);  
            BefSelectNo = -2;
            this.MovePictAdd(UseCard.setPNo, 0, -50, 30, 0);
            for (let i = 0; i <= _FzHand.length - 1; i++) {
                if (_FzHand[i].setPNo == UseCard.setPNo) continue;
                this.MovePictAdd(_FzHand[i].setPNo, 0, 30, 5, 0);
            }
            CharaStopVoice("romasha2");
            風俗CardNo = UseCard.CNo; 
            this.FzCmnEv_Cng(); 
        }
    } else {
        this.DelSpriteSpan(PN_FzSetu, PN_FzSetu + 2);
    }
    _FzSelect_flame++;
}
Game_Interpreter.prototype.FzSelect_TurnEnd = function () {
    for (let i = 0; i <= _FzHand.length - 1; i++) {
        if (_FzHand[i].CNo == 0) continue;
        this.MovePictAdd(_FzHand[i].setPNo, 0, -50, 15, 0);
        _FzHand.splice(i, 1);
        i--;
    }
    _Fz_Turn--;
    _FzTurnEnd_wait = 15;
    this.SetCmnEvent(CN_風俗ターン終了);
}
Game_Interpreter.prototype.Fz_CardSelect = function (SelectCPNo) {
    if (BefSelectNo == SelectCPNo) return; 
    BefSelectNo = SelectCPNo;
    let Cardxset = Fz_HandZureX();
    let selcount = 0; 
    for (let i = 0; i <= _FzHand.length - 1; i++) {
        if (SelectCPNo == _FzHand[i].setPNo) {
            _FzHand[i].selectFlg = true;
        } else {
            _FzHand[i].selectFlg = false;
        }
    }
    for (let i = 0; i <= BtlStatic._手札最大枚数 - 1; i++) {
        this.DelPict(PN_FzCard + i);
        this.PicInObj(PN_FzCard + i, null);
    }
    let _cardKakudo = (_FzHand.length / 2) * -Cardkakudo;
    let inCnt = 0;
    let _SelXZure = 0;
    EasingStr = "easeOutQuad";
    this.DelPictSpan(PN_FzCard, PN_FzCard + 11);
    for (let i = 0; i <= _FzHand.length - 1; i++) {
        _FzHand[i].XPos = Fz_handCardBasePostion._x + (Cardxset * i) + _SelXZure;
        _FzHand[i].YPos = Fz_handCardBasePostion._y + Math.abs(_cardKakudo + (Cardkakudo * i) * 1.4);
        if (_FzHand[i].selectFlg) { 
            if (i != 0) _SelXZure += 30;
            _FzHand[i].XPos += _SelXZure;
            _FzHand[i].YPos = Fz_handCardBasePostion._y - 20;
            _FzHand[i].setPNo = PN_FzCard + _FzHand.length - 1;
            this.PicInObj(_FzHand[i].setPNo, _FzHand[i].KeepPicData);
            this.MovePict(_FzHand[i].setPNo, _FzHand[i].XPos, _FzHand[i].YPos, 5, 255, Fz_CScaleSel, Fz_CScaleSel);
            $gameScreen.tintPicture(_FzHand[i].setPNo, [0, 0, 0, 0], 0);
            selcount = 1;
            _SelXZure += 30;
        } else {
            let ccOpi = 200;
            if (selcount == 0) { 
                _FzHand[i].setPNo = PN_FzCard + inCnt;
                this.PicInObj(_FzHand[i].setPNo, _FzHand[i].KeepPicData);
                this.MovePict(_FzHand[i].setPNo, _FzHand[i].XPos, _FzHand[i].YPos, 5, ccOpi, Fz_CScale, Fz_CScale);
                $gameScreen.tintPicture(_FzHand[i].setPNo, [-20, -20, -20, 0], 0);
                inCnt++;
            } else { 
                _FzHand[i].setPNo = PN_FzCard + _FzHand.length - 1 - (selcount);
                this.PicInObj(_FzHand[i].setPNo, _FzHand[i].KeepPicData);
                this.MovePict(_FzHand[i].setPNo, _FzHand[i].XPos, _FzHand[i].YPos, 5, ccOpi, Fz_CScale, Fz_CScale);
                $gameScreen.tintPicture(_FzHand[i].setPNo, [-20, -20, -20, 0], 0);
                selcount++;
            }
        }
        if (!_FzHand[i].selectFlg) {
            this.AnglePict(_FzHand[i].setPNo, _cardKakudo + (Cardkakudo * i));
        } else {
            this.AnglePict(_FzHand[i].setPNo);
        }
    }
    EasingStr = "";
}
Game_Interpreter.prototype.Fz_CardSetu_Draw = function (_CardId, _PsX, _PsY) {
    this.SetSprite(PN_FzSetu, BtlPicPath + "PN_SetuWaku", _PsX, _PsY);
    let _SetuArr = [];
    for (let i = 0; i <= _Fz_CardData.length - 1; i++) {
        if ((_Fz_CardData[i].CNo == _CardId)) {
            _SetuArr.push(_Fz_CardData[i].Setu1);
            _SetuArr.push(_Fz_CardData[i].Setu2);
        }
    }
    for (let j = 0; j <= _SetuArr.length - 1; j++) {
        this.SpriteStr(PN_FzSetu + 1 + j, _SetuArr[j], 19, _PsX + 8, _PsY + 11 + (27 * j));
    }
}
let _FzCmnEv_flame = 0;
Game_Interpreter.prototype.FzCmnEv_Cng = function () {
    _FzCmnEv_flame = 0;
    _FzMode = FzMode.CmnEv;
    _FzDbgFlg = false;
    if (_Fz_Turn < 0) {
        this.SetCmnEvent(CN_風俗終了);
    } else {
        this.SetCmnEvent(CN_風俗コモン);
    }
}
let Fz_CmnEndFlg = false;
Game_Interpreter.prototype.FzCmnEv_Update = function () {
    if (Fz_CmnEndFlg) {
        if (this.Fz_ちょいす設定Update()) return;
        this.FzSelect_Cng();
        Fz_CmnEndFlg = false;
    }
    _FzCmnEv_flame++;
}
Game_Interpreter.prototype.FzCmn_End = function () {
    if (_Fz_Turn < 0) {
        this.FzEnd_Cng(); 
    } else {
        this.Fz_CardDrawMove();
        Fz_CmnEndFlg = true;
    }
}
let _FzEnd_flame = 0;
Game_Interpreter.prototype.FzEnd_Cng = function () {
    _FzEnd_flame = 0;
    _FzMode = FzMode.End;
    this.SetPictFIn(PNo_Ensyutu, "White", 0, 0, 0, 0, 60);
}
let _Fz変数保存 = [];
class FzVNData {
    constructor(VNNo) {
        this.VNNo = VNNo;
        this.Value = $gameVariables.value(VNNo);
    }
}
let _Fzスイッチ保存 = [];
class FzSNData {
    constructor(SWNo) {
        this.SWNo = SWNo;
        this.Value = $gameSwitches.value(SWNo);
    }
}
const VN_Fz保存変数 = 167;
const VN_Fz保存変数Max = 200;
Game_Interpreter.prototype.FzEnd_Update = function () {
    if (_FzEnd_flame == 60) {
        this.BtlKeepSave(); 
        this.InstantLoad(); 
    }
    if (_FzEnd_flame == 80) {
        fuzokuFlg = false;
    }
    _FzEnd_flame++;
}
let HensuKeepArr = [];
class HensuData {
    constructor(_No, _var) {
        this.No = _No;
        this.Var = _var;
    }
}
Game_Interpreter.prototype.HensuKeep = function (_HensuArr) {
    HensuKeepArr = [];
    _HensuArr.forEach(_HNo => {
        HensuKeepArr.push(new HensuData(_HNo, $gameVariables.value(_HNo)))
    })
}
Game_Interpreter.prototype.HensuBack = function () {
    HensuKeepArr.forEach(_HData => {
        $gameVariables.setValue(_HData.No, _HData.Var);
    })
}
Game_Interpreter.prototype.Fz_ベッドIN = function () {
    _FzMasterDeck = [];
    while (_FzMasterDeck.length < 99) {
        let _CpyArr = $gameSystem.FzベットDeck.slice();
        for (let i = 0; i <= _CpyArr.length - 1; i++) {
            _FzMasterDeck.push(_CpyArr[i]);
        }
    }
    _FzHand = [];
    _FzDeck = [];
    this.Fz_DeckSetting();
    this.FzTnCng_Cng();
}
let Fz_満足度倍率 = 1;
let Fz_満足度ターン = 0;
Game_Interpreter.prototype.Fz_満足度向上 = function (_倍率, _ターン) {
    Fz_満足度倍率 = _倍率;
    Fz_満足度ターン = _ターン;
}
let _Fz_CmnWait = 0;
Game_Interpreter.prototype.Fz_ちょいす設定Update = function () {
    _Fz_CmnWait--
    if (_Fz_CmnWait > 0) return true; 
    if (Fz_カード選択Flg) {
        this.Fz_カード選択Update();
        return true;
    }
    if (Fz_ドローカウント > 0) {
        this.Fz_CardSetting();  
        this.Fz_CardDrawMove(); 
        _Fz_CmnWait = 16;
        Fz_ドローカウント--;
        return true;
    }
    return false; 
}
Game_Interpreter.prototype.Fz_ちょいす設定TnCng = function () {
    if (Fz_GageUpターン > 0) {
        Fz_GageUpターン--;
        if (Fz_GageUpターン <= 0) Fz_GageUp倍率 = 0;
    }
    if (Fz_満足度ターン > 0) {
        Fz_満足度ターン--;
        if (Fz_満足度ターン <= 0) Fz_満足度倍率 = 1;
    }
}
Game_Interpreter.prototype.Fz_満足度上昇 = function (_Var) {
    let _SetVar = $gameVariables.value(VN_Fz満足度);
    _SetVar += Math.floor(_Var * Fz_満足度倍率);
    if (_SetVar > 100) _SetVar = 100;
    $gameVariables.setValue(VN_Fz満足度, _SetVar);
    this.SpriteStrR(PN_MzTxt, " " + $gameVariables.value(VN_Fz満足度), 26, 175, 22);
}
Game_Interpreter.prototype.Fz_ちょいす設定ReEnd = function () {
    for (let i = 0; i <= _Fz変数保存.length - 1; i++) {
        $gameVariables.setValue(_Fz変数保存[i].VNNo, _Fz変数保存[i].Value);
    }
}
let Fz_ドローカウント = 0;
Game_Interpreter.prototype.Fz_カードドロー = function (_DrwCnt) {
    Fz_ドローカウント = _DrwCnt;
}
Game_Interpreter.prototype.Fz_MP回復 = function (_SetVar) {
    _Fz_Mp += _SetVar;
    this.Fz_UIDrawer();
}
let Fz_GageUp倍率 = 1;
let Fz_GageUpターン = 0;
Game_Interpreter.prototype.Fz_射精ゲージ向上 = function (_倍率, _ターン) {
    Fz_GageUp倍率 = _倍率;
    Fz_GageUpターン = _ターン;
}
Game_Interpreter.prototype.Fz_射精ゲージ変化 = function (_変化値) {
    let _SetVar = Math.floor($gameVariables.value(VN_Fz射精ゲージ) + (_変化値 * Fz_GageUp倍率));
    if (_SetVar > 100) _SetVar = 100;
    if (_SetVar < 0) _SetVar = 0;
    $gameVariables.setValue(VN_Fz射精ゲージ, _SetVar)
}
Game_Interpreter.prototype.Fz_ランダムゲット = function (_取得配列) {
    let _GetCardId = ArrGetRandData(_取得配列);
    _FzDeck.unshift(_GetCardId); 
    this.Fz_カードドロー(1);
}
let Fz_カード選択Flg = false;
let Fz_カード選択Arr = [];
let Fz_カードPic = [];
Game_Interpreter.prototype.Fz_カード選択 = function (_取得配列) {
    Fz_カード選択Flg = true;
    Fz_カード選択Arr = _取得配列;
    Fz_カード選択_flame = 0;
    Fz_カードPic = [];
    for (let i = 0; i <= Fz_カード選択Arr.length - 1; i++) {
        Fz_カードPic.push(PN_FzCardSel_C + i);
    }
}
let Fz_カード選択_flame = 0;
Game_Interpreter.prototype.Fz_カード選択Update = function () {
    if (Fz_カード選択_flame == 0) { 
        this.SetPict(PN_FzCardSelBase, "Black", 0, 0, 200);
        let _SetStr = "取得するカードを選択してください";
        this.SetPicStrC(PN_FzCardSelTxt, _SetStr, 35, 720, 117);
        for (let i = 0; i <= Fz_カード選択Arr.length - 1; i++) {
            let _CStr = Fz_CardPath + "Card_" + Fz_カード選択Arr[i];
            this.SetPictC(PN_FzCardSel_C + i, _CStr, 338 + (352 * i), 389);
            let _SetCard = new FzCardData(Fz_カード選択Arr[i]);
            this.SetPict(PN_Cmp, BtlPicPath + "PN_Cost" + _SetCard.Cost + "_H");
            this.CmpPict(PN_FzCardSel_C + i, PN_Cmp);
        }
    }
    let _CNo = overPointerCkArr(Fz_カードPic);
    if (_CNo != -1) {
        let i = _CNo - PN_FzCardSel_C;
        this.SetPictC(PN_FzCardSel_H, BtlPicPath + "PN_CHikariRd", 338 + (352 * i), 389);
        if (TouchInput.isPressed()) {
            Fz_カード選択Flg = false;
            _FzDeck.unshift(Fz_カード選択Arr[i]); 
            this.Fz_カードドロー(1);
            this.DelPictSpan(PN_FzCardSelBase, PN_FzCardSel_C + 6);
        }
    }
    Fz_カード選択_flame++;
}
Game_Interpreter.prototype.Fz_指定カード削除 = function (_CardNo) {
    for (let i = 0; i <= _FzMasterDeck.length - 1; i++) {
        if (_FzMasterDeck[i] == _CardNo) {
            _FzMasterDeck.splice(i, 1);
            i--;
        }
    }
    for (let i = 0; i <= _FzDeck.length - 1; i++) {
        if (_FzDeck[i] == _CardNo) {
            _FzDeck.splice(i, 1);
            i--;
        }
    }
    for (let i = 0; i <= _FzHand.length - 1; i++) {
        if (_FzHand[i].CNo == _CardNo) {
            _FzHand.splice(i, 1);
            i--;
        }
    }
    this.Fz_CardSelect(-1); 
    this.Fz_UIDrawer(); 
}
let Fz_CostCng = 0;
let Fz_CostCngTurn = -1;
Game_Interpreter.prototype.Fz_コスト変動 = function (_数値, _ターン) {
    Fz_CostCng += _数値;
    Fz_CostCngTurn = _ターン;
    let _Bef_Fz_CostCngTurn = Fz_CostCngTurn
    for (let i = 0; i <= _FzHand.length - 1; i++) {
        _FzHand[i].Cost = new FzCardData(_FzHand[i].CNo).Cost + Fz_CostCng;
        if (_FzHand[i].Cost < 0) _FzHand[i].Cost = 0;
        if (_FzHand[i].Cost > 9) _FzHand[i].Cost = 9;
        this.Fz_CngCard(i);
    }
}
Game_Interpreter.prototype.Fz_手札コスト変更 = function (_数値) {
    for (let i = 0; i <= _FzHand.length - 1; i++) {
        _FzHand[i].Cost += _数値;
        if (_FzHand[i].Cost < 0) _FzHand[i].Cost = 0;
        if (_FzHand[i].Cost > 9) _FzHand[i].Cost = 9;
        this.Fz_CngCard(i);
    }
}
Game_Interpreter.prototype.Fz_コストランダム変動 = function (_Low, _High) {
    let _RndC = _High - _Low + 1;
    for (let i = 0; i <= _FzHand.length - 1; i++) {
        let _varRnd = Math.floor(Math.random() * _RndC) + _Low;
        _FzHand[i].Cost = _varRnd;
        if (_FzHand[i].Cost < 0) _FzHand[i].Cost = 0;
        if (_FzHand[i].Cost > 9) _FzHand[i].Cost = 9;
        this.Fz_CngCard(i);
    }
}
let _Fz_引直枚数 = 0;
Game_Interpreter.prototype.Fz_手札引き直し = function () {
    Fz_ドローカウント = _FzHand.length + 1;
    for (let i = 0; i <= _FzHand.length - 1; i++) {
        if (_FzHand[i].CNo == 0) _FzDeck.unshift(0);
    }
    _FzHand = [];
}
let Fz_アフターFlg = false;
Game_Interpreter.prototype.Fz_アフターデッキ移行 = function () {
    _FzMasterDeck = [];
    let _CpyArr = $gameSystem.FzアフターDeck.slice();
    _FzDeck = [];
    for (let i = 0; i <= _CpyArr.length - 1; i++) {
        _FzMasterDeck.push(_CpyArr[i]);
        _FzDeck.push(_CpyArr[i]);
    }
    _FzHand = [];
    Fz_アフターFlg = true;
    _Fz_Turn = 0; 
    this.FzTnCng_Cng();
    this.Fz_残TurnDraw();
    this.CngSprite(PN_FzBase, Fz_Path + "PN_FzBase_after");
}
const FzRzPicPath = Fz_Path + "Result/";
const VN_Fz基本指名料 = 176;
const VN_Fz特別指名料 = 198;
const VN_Fzチップ = 197;
const VN_FzRz部屋ランク = 196;
const VN_Fz人気度上昇値 = 179;
const VN_Fzお給料 = 177;
let fzRzflame = 0;
Game_Interpreter.prototype.Fz_リザルトStart = function () {
    fzRzflame = 0;
    this.MovePict(PNo_Ensyutu , true , true , 15 , 0 , true , true);
    this.SetSpriteFIn(PN_FzRzBack , FzRzPicPath + "PN_FzRzBack" , 0 , 0 , 0 , 0 , 10);
}
const fzRzTim = 30;
const fzRzTxtSize = 27;
const fzRzPosX = 500;
const fzRzZureX = 50;
var fzCountUpValue = 0;
let GetRzltMoney = 0;
Game_Interpreter.prototype.Fz_リザルトUpdate = function () {
    if (fzRzflame == 15) {
        this.SetSpriteFIn(PN_FzRzWin , FzRzPicPath + "PN_FzRzWin" , 0 , 0 , fzRzZureX , 0 , 20);
        this.SetSprite(PN_FzRzBar , FzRzPicPath + "PN_FzRzBar" , 265 - fzRzZureX , 484 , 0 , _FzRzBef_VN_風俗人気度);
        this.MoveSprite(PN_FzRzBar , 265 , true , 20 , 255 , true);
        this.SpriteStrR(PN_FzRzNinkiTxt , _FzRzBef_VN_風俗人気度 , fzRzTxtSize , fzRzPosX - fzRzZureX , 443 , 0);
        this.MoveSprite(PN_FzRzNinkiTxt , fzRzPosX , true , 20 , 255);
        fzCountUpValue = $gameVariables.value(VN_Fz人気度上昇値);
        fzCountUpValue /= fzRzTim;
        $gameVariables.setValue(VN_風俗人気度 , $gameVariables.value(VN_風俗人気度) + $gameVariables.value(VN_Fz人気度上昇値));
    }
    let ckCnt = 1;
    let fzZureY = 66;
    if (fzRzflame == fzRzTim * ckCnt) {
        this.SetSpriteFIn(PN_FzRzTxt + 0 , FzRzPicPath + "PN_FzRzTxt1" , 0 , 0 , fzRzZureX , 0 , 20);
        this.SpriteStrR( PN_FzRzSysTxt + 0 , $gameVariables.value(VN_Fz基本指名料) + "c" , fzRzTxtSize , fzRzPosX + fzRzZureX , 119 , 0);
        this.MoveSprite(PN_FzRzSysTxt + 0 , fzRzPosX , true , 20 , 255);
    }
    ckCnt++;
    if (fzRzflame == fzRzTim * ckCnt) {
        this.SetSpriteFIn(PN_FzRzTxt + 1 , FzRzPicPath + "PN_FzRzTxt2" , 0 , 0 , fzRzZureX , 0 , 20);
        this.SpriteStrR( PN_FzRzSysTxt + 1 , $gameVariables.value(VN_Fz特別指名料) + "c" , fzRzTxtSize , fzRzPosX + fzRzZureX , 119 + fzZureY * (ckCnt - 1) , 0);
        this.MoveSprite(PN_FzRzSysTxt + 1 , fzRzPosX , true , 20 , 255);
    }
    ckCnt++;
    if (fzRzflame == fzRzTim * ckCnt) {
        this.SetSpriteFIn(PN_FzRzTxt + 2 , FzRzPicPath + "PN_FzRzTxt3" , 0 , 0 , fzRzZureX , 0 , 20);
        this.SpriteStrR( PN_FzRzSysTxt + 2 , $gameVariables.value(VN_Fzチップ) + "c" , fzRzTxtSize , fzRzPosX + fzRzZureX , 111 + fzZureY * (ckCnt - 1) , 0);
        this.MoveSprite(PN_FzRzSysTxt + 2 , fzRzPosX , true , 20 , 255);
    }
    ckCnt++;
    if (fzRzflame == fzRzTim * ckCnt) {
        this.SetSpriteFIn(PN_FzRzTxt + 3 , FzRzPicPath + "PN_FzRzTxt4" , 0 , 0 , fzRzZureX , 0 , 20);
        this.SpriteStrR( PN_FzRzSysTxt + 3 , "x" + $gameVariables.value(VN_Fz部屋ランクボーナス) , fzRzTxtSize , fzRzPosX + fzRzZureX , 107 + fzZureY * (ckCnt - 1) , 0);
        this.MoveSprite(PN_FzRzSysTxt + 3 , fzRzPosX , true , 20 , 255);
    }
    ckCnt++;
    if (fzRzflame == fzRzTim * ckCnt) { 
        this.SetSpriteFIn(PN_FzRzTxt + 4 , FzRzPicPath + "PN_FzRzTxt5" , 0 , 0 , fzRzZureX , 0 , 20);
        this.SpriteStrR( PN_FzRzSysTxt + 4 , $gameVariables.value(VN_Fz満足度) , fzRzTxtSize , fzRzPosX + fzRzZureX , 101 + fzZureY * (ckCnt - 1) , 0);
        this.MoveSprite(PN_FzRzSysTxt + 4 , fzRzPosX , true , 20 , 255);
    }
    ckCnt++;
    if (fzRzflame == fzRzTim * ckCnt) { 
        EasingStr = "easeOutQuad";
        if ($gameVariables.value(VN_風俗人気度) > 100) $gameVariables.setValue(VN_風俗人気度 ,100);
        this.MoveSprite(PN_FzRzBar , true , true , 60 , 255 , $gameVariables.value(VN_風俗人気度));
        EasingStr = "";
    }
    if (fzRzflame >= fzRzTim * ckCnt && fzRzflame < fzRzTim * (ckCnt + 1)) {
        _FzRzBef_VN_風俗人気度 += fzCountUpValue;
        this.SpriteStrR(PN_FzRzNinkiTxt , Math.round(_FzRzBef_VN_風俗人気度) , fzRzTxtSize , fzRzPosX , 443);
    }
    ckCnt++;
    if (fzRzflame == fzRzTim * ckCnt) {
        this.SpriteStrR(PN_FzRzNinkiTxt , $gameVariables.value(VN_風俗人気度) , fzRzTxtSize , fzRzPosX , 443);
        let getMoney = Math.round(
            ($gameVariables.value(VN_Fz基本指名料) + $gameVariables.value(VN_Fz特別指名料) + $gameVariables.value(VN_Fzチップ)) * $gameVariables.value(VN_Fz部屋ランクボーナス)
        );
        GetRzltMoney = getMoney;
        $gameVariables.setValue(VN_Fzお給料 ,GetRzltMoney);
        this.SetSpriteFIn(PN_FzRzMnWin , FzRzPicPath + "PN_FzRzMnWin" , 0 , 0 , fzRzZureX , 0 , 20);
        let txtPosX = 1000;
        this.SpriteStr( PN_FzRzMnTxt , GetRzltMoney + "c" , 32 , txtPosX - fzRzZureX , 645 , 0);
        this.MoveSprite(PN_FzRzMnTxt , txtPosX , true , 20 , 255);
    }
    ckCnt++;
    if (fzRzflame == fzRzTim * ckCnt + 30) {
        let stampPicName = "PN_FzRzStmp1";
        if ($gameVariables.value(VN_風俗人気度) >= 30) stampPicName = "PN_FzRzStmp2";
        if ($gameVariables.value(VN_風俗人気度) >= 70) stampPicName = "PN_FzRzStmp3";
        this.SetSpriteC(PN_FzRzStmp , FzRzPicPath + stampPicName , 1209 , 570 , 255 , 0 , 0);
        EasingStr = "easeOutElastic";
        this.MoveSprite(PN_FzRzStmp , true , true , 30 , 255);
        EasingStr = "";
    }
    if (fzRzflame > fzRzTim * ckCnt + 30 + 60 && (TouchInput.isPressed() || Input.isTriggered('ok'))) {
        return false; 
    }
    fzRzflame++;
    return true; 
}
Game_Interpreter.prototype.Fz_リザルトEnd = function () {
    this.DelSpriteSpan(PN_FzRzBack , PN_FzRzStmp);
}
Game_Interpreter.prototype.Set風俗吹き出し = function (setText) {
    var testDt = new PicFukidasiData("PN_FFuki" , 47 , 61 , 24);
    this.SetPicFukidasiR(testDt , PN_FFukidasi , SCol.Blk0 + setText , 1366 , 97);
}
Game_Interpreter.prototype.Set風俗吹き出しL = function (setText) {
    var testDt = new PicFukidasiData("PN_FRFuki" , 47 , 61 , 24);
    this.SetPicFukidasi(testDt , PN_FRFukidasi , SCol.Blk0 + setText , 88 , 97);
}
Game_Interpreter.prototype.Del風俗吹き出し = function () {
    this.DelPicFukidasi(PN_FFukidasi);
}
Game_Interpreter.prototype.Del風俗吹き出しL = function () {
    this.DelPicFukidasi(PN_FRFukidasi);
}
