Ejemplo n.º 1
0
 public ConstructionCost[] GetConvertionCost(Army army, Village village)
 {
     if (army == null)
     {
         return(null);
     }
     Diagnostics.Assert(army.Empire != null);
     Diagnostics.Assert(army.Empire is MajorEmpire);
     return(ArmyAction_Convert.GetConvertionCost(army.Empire as MajorEmpire, village));
 }
Ejemplo n.º 2
0
    private void RefreshCosts()
    {
        IConstructionCost[] array              = this.ArmyAction.Costs;
        ArmyAction_Bribe    armyAction_Bribe   = this.ArmyAction as ArmyAction_Bribe;
        ArmyAction_Convert  armyAction_Convert = this.ArmyAction as ArmyAction_Convert;

        if (armyAction_Bribe != null || armyAction_Convert != null)
        {
            Village village = this.Target as Village;
            if (village != null)
            {
                IConstructionCost[] array2 = null;
                if (armyAction_Bribe != null)
                {
                    IConstructionCost[] array3 = armyAction_Bribe.GetBribeCosts(this.Army, village);
                    array2 = array3;
                }
                else if (armyAction_Convert != null)
                {
                    IConstructionCost[] array3 = armyAction_Convert.GetConvertionCost(this.Army, village);
                    array2 = array3;
                }
                if (array2 != null && array2.Length != 0)
                {
                    if (array == null)
                    {
                        array = array2;
                    }
                    else
                    {
                        Array.Resize <IConstructionCost>(ref array, array.Length + array2.Length);
                        Array.Copy(array2, 0, array, array.Length - array2.Length, array2.Length);
                    }
                }
            }
        }
        if (this.Army != null && this.Army.Empire != null && array != null && array.Length != 0)
        {
            this.ActionCostLabel.AgeTransform.Visible = true;
            if (ELCPUtilities.UseELCPSymbiosisBuffs && this.ArmyAction is ArmyAction_TameUnstunnedKaiju)
            {
                KaijuGarrison kaijuGarrison = this.Target as KaijuGarrison;
                if (kaijuGarrison != null)
                {
                    KaijuCouncil agency = kaijuGarrison.KaijuEmpire.GetAgency <KaijuCouncil>();
                    if (agency != null)
                    {
                        ConstructionCost constructionCost = new ConstructionCost(agency.ELCPResourceName, KaijuCouncil.GetKaijuTameCost().GetValue(this.Army.Empire), true, true);
                        array = new IConstructionCost[]
                        {
                            constructionCost
                        };
                    }
                }
            }
            this.ActionCostLabel.Text = GuiFormater.FormatCost(this.Army.Empire, array, false, 1, this.Army);
            this.ActionDescription.AgeTransform.PixelMarginBottom = this.ActionCostLabel.AgeTransform.PixelMarginBottom + this.ActionCostLabel.AgeTransform.Height;
            return;
        }
        this.ActionCostLabel.AgeTransform.Visible = false;
        this.ActionCostLabel.Text = string.Empty;
        this.ActionDescription.AgeTransform.PixelMarginBottom = this.ActionCostLabel.AgeTransform.PixelMarginBottom;
    }