Example #1
0
File: ucNPC.cs Project: Tonaplo/RPG
        public ucNPC(NPC _npc)
        {
            InitializeComponent();

            this.BackColor = Color.Transparent;
            npc = _npc;
            lbNPCName.Text = npc.UnitName + " the Level " + npc.UnitLevel + " " + npc.TypeOfNPC;
            labelHealthRemaining.Width = flpHealthBar.Width;
            labelHealthRemaining.Text = npc.CurrentHP.IntValue + "/" + npc.BuffedHP.IntValue + " (100%)";

            foreach (var item in _npc.UnitActiveAbilities)
            {
                flpAbilitiesAndPassives.Controls.Add(new ucAbilityIcon(item));
            }

            switch (_npc.TypeOfNPC)
            {
                case EnumMonsterType.Dragon:
                    pictureBoxNPC.Image = Properties.Resources.dragon;
                    break;
                case EnumMonsterType.Humanoid:
                    pictureBoxNPC.Image = Properties.Resources.humanoid;
                    break;
                case EnumMonsterType.Beast:
                    pictureBoxNPC.Image = Properties.Resources.beast;
                    break;
                case EnumMonsterType.Undead:
                    pictureBoxNPC.Image = Properties.Resources.undead;
                    break;
                case EnumMonsterType.Null:
                    break;
                default:
                    break;
            }
        }
Example #2
0
        /// <summary>
        /// Constructor for the Battle Form. Only supports Singleplayer combat atm
        /// </summary>
        /// <param name="_listOfChars"></param>
        /// <param name="_difficulty"></param>
        public BattleForm(List<Core.Units.Character> _listOfChars, int _difficulty, RPG.Core.PlayerSettings settings)
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.CenterParent;
            this.BackgroundImage = GeneralFunctions.ResizeImage(Properties.Resources.background, labelBackgroundIGNORE.Size);
            Function.SoundManager.PlayMain(settings.SoundOn, this, settings.SoundVolume);

            numberOfPlayers = _listOfChars.Count;

            battleChars = _listOfChars;

            int sum = 0;

            foreach (var item in battleChars)
            {
                sum += item.UnitLevel;
                liveChars.Add(item.UnitName);
            }

            int average = (int)(sum / battleChars.Count);

            enemy = WorldGeneration.GenerateNPC(null, average, _difficulty, EnumMonsterType.Null, battleChars.Count);
            ai = WorldGeneration.GenerateNPCAI(enemy,  battleChars);
            enemy = ai.ModifiedNPC;

            foreach (var item in battleChars)
            {
                ucCharacterBattle ucb = new ucCharacterBattle(item, battleChars.Count);
                ucb.AttackClicked += ucb_AttackClicked;
                flpCharacters.Controls.Add(ucb);
            }

            flpNPCs.Controls.Add(new ucNPC(enemy));
        }
Example #3
0
        public override void UpdateQuest(Player _player, int _difficulty, NPC _enemy, int _healingDone, int _damageDone, double _charPercent, List<EnumCharClass> _class, bool battleWasWon)
        {
            if (classList.Count == 0)
            {
                classList = Function.PlayerQuestHandler.ReturnClassesForQuest(_player, 3);
                this.questText = "Defeat 3 opponents of Easy difficulty with a " + classList[0] + ", " + classList[1] + " or " + classList[2];
            }

            if (_difficulty == -2 && classList.Intersect(_class).Count() != 0 && battleWasWon)
            {
                this.currentValue++;
                if (currentValue == finalValue)
                    this.EndQuest(_player);
            }
        }
Example #4
0
        public Battle(List<Core.Units.Character> _listOfChars, int _difficulty)
        {
            battleChars = _listOfChars;

            int sum = 0;

            foreach (var item in battleChars)
            {
                sum += item.UnitLevel;
            }

            int average = (int)(sum/battleChars.Count);

            enemy = WorldGeneration.GenerateNPC("", average, _difficulty, EnumMonsterType.Null, battleChars.Count);
            ai = WorldGeneration.GenerateNPCAI(enemy, battleChars);
        }
Example #5
0
        private void CheckForQuest(int difficulty, Core.Units.NPC enemy, int healingdone, double percent, List <Core.EnumCharClass> usedclass, bool battleWasWon)
        {
            if (player.CurrentQuest != null)
            {
                player.CurrentQuest.UpdateQuest(player, difficulty, enemy, healingdone, enemy.BuffedHP.IntValue, percent, usedclass, battleWasWon);

                if (player.CurrentQuest.questcompleted == true)
                {
                    PlayerQuestHandler.BeginNewQuest(player);
                }
            }
            else
            {
                Function.PlayerQuestHandler.BeginNewQuest(player);
            }
        }
Example #6
0
 public override void UpdateQuest(Player _player, int _difficulty, NPC _enemy, int _healingDone, int _damageDone, double _charPercent, List<EnumCharClass> _class, bool battleWasWon)
 {
     if (_difficulty == -4 && battleWasWon)
     {
         this.currentValue++;
         if (currentValue == 5)
             this.EndQuest(_player);
     }
 }
Example #7
0
 public virtual void UpdateQuest(Player _player, int _difficulty, NPC _enemy, int _healingDone, int _damageDone, double _charPercent, List<EnumCharClass> _class, bool battleWasWon)
 {
 }
Example #8
0
        public override void UpdateQuest(Player _player, int _difficulty, NPC _enemy, int _healingDone, int _damageDone, double _charPercent, List<EnumCharClass> _class, bool battleWasWon)
        {
            if (monsterType == null)
            {
                monsterType = Function.PlayerQuestHandler.ReturnRandomMonsterType();

            }
            this.questText = "Defeat 3 " + monsterType + " of Normal difficulty";

            if (_difficulty == 0 && monsterType == _enemy.TypeOfNPC && battleWasWon)
            {
                this.currentValue++;
                if (currentValue == finalValue)
                    this.EndQuest(_player);
            }
        }