當前位置: 首頁>>代碼示例>>C#>>正文


C# Player.AcquireAdditionalSkill方法代碼示例

本文整理匯總了C#中Sanguosha.Core.Players.Player.AcquireAdditionalSkill方法的典型用法代碼示例。如果您正苦於以下問題:C# Player.AcquireAdditionalSkill方法的具體用法?C# Player.AcquireAdditionalSkill怎麽用?C# Player.AcquireAdditionalSkill使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sanguosha.Core.Players.Player的用法示例。


在下文中一共展示了Player.AcquireAdditionalSkill方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Run

 void Run(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs)
 {
     Game.CurrentGame.RegisterTrigger(GameEvent.PlayerJudgeDone, new GetJudgeCardTrigger(Owner) { Priority = int.MinValue });
     var result = Game.CurrentGame.Judge(Owner, this);
     ISkill skill = new ShuangXiongCardTransformSkill(result.SuitColor);
     Owner.AcquireAdditionalSkill(skill);
     Game.CurrentGame.RegisterTrigger(GameEvent.PhasePostEnd, new TriggerRemoval(Owner, skill));
     Game.CurrentGame.CurrentPhaseEventIndex++;
     throw new TriggerResultException(TriggerResult.End);
 }
開發者ID:maplegh,項目名稱:sgs,代碼行數:10,代碼來源:ShuangXiong.cs

示例2: InstallTriggers

 protected override void InstallTriggers(Player owner)
 {
     theSkill = new List<ISkill>();
     foreach (var p in Game.CurrentGame.AlivePlayers)
     {
         if (p.Role == Role.Ruler)
         {
             foreach (var sk in p.Hero.Skills)
             {
                 if (sk.IsRulerOnly)
                 {
                     var toAdd = Activator.CreateInstance(sk.GetType()) as ISkill;
                     owner.AcquireAdditionalSkill(toAdd);
                     theSkill.Add(toAdd);
                 }
             }
         }
     }
 }
開發者ID:maplegh,項目名稱:sgs,代碼行數:19,代碼來源:WeiDi.cs

示例3: PlayerAcquireSkill

 public void PlayerAcquireSkill(Player p, ISkill skill, bool undeletable = false)
 {
     if (p.IsDead) return;
     p.AcquireAdditionalSkill(skill, undeletable);
     SkillSetChangedEventArgs args = new SkillSetChangedEventArgs();
     args.Source = p;
     args.Skills.Add(skill);
     args.IsLosingSkill = false;
     Emit(GameEvent.PlayerSkillSetChanged, args);
     _ResetCards(p);
 }
開發者ID:h1398123,項目名稱:sgs,代碼行數:11,代碼來源:Game.Procedures.cs

示例4: PlayerAcquireSkill

 public void PlayerAcquireSkill(Player p, ISkill skill, bool undeletable = false)
 {
     p.AcquireAdditionalSkill(skill, undeletable);
     GameEventArgs args = new GameEventArgs();
     args.Source = p;
     Game.CurrentGame.Emit(GameEvent.PlayerSkillSetChanged, args);
     _ResetCards(p);
 }
開發者ID:pxoylngx,項目名稱:sgs,代碼行數:8,代碼來源:Game.Procedures.cs

示例5: Run

 void Run(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs)
 {
     if (acquiredSkill != null)
         Owner.LoseAdditionalSkill(acquiredSkill);
     List<List<Card>> answer;
     if (!Game.CurrentGame.UiProxies[Owner].AskForCardChoice(
         new CardChoicePrompt("HuaShen"),
         new List<DeckPlace>() { new DeckPlace(Owner, HuaShenDeck) },
         new List<string>() { "HuaShen" },
         new List<int>() { 1 },
         new RequireOneCardChoiceVerifier(),
         out answer))
     {
         Trace.TraceInformation("Invalid answer, choosing for you");
         answer = new List<List<Card>>();
         answer.Add(new List<Card>());
         answer[0].Add(Game.CurrentGame.Decks[Owner, HuaShenDeck][0]);
     }
     Game.CurrentGame.SyncImmutableCardAll(answer[0][0]);
     Trace.Assert(answer[0][0].Type is HeroCardHandler);
     var handler = answer[0][0].Type as HeroCardHandler;
     List<ISkill> skills = new List<ISkill>();
     List<string> hsOptions = new List<string>();
     foreach (var sk in handler.Hero.Skills)
     {
         if (sk.IsAwakening || sk.IsRulerOnly || sk.IsSingleUse) continue;
         skills.Add(sk);
         hsOptions.Add(string.Format("Skill.{0}.Name", sk.GetType().Name));
     }
     int skanswer;
     Game.CurrentGame.UiProxies[Owner].AskForMultipleChoice(new MultipleChoicePrompt("HuaShen"), hsOptions, out skanswer);
     acquiredSkill = skills[skanswer];
     Owner.AcquireAdditionalSkill(acquiredSkill);
     Owner.Allegiance = handler.Hero.Allegiance;
     Owner.IsMale = handler.Hero.IsMale;
     Owner.IsFemale = !handler.Hero.IsMale;
     Game.CurrentGame.NotificationProxy.NotifyImpersonation(Owner, handler.Hero, acquiredSkill);
     Game.CurrentGame.Emit(GameEvent.PlayerChangedAllegiance, new GameEventArgs() { Source = Owner });
     return;
 }
開發者ID:maplegh,項目名稱:sgs,代碼行數:40,代碼來源:HuaShen.cs

示例6: PlayerAcquireSkill

 public void PlayerAcquireSkill(Player p, ISkill skill)
 {
     p.AcquireAdditionalSkill(skill);
     _ResetCards(p);
 }
開發者ID:maplegh,項目名稱:sgs,代碼行數:5,代碼來源:Game.Procedures.cs


注:本文中的Sanguosha.Core.Players.Player.AcquireAdditionalSkill方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。