Beispiel #1
0
        private static bool Prefix(ref TournamentGame __result, Town town)
        {
            float gameBasicMeleeChance = 65f;
            float rdm = MBRandom.RandomFloatRanged(1f, 100f);


            try
            {
                if (rdm < gameBasicMeleeChance)
                {
                    __result = new FightTournamentGame(town);
                    return(false);
                }
                else
                {
                    var newgame = new Fight2TournamentGame(town);
                    //rdm = MBRandom.RandomFloatRanged(1f, 100f);
                    //if (rdm < 50f)
                    //{
                    //    newgame.SetFightMode(Fight2TournamentGame.FightMode.One_One);
                    //}
                    __result = newgame;
                    return(false);
                }
            }
            catch (Exception ex)
            {
                ErrorLog.Log("Error Creating Tournament\n" + ex.ToStringFull());
            }
            return(true);
        }
        public static void Postfix(ref float __result, MobileParty party, StatExplainer explainer)
        {
            //For now only do hero
            if (party.LeaderHero == Hero.MainHero)
            {
                if (party.Scout != null)
                {
                    var sk = party.Scout.GetSkillValue(DefaultSkills.Scouting);
                    if (sk > 0)
                    {
                        var mod = 1.0f - ((float)sk / 300.0f);
                        if (mod < 0.1f)
                        {
                            mod = 0.1f;
                        }

                        mod = MBRandom.RandomFloatRanged(mod, 1.0f);
                        var orig      = __result;
                        var deduction = (orig - ((__result * mod))) * -1f;;

                        ExplainedNumber en = new ExplainedNumber(__result, explainer);
                        explainer?.Lines.Remove(explainer.Lines.Last());
                        var textObject = new TextObject("{FIRST_NAME} scouted for food.", null);
                        textObject.SetTextVariable("FIRST_NAME", party.Scout.FirstName);
                        //textObject.SetTextVariable("REDUCTION_AMOUNT", (orig-__result).ToString());
                        en.Add(deduction, textObject);
                        __result = en.ResultNumber;
                    }
                }
            }
        }
        private static IEnumerable <ItemRosterElement> LootCasualties2(ICollection <TroopRosterElement> shareFromCasualties, float lootChance)
        {
            // MobileParty.GetMainPartySkillCounsellor(DefaultSkills.Roguery).GetSkillValue(DefaultSkills.Roguery)
            ItemRoster itemRosters         = new ItemRoster();
            Dictionary <string, int> loots = new Dictionary <string, int>();

            lootChance = MathF.Clamp(lootChance * 1.3f, 20f, 95f);

            foreach (TroopRosterElement casualty in shareFromCasualties)
            {
                Equipment randomEquipment    = GetRandomEquipment(casualty.Character);
                var       potentialLootItems = GetItemsFromEquipmentSlots(randomEquipment);
                foreach (ItemObject item in potentialLootItems)
                {
                    float rdm = MBRandom.RandomFloatRanged(100f);
                    if (rdm < lootChance)
                    {
                        if (loots.ContainsKey(item.StringId))
                        {
                            loots[item.StringId] += 1;
                        }
                        else
                        {
                            loots.Add(item.StringId, 1);
                        }
                    }
                }
            }
            foreach (var stringId in loots.Keys)
            {
                itemRosters.Add(new ItemRosterElement(MBObjectManager.Instance.GetObject <ItemObject>(stringId), loots[stringId]));
            }
            return(itemRosters);
        }
 private bool PlagueKills(bool useSkill)
 {
     if (useSkill)
     {
         if (MBRandom.RandomFloatRanged(0, 1) >= highMedicineChance)
         {
             // Plague kills
             return(true);
         }
         else
         {
             // Plague doesn't kill
             return(false);
         }
     }
     else
     {
         if (MBRandom.RandomFloatRanged(0, 1) >= baseSuccessChance)
         {
             // Plague kills
             return(true);
         }
         else
         {
             // Plague doesn't kill
             return(false);
         }
     }
 }
Beispiel #5
0
        public static EquipmentElement GetEquipmentWithModifier(ItemObject item, float prosperityFactor)
        {
            ItemModifierGroup itemModifierGroup;
            ArmorComponent    armorComponent = item.ArmorComponent;

            if (armorComponent != null)
            {
                itemModifierGroup = armorComponent.ItemModifierGroup;
            }
            else
            {
                itemModifierGroup = null;
            }
            ItemModifierGroup itemModifierGroup1     = itemModifierGroup ?? Campaign.Current.ItemModifierGroupss.FirstOrDefault <ItemModifierGroup>((ItemModifierGroup x) => x.ItemTypeEnum == item.ItemType);
            ItemModifier      itemModifierWithTarget = null;

            if (itemModifierGroup1 != null)
            {
                float prosperityVariance = 1f;
                if (prosperityFactor < 1f)
                {
                    prosperityVariance = MBRandom.RandomFloatRanged(prosperityFactor, 1f);
                }
                else
                {
                    prosperityVariance = MBRandom.RandomFloatRanged(1f, prosperityFactor);
                }

                itemModifierWithTarget = itemModifierGroup1.GetRandomModifierWithTarget(prosperityVariance, 1f);
            }
            return(new EquipmentElement(item, itemModifierWithTarget));
        }
Beispiel #6
0
        public override void StartEvent()
        {
            string extraDialogue   = "";
            int    damageToInflict = damage;

            if (MBRandom.RandomFloatRanged(0.0f, 1.0f) <= reactionChance)
            {
                extraDialogue   = "Your body reacts painfully to the sting. ";
                damageToInflict = reactionDamage;
            }

            Hero.MainHero.HitPoints -= damageToInflict;

            InformationManager.ShowInquiry(
                new InquiryData("Bee Kind",
                                $"As you sit down next to some flowers you get stung by a bee! {extraDialogue}Why is nature so cruel?",
                                true,
                                false,
                                "Ouch.",
                                null,
                                null,
                                null
                                ),
                true);

            StopEvent();
        }
        private static void ml_town_init_garrison_menu(MenuCallbackArgs args)
        {
            args.MenuTitle = new TextObject("{ml.garrison.title}Garrison Headquarters", null);
            MBTextManager.SetTextVariable("ML_GARRISON_TOWN_NAME", Settlement.CurrentSettlement.Name, false);
            float garrisonSatsifaction = TownUtils.CalculateGarrisonSatsifaction(Settlement.CurrentSettlement.Town);

            switch (Settlement.CurrentSettlement.Town.GetProsperityLevel())
            {
            case SettlementComponent.ProsperityLevel.Low:
                MBTextManager.SetTextVariable("ML_GARRISON_DESC", "modest wooden stockade");
                break;

            case SettlementComponent.ProsperityLevel.Mid:
                MBTextManager.SetTextVariable("ML_GARRISON_DESC", "stout wooden blockhouse");
                break;

            case SettlementComponent.ProsperityLevel.High:
                MBTextManager.SetTextVariable("ML_GARRISON_DESC", "large stone towerhouse");
                break;
            }

            switch (Settlement.CurrentSettlement.Town.GetProsperityLevel())
            {
            case SettlementComponent.ProsperityLevel.Low:
                MBTextManager.SetTextVariable("ML_GARRISON_SATISFACTION", "of destitution. The soldiers look underfed and glance longingly at their empty coin pouches between swigs of cheap alcohol. Some men curse out their commanders and lords in the corner.");
                break;

            case SettlementComponent.ProsperityLevel.Mid:
                MBTextManager.SetTextVariable("ML_GARRISON_SATISFACTION", "of typical military attitude. One or two men curse the commander under their breath, and some look on at the town with displeasure, but generally everyone is adquately fed and well enough off for their status.");
                break;

            case SettlementComponent.ProsperityLevel.High:
                MBTextManager.SetTextVariable("ML_GARRISON_SATISFACTION", "of general happiness and camraderie. The men look content and well-fed, and they sling jokes back and forth. Everyone seems like friends.");
                break;
            }

            float num = MBRandom.RandomFloatRanged(0, 1f);

            if (num <= 0.25)
            {
                MBTextManager.SetTextVariable("ML_GARRISON_FLAVOR", "soldiers milling about, playing board games and catching up on the latest gossip.");
            }
            else if (num <= 0.5)
            {
                MBTextManager.SetTextVariable("ML_GARRISON_FLAVOR", "soldiers and stewards moving about on duty. On the officer's desk, there's a colossal stack of parchments.");
            }
            else if (num <= 0.75)
            {
                MBTextManager.SetTextVariable("ML_GARRISON_FLAVOR", "a handful of guards chatting in a corner, their comrades diligently watching the ramparts just outside.");
            }
            else
            {
                MBTextManager.SetTextVariable("ML_GARRISON_FLAVOR", "a smattering of armed men lounging about, some eating or catching up on sleep.");
            }
        }
        public override void StartEvent()
        {
            if (Settings.GeneralSettings.DebugMode)
            {
                InformationManager.DisplayMessage(new InformationMessage($"Starting {this.RandomEventData.EventType}", RandomEventsSubmodule.textColor));
            }

            List <InquiryElement> inquiryElements = new List <InquiryElement>();

            inquiryElements.Add(new InquiryElement("a", "Pay gold to have them leave", null, true, "What is gold good for, if not to dissuade people from killing you?"));
            inquiryElements.Add(new InquiryElement("b", "Attack", null));

            if (Hero.MainHero.PartyBelongedTo.MemberRoster.TotalHealthyCount > troopScareCount)
            {
                inquiryElements.Add(new InquiryElement("c", "Intimidate them", null));
            }

            MultiSelectionInquiryData msid = new MultiSelectionInquiryData(
                eventTitle,             // Title
                CalculateDescription(), // Description
                inquiryElements,        // Options
                false,                  // Can close menu without selecting an option. Should always be false.
                1,                      // Force a single option to be selected. Should usually be true
                "Okay",                 // The text on the button that continues the event
                null,                   // The text to display on the "cancel" button, shouldn't ever need it.
                (elements) =>           // How to handle the selected option. Will only ever be a single element unless force single option is off.
            {
                if ((string)elements[0].Identifier == "a")
                {
                    float percentMoneyLost = MBRandom.RandomFloatRanged(moneyMinPercent, moneyMaxPercent);
                    int goldLost           = (int)MathF.Floor(Hero.MainHero.Gold * percentMoneyLost);
                    Hero.MainHero.ChangeHeroGold(-goldLost);
                    InformationManager.ShowInquiry(new InquiryData(eventTitle, $"You give the bandits {goldLost} coins and they quickly flee. At least you and your soldiers live to fight another day.", true, false, "Done", null, null, null), true);
                }
                else if ((string)elements[0].Identifier == "b")
                {
                    SpawnBandits(false);
                    InformationManager.ShowInquiry(new InquiryData(eventTitle, "Seeing you won't back down, the bandits get ready for a fight.", true, false, "Done", null, null, null), true);
                }
                else if ((string)elements[0].Identifier == "c")
                {
                    SpawnBandits(true);
                    InformationManager.ShowInquiry(new InquiryData(eventTitle, "You laugh as you watch the rest of your party emerge over the crest of the hill. The bandits get ready to flee.", true, false, "Done", null, null, null), true);
                }
                else
                {
                    MessageBox.Show($"Error while selecting option for \"{this.RandomEventData.EventType}\"");
                }
            },
                null);                 // What to do on the "cancel" button, shouldn't ever need it.

            InformationManager.ShowMultiSelectionInquiry(msid, true);

            StopEvent();
        }
        public float GetFloatFromXML(string numpassed)
        {
            try
            {
                float number = 0f;

                if (numpassed == null)
                {
                    return(number);
                }

                if (numpassed.StartsWith("R"))
                {
                    string[] splitPass = numpassed.Split(' ');

                    switch (splitPass.Length)
                    {
                    case 3:
                        float numberOne = float.Parse(splitPass[1]);
                        float numberTwo = float.Parse(splitPass[2]);

                        number = numberOne < numberTwo
                                ? MBRandom.RandomFloatRanged(numberOne, numberTwo)
                                : MBRandom.RandomFloatRanged(numberTwo, numberOne);

                        break;

                    case 2:
                        number = MBRandom.RandomFloatRanged(float.Parse(splitPass[1]));

                        break;

                    default:
                        number = MBRandom.RandomFloat;

                        break;
                    }
                }
                else
                {
                    number = float.Parse(numpassed);
                }

                return(number);
            }
            catch (Exception)
            {
                CECustomHandler.LogToFile("Failed to parse float " + numpassed);

                return(0f);
            }
        }
Beispiel #10
0
        public RandomEventData GetRandom()
        {
            float rand = MBRandom.RandomFloatRanged(0.0f, accumulatedWeight);

            foreach (WeightedEventData weightedEvent in weightedEvents)
            {
                if (weightedEvent.accumulatedWeight >= rand)
                {
                    return(weightedEvent.RandomEventData);
                }
            }
            return(null);
        }
        public override void StartEvent()
        {
            if (Settings.GeneralSettings.DebugMode)
            {
                InformationManager.DisplayMessage(new InformationMessage($"Starting {this.RandomEventData.EventType}", RandomEventsSubmodule.textColor));
            }

            float percentOffset = MBRandom.RandomFloatRanged(-percentageDifferenceOfCurrentTroop, percentageDifferenceOfCurrentTroop);

            int spawnCount = (int)(MobileParty.MainParty.MemberRoster.Count * (1 + percentOffset));

            if (spawnCount < minimumSoldiers)
            {
                spawnCount = minimumSoldiers;
            }

            List <InquiryElement> inquiryElements = new List <InquiryElement>();

            inquiryElements.Add(new InquiryElement("a", "Let the soldiers have some fun!", null));
            inquiryElements.Add(new InquiryElement("b", "Do nothing.", null, true, "Think about the experience you're giving up!"));

            MultiSelectionInquiryData msid = new MultiSelectionInquiryData(
                eventTitle,                       // Title
                CalculateDescription(spawnCount), // Description
                inquiryElements,                  // Options
                false,                            // Can close menu without selecting an option. Should always be false.
                1,                                // Force a single option to be selected. Should usually be true
                "Okay",                           // The text on the button that continues the event
                null,                             // The text to display on the "cancel" button, shouldn't ever need it.
                (elements) =>                     // How to handle the selected option. Will only ever be a single element unless force single option is off.
            {
                if ((string)elements[0].Identifier == "a")
                {
                    InformationManager.ShowInquiry(new InquiryData(eventTitle, "The looters look terrified.", true, false, "Good", null, null, null), true);
                    SpawnLooters(spawnCount);
                }
                else if ((string)elements[0].Identifier == "b")
                {
                    InformationManager.ShowInquiry(new InquiryData(eventTitle, "The looters, seeing that you aren't about to attack, quickly scatter to the wind. Your soldiers grumble.", true, false, "Done", null, null, null), true);
                }
                else
                {
                    MessageBox.Show($"Error while selecting option for \"{this.RandomEventData.EventType}\"");
                }
            },
                null);                 // What to do on the "cancel" button, shouldn't ever need it.

            InformationManager.ShowMultiSelectionInquiry(msid, true);

            StopEvent();
        }
Beispiel #12
0
        private static bool GetRandomBirthDayForAge(float age, ref CampaignTime __result)
        {
            var   now           = CampaignTime.Now;
            float birthYear     = now.GetYear - age;
            float randDayOfYear = MBRandom.RandomFloatRanged(1, Main.TimeParam.DayPerYear);

            if (randDayOfYear > now.GetDayOfYear)
            {
                --birthYear;
            }

            __result = CampaignTime.Years(birthYear) + CampaignTime.Days(randDayOfYear);
            return(false);
        }
Beispiel #13
0
        private string DoBet(int goldToBet)
        {
            float decision = MBRandom.RandomFloatRanged(0.0f, 1.0f);


            string outcomeText;

            if (decision >= 0.5f)
            {
                outcomeText = "\"Well, I'm never going to make that money back...\" Your companion says with a heavy sigh as your pocket your 'hard earned' gold.";
                Hero.MainHero.ChangeHeroGold(goldToBet);
            }
            else
            {
                outcomeText = "\"Better luck next time\" Your companion says smugly.";
                Hero.MainHero.ChangeHeroGold(-goldToBet);
            }

            return(outcomeText);
        }
Beispiel #14
0
        public void RecordPrePregnantInfo(Hero sexPartner1, Hero sexPartner2)
        {
            if ((double)MBRandom.RandomFloatRanged(0.0f, 1f) > (double)Config.Instance.PregnancyProbability || sexPartner1 == null || sexPartner2 == null || !Config.Instance.EnableLesbianPregnancy && sexPartner1.IsFemale && sexPartner2.IsFemale)
            {
                return;
            }
            Hero key    = (Hero)null;
            Hero father = (Hero)null;

            if (sexPartner1.IsAlive && sexPartner1.IsFemale && (sexPartner1.IsPregnant == false && (double)sexPartner1.Age > (double)Config.Instance.MinAge))
            {
                key    = sexPartner1;
                father = sexPartner2;
            }
            if (sexPartner2.IsAlive && sexPartner2.IsFemale && (sexPartner2.IsPregnant == false && (double)sexPartner2.Age > (double)Config.Instance.MinAge) && (key == null || MBRandom.RandomInt(0, 1) == 0))
            {
                key    = sexPartner2;
                father = sexPartner1;
            }
            if (key == null || father == null)
            {
                return;
            }
            CampaignTime pregnantDate = CampaignTime.DaysFromNow((float)MBRandom.RandomInt(Config.Instance.MinPregnancyDelayDays, Config.Instance.MaxPregnancyDelayDays));

            if (this.m_prePregnancyInfoMap.ContainsKey(key))
            {
                if (this.m_prePregnancyInfoMap[key].m_pregnantDate > pregnantDate)
                {
                    this.m_prePregnancyInfoMap[key].m_father       = father;
                    this.m_prePregnancyInfoMap[key].m_pregnantDate = pregnantDate;
                }
            }
            else
            {
                this.m_prePregnancyInfoMap.Add(key, new PregnancyControlBehavior.PrePregnancyInfo(father, pregnantDate));
            }
            Utillty.DebugDisplayMessage("_recordPrePregnantInfo Success! Mother : " + ((object)key.Name).ToString() + " Father : " + ((object)father.Name).ToString() + " PregnantDate : " + pregnantDate.ToString());
        }
        private static bool Prefix(ref TournamentGame __result, Town town)
        {
            float gameBasicMeleeChance = 65f;
            float rdm = MBRandom.RandomFloatRanged(1f, 100f);

            if (rdm < gameBasicMeleeChance)
            {
                __result = new FightTournamentGame(town);
            }
            else
            {
                var newgame = new Fight2TournamentGame(town);
                //rdm = MBRandom.RandomFloatRanged(1f, 100f);
                //if (rdm < 50f)
                //{
                //    newgame.SetFightMode(Fight2TournamentGame.FightMode.One_One);
                //}
                __result = newgame;
            }

            return(false);
        }
Beispiel #16
0
        private void conversation_tavernkeep_bought_drinks()
        {
            int _curDrinkPrice = CalculateDrinksPrice();

            GiveGoldAction.ApplyBetweenCharacters(Hero.MainHero, null, _curDrinkPrice, false);
            if (_curDrinkPrice >= 500 && _curDrinkPrice < 1000)
            {
                GainRenownAction.Apply(Hero.MainHero, MBRandom.RandomFloatRanged(1.0f, 2.0f));
                Hero.MainHero.AddSkillXp(DefaultSkills.Charm, MBRandom.RandomInt(2, 4));
            }
            else if (_curDrinkPrice >= 1000 && _curDrinkPrice < 1500)
            {
                GainRenownAction.Apply(Hero.MainHero, MBRandom.RandomFloatRanged(2.0f, 3.5f));
                Hero.MainHero.AddSkillXp(DefaultSkills.Charm, MBRandom.RandomInt(4, 8));
            }
            else if (_curDrinkPrice >= 1500)
            {
                GainRenownAction.Apply(Hero.MainHero, MBRandom.RandomFloatRanged(3.5f, 5.0f));
                Hero.MainHero.AddSkillXp(DefaultSkills.Charm, MBRandom.RandomInt(5, 10));
            }
            InformationManager.DisplayMessage(new InformationMessage("Gained some renown and charm for buying drinks."));
            _boughtDrinksIn.Add(MobileParty.MainParty.CurrentSettlement);
        }
Beispiel #17
0
 public RandomTimer(float gameTime, float durationMin, float durationMax)
     : base(gameTime, MBRandom.RandomFloatRanged(durationMin, durationMax))
 {
     this.durationMin = durationMin;
     this.durationMax = durationMax;
 }
        public override void OnUdpNetworkHandlerTick(float dt)
        {
            if (!GameNetwork.IsServer)
            {
                return;
            }
            float time = MBCommon.GetTime(MBCommon.TimeType.Mission);

            foreach (NetworkCommunicator networkPeer in GameNetwork.NetworkPeers)
            {
                if (networkPeer.IsSynchronized)
                {
                    while (this._peerData.Count <= networkPeer.Index)
                    {
                        this._peerData.Add(new NetworkStatusReplicationComponent.NetworkStatusData());
                    }
                    double pingInMilliseconds = networkPeer.RefreshAndGetAveragePingInMilliseconds();
                    NetworkStatusReplicationComponent.NetworkStatusData networkStatusData = this._peerData[networkPeer.Index];
                    bool flag = (double)networkStatusData.NextPingForceSendTime <= (double)time;
                    if (flag || (double)networkStatusData.NextPingTrySendTime <= (double)time)
                    {
                        int ping = pingInMilliseconds.Round();
                        if (flag || networkStatusData.LastSentPingValue != ping)
                        {
                            networkStatusData.LastSentPingValue     = ping;
                            networkStatusData.NextPingForceSendTime = time + 10f + MBRandom.RandomFloatRanged(1.5f, 2.5f);
                            GameNetwork.BeginBroadcastModuleEvent();
                            GameNetwork.WriteMessage((GameNetworkMessage) new PingReplication(networkPeer, ping));
                            GameNetwork.EndBroadcastModuleEventUnreliable(GameNetwork.EventBroadcastFlags.None);
                        }
                        networkStatusData.NextPingTrySendTime = time + MBRandom.RandomFloatRanged(1.5f, 2.5f);
                    }
                    if (!networkPeer.IsServerPeer && (double)networkStatusData.NextLossTrySendTime <= (double)time)
                    {
                        networkStatusData.NextLossTrySendTime = time + MBRandom.RandomFloatRanged(1.5f, 2.5f);
                        int averageLossPercent = (int)networkPeer.RefreshAndGetAverageLossPercent();
                        if (networkStatusData.LastSentLossValue != averageLossPercent)
                        {
                            networkStatusData.LastSentLossValue = averageLossPercent;
                            GameNetwork.BeginModuleEventAsServer(networkPeer);
                            GameNetwork.WriteMessage((GameNetworkMessage) new LossReplicationMessage(averageLossPercent));
                            GameNetwork.EndModuleEventAsServer();
                        }
                    }
                }
            }
            if ((double)this._nextPerformanceStateTrySendTime > (double)time)
            {
                return;
            }
            this._nextPerformanceStateTrySendTime = time + MBRandom.RandomFloatRanged(1.5f, 2.5f);
            ServerPerformanceState performanceState = this.GetServerPerformanceState();

            if (performanceState == this._lastSentPerformanceState)
            {
                return;
            }
            this._lastSentPerformanceState = performanceState;
            GameNetwork.BeginBroadcastModuleEvent();
            GameNetwork.WriteMessage((GameNetworkMessage) new ServerPerformanceStateReplicationMessage(performanceState));
            GameNetwork.EndBroadcastModuleEventUnreliable(GameNetwork.EventBroadcastFlags.None);
        }
Beispiel #19
0
        public override void OnAgentRemoved(Agent affectedAgent, Agent affectorAgent, AgentState agentState, KillingBlow blow)
        {
            if (Mission.Current.CombatType != Mission.MissionCombatType.Combat)
            {
                return;
            }
            if (affectedAgent == null)
            {
                return;
            }
            try
            {
                if ((affectedAgent.IsMainAgent == false && !affectedAgent.IsMount))
                {
                    //Don't get your companion equipment
                    if (affectedAgent.IsHero && affectedAgent.Team == Agent.Main.Team)
                    {
                        return;
                    }

                    for (int i = 0; i < 12; i++)
                    {
                        EquipmentIndex   equipmentIndex = (EquipmentIndex)i;
                        var              rdm            = MBRandom.RandomFloatRanged(BMRandomTweaksConfiguration.Instance.LootRandomMaxRoll);
                        EquipmentElement equipmentFromSlot;
                        if (rdm < PlayerDropRate) //Might as well use the player loot rate.  If player looses they get no loot anyway.
                        {
                            if (affectedAgent.Character.Equipment.GetEquipmentFromSlot(equipmentIndex).Item != null)
                            {
                                equipmentFromSlot = affectedAgent.Character.Equipment.GetEquipmentFromSlot(equipmentIndex);
                                if (!BMRandomTweaksConfiguration.Instance.HorseDropEnabled)
                                {
                                    if (equipmentFromSlot.Item.ItemType == ItemObject.ItemTypeEnum.HorseHarness ||
                                        equipmentFromSlot.Item.ItemType == ItemObject.ItemTypeEnum.Horse)
                                    {
                                        continue;
                                    }
                                }

                                float itemValue = equipmentFromSlot.Item.Value + 0.1f;
                                if (itemValue > 1.3f * PlayerMaxValue || itemValue < 0.8f * PlayerMaxValue)
                                {
                                    equipmentFromSlot = this.GetEquipmentWithModifier(equipmentFromSlot.Item, PlayerMaxValue / itemValue);
                                    itemValue         = equipmentFromSlot.ItemValue;
                                }
                                if (itemValue > PlayerMaxValue * 1.3f)
                                {
                                    float single = PlayerMaxValue / (Math.Max(PlayerMaxValue, itemValue));
                                    if (MBRandom.RandomFloatRanged(itemValue) < single)
                                    {
                                        LootedItems.Add(equipmentFromSlot);
                                    }
                                }
                                else
                                {
                                    LootedItems.Add(equipmentFromSlot);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorLog.Log("Error OnAgentRemoval");
                ErrorLog.Log(ex.ToStringFull());
            }
        }
 public virtual float RandomFloatRanged(float minVal, float maxVal) => MBRandom.RandomFloatRanged(minVal, maxVal);
        public static ItemObject GenerateTournamentPrize(TournamentGame tournamentGame, TournamentXPandedModel tournamentInfo, bool keepTownPrize = false, bool regenAllPrizes = true)
        {
            if (tournamentGame == null)
            {
                return(null);
            }

            var numItemsToGet = TournamentXPSettings.Instance.NumberOfPrizeOptions;
            var allitems      = GetItemStringsRevised(tournamentGame, TournamentXPSettings.Instance.GetActivePrizeTypes());

            if (allitems.Count == 0)
            {
                MessageBox.Show("TournamentsXPanded Error:\nAlert, your prize generation filters have resulted in no valid prizes.  Consider widening your prize value range and if you are using a custom list make sure it's loaded correctly.");
                return(null);
            }

            //Add any existing items if we are filling in missing ones from an already generated pool
            if (regenAllPrizes)
            {
                tournamentInfo.SelectedPrizeStringId = "";
                tournamentInfo.PrizePool             = new List <PrizeItem>();
            }
            var pickeditems = new List <PrizeItem>();

            if (keepTownPrize && tournamentGame != null && !string.IsNullOrWhiteSpace((tournamentGame.Prize.StringId)))
            {
                pickeditems.Add(new PrizeItem()
                {
                    ItemStringId = tournamentGame.Prize.StringId, ItemModifierStringId = ""
                });
                tournamentInfo.SelectedPrizeStringId = tournamentGame.Prize.StringId;
            }
            try
            {
                if (!regenAllPrizes)
                {
                    foreach (PrizeItem existingPrize in tournamentInfo.PrizePool)
                    {
                        if (pickeditems.Where(x => x.ItemStringId == existingPrize.ItemStringId).Count() == 0)
                        {
                            pickeditems.Add(existingPrize);
                        }
                        if (allitems.Contains(existingPrize.ItemStringId))
                        {
                            allitems.Remove(existingPrize.ItemStringId);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorLog.Log("ERROR: GetTournamentPrize existingprizes\n" + ex.ToStringFull());
            }

            //If the totoal pool of unique items is less than our desired number, reduce our pool size.
            if (allitems.Count() < numItemsToGet)
            {
                numItemsToGet = allitems.Count();
            }

            while (pickeditems.Count < numItemsToGet && allitems.Count() > 0)
            {
                var randomId = allitems.GetRandomElement <string>();
                if (pickeditems.Where(x => x.ItemStringId == randomId).Count() == 0)
                {
                    pickeditems.Add(new PrizeItem()
                    {
                        ItemStringId = randomId, ItemModifierStringId = ""
                    });
                }
                allitems.Remove(randomId);
            }
            tournamentInfo.PrizePool = new List <PrizeItem>();

            foreach (var pickedItem in pickeditems)
            {
                ItemModifier itemModifier         = null;
                ItemObject   pickedPrize          = null;
                string       itemModifierStringId = "";
                try
                {
                    pickedPrize = Game.Current.ObjectManager.GetObject <ItemObject>(pickedItem.ItemStringId);
                }
                catch (Exception ex)
                {
                    ErrorLog.Log("Error getting object StringId: " + pickedItem.ItemStringId + "\n" + ex.ToStringFull());
                }

                if (pickedPrize != null)
                {
                    if (TournamentXPSettings.Instance.EnableItemModifiersForPrizes && pickedPrize.ItemType != ItemObject.ItemTypeEnum.Thrown && pickedPrize.ItemType != ItemObject.ItemTypeEnum.Arrows)
                    {
                        try
                        {
                            if (MBRandom.RandomFloatRanged(100f) < 50f)
                            {
                                var ee = GetEquipmentWithModifier(pickedPrize, GetProsperityModifier(tournamentGame.Town.Settlement));
                                itemModifier = ee.ItemModifier;
                                if (itemModifier != null)
                                {
                                    itemModifierStringId = itemModifier.StringId;
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            ErrorLog.Log("Error in GetEquipmentWithModifier\nItem:" + pickedPrize.StringId + "\n" + ex.ToStringFull());
                        }
                    }
                    try
                    {
                        tournamentInfo.PrizePool.Add(new PrizeItem()
                        {
                            ItemStringId = pickedPrize.StringId, ItemModifierStringId = itemModifierStringId
                        });
                    }
                    catch (Exception ex)
                    {
                        ErrorLog.Log("Error adding equipment to prizepool.\n" + ex.ToStringFull());
                    }
                }
                else
                {
                    MessageBox.Show("Invalid Item detected.  Please remove: " + pickedItem.ItemStringId + " from your list of custom items. Ignoring this item and continuing.");
                }
            }

            if (!keepTownPrize)
            {
                if (tournamentInfo.PrizePool.Count > 0)
                {
                    tournamentInfo.SelectedPrizeStringId = tournamentInfo.PrizePool.First().ItemStringId;
                    //    SetTournamentSelectedPrize(tournamentGame, tournamentInfo.SelectPrizeItemRosterElement?.EquipmentElement.Item);
                }
            }
            try
            {
                return(tournamentInfo.SelectedPrizeItem.ToItemRosterElement().EquipmentElement.Item);
            }
            catch
            {
                //something went wrong generating a valid prize somewhere up above. hopefully earlier try catches will provide info, this is just a final failsafe to let it revert to default behavior.
            }
            return(null);
        }
 private float GetRolledDay(PatrolAroundClosestLestInterruptedAndSwitchBehaviourData dat)
 {
     return(MBRandom.RandomFloatRanged(dat.minStablePatrolDays, dat.maxStablePatrolDays));
 }
Beispiel #23
0
        public static ItemObject GenerateTournamentPrize(TournamentGame tournamentGame, TournamentPrizePool currentPool = null, bool keepTownPrize = true)
        {
            var  numItemsToGet   = TournamentXPSettings.Instance.NumberOfPrizeOptions;
            bool bRegenAllPrizes = false;

            if (currentPool == null)
            {
                bRegenAllPrizes = true;
                currentPool     = GetTournamentPrizePool(tournamentGame.Town.Settlement);
            }
            var allitems = GetItemStringsRevised(tournamentGame, TournamentPrizePoolBehavior.GetActivePrizeTypes());

            if (allitems.Count == 0)
            {
                MessageBox.Show("TournamentsXPanded Error:\nAlert, your prize generation filters have resulted in no valid prizes.  Consider widening your prize value range and if you are using a custom list make sure it's loaded correctly.");
                return(null);
            }

            //Add any existing items if we are filling in missing ones from an already generated pool
            var pickeditems = new List <string>();

            if (keepTownPrize && !string.IsNullOrWhiteSpace((tournamentGame.Prize.StringId)))
            {
                pickeditems.Add(tournamentGame.Prize.StringId);
                currentPool.SelectedPrizeStringId = tournamentGame.Prize.StringId;
            }
            try
            {
                if (!bRegenAllPrizes)
                {
                    foreach (ItemRosterElement existingPrize in currentPool.Prizes)
                    {
                        if (!pickeditems.Contains(existingPrize.EquipmentElement.Item.StringId))
                        {
                            pickeditems.Add(existingPrize.EquipmentElement.Item.StringId);
                        }

                        if (allitems.Contains(existingPrize.EquipmentElement.Item.StringId))
                        {
                            allitems.Remove(existingPrize.EquipmentElement.Item.StringId);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorLog.Log("ERROR: GetTournamentPrize existingprizes\n" + ex.ToStringFull());
            }

            //If the totoal pool of unique items is less than our desired number, reduce our pool size.
            if (allitems.Count() < numItemsToGet)
            {
                numItemsToGet = allitems.Count();
            }

            while (pickeditems.Count < numItemsToGet && allitems.Count() > 0)
            {
                var randomId = allitems.GetRandomElement <string>();

                if (!pickeditems.Contains(randomId))
                {
                    pickeditems.Add(randomId);
                    allitems.Remove(randomId);
                }
            }
            currentPool.Prizes = new ItemRoster();
            foreach (var id in pickeditems)
            {
                ItemModifier itemModifier = null;
                ItemObject   pickedPrize  = null;
                try
                {
                    pickedPrize = Game.Current.ObjectManager.GetObject <ItemObject>(id);
                }
                catch (Exception ex)
                {
                    ErrorLog.Log("Error getting object StringId: " + id + "\n" + ex.ToStringFull());
                }

                if (pickedPrize != null)
                {
#if VERSION120 || VERSION130
                    if (TournamentXPSettings.Instance.EnableItemModifiersForPrizes && pickedPrize.ItemType != ItemObject.ItemTypeEnum.Thrown && pickedPrize.ItemType != ItemObject.ItemTypeEnum.Arrows)
                    {
                        try
                        {
                            if (MBRandom.RandomFloatRanged(100f) < 50f)
                            {
                                var ee = GetEquipmentWithModifier(pickedPrize, TournamentPrizePoolBehavior.GetProsperityModifier(tournamentGame.Town.Settlement));
                                itemModifier = ee.ItemModifier;
                            }
                        }
                        catch (Exception ex)
                        {
                            ErrorLog.Log("Error in GetEquipmentWithModifier\nItem:" + pickedPrize.StringId + "\n" + ex.ToStringFull());
                        }
                    }
#endif
                    try
                    {
                        currentPool.Prizes.Add(new ItemRosterElement(pickedPrize, 1, itemModifier));
                    }
                    catch (Exception ex)
                    {
                        ErrorLog.Log("Error adding equipment to prizepool.\n" + ex.ToStringFull());
                    }
                }
                else
                {
                    MessageBox.Show("Invalid Item detected.  Please remove: " + id + " from your list of custom items. Ignoring this item and continuing.");
                }
            }

            if (!keepTownPrize)
            {
                var selected = currentPool.Prizes.GetRandomElement <ItemRosterElement>();
                currentPool.SelectedPrizeStringId = selected.EquipmentElement.Item.StringId;
                SetTournamentSelectedPrize(tournamentGame, selected.EquipmentElement.Item);
            }
            return(currentPool.SelectPrizeItemRosterElement.EquipmentElement.Item);
        }
Beispiel #24
0
        public static ItemObject GenerateTournamentPrize(TournamentGame tournamentGame, TournamentPrizePool currentPool = null, bool keepTownPrize = true)
        {
            var  numItemsToGet   = TournamentXPSettings.Instance.NumberOfPrizeOptions;
            bool bRegenAllPrizes = false;

            if (currentPool == null)
            {
                bRegenAllPrizes = true;
                currentPool     = GetTournamentPrizePool(tournamentGame.Town.Settlement);
            }
            var allitems = GetItemStringsRevised(tournamentGame, TournamentPrizePoolBehavior.GetActivePrizeTypes());

            //Add any existing items if we are filling in missing ones from an already generated pool
            var pickeditems = new List <string>();

            if (keepTownPrize && !string.IsNullOrWhiteSpace((tournamentGame.Prize.StringId)))
            {
                pickeditems.Add(tournamentGame.Prize.StringId);
                currentPool.SelectedPrizeStringId = tournamentGame.Prize.StringId;
            }
            try
            {
                if (!bRegenAllPrizes)
                {
                    foreach (ItemRosterElement existingPrize in currentPool.Prizes)
                    {
                        if (!pickeditems.Contains(existingPrize.EquipmentElement.Item.StringId))
                        {
                            pickeditems.Add(existingPrize.EquipmentElement.Item.StringId);
                        }

                        if (allitems.Contains(existingPrize.EquipmentElement.Item.StringId))
                        {
                            allitems.Remove(existingPrize.EquipmentElement.Item.StringId);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorLog.Log("ERROR: GetTournamentPrize existingprizes\n" + ex.ToStringFull());
            }

            //If the totoal pool of unique items is less than our desired number, reduce our pool size.
            if (allitems.Count() < numItemsToGet)
            {
                numItemsToGet = allitems.Count();
            }

            while (pickeditems.Count < numItemsToGet && allitems.Count() > 0)
            {
                var randomId = allitems.GetRandomElement <string>();

                if (!pickeditems.Contains(randomId))
                {
                    pickeditems.Add(randomId);
                    allitems.Remove(randomId);
                }
            }
            currentPool.Prizes = new ItemRoster();
            foreach (var id in pickeditems)
            {
                ItemModifier itemModifier = null;
                var          pickedPrize  = Game.Current.ObjectManager.GetObject <ItemObject>(id);
#if VERSION120
                if (TournamentXPSettings.Instance.EnableItemModifiersForPrizes)
                {
                    //var ee = GetEquipmentWithModifier(pickedPrize, TournamentPrizePoolBehavior.GetProsperityModifier(tournamentGame.Town.Settlement));
                    if (MBRandom.RandomFloatRanged(100f) < 50f)
                    {
                        var ee = GetEquipmentWithModifier(pickedPrize, 1.3f);
                        itemModifier = ee.ItemModifier;
                    }
                }
#endif
                currentPool.Prizes.Add(new ItemRosterElement(pickedPrize, 1, itemModifier));
                // currentPool.Prizes.Add(new ItemRosterElement(pickedPrize, 1, null)); //Turn off random item mods for now;
            }

            if (!keepTownPrize)
            {
                var selected = currentPool.Prizes.GetRandomElement <ItemRosterElement>();
                currentPool.SelectedPrizeStringId = selected.EquipmentElement.Item.StringId;
                SetTournamentSelectedPrize(tournamentGame, selected.EquipmentElement.Item);
            }
            return(currentPool.SelectPrizeItemRosterElement.EquipmentElement.Item);
        }
 public float RandomInRange() => IsFixed ? Min : MBRandom.RandomFloatRanged(Min, Max);
        public static void GenerateParentKey(
            BodyProperties childBodyProperties,
            ref BodyProperties motherBodyProperties,
            ref BodyProperties fatherBodyProperties)
        {
            FaceGenerationParams faceGenerationParams1 = FaceGenerationParams.Create();
            FaceGenerationParams faceGenerationParams2 = FaceGenerationParams.Create();
            FaceGenerationParams faceGenerationParams3 = FaceGenerationParams.Create();

            MBBodyProperties.GenerationType[] generationTypeArray = new MBBodyProperties.GenerationType[4];
            for (int index = 0; index < generationTypeArray.Length; ++index)
            {
                generationTypeArray[index] = (MBBodyProperties.GenerationType)MBRandom.RandomInt(2);
            }
            MBBodyProperties.GetParamsFromKey(ref faceGenerationParams1, childBodyProperties, false);
            int genInstancesLength = MBBodyProperties.GetFaceGenInstancesLength(faceGenerationParams1._currentGender, (int)faceGenerationParams1._curAge);

            for (int keyNo = 0; keyNo < genInstancesLength; ++keyNo)
            {
                DeformKeyData deformKeyData = MBBodyProperties.GetDeformKeyData(keyNo, faceGenerationParams1._currentGender, (int)faceGenerationParams1._curAge);
                if (deformKeyData.GroupId >= 0 && deformKeyData.GroupId != 0 && (deformKeyData.GroupId != 5 && deformKeyData.GroupId != 6))
                {
                    float num = MBRandom.RandomFloat * Math.Min(faceGenerationParams1.KeyWeights[keyNo], 1f - faceGenerationParams1.KeyWeights[keyNo]);
                    if (generationTypeArray[deformKeyData.GroupId - 1] == MBBodyProperties.GenerationType.FromMother)
                    {
                        faceGenerationParams3.KeyWeights[keyNo] = faceGenerationParams1.KeyWeights[keyNo];
                        faceGenerationParams2.KeyWeights[keyNo] = faceGenerationParams1.KeyWeights[keyNo] + num;
                    }
                    else if (generationTypeArray[deformKeyData.GroupId - 1] == MBBodyProperties.GenerationType.FromFather)
                    {
                        faceGenerationParams2.KeyWeights[keyNo] = faceGenerationParams1.KeyWeights[keyNo];
                        faceGenerationParams3.KeyWeights[keyNo] = faceGenerationParams1.KeyWeights[keyNo] + num;
                    }
                    else
                    {
                        faceGenerationParams3.KeyWeights[keyNo] = faceGenerationParams1.KeyWeights[keyNo] + num;
                        faceGenerationParams2.KeyWeights[keyNo] = faceGenerationParams1.KeyWeights[keyNo] - num;
                    }
                }
            }
            faceGenerationParams2._curAge = faceGenerationParams1._curAge + (float)MBRandom.RandomInt(18, 25);
            faceGenerationParams2.SetRandomParamsExceptKeys(0, (int)faceGenerationParams2._curAge, out float _);
            faceGenerationParams2._curFaceTattoo = 0;
            faceGenerationParams3._curAge        = faceGenerationParams1._curAge + (float)MBRandom.RandomInt(18, 22);
            faceGenerationParams3.SetRandomParamsExceptKeys(1, (int)faceGenerationParams3._curAge, out float _);
            faceGenerationParams3._curFaceTattoo    = 0;
            faceGenerationParams3._heightMultiplier = faceGenerationParams2._heightMultiplier * MBRandom.RandomFloatRanged(0.7f, 0.9f);
            if (faceGenerationParams3._currentHair == 0)
            {
                faceGenerationParams3._currentHair = 1;
            }
            float num1 = MBRandom.RandomFloat * Math.Min(faceGenerationParams1._curSkinColorOffset, 1f - faceGenerationParams1._curSkinColorOffset);

            if (MBRandom.RandomInt(2) == 1)
            {
                faceGenerationParams2._curSkinColorOffset = faceGenerationParams1._curSkinColorOffset + num1;
                faceGenerationParams3._curSkinColorOffset = faceGenerationParams1._curSkinColorOffset - num1;
            }
            else
            {
                faceGenerationParams2._curSkinColorOffset = faceGenerationParams1._curSkinColorOffset - num1;
                faceGenerationParams3._curSkinColorOffset = faceGenerationParams1._curSkinColorOffset + num1;
            }
            MBBodyProperties.ProduceNumericKeyWithParams(faceGenerationParams3, false, ref motherBodyProperties);
            MBBodyProperties.ProduceNumericKeyWithParams(faceGenerationParams2, false, ref fatherBodyProperties);
        }
        /// <summary>
        /// Behavior Duplicate found In PregnancyCampaignBehavior
        /// </summary>
        /// <param name="pregnancy"></param>
        private void CheckOffspringsToDeliver(Pregnancy pregnancy)
        {
            try
            {
                if (!pregnancy.Mother.IsAlive)
                {
                    pregnancy.AlreadyOccured = true;
                    return;
                }

                CalculatePregnancyWeight(pregnancy);

                if (pregnancy.DueDate.IsFuture)
                {
                    return;
                }
                PregnancyModel pregnancyModel = Campaign.Current.Models.PregnancyModel;

                Hero        mother          = pregnancy.Mother;
                bool        flag            = MBRandom.RandomFloat <= pregnancyModel.DeliveringTwinsProbability;
                List <Hero> aliveOffsprings = new List <Hero>();

                int num            = flag ? 2 : 1;
                int stillbornCount = 0;

                for (int i = 0; i < 1; i++)
                {
                    if (MBRandom.RandomFloat > pregnancyModel.StillbirthProbability)
                    {
                        bool isOffspringFemale = MBRandom.RandomFloat <= pregnancyModel.DeliveringFemaleOffspringProbability;

                        try
                        {
                            Hero item = DeliverOffSpring(pregnancy.Mother, pregnancy.Father, isOffspringFemale, 0);
                            aliveOffsprings.Add(item);
                        }
                        catch (Exception e)
                        {
                            CECustomHandler.ForceLogToFile("Bad pregnancy " + (isOffspringFemale ? "Female" : "Male"));
                            CECustomHandler.ForceLogToFile(e.Message + " : " + e);
                            Hero item = HeroCreator.DeliverOffSpring(pregnancy.Mother, pregnancy.Father, !isOffspringFemale, null, 0);
                            aliveOffsprings.Add(item);
                        }
                    }
                    else
                    {
                        if (mother == Hero.MainHero)
                        {
                            TextObject textObject = new TextObject("{=pw4cUPEn}{MOTHER.LINK} has delivered stillborn.");
                            StringHelpers.SetCharacterProperties("MOTHER", mother.CharacterObject, textObject);
                            InformationManager.DisplayMessage(new InformationMessage(textObject.ToString()));
                        }

                        stillbornCount++;
                    }
                }

                if (mother == Hero.MainHero || pregnancy.Father == Hero.MainHero)
                {
                    TextObject textObject = mother == Hero.MainHero
                        ? new TextObject("{=oIA9lkpc}You have given birth to {DELIVERED_CHILDREN}.")
                        : new TextObject("{=CEEVENTS1092}Your captive {MOTHER.NAME} has given birth to {DELIVERED_CHILDREN}.");

                    switch (stillbornCount)
                    {
                    case 2:
                        textObject.SetTextVariable("DELIVERED_CHILDREN", new TextObject("{=Sn9a1Aba}two stillborn babies"));
                        break;

                    case 1 when aliveOffsprings.Count == 0:
                        textObject.SetTextVariable("DELIVERED_CHILDREN", new TextObject("{=qWLq2y84}a stillborn baby"));
                        break;

                    case 1 when aliveOffsprings.Count == 1:
                        textObject.SetTextVariable("DELIVERED_CHILDREN", new TextObject("{=CEEVENTS1168}one healthy and one stillborn baby"));
                        break;

                    case 0 when aliveOffsprings.Count == 1:
                        textObject.SetTextVariable("DELIVERED_CHILDREN", new TextObject("{=CEEVENTS1169}a healthy baby"));
                        break;

                    case 0 when aliveOffsprings.Count == 2:
                        textObject.SetTextVariable("DELIVERED_CHILDREN", new TextObject("{=CEEVENTS1170}two healthy babies"));
                        break;
                    }
                    StringHelpers.SetCharacterProperties("MOTHER", mother.CharacterObject, textObject);
                    InformationManager.AddQuickInformation(textObject);
                }

                if (mother.IsHumanPlayerCharacter || pregnancy.Father == Hero.MainHero)
                {
                    for (int i = 0; i < stillbornCount; i++)
                    {
                        ChildbirthLogEntry childbirthLogEntry = new ChildbirthLogEntry(mother, null);
                        LogEntry.AddLogEntry(childbirthLogEntry);
                        Campaign.Current.CampaignInformationManager.NewMapNoticeAdded(new ChildBornMapNotification(null, childbirthLogEntry.GetEncyclopediaText()));
                    }
                    foreach (Hero newbornHero in aliveOffsprings)
                    {
                        ChildbirthLogEntry childbirthLogEntry2 = new ChildbirthLogEntry(mother, newbornHero);
                        LogEntry.AddLogEntry(childbirthLogEntry2);
                        Campaign.Current.CampaignInformationManager.NewMapNoticeAdded(new ChildBornMapNotification(newbornHero, childbirthLogEntry2.GetEncyclopediaText()));
                    }
                }

                mother.IsPregnant        = false;
                pregnancy.AlreadyOccured = true;

                ChangeWeight(pregnancy.Mother, 0, MBRandom.RandomFloatRanged(0.4025f, 0.6025f));
            }
            catch (Exception e)
            {
                CECustomHandler.ForceLogToFile("Bad pregnancy");
                CECustomHandler.ForceLogToFile(e.Message + " : " + e);
                TextObject textObject = new TextObject("{=CEEVENTS1008}Error: bad pregnancy in CE pregnancy list");
                InformationManager.DisplayMessage(new InformationMessage(textObject.ToString(), Colors.Black));
                pregnancy.AlreadyOccured = true;
            }
        }
Beispiel #28
0
 public void RecomputeDuration() => this.Duration = MBRandom.RandomFloatRanged(this.durationMin, this.durationMax);