}else if($gameVariables.value(31)==3){
const ar_kakaku1 = [1000,3000,5000,10000,20000, 30000, 40000, 60000, 80000, 100000];
const ar_kakaku_hp=[500, 1000,1500,2000, 2500, 3000, 3500, 4000, 4500, 5000, 6000, 7000, 8000, 9000, 10000,11000,12000,13000,14000,15000,16000,17000,18000,19000,20000,22000,24000,26000,28000,30000,32000,34000,36000,38000,40000,42000,44000,46000,48000,50000,60000,65000,70000,75000,80000,85000,90000,95000,100000,105000];
const ar_kakaku_mp=[1000,2000,3000,4000, 5000, 6000, 7000, 8000, 9000, 10000, 13000,16000,20000,25000,30000,35000,40000,50000,60000,70000,80000,100000];
let _ATK = $gameVariables.value(41)
let _MAT = $gameVariables.value(42)
let _INT = $gameVariables.value(43)
let _HP = $gameVariables.value(44)
let _MP = $gameVariables.value(45)
//初期能力UP GG EDIT
if($gameVariables.value(32)==0){
AudioManager.playSe({"name":"Decision2","volume":90,"pitch":100,"pan":0});
if(la==1){
ms = "\x1b>The initial stats will be increased";
}else if(la==2){
ms = "\x1b>增加初期能力喔\n";
}else if(la==3){
ms = "\x1b>增加初期能力喔\n";
}else{
ms = "\x1b>初期能力を上げるよ\n";
}
if(_ATK>=0 && _ATK<=9){choices[0] = "ATK"+zeroPadding(_ATK+" → "+(_ATK+1),8)+" \x1bC[17]"+zeroPadding("-"+separate(ar_kakaku1[_ATK]),11)+"GOLD";}
if(_ATK>9){choices[0] = "ATK 10(MAX)";}
if(_MAT>=0 && _MAT<=9){choices[1] = "MAT"+zeroPadding(_MAT+" → "+(_MAT+1),8)+" \x1bC[17]"+zeroPadding("-"+separate(ar_kakaku1[_MAT]),11)+"GOLD";}
if(_MAT>9){choices[1] = "MAT 10(MAX)";}
if(_INT>=0 && _INT<=9){choices[2] = "INT"+zeroPadding(_INT+" → "+(_INT+1),8)+" \x1bC[17]"+zeroPadding("-"+separate(ar_kakaku1[_INT]),11)+"GOLD";}
if(_INT>9){choices[2] = "INT 10(MAX)";}
if(_HP>=0 && _HP<=49){choices[3] = "HP "+zeroPadding((_HP+10)+" → "+(_HP+11),8)+" \x1bC[17]"+zeroPadding("-"+separate(ar_kakaku_hp[_HP]),11)+"GOLD";}
if(_HP>49){choices[3] = "HP 60(MAX)";}
if(_MP>=0 && _MP<=21){choices[4] = "MP "+zeroPadding((_MP+3)+" → "+(_MP+4),8)+" \x1bC[17]"+zeroPadding("-"+separate(ar_kakaku_mp[_MP]),11)+"GOLD";}
if(_MP>21){choices[4] = "MP 25(MAX)";}
choices[5] = ar_cancel[la];
$gameMessage.add(ms);
$gameMessage.setChoiceBackground(0);
$gameMessage.setChoices(choices, $gameVariables.value(33),choices.length-1);
$gameMessage.setChoiceCallback(n=>{this._branch[this._indent]=n;});
this.setWaitMode("message");
$gameVariables.setValue(32,1);
}else if($gameVariables.value(32)==1){
$gameVariables.setValue(33,vl);
const val_id=41;
let kakaku = 0;
if(vl==0){kakaku = ar_kakaku1[_ATK];}
if(vl==1){kakaku = ar_kakaku1[_MAT];}
if(vl==2){kakaku = ar_kakaku1[_INT];}
if(vl==3){kakaku = ar_kakaku_hp[_HP];}
if(vl==4){kakaku = ar_kakaku_mp[_MP];}
if(vl<3){
if($gameVariables.value(val_id+vl)==5){
ms = ar_limit[la];
$gameMessage.add(ms);
this.setWaitMode("message");
}else if($gameVariables.value(7) < kakaku){
ms = ar_e_GOLD[la];
$gameMessage.add(ms);
this.setWaitMode("message");
}else{
AudioManager.playSe({"name":"Shop2","volume":90,"pitch":100,"pan":0});
$gameVariables.setValue(7,$gameVariables.value(7)-kakaku);
$gameVariables.setValue((val_id+vl),$gameVariables.value(val_id+vl)+1);
}
$gameVariables.setValue(32,0);
}else if(vl==3){
if($gameVariables.value(val_id+vl)==10){
ms = ar_limit[la];
$gameMessage.add(ms);
this.setWaitMode("message");
}else if($gameVariables.value(7) < kakaku){
ms = ar_e_GOLD[la];
$gameMessage.add(ms);
this.setWaitMode("message");
}else{
AudioManager.playSe({"name":"Shop2","volume":90,"pitch":100,"pan":0});
$gameVariables.setValue(7,$gameVariables.value(7)-kakaku);
$gameVariables.setValue((val_id+vl),$gameVariables.value(val_id+vl)+1);
}
$gameVariables.setValue(32,0);
}else if(vl==4){
if($gameVariables.value(val_id+vl)==17){
ms = ar_limit[la];
$gameMessage.add(ms);
this.setWaitMode("message");
}else if($gameVariables.value(7) < kakaku){
ms = ar_e_GOLD[la];
$gameMessage.add(ms);
this.setWaitMode("message");
}else{
AudioManager.playSe({"name":"Shop2","volume":90,"pitch":100,"pan":0});
$gameVariables.setValue(7,$gameVariables.value(7)-kakaku);
$gameVariables.setValue((val_id+vl),$gameVariables.value(val_id+vl)+1);
}
$gameVariables.setValue(32,0);
}else{
AudioManager.playSe({"name":"Cancel1","volume":90,"pitch":100,"pan":0});
this._index = this._list.length; //ターンエンド
$gameTemp.reserveCommonEvent(10); //表示の初期化
}
}