/// <summary> /// 回城 /// </summary> /// <param name="player"></param> /// <param name="tType">回城方式</param> public bool TownGate(PlayerBusiness player, TransmitType tType) { if (player.Scene != this) { return false; } Destination desc = null; if (tType == TransmitType.UseProp) { //不能使用道具回城 desc = PropDestination; if (desc == null) { return false; } } else if (tType == TransmitType.Dead) { desc = DeadDestination; if (desc != null) { player.SetActionState(ActionState.Standing); } } else if (tType == TransmitType.OverTime) { string sceneid = player.Ectype.Value.GetStringOrDefault("SceneID"); if (!string.IsNullOrEmpty(sceneid)) { int x = player.Ectype.Value.GetIntOrDefault("X"); int y = player.Ectype.Value.GetIntOrDefault("Y"); desc = new Destination(sceneid, x, y); } if (desc != null) { player.SetActionState(ActionState.Standing); } } if (desc == null) { return false; } SceneBusiness inScene; ScenesProxy.TryGetScene(desc.SceneID, out inScene); //场景转移检查,除了死亡和超时.其它情况进行场景检查 if (!(tType == TransmitType.Dead || tType == TransmitType.OverTime)) { if ((!TransferCheck(player, inScene, tType))) { return false; } } object[] point = new object[] { desc.X, desc.Y }; if (ExitScene(player)) { //执行进入 inScene.Execute(new UserNote(player, ClientCommand.IntoSceneSuccess, point)); } if (player.TeamJob == TeamJob.Captain) { PlayerTeam team = player.Team; if (team != null) { for (int i = 1; i < team.Members.Length; i++) { PlayerBusiness member = team.Members[i]; if (member != null && member.TeamJob == TeamJob.Member) { if (ExitScene(member)) { //执行进入 inScene.Execute(new UserNote(member, ClientCommand.IntoSceneSuccess, point)); } } } } } return true; }