void JoinCombat() { MainCameraM.s_Instance.EnableDrag(true); WndManager.DestoryDialog <SelectSoldierwnd>(); CombatInfoWnd wndInfo = WndManager.GetDialog <CombatInfoWnd>(); if (wndInfo != null) { wndInfo.SetWndMode(CombatInfoMode.combat); } CombatWnd wnd = WndManager.GetDialog <CombatWnd>(); if (wnd != null) { wnd.InitSoldierUI(); } if (m_SelectedBlackScienceCaptainID != 0) //黑科技设置 { CmCarbon.AddGodSkill(true, m_SelectedBlackScienceCaptainID, ConfigM.GetInitMana()); GodSkillWnd gsw = WndManager.GetDialog <GodSkillWnd>(); if (gsw != null) { gsw.SetCurMana(CmCarbon.GetGodSkillMana(true)); gsw.SetRequireMana(CmCarbon.GetGodSkill(true).GetRequireMana()); } } CombatScheduler.SetCSState(CSState.Combat); }
public override void BuildUI() { Life.Environment = LifeEnvironment.Combat; CombatScheduler.SetCSState(CSState.Ready); if (BattleEnvironmentM.GetBattleEnvironmentMode() == BattleEnvironmentMode.CombatPVE) { if (StageDC.GetPveMode() == PVEMode.Attack) { WndManager.GetDialog <SelectSoldierwnd>(); BattleEnvironmentM.BuildScene(); } else { BattleEnvironmentM.BuildScene(); WndManager.GetDialog <CombatWnd>(); CombatInfoWnd wnd = WndManager.GetDialog <CombatInfoWnd>(); if (wnd != null) { wnd.SetWndMode(CombatInfoMode.combat); } if (CmCarbon.GetGodSkill(StageDC.GetPveMode() == PVEMode.Attack) != null) { //船长技能设置 GodSkillWnd gsw = WndManager.GetDialog <GodSkillWnd>(); if (gsw != null) { gsw.SetCurMana(CmCarbon.GetGodSkillMana(true)); gsw.SetRequireMana(CmCarbon.GetGodSkill(true).GetRequireMana()); } } // } } else { WndManager.GetDialog <CombatWnd>(); WndManager.GetDialog <CombatCountDownWnd>(); CombatInfoWnd wnd = WndManager.GetDialog <CombatInfoWnd>(); if (wnd != null) { wnd.SetWndMode(CombatInfoMode.view); } BattleEnvironmentM.BuildScene(); } BattleEnvironmentM.AddFireSoldierCompent(); Screen.sleepTimeout = SleepTimeout.NeverSleep;//prevent phone from going to sleep m_oldUserInfo.Level = UserDC.GetLevel(); m_oldUserInfo.Physical = UserDC.GetPhysical(); }
void PlayCombatEndAnimation(bool isWin) { List <Life> list = new List <Life>(); CM.SearchLifeMListInBoat(ref list, LifeMType.SOLDIER); GodSkillWnd gsw = WndManager.FindDialog <GodSkillWnd>(); if (gsw != null) { if (isWin) { gsw.ChangeBiaoqing((int)CaptionExpress.win); } else { gsw.ChangeBiaoqing((int)CaptionExpress.faile); } } foreach (var lifeM in list) { lifeM.GameOver(lifeM.m_Core.m_IsPlayer ? isWin : !isWin); } }
/// <summary> /// 发送炮弹兵 /// </summary> public static bool Fire(List <Vector3> lFlyPoint, int RoleID, SoldierInfo Soldier, bool IsPlayer) { if (Soldier == null || lFlyPoint == null || lFlyPoint.Count < 3) { return(false); } Role SoldierRole = null; int sceneID = CM.DataID2SceneIDInSoldier(RoleID); Life life = CM.GetLifeM(sceneID, LifeMType.SOLDIER); if (life == null) { int RoleType = Soldier.m_modeltype; if (RoleType == 102003) { RoleType = 1020032; } if (RoleType == 200009) { RoleType = 2000092; } string SoldierName = Soldier.m_name; Transform FlyNode = BattleEnvironmentM.GetLifeMBornNode(false); FlyNode.position = new Vector3(FlyNode.position.x, FlyNode.position.y, -0.5f); //IGameRole i = GameRoleFactory.Create(FlyNode, RoleType, SoldierName, AnimatorState.Fly00000); SoldierRole = LifeFactory.CreateRole(FlyNode, AnimatorState.Fly00000, Soldier, LifeMCamp.ATTACK, RoleID, MoveState.Fly, Int2.zero, LifeEnvironment.Combat); GameObject go = SoldierRole.RoleSkinCom.tRoot.gameObject; RoleColider col = SoldierRole.RoleSkinCom.tBody.gameObject.GetComponent <RoleColider>(); col.EnableColider(ColiderType.Fire, true); Vector3 dir = lFlyPoint[1] - lFlyPoint[0]; if (dir.x <= 0) { SoldierRole.RoleSkinCom.SetMirror(1, 1, 1); } else { SoldierRole.RoleSkinCom.SetMirror(-1, 1, 1); } } else { life.SetActive(true); SoldierRole = life as Role; SoldierRole.m_bReBorn = false; } if (SoldierRole != null) { if (IsPlayer) { GodSkillWnd gsw = WndManager.FindDialog <GodSkillWnd>(); if (gsw != null) { gsw.ChangeBiaoqing((int)CaptionExpress.fire); } } if (SoldierRole.MoveAI != null && SoldierRole.MoveAI is Fly) { (SoldierRole.MoveAI as Fly).SetTrailFly(lFlyPoint); PlayFlyMusic(Soldier.m_modeltype); } } return(true); }
public virtual void Dead() { if (m_isDead) { return; } //Debug.Log(this + " dead" + "," + SceneID); //炮弹兵死亡 if (m_Core.m_type == LifeMType.SOLDIER) { CmCarbon.AddDiePlayerSoldier(m_Core, GetMapPos()); //Debug.Log("add mana" + m_SceneID + gameObject); CmCarbon.AddGodSkillMana(!m_Core.m_IsPlayer, ConfigM.GetSoldierDeadMana()); if (m_Core.m_IsPlayer == false) { GodSkillWnd gsw = WndManager.FindDialog <GodSkillWnd>(); if (gsw != null) { gsw.SetCurMana(CmCarbon.GetGodSkillMana(true)); } } } //建筑物死亡 if (m_Core.m_type == LifeMType.BUILD) { CmCarbon.AddDieBuild(m_Core); BattleEnvironmentM.ShowSmoke(); //Debug.Log("add mana" + m_SceneID + gameObject); if (BattleEnvironmentM.GetBattleEnvironmentMode() == BattleEnvironmentMode.CombatPVE) { int mana = (m_Attr as BuildAttribute).DeadMana; CmCarbon.AddGodSkillMana(!m_Core.m_IsPlayer, mana); } else { CmCarbon.AddGodSkillMana(!m_Core.m_IsPlayer, ConfigM.GetBuildDeadMana()); } if (m_Core.m_IsPlayer == false) { GodSkillWnd gsw = WndManager.FindDialog <GodSkillWnd>(); if (gsw != null) { gsw.SetCurMana(CmCarbon.GetGodSkillMana(true)); } } } m_isDead = true; BeforeDead(); //SkillEffects._instance.LoadEffect("effect/prefab/", "1052061",transform.position,1f); LifeMCamp Camp = (m_Core.m_Camp == LifeMCamp.ATTACK) ? LifeMCamp.DEFENSE :LifeMCamp.ATTACK; List <Life> RoleList = new List <Life>(); CM.SearchLifeMListInBoat(ref RoleList, LifeMType.SOLDIER | LifeMType.SUMMONPET, Camp); AIPathConditions.AIPathEvent(new AIEventData(AIEvent.EVENT_TD), RoleList); MapM.EmptyRoleStations(m_SceneID, m_Core.m_type); CM.ExitCombat(m_Core, m_SceneID); DeadEffect(); if (this is Building1300) { } else { Destroy(); } }