Exemplo n.º 1
0
        private void AllianceFormed(AllianceEvent allianceFormedEvent)
        {
            var txt = new TextObject("{=PdN5g5ub}{KINGDOM} has formed an alliance with {OTHER_KINGDOM}!");

            txt.SetTextVariable("KINGDOM", allianceFormedEvent.Kingdom.Name);
            txt.SetTextVariable("OTHER_KINGDOM", allianceFormedEvent.OtherKingdom.Name);
            var txtRendered = txt.ToString();

            if (allianceFormedEvent.Kingdom == Clan.PlayerClan.Kingdom ||
                allianceFormedEvent.OtherKingdom == Clan.PlayerClan.Kingdom)
            {
                InformationManager.ShowInquiry(
                    new InquiryData(new TextObject("{=qIa19an4}Alliance Formed").ToString(),
                                    txtRendered,
                                    true,
                                    false,
                                    GameTexts.FindText("str_ok", null).ToString(),
                                    null,
                                    null,
                                    null));
            }
            else
            {
                InformationManager.DisplayMessage(new InformationMessage(txtRendered, SubModule.StdTextColor));
            }
        }
 private void ExpireNonAggressionPact(AllianceEvent obj)
 {
     if (DiplomaticAgreementManager.Instance.HasNonAggressionPact(obj.Kingdom, obj.OtherKingdom, out NonAggressionPactAgreement pactAgreement))
     {
         pactAgreement.Expire();
     }
 }
        private void RegisterAllianceFormedCooldown(AllianceEvent allianceFormedEvent)
        {
            LogFactory.Get <CooldownBehavior>()
            .LogTrace($"[{CampaignTime.Now}] {allianceFormedEvent.Kingdom} got an alliance formation cooldown with {allianceFormedEvent.OtherKingdom}.");

            _cooldownManager.UpdateLastAllianceFormedTime(allianceFormedEvent.Kingdom, allianceFormedEvent.OtherKingdom, CampaignTime.Now);
        }
Exemplo n.º 4
0
        public EventStreamEntry(Member Member, Member Executer, AllianceEvent Event) : base(Member)
        {
            this.ExecuterHighId = Executer.HighId;
            this.ExecuterLowId  = Executer.LowId;
            this.ExecuterName   = Executer.Player.Name;

            this.Event = Event;
        }
Exemplo n.º 5
0
        internal override void Load(JToken Json)
        {
            base.Load(Json);

            int Event;

            if (JsonHelper.GetJsonNumber(Json, "event", out Event))
            {
                this.Event = (AllianceEvent)Event;
            }

            JsonHelper.GetJsonNumber(Json, "exc_id_high", out this.ExecuterHighId);
            JsonHelper.GetJsonNumber(Json, "exc_id_low", out this.ExecuterLowId);
            JsonHelper.GetJsonString(Json, "exc_name", out this.ExecuterName);
        }
Exemplo n.º 6
0
 internal void OnAllianceBroken(AllianceEvent allianceEvent)
 {
     Instance._allianceBroken.Invoke(allianceEvent);
 }
Exemplo n.º 7
0
 internal void OnAllianceFormed(AllianceEvent allianceEvent)
 {
     Instance._allianceFormed.Invoke(allianceEvent);
 }
Exemplo n.º 8
0
 private void RegisterAllianceFormedCooldown(AllianceEvent allianceFormedEvent)
 {
     _cooldownManager.UpdateLastAllianceFormedTime(allianceFormedEvent.Kingdom, allianceFormedEvent.OtherKingdom, CampaignTime.Now);
 }