Exemplo n.º 1
0
        public int CharacterDropItem(EntityInfoModel Target)
        {
            var DroppedMessage = "\nItems Dropped : \n";

            // Drop Items to ItemModel Pool
            var myItemList = Target.DropAllItems();


            // Add to ScoreModel
            foreach (var ItemModel in myItemList)
            {
                BattleScore.ItemsDroppedList += ItemModel.FormatOutput() + "\n";
                DroppedMessage += ItemModel.Name + "\n";
            }

            ItemPool.AddRange(myItemList);

            if (myItemList.Count == 0)
            {
                DroppedMessage = " Nothing dropped. ";
            }

            BattleMessageModel.DroppedMessage = DroppedMessage;

            BattleScore.ItemModelDropList.AddRange(myItemList);

            return(myItemList.Count());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Drop Items
        /// </summary>
        /// <param name="Target"></param>
        public int DropItems(PlayerInfoModel Target)
        {
            var DroppedMessage = "\nItems Dropped : \n";

            // Drop Items to ItemModel Pool
            var myItemList = Target.DropAllItems();

            // I feel generous, even when characters die, random drops happen :-)
            // If Random drops are enabled, then add some....
            myItemList.AddRange(GetRandomMonsterItemDrops(BattleScore.RoundCount));

            // Add to ScoreModel
            foreach (var ItemModel in myItemList)
            {
                BattleScore.ItemsDroppedList += ItemModel.FormatOutput() + "\n";
                DroppedMessage += ItemModel.Name + "\n";
            }

            ItemPool.AddRange(myItemList);

            if (myItemList.Count == 0)
            {
                DroppedMessage = " Nothing dropped. ";
            }

            BattleMessagesModel.TurnMessageSpecial += DroppedMessage;

            BattleScore.ItemModelDropList.AddRange(myItemList);

            return(myItemList.Count());
        }
Exemplo n.º 3
0
        /// <summary>
        /// Have the target drop all their items
        /// </summary>
        /// <param name="target"></param>
        /// <returns></returns>
        public int DropItems(BattleEntityModel target)
        {
            // Reset item drop message
            BattleMessages.ItemDropMessage = string.Empty;

            // Drop Items to ItemModel Pool
            var myItemList = RemoveItems(target);

            // Add monster drop items
            if (target.EntityType == EntityTypeEnum.Monster)
            {
                myItemList.AddRange(GetRandomMonsterItemDrops(myItemList));

                if (CloudItemDropEnabled)
                {
                    var cloudItem = Task.Run(async() => await GetExternalItem(target.Level)).Result;

                    if (cloudItem != null)
                    {
                        myItemList.Add(cloudItem);
                    }
                }

                //// Hackathon Scenario 10
                //if (myItemList.Count == 1)
                //{
                //    var diceroll = DiceHelper.RollDice(1, 10);
                //    if (diceroll == 1)
                //    {
                //        var damageroll = DiceHelper.RollDice(1, 4);
                //        var damage = Score.RoundCount * damageroll;
                //        BattleMessages.ItemDropMessage += "GRENADE dropped!";
                //        Debug.WriteLine(BattleMessages.TurnMessageSpecial);

                //        foreach (var monster in MonsterList)
                //        {
                //            // monsters take damage
                //            TakeDamage(EntityList.First(a => a.Id == monster.Id), damage);
                //            // remove monsters if dead
                //            var dead = RemoveIfDead(EntityList.First(a => a.Id == monster.Id));
                //            // add dead monsters' items to myItemList
                //            if (dead)
                //            {
                //                var monsterItemList = RemoveItems(EntityList.First(a => a.Id == monster.Id));
                //                myItemList.AddRange(GetRandomMonsterItemDrops(monsterItemList));
                //            }
                //        }
                //    }
                //}
            }
            var itemsForPool = new List <ItemModel>();

            // Add to ScoreModel
            foreach (var ItemModel in myItemList)
            {
                if (ItemModel != null)
                {
                    Score.ItemsDroppedList         += ItemModel.FormatOutput() + "\n";
                    BattleMessages.ItemDropMessage += "\n" + ItemModel.Name + " dropped";

                    itemsForPool.Add(ItemModel);
                }
            }

            Debug.WriteLine(BattleMessages.ItemDropMessage);

            ItemPool.AddRange(itemsForPool);

            return(myItemList.Count());
        }