*char_voice_sys_top
[iscript]\
//各キャラのボイスの番号取得
function CharVoiceNumGet(vo_name)
{
	var ret;
	var i;
	var j;
	var getflg;
	var ch_len;

	ret = 0;
	getflg = 0;

	for(i = 0;i < sf.ch_voice_name.count;i++){
		for(j = 0;j < sf.ch_voice_name[i].count;j++){
			ch_len = sf.ch_voice_name[i][j].length;
			if(vo_name.substring(0,ch_len) == sf.ch_voice_name[i][j]){
				getflg = 1;
				break;
			}
		}
		if(getflg == 1){
			break;
		}
	}

	ret = i;
	return ret;
}

//各キャラのボイスのフラグチェック
function CharVoiceFlgCheck(vo_name)
{
	var ret;
	ret = 0;
	ret = sf.ch_voice_flg[CharVoiceNumGet(vo_name)];
	return ret;
}

//各キャラのボイスのボリュームチェック
function CharVoiceVolCheck(vo_name)
{
	var ret;
	ret = 0;
	ret = sf.ch_voice_vol[CharVoiceNumGet(vo_name)];
	return ret;
}

//各キャラのボイスのフラグチェック（履歴再生用）
function CharHisVoFlgCheck(vo_name)
{
	var ret;
	if(kag.se[0].status == 'stop' && CharVoiceFlgCheck(vo_name) == 1){
		ret = 1;
	}
	else{
		ret = 0;
	}

	if(CharVoiceFlgCheck(vo_name)==1){
		if(CharVoiceVolCheck(vo_name)==1){
			kag.se[0].setOptions(%[gvolume:20]);
		}
		if(CharVoiceVolCheck(vo_name)==2){
			kag.se[0].setOptions(%[gvolume:30]);
		}
		if(CharVoiceVolCheck(vo_name)==3){
			kag.se[0].setOptions(%[gvolume:40]);
		}
		if(CharVoiceVolCheck(vo_name)==4){
			kag.se[0].setOptions(%[gvolume:50]);
		}
		if(CharVoiceVolCheck(vo_name)==5){
			kag.se[0].setOptions(%[gvolume:60]);
		}
		if(CharVoiceVolCheck(vo_name)==6){
			kag.se[0].setOptions(%[gvolume:70]);
		}
		if(CharVoiceVolCheck(vo_name)==7){
			kag.se[0].setOptions(%[gvolume:80]);
		}
		if(CharVoiceVolCheck(vo_name)==8){
			kag.se[0].setOptions(%[gvolume:90]);
		}
		if(CharVoiceVolCheck(vo_name)==9){
			kag.se[0].setOptions(%[gvolume:100]);
		}
		if(CharVoiceVolCheck(vo_name)==10){
			kag.se[0].setOptions(%[gvolume:100]);
		}				
	}
	else{
		kag.se[0].setOptions(%[gvolume:0]);
	}

	
	return ret;
}

[endscript]\
[return]\