Ejemplo n.º 1
0
 public override void ApplyEffectKind(Architecture a, Event e)
 {
     foreach (Military i in a.Militaries)
     {
         i.IncreaseQuantity(increment);
     }
 }
Ejemplo n.º 2
0
 public override void ApplyEffectKind(Architecture a, Event e)
 {
     while (a.Facilities.Count > 0)
     {
         a.DemolishFacility(a.Facilities[0] as Facility);
     }
 }
        public override void PurifyInfluenceKind(Architecture architecture)
        {
            switch (this.type)
            {
                case 0:
                    architecture.RateOfNewBubingMilitaryFundCost += 1 - this.rate;
                    break;

                case 1:
                    architecture.RateOfNewNubingMilitaryFundCost += 1 - this.rate;
                    break;

                case 2:
                    architecture.RateOfNewQibingMilitaryFundCost += 1 - this.rate;
                    break;

                case 3:
                    architecture.RateOfNewShuijunMilitaryFundCost += 1 - this.rate;
                    break;

                case 4:
                    architecture.RateOfNewQixieMilitaryFundCost += 1 - this.rate;
                    break;
            }
        }
Ejemplo n.º 4
0
 public static Military Create(GameScenario scenario, Architecture architecture, MilitaryKind kind)
 {
     Military military = new Military();
     military.Scenario = scenario;
     military.KindID = kind.ID;
     military.ID = scenario.Militaries.GetFreeGameObjectID();
     if (kind.RecruitLimit == 1)
     {
         military.Name = kind.Name;
     }
     else
     {
         military.Name = kind.Name + "队";
     }
     architecture.AddMilitary(military);
     architecture.BelongedFaction.AddMilitary(military);
     scenario.Militaries.AddMilitary(military);
     architecture.DecreaseFund((int) (kind.CreateCost * kind.GetRateOfNewMilitary(architecture)));
     if (kind.IsTransport)
     {
         military.Quantity = kind.MaxScale;
         military.Morale = military.MoraleCeiling;
         military.Combativity = military.CombativityCeiling;
     }
     return military;
 }
Ejemplo n.º 5
0
 public override void PurifyInfluenceKind(Architecture a)
 {
     foreach (LinkNode i in a.AIAllLinkNodes.Values)
     {
         i.A.disasterChanceIncrease[disasterId] -= this.increment;
     }
 }
Ejemplo n.º 6
0
 public override void PurifyInfluenceKind(Architecture p)
 {
     if (p.BelongedFaction != null)
     {
         p.BelongedFaction.techniquePointCostRateDecrease.Remove(this.increment);
     }
 }
Ejemplo n.º 7
0
 public override void PurifyInfluenceKind(Architecture a)
 {
     if (a.disasterDamageRateDecrease.ContainsKey(disasterId))
     {
         a.disasterDamageRateDecrease[disasterId] -= this.increment;
     }
 }
Ejemplo n.º 8
0
 public override void PurifyInfluenceKind(Architecture a)
 {
     if (a.BelongedFaction != null)
     {
         a.BelongedFaction.techniqueReputationRateDecrease.Remove(this.increment);
     }
 }
Ejemplo n.º 9
0
 public void DoWork(Architecture a)
 {
     foreach (Influence influence in this.Kind.Influences.Influences.Values)
     {
         influence.DoWork(a);
     }
 }
Ejemplo n.º 10
0
 public bool ChangeArchitectureData(Architecture a, int X, int Y)
 {
     int x = X / this.TileWidth;
     int y = Y / this.TileHeight;
     System.Drawing.Point point = new System.Drawing.Point(x, y);
     if (a.ArchitectureArea.HasPoint(new Microsoft.Xna.Framework.Point(x, y)))
     {
         return false;
     }
     if (!a.ArchitectureArea.GetContactArea(false).HasPoint(new Microsoft.Xna.Framework.Point(x, y)))
     {
         return false;
     }
     foreach (Architecture architecture in this.Architectures)
     {
         int pointIndex = architecture.ArchitectureArea.GetPointIndex(new Microsoft.Xna.Framework.Point(x, y));
         if (pointIndex >= 0)
         {
             architecture.ArchitectureArea.Area.RemoveAt(pointIndex);
             if (pointIndex == 0)
             {
                 this.Architectures.Remove(architecture);
             }
             break;
         }
     }
     a.ArchitectureArea.AddPoint(new Microsoft.Xna.Framework.Point(x, y));
     return true;
 }
Ejemplo n.º 11
0
 public void ApplyInfluenceKind(Architecture architecture, Influence i, Applier applier, int applierID)
 {
     if (this.Type == InfluenceType.建筑 || this.Type == InfluenceType.建筑战斗)
     {
         ApplyInfluenceKind(architecture);
     } 
     else if (this.Type == InfluenceType.个人)
     {
         foreach (Person p in architecture.Persons)
         {
             ApplyingPerson a = new ApplyingPerson(p, applier, applierID);
             if (!i.appliedPerson.Contains(a))
             {
                 i.appliedPerson.Add(a);
                 ApplyInfluenceKind(p, i, applier, applierID, false);
             }
         }
         foreach (Person p in architecture.MovingPersons)
         {
             ApplyingPerson a = new ApplyingPerson(p, applier, applierID);
             if (!i.appliedPerson.Contains(a))
             {
                 i.appliedPerson.Add(a);
                 ApplyInfluenceKind(p, i, applier, applierID, false);
             }
         }
     }
 }
Ejemplo n.º 12
0
        public bool checkConditions(Architecture a)
        {
            if (this.happened && !this.repeatable) return false;
            if (GameObject.Random(this.happenChance) != 0)
            {
                return false;
            }

            if (this.AfterEventHappened >= 0)
            {
                if (!(base.Scenario.AllEvents.GetGameObject(this.AfterEventHappened) as Event).happened)
                {
                    return false;
                }
            }

            foreach (Condition i in this.architectureCond)
            {
                if (!i.CheckCondition(a, this))
                {
                    return false;
                }
            }

            foreach (Condition i in this.factionCond)
            {
                if (!i.CheckCondition(a.BelongedFaction, this))
                {
                    return false;
                }
            }

            return this.matchEventPersons(a);
        }
Ejemplo n.º 13
0
 public bool CheckCondition(Architecture architecture)
 {
     if (this.Kind == null) return false;
     this.Kind.InitializeParameter(this.Parameter);
     this.Kind.InitializeParameter2(this.Parameter2);
     return this.Kind.CheckConditionKind(architecture);
 }
Ejemplo n.º 14
0
 public virtual void ApplyEffectKind(Architecture architecture, Event e)
 {
     foreach (Person p in architecture.Persons)
     {
         this.ApplyEffectKind(p, e);
     }
 }
Ejemplo n.º 15
0
 public override void ApplyInfluenceKind(Architecture p)
 {
     if (p.BelongedFaction != null)
     {
         p.BelongedFaction.techniqueTimeRateDecrease.Add(this.increment);
     }
 }
Ejemplo n.º 16
0
 public override void ApplyInfluenceKind(Architecture a)
 {
     if (rate > a.facilityConstructionTimeRateDecrease)
     {
         a.facilityConstructionTimeRateDecrease = rate;
     }
 }
        public override void ArchitectureBeginRecentlyAttacked(Architecture architecture)
        {
            if (base.Scenario.IsCurrentPlayer(architecture.BelongedFaction) && architecture.BelongedFaction != null)
            {
                Person reporter = architecture.Advisor;
                if (reporter == null)
                {
                    reporter = architecture.BelongedFaction.Leader;
                }

                this.Plugins.tupianwenziPlugin.SetPosition(ShowPosition.Bottom);
                this.Plugins.tupianwenziPlugin.SetGameObjectBranch(reporter, architecture, TextMessageKind.ArchitectureUnderAttack, "ArchitectureBeginRecentlyAttacked", "zaoshougongji.jpg", "");
                this.Plugins.tupianwenziPlugin.IsShowing = true;
                /*architecture.BelongedFaction.Leader.TextResultString = architecture.Name;
                architecture.BelongedFaction.TextResultString = architecture.Name;
                this.xianshishijiantupian(architecture.BelongedFaction.Leader, architecture.BelongedFaction.Leader.TextResultString, "ArchitectureBeginRecentlyAttacked", "zaoshougongji.jpg", "", false);
                */
                architecture.BelongedFaction.TextResultString = architecture.Name;
                this.Plugins.GameRecordPlugin.AddBranch(architecture.BelongedFaction, "zaoshougongji", architecture.Position);
                if (architecture.BelongedFaction.StopToControl)
                {
                    this.Plugins.DateRunnerPlugin.Pause();
                    architecture.BelongedFaction.StopToControl = false;

                }
            }
        }
Ejemplo n.º 18
0
 public void ApplyInfluence(Architecture architecture, Applier applier, int applierID)
 {
     foreach (Influence influence in this.Influences.Values)
     {
         influence.ApplyInfluence(architecture, applier, applierID);
     }
 }
Ejemplo n.º 19
0
        public override void PurifyInfluenceKind(Architecture architecture)
        {
            switch (this.type)
            {
                case 0:
                    architecture.RateIncrementOfNewBubingTroopOffence -= this.rate;
                    break;

                case 1:
                    architecture.RateIncrementOfNewNubingTroopOffence -= this.rate;
                    break;

                case 2:
                    architecture.RateIncrementOfNewQibingTroopOffence -= this.rate;
                    break;

                case 3:
                    architecture.RateIncrementOfNewShuijunTroopOffence -= this.rate;
                    break;

                case 4:
                    architecture.RateIncrementOfNewQixieTroopOffence -= this.rate;
                    break;
            }
        }
Ejemplo n.º 20
0
        public void ApplyEventDialogs(Architecture a)
        {
            this.Scenario = a.Scenario;
            if (this.OnApplyEvent != null)
            {
                this.OnApplyEvent(this, a);
            }
            if (nextScenario.Length > 0)
            {
                base.Scenario.EnableLoadAndSave = false;

                List<int> factionIds = new List<int>();
                foreach (Faction f in this.Scenario.PlayerFactions) 
                {
                    factionIds.Add(f.ID);
                }

                OleDbConnectionStringBuilder builder = new OleDbConnectionStringBuilder
                {
                    DataSource = "GameData/Scenario/" + nextScenario,
                    Provider = "Microsoft.Jet.OLEDB.4.0"
                };
                this.Scenario.LoadGameScenarioFromDatabase(builder.ConnectionString, factionIds);

                this.Scenario.GameScreen.ReloadScreenData();

                base.Scenario.EnableLoadAndSave = true;
            }
        }
Ejemplo n.º 21
0
 public virtual bool CheckConditionKind(Architecture architecture)
 {
     if (this.ID >= 3000 && this.ID < 4000)
     {
         return architecture.BelongedFaction != null && this.CheckConditionKind(architecture.BelongedFaction);
     }
     return false;
 }
Ejemplo n.º 22
0
 public void ApplyEventDialogs(Architecture a)
 {
     this.Scenario = a.Scenario;
     if (this.OnApplyEvent != null)
     {
         this.OnApplyEvent(this, a);
     }
 }
Ejemplo n.º 23
0
 public override void renwukaishitishi(Person person, Architecture architecture)
 {
     if (base.Scenario.IsCurrentPlayer(person.BelongedFaction))
     {
         person.TextResultString = architecture.Name;
         this.Plugins.GameRecordPlugin.AddBranch(person, "PersonTravel", architecture.Position);
     }
 }
Ejemplo n.º 24
0
 public override void ApplyEffectKind(Architecture a, Event e)
 {
     a.zainan.shengyutianshu += id;
     if (a.zainan.shengyutianshu <= 0)
     {
         a.youzainan = false;
         a.tingzhizhenzai();
     }
 }
Ejemplo n.º 25
0
 public override bool CheckConditionKind(Architecture architecture)
 {
     int result = 0;
     foreach (Person p in architecture.Persons)
     {
         result += p.TreasureCount;
     }
     return result < number;
 }
Ejemplo n.º 26
0
 public override void DoWork(Architecture architecture)
 {
     foreach (Military military in architecture.Militaries)
     {
         if ((military.Kind.ID == this.kind) && (military.InjuryQuantity == 0))
         {
             architecture.RecruitmentMilitary(military, this.rate);
         }
     }
 }
Ejemplo n.º 27
0
 public override void ApplyEffectKind(Architecture a, Event e)
 {
     foreach (Military i in a.Militaries)
     {
         if (i.KindID == mType)
         {
             i.IncreaseCombativity(increment);
         }
     }
 }
Ejemplo n.º 28
0
 public override void ApplyEffectKind(Architecture a, Event e)
 {
     a.zainan.zainanzhonglei = base.Scenario.GameCommonData.suoyouzainanzhonglei.Getzainanzhonglei(id);
     a.zainan.shengyutianshu = a.zainan.zainanzhonglei.shijianxiaxian + GameObject.Random(a.zainan.zainanzhonglei.shijianshangxian - a.zainan.zainanzhonglei.shijianxiaxian);
     a.youzainan = true;
     foreach (Military military in a.Militaries)//发生灾难时不能补充
     {
         military.StopRecruitment();
     }
 }
Ejemplo n.º 29
0
 public override void PurifyInfluenceKind(Architecture architecture)
 {
     foreach (Microsoft.Xna.Framework.Point point in architecture.ViewArea.Area)
     {
         Troop troopByPosition = base.Scenario.GetTroopByPosition(point);
         if ((troopByPosition != null) && !architecture.IsFriendly(troopByPosition.BelongedFaction))
         {
             troopByPosition.DecreaseCombativity(this.decrement);
         }
     }
 }
Ejemplo n.º 30
0
 public override void ApplyInfluenceKind(Architecture architecture)
 {
     foreach (Microsoft.Xna.Framework.Point point in architecture.ViewArea.Area)
     {
         Troop troopByPosition = base.Scenario.GetTroopByPosition(point);
         if ((troopByPosition != null) && !architecture.IsFriendly(troopByPosition.BelongedFaction))
         {
             troopByPosition.ChanceDecrementOfStratagem += this.decrement;
         }
     }
 }