Example #1
0
    public void TestPound()
    {
        ICharacter characterA = Container.Resolve <ICharacter>();
        ICharacter characterB = Container.Resolve <ICharacter>();

        int hp = characterA.CurrentHP.Value;

        ISkill pound = new Pound();

        pound.Initialize(characterB, characterA);
        characterA.ApplySkill(pound);

        Assert.That(characterA.CurrentHP.Value == characterA.Stats_Total.MaxHp - characterB.Stats_Total.Strength);
    }
Example #2
0
    void Rest()
    {
        // Restore Health
        restSub = Observable.Timer(TimeSpan.FromSeconds(restTime))
                  .Subscribe(_ =>
        {
            // Health restored
            ISkill restoration = new FullRestore();
            restoration.Initialize(null, hero);
            hero.ApplySkill(restoration);

            battleUI.HeroRestored();

            NextEnemy();
            fightController.SetFight(hero, enemy);
            fightController.StartFight();
        });
    }
Example #3
0
    public void StartFight()
    {
        heroAttack = Observable.Interval(TimeSpan.FromSeconds(hero.Stats_Total.AttackRate))
                     .Subscribe(_ =>
        {
            ISkill pound = new Pound();
            pound.Initialize(hero, enemy);
            enemy.ApplySkill(pound);
        });

        enemyAttack = Observable.Interval(TimeSpan.FromSeconds(enemy.Stats_Total.AttackRate))
                      .Subscribe(_ =>
        {
            ISkill pound = new Pound();
            pound.Initialize(enemy, hero);
            hero.ApplySkill(pound);
        });
    }