Beispiel #1
0
    public static void getMonsterInfo(MonsterList list)
    {
        ulong monsterAndBuffRootPtr = loadEffectiveAddressRelative(game, monster_base_root_offset);
        uint  monsterAndBuffOffset1 = readStaticOffset(game, monster_offset_1);
        ulong lastMonsterAddress    = MemoryHelper.read_pointer_chain(game, monsterAndBuffRootPtr, monsterAndBuffOffset1, 0x8F9BC * 8, 0, 0);

        List <ulong> monsterAddresses = new List <ulong>();

        if (lastMonsterAddress < 0xffffff)
        {
            // no monsters found
            return;
        }

        ulong currentMonsterAddress = lastMonsterAddress;

        //int i = 0;
        while (currentMonsterAddress != 0)
        {
            monsterAddresses.Insert(0, currentMonsterAddress);
            lastMonsterAddress    = currentMonsterAddress;
            currentMonsterAddress = MemoryHelper.read_ulong(game.Handle, (UIntPtr)(currentMonsterAddress + PREV_MONSTER_PTR));
            //i++;
            if (currentMonsterAddress == lastMonsterAddress)
            {
                break;
            }
        }
        //Console.WriteLine(i + " monster candidates");

        foreach (ulong monsterAddress in monsterAddresses)
        {
            readMonster(monsterAddress, list);
        }
    }
Beispiel #2
0
 private void TurnOptionsOff()
 {
     Types.SetActive(false);
     Rarities.SetActive(false);
     Plates.SetActive(false);
     MonsterList.SetActive(false);
 }
        /// <summary>
        /// Add Monsters to the Round
        ///
        /// Because Monsters can be duplicated, will add 1, 2, 3 to their name
        ///

        /*
         * Hint:
         * I don't have crudi monsters yet so will add 6 new ones...
         * If you have crudi monsters, then pick from the list
         * Consdier how you will scale the monsters up to be appropriate for the characters to fight
         *
         */
        /// </summary>
        /// <returns></returns>
        public int AddMonstersToRound()
        {
            var    monsterModel = MonsterIndexViewModel.Instance;
            Random rnd          = new Random();
            int    TargetLevel  = 1;
            int    MaxLevel     = 20;


            if (CharacterList.Count() > 0)
            {
                // Get the Min Character Level (linq is soo cool....)
                TargetLevel = Convert.ToInt32(CharacterList.Min(m => m.Level));
                MaxLevel    = Convert.ToInt32(CharacterList.Max(m => m.Level));
            }

            /* Hack 31 has been implemented. If the round count is > 100
             * then the monster's speed, defense, attack, current health, and max health
             * are buffed 10x
             */
            for (var i = 0; i < MaxNumberPartyMonsters; i++)
            {
                int index = rnd.Next(0, MaxNumberPartyMonsters - 1);
                var data  = monsterModel.Dataset[index];
                data.Level         = TargetLevel;
                data.Speed         = getAttributeLevel();
                data.Defense       = getAttributeLevel();
                data.Attack        = getAttributeLevel();
                data.MaxHealth     = DiceHelper.RollDice(TargetLevel, 10);
                data.CurrentHealth = data.MaxHealth;

                MonsterList.Add(new PlayerInfoModel(data));
            }

            return(MonsterList.Count());
        }
Beispiel #4
0
        /// <summary>
        /// Add Monsters to the Round
        ///
        /// Because Monsters can be duplicated, will add 1, 2, 3 to their name
        ///

        /*
         * Hint:
         * I don't have crudi monsters yet so will add 6 new ones...
         * If you have crudi monsters, then pick from the list
         *
         * Consdier how you will scale the monsters up to be appropriate for the characters to fight
         */
        /// </summary>
        /// <returns></returns>
        public int AddMonstersToRound()
        {
            List <MonsterModel> SelectedMonsterList = DefaultData.LoadData(new MonsterModel());

            for (int i = 0; i < MaxNumberPartyMonsters; i++)
            {
                PlayerInfoModel CurrentMonster = new PlayerInfoModel(SelectedMonsterList[i]);
                CurrentMonster.ScaleLevel(GetAverageCharacterLevel());
                MonsterList.Add(CurrentMonster);
            }

            //Hack #31, When Round Count exceeds 100, Monster power becomes 10x
            if (BattleScore.RoundCount > 100)
            {
                foreach (PlayerInfoModel Monster in MonsterList)
                {
                    Monster.Attack        = 10 * Monster.Attack;
                    Monster.Speed         = 10 * Monster.Speed;
                    Monster.Defense       = 10 * Monster.Defense;
                    Monster.CurrentHealth = 10 * Monster.CurrentHealth;
                    Monster.MaxHealth     = 10 * Monster.MaxHealth;
                }
            }
            return(MonsterList.Count);
        }
        public override Task OnActivateAsync()
        {
            if (this.GetPrimaryKeyLong() == (long)BiomeId.Forest)
            {
                BiomeProperties.BaseHeight      = 0.1f;
                BiomeProperties.HeightVariation = 0.2f;
                BiomeProperties.Temperature     = 0.7f;
                BiomeProperties.Rainfall        = 0.8f;
                BiomeProperties.EnableSnow      = false;
            }

            BiomeProperties.WaterColor = 16777215;
            BiomeProperties.EnableRain = true;
            TopBlock    = BlockStates.GrassBlock();
            FillerBlock = BlockStates.Dirt();

            PlantsList.Add(PlantsType.TallGrass);
            PlantsList.Add(PlantsType.Poppy);
            PlantsList.Add(PlantsType.Dandelion);

            PassiveMobList.Add(MobType.Cow);
            PassiveMobList.Add(MobType.Sheep);
            PassiveMobList.Add(MobType.Horse);
            PassiveMobList.Add(MobType.Donkey);

            MonsterList.Add(MobType.Creeper);
            MonsterList.Add(MobType.Skeleton);
            MonsterList.Add(MobType.Zombie);
            MonsterList.Add(MobType.Spider);

            return(Task.CompletedTask);
        }
Beispiel #6
0
        public async Task <ReturnObject> GetUserMonster()
        {
            ReturnObject ReturnObject;

            MonsterList ml;

            Request.Monster.UsersMonster monsters = new Request.Monster.UsersMonster();
            monsters.SetParam(Token);

            if (App.core.Offline)
            {
                return new ReturnObject()
                       {
                           Content   = MonsterList.GetUserMonsterListFromJson(null, 12),
                           ErrorCode = 0,
                           Message   = string.Empty
                       }
            }
            ;

            try
            {
                ml = MonsterList.GetUserMonsterListFromJson(await monsters.GetJsonAsync());

                ReturnObject = new ReturnObject()
                {
                    Content = ml, ErrorCode = 0, Message = string.Empty
                };
            }
            catch (HttpRequestException HRException)
            {
                Debug.WriteLine(HRException);
                ReturnObject = new ReturnObject()
                {
                    Content = null, ErrorCode = HRException.HResult, Message = "HttpRequestException : " + HRException.Message
                };
            }
            catch (Newtonsoft.Json.JsonException jEx)
            {
                Debug.WriteLine(jEx);
                ReturnObject = new ReturnObject()
                {
                    Content = null, ErrorCode = jEx.HResult, Message = "JsonException : " + jEx.Message
                };
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
                ReturnObject = new ReturnObject()
                {
                    Content = null, ErrorCode = ex.HResult, Message = "Exception : " + ex.Message
                };
            }
            return(ReturnObject);
        }

        #endregion
    }
        // Add Monsters
        // Scale them to meet Character Strength...
        public void AddMonstersToRound()
        {
            // Check to see if the monster list is full, if so, no need to add more...
            if (MonsterList.Count() >= GameGlobals.MaxNumberPartyPlayers)
            {
                return;
            }

            // Make Sure Monster List exists and is loaded...
            var myMonsterViewModel = MonstersViewModel.Instance;

            if (myMonsterViewModel.Dataset.Count() > 0)
            {
                // Scale monsters to be within the range of the Characters

                var ScaleLevelMax     = 1;
                var ScaleLevelMin     = 1;
                var ScaleLevelAverage = 1;

                if (CharacterList.Any())
                {
                    ScaleLevelMax     = GetMaxCharacterLevel();
                    ScaleLevelMin     = GetMinCharacterLevel();
                    ScaleLevelAverage = GetAverageCharacterLevel();
                }

                // Get 1 monsters
                do
                {
                    //Force Random Roll here. Important for the debug override setting.
                    //Game will not work without a random value here
                    var rnd = HelperEngine.RollDice(1, myMonsterViewModel.Dataset.Count, true);
                    {
                        var monster = new Monster(myMonsterViewModel.Dataset[rnd - 1]);

                        // Help identify which monster it is...
                        monster.Name += " " + (1 + MonsterList.Count()).ToString();

                        // Scale the monster to be between the average level of the characters+1
                        var rndScale = HelperEngine.RollDice(1, ScaleLevelAverage + 1);
                        monster.ScaleLevel(rndScale);
                        MonsterList.Add(monster);
                    }
                } while (MonsterList.Count() < 1);
            }
            else
            {
                // No monsters in DB, so add 1 new ones...
                for (var i = 0; i < 1; i++)
                {
                    var item = new Monster();
                    // Help identify which monster it is...
                    item.Name += " " + MonsterList.Count() + 1;
                    MonsterList.Add(item);
                }
            }
        }
Beispiel #8
0
    void Start()
    {
        m_startTime = Time.time;

        m_interval = Random.Range(m_minInterval, m_maxInterval);

        m_col         = m_chargeArea.GetComponent <Collider2D>();
        m_monsterList = m_chargeArea.GetComponent <MonsterList>();
    }
        private void _timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            //TODO: Obecnie atakowany potwór nie powinien znajdować się w liście.

            float hp            = MonsterList.Single(x => x.Id == _currentMonsterId).Health;
            var   monsterhelath = _autoDamager.Attack(hp);

            Update(monsterhelath);
        }
        protected override Task Handle(RegisterMonsterListCommand command, CancellationToken cancellationToken)
        {
            var list = new MonsterList(
                command.Name,
                command.Members
                );

            return(_database.Save("monsterLists", x => x.Name == list.Name, list, cancellationToken));
        }
        private IEntity PickMonsterToSpawn(MonsterList monsterList, int power, IRandom random)
        {
            if (!monsterList.ContainsKey(power))
            {
                return(null);
            }

            return(random.PickOne(monsterList[power].ToList()));
        }
        private void FillMap(IMap map, ISystemContainer systemContainer, int power, MonsterList monsterList, IRandom random)
        {
            var mapSize = map.Cells.Count;

            var numberOfMonsters = (int)Math.Ceiling(Density * mapSize);

            for (int i = 0; i < numberOfMonsters; i++)
            {
                SpawnMonster(map, systemContainer, power, monsterList, random);
            }
        }
        /// <summary>
        /// Adds monsters to the round.
        /// Since monsters may be duplicated, appends a number to the name of each monster.
        /// </summary>
        /// <returns></returns>
        public int AddMonstersToRound(List <MonsterModel> monsters)
        {
            for (var i = 0; i < MaxNumberMonsters; i++)
            {
                var data = monsters[i];

                MonsterList.Add(data);
            }

            return(MonsterList.Count());
        }
Beispiel #14
0
        public void MonsterList(string command, string[] args)
        {
            var monsterList = new MonsterList();

            Monitor.Log(
                "Monsters available to spawn:\n\n" +
                monsterList.ToString() +
                "\n\nUse these names with 'monster_spawn'.\n" +
                "Keep in mind that some monsters don't work properly outside of the farm and the mines!\n"
                , LogLevel.Info);
        }
 /// <summary>
 /// Checks if the character list and monster list are empty.
 /// </summary>
 /// <param name="characterList"></param>
 /// <param name="monsterList"></param>
 /// <returns></returns>
 private bool AllListsAreNotEmpty(CharacterList characterList, MonsterList monsterList)
 {
     if (characterList.GetCharacterListCount() <= 0 && monsterList.GetMonsterListCount() <= 0)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
        // Sets the new state for the variables for Battle
        private void BattleEngineClearData()
        {
            //BattleScore = new Score();
            // BattleMessages = new BattleMessages();

            ItemPool.Clear();
            MonsterList.Clear();
            CharacterList.Clear();

            // Reset current player
            PlayerCurrent = null;
        }
Beispiel #17
0
        /// <summary>
        /// Have the character or monster drop all their items and returns the list of item models
        /// </summary>
        /// <param name="target"></param>
        /// <returns></returns>
        public List <ItemModel> RemoveItems(BattleEntityModel target)
        {
            switch (target.EntityType)
            {
            case (EntityTypeEnum.Character):
                return(CharacterList.Where(a => a.Id == target.Id).FirstOrDefault().DropAllItems());

            case (EntityTypeEnum.Monster):
            default:
                return(MonsterList.Where(a => a.Id == target.Id).FirstOrDefault().DropItems());
            }
        }
Beispiel #18
0
        /// <summary>
        /// Gets the roll of the damage value (including any stat boosts) of the character or monster
        /// </summary>
        /// <param name="attacker"></param>
        /// <returns></returns>
        public int GetDamage(BattleEntityModel attacker)
        {
            switch (attacker.EntityType)
            {
            case (EntityTypeEnum.Character):
                return(CharacterList.Where(a => a.Id == attacker.Id).FirstOrDefault().RollDamageDice());

            case (EntityTypeEnum.Monster):
            default:
                return(MonsterList.Where(a => a.Id == attacker.Id).FirstOrDefault().RollDamageDice());
            }
        }
Beispiel #19
0
        /// <summary>
        /// Add Monsters to the Round
        ///
        /// Because Monsters can be duplicated, will add 1, 2, 3 to their name
        /// </summary>
        /// <returns></returns>
        public int AddMonstersToRound()
        {
            for (var i = 0; i < MaxNumberPartyMonsters; i++)
            {
                var data = new MonsterModel();
                // Help identify which Monster it is
                data.Name += " " + MonsterList.Count() + 1;
                MonsterList.Add(new PlayerInfoModel(data));
            }

            return(MonsterList.Count());
        }
Beispiel #20
0
    //获取json文件,传入json文件路径
    private void GetJsonToLevelData(string path)
    {
        //如果文件不存在,则跳出该方法
        if (File.Exists(path) == false)
        {
            Logger.Log(path + "  文件不存在", LogType.Data);
            return;
        }

        //获取文件数据流读入
        StreamReader streamReader = new StreamReader(path);

        //获取json文件的string格式,可优化
        string jsonToString = streamReader.ReadToEnd();

        //获得json中的数据
        Dictionary <string, JsonData> levelData = JsonMapper.ToObject <Dictionary <string, JsonData> >(jsonToString);

        if (levelData == null)
        {
            Logger.Log("没有获取到 关卡json 文件", LogType.Data);
        }
        else
        {
            Logger.Log("已获取到关卡json数据", LogType.Data);
            //获取关卡队列
            var missions = levelData["mission"];
            for (int i = 0; i < missions.Count; ++i)
            {
                //获取某个关卡的怪物列表
                JsonData           monsterLists = missions[i]["monsterList"];
                List <MonsterList> onelist      = new List <MonsterList>();
                for (int j = 0; j < monsterLists.Count; ++j)
                {
                    MonsterList m = new MonsterList();
                    m.monsterID = (int)monsterLists[j]["monsterID"];
                    m.rate      = (float)monsterLists[j]["rate"];
                    m.wayID     = (int)monsterLists[j]["wayID"];
                    m.count     = (int)monsterLists[j]["count"];

                    onelist.Add(m);
                }
                //生成某个关卡的数据
                WaveInformation waveInformation = new WaveInformation();
                waveInformation.time         = (int)missions[i]["time"];
                waveInformation.monsterLists = onelist;

                waveQueue.Enqueue(waveInformation);
            }

            Logger.Log("成功获取关卡队列:" + waveQueue.Count, LogType.Monster);
        }
    }
Beispiel #21
0
    public static Monster CreateMonster(MonsterList monster, Game game, int level)
    {
        Monster newMonster = null;

        switch (monster)
        {
        case MonsterList.Bat:
            newMonster          = Bat.Create(level, game);
            newMonster.Behavior = new StandardMoveAndAttack();
            break;

        case MonsterList.Banshee:
            newMonster          = Banshee.Create(level, game);
            newMonster.Behavior = new TeleportAroundPlayer();
            break;

        case MonsterList.Demon:
            newMonster          = Demon.Create(level, game);
            newMonster.Behavior = new StandardMoveAndAttack();
            break;

        case MonsterList.Doll:
            newMonster          = Doll.Create(level, game);
            newMonster.Behavior = new DontLookAway();
            break;

        case MonsterList.Ghoul:
            newMonster          = Ghoul.Create(level, game);
            newMonster.Behavior = new StandardMoveAndAttack();
            break;

        case MonsterList.LivingArmor:
            newMonster          = LivingArmor.Create(level, game);
            newMonster.Behavior = new DontLookAway();
            break;

        case MonsterList.Spider:
            newMonster          = Spider.Create(level, game);
            newMonster.Behavior = new StandardMoveAndAttack();
            break;

        case MonsterList.Wraith:
            newMonster          = Wraith.Create(level, game);
            newMonster.Behavior = new TeleportAroundPlayer();
            break;
        }

        newMonster.Health = newMonster.Health + (level - 1);
        newMonster.Attack = newMonster.Attack + (level - 1);

        return(newMonster);
    }
        // Sets the new state for the variables for Battle
        public void BattleEngineClearData()
        {
            BattleScore    = new Score();
            BattleMessages = new BattleMessages();
            RoundStateEnum = RoundEnum.NewRound;

            ItemPool.Clear();
            MonsterList.Clear();
            CharacterList.Clear();

            // Reset current player
            PlayerCurrent = null;
        }
        /// <summary>
        /// Clear the List between Rounds
        /// will only clear potions and monster
        /// </summary>
        /// <returns></returns>
        private bool ClearLists()
        {
            MonsterList.Clear();
            potionPool.Clear();

            if (MonsterList.Count == 0 && potionPool.Count == 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #24
0
        /// <summary>
        /// Handle the Critical Miss event (if enabled)
        /// </summary>
        /// <param name="attacker"></param>
        /// <returns></returns>
        public bool CriticalMiss(BattleEntityModel attacker)
        {
            switch (attacker.EntityType)
            {
            case EntityTypeEnum.Monster:
                return(MonsterCriticalMiss(MonsterList.First(a => a.Id == attacker.Id)));

            case EntityTypeEnum.Character:
                return(CharacterCriticalMiss(CharacterList.First(a => a.Id == attacker.Id)));

            default:
                return(false);
            }
        }
Beispiel #25
0
        public Core()
        {
            Offline  = true;
            user     = UserInfo.GetYou();
            userList = new UserList();

            monsterList     = new MonsterList();
            monsterUserList = new MonsterList();
            userList        = new UserList();
            areaList        = new AreaList();
            //garden = new Garden.Garden();
            mapCore = new MapCore(user);
            Shop    = new Shop();
        }
Beispiel #26
0
        /// <summary>
        /// Add Monsters to the Round
        /// </summary>
        /// <returns></returns>
        public int AddMonstersToRound()
        {
            foreach (var data in MonsterIndexViewModel.Instance.Dataset)
            {
                if (MonsterList.Count() >= MaxNumberPartyMonsters)
                {
                    break;
                }
                //data.Attack += 50;
                //data.Level = 10;
                MonsterList.Add(new EntityInfoModel(data));
            }

            return(MonsterList.Count());
        }
Beispiel #27
0
        // Add Monsters
        // Scale them to meet Character Strength...
        private void AddMonstersToRound()
        {
            // Check to see if the monster list is full, if so, no need to add more...
            if (MonsterList.Count() >= 6)
            {
                return;
            }

            // TODO, determine the character strength
            // add monsters up to that strength...
            var ScaleLevelMax = 2;
            var ScaleLevelMin = 1;

            // Make Sure Monster List exists and is loaded...
            var myMonsterViewModel = MonstersViewModel.Instance;

            myMonsterViewModel.ForceDataRefresh();

            if (myMonsterViewModel.Dataset.Count() > 0)
            {
                // Get 6 monsters
                do
                {
                    var rnd = HelperEngine.RollDice(1, myMonsterViewModel.Dataset.Count);
                    {
                        var item = new Monster(myMonsterViewModel.Dataset[rnd - 1]);

                        // Help identify which monster it is...
                        item.Name += " " + (1 + MonsterList.Count()).ToString();

                        var rndScale = HelperEngine.RollDice(ScaleLevelMin, ScaleLevelMax);
                        item.ScaleLevel(rndScale);
                        MonsterList.Add(item);
                    }
                } while (MonsterList.Count() < 6);
            }
            else
            {
                // No monsters in DB, so add 6 new ones...
                for (var i = 0; i < 6; i++)
                {
                    var item = new Monster();
                    // Help identify which monster it is...
                    item.Name += " " + MonsterList.Count() + 1;
                    MonsterList.Add(item);
                }
            }
        }
        /// <summary>
        /// Round is restarted when all monsters are killed.
        /// </summary>
        /// <returns></returns>
        public bool CheckRoundRestartCondtion()
        {
            // if all monsters are dead then round is restarted
            var _aliveMonsters = MonsterList.Where(arg => arg.Alive).Count();

            if (_aliveMonsters > 0)
            {
                // some Monsters are alive
                return(false);
            }
            else
            {
                // all Monsters died
                return(true);
            }
        }
Beispiel #29
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            MonsterList monsterList = e.Parameter as MonsterList;

            try
            {
                Core.EnemieMonster    = monsterList;
                Core.UserMonster      = monsterList;
                userMonster.monster   = monsterList.monsterList[0];
                enemieMonster.monster = monsterList.monsterList[1];
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
        }
Beispiel #30
0
        // Sets the new state for the variables for Battle
        public void BattleEngineClearData()
        {
            // Create a score object
            BattleScore = new Score();

            // Create a BattleMessages object
            BattleMessage = new BattleMessages();

            // Clear the lists
            ItemPool.Clear();
            MonsterList.Clear();
            CharacterList.Clear();

            // Reset current player
            PlayerCurrent = null;
        }