コード例 #1
0
        /// <summary>
        /// Writes the monster info to the spoiler log
        /// </summary>
        /// <param name="allMonsters">The monster</param>
        /// <param name="extraItemDrops">The map of monsters to their extra item drop</param>
        private static void WriteMonsterInfoToSpoilerLog(List <Monster> allMonsters, Dictionary <string, ItemDrop> extraItemDrops)
        {
            if (!Globals.Config.Monsters.Randomize)
            {
                return;
            }

            Globals.SpoilerWrite("");
            Globals.SpoilerWrite("> Monster stats");

            foreach (Monster monster in allMonsters)
            {
                ItemDrop extraDrop = extraItemDrops[monster.Name];

                Globals.SpoilerWrite("---");
                Globals.SpoilerWrite(monster.Name);
                Globals.SpoilerWrite($"{monster.HP} HP; {monster.Damage} Damage; {monster.Resilience} Resilience; {monster.Speed} Speed");
                Globals.SpoilerWrite($"Miss chance: {monster.MissChance * 100}%");
                Globals.SpoilerWrite($"Experience: {monster.Experience}");
                Globals.SpoilerWrite($"Moves randomly for {monster.RandomMovementDuration / 1000d} seconds");
                Globals.SpoilerWrite($"Jitteriness value: {monster.Jitteriness}");
                Globals.SpoilerWrite($"Threshold until the monster moves towards players: {monster.MovesTowardPlayerThreshold}");
                Globals.SpoilerWrite($"Extra drop: {extraDrop.ItemToDrop.Name} at {extraDrop.Probability * 100}%");
            }

            Globals.SpoilerWrite("");
        }
コード例 #2
0
ファイル: Monster.cs プロジェクト: somnomania/smapi-mod-dump
 /// <summary>
 /// Constructor specifically for mines monsters
 /// </summary>
 public Monster(
     int hp,
     int damage,
     int minCoins,
     int maxCoins,
     bool isGlider,
     int randomMovementDuration,
     string itemDropString,
     int resilience,
     double jitteriness,
     int moveTowardPlayer,
     int speed,
     double missChance,
     bool isMinesMonster,
     int experience,
     string name)
 {
     HP       = hp;
     Damage   = damage;
     Coins    = new Range(minCoins, maxCoins);
     IsGlider = isGlider;
     RandomMovementDuration = randomMovementDuration;
     ItemDrops   = ItemDrop.ParseString(itemDropString);
     Resilience  = resilience;
     Jitteriness = jitteriness;
     MovesTowardPlayerThreshold = moveTowardPlayer;
     Speed          = speed;
     MissChance     = missChance;
     IsMinesMonster = isMinesMonster;
     Experience     = experience;
     Name           = name;
 }
コード例 #3
0
        /// <summary>
        /// Swaps around monster drops and adds the extra drop to each monster
        /// </summary>
        /// <param name="monster">The monster</param>
        /// <param name="swaps">The swaps</param>
        private static void RandomizeMonsterDrops(Monster monster, Dictionary <int, int> swaps, Dictionary <string, ItemDrop> extras)
        {
            SwapMonsterItemDrops(monster, swaps);

            ItemDrop extraDrop = GetRandomItemDrop();

            extras[monster.Name] = extraDrop;
            monster.ItemDrops.Add(extraDrop);
        }