Exemplo n.º 1
0
    // Add individual monster placements for hero count
    public void AddPlacedMonsters(EventManager.MonsterEvent me, int count)
    {
        // Get monster placement image
        Texture2D newTex = ContentData.FileToTexture(me.cMonster.imagePlace);

        // Check load worked
        if (newTex == null)
        {
            ValkyrieDebug.Log("Error: Cannot load monster image");
            Application.Quit();
        }

        // Get placement dimensions
        int x = 1;
        int y = 1;

        if (me.cMonster.ContainsTrait("medium") || me.cMonster.ContainsTrait("huge"))
        {
            x = 2;
        }
        if (me.cMonster.ContainsTrait("huge") || me.cMonster.ContainsTrait("massive"))
        {
            y = 2;
        }
        if (me.cMonster.ContainsTrait("massive"))
        {
            x = 3;
        }

        // All all placements
        foreach (string s in me.qMonster.placement[count])
        {
            AddPlacedMonsterImg(s, newTex, x, y);
        }
    }
Exemplo n.º 2
0
    // Monsters are only on the board during an event
    public void AddMonster(EventManager.MonsterEvent me)
    {
        Game game  = Game.Get();
        int  count = 0;

        // Get number of heroes
        foreach (Quest.Hero h in game.quest.heroes)
        {
            if (h.heroData != null)
            {
                count++;
            }
        }

        // Check for a placement list at this hero count
        if (me.qMonster.placement[count].Length == 0)
        {
            // group placement
            AddAreaMonster(me.qMonster);
        }
        else
        {
            // Individual monster placement
            AddPlacedMonsters(me, count);
        }
    }
Exemplo n.º 3
0
 // Initialise from monster event
 public Monster(EventManager.MonsterEvent monsterEvent)
 {
     monsterData = monsterEvent.cMonster;
     unique      = monsterEvent.qMonster.unique;
     uniqueTitle = monsterEvent.GetUniqueTitle();
     uniqueText  = monsterEvent.qMonster.uniqueText;
 }
Exemplo n.º 4
0
    // Monsters are only on the board during an event
    public void AddMonster(EventManager.MonsterEvent me)
    {
        Game game  = Game.Get();
        int  count = 0;

        // Get number of heroes
        foreach (Quest.Hero h in game.quest.heroes)
        {
            if (h.heroData != null)
            {
                count++;
            }
        }

        if (game.gameType is MoMGameType)
        {
            Texture2D newTex = ContentData.FileToTexture(me.cMonster.image);
            AddPlacedMonsterImg("", newTex, 1, 1, me.qEvent.location.x, me.qEvent.location.y);
        }
        // Check for a placement list at this hero count
        else if (me.qMonster.placement[count].Length == 0)
        {
            if (me.cMonster.ContainsTrait("lieutenant"))
            {
                Texture2D newTex = ContentData.FileToTexture(me.cMonster.image);
                AddPlacedMonsterImg("", newTex, 1, 1, me.qEvent.location.x, me.qEvent.location.y);
            }
            else
            {
                // group placement
                AddAreaMonster(me.qMonster);
            }
        }
        else
        {
            // Individual monster placement
            AddPlacedMonsters(me, count);
        }
    }
Exemplo n.º 5
0
    public void AddMonster(EventManager.MonsterEvent me)
    {
        Game game  = Game.Get();
        int  count = 0;

        foreach (Quest.Hero h in game.quest.heroes)
        {
            if (h.heroData != null)
            {
                count++;
            }
        }

        if (me.qMonster.placement[count].Length == 0)
        {
            AddAreaMonster(me.qMonster);
        }
        else
        {
            AddPlacedMonsters(me, count);
        }
    }
Exemplo n.º 6
0
        // Initialise from monster event
        // When an event adds a monster group this is called
        public Monster(EventManager.MonsterEvent monsterEvent)
        {
            monsterData = monsterEvent.cMonster;
            unique      = monsterEvent.qMonster.unique;
            uniqueTitle = monsterEvent.GetUniqueTitle();
            uniqueText  = monsterEvent.qMonster.uniqueText;

            Game          game = Game.Get();
            HashSet <int> dupe = new HashSet <int>();

            foreach (Monster m in game.quest.monsters)
            {
                if (m.monsterData == monsterData || m.duplicate != 0)
                {
                    dupe.Add(m.duplicate);
                }
            }

            while (dupe.Contains(duplicate))
            {
                duplicate++;
            }
        }
Exemplo n.º 7
0
        // Initialise from monster event
        // When an event adds a monster group this is called
        public Monster(EventManager.MonsterEvent monsterEvent)
        {
            monsterData = monsterEvent.cMonster;
            unique      = monsterEvent.qMonster.unique;
            uniqueTitle = monsterEvent.GetUniqueTitle();
            uniqueText  = monsterEvent.qMonster.uniqueText;
            healthMod   = Mathf.RoundToInt(monsterEvent.qMonster.uniqueHealthBase + (Game.Get().quest.GetHeroCount() * monsterEvent.qMonster.uniqueHealthHero));

            Game          game = Game.Get();
            HashSet <int> dupe = new HashSet <int>();

            foreach (Monster m in game.quest.monsters)
            {
                if (m.monsterData == monsterData || m.duplicate != 0)
                {
                    dupe.Add(m.duplicate);
                }
            }

            while (dupe.Contains(duplicate))
            {
                duplicate++;
            }
        }