
//============================================================================
/**
 *
 *@file		sub_091.s
 *@brief	戦闘シーケンス
 *			ふきとばしシーケンス
 *@author	HisashiSogabe
 *@data		2006.01.26
 *
 */
//============================================================================
	.text

	.include	"waza_seq_def.h"

SUB_091:
	//場にいなくて外れの場合は、うまくきまらんにする
	IF					IF_FLAG_BIT,BUF_PARA_WAZA_STATUS_FLAG,WAZA_STATUS_FLAG_KIE_NOHIT,Umakukimaran
	//特性きゅうばんを持っているときは失敗する
	KATAYABURI_TOKUSEI_CHECK		TOKUSEI_HAVE,SIDE_DEFENCE,TOKUSYU_KYUUBAN,Kyuuban
	//根を張っている時は失敗する
	IF_PSP				IF_FLAG_EQ,SIDE_DEFENCE,ID_PSP_waza_kouka,WAZAKOUKA_NEWOHARU,Newoharu
	//2vs2野生は失敗
	IF					IF_FLAG_EQ,BUF_PARA_FIGHT_TYPE,FIGHT_TYPE_2vs2_YASEI,Umakukimaran
	HUKITOBASI			Umakukimaran
	GOSUB				SUB_SEQ_WAZA_OUT_EFF
	//特性しぜんかいふくをもっていたら、状態異常を直す
	SIZENKAIHUKU_CHECK	SIDE_DEFENCE,SUB_091_NEXT
	PSP_VALUE			VAL_SET,SIDE_DEFENCE,ID_PSP_condition,0
SUB_091_NEXT:
	POKEMON_DELETE		SIDE_DEFENCE
	SERVER_WAIT
	//野生戦なら戦闘終了
	IF					IF_FLAG_NBIT,BUF_PARA_FIGHT_TYPE,FIGHT_TYPE_TRAINER,FightEnd
	HP_GAUGE_OUT		SIDE_DEFENCE
	SERVER_WAIT
	POKEMON_RESHUFFLE	SIDE_HUKITOBASI
	SERVER_WAIT
	POKEMON_APPEAR		SIDE_DEFENCE
	SERVER_WAIT
	HP_GAUGE_IN			SIDE_DEFENCE
	SERVER_WAIT
	MESSAGE				HikizuriMineMsg,TAG_NICK,SIDE_DEFENCE
	SERVER_WAIT
	WAIT				MSG_WAIT
	//ReshuffleClientにDefenceClientを代入
	VALUE_WORK			VAL_SET,BUF_PARA_RESHUFFLE_CLIENT,BUF_PARA_DEFENCE_CLIENT
	GOSUB				SUB_SEQ_MAKIBISI_CHECK
	SEQ_END

FightEnd:
	FADE_OUT
	SERVER_WAIT
	VALUE				VAL_BIT,BUF_PARA_WIN_LOSE_FLAG,FIGHT_ESCAPE
	SEQ_END

Umakukimaran:
	VALUE				VAL_BIT,BUF_PARA_WAZA_STATUS_FLAG,WAZA_STATUS_FLAG_UMAKUKIMARAN
	SEQ_END

Kyuuban:
	MESSAGE_PARAM		KyuubanMineMsg,TAG_NICK_TOKU,SIDE_DEFENCE,SIDE_DEFENCE
	BRANCH				SUB_091_END
Newoharu:
	MESSAGE_PARAM		NewoharareMineMsg,TAG_NICK,SIDE_DEFENCE
SUB_091_END:
	ATTACK_MESSAGE
	SERVER_WAIT
	WAIT				MSG_WAIT
	MESSAGE_WORK
	SERVER_WAIT
	WAIT				MSG_WAIT
	//技の起動に失敗フラグを立てる
	VALUE				VAL_BIT,BUF_PARA_WAZA_STATUS_FLAG,WAZA_STATUS_FLAG_SIPPAI
	SEQ_END
