private void OnWeaponUpgradeClick() { int energy = mCamp.energyCostUpgradeWeapon; if (energy < 0) { mFacade.ShowMessage("武器已到最高等级,无法进行升级"); } if (mFacade.TakeEnergy(energy)) { mCamp.UpgradeWeapon(); ShowCampInfo(mCamp); } else { mFacade.ShowMessage("升级武器需要能量:" + energy + " 能量不足,请稍后再进行升级。"); } }
// 武器升级按钮点击事件 private void OnWeaponUpgradeClick() { int energy = mCamp.EnergyCostWeaponUpgrade; if (energy < 0) { mFacade.ShowMsg("该兵营武器已升级到最大等级!"); return; } if (mFacade.TakeEnergy(energy)) { mCamp.UpgradeWeapon(); ShowCampInfo(mCamp); } else { mFacade.ShowMsg("能量不足,武器升级所需能量" + energy); } }
private void OnWeaponUpgradeClick() { int energy = mCamp.energyCostWeaponUpgrade; if (energy < 0) { mFacade.ShowMsg("武器已到最大等级,无法再进行升级"); return; } if (mFacade.TakeEnergy(energy)) { mCamp.UpgradeWeapon(); ShowCampInfo(mCamp); } else { mFacade.ShowMsg("升级武器需要能量:" + energy + " 能量不足,请稍后再进行升级"); } }
private void OnWeaponUpgradeClick() { int energy = m_Camp.EnergyCostWeaponUpgrade; if (energy < 0) { m_Facade.ShowMsg("武器已经最大等级,无法再升级"); return; } if (m_Facade.TakeEnergy(energy)) { m_Camp.UpgradeWeapon(); ShowCampInfo(m_Camp); } else { m_Facade.ShowMsg("升级武器需要能量:" + energy + " 能量不足,请稍后升级"); } }
private void OnWeaponUpgradeClick() { int energyCost = mCurrentCamp.energyCostUpgradeWeapon; if (energyCost < 0) { //提示信息:不能升级Weapon TODO mFacade.ShowMsg("武器已是最大等级,无法继续升级!"); return; } //能量消耗 TODO if (mFacade.TakeEnergy(energyCost)) { mCurrentCamp.UpgradeWeapon(); //更新界面 ShowCampInfo(mCurrentCamp); } else { mFacade.ShowMsg("升级武器需要能量:" + energyCost + ":能量不足,无法继续升级武器!"); } }