
//============================================================================
/**
 *
 *@file		sub_004.s
 *@brief	戦闘シーケンス
 *			勝利シーケンス
 *@author	HisashiSogabe
 *@data		2005.07.29
 *
 */
//============================================================================
	.text

	.include	"waza_seq_def.h"

SUB_004:
	//特性しぜんかいふくをもっていたら、状態異常を直す
	SIZENKAIHUKU_CHECK	SIDE_MINE_1,SUB_004_MINE2
	PSP_VALUE			VAL_SET,SIDE_MINE_1,ID_PSP_condition,0
SUB_004_MINE2:
	SIZENKAIHUKU_CHECK	SIDE_MINE_2,SUB_004_START
	PSP_VALUE			VAL_SET,SIDE_MINE_2,ID_PSP_condition,0
SUB_004_START:

	IF				IF_FLAG_NBIT,BUF_PARA_FIGHT_TYPE,FIGHT_TYPE_TRAINER,KobanCheck

	IF				IF_FLAG_EQ,BUF_PARA_FIGHT_TYPE,FIGHT_TYPE_BATTLE_TOWER_SIO_MULTI,TrainerMessageSioMulti
	IF				IF_FLAG_BIT,BUF_PARA_FIGHT_TYPE,FIGHT_TYPE_SIO,SioWin
	IF				IF_FLAG_BIT,BUF_PARA_FIGHT_TYPE,FIGHT_TYPE_MULTI,TrainerMessageMulti
	IF				IF_FLAG_BIT,BUF_PARA_FIGHT_TYPE,FIGHT_TYPE_TAG,TrainerMessageMulti

TrainerMessage1vs1:
	MESSAGE			TrainerWinMsg,TAG_TRTYPE_TRNAME,SIDE_ENEMY_1,SIDE_ENEMY_1
	SERVER_WAIT
	WAIT			MSG_WAIT/2
	TRAINER_IN		SIDE_ENEMY_1,POS_MSG
	SERVER_WAIT
	IF				IF_FLAG_BIT,BUF_PARA_FIGHT_TYPE,FIGHT_TYPE_2vs2,TrainerMessage2vs2
	TRAINER_MESSAGE	SIDE_ENEMY_1,TRMSG_FIGHT_LOSE
	SERVER_WAIT
	WAIT			MSG_WAIT*2
	BRANCH			SUB_004_NEXT

TrainerMessage2vs2:
	TRAINER_MESSAGE	SIDE_ENEMY_1,TRMSG_FIGHT_LOSE_1
	SERVER_WAIT
	WAIT			MSG_WAIT*2
	IF				IF_FLAG_BIT,BUF_PARA_FIGHT_TYPE,FIGHT_TYPE_TOWER,SUB_004_NEXT
	TRAINER_MESSAGE	SIDE_ENEMY_1,TRMSG_FIGHT_LOSE_2
	SERVER_WAIT
	WAIT			MSG_WAIT*2
	BRANCH			SUB_004_NEXT

TrainerMessageSioMulti:
	BGM_PLAY		SIDE_MINE_1,SEQ_WINTRAIN
TrainerMessageMulti:
	MESSAGE			Trainer2WinMsg,TAG_TRTYPE_TRNAME_TRTYPE_TRNAME,SIDE_ENEMY_1,SIDE_ENEMY_1,SIDE_ENEMY_2,SIDE_ENEMY_2
	SERVER_WAIT
	WAIT			MSG_WAIT/2
	TRAINER_IN		SIDE_ENEMY_1,POS_MSG
	SERVER_WAIT
	TRAINER_MESSAGE	SIDE_ENEMY_1,TRMSG_FIGHT_LOSE
	SERVER_WAIT
	WAIT			MSG_WAIT
	TRAINER_OUT		SIDE_ENEMY_1
	SERVER_WAIT
	TRAINER_IN		SIDE_ENEMY_2,POS_MSG
	SERVER_WAIT
	TRAINER_MESSAGE	SIDE_ENEMY_2,TRMSG_FIGHT_LOSE
	SERVER_WAIT
	WAIT			MSG_WAIT*2

SUB_004_NEXT:
	IF				IF_FLAG_BIT,BUF_PARA_FIGHT_TYPE,FIGHT_TYPE_NO_MONEY,NoMessage
	OKODUKAI_CALC
	MESSAGE			OkodukaiMsg,TAG_TRNAME_NUM,SIDE_MINE,SIDE_WORK
	SERVER_WAIT
	WAIT			MSG_WAIT*2
KobanCheck:
	MONOHIROI
	KOBAN_CHECK
	//こばんカウンタが０ならメッセージなし
	IF				IF_FLAG_EQ,BUF_PARA_MSG_WORK,0,NoMessage
	MESSAGE			MoneyPickUpMsg,TAG_TRNAME_NUM,SIDE_MINE,SIDE_WORK
	SERVER_WAIT
	WAIT			MSG_WAIT*2
NoMessage:
	FADE_OUT
	SERVER_WAIT
	SEQ_END

SioWin:
	GOSUB			SUB_SEQ_SIO_WIN_LOSE
	SEQ_END

