public override void ApplyEffectKind(Person person, Event e) { if (person.BelongedFaction == null && person.LocationArchitecture != null) { person.Status = GameObjects.PersonDetail.PersonStatus.Normal; person.ChangeFaction(person.LocationArchitecture.BelongedFaction); } else if (person.LocationArchitecture != null && person.BelongedCaptive != null) { person.ChangeFaction(person.BelongedCaptive.LocationArchitecture.BelongedFaction); } }
public override void ApplyEffectKind(Person person, Event e) { FactionList factionlist = person.Scenario.Factions; Faction targetFaction = factionlist.GetGameObject(targetFactionID) as Faction; /* if (targetFaction != null) { throw new Exception("targetFaction 为" + targetFaction.Name); } */ if (person.BelongedFaction == null && person.LocationArchitecture != null && targetFaction != null) { //person.Status = GameObjects.PersonDetail.PersonStatus.Normal; person.MoveToArchitecture(targetFaction.Capital); person.ChangeFaction(targetFaction); } else if (person.LocationArchitecture != null && person.LocationArchitecture.BelongedFaction != null) { person.MoveToArchitecture(targetFaction.Capital); person.ChangeFaction(targetFaction); //person.ChangeFaction(targetFaction); } }
/* public void shoudongluyong() { this.shoudongluyongshibai = false; this.HireNoFactionPerson(); if (this.shoudongluyongshibai) { this.Scenario.GameScreen.xianshishijiantupian(this.NoFactionPersons[0] as Person, "", "luyongshibai", "", "",true ); } this.shoudongluyongshibai = false; } */ public void ManualHire(Person person) { this.DecreaseFund(this.HirePersonFund); if ((person.BelongedFaction != null) || (person.LocationArchitecture != this)) { //this.NoFactionPerson.Remove(person); this.Scenario.GameScreen.xianshishijiantupian(person, "", "luyongshibai", "", "", true); } else { int idealOffset = Person.GetIdealOffset(person, this.BelongedFaction.Leader); if (GlobalVariables.IdealTendencyValid && idealOffset > person.IdealTendency.Offset + (double)this.BelongedFaction.Reputation / this.BelongedFaction.MaxPossibleReputation * 75) { this.Scenario.GameScreen.xianshishijiantupian(person, "", "LinianButong", "", "", true); } else if ( (!GlobalVariables.IdealTendencyValid || (idealOffset <= person.IdealTendency.Offset + (double)this.BelongedFaction.Reputation / this.BelongedFaction.MaxPossibleReputation * 75)) && (GameObject.Random(idealOffset * idealOffset + 100) < 100) && (!this.BelongedFaction.IsAlien || (int)person.PersonalLoyalty < 2) && (!person.HatedPersons.Contains(this.BelongedFaction.LeaderID)) ) { person.ChangeFaction(this.BelongedFaction); ExtensionInterface.call("HirePerson", new Object[] { this.Scenario, this, person }); this.Scenario.GameScreen.xianshishijiantupian(person, this.Name, "ArchitectureHirePerson", "", "", this.BelongedFaction.Name, false); if (this.HasSpy) { this.CreateHireNewPersonSpyMessage(person); } } else { this.Scenario.GameScreen.xianshishijiantupian(person, "", "luyongshibai", "", "", true); } } this.HireFinished = true; this.HasManualHire = true; }
public void haizichusheng(Person person, Person father, Person muqin, bool doAffect) { person.Available = true; foreach (Treasure treasure in person.Treasures) { treasure.Available = true; } person.LocationArchitecture = muqin.BelongedArchitecture; person.ChangeFaction(muqin.BelongedFaction); if (muqin.IsCaptive) { person.Loyalty = muqin.Loyalty; Captive c = Captive.Create(this, person, muqin.BelongedCaptive.BelongedFaction); } else { if (GlobalVariables.lockChildrenLoyalty && father != null && father.BelongedFaction == person.LocationArchitecture.BelongedFaction) { person.Loyalty = 120; } if (GameObject.Chance(father.childrenLoyaltyRate)) { person.Loyalty = father.childrenLoyalty; } else if (GameObject.Chance(muqin.childrenLoyaltyRate)) { person.Loyalty = muqin.childrenLoyalty; } } if (doAffect) { person.muqinyingxiangnengli(muqin); } if (person.BaseCommand < 1) person.BaseCommand = 1; if (person.BaseStrength < 1) person.BaseStrength = 1; if (person.BaseIntelligence < 1) person.BaseIntelligence = 1; if (person.BasePolitics < 1) person.BasePolitics = 1; if (person.BaseGlamour < 1) person.BaseGlamour = 1; this.GameScreen.haizizhangdachengren(person, person); }
public void haizichusheng(Person person, Person father, Person muqin, bool doAffect) { person.Available = true; foreach (Treasure treasure in person.Treasures) { treasure.Available = true; } person.LocationArchitecture = muqin.BelongedArchitecture; person.ChangeFaction(muqin.BelongedFaction); if (muqin.IsCaptive) { person.Loyalty = muqin.Loyalty; Captive.Create(this, person, muqin.BelongedArchitecture.BelongedFaction); } else { if (GlobalVariables.lockChildrenLoyalty && father != null && father.BelongedFaction == person.LocationArchitecture.BelongedFaction) { person.Loyalty = 120; } if (GameObject.Chance(father.childrenLoyaltyRate)) { person.Loyalty = father.childrenLoyalty; } else if (GameObject.Chance(muqin.childrenLoyaltyRate)) { person.Loyalty = muqin.childrenLoyalty; } } ExtensionInterface.call("ChildrenJoinFaction", new Object[] { this, person }); this.GameScreen.haizizhangdachengren(person, person); }
internal void ConvincePersonSuccess(Person person) { if (this.BelongedFaction == null) //盗贼不能说服武将 { return; } GameObjects.Faction belongedFaction = null; if (person.BelongedFaction != null && this.BelongedFaction!=null) { belongedFaction = person.BelongedFaction; base.Scenario.ChangeDiplomaticRelation(this.BelongedFaction.ID, person.BelongedFaction.ID, -10); if (person.BelongedFaction.Leader.hasStrainTo(person)) { base.Scenario.ChangeDiplomaticRelation(this.BelongedFaction.ID, person.BelongedFaction.ID, -10); } if (person.BelongedFaction.Leader.hasCloseStrainTo(person)) { base.Scenario.ChangeDiplomaticRelation(this.BelongedFaction.ID, person.BelongedFaction.ID, -10); } person.RebelCount++; } Architecture from = null; if (person.IsCaptive) { from = person.BelongedCaptive.LocationArchitecture; person.Status = PersonStatus.Normal; person.BelongedCaptive = null; } else if (person.LocationTroop != null) { from = person.LocationTroop.StartingArchitecture; } else { from = person.LocationArchitecture; } person.ChangeFaction(this.BelongedFaction); if (person.LocationTroop != null) //单挑中说服敌人 { this.ConvincePersonInTroop(person); } else if (from == null) { person.MoveToArchitecture(this.TargetArchitecture, null); } else { person.MoveToArchitecture(this.TargetArchitecture, from.ArchitectureArea.Area[0]); } /*if (!(flag || (person.LocationArchitecture == null))) { person.LocationArchitecture.RemovePerson(person); }*/ this.AddGlamourExperience(40); this.IncreaseReputation(40); this.BelongedFaction.IncreaseReputation(20 * this.MultipleOfTacticsReputation); this.BelongedFaction.IncreaseTechniquePoint((20 * this.MultipleOfTacticsTechniquePoint) * 100); ExtensionInterface.call("DoConvinceSuccess", new Object[] { this.Scenario, this }); if (this.OnConvinceSuccess != null) { this.OnConvinceSuccess(this, person, belongedFaction); } }