Exemple #1
0
        public void AddFoeStage(FoeCard foe, List <WeaponCard> weapons = null)
        {
            if (this.stages.Count >= this.numStages)
            {
                throw new Exception("Quest stage limit exceeded");
            }

            QuestArea area = new QuestArea(foe);

            this.sponsor.Hand.Transfer(area, foe);
            if (weapons != null)
            {
                foreach (WeaponCard weapon in weapons)
                {
                    this.sponsor.Hand.Transfer(area, weapon);
                }
            }

            this.stages.Add(area);

            string stageString = foe.ToString();

            if (weapons != null && weapons.Count > 0)
            {
                stageString += " with weapons " + Utils.Stringify.CommaList(weapons);
            }
            this.match.Log(this.sponsor.Username + " adding " + area.BattlePoints() + "BP stage " + stageString);
        }
Exemple #2
0
        public void SetupNextStage()
        {
            if (this.sponsor.Behaviour is HumanPlayer)
            {
                this.stageBuilder = new QuestArea();
                this.match.Controller.RequestStage(this.sponsor);
            }
            else if (this.sponsor.Behaviour != null)
            {
                // Player behaviour functions for individual stage setup.
                List <AdventureCard>[] stages = this.sponsor.Behaviour.SetupQuest(this, this.sponsor.Hand);
                foreach (List <AdventureCard> stage in stages)
                {
                    if (stage.Count == 1 && stage[0] is TestCard)
                    {
                        this.AddTestStage((TestCard)stage[0]);
                    }
                    else
                    {
                        FoeCard           foe     = (FoeCard)stage.Find(x => x is FoeCard);
                        List <WeaponCard> weapons = stage.FindAll(x => x is WeaponCard).Cast <WeaponCard>().ToList();
                        this.AddFoeStage(foe, weapons);
                    }
                }

                this.StageResponse();
            }
        }