Ejemplo n.º 1
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            Properties.Settings.Default.Freindship = Monster.MonsterFriendShip;// Should update without these two but had an issue
            Monster.MonsterFriendShip = Properties.Settings.Default.Freindship;

            Monster.MonsterFriendShip += 1;
            StatsCustomControl.FriendshipLblUpdate(Monster.MonsterFriendShip);
        }
Ejemplo n.º 2
0
 private static void GetSettings()
 {
     Monster.MonsterName       = Properties.Settings.Default.Name;
     Monster.MonsterXp         = Properties.Settings.Default.Xp;
     Monster.MonsterAttack     = Properties.Settings.Default.Attack;
     Monster.MonsterMaxHealth  = Properties.Settings.Default.MaxHealth;
     Monster.MonsterHealth     = Properties.Settings.Default.Health;
     Monster.MonsterLvl        = Properties.Settings.Default.Lvl;
     Monster.MonsterFriendShip = Properties.Settings.Default.Freindship;
     StatsCustomControl.AttackLblUpdate(Monster.MonsterAttack.ToString());
     StatsCustomControl.HealthLblUpdate(Monster.MonsterHealth, Monster.MonsterMaxHealth);
 }
Ejemplo n.º 3
0
        public static void EveryTick(object sender, EventArgs e)
        {
            StatsCustomControl.TimePlayedLblUpdate(.001);

            MonsterXp = Logger.LetterPoints;

            switch (MonsterLvl)
            {
            case 0:
                _newXpGate = 2;
                break;

            case 1:
                _newXpGate = 10;
                break;

            default:
            {
                if (MonsterLvl <= 6)
                {
                    _newXpGate = Math.Round(Math.Pow(2, MonsterLvl - 1)) * 5;
                }
                else if (MonsterLvl <= 10)
                {
                    _newXpGate = Math.Round(Math.Pow(2, MonsterLvl - 1) * 2);
                }
                else
                {
                    _newXpGate = Math.Round(Math.Pow(2, MonsterLvl - 1) + 2);
                }
                break;
            }
            }

            StatsCustomControl.XpLblUpdate(MonsterXp.ToString(), _newXpGate.ToString());


            if (MonsterXp < _newXpGate)
            {
                return;
            }

            MonsterLvl++; //LEVEL UP!
            MainCustomControl.LvlLabel1Update(MonsterLvl.ToString());
            StatsCustomControl.LvlLabel2Update(MonsterLvl.ToString());

            MonsterHealth    += 5;
            MonsterMaxHealth += 5;
            StatsCustomControl.HealthLblUpdate(MonsterHealth, MonsterMaxHealth);

            if (MonsterLvl % 5 == 0)
            {
                MonsterAttack += 5;
                StatsCustomControl.AttackLblUpdate(MonsterAttack.ToString());
            }

            using (var soundPlayer = new SoundPlayer(Application.StartupPath + @"\LevelUp.wav"))
            {
                soundPlayer.Play();
            }

            Logger.LetterPoints = 0;
            MonsterXp           = 0; //reset points and xp
            MainForm.SaveSettings();
        }