public ActionResult Create([Bind(Include = "Id,Keyword,MaxScore,Type,JudgeNotes,Published,Collapsible")] Stunt stunt) { if (ModelState.IsValid) { // Créer une traduction par défaut et rediriger var st = new StuntTranslation(); stunt.Translations = new Collection <StuntTranslation>() { st }; db.Stunts.Add(stunt); db.SaveChanges(); // Il faut aussi l'ajouter/assigner aux équipes déjà inscrites foreach (var team in db.Teams) { var ts = new TeamStunt() { Stunt = stunt, Team = team }; db.TeamStunts.Add(ts); } db.SaveChanges(); return(RedirectToAction("Edit", "StuntTranslation", new { id = st.Id })); } return(View(stunt)); }
public static Stunt Globalize(this Stunt stunt, string language) { // Are there any translation available? if (!stunt.Translations.Any()) { return(stunt); } var translation = stunt.Translations.SingleOrDefault(x => language.StartsWith(x.Language)); // Fallback to English if (translation == null) { translation = stunt.Translations.FirstOrDefault(x => x.Language == "en"); } // If translation is still null here, it's beacause English is not part of the provided languages if (translation == null) { return(stunt); } stunt.Title = translation.Title; stunt.Description = translation.Description; return(stunt); }
public ActionResult DeleteConfirmed(int id) { Stunt stunt = db.Stunts.Find(id); db.Stunts.Remove(stunt); db.SaveChanges(); return(RedirectToAction("IndexAdmin")); }
public void WhenFakingFormatterThenCanInvokeIt() { var stunt1 = Stunt.Of <ICustomFormatter>(); var stunt2 = Stunt.Of <ICustomFormatter>(); var result1 = stunt1.Format("Hello {0}", "World", null); var result2 = stunt2.Format("Hello {0}", "World", null); }
private Message GetStuntData(Stunt stunt) { var message = new StuntDataMessage(); message.characterID = stunt.Belong == null ? "" : stunt.Belong.ID; message.stuntID = stunt.ID; return(message); }
//Use this to duplicate a stunt public Stunt(Stunt oldStunt) { name = oldStunt.name; rotationAxis = oldStunt.rotationAxis; precision = oldStunt.precision; scoreRate = oldStunt.scoreRate; angleThreshold = oldStunt.angleThreshold; multiplier = oldStunt.multiplier; boostAdd = oldStunt.boostAdd; }
public ActionResult Edit([Bind(Include = "Id,Keyword,MaxScore,Type,JudgeNotes,Published,Collapsible")] Stunt stunt) { if (ModelState.IsValid) { db.Entry(stunt).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("IndexAdmin")); } return(View(stunt)); }
public void DisplayUsingStunt(SceneObject sceneObject, Stunt stunt) { if (!_isUsing) { return; } var message = new BattleSceneDisplayUsingStuntMessage(); message.obj = StreamableFactory.CreateBattleSceneObject(sceneObject); message.stunt = StreamableFactory.CreateCharacterPropertyDescription(stunt); _connection.SendMessage(message); }
public void CanVerifyLooseMockDelegateWithNoReturnValue() { var recorder = new RecordingBehavior(); var stunt = Stunt.Of <Action <int> >(); stunt.AddBehavior(recorder); stunt.AddBehavior((invocation, next) => invocation.CreateValueReturn(null, invocation.Arguments)); stunt(3); Assert.Single(recorder.Invocations); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Stunt stunt = db.Stunts.Find(id); if (stunt == null) { return(HttpNotFound()); } return(View(stunt)); }
public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Stunt stunt = db.Stunts.Find(id); if (stunt == null) { return(HttpNotFound()); } return(View(stunt.Globalize(Language))); }
public void PassiveUseStunt(Stunt stunt) { if (stunt.Belong != SkillChecker.Instance.Passive) { throw new ArgumentException("This stunt is not belong to passive character.", nameof(stunt)); } /* * if (stunt.NeedDMCheck) * Game.DM.DMClient.RequestDMCheck(SkillChecker.Instance.Passive.Controller, * SkillChecker.Instance.Passive.Name + "对" + SkillChecker.Instance.Initiative.Name + "使用" + stunt.Name + ",可以吗?", * result => { if (result) stunt.Effect.TakeEffect(); }); * else stunt.Effect.TakeEffect(); */ }
public override void PersonStudyStuntFinished(Person person, Stunt stunt, bool success) { if (((base.Scenario.CurrentPlayer == null) || base.Scenario.IsCurrentPlayer(person.BelongedFaction)) || GlobalVariables.SkyEye) { person.TextDestinationString = stunt.Name; this.Plugins.PersonTextDialogPlugin.SetPosition(ShowPosition.Bottom); if (success) { this.Plugins.PersonTextDialogPlugin.SetGameObjectBranch(person, person, "PersonStudyStuntSuccess"); } else { this.Plugins.PersonTextDialogPlugin.SetGameObjectBranch(person, person, "PersonStudyStuntFailed"); } this.Plugins.PersonTextDialogPlugin.IsShowing = true; } }
public void WhenFakingFormatterThenCanInvokeIt() { var stunt1 = Stunt.Of <ICustomFormatter, IDisposable>(); var stunt2 = Stunt.Of <ICustomFormatter>(); stunt1.AddBehavior(new DefaultValueBehavior()); stunt1.InsertBehavior(0, (m, n) => m.CreateValueReturn(string.Format((string)m.Arguments[0], m.Arguments.Skip(1).ToArray())), m => m.MethodBase.Name == nameof(ICustomFormatter.Format), "Format"); stunt2.AddBehavior(new DefaultValueBehavior()); var result1 = stunt1.Format("Hello {0}", "World", null); var result2 = stunt2.Format("Hello {0}", "World", null); Console.WriteLine(result1); Console.WriteLine(result2); var bar = Stunt.Of <IBar>(); }
private void person_OnStudyStuntFinished(Person person, Stunt stunt, bool success) { person.Scenario.GameScreen.PersonStudyStuntFinished(person, stunt, success); }
public override void MessageReceived(Message message) { if (!_isUsing) { return; } var container = BattleSceneContainer.Instance; try { switch (message.MessageType) { case BattleSceneActableObjectMoveMessage.MESSAGE_TYPE: { var msg = (BattleSceneActableObjectMoveMessage)message; if (container.IsChecking) { return; } if (!_canOperate || container.CurrentActable.CharacterRef.Controller != _owner) { return; } container.CurrentActable.MoveTo(msg.dst.row, msg.dst.col, msg.dst.highland); } break; case BattleSceneTakeExtraMovePointMessage.MESSAGE_TYPE: { if (container.IsChecking) { return; } if (!_canOperate || container.CurrentActable.CharacterRef.Controller != _owner) { return; } container.CurrentActable.TakeExtraMove(); } break; case BattleSceneActableObjectDoActionMessage.MESSAGE_TYPE: { if (container.IsChecking) { return; } if (!_canOperate || container.CurrentActable.CharacterRef.Controller != _owner) { return; } var msg = (BattleSceneActableObjectDoActionMessage)message; if (msg.isStunt) { Stunt selectedStunt = container.CurrentActable.CharacterRef.FindStuntByID(msg.skillTypeOrStuntID); List <SceneObject> targets = new List <SceneObject>(); foreach (var msgTarget in msg.targets) { var target = container.FindObject(msgTarget); if (target != null) { targets.Add(target); } } if (selectedStunt != null) { container.CurrentActable.UseStunt(selectedStunt, msg.action, msg.dstCenter, targets); } } else { var skillType = SkillType.SkillTypes[msg.skillTypeOrStuntID]; List <SceneObject> targets = new List <SceneObject>(); foreach (var msgTarget in msg.targets) { var target = container.FindObject(msgTarget); if (target != null) { targets.Add(target); } } container.CurrentActable.UseSkill(skillType, msg.action, msg.dstCenter, targets); } } break; case BattleSceneActableObjectDoInteractMessage.MESSAGE_TYPE: { if (container.IsChecking) { return; } if (!_canOperate || container.CurrentActable.CharacterRef.Controller != _owner) { return; } var msg = (BattleSceneActableObjectDoInteractMessage)message; if (msg.isStunt) { Stunt selectedStunt = container.CurrentActable.CharacterRef.FindStuntByID(msg.skillTypeOrStuntID); List <SceneObject> targets = new List <SceneObject>(); foreach (var msgTarget in msg.targets) { var target = container.FindObject(msgTarget); if (target != null) { targets.Add(target); } } if (selectedStunt != null) { container.CurrentActable.UseStuntOnInteract(selectedStunt, msg.dstCenter, targets); } } else { var skillType = SkillType.SkillTypes[msg.skillTypeOrStuntID]; List <SceneObject> targets = new List <SceneObject>(); foreach (var msgTarget in msg.targets) { var target = container.FindObject(msgTarget); if (target != null) { targets.Add(target); } } container.CurrentActable.UseSkillOnInteract(skillType, msg.dstCenter, targets); } } break; case BattleSceneSetSkipSelectAspectMessage.MESSAGE_TYPE: { var msg = (BattleSceneSetSkipSelectAspectMessage)message; _skipSelectAspect = msg.val; } break; case CheckerSkillSelectedMessage.MESSAGE_TYPE: { var msg = (CheckerSkillSelectedMessage)message; if (!container.IsChecking) { return; } if (SkillChecker.Instance.State == SkillChecker.CheckerState.PASSIVE_SKILL && container.CurrentPassive.CharacterRef.Controller == _owner) { var selectedSkillType = SkillType.SkillTypes[msg.skillTypeID]; container.CurrentPassiveUseSkill(selectedSkillType); } } break; case CheckerStuntSelectedMessage.MESSAGE_TYPE: { var msg = (CheckerStuntSelectedMessage)message; if (!container.IsChecking) { return; } if (SkillChecker.Instance.State == SkillChecker.CheckerState.PASSIVE_SKILL && container.CurrentPassive.CharacterRef.Controller == _owner) { var stunt = container.CurrentPassive.CharacterRef.FindStuntByID(msg.stuntID); if (stunt != null) { container.CurrentPassiveUseStunt(stunt); } } } break; case CheckerAspectSelectedMessage.MESSAGE_TYPE: { var msg = (CheckerAspectSelectedMessage)message; if (!container.IsChecking) { return; } if (SkillChecker.Instance.State == SkillChecker.CheckerState.INITIATIVE_ASPECT && container.Initiative.CharacterRef.Controller == _owner) { var gridObj = container.FindObject(msg.characterID); Aspect aspect; if (msg.isConsequence) { aspect = gridObj.CharacterRef.FindConsequenceByID(msg.aspectID); } else { aspect = gridObj.CharacterRef.FindAspectByID(msg.aspectID); } container.InitiativeSelectAspect(aspect, msg.reroll); } else if (SkillChecker.Instance.State == SkillChecker.CheckerState.PASSIVE_ASPECT && container.CurrentPassive.CharacterRef.Controller == _owner) { var gridObj = container.FindObject(msg.characterID); Aspect aspect; if (msg.isConsequence) { aspect = gridObj.CharacterRef.FindConsequenceByID(msg.aspectID); } else { aspect = gridObj.CharacterRef.FindAspectByID(msg.aspectID); } container.CurrentPassiveSelectAspect(aspect, msg.reroll); } } break; case SelectAspectOverMessage.MESSAGE_TYPE: { var msg = (SelectAspectOverMessage)message; if (!container.IsChecking) { return; } if (SkillChecker.Instance.State == SkillChecker.CheckerState.INITIATIVE_ASPECT && container.Initiative.CharacterRef.Controller == _owner) { container.InitiativeAspectSelectionOver(); } else if (SkillChecker.Instance.State == SkillChecker.CheckerState.PASSIVE_ASPECT && container.CurrentPassive.CharacterRef.Controller == _owner) { container.CurrentPassiveAspectSelectionOver(); } } break; case BattleSceneTurnOverMessage.MESSAGE_TYPE: { if (container.IsChecking) { return; } if (!_canOperate || container.CurrentActable.CharacterRef.Controller != _owner) { return; } container.CurrentTurnOver(); } break; default: break; } } catch (Exception e) { Logger.WriteLine(e.Message); } }
private void troop_OnApplyStunt(Troop troop, Stunt stunt) { Session.MainGame.mainGameScreen.TroopApplyStunt(troop, stunt); }
private void screen_OnMouseMove(Point position, bool leftDown) { bool flag = false; if (!flag && StaticMethods.PointInRectangle(position, this.TitleDisplayPosition) && this.TitleText.RowHeight > 0) { int num2 = (position.Y - this.TitleText.DisplayOffset.Y) / this.TitleText.RowHeight; if (num2 >= 0) { int num3 = num2; if (this.ShowingPerson.Titles.Count > num3) { Title title = this.ShowingPerson.Titles[num3] as Title; if (title != null) { if (this.current != title) { this.BiographyText.Clear(); this.InfluenceText.Clear(); //阿柒:增加根据称号等级设定不同字体颜色 Color titleColor = Color.White; if (title.Level < 4) { titleColor = Color.AliceBlue; } else if (title.Level >= 4 && title.Level < 7) { titleColor = Color.YellowGreen; } else if (title.Level >= 7 && title.Level < 10) { titleColor = Color.LightSkyBlue; } else if (title.Level >= 10 && title.Level < 13) { titleColor = Color.Violet; } else { titleColor = Color.Orange; } this.InfluenceText.AddText(title.DetailedName, titleColor); this.InfluenceText.AddNewLine(); foreach (Influence influence in title.Influences.Influences.Values) { //阿柒:根据影响种类设定不同颜色 if (influence.Kind.ID == 280 || influence.Kind.ID == 281 || influence.Kind.ID == 285 || influence.Kind.ID == 290 || influence.Kind.ID == 300) { this.InfluenceText.AddText(influence.Description, Color.Moccasin); } else { this.InfluenceText.AddText(influence.Description); } this.InfluenceText.AddNewLine(); } this.InfluenceText.ResortTexts(); this.ConditionText.Clear(); this.ConditionText.AddText("修习条件", this.ConditionText.TitleColor); this.ConditionText.AddNewLine(); foreach (Condition condition in title.Conditions.Conditions.Values) { if (condition.CheckCondition(this.ShowingPerson)) { this.ConditionText.AddText(condition.Name, this.ConditionText.PositiveColor); } else { this.ConditionText.AddText(condition.Name, this.ConditionText.NegativeColor); } this.ConditionText.AddNewLine(); } foreach (Condition condition in title.ArchitectureConditions.Conditions.Values) { if (this.ShowingPerson.LocationArchitecture != null && condition.CheckCondition(this.ShowingPerson.LocationArchitecture)) { this.ConditionText.AddText(condition.Name, this.ConditionText.PositiveColor); } else { this.ConditionText.AddText(condition.Name, this.ConditionText.NegativeColor); } this.ConditionText.AddNewLine(); } foreach (Condition condition in title.FactionConditions.Conditions.Values) { if (this.ShowingPerson.BelongedFaction != null && condition.CheckCondition(this.ShowingPerson.BelongedFaction)) { this.ConditionText.AddText(condition.Name, this.ConditionText.PositiveColor); } else { this.ConditionText.AddText(condition.Name, this.ConditionText.NegativeColor); } this.ConditionText.AddNewLine(); } this.ConditionText.ResortTexts(); this.current = title; } flag = true; } } } } /* if (!flag && StaticMethods.PointInRectangle(position, this.GuanzhiDisplayPosition)) * { * int num2 = (position.Y - this.GuanzhiText.DisplayOffset.Y / this.GuanzhiText.RowHeight); * if (num2 > 1) * { * int num3 = num2 - 2; * if (this.ShowingPerson.Guanzhis.Count > num3) * { * Guanzhi guanzhi = this.ShowingPerson.Guanzhis[num3] as Guanzhi; * if (guanzhi != null) * { * if (this.current != guanzhi) * { * this.BiographyText.Clear(); * this.InfluenceText.Clear(); * this.InfluenceText.AddText(guanzhi.DetailedName, this.InfluenceText.TitleColor); * this.InfluenceText.AddNewLine(); * foreach (Influence influence in guanzhi.Influences.Influences.Values) * { * this.InfluenceText.AddText(influence.Description); * this.InfluenceText.AddNewLine(); * } * this.InfluenceText.ResortTexts(); * this.ConditionText.Clear(); * this.ConditionText.AddText("授予条件", this.ConditionText.TitleColor); * this.ConditionText.AddNewLine(); * foreach (Condition condition in guanzhi.Conditions.Conditions.Values) * { * if (condition.CheckCondition(this.ShowingPerson)) * { * this.ConditionText.AddText(condition.Name, this.ConditionText.PositiveColor); * } * else * { * this.ConditionText.AddText(condition.Name, this.ConditionText.NegativeColor); * } * this.ConditionText.AddNewLine(); * } * foreach (Condition condition in guanzhi.LoseConditions.Conditions.Values) * { * if (condition.CheckCondition(this.ShowingPerson)) * { * this.ConditionText.AddText(condition.Name, this.ConditionText.PositiveColor); * } * else * { * this.ConditionText.AddText(condition.Name, this.ConditionText.NegativeColor); * } * this.ConditionText.AddNewLine(); * } * foreach (Condition condition in guanzhi.FactionConditions.Conditions.Values) * { * if (this.ShowingPerson.BelongedFaction != null && condition.CheckCondition(this.ShowingPerson.BelongedFaction)) * { * this.ConditionText.AddText(condition.Name, this.ConditionText.PositiveColor); * } * else * { * this.ConditionText.AddText(condition.Name, this.ConditionText.NegativeColor); * } * this.ConditionText.AddNewLine(); * } * * this.ConditionText.ResortTexts(); * this.current = guanzhi; * } * flag = true; * } * } * } * }*/ if (!flag && StaticMethods.PointInRectangle(position, this.StuntDisplayPosition) && this.StuntText.RowHeight > 0) { int num2 = (position.Y - this.StuntText.DisplayOffset.Y) / this.StuntText.RowHeight; if (num2 > -1) { int num3 = num2; if (this.ShowingPerson.Stunts.Count > num3) { Stunt stunt = this.ShowingPerson.Stunts.GetStuntList()[num3] as Stunt; if (stunt != null) { if (this.current != stunt) { this.BiographyText.Clear(); this.InfluenceText.Clear(); this.InfluenceText.AddText("战斗特技", this.InfluenceText.TitleColor); this.InfluenceText.AddText(stunt.Name, this.InfluenceText.SubTitleColor); this.InfluenceText.AddNewLine(); this.InfluenceText.AddText("持续天数", this.InfluenceText.SubTitleColor2); this.InfluenceText.AddText((stunt.Period * Session.Parameters.DayInTurn).ToString(), this.InfluenceText.SubTitleColor3); this.InfluenceText.AddText("天", this.InfluenceText.SubTitleColor2); this.InfluenceText.AddNewLine(); foreach (Influence influence in stunt.Influences.Influences.Values) { this.InfluenceText.AddText(influence.Description); this.InfluenceText.AddNewLine(); } this.InfluenceText.ResortTexts(); this.ConditionText.Clear(); this.ConditionText.AddText("使用条件", this.ConditionText.TitleColor); this.ConditionText.AddNewLine(); if ((this.ShowingPerson.LocationTroop != null) && (this.ShowingPerson == this.ShowingPerson.LocationTroop.Leader)) { foreach (Condition condition in stunt.CastConditions.Conditions.Values) { if (condition.CheckCondition(this.ShowingPerson.LocationTroop)) { this.ConditionText.AddText(condition.Name, this.ConditionText.PositiveColor); } else { this.ConditionText.AddText(condition.Name, this.ConditionText.NegativeColor); } this.ConditionText.AddNewLine(); } } else { foreach (Condition condition in stunt.CastConditions.Conditions.Values) { this.ConditionText.AddText(condition.Name); this.ConditionText.AddNewLine(); } } this.ConditionText.AddNewLine(); this.ConditionText.AddText("修习条件", this.ConditionText.SubTitleColor); this.ConditionText.AddNewLine(); foreach (Condition condition in stunt.LearnConditions.Conditions.Values) { if (condition.CheckCondition(this.ShowingPerson)) { this.ConditionText.AddText(condition.Name, this.ConditionText.PositiveColor); } else { this.ConditionText.AddText(condition.Name, this.ConditionText.NegativeColor); } this.ConditionText.AddNewLine(); } this.ConditionText.ResortTexts(); this.current = stunt; } flag = true; } } } } if (!flag) { for (int i = 0; i < this.AllSkillTexts.Count; i++) { if (StaticMethods.PointInRectangle(position, this.AllSkillTexts[i].AlignedPosition)) { if (this.current != this.LinkedSkills[i]) { this.BiographyText.Clear(); this.InfluenceText.Clear(); if (this.LinkedSkills[i].InfluenceCount > 0) { this.InfluenceText.AddText("技能", this.InfluenceText.TitleColor); this.InfluenceText.AddText(this.LinkedSkills[i].Name, this.InfluenceText.SubTitleColor); this.InfluenceText.AddNewLine(); foreach (Influence influence in this.LinkedSkills[i].Influences.Influences.Values) { //阿柒:根据影响种类设定不同颜色 if (influence.Kind.ID == 280 || influence.Kind.ID == 281 || influence.Kind.ID == 285 || influence.Kind.ID == 290 || influence.Kind.ID == 300) { this.InfluenceText.AddText(influence.Description, Color.Moccasin); } else { this.InfluenceText.AddText(influence.Description); } this.InfluenceText.AddNewLine(); } this.InfluenceText.ResortTexts(); this.ConditionText.Clear(); this.ConditionText.AddText("修习条件", this.ConditionText.TitleColor); this.ConditionText.AddNewLine(); foreach (Condition condition in this.LinkedSkills[i].Conditions.Conditions.Values) { if (condition.CheckCondition(this.ShowingPerson)) { this.ConditionText.AddText(condition.Name, this.ConditionText.PositiveColor); } else { this.ConditionText.AddText(condition.Name, this.ConditionText.NegativeColor); } this.ConditionText.AddNewLine(); } this.ConditionText.ResortTexts(); } this.current = this.LinkedSkills[i]; } flag = true; break; } } } if (!flag) { if (this.current != null) { this.current = null; this.InfluenceText.Clear(); this.ConditionText.Clear(); if (this.ShowingPerson.PersonBiography != null) { this.BiographyText.Clear(); this.BiographyText.AddText("列传", this.BiographyText.TitleColor); this.BiographyText.AddNewLine(); this.BiographyText.AddText(this.ShowingPerson.PersonBiography.Brief); this.BiographyText.AddNewLine(); this.BiographyText.AddText("演义", this.BiographyText.SubTitleColor); this.BiographyText.AddNewLine(); this.BiographyText.AddText(this.ShowingPerson.PersonBiography.Romance); this.BiographyText.AddNewLine(); this.BiographyText.AddText("历史", this.BiographyText.SubTitleColor2); this.BiographyText.AddNewLine(); this.BiographyText.AddText(this.ShowingPerson.PersonBiography.History); this.BiographyText.AddNewLine(); this.BiographyText.AddText("剧本", this.BiographyText.SubTitleColor2); this.BiographyText.AddText(":"); String[] lineBrokenText = ShowingPerson.PersonBiography.InGame.Split('\n'); foreach (String s in lineBrokenText) { this.BiographyText.AddText(s); this.BiographyText.AddNewLine(); } this.BiographyText.ResortTexts(); } } } }
public void Configure() { // var instance = new MyClass(); var cloneable = Stunt.Of <ICloneable>(); }
internal void SetTroop(Troop troop) { bool leader; this.ShowingTroop = troop; this.TroopNameText.Text = troop.DisplayName; List <LabelText> .Enumerator enumerator = this.LabelTexts.GetEnumerator(); try { while (true) { leader = enumerator.MoveNext(); if (!leader) { break; } LabelText current = enumerator.Current; current.Text.Text = StaticMethods.GetPropertyValue(troop, current.PropertyName).ToString(); } } finally { enumerator.Dispose(); } this.OtherPersonText.AddText("其他人物", Color.Yellow); this.OtherPersonText.AddNewLine(); int personCount = troop.PersonCount - 1; this.OtherPersonText.AddText(string.Concat(personCount.ToString(), "人"), Color.Lime); this.OtherPersonText.AddNewLine(); IEnumerator enumerator1 = troop.Persons.GetEnumerator(); try { while (true) { leader = enumerator1.MoveNext(); if (!leader) { break; } Person person = (Person)enumerator1.Current; leader = person != troop.Leader; if (leader) { this.OtherPersonText.AddText(person.Name); this.OtherPersonText.AddNewLine(); } } } finally { IDisposable disposable = enumerator1 as IDisposable; leader = disposable == null; if (!leader) { disposable.Dispose(); } } this.OtherPersonText.ResortTexts(); this.CombatMethodText.AddText("部队战法", Color.Yellow); this.CombatMethodText.AddNewLine(); personCount = troop.CombatMethods.Count; this.CombatMethodText.AddText(string.Concat(personCount.ToString(), "种"), Color.Lime); this.CombatMethodText.AddNewLine(); Dictionary <int, CombatMethod> .ValueCollection.Enumerator enumerator2 = troop.CombatMethods.CombatMethods.Values.GetEnumerator(); try { while (true) { leader = enumerator2.MoveNext(); if (!leader) { break; } CombatMethod combatMethod = enumerator2.Current; this.CombatMethodText.AddText(combatMethod.Name, Color.Red); personCount = combatMethod.Combativity - troop.DecrementOfCombatMethodCombativityConsuming; this.CombatMethodText.AddText(string.Concat(" 战意消耗", personCount.ToString()), Color.LightGreen); this.CombatMethodText.AddNewLine(); } } finally { enumerator2.Dispose(); } this.CombatMethodText.ResortTexts(); this.StuntText.AddText("部队特技", Color.Yellow); this.StuntText.AddNewLine(); personCount = troop.Stunts.Count; this.StuntText.AddText(string.Concat(personCount.ToString(), "种"), Color.Lime); this.StuntText.AddNewLine(); Dictionary <int, Stunt> .ValueCollection.Enumerator enumerator3 = troop.Stunts.Stunts.Values.GetEnumerator(); try { while (true) { leader = enumerator3.MoveNext(); if (!leader) { break; } Stunt stunt = enumerator3.Current; this.StuntText.AddText(stunt.Name, Color.Red); personCount = stunt.Combativity; this.StuntText.AddText(string.Concat(" 战意消耗", personCount.ToString()), Color.LightGreen); this.StuntText.AddNewLine(); } } finally { enumerator3.Dispose(); } this.StuntText.ResortTexts(); this.InfluenceText.AddText("部队特性", Color.Yellow); this.InfluenceText.AddNewLine(); this.InfluenceText.AddText(this.ShowingTroop.Army.Kind.Name, Color.Lime); this.InfluenceText.AddNewLine(); Dictionary <int, Influence> .ValueCollection.Enumerator enumerator4 = this.ShowingTroop.Army.Kind.Influences.Influences.Values.GetEnumerator(); try { while (true) { leader = enumerator4.MoveNext(); if (!leader) { break; } Influence influence = enumerator4.Current; this.InfluenceText.AddText(influence.Name, Color.Red); this.InfluenceText.AddText(influence.Description, Color.LightGreen); this.InfluenceText.AddNewLine(); } } finally { enumerator4.Dispose(); } this.InfluenceText.ResortTexts(); }
public void WhenFakingCalculatorBase() { var fake = Stunt.Of <CalculatorBase>(); }
public static T Of <T>() => Stunt.Of <T>() .AddBehavior( (invocation, next) => invocation.CreateValueReturn(random.Next()), invocation => invocation.MethodBase is MethodInfo info && info.ReturnType == typeof(int));
public void CanCreateDelegateStunt() => Stunt.Of <EventHandler>();
public virtual void PersonStudyStuntFinished(Person person, Stunt stunt, bool success) { }
private void person_OnStudyStuntFinished(Person person, Stunt stunt, bool success) { Session.MainGame.mainGameScreen.PersonStudyStuntFinished(person, stunt, success); }
public override void MessageReceived(Message message) { switch (message.MessageType) { case SyncAbilityTypeListMessage.MESSAGE_TYPE: { var msg = (SyncAbilityTypeListMessage)message; AbilityType.AbilityTypes.Clear(); foreach (var typeInfo in msg.abilityTypes) { var abilityType = new AbilityType(IdentificationConverter.GetID(typeInfo.id), typeInfo.name); AbilityType.AbilityTypes.Add(abilityType.ID, abilityType); } } break; case CreateCharacterMessage.MESSAGE_TYPE: { var msg = (CreateCharacterMessage)message; var pool = CharacterManager.Instance.CharacterPool; var character = new Character(IdentificationConverter.GetID(msg.id), msg.avatar); character.Name = msg.description.name; character.Description = msg.description.text; pool.Add(character); } break; case CreateTemporaryCharacterMessage.MESSAGE_TYPE: { var msg = (CreateTemporaryCharacterMessage)message; var pool = CharacterManager.Instance.TemporaryCharacterPool; var character = new Character(IdentificationConverter.GetID(msg.id), msg.avatar); character.Name = msg.description.name; character.Description = msg.description.text; pool.Add(character); } break; case ClearTemporaryCharacterListMessage.MESSAGE_TYPE: { CharacterManager.Instance.TemporaryCharacterPool.Clear(); } break; case UpdateCharacterBaseDataMessage.MESSAGE_TYPE: { var msg = (UpdateCharacterBaseDataMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); character.Destroyed = msg.destroyed; character.Token = msg.token; character.FatePoint = msg.fatePoint; character.RefreshPoint = msg.refreshPoint; character.PhysicsStress = msg.physicsStress; character.PhysicsStressMax = msg.physicsStressMax; character.PhysicsInvincible = msg.physicsInvincible; character.MentalStress = msg.mentalStress; character.MentalStressMax = msg.mentalStressMax; character.MentalInvincible = msg.mentalInvincible; } break; case UpdateCharacterAbilityDataMessage.MESSAGE_TYPE: { var msg = (UpdateCharacterAbilityDataMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); var abilityType = AbilityType.AbilityTypes[IdentificationConverter.GetID(msg.typeID)]; character.Abilities[abilityType] = new AbilityData() { customName = msg.customName, level = msg.level, damageMental = msg.damageMental }; } break; case CharacterAddAspectMessage.MESSAGE_TYPE: { var msg = (CharacterAddAspectMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); var aspect = new Aspect(IdentificationConverter.GetID(msg.aspectID)); aspect.Name = msg.description.name; aspect.Description = msg.description.text; character.Aspects.Add(aspect); } break; case CharacterRemoveAspectMessage.MESSAGE_TYPE: { var msg = (CharacterRemoveAspectMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); character.Aspects.Remove(IdentificationConverter.GetID(msg.aspectID)); } break; case CharacterUpdateAspectDataMessage.MESSAGE_TYPE: { var msg = (CharacterUpdateAspectDataMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); var aspect = character.Aspects[IdentificationConverter.GetID(msg.aspectID)]; aspect.PersistenceType = msg.persistenceType; int benefiterID = IdentificationConverter.GetID(msg.benefiterID); if (benefiterID == -1) { aspect.Benefiter = null; } else { aspect.Benefiter = CharacterManager.Instance.FindCharacter(benefiterID); } aspect.BenefitTimes = msg.benefitTimes; } break; case CharacterClearAspectListMessage.MESSAGE_TYPE: { var msg = (CharacterClearAspectListMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); character.Aspects.Clear(); } break; case CharacterAddConsequenceMessage.MESSAGE_TYPE: { var msg = (CharacterAddConsequenceMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); var consequence = new Consequence(IdentificationConverter.GetID(msg.consequenceID)); consequence.Name = msg.description.name; consequence.Description = msg.description.text; character.Consequences.Add(consequence); } break; case CharacterRemoveConsequenceMessage.MESSAGE_TYPE: { var msg = (CharacterRemoveConsequenceMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); character.Consequences.Remove(IdentificationConverter.GetID(msg.consequenceID)); } break; case CharacterUpdateConsequenceMessage.MESSAGE_TYPE: { var msg = (CharacterUpdateConsequenceMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); var consequence = character.Consequences[IdentificationConverter.GetID(msg.consequenceID)]; consequence.PersistenceType = msg.persistenceType; int benefiterID = IdentificationConverter.GetID(msg.benefiterID); if (benefiterID == -1) { consequence.Benefiter = null; } else { consequence.Benefiter = CharacterManager.Instance.FindCharacter(benefiterID); } consequence.BenefitTimes = msg.benefitTimes; consequence.CounteractLevel = msg.counteractLevel; consequence.ActualDamage = msg.actualDamage; consequence.Mental = msg.mental; } break; case CharacterClearConsequenceListMessage.MESSAGE_TYPE: { var msg = (CharacterClearConsequenceListMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); character.Consequences.Clear(); } break; case CharacterAddStuntMessage.MESSAGE_TYPE: { var msg = (CharacterAddStuntMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); var stunt = new Stunt(IdentificationConverter.GetID(msg.stuntID)); stunt.Name = msg.description.name; stunt.Description = msg.description.text; character.Stunts.Add(stunt); } break; case CharacterRemoveStuntMessage.MESSAGE_TYPE: { var msg = (CharacterRemoveStuntMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); character.Stunts.Remove(IdentificationConverter.GetID(msg.stuntID)); } break; case CharacterUpdateStuntMessage.MESSAGE_TYPE: { var msg = (CharacterUpdateStuntMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); var stunt = character.Stunts[IdentificationConverter.GetID(msg.stuntID)]; /////////////////////////////////// } break; case CharacterClearStuntListMessage.MESSAGE_TYPE: { var msg = (CharacterClearStuntListMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); character.Stunts.Clear(); } break; case CharacterAddExtraMessage.MESSAGE_TYPE: { var msg = (CharacterAddExtraMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); int itemID = IdentificationConverter.GetID(msg.boundCharacterID); var character = CharacterManager.Instance.FindCharacter(characterID); var item = CharacterManager.Instance.FindCharacter(itemID); var extra = new Extra(IdentificationConverter.GetID(msg.extraID), item); extra.Name = msg.description.name; extra.Description = msg.description.text; character.Extras.Add(extra); } break; case CharacterRemoveExtraMessage.MESSAGE_TYPE: { var msg = (CharacterRemoveExtraMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); character.Extras.Remove(IdentificationConverter.GetID(msg.extraID)); } break; case CharacterUpdateExtraMessage.MESSAGE_TYPE: { var msg = (CharacterUpdateExtraMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); var extra = character.Extras[IdentificationConverter.GetID(msg.extraID)]; extra.IsLongRangeWeapon = msg.isLongRangeWeapon; extra.IsVehicle = msg.isVehicle; } break; case CharacterClearExtraListMessage.MESSAGE_TYPE: { var msg = (CharacterClearExtraListMessage)message; int characterID = IdentificationConverter.GetID(msg.characterID); var character = CharacterManager.Instance.FindCharacter(characterID); character.Extras.Clear(); } break; } }
private void screen_OnMouseMove(Point position, bool leftDown) { bool flag = false; if (!flag && StaticMethods.PointInRectangle(position, this.TitleDisplayPosition)) { int num2 = (position.Y - this.TitleText.DisplayOffset.Y) / this.TitleText.RowHeight; if (num2 >= 0) { int num3 = num2; if (this.ShowingPerson.Titles.Count > num3) { Title title = this.ShowingPerson.Titles[num3] as Title; if (title != null) { if (this.current != title) { this.BiographyText.Clear(); this.InfluenceText.Clear(); this.InfluenceText.AddText(title.DetailedName, Color.Yellow); this.InfluenceText.AddNewLine(); foreach (Influence influence in title.Influences.Influences.Values) { this.InfluenceText.AddText(influence.Description); this.InfluenceText.AddNewLine(); } this.InfluenceText.ResortTexts(); this.ConditionText.Clear(); this.ConditionText.AddText("修习条件", Color.LightPink); this.ConditionText.AddNewLine(); foreach (Condition condition in title.Conditions.Conditions.Values) { if (condition.CheckCondition(this.ShowingPerson)) { this.ConditionText.AddText(condition.Name, Color.Lime); } else { this.ConditionText.AddText(condition.Name, Color.Red); } this.ConditionText.AddNewLine(); } this.ConditionText.ResortTexts(); this.current = title; } flag = true; } } } } if (!flag && StaticMethods.PointInRectangle(position, this.StuntDisplayPosition)) { int num2 = (position.Y - this.StuntText.DisplayOffset.Y) / this.StuntText.RowHeight; if (num2 > 1) { int num3 = num2 - 2; if (this.ShowingPerson.Stunts.Count > num3) { Stunt stunt = this.ShowingPerson.Stunts.GetStuntList()[num3] as Stunt; if (stunt != null) { if (this.current != stunt) { this.BiographyText.Clear(); this.InfluenceText.Clear(); this.InfluenceText.AddText("战斗特技", Color.Yellow); this.InfluenceText.AddText(stunt.Name, Color.Red); this.InfluenceText.AddNewLine(); this.InfluenceText.AddText("持续天数", Color.LightSteelBlue); this.InfluenceText.AddText(stunt.Period.ToString(), Color.Lime); this.InfluenceText.AddText("天", Color.LightSteelBlue); this.InfluenceText.AddNewLine(); foreach (Influence influence in stunt.Influences.Influences.Values) { this.InfluenceText.AddText(influence.Description); this.InfluenceText.AddNewLine(); } this.InfluenceText.ResortTexts(); this.ConditionText.Clear(); this.ConditionText.AddText("使用条件", Color.LightSkyBlue); this.ConditionText.AddNewLine(); if ((this.ShowingPerson.LocationTroop != null) && (this.ShowingPerson == this.ShowingPerson.LocationTroop.Leader)) { foreach (Condition condition in stunt.CastConditions.Conditions.Values) { if (condition.CheckCondition(this.ShowingPerson.LocationTroop)) { this.ConditionText.AddText(condition.Name, Color.Lime); } else { this.ConditionText.AddText(condition.Name, Color.Red); } this.ConditionText.AddNewLine(); } } else { foreach (Condition condition in stunt.CastConditions.Conditions.Values) { this.ConditionText.AddText(condition.Name); this.ConditionText.AddNewLine(); } } this.ConditionText.AddNewLine(); this.ConditionText.AddText("修习条件", Color.LightPink); this.ConditionText.AddNewLine(); foreach (Condition condition in stunt.LearnConditions.Conditions.Values) { if (condition.CheckCondition(this.ShowingPerson)) { this.ConditionText.AddText(condition.Name, Color.Lime); } else { this.ConditionText.AddText(condition.Name, Color.Red); } this.ConditionText.AddNewLine(); } this.ConditionText.ResortTexts(); this.current = stunt; } flag = true; } } } } if (!flag) { for (int i = 0; i < this.AllSkillTexts.Count; i++) { if (StaticMethods.PointInRectangle(position, this.AllSkillTexts[i].AlignedPosition)) { if (this.current != this.LinkedSkills[i]) { this.BiographyText.Clear(); this.InfluenceText.Clear(); if (this.LinkedSkills[i].InfluenceCount > 0) { this.InfluenceText.AddText("技能", Color.Yellow); this.InfluenceText.AddText(this.LinkedSkills[i].Name, Color.Lime); this.InfluenceText.AddNewLine(); foreach (Influence influence in this.LinkedSkills[i].Influences.Influences.Values) { this.InfluenceText.AddText(influence.Description); this.InfluenceText.AddNewLine(); } this.InfluenceText.ResortTexts(); this.ConditionText.Clear(); this.ConditionText.AddText("修习条件", Color.LightPink); this.ConditionText.AddNewLine(); foreach (Condition condition in this.LinkedSkills[i].Conditions.Conditions.Values) { if (condition.CheckCondition(this.ShowingPerson)) { this.ConditionText.AddText(condition.Name, Color.Lime); } else { this.ConditionText.AddText(condition.Name, Color.Red); } this.ConditionText.AddNewLine(); } this.ConditionText.ResortTexts(); } this.current = this.LinkedSkills[i]; } flag = true; break; } } } if (!flag) { this.current = null; this.InfluenceText.Clear(); this.ConditionText.Clear(); if (this.ShowingPerson.PersonBiography != null) { this.BiographyText.Clear(); this.BiographyText.AddText("列传", Color.Yellow); this.BiographyText.AddNewLine(); this.BiographyText.AddText(this.ShowingPerson.PersonBiography.Brief); this.BiographyText.AddNewLine(); this.BiographyText.AddText("演义", Color.Lime); this.BiographyText.AddText(":" + this.ShowingPerson.PersonBiography.Romance); this.BiographyText.AddNewLine(); this.BiographyText.AddText("历史", Color.Red); this.BiographyText.AddText(":" + this.ShowingPerson.PersonBiography.History); this.BiographyText.AddNewLine(); this.BiographyText.ResortTexts(); } } }
private void troop_OnApplyStunt(Troop troop, Stunt stunt) { troop.Scenario.GameScreen.TroopApplyStunt(troop, stunt); }
public virtual void TroopApplyStunt(Troop troop, Stunt stunt) { }
static void Main(string[] args) { var brught_jackson = player1characters[0] = new KeyCharacter("PlayerBrughtJackson", new CharacterView() { battle = "布鲁特", story = "布鲁特·杰克逊" }); brught_jackson.Name = "布鲁特·杰克逊"; brught_jackson.Description = "正在读大学的布鲁特是他所成长的街区内这一辈年轻人里唯一一个拿到私立大学奖学金的人,被考古专业录取的他对于一切古老而神秘的事务充满好奇。"; brught_jackson.PhysicsStressMax = 2; brught_jackson.MentalStressMax = 4; brught_jackson.Aspects.Add(new Aspect() { Name = "年少老成", PersistenceType = PersistenceType.Fixed }); brught_jackson.Aspects.Add(new Aspect() { Name = "痴迷于古代文化", PersistenceType = PersistenceType.Fixed }); brught_jackson.Aspects.Add(new Aspect() { Name = "相较于发达大脑的贫弱体格", PersistenceType = PersistenceType.Fixed }); brught_jackson.FatePoint = brught_jackson.RefreshPoint = 3; brught_jackson.GetSkill(SkillType.Lore).Level = 4; brught_jackson.GetSkill(SkillType.Investigate).Level = 3; brught_jackson.GetSkill(SkillType.Will).Level = 3; brught_jackson.GetSkill(SkillType.Empathy).Level = 2; brught_jackson.GetSkill(SkillType.Crafts).Level = 2; brught_jackson.GetSkill(SkillType.Notice).Level = 2; brught_jackson.GetSkill(SkillType.Drive).Level = 1; brught_jackson.GetSkill(SkillType.Contacts).Level = 1; brught_jackson.GetSkill(SkillType.Rapport).Level = 1; brught_jackson.GetSkill(SkillType.Stealth).Level = 1; var stunt1 = new Stunt(new InitiativeEffect(new Command("专家主动效果", Resource.Stunt1JSCode))); stunt1.Name = "专家"; stunt1.Description = "你声明一个专业领域,例如草药学,犯罪学或者动物学。在你针对那个领域相关的内容进行学识掷骰时,你获得 + 2 的掷骰结果。"; var limit1 = new StuntSituationLimit() { canUseOnInteract = true, usableSituation = CharacterAction.CREATE_ASPECT | CharacterAction.HINDER, resistableSituation = CharacterAction.CREATE_ASPECT | CharacterAction.HINDER }; stunt1.SituationLimit = limit1; stunt1.BattleMapProperty = brught_jackson.GetSkill(SkillType.Lore).BattleMapProperty; stunt1.CopyResistTable(SkillType.Lore); brught_jackson.Stunts.Add(stunt1); var stunt2 = new Stunt(new InitiativeEffect(new Command("决心的力量主动效果", Resource.Stunt2JSCode))); stunt2.Name = "决心的力量"; stunt2.Description = "任何被动掷骰中都可以使用意志代替体格,这表示超凡的力量。"; var limit2 = new StuntSituationLimit() { canUseOnInteract = false, usableSituation = 0, resistableSituation = CharacterAction.ATTACK | CharacterAction.CREATE_ASPECT | CharacterAction.HINDER }; stunt2.SituationLimit = limit2; stunt2.BattleMapProperty = brught_jackson.GetSkill(SkillType.Will).BattleMapProperty; stunt2.CopyResistTable(SkillType.Physique); stunt2.PassiveEffects.Add(new PassiveEffect("event.battleScene.onceCheckOver", new Command("决心的力量被动效果", Resource.Stunt2Trigger1JSCode))); brught_jackson.Stunts.Add(stunt2); var ranbo = player2characters[0] = new KeyCharacter("PlayerRanbo", new CharacterView() { battle = "蓝波", story = "蓝波" }); ranbo.Name = "蓝波"; ranbo.Description = "从小就备受欺负的蓝波,坚信一身强健的肌肉可以保护自己,长大后成为了亚特兰大市民中心内的健身房教练,出生于美国中部州的他对政府极度不信任。"; ranbo.PhysicsStressMax = 4; ranbo.MentalStressMax = 3; ranbo.Aspects.Add(new Aspect() { Name = "“所有人都在注视着我的肌肉!”", PersistenceType = PersistenceType.Fixed }); ranbo.Aspects.Add(new Aspect() { Name = "政府阴谋论支持者", PersistenceType = PersistenceType.Fixed }); ranbo.Aspects.Add(new Aspect() { Name = "体育中心的健身教练", PersistenceType = PersistenceType.Fixed }); ranbo.FatePoint = ranbo.RefreshPoint = 3; ranbo.GetSkill(SkillType.Physique).Level = 4; ranbo.GetSkill(SkillType.Athletics).Level = 3; ranbo.GetSkill(SkillType.Drive).Level = 3; ranbo.GetSkill(SkillType.Will).Level = 2; ranbo.GetSkill(SkillType.Shoot).Level = 2; ranbo.GetSkill(SkillType.Provoke).Level = 2; ranbo.GetSkill(SkillType.Resources).Level = 1; ranbo.GetSkill(SkillType.Contacts).Level = 1; ranbo.GetSkill(SkillType.Lore).Level = 1; ranbo.GetSkill(SkillType.Empathy).Level = 1; var stunt3 = new Stunt(new InitiativeEffect(new Command("", ""))); stunt3.Name = "晕眩反击"; stunt3.Description = "每当你在对抗对手格斗技能的防御行动中获得大成功时,你自动反击对手。你可以免费在你的对手身上激活晕眩特性。"; stunt3.PassiveEffects.Add(new PassiveEffect("event.battleScene.onceCheckOver", new Command("晕眩反击被动效果", Resource.Stunt3Trigger1JSCode))); ranbo.Stunts.Add(stunt3); var stunt4 = new Stunt(new InitiativeEffect(new Command("坚韧如钉主动效果", Resource.Stunt4JSCode))); stunt4.UsingCondition = new Condition(new Command("坚韧如钉使用判定", Resource.Stunt4UsingConditionJSCode)); stunt4.TargetCondition = new Condition(new Command("坚韧如钉目标判定", Resource.Stunt4TargetConditionJSCode)); stunt4.Name = "坚韧如钉"; stunt4.Description = "每局游戏一次,消耗一点命运点数,你可以将一个物理性的中度伤痕减弱为轻微(如果你的轻微不良状态槽正空着),或者完全解除一个轻微伤痕。"; var limit4 = new StuntSituationLimit() { canUseOnInteract = true, usableSituation = 0, resistableSituation = 0 }; stunt4.SituationLimit = limit4; ranbo.Stunts.Add(stunt4); var lily = player2characters[1] = new KeyCharacter("PlayerLily", new CharacterView() { battle = "李莉", story = "李莉" }); lily.Name = "李莉"; lily.Description = "联邦调查局,负责人口失踪与贩卖类别的调查。由于移民身份总是受到同事的排挤。"; lily.PhysicsStressMax = lily.MentalStressMax = 3; lily.Aspects.Add(new Aspect() { Name = "身手不凡的调查员", PersistenceType = PersistenceType.Fixed }); lily.Aspects.Add(new Aspect() { Name = "种族问题", PersistenceType = PersistenceType.Fixed }); lily.FatePoint = lily.RefreshPoint = 3; lily.GetSkill(SkillType.Fight).Level = 4; lily.GetSkill(SkillType.Shoot).Level = 3; lily.GetSkill(SkillType.Investigate).Level = 3; lily.GetSkill(SkillType.Physique).Level = 2; lily.GetSkill(SkillType.Lore).Level = 2; lily.GetSkill(SkillType.Athletics).Level = 2; lily.GetSkill(SkillType.Rapport).Level = 1; lily.GetSkill(SkillType.Empathy).Level = 1; lily.GetSkill(SkillType.Will).Level = 1; lily.GetSkill(SkillType.Notice).Level = 1; var stunt5 = new Stunt(new InitiativeEffect(new Command("", ""))); stunt5.UsingCondition = new Condition(new Command("备用武器使用判定", Resource.Stunt5UsingConditionJSCode)); stunt5.Name = "备用武器"; stunt5.Description = "每当其他人在你身上创造“缴械”、“武器落手”或类似的情景特征时,你可以花费1 个命运点来宣告细节,表示你带着备用武器,对手将因此而无法创造情景特征,但他可以获得一个增益,以此表示你在不得不更换武器时所出现的短时间分心。"; stunt5.PassiveEffects.Add(new PassiveEffect("event.battleScene.onceCheckOverAspectCreated", new Command("备用武器被动效果", Resource.Stunt5Trigger1JSCode))); lily.Stunts.Add(stunt5); var pistol = new Extra(CharacterManager.Instance.CreateCharacterWithSaving(CharacterManager.DataLevel.Common, "ItemPistol", new CharacterView() { battle = "手枪", story = "手枪" })); pistol.Name = "M1911手枪"; pistol.Description = "一种在1911年起生产的.45 ACP口径半自动手枪。"; lily.Extras.Add(pistol); var stunt6 = new Stunt(new InitiativeEffect(new Command("洞若观火主动效果", Resource.Stunt6JSCode))); stunt6.Name = "洞若观火"; stunt6.Description = "你可以使用调查技能代替洞察技能来防御欺诈。其他人凭借本能反应和直觉感知的信息,你可以通过仔细观察别人的细微表情来获悉。"; var limit6 = new StuntSituationLimit() { canUseOnInteract = false, usableSituation = 0, resistableSituation = CharacterAction.ATTACK | CharacterAction.CREATE_ASPECT | CharacterAction.HINDER }; stunt6.SituationLimit = limit6; stunt6.BattleMapProperty = lily.GetSkill(SkillType.Investigate).BattleMapProperty; stunt6.CopyResistTable(SkillType.Notice); stunt6.PassiveEffects.Add(new PassiveEffect("event.battleScene.onceCheckOver", new Command("洞若观火被动效果", Resource.Stunt6Trigger1JSCode))); lily.Stunts.Add(stunt6); var franz = CharacterManager.Instance.CreateCharacterWithSaving(CharacterManager.DataLevel.Key, "NPCFranz", new CharacterView { battle = "弗兰兹", story = "弗兰兹" }); franz.Name = "弗兰兹·欧洛克"; franz.Description = "弗兰兹·欧洛克本是一名前途似锦的足球新星,但一切都在本赛季的第一场球赛前的一次私人会面后改变了。一个自称特拉维尔爵士的人找到了他,并告诉他,在他的体内拥有着古老而高贵的血族血统,只不过还没有觉醒。在那个“爵士”的女秘书掏出那块怀表之前,欧洛克只当这个人不过是一个江湖骗子而已,但现在他对此深信不疑,毕竟获得永生总是赚到了。"; franz.PhysicsStressMax = 5; franz.MentalStressMax = 4; franz.Aspects.Add(new Aspect() { Name = "天降死神", PersistenceType = PersistenceType.Fixed }); franz.Aspects.Add(new Aspect() { Name = "吸血鬼诅咒", PersistenceType = PersistenceType.Fixed }); franz.Aspects.Add(new Aspect() { Name = "多疑的秃脑袋", PersistenceType = PersistenceType.Fixed }); franz.FatePoint = franz.RefreshPoint = 3; franz.GetSkill(SkillType.Athletics).Level = 5; franz.GetSkill(SkillType.Notice).Level = 4; franz.GetSkill(SkillType.Physique).Level = 4; franz.GetSkill(SkillType.Stealth).Level = 3; franz.GetSkill(SkillType.Fight).Level = 3; franz.GetSkill(SkillType.Deceive).Level = 2; franz.GetSkill(SkillType.Crafts).Level = 1; franz.GetSkill(SkillType.Lore).Level = 1; franz.GetSkill(SkillType.Will).Level = 1; var stunt7 = new Stunt(new InitiativeEffect(new Command("掠空攻击主动效果", Resource.Stunt7JSCode))); stunt7.Name = "掠空攻击"; stunt7.Description = "从空中滑翔而下,在飞行的最低点攻击目标。如果目标足够轻,则将其携带至高空中摔死。"; var limit7 = new StuntSituationLimit() { canUseOnInteract = false, usableSituation = CharacterAction.ATTACK, resistableSituation = 0 }; stunt7.SituationLimit = limit7; var mapProperty7 = franz.GetSkill(SkillType.Athletics).BattleMapProperty; mapProperty7.useRange = new Range() { low = 0, lowOpen = false, high = 8, highOpen = false }; stunt7.BattleMapProperty = mapProperty7; stunt7.PassiveEffects.Add(new PassiveEffect("event.battleScene.onceCheckOver", new Command("掠空攻击被动效果", Resource.Stunt7Trigger1JSCode))); franz.Stunts.Add(stunt7); var stunt8 = new Stunt(new InitiativeEffect(new Command("", ""))); stunt8.Name = "不死之身"; stunt8.Description = "作为吸血鬼,除非受到阳光(紫外线)和银制物品的攻击,否则不会受到伤害,就算有外伤也会迅速愈合。生理压力槽 + 2,精神压力槽 + 1。"; stunt8.PassiveEffects.Add(new PassiveEffect("event.battleScene.onceCheckOverCauseDamage", new Command("不死之身被动效果", Resource.Stunt8Trigger1JSCode))); franz.Stunts.Add(stunt8); var emma = CharacterManager.Instance.CreateCharacterWithSaving(CharacterManager.DataLevel.Common, "NPCEmma", new CharacterView { battle = "艾玛", story = "艾玛" }); emma.Name = "艾玛·蒂姆"; emma.Description = "艾玛·蒂姆从小就是一个富有正义感的迷人女孩儿,为人处世从来都遵从自己的那一套“正义”准则。在成年后选择做一名警察后,这种天性变得更加不可收拾,每每不考虑后果就先鲁莽行事,好在她的运气就和她的正义感一样丰富,一次次帮助她化险为夷。这次的行动也是她自己率性而为,根据手中的证据前来这里探查结果却遇见了一场邪恶仪式的举行,还将自己陷入无解的困境之中。"; emma.PhysicsStressMax = 3; emma.MentalStressMax = 2; emma.Aspects.Add(new Aspect() { Name = "我要做正义的伙伴!", PersistenceType = PersistenceType.Fixed }); emma.Aspects.Add(new Aspect() { Name = "无知者无畏", PersistenceType = PersistenceType.Fixed }); emma.Aspects.Add(new Aspect() { Name = "警局中的红发安妮", PersistenceType = PersistenceType.Fixed }); emma.GetSkill(SkillType.Fight).Level = 3; emma.GetSkill(SkillType.Shoot).Level = 3; emma.GetSkill(SkillType.Investigate).Level = 2; emma.GetSkill(SkillType.Stealth).Level = 2; emma.GetSkill(SkillType.Physique).Level = 2; emma.GetSkill(SkillType.Lore).Level = 1; emma.GetSkill(SkillType.Athletics).Level = 1; emma.GetSkill(SkillType.Will).Level = 1; emma.GetSkill(SkillType.Resources).Level = 1; var stunt9 = new Stunt(new InitiativeEffect(new Command("爆发射击主动效果", Resource.Stunt9JSCode))); stunt9.UsingCondition = new Condition(new Command("爆发射击使用判定", Resource.Stunt9UsingConditionJSCode)); stunt9.Name = "爆发射击(雷明顿M870霰弹枪)"; stunt9.Description = "在攻击检定结果上获得 + 2 的奖励,并且可以攻击同方向至多3 个目标。"; var limit9 = new StuntSituationLimit() { canUseOnInteract = false, usableSituation = CharacterAction.ATTACK, resistableSituation = 0 }; stunt9.SituationLimit = limit9; var mapProperty9 = emma.GetSkill(SkillType.Shoot).BattleMapProperty; mapProperty9.affectRange = new Range() { low = 0, lowOpen = false, high = 3, highOpen = false }; mapProperty9.targetMaxCount = 3; stunt9.BattleMapProperty = mapProperty9; emma.Stunts.Add(stunt9); var gun = new Extra(CharacterManager.Instance.CreateCharacterWithSaving(CharacterManager.DataLevel.Common, "ItemGun", new CharacterView() { battle = "霰弹枪", story = "霰弹枪" })); gun.Name = "雷明顿M870霰弹枪"; gun.Description = "一种近距离杀伤性武器,是雷明顿兵工厂于50年代初研制成功的,它一直是美国军、警界的专用装备。"; gun.IsLongRangeWeapon = true; emma.Extras.Add(gun); /* * var lance = CharacterManager.Instance.CreateCharacterWithSaving(CharacterManager.DataLevel.Common, "NPCLance", new CharacterView { battle = "兰斯", story = "兰斯" }); * lance.Name = "兰斯·帕特洛西"; * lance.Description = "兰斯·帕特洛西来自一个富足的商人家庭,生性内敛的他并没有成为一名花花公子,相反成为了一名彬彬有礼的绅士,但是在一次意外的冲突之中,他发现一定的自我保护是必须的,甚至他需要有保护别人的能力。之后他志愿成为一名海军陆战队员,背着家里偷偷参军并在伊拉克待了2年多,最后被家人强行带回了美国,进入了国民警卫队这种“安全”的部队。"; * lance.PhysicsStressMax = 4; * lance.MentalStressMax = 3; * lance.Aspects.Add(new Aspect() { Name = "人类的伟大,就是勇气的伟大!", PersistenceType = PersistenceType.Fixed }); * lance.Aspects.Add(new Aspect() { Name = "一三得三,二三得九,三八妇女节~", PersistenceType = PersistenceType.Fixed }); * lance.Aspects.Add(new Aspect() { Name = "循规蹈矩的好孩子", PersistenceType = PersistenceType.Fixed }); * lance.GetSkill(SkillType.Shoot).Level = 4; * lance.GetSkill(SkillType.Fight).Level = 3; * lance.GetSkill(SkillType.Athletics).Level = 3; * lance.GetSkill(SkillType.Investigate).Level = 2; * lance.GetSkill(SkillType.Will).Level = 2; * lance.GetSkill(SkillType.Notice).Level = 2; * lance.GetSkill(SkillType.Stealth).Level = 1; * lance.GetSkill(SkillType.Resources).Level = 1; */ Player[] players = new Player[2]; players[0] = new Player("Player1", "Player1", player1Connection, 1, player1characters); players[1] = new Player("Player2", "Player2", player2Connection, 2, player2characters); DM dm = new DM("DM", "DM", dmConnection); Game.Init(dm, players); NetworkHelper.StartServer(OnConnectionEstablished); CampaignManager.Instance.CurrentContainer = ContainerType.BATTLE; var battleScene = BattleSceneContainer.Instance; battleScene.Reset(8, 8); var groundView = new CharacterView(); var stelaeView = new CharacterView(); groundView.battle = "地面"; stelaeView.battle = "石柱"; for (int i = 0; i < 8; ++i) { for (int j = 0; j < 8; ++j) { var ground = new GridObject(CharacterManager.Instance.CreateTemporaryCharacter(CharacterManager.DataLevel.Temporary, groundView)); ground.CharacterRef.PhysicsInvincible = true; ground.CharacterRef.MentalInvincible = true; ground.Stagnate = 1; battleScene.PushGridObject(i, j, false, ground); } } var stelae1 = new GridObject(CharacterManager.Instance.CreateTemporaryCharacter(CharacterManager.DataLevel.Temporary, stelaeView)); var stelae2 = new GridObject(CharacterManager.Instance.CreateTemporaryCharacter(CharacterManager.DataLevel.Temporary, stelaeView)); var stelae3 = new GridObject(CharacterManager.Instance.CreateTemporaryCharacter(CharacterManager.DataLevel.Temporary, stelaeView)); var stelae4 = new GridObject(CharacterManager.Instance.CreateTemporaryCharacter(CharacterManager.DataLevel.Temporary, stelaeView)); stelae1.Obstacle = stelae2.Obstacle = stelae3.Obstacle = stelae4.Obstacle = true; stelae1.CharacterRef.MentalInvincible = stelae2.CharacterRef.MentalInvincible = stelae3.CharacterRef.MentalInvincible = stelae4.CharacterRef.MentalInvincible = true; stelae1.CharacterRef.PhysicsStressMax = stelae2.CharacterRef.PhysicsStressMax = stelae3.CharacterRef.PhysicsStressMax = stelae4.CharacterRef.PhysicsStressMax = 12; battleScene.PushGridObject(1, 1, false, stelae1); battleScene.PushGridObject(6, 1, false, stelae2); battleScene.PushGridObject(1, 6, false, stelae3); battleScene.PushGridObject(5, 5, false, stelae4); battleScene.PushGridObject(7, 6, false, new ActableGridObject(player1characters[0])); battleScene.PushGridObject(7, 5, false, new ActableGridObject(player2characters[0])); battleScene.PushGridObject(7, 4, false, new ActableGridObject(player2characters[1])); battleScene.PushGridObject(4, 3, false, new ActableGridObject(franz)); battleScene.PushGridObject(4, 4, false, new ActableGridObject(emma)); battleScene.NewRound(); while (!Game.GameOver) { Game.Update(); Thread.Sleep(100); } Game.Cleanup(); Console.WriteLine("Press any key to continue..."); Console.ReadKey(); }