Beispiel #1
0
 public SpellBook(Creature creature)
 {
     spells              = new List <Spell>();
     spellsByLevel       = BlankSpellsByLevel();
     contextMenuTextures = baseContextMenuTextureSet;
     owner = creature;
 }
Beispiel #2
0
 public SpellBook(List <Spell> spells)
 {
     if (spells == null)
     {
         spells        = new List <Spell>();
         spellsByLevel = BlankSpellsByLevel();
     }
     this.spells         = new List <Spell>(spells);
     spellsByLevel       = SortSpellsByLevel(spells);
     contextMenuTextures = baseContextMenuTextureSet;
 }
Beispiel #3
0
        public Encounter(DnDManager manager, Vector2 boardDimensions, int boardTileSize, BoardTextureSet boardTextureSet)
        {
            DnDManager.encounters.Add(this);
            library             = DnDManager.libraries[0];
            contextMenuTextures = manager.menuTextureSet;
            turn            = 0;
            creatures       = new List <Creature>();
            initiativeOrder = new List <Creature>();

            MakeSquareBoard(new Vector2(0, 0), boardDimensions, boardTileSize, boardTextureSet);
        }
Beispiel #4
0
        public DnDManager(Library library, Dictionary <string, Texture2D> monsterTextures, ContextMenuTextureSet menuTextureSet, BoardTextureSet boardTextureSet)
        {
            manager = this;

            ongoingRolls    = new List <Roll>();
            encounters      = new List <Encounter>();
            ongoingControls = new List <Control>();

            DnDManager.monsterTextures          = new Dictionary <string, Texture2D>(monsterTextures);
            this.menuTextureSet                 = menuTextureSet;
            this.boardTextureSet                = boardTextureSet;
            SpellBook.baseContextMenuTextureSet = menuTextureSet;

            InitializeLibraryLists();

            AddLibrary(library);

            contextMenu = null;
        }
Beispiel #5
0
        public SpellBook(List <Spell> spells, Creature creature, Stats spellcastingStat = Stats.None)
        {
            contextMenuTextures = baseContextMenuTextureSet;
            if (spells == null)
            {
                spells = new List <Spell>();
            }
            this.spells   = new List <Spell>(spells);
            spellsByLevel = SortSpellsByLevel();
            AssignOwner(creature);

            if (spellcastingStat != Stats.None)
            {
                foreach (Spell spell in spells)
                {
                    spell.abilityModifier = spellcastingStat;
                }
            }
        }
Beispiel #6
0
        public void LoadContextMenuTextures()
        {
            contextMenuTextureSet = new ContextMenuTextureSet();

            contextMenuTextureSet.baseFont = Content.Load <SpriteFont>("debugMenuFont");

            EngManager.defaultFont = contextMenuTextureSet.baseFont;

            contextMenuTextureSet.baseTextures = new List <Texture2D>(new Texture2D[Enum.GetNames(typeof(ButtonTexture)).Length]);
            contextMenuTextureSet.baseTextures[(int)ButtonTexture.BaseTexture] = Content.Load <Texture2D>("debugMenuBaseTexture");


            contextMenuTextureSet.baseTextures[(int)ButtonTexture.HoveredTexture]        = Content.Load <Texture2D>("debugMenuMouseOverTexture");
            contextMenuTextureSet.baseTextures[(int)ButtonTexture.PressedTexture]        = Content.Load <Texture2D>("debugMenuClickedTexture");
            contextMenuTextureSet.baseTextures[(int)ButtonTexture.PressedHoveredTexture] = Content.Load <Texture2D>("debugMenuClickedMouseOverTexture");
            contextMenuTextureSet.baseTextures[(int)ButtonTexture.InactiveTexture]       = Content.Load <Texture2D>("debugMenuClickedTexture");

            contextMenuTextureSet.blankTileTextures = new List <Texture2D>(contextMenuTextureSet.baseTextures);
        }
Beispiel #7
0
        public Encounter(Library library, Vector2 boardDimensions, int boardTileSize, BoardTextureSet boardTextureSet, ContextMenuTextureSet menuTextureSet, List <Creature> creatures = null, List <int> teams = null, List <Vector2> positions = null)
        {
            this.library = library;
            DnDManager.encounters.Add(this);
            turn            = 0;
            creatures       = new List <Creature>();
            initiativeOrder = new List <Creature>();
            creatures       = new List <Creature>();

            contextMenuTextures = menuTextureSet;

            if (creatures != null)
            {
                for (int i = 0; i < creatures.Count; i++)
                {
                    this.creatures.Add(creatures[i]);
                    creatures[i].SetToTile(board.Tile(positions[i]));
                }
            }

            MakeSquareBoard(new Vector2(0, 0), boardDimensions, boardTileSize, boardTextureSet);
        }
Beispiel #8
0
 public SpellBook(SpellBook copy)
 {
     spells              = new List <Spell>(copy.spells);
     spellsByLevel       = new Dictionary <int, List <Spell> >(copy.spellsByLevel);
     contextMenuTextures = copy.contextMenuTextures;
 }
Beispiel #9
0
 public SpellBook(List <Spell> spells, Dictionary <int, List <Spell> > spellsByLevel, ContextMenuTextureSet contextMenuTextures)
 {
     this.spells              = new List <Spell>(spells);
     this.spellsByLevel       = new Dictionary <int, List <Spell> >(spellsByLevel);
     this.contextMenuTextures = contextMenuTextures;
 }
Beispiel #10
0
 public SpellBook()
 {
     spells              = new List <Spell>();
     spellsByLevel       = BlankSpellsByLevel();
     contextMenuTextures = baseContextMenuTextureSet;
 }