
//============================================================================
/**
 *
 *@file		sub_121.s
 *@brief	戦闘シーケンス
 *			みらいよち発動シーケンス
 *@author	HisashiSogabe
 *@data		2006.02.02
 *
 */
//============================================================================
	.text

	.include	"waza_seq_def.h"

SUB_121:
	MESSAGE_WORK
	SERVER_WAIT
	WAIT			MSG_WAIT
	HITCHECK		SIDE_ATTACK_WORK,SIDE_WORK,SIDE_WORK,Umakukimaran
	VALUE			VAL_SET,BUF_PARA_WAZA_EFF_CNT,1
	WAZA_EFFECT2	SIDE_WORK,SIDE_ATTACK_WORK,SIDE_WORK
	SERVER_WAIT
	//同一ターンで技エフェクトが出ていると重ねて出せないので、フラグを落としておく
	VALUE			VAL_NBIT,BUF_PARA_SERVER_STATUS_FLAG,SERVER_STATUS_FLAG_NO_WAZA_EFFECT
	//みがわりチェック
	IF_PSP			IF_FLAG_NBIT,SIDE_WORK,ID_PSP_condition2,CONDITION2_MIGAWARI,WazaHit
	VALUE			VAL_MUL,BUF_PARA_HP_CALC_WORK,-1
	IF_PSP_WORK		IF_FLAG_NC,SIDE_WORK,ID_PSP_wkw_migawari_hp,BUF_PARA_HP_CALC_WORK,MigawariDel
MigawariHit:
	PSP_VALUE_WORK	VAL_SUB,SIDE_WORK,ID_PSP_wkw_migawari_hp,BUF_PARA_HP_CALC_WORK
	BRANCH			Migawari
MigawariDel:
	PSP_VALUE		VAL_SET,SIDE_WORK,ID_PSP_wkw_migawari_hp,0
	PSP_VALUE		VAL_NBIT,SIDE_WORK,ID_PSP_condition2,CONDITION2_MIGAWARI
Migawari:
	GOSUB			SUB_SEQ_MIGAWARI_HIT
	BRANCH			SUB_121_END
WazaHit:
	HP1_CHECK		SIDE_WORK
	GOSUB			SUB_SEQ_HP_CALC
	//いかりチェック
	IF_PSP			IF_FLAG_NBIT,SIDE_WORK,ID_PSP_condition2,CONDITION2_IKARI,SUB_121_END
	IF_PSP			IF_FLAG_EQ,SIDE_WORK,ID_PSP_hp,0,SUB_121_END
	IF_PSP			IF_FLAG_EQ,SIDE_WORK,ID_PSP_abiritycnt_pow,12,SUB_121_END
	PSP_VALUE		VAL_ADD,SIDE_WORK,ID_PSP_abiritycnt_pow,1
	MESSAGE			IkariMineMsg,TAG_NICK,SIDE_WORK
	SERVER_WAIT
	WAIT			MSG_WAIT
SUB_121_END:
	IF				IF_FLAG_NBIT,BUF_PARA_WAZA_STATUS_FLAG,WAZA_STATUS_FLAG_ITEM_KORAETA,SUB_121_RET
	STATUS_EFFECT	SIDE_WORK,STATUS_ITEM_POKE
	SERVER_WAIT
	MESSAGE			ItemKoraetaMineMsg,TAG_NICK_ITEM,SIDE_WORK,SIDE_CLIENT_WORK
	SERVER_WAIT
	WAIT			MSG_WAIT
	//装備効果HPMAXでこらえる時は、アイテムを消す
	SOUBI_CHECK		SOUBI_NO_HAVE,SIDE_WORK,SOUBI_HPMAXDEITIGEKISISINAI,SUB_121_RET
	KILL_ITEM		SIDE_DEFENCE
SUB_121_RET:
	SEQ_END

Umakukimaran:
	WAIT			MSG_WAIT
	MESSAGE			UmakukimaranMsg,TAG_NONE
	SERVER_WAIT
	WAIT			MSG_WAIT
	SEQ_END

