private static void AllocateAIPWithinStep(ArcenEnumIndexedArray_AIBudgetType <FInt> aipToQuasiAllocate, ArcenEnumIndexedArray_AIBudgetType <FInt> aipRatioForStep, FInt bottomOfStep, FInt topOfStep) { FInt planetsWorthOfAIP = World_AIW2.Instance.AIProgress_Effective / ExternalConstants.Instance.Balance_BaseAIPScale; if (planetsWorthOfAIP <= bottomOfStep) { return; } FInt aipForThisStep = planetsWorthOfAIP - bottomOfStep; if (topOfStep >= 0) { aipForThisStep = Mat.Min(aipForThisStep, (topOfStep - bottomOfStep)); } for (AIBudgetType i = AIBudgetType.None; i < AIBudgetType.Length; i++) { aipToQuasiAllocate[i] += (aipForThisStep * aipRatioForStep[i]); } }
public ArcenEnumIndexedArray_AIBudgetType <FInt> GetSpendingRatios(WorldSide side) { ArcenEnumIndexedArray_AIBudgetType <FInt> aipToQuasiAllocate = new ArcenEnumIndexedArray_AIBudgetType <FInt>(); FInt bottomOfStep; FInt topOfStep; ArcenEnumIndexedArray_AIBudgetType <FInt> aipRatioForStep = new ArcenEnumIndexedArray_AIBudgetType <FInt>(); bottomOfStep = FInt.Zero; topOfStep = FInt.FromParts(2, 500); aipRatioForStep[AIBudgetType.Wave] = FInt.FromParts(0, 167); aipRatioForStep[AIBudgetType.Reinforcement] = FInt.FromParts(0, 83); aipRatioForStep[AIBudgetType.CPA] = FInt.FromParts(0, 125); aipRatioForStep[AIBudgetType.SpecialForces] = FInt.FromParts(0, 500); aipRatioForStep[AIBudgetType.Reconquest] = FInt.FromParts(0, 125); AllocateAIPWithinStep(aipToQuasiAllocate, aipRatioForStep, bottomOfStep, topOfStep); bottomOfStep = topOfStep; topOfStep = FInt.FromParts(10, 000); aipRatioForStep[AIBudgetType.Wave] = FInt.FromParts(0, 83); aipRatioForStep[AIBudgetType.Reinforcement] = FInt.FromParts(0, 167); aipRatioForStep[AIBudgetType.CPA] = FInt.FromParts(0, 125); aipRatioForStep[AIBudgetType.SpecialForces] = FInt.FromParts(0, 500); aipRatioForStep[AIBudgetType.Reconquest] = FInt.FromParts(0, 125); AllocateAIPWithinStep(aipToQuasiAllocate, aipRatioForStep, bottomOfStep, topOfStep); bottomOfStep = topOfStep; topOfStep = FInt.FromParts(20, 000); aipRatioForStep[AIBudgetType.Wave] = FInt.FromParts(0, 250); aipRatioForStep[AIBudgetType.Reinforcement] = FInt.FromParts(0, 000); aipRatioForStep[AIBudgetType.CPA] = FInt.FromParts(0, 125); aipRatioForStep[AIBudgetType.SpecialForces] = FInt.FromParts(0, 500); aipRatioForStep[AIBudgetType.Reconquest] = FInt.FromParts(0, 125); AllocateAIPWithinStep(aipToQuasiAllocate, aipRatioForStep, bottomOfStep, topOfStep); bottomOfStep = topOfStep; topOfStep = FInt.FromParts(50, 000); aipRatioForStep[AIBudgetType.Wave] = FInt.FromParts(0, 125); aipRatioForStep[AIBudgetType.Reinforcement] = FInt.FromParts(0, 000); aipRatioForStep[AIBudgetType.CPA] = FInt.FromParts(0, 250); aipRatioForStep[AIBudgetType.SpecialForces] = FInt.FromParts(0, 500); aipRatioForStep[AIBudgetType.Reconquest] = FInt.FromParts(0, 125); AllocateAIPWithinStep(aipToQuasiAllocate, aipRatioForStep, bottomOfStep, topOfStep); bottomOfStep = topOfStep; topOfStep = (FInt)(-1); aipRatioForStep[AIBudgetType.Wave] = FInt.FromParts(0, 000); aipRatioForStep[AIBudgetType.Reinforcement] = FInt.FromParts(0, 000); aipRatioForStep[AIBudgetType.CPA] = FInt.FromParts(0, 375); aipRatioForStep[AIBudgetType.SpecialForces] = FInt.FromParts(0, 500); aipRatioForStep[AIBudgetType.Reconquest] = FInt.FromParts(0, 125); AllocateAIPWithinStep(aipToQuasiAllocate, aipRatioForStep, bottomOfStep, topOfStep); ArcenEnumIndexedArray_AIBudgetType <FInt> result = new ArcenEnumIndexedArray_AIBudgetType <FInt>(); FInt planetsWorthOfAIP = World_AIW2.Instance.AIProgress_Effective / ExternalConstants.Instance.Balance_BaseAIPScale; for (AIBudgetType i = AIBudgetType.None; i < AIBudgetType.Length; i++) { result[i] = aipToQuasiAllocate[i] / planetsWorthOfAIP; } return(result); }