Esempio n. 1
0
        public Merchant()
            : base()
        {
            float dmgMin = randed.Instance.rand.Next(5, 11);
            float dmgMax = randed.Instance.rand.Next(15, 26);
            float dodge  = randed.Instance.rand.Next(0, 7);
            int   armor  = randed.Instance.rand.Next(15, 36);
            float health = randed.Instance.rand.Next(80, 101);
            float mana   = 0;

            magic = false;
            melee = false;
            range = false; // true just for testing;
            stats = new Osobini(dmgMin, dmgMax, dodge, armor, health, mana);
            if (lista == null)
            {
                lista = new List <Item>();
            }
            else
            {
                lista.Clear();
            }
            for (int i = 0; i < 19; i++)
            {
                this.lista.Add(fact.create_MercItem());
            }
            this.lista.Add(fact.create_Berries(10));
            type = "Merchant";
            stats.set_maxHP(stats.health);
            stats.set_maxMP(stats.mana);
        }
Esempio n. 2
0
        public void calculate_bonus() // IMA GOLEMA POTREBA OD BALANSIRANJE !!!!!
        {
            level_up_exp = 100 * stepen(level);
            float   str   = this.stats.x;
            float   dex   = this.stats.y;
            float   intel = this.stats.z;
            Osobini pom   = this.equipment.get_Stats();

            //Osobini pom = new Osobini();
            //Str bonusi 1 str= 0.6 max dmg, 0.2 min/max dmg,1.2 armor,3 health
            pom.health += str * 3;
            pom.dmgMax += (int)(str / 5) * 3;
            if (!(str % 5 == 0))
            {
                if (str % 5 > 2)
                {
                    pom.dmgMax += 2;
                }
                else
                {
                    pom.dmgMax++;
                }
            }
            pom.dmgMax += (int)(str / 5);
            pom.dmgMin += (int)(str / 5);
            pom.armor  += ((int)str + (int)(str / 5));

            //Dex bonusi   1 dex = 0.5 dodge , 0.5 armor , 1 min/max dmg,1.5 hp
            pom.dmgMax += (int)(dex);
            pom.dmgMin += (int)(dex);
            pom.health += ((int)dex + ((int)dex / 2));
            pom.armor  += (int)(dex / 2);
            pom.dodge  += (int)(dex / 2);

            //Int Bonusi  1 int = 5 mana,2.75 hp,0.5 min/max dmg,0.5 armor;
            pom.mana   += (int)(5 * intel);
            pom.health += ((int)(2 * intel) + (int)(intel / 4));
            pom.dmgMax += (int)(intel / 2);
            pom.dmgMin += (int)(intel / 2);
            pom.armor  += (int)(intel / 2);
            //nesto?
            pom.set_maxHP(pom.health);
            pom.set_maxMP(pom.mana);
            //moment of truth;
            if (bonuses == null)
            {
                bonuses = pom;
            }
            else
            {
                //  System.Windows.Forms.MessageBox.Show(bonuses.health + " your health pre check");// ima tuka greshka
                bonuses.health = bonuses.health * (pom.maxHealth / this.bonuses.maxHealth);
                bonuses.set_maxHP(pom.maxHealth);
                bonuses.mana = bonuses.mana * (pom.maxMana / this.bonuses.maxMana);
                bonuses.set_maxMP(pom.maxMana);
                bonuses.armor  = pom.armor;
                bonuses.dmgMax = pom.dmgMax;
                bonuses.dmgMin = pom.dmgMin;
                bonuses.dodge  = pom.dodge;
            }

            //   System.Windows.Forms.MessageBox.Show(bonuses.health + " your health");
        }