Exemple #1
0
    public void TestAusdauerBonus()
    {
        mCharacter.Spezies = Races.Mensch;
        CharacterEngine.ComputeBasisKo(this.mCharacter);         //Stärke
        CharacterEngine.ComputeBasisGs(this.mCharacter);         //Gs
        CharacterEngine.ComputeAbgeleiteteEigenschaften(this.mCharacter);

        int AusB = this.mCharacter.AusB;

        Assert.LessOrEqual(AusB, _MAX_AUSB);
    }
Exemple #2
0
    public void TestLPsForAllRaces()
    {
        var races = Enum.GetValues(typeof(Races));

        try {
            foreach (Races race in races)
            {
                mCharacter.Spezies = race;
                CharacterEngine.ComputeBasisKo(this.mCharacter);
                CharacterEngine.ComputeAPLP(this.mCharacter);

                switch (mCharacter.Spezies)
                {
                case Races.Mensch:
                    Assert.GreaterOrEqual(mCharacter.LP, _MIN_LP_MENSCH, "Mensch zu wenig LP");
                    Assert.LessOrEqual(mCharacter.LP, _MAX_LP_MENSCH, "Mensch zu viel LP");
                    break;

                case Races.Elf:
                    Assert.GreaterOrEqual(mCharacter.LP, _MIN_LP_ELF, "Elf zu wenig LP");
                    Assert.LessOrEqual(mCharacter.LP, _MAX_LP_ELF, "Elf zu viel LP");
                    break;

                case Races.Berggnom:
                case Races.Waldgnom:
                    Assert.GreaterOrEqual(mCharacter.LP, _MIN_LP_GNOM, "Gnom zu wenig LP");
                    Assert.LessOrEqual(mCharacter.LP, _MAX_LP_GNOM, "Gnom zu viel LP");
                    break;

                case Races.Halbling:
                    Assert.GreaterOrEqual(mCharacter.LP, _MIN_LP_HALBLING, "Halbling zu wenig LP");
                    Assert.LessOrEqual(mCharacter.LP, _MAX_LP_HALBLING, "Halbling zu viel LP");
                    break;

                case Races.Zwerg:
                    Assert.GreaterOrEqual(mCharacter.LP, _MIN_LP_ZWERG, "Zwerg zu wenig LP");
                    Assert.LessOrEqual(mCharacter.LP, _MAX_LP_ZWERG, "Zwerg zu viel LP");
                    break;

                default:
                    break;
                }
            }
        } catch (AssertionException aEx) {
            Debug.Log(aEx.ToString());
            Assert.Fail();
        }
    }
    public void TestWkSb()
    {
        mCharacter.Spezies  = Races.Mensch;
        mCharacter.Archetyp = AbenteuerTyp.Gl;         //egal

        CharacterEngine.ComputeBasisIn(this.mCharacter);
        CharacterEngine.ComputeBasisKo(this.mCharacter);
        CharacterEngine.ComputePsychisch(this.mCharacter);

        CharacterEngine.ComputePsychisch(this.mCharacter);

        Assert.GreaterOrEqual(mCharacter.Wk, _MIN_D100);
        Assert.LessOrEqual(mCharacter.Wk, _MAX_D100);

        Assert.GreaterOrEqual(mCharacter.Sb, _MIN_D100);
        Assert.LessOrEqual(mCharacter.Sb, _MAX_D100);

        Debug.Log(mCharacter.Sb);
    }
    public void TestKonstitutionForAllRaces()
    {
        //Transformiere Enum nach Value
        var races = Enum.GetValues(typeof(Races));

        try {
            foreach (Races race in races)
            {
                _mCharacter.Spezies = race;
                int Ko = CharacterEngine.ComputeBasisKo(this._mCharacter);
                switch (_mCharacter.Spezies)
                {
                case Races.Mensch:
                case Races.Halbling:
                    Assert.LessOrEqual(Ko, this._EIGENSCHAFT_MAX);
                    Assert.GreaterOrEqual(Ko, this._EIGENSCHAFT_MIN);
                    break;

                case Races.Elf:
                    Assert.GreaterOrEqual(Ko, this._KO_MIN_ELF, "Elfenkonstitution zu gering");
                    break;

                case Races.Berggnom:
                case Races.Waldgnom:
                    Assert.GreaterOrEqual(Ko, this._KO_MIN_GNOM, "Gnomenkonstitution zu gering");
                    break;

                case Races.Zwerg:
                    Assert.GreaterOrEqual(Ko, this._KO_MIN_ZWERG, "Zwergenkonstitution zu gering");
                    break;

                default:
                    break;
                }
            }
        } catch (AssertionException asEx) {
            Debug.Log(asEx.ToString());
            Assert.Fail();
        }
    }
Exemple #5
0
    public void SetBasisKo()
    {
        Toolbox globalVars = Toolbox.Instance;

        inKo.text = CharacterEngine.ComputeBasisKo(globalVars.mCharacter).ToString();
    }
Exemple #6
0
    public void TestAPsForAllATypen()
    {
        mCharacter.Spezies = Races.Mensch;         //Rasse spielt keine Rolle bei Max- und Minwerten
        var aTypen = Enum.GetValues(typeof(AbenteuerTyp));

        try {
            foreach (AbenteuerTyp aTyp in aTypen)
            {
                //Debug.Log(aTyp);
                this.mCharacter.Archetyp = aTyp;
                CharacterEngine.ComputeBasisSt(this.mCharacter);                  //Stärke
                CharacterEngine.ComputeBasisKo(this.mCharacter);                  //Konstitution -> für AusB
                CharacterEngine.ComputeAbgeleiteteEigenschaften(this.mCharacter);
                CharacterEngine.ComputeAPLP(this.mCharacter);

                switch (this.mCharacter.Archetyp)
                {
                case AbenteuerTyp.BN:
                case AbenteuerTyp.BS:
                case AbenteuerTyp.BW:
                case AbenteuerTyp.Kr:
                case AbenteuerTyp.Soe:
                    Assert.GreaterOrEqual(mCharacter.AP, this._MIN_AP_KÄMPFER_I, "Kä I zu wenig AP " + mCharacter.AP);
                    Assert.LessOrEqual(mCharacter.AP, this._MAX_AP_KÄMPFER_I, "Kä I zu viel AP " + mCharacter.AP);
                    break;

                case AbenteuerTyp.As:
                case AbenteuerTyp.Er:
                case AbenteuerTyp.Gl:
                case AbenteuerTyp.Hä:
                case AbenteuerTyp.Ku:
                case AbenteuerTyp.Se:
                case AbenteuerTyp.Sp:
                case AbenteuerTyp.Sc:
                case AbenteuerTyp.Ba:
                case AbenteuerTyp.Or:
                case AbenteuerTyp.Tm:
                    Assert.GreaterOrEqual(mCharacter.AP, this._MIN_AP_KÄMPFER_II, "Kä II zu wenig AP " + mCharacter.AP);
                    Assert.LessOrEqual(mCharacter.AP, this._MAX_AP_KÄMPFER_II, "Kä II zu viel AP " + mCharacter.AP);
                    break;

                case AbenteuerTyp.Be:
                case AbenteuerTyp.Dr:
                case AbenteuerTyp.Hl:
                case AbenteuerTyp.Hx:
                case AbenteuerTyp.Ma:
                case AbenteuerTyp.PF:
                case AbenteuerTyp.PHa:
                case AbenteuerTyp.PHe:
                case AbenteuerTyp.PK:
                case AbenteuerTyp.PM:
                case AbenteuerTyp.PT:
                case AbenteuerTyp.PW:
                case AbenteuerTyp.Th:
                    Assert.GreaterOrEqual(mCharacter.AP, this._MIN_AP_ZAUBERER, "Zauberer zu wenig AP " + mCharacter.AP);
                    Assert.LessOrEqual(mCharacter.AP, this._MAX_AP_ZAUBERER, "Zauberer zu viel AP " + mCharacter.AP);
                    break;

                default:
                    break;
                }
            }
        } catch (AssertionException asEx) {
            Debug.Log(asEx.ToString());
            Assert.Fail();
        }
    }