public override bool Run()
{
//意外断开处理
if (GetGameSession() == null)
{
//广播出去,清除该玩家
if (GetVisibleList().Count > 0)
{
NetMsg.MsgClearObjectInfo clear = new NetMsg.MsgClearObjectInfo();
clear.id = this.GetTypeId();
GetGameMap().BroadcastBuffer(this, clear.GetBuffer());
}
return false;
}
base.Run();
//连招解锁
if (this.IsLock())
{
if (!this.CheckLockTime())
{
this.UnLock();
}
}
this.GetTimerSystem().Run();
//战斗系统
this.GetFightSystem().Run();
this.GetPKSystem().Run();
//角色死亡变为鬼魂状态,
if (this.IsDie() && m_bGhost && mnGhostTick != -1)
{
if (System.Environment.TickCount - mnGhostTick >= 3000)
{
this.ChangeAttribute(UserAttribute.STATUS, 6);
this.ChangeAttribute(UserAttribute.LOOKFACE, GetLookFace(), true);
mnGhostTick = -1;
}
}
//死亡--因为会被连击锁定-- 所以放到run方法
if (IsDie() && !this.IsLock() && mTarget != null && m_bGhost == false)
{
GameStruct.Action action;
//死亡
action = new GameStruct.Action(GameStruct.Action.DIE, null);
action.AddObject(mTarget);
this.PushAction(action);
}
//定时保存玩家数据
if (mSaveTime.ToNextTime())
{
UserEngine.Instance().AddSaveRole(this);
}
//传送状态
if (mbTransmit && mTransmitTimeOut.ToNextTime())
{
//幻兽出征
this.GetEudemonSystem().Eudemon_BattleAll();
//发送天气信息
this.GetGameMap().SendWeatherInfo(this);
this.SetTransmitIng(false);
}
return true;
}