<commit_before>#include "MoQiang.h"
#include "..\GameGrail.h"
#include "..\UserTask.h"


bool MoQiang::cmdMsgParse(UserTask *session, uint16_t type, ::google::protobuf::Message *proto)
{
	switch(type)
	{
	case MSG_RESPOND:
		Respond* respond = (Respond*)proto;
		switch(respond->respond_id())
		{
		case AN_ZHI_JIE_FANG://֮
			//tryNotifyϷ̴߳ϢֻidڵǰȴidstateڵǰstatestepڵǰstepϷ̲߳Ż
			session->tryNotify(id,STATE_BOOT,AN_ZHI_JIE_FANG, respond);
			return true;

        case HUAN_YING_XING_CHEN://Ӱǳ
			//tryNotifyϷ̴߳ϢֻidڵǰȴidstateڵǰstatestepڵǰstepϷ̲߳Ż
			session->tryNotify(id,STATE_BOOT,HUAN_YING_XING_CHEN, respond);
			return true;

		case  AN_ZHI_ZHANG_BI://֮ϱ
			//tryNotifyϷ̴߳ϢֻidڵǰȴidstateڵǰstatestepڵǰstepϷ̲߳Ż
			session->tryNotify(id,STATE_TIMELINE_3,AN_ZHI_ZHANG_BI, respond);
			return true;

		case QI_HEI_ZHI_QIANG://֮ǹ
			//tryNotifyϷ̴߳ϢֻidڵǰȴidstateڵǰstatestepڵǰstepϷ̲߳Ż
			session->tryNotify(id,STATE_TIMELINE_2_HIT,QI_HEI_ZHI_QIANG, respond);  //ʲô״̬
			return true;
		}
	}
	//ûƥ򷵻false
	return false;
}

//ͳһp_before_turn_begin ʼֻغϱ
int  MoQiang::p_before_turn_begin(int &step, int currentPlayerID) 
{
	cardCount = 0;
	using_AnZhiJieFang=false;
	using_HuanYingXingCeng=false;
	availabel_QiHeiZhiQiang=true;
	availabel_ChongYing=true;
	used_ChongYing=false;
	hurtID=-1;
	HuanYingXingChenEffectFlag = false;//tureͲը
	used_AnZhiJieFang = false;
	return GE_SUCCESS; 
}

int MoQiang::p_boot(int &step, int currentPlayerID)
{
	int ret = GE_INVALID_STEP;
	if( id != currentPlayerID){
		return GE_SUCCESS;
	}

	if(STEP_INIT == step)
	{
		if(!tap)
			step = AN_ZHI_JIE_FANG;     
		else
			step = HUAN_YING_XING_CHEN;
	}
	if(AN_ZHI_JIE_FANG == step || HUAN_YING_XING_CHEN == step)
	{
		ret = AnZhiHuanYing();
		if(toNextStep(ret) || ret == GE_URGENT){
			if(using_HuanYingXingCeng)
			{
				step = HUAN_YING_XING_CHEN_EFFECT;
				return ret;
			}
			else
			{
				step = STEP_DONE;
			}
		}
	}
	if(HUAN_YING_XING_CHEN_EFFECT == step)
	{
		ret = HuanYingXingChen_Effect();

		if(toNextStep(ret) || ret == GE_URGENT){
			step = STEP_DONE;
		}

	}

	return ret;
}

int MoQiang::p_timeline_2_miss(int &step, CONTEXT_TIMELINE_2_MISS *con)
{
	used_AnZhiJieFang = true;
	return GE_SUCCESS;
}

int MoQiang::p_timeline_2_hit(int &step, CONTEXT_TIMELINE_2_HIT * con)
{

	int ret = GE_INVALID_STEP;
	if(con->attack.srcID != id){
		return GE_SUCCESS;
	}

	if(STEP_INIT == step){
		step = AN_ZHI_JIE_FANG;
	}
	if(AN_ZHI_JIE_FANG == step)
	{		//AN_ZHI_JIE_FANG:
		ret =AnZhiJieFang_Effect(con);
		if(toNextStep(ret) || ret == GE_URGENT){<commit_msg>修复魔枪充盈第二刀bug<commit_after>#include "MoQiang.h"
#include "..\GameGrail.h"
#include "..\UserTask.h"


bool MoQiang::cmdMsgParse(UserTask *session, uint16_t type, ::google::protobuf::Message *proto)
{
	switch(type)
	{
	case MSG_RESPOND:
		Respond* respond = (Respond*)proto;
		switch(respond->respond_id())
		{
		case AN_ZHI_JIE_FANG://֮
			//tryNotifyϷ̴߳ϢֻidڵǰȴidstateڵǰstatestepڵǰstepϷ̲߳Ż
			session->tryNotify(id,STATE_BOOT,AN_ZHI_JIE_FANG, respond);
			return true;

        case HUAN_YING_XING_CHEN://Ӱǳ
			//tryNotifyϷ̴߳ϢֻidڵǰȴidstateڵǰstatestepڵǰstepϷ̲߳Ż
			session->tryNotify(id,STATE_BOOT,HUAN_YING_XING_CHEN, respond);
			return true;

		case  AN_ZHI_ZHANG_BI://֮ϱ
			//tryNotifyϷ̴߳ϢֻidڵǰȴidstateڵǰstatestepڵǰstepϷ̲߳Ż
			session->tryNotify(id,STATE_TIMELINE_3,AN_ZHI_ZHANG_BI, respond);
			return true;

		case QI_HEI_ZHI_QIANG://֮ǹ
			//tryNotifyϷ̴߳ϢֻidڵǰȴidstateڵǰstatestepڵǰstepϷ̲߳Ż
			session->tryNotify(id,STATE_TIMELINE_2_HIT,QI_HEI_ZHI_QIANG, respond);  //ʲô״̬
			return true;
		}
	}
	//ûƥ򷵻false
	return false;
}

//ͳһp_before_turn_begin ʼֻغϱ
int  MoQiang::p_before_turn_begin(int &step, int currentPlayerID) 
{
	cardCount = 0;
	using_AnZhiJieFang=false;
	using_HuanYingXingCeng=false;
	availabel_QiHeiZhiQiang=true;
	availabel_ChongYing=true;
	used_ChongYing=false;
	hurtID=-1;
	HuanYingXingChenEffectFlag = false;//tureͲը
	used_AnZhiJieFang = false;
	return GE_SUCCESS; 
}

int MoQiang::p_boot(int &step, int currentPlayerID)
{
	int ret = GE_INVALID_STEP;
	if( id != currentPlayerID){
		return GE_SUCCESS;
	}

	if(STEP_INIT == step)
	{
		if(!tap)
			step = AN_ZHI_JIE_FANG;     
		else
			step = HUAN_YING_XING_CHEN;
	}
	if(AN_ZHI_JIE_FANG == step || HUAN_YING_XING_CHEN == step)
	{
		ret = AnZhiHuanYing();
		if(toNextStep(ret) || ret == GE_URGENT){
			if(using_HuanYingXingCeng)
			{
				step = HUAN_YING_XING_CHEN_EFFECT;
				return ret;
			}
			else
			{
				step = STEP_DONE;
			}
		}
	}
	if(HUAN_YING_XING_CHEN_EFFECT == step)
	{
		ret = HuanYingXingChen_Effect();

		if(toNextStep(ret) || ret == GE_URGENT){
			step = STEP_DONE;
		}

	}

	return ret;
}

int MoQiang::p_timeline_2_miss(int &step, CONTEXT_TIMELINE_2_MISS *con)
{
	if(con->srcID!=id||!con->isActive)
    {
        return GE_SUCCESS;
     }

        if(used_ChongYing)
        cardCount=0;  

	used_AnZhiJieFang = true;
	return GE_SUCCESS;
}

int MoQiang::p_timeline_2_hit(int &step, CONTEXT_TIMELINE_2_HIT * con)
{

	int ret = GE_INVALID_STEP;
	if(con->attack.srcID != id){
		return GE_SUCCESS;
	}

	if(STEP_INIT == step){
		step = AN_ZHI_JIE_FANG;
	}
	if(AN_ZHI_JIE_FANG == step)
	{		//AN_ZHI_JIE_FANG:
		ret =AnZhiJieFang_Effect(con);
		if(toNextStep(ret) || ret == GE_URGENT){
{'fraction_non_alphanumeric': 0.12833813640730068, 'fraction_numerical': 0.004034582132564841, 'mean_word_length': 4.561965811965812, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4645178', 'n_tokens_mistral': 2814, 'n_tokens_neox': 2586, 'n_words': 314}