Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Amplitude.Framework.Simulation;
- using Amplitude.Framework.Simulation.Attributes;
- using Amplitude.Mercury.Data.AI;
- using Amplitude.Mercury.Data.Simulation;
- using Amplitude.Mercury.Interop;
- using Amplitude.Serialization;
- namespace Amplitude.Mercury.Simulation
- {
- internal class DiplomaticAmbassy : SimulationEntity
- {
- [PropertyDefinition(BaseValue = 0.8f)]
- public Property LesserTradeCostMultiplier;
- [PropertyDefinition(BaseValue = 0.5f)]
- public Property GreaterTradeCostMultiplier;
- [PropertyDefinition(BaseValue = 50f, MaxValue = 100f, MinValue = 0f)]
- public Property BaseMoral;
- public EditableProperty NumberOfAgreementSigned;
- [PropertyDefinition(BaseValue = -5f)]
- public Property BaseMoralPerAgreementSigned;
- [PropertyDefinition(BaseValue = 0f)]
- public Property OnGoingDemandMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property OnGoingTheirCityOccupiedByUsMoralGain;
- [PropertyDefinition(BaseValue = -4f)]
- public Property OnGoingOurCityOccupiedByThemMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property OnGoingWarAgainstPacifistMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property OnGoingMyWarMoralGainFromMyStabilityMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property OnGoingTheirTerritoryIsUnderOurInfluence;
- [PropertyDefinition(BaseValue = 0f)]
- public Property OnGoingOurTerritoryIsUnderTheirInfluence;
- [PropertyDefinition(BaseValue = 0f)]
- public Property OnGoingThisJustWarWasTheirFaultMoralGain;
- [PropertyDefinition(BaseValue = -2f)]
- public Property OnGoingThisUnjustWarWasOurFaultMoralGain;
- [PropertyDefinition(BaseValue = -1f)]
- public Property OnGoingThisJustWarWasOurFaultMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property OnGoingThisUnjustWarWasTheirFaultMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property OnGoingProximityStateThisWarWasOurFaultMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property OnGoingProximityStateThisWarWasTheirFaultMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property OnGoingTheirEmpireHasNoCapital;
- [PropertyDefinition(BaseValue = -5f)]
- public Property OnGoingOurEmpireHasNoCapital;
- [PropertyDefinition(BaseValue = 0f)]
- public Property NoWarAndTheyHaveMoreOngoingDemands;
- [PropertyDefinition(BaseValue = 3f)]
- public Property NoWarAndWeHaveMoreOngoingDemands;
- [PropertyDefinition(BaseValue = 2f)]
- public Property NoWarAndWeHaveLessThanBaseMoral;
- [PropertyDefinition(BaseValue = -1f)]
- public Property NoWarAndWeHaveMoreThanBaseMoral;
- [PropertyDefinition(BaseValue = 5f)]
- public Property InstantGrievanceMoralGain;
- [PropertyDefinition(BaseValue = 8f)]
- public Property InstantBattleWonMoralGain;
- [PropertyDefinition(BaseValue = -8f)]
- public Property InstantBattleLostMoralGain;
- [PropertyDefinition(BaseValue = -5f)]
- public Property InstantMyEmpireRetreatedMoralGain;
- [PropertyDefinition(BaseValue = 5f)]
- public Property InstantOtherEmpireRetreatedMoralGain;
- [PropertyDefinition(BaseValue = 5f)]
- public Property InstantMyExtensionHasBeenDamagedMoralGain;
- [PropertyDefinition(BaseValue = 10f)]
- public Property InstantMyAdministrativeCentreHasBeenDamaged;
- [PropertyDefinition(BaseValue = 0f)]
- public Property InstantDamageEnemyExtensionMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property InstantDamageEnemyAdministrativeCentreMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property InstantMyEmpireCapturedCityMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property InstantOtherEmpireCapturedCityMoralGain;
- [PropertyDefinition(BaseValue = 5f)]
- public Property InstantMyEmpireCapturedCampMoralGain;
- [PropertyDefinition(BaseValue = -5f)]
- public Property InstantOtherEmpireCapturedCampMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property InstantRefuseOtherDemandMoralGain;
- [PropertyDefinition(BaseValue = 20f)]
- public Property InstantOtherRefusedOurSurrenderMoralGain;
- [PropertyDefinition(BaseValue = -10f)]
- public Property InstantIRefusedOtherSurrenderMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property InstantDeclareEndOfAllianceMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property InstantBreakAgreementMoralGain;
- [PropertyDefinition(BaseValue = 5f)]
- public Property InstantWithdrawMyDemandMoralGain;
- [PropertyDefinition(BaseValue = 10f)]
- public Property InstantAcceptOtherDemandMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property InstantProposeEndWarTreatyMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property InstantProposeEndCrisisTreatyMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property InstantCreateDemandsMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property InstantWarStartsMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property InstantDeclareWarMoralGain;
- [PropertyDefinition(BaseValue = -5f)]
- public Property InstantWhitePeaceGotRefusedMoralGain;
- [PropertyDefinition(BaseValue = 0f)]
- public Property OnGoingOtherEmpireWarMoralGainFromMyStability;
- [PropertyDefinition(BaseValue = 20f)]
- public Property InstantOtherEmpireDeclaredEndOfAlliance;
- [PropertyDefinition(BaseValue = 10f)]
- public Property InstantOtherEmpireBrokeAgreement;
- [PropertyDefinition(BaseValue = 10f)]
- public Property InstantOtherEmpireRefusedDemands;
- [PropertyDefinition(BaseValue = -5f)]
- public Property MyEmpireAbandonedSiegeMoralGain;
- [PropertyDefinition(BaseValue = 5f)]
- public Property OtherEmpireAbandonedSiegeMoralGain;
- [PropertyDefinition(BaseValue = 1f)]
- public Property OnGoingWarWithNoDemandsAgainstMeMoralMultiplier;
- [PropertyDefinition(BaseValue = 5f)]
- public Property NumberOfTurnTimeoutOnDiplomaticAction;
- [PropertyDefinition(BaseValue = 0f)]
- public EditableProperty NumberOfOverrideSinceLastNaturalTimeout;
- [PropertyDefinition(BaseValue = 80f)]
- public Property DeclareFormalWarMoralThreshold;
- [PropertyDefinition(BaseValue = 20f)]
- public Property DeclareSurpriseWarMoralThreshold;
- [PropertyDefinition(BaseValue = 25f)]
- public Property LowMoralNotificationThreshold;
- public Reference<MajorEmpire> MyEmpire = new Reference<MajorEmpire>();
- public Reference<MajorEmpire> OtherEmpire = new Reference<MajorEmpire>();
- public Reference<DiplomaticAmbassy> OtherAmbassy = new Reference<DiplomaticAmbassy>();
- public Reference<DiplomaticRelation> DiplomaticRelation = new Reference<DiplomaticRelation>();
- internal AvailableGrievanceCollection AvailableGrievances = AvailableGrievanceCollection.Default;
- internal OnGoingDemandCollection OnGoingDemands = OnGoingDemandCollection.Default;
- internal AIBehaviourState PreviousAIBehaviourState = AIBehaviourState.Unknown;
- internal AIBehaviourState CurrentAIBehaviourState = AIBehaviourState.Unknown;
- internal int AIBehaviourStateChangeDate;
- internal int AITransitioningStates;
- internal float AIRapportScore;
- internal float AISuperiorityScore;
- internal DiplomaticScoreModifierEntry[] AIFeedbackEntries;
- internal AIMoodMessage AIMoodMessage;
- internal int AIMoodMessageTurn;
- internal RelationTendency AIRelationTendency;
- internal DiplomaticMoral EmpireMoral = DiplomaticMoral.Default;
- internal int CurrentSurrenderToOtherProposition = -1;
- internal int ForcedOtherToSurrenderProposition = -1;
- internal DiplomaticAbility CurrentAbilities;
- internal int TurnNumberAtWhichTimeoutEnds;
- internal bool HasStalled;
- public override void Serialize(Serializer serializer)
- {
- MyEmpire.Serialize("MyEmpire", serializer);
- OtherEmpire.Serialize("OtherEmpire", serializer);
- OtherAmbassy.Serialize("OtherAmbassy", serializer);
- DiplomaticRelation.Serialize("DiplomaticRelation", serializer);
- base.Serialize(serializer);
- AvailableGrievances = serializer.SerializeElement("AvailableGrievances", AvailableGrievances);
- OnGoingDemands = serializer.SerializeElement("OnGoingDemands", OnGoingDemands);
- PreviousAIBehaviourState = (AIBehaviourState)serializer.SerializeElement("PreviousAIBehaviourState", (int)PreviousAIBehaviourState);
- CurrentAIBehaviourState = (AIBehaviourState)serializer.SerializeElement("CurrentAIBehaviourState", (int)CurrentAIBehaviourState);
- AIBehaviourStateChangeDate = serializer.SerializeElement("AIBehaviourStateChangeDate", AIBehaviourStateChangeDate);
- EmpireMoral = serializer.SerializeElement("EmpireMoral", EmpireMoral);
- CurrentAbilities = (DiplomaticAbility)serializer.SerializeElement("CurrentAbilities", (int)CurrentAbilities);
- CurrentSurrenderToOtherProposition = serializer.SerializeElement("CurrentSurrenderToOtherProposition", CurrentSurrenderToOtherProposition);
- ForcedOtherToSurrenderProposition = serializer.SerializeElement("ForcedOtherToSurrenderProposition", ForcedOtherToSurrenderProposition);
- TurnNumberAtWhichTimeoutEnds = serializer.SerializeElement("TurnNumberAtWhichTimeoutEnds", TurnNumberAtWhichTimeoutEnds);
- AIRapportScore = serializer.SerializeElement("RapportScore", AIRapportScore);
- AISuperiorityScore = serializer.SerializeElement("SuperiorityScore", AISuperiorityScore);
- AITransitioningStates = serializer.SerializeElement("TransitioningStates", AITransitioningStates);
- AIFeedbackEntries = serializer.SerializeElement("AIFeedbackEntries", AIFeedbackEntries);
- AIMoodMessage = (AIMoodMessage)serializer.SerializeElement("AIMoodMessage", (int)AIMoodMessage);
- AIMoodMessageTurn = serializer.SerializeElement("AIMoodMessageTurn", AIMoodMessageTurn);
- }
- internal void Load()
- {
- }
- internal void Initialize(MajorEmpire myEmpire, MajorEmpire otherEmpire, DiplomaticRelation relation, DiplomaticAmbassy otherAmbassy)
- {
- MyEmpire.SetEntity(myEmpire);
- OtherEmpire.SetEntity(otherEmpire);
- OtherAmbassy.SetEntity(otherAmbassy);
- DiplomaticRelation.SetEntity(relation);
- EmpireMoral.Reset();
- CurrentSurrenderToOtherProposition = -1;
- ForcedOtherToSurrenderProposition = -1;
- TurnNumberAtWhichTimeoutEnds = 0;
- }
- protected override void OnFreeing()
- {
- base.OnFreeing();
- AvailableGrievances.Clear();
- OnGoingDemands.Clear();
- PreviousAIBehaviourState = AIBehaviourState.Unknown;
- CurrentAIBehaviourState = AIBehaviourState.Unknown;
- AIBehaviourStateChangeDate = 0;
- AITransitioningStates = 0;
- AIRapportScore = 0f;
- AISuperiorityScore = 0f;
- AIFeedbackEntries = null;
- AIMoodMessage = AIMoodMessage.None;
- AIMoodMessageTurn = 0;
- AIRelationTendency = RelationTendency.DeterioratingRapidly;
- EmpireMoral.Empty();
- CurrentSurrenderToOtherProposition = -1;
- ForcedOtherToSurrenderProposition = -1;
- CurrentAbilities = DiplomaticAbility.None;
- TurnNumberAtWhichTimeoutEnds = 0;
- HasStalled = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement