
//============================================================================
/**
 *
 *@file		sub_005.s
 *@brief	戦闘シーケンス
 *			負けシーケンス
 *@author	HisashiSogabe
 *@data		2005.07.29
 *
 */
//============================================================================
	.text

	.include	"waza_seq_def.h"

SUB_005:
	IF				IF_FLAG_BIT,BUF_PARA_FIGHT_TYPE,FIGHT_TYPE_TOWER,TowerLose
	IF				IF_FLAG_BIT,BUF_PARA_FIGHT_TYPE,FIGHT_TYPE_SIO,SioLose

	MESSAGE			LoseMsg1,TAG_TRNAME,SIDE_MINE
	SERVER_WAIT
	WAIT			MSG_WAIT

	IF				IF_FLAG_BIT,BUF_PARA_FIGHT_TYPE,FIGHT_TYPE_NO_MONEY,SUB_005_RET

	OKODUKAI_CALC

	//罰金額が０の時はメッセージ表示しない
	IF				IF_FLAG_EQ,BUF_PARA_MSG_WORK,0,SUB_005_RET

	//トレーナー戦の時は専用メッセージへ
	IF				IF_FLAG_BIT,BUF_PARA_FIGHT_TYPE,FIGHT_TYPE_TRAINER,TrainerLose

	MESSAGE			LostMsg,TAG_TRNAME_NUM,SIDE_MINE,SIDE_WORK
	SERVER_WAIT
	WAIT			MSG_WAIT
	BRANCH			SUB_005_RET

TrainerLose:
	MESSAGE			PenaltyMsg,TAG_TRNAME_NUM,SIDE_MINE,SIDE_WORK
	SERVER_WAIT
	WAIT			MSG_WAIT

SUB_005_RET:
	MESSAGE			LoseMsg3,TAG_NONE
	SERVER_WAIT
	WAIT			MSG_WAIT

	MESSAGE			LoseMsg2,TAG_NONE
	SERVER_WAIT
	WAIT			MSG_WAIT
SUB_005_END:
	FADE_OUT
	SERVER_WAIT
	SEQ_END

SioLose:
	GOSUB			SUB_SEQ_SIO_WIN_LOSE
	SEQ_END

TowerLose:
	IF_PSP			IF_FLAG_EQ,SIDE_ENEMY_1,ID_PSP_hp,0,Enemy2
	POKEMON_RETURN	SIDE_ENEMY_1
Enemy2:
	//2vs2戦じゃなければ、以降を無視
	IF				IF_FLAG_NBIT,BUF_PARA_FIGHT_TYPE,FIGHT_TYPE_2vs2,PokemonReturnWait
	IF_PSP			IF_FLAG_EQ,SIDE_ENEMY_2,ID_PSP_hp,0,PokemonReturnWait
	POKEMON_RETURN	SIDE_ENEMY_2
PokemonReturnWait:
	SERVER_WAIT
	HP_GAUGE_OUT	SIDE_ENEMY
	SERVER_WAIT
	TRAINER_IN		SIDE_ENEMY_1,POS_MSG
	SERVER_WAIT
	TRAINER_MESSAGE	SIDE_ENEMY_1,TRMSG_FIGHT_WIN
	SERVER_WAIT
	WAIT			MSG_WAIT
	IF				IF_FLAG_NBIT,BUF_PARA_FIGHT_TYPE,FIGHT_TYPE_MULTI,TowerLoseNext
	TRAINER_OUT		SIDE_ENEMY_1
	SERVER_WAIT
	TRAINER_IN		SIDE_ENEMY_2,POS_MSG
	SERVER_WAIT
	TRAINER_MESSAGE	SIDE_ENEMY_2,TRMSG_FIGHT_WIN
	SERVER_WAIT
	WAIT			MSG_WAIT*2
	BRANCH			TowerLoseNext2
TowerLoseNext:
	WAIT			MSG_WAIT
TowerLoseNext2:
	WIN_LOSE_SET
	FADE_OUT
	SERVER_WAIT
	SEQ_END

