public static void BuildViewStageScene() { CounterPartInfo Info = StageDC.GetCounterPartInfo(); ShipCanvasInfo Map = StageM.GetCounterPartMap(Info.countershipcanvasid); List <SoldierInfo> lSoldier = new List <SoldierInfo>(); List <BuildInfo> lBuild = new List <BuildInfo>(); StageM.GetCounterPartShipPut(Info.id, ref lSoldier, ref lBuild); CmCarbon.SetDefenseMap(Map); GenerateShip.GenerateShips(GetShipBodyMap(), GetLifeMBornNode(true), lBuild, lSoldier); MainCameraM.s_Instance.ResetCameraDataByBattle(); }
/// <summary> /// 加入战役战斗,填充战役相关数据。 /// </summary> public static bool JoinCompaignBattle() { m_CounterPartPutSoldier.Clear(); m_CounterPartEnemys.Clear(); m_CounterPartPutBulid.Clear(); m_CounterPartInfo = StageM.GetCounterPartInfo(m_stageid); if (m_CounterPartInfo != null) { SetStageReward(m_stageid); //战斗模式 if (m_CounterPartInfo.mode == 0) { m_CounterPartMap = StageM.GetCounterPartMap(m_CounterPartInfo.countershipcanvasid); StageM.GetCounterPartShipPut(m_stageid, ref m_CounterPartPutSoldier, ref m_CounterPartPutBulid); //加入战斗 CmCarbon.ReadyCombat(); CmCarbon.SetDefenseMap(m_CounterPartMap); CmCarbon.SetDefenseBuild(m_CounterPartPutBulid); CmCarbon.SetPVEMonisterSoldier(m_CounterPartPutSoldier); CmCarbon.SetDefenseFloor(m_CounterPartInfo.decklevel); CmCarbon.SetDefenseUserInfo(m_CounterPartInfo, m_CounterPartPutBulid); } else //防守模式 //StageM.GetCounterPartShipPut(m_stageid , ref m_CounterPartPutSoldier , ref m_CounterPartPutBulid); { StageM.GetCounterPartShipPut(m_stageid, ref m_CounterPartEnemys, ref m_CounterPartPutBulid); //加入战斗 CmCarbon.ReadyCombat(); CmCarbon.SetAttackSoldier(m_CounterPartEnemys); } if (GetPassStageStar(m_type, m_stageid) == 0 /*&& GetPassStageTimes (m_type ,m_stageid) == 0*/) { CmCarbon.SetStartTalk(m_CounterPartInfo.m_StageStartTalk); CmCarbon.SetEndTalk(m_CounterPartInfo.m_StageEndTalk); } return(true); } return(false); }
/// <summary> /// 模拟数据 /// </summary> public static void SimulationData() { List <StaticShipCanvas> l = ShipPlanM.GetAllShipCanvasInfo(); foreach (StaticShipCanvas v in l) { m_lShipDesignInfo.Add(v.Id, v); } // ShipPlan p = new ShipPlan(); p.ID = 1; p.bExitCanvas = false; p.Name = "我的小船船"; p.Type = PlanType.Default; p.BlackScienceID = 1; p.Canvans = StageM.GetCounterPartMap(101001); p.ShipDesignId = 100005; // 16格大船 StaticShipCanvas shipInfo = ShipPlanDC.GetShipDesignInfo(p.ShipDesignId); if (shipInfo != null) { p.Canvans.CorrectionShiftError(new Int2(shipInfo.Width, shipInfo.Height)); } // 船只摆设数据 List <SoldierInfo> lSoldier = null; List <BuildInfo> lBuild = null; StageM.GetCounterPartShipPut(101001, ref lSoldier, ref lBuild); // 建筑跟楼梯 foreach (BuildInfo v in lBuild) { if (v.BuildType == 1300) { BuildInfo gold = BuildDC.GetVaultBuildInfo(); ShipPutInfo Info = new ShipPutInfo(); Info.id = ShipPutInfo.GetNewShipPutId(); Info.objid = gold.ID; Info.type = 1; Info.cxMapGrid = v.m_cx; Info.cyMapGrid = v.m_cy; Info.shipput_data0 = 0; Info.shipput_data1 = 0; p.AddShipBuildInfo(Info, ShipBuildType.BuildRoom); } if (v.BuildType == 1201) { ShipPutInfo Info = new ShipPutInfo(); Info.id = ShipPutInfo.GetNewShipPutId(); Info.objid = v.BuildType; Info.type = 3; Info.cxMapGrid = v.m_cx; Info.cyMapGrid = v.m_cy; Info.shipput_data0 = 0; Info.shipput_data1 = 0; p.AddShipBuildInfo(Info, ShipBuildType.BuildStair); } } m_lShipPlan.Add(p.ID, p); m_SelPlan = p; }