Exemplo n.º 1
0
        public void Turn(BuffPool buffPool)
        {
            if (buffPool.Count > 0)
            {
                turnStages[current].StageRun(buffPool);
            }

            current++;
            if (current >= turnStages.Count)
            {
                current = 0;
            }
        }
Exemplo n.º 2
0
 public independentBuff(BuffPool buffPool, int duration, RoleBase owner) : base(buffPool, duration, owner)
 {
 }
Exemplo n.º 3
0
 public limitedBuff(BuffPool buffPool, int duration, RoleBase owner) : base(buffPool, duration, owner)
 {
 }
Exemplo n.º 4
0
 public BuffBase(BuffPool buffPool, int duration, RoleBase owner)
 {
     this.buffPool = buffPool;
     this.duration = duration;
     this.owner    = owner;
 }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            TurnStructure turnStructure = new TurnStructure();

            turnStructure.Attach(new StartStage());
            turnStructure.Attach(new AcceptStage());
            turnStructure.Attach(new EndStage());

            BuffPool buffPool = new BuffPool();
            RoleBase player   = new RoleBase("Player");
            RoleBase enemy    = new RoleBase("Enemy");

            Console.WriteLine("第一回合");
            turnStructure.Turn(buffPool);
            turnStructure.Turn(buffPool);
            turnStructure.Turn(buffPool);

            ReplylimitedBuff reply = new ReplylimitedBuff(buffPool, 3, player, 1);

            buffPool.AddBuff(reply);

            RagelimitedBuff rage = new RagelimitedBuff(buffPool, 5, enemy, 2, 10);

            buffPool.AddBuff(rage);

            Console.WriteLine("第二回合");
            turnStructure.Turn(buffPool);
            turnStructure.Turn(buffPool);
            turnStructure.Turn(buffPool);
            player.Display();
            enemy.Display();

            ReplylimitedBuff reply2 = new ReplylimitedBuff(buffPool, 5, enemy, 3);

            buffPool.AddBuff(reply2);

            RagelimitedBuff rage2 = new RagelimitedBuff(buffPool, 5, enemy, 5, 10);

            buffPool.AddBuff(rage2);

            Console.WriteLine("第三回合");
            turnStructure.Turn(buffPool);
            turnStructure.Turn(buffPool);
            turnStructure.Turn(buffPool);
            player.Display();
            enemy.Display();

            Console.WriteLine("第四回合");
            turnStructure.Turn(buffPool);
            turnStructure.Turn(buffPool);
            turnStructure.Turn(buffPool);
            player.Display();
            enemy.Display();

            Reinforce reinforce = new Reinforce(buffPool, 2, player);

            buffPool.AddBuff(reinforce);

            Console.WriteLine("第五回合");
            turnStructure.Turn(buffPool);
            turnStructure.Turn(buffPool);

            Console.WriteLine("回合中");
            player.Display();
            enemy.Display();

            turnStructure.Turn(buffPool);
            Console.WriteLine("回合结束后");
            player.Display();
            enemy.Display();

            Reinforce reinforce2 = new Reinforce(buffPool, 2, player);

            buffPool.AddBuff(reinforce2);

            Console.WriteLine("第六回合");
            turnStructure.Turn(buffPool);
            turnStructure.Turn(buffPool);

            Console.WriteLine("回合中");
            player.Display();
            enemy.Display();
            turnStructure.Turn(buffPool);
            Console.WriteLine("回合结束后");
            player.Display();
            enemy.Display();

            Console.Read();
        }
Exemplo n.º 6
0
 public override void StageRun(BuffPool buffPool)
 {
     buffPool.turnEnd();
 }
Exemplo n.º 7
0
 public override void StageRun(BuffPool buffPool)
 {
     buffPool.turnAccept();
 }
Exemplo n.º 8
0
 public virtual void StageRun(BuffPool buffPool)
 {
 }
Exemplo n.º 9
0
 public RagelimitedBuff(BuffPool buffPool, int duration, RoleBase owner, int rageNumber, int costHpNumber) : base(buffPool, duration, owner)
 {
     this.rageNumber   = rageNumber;
     this.costHpNumber = costHpNumber;
 }
Exemplo n.º 10
0
 public ReplylimitedBuff(BuffPool buffPool, int duration, RoleBase owner, int replayNumber) : base(buffPool, duration, owner)
 {
     this.replayNumber = replayNumber;
 }
Exemplo n.º 11
0
 public Reinforce(BuffPool buffPool, int duration, RoleBase owner) : base(buffPool, duration, owner)
 {
 }