public void Turn(BuffPool buffPool) { if (buffPool.Count > 0) { turnStages[current].StageRun(buffPool); } current++; if (current >= turnStages.Count) { current = 0; } }
public independentBuff(BuffPool buffPool, int duration, RoleBase owner) : base(buffPool, duration, owner) { }
public limitedBuff(BuffPool buffPool, int duration, RoleBase owner) : base(buffPool, duration, owner) { }
public BuffBase(BuffPool buffPool, int duration, RoleBase owner) { this.buffPool = buffPool; this.duration = duration; this.owner = owner; }
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(); }
public override void StageRun(BuffPool buffPool) { buffPool.turnEnd(); }
public override void StageRun(BuffPool buffPool) { buffPool.turnAccept(); }
public virtual void StageRun(BuffPool buffPool) { }
public RagelimitedBuff(BuffPool buffPool, int duration, RoleBase owner, int rageNumber, int costHpNumber) : base(buffPool, duration, owner) { this.rageNumber = rageNumber; this.costHpNumber = costHpNumber; }
public ReplylimitedBuff(BuffPool buffPool, int duration, RoleBase owner, int replayNumber) : base(buffPool, duration, owner) { this.replayNumber = replayNumber; }
public Reinforce(BuffPool buffPool, int duration, RoleBase owner) : base(buffPool, duration, owner) { }