protected void OnClickEntourage(EntourageBase _entourage) { // if (_entourage == null || target == null) return; // if (_entourage.isDead) return; // target.CurTarget = _entourage; // if (isDragingRockerItem) // { // return; // } // if (PlayerAutoFightFSM.IsEnemy(_entourage)) // { // target.CancelCommands(); // target.SetAiFightTarget(_entourage); // if (target.CurFSMState == MainPlayer.EventType.AI_FIGHT_CTRL) //应策划要求,自动战斗时的点击,不能直接跳转到普通,而只是临时执行。 // { // target.BreakAutoFight(); // } //// else //// { //// target.GoNormalFight(); //// } // } }
/// <summary> /// 清理所有的硬直状态(一般是由于切换场景) /// </summary> //public void CleanLockState() //{ // foreach (var item in lockStateList.Keys) // { // C2S_FinishedLockState(item); // } // lockStateList.Clear(); //} /// <summary> /// 设置佣兵信息 by吴江 /// </summary> /// <param name="_info"></param> public void SetEntourage(MainEntourage _entourage, MercenaryInfo _info) { entourage = _entourage; entourageDefaultAbilityList.Clear(); entourageNormalAbility = null; if (entourage == null) { return; } for (int i = 0; i < _info.PetSkillList.Count; i++) { AbilityInstance instance = new AbilityInstance((int)_info.PetSkillList[i], 1, 1, entourage, null); instance.FullCD(); entourageDefaultAbilityList.Add(instance); } entourageNormalAbility = new AbilityInstance(_info.NormalSkill, 1, entourage, null); AttackDiffTime = entourageNormalAbility.AbilityCD; }
/// <summary> /// 是否为敌人 by吴江 /// </summary> /// <param name="_smartActor"></param> /// <returns></returns> public static bool IsEnemy(InteractiveObject _obj) { if (_obj == null) { return(false); } if (GameCenter.curGameStage is CityStage) { return(false); //主城不能打,没敌人 } switch (_obj.typeID) { case ObjectType.Player: OtherPlayer op = _obj as OtherPlayer; if (op == null) { return(false); } if (GameCenter.mainPlayerMng.MainPlayerInfo.CurSceneUiType == SceneUiType.BATTLEFIGHT)//阵营模式 { return(ConfigMng.Instance.GetRelationType(GameCenter.curMainPlayer.Camp, op.Camp, GameCenter.curGameStage.SceneType) != RelationType.NO_ATTAK); } if (GameCenter.curMainPlayer.CurPkMode == PkMode.PKMODE_ALL) { return(true); } if (GameCenter.curMainPlayer.CurPkMode == PkMode.PKMODE_TEAM && !GameCenter.teamMng.CheckTeamMate(op.id)) { return(true); //队伍模式,不在一个队伍则是敌人 } if (GameCenter.curMainPlayer.CurPkMode == PkMode.PKMODE_GUILD && (string.IsNullOrEmpty(op.GuildName) || string.IsNullOrEmpty(GameCenter.curMainPlayer.GuildName) || !op.GuildName.Equals(GameCenter.curMainPlayer.GuildName))) { return(true); //公会模式下,自己无公会or对方无公会or不同的公会则是敌人 } if (GameCenter.curMainPlayer.CurPkMode == PkMode.PKMODE_JUSTICE && (op.SlaSevel == 3 || op.SlaSevel == 2 || op.IsCounterAttack)) { return(true); //3是魔头,IsCounterAttack表示该玩家恶意了你 } return(false); //和平模式 case ObjectType.MOB: Monster mob = _obj as Monster; if (mob == null) { return(false); } if (mob.actorInfo.RankLevel == MobRankLevel.DAILYDART) { if (mob.actorInfo.DartOwnerID == GameCenter.curMainPlayer.id) { return(false); } OtherPlayer opc = GameCenter.curGameStage.GetOtherPlayer(mob.actorInfo.DartOwnerID); if (opc == null) { if (GameCenter.curMainPlayer.CurPkMode == PkMode.PKMODE_PEASE) { return(false); } return(true); //无人镖车可以打吧 } if (GameCenter.curMainPlayer.CurPkMode == PkMode.PKMODE_ALL) { return(true); } if (GameCenter.curMainPlayer.CurPkMode == PkMode.PKMODE_TEAM && !GameCenter.teamMng.CheckTeamMate(opc.id)) { return(true); //队伍模式,不在一个队伍则是敌人 } if (GameCenter.curMainPlayer.CurPkMode == PkMode.PKMODE_GUILD && (string.IsNullOrEmpty(opc.GuildName) || string.IsNullOrEmpty(GameCenter.curMainPlayer.GuildName) || !opc.GuildName.Equals(GameCenter.curMainPlayer.GuildName))) { return(true); //公会模式下,自己无公会or对方无公会or不同的公会则是敌人 } if (GameCenter.curMainPlayer.CurPkMode == PkMode.PKMODE_JUSTICE && (opc.SlaSevel == 3 || opc.SlaSevel == 2)) { return(true); //3是魔头 } return(false); //和平模式 } else if (mob.actorInfo.RankLevel == MobRankLevel.GUILDDART) { if (GameCenter.curMainPlayer.CurPkMode != PkMode.PKMODE_PEASE && GameCenter.curMainPlayer.CurPkMode != PkMode.PKMODE_JUSTICE) { if (GameCenter.guildMng.MyGuildInfo != null && mob.actorInfo.DartOwnerID == GameCenter.guildMng.MyGuildInfo.GuildId) { return(false); //不能打自己公会的镖车 } return(true); } return(false); //和平模式和善恶模式不能打镖车 } return(ConfigMng.Instance.GetRelationType(GameCenter.curMainPlayer.Camp, mob.Camp, GameCenter.curGameStage.SceneType) != RelationType.NO_ATTAK); case ObjectType.Entourage: EntourageBase Entourage = _obj as EntourageBase; if (Entourage.Owner != null && Entourage.Owner == GameCenter.curMainPlayer) { return(false); } else { return(ConfigMng.Instance.GetRelationType(GameCenter.curMainPlayer.Camp, Entourage.Camp, GameCenter.curGameStage.SceneType) != RelationType.NO_ATTAK); } case ObjectType.NPC: return(false); case ObjectType.FlyPoint: return(false); default: return(false); } }