private void OnFinshAttackOneLand() { //进攻消耗 CurCamp.AttackLandConsumeGold(); SetCurCampCanAttack(); //todo }
private void SetCurCampCanAttack() { //为了在UI上更新一些东西,比如不能进攻的时候把结束按钮高亮 bool campCanMove = false; foreach (Land land in CurCamp.ownedLands) { if (land.ArmyCanMove()) { campCanMove = true; break; } } //如果当前剩余的钱够一次进攻,并且至少有一个领地的兵可以动,那么可以进攻 CanAttack = CurCamp.CampCanMove() && campCanMove; }
private void OnTurnEnd() { foreach (BattleCardUI battleCardUI in CurCamp.BattleCardUIs) { //取消卡牌可点击状态 battleCardUI.SetCanClick(false); battleCardUI.BackToNormal(); } //补给当前阵营各地块 foreach (Land land in CurCamp.ownedLands) { land.EndTurnSupply(); } //遍历该阵营下所有地块,结算 Debug.Log("当前结算阵营" + CurCamp.name); Cannon cannon; foreach (Land land in CurCamp.ownedLands) { //当前阵营的炮,重置冷却 cannon = land.cannon; if (cannon.isOwned && cannon.isInCool) { land.cannon.isInCool = !((CurNumOfRounds - cannon.lastFire) >= CampDic.Count); } //进攻效果的卡牌都去掉 if (land.HasCard()) { land.ClearAttackCard(); } } //当前阵营的卡牌buff取消 CurCamp.ResetCardEffect(); //所有地块取消高亮 SetCampLandsHighLight(false, false); SetCampLandsHighLight(true, false); SupplyCard(); }