示例#1
0
 public void Update(SpellContainer container)
 {
     if (container.Time.Current - spellStartTime > SpellDuration)
     {
         container.Expire();
     }
 }
示例#2
0
    void tileToScroll(GameObject tile)
    {//Called by the static function addToScroll
        int            temp          = System.Convert.ToInt32(ScrollClick.selectedScroll);
        SpellContainer scrollToAddTo = PlayerScrolls.transform.GetChild(temp).GetComponent <SpellContainer>();

        TileCompatibility tileComp = tile.GetComponent <TileCompatibility>();
        bool added = false;

        if (tileComp.IsCompatible(turnOfPlayer == 1 ? scrollToAddTo.getP1spellSymbols : scrollToAddTo.getP2SpellSymbols))
        {
            added = scrollToAddTo.addTile(turnOfPlayer, tile.name);
        }

        if (added)
        {
            if (turnOfPlayer == 1)
            {
                tile.GetComponent <AudioSource>().Play();
                P1HandTiles.Remove(tile);
                Destroy(tile);
                // This Updates the List that keps track which scroll have how many tiles
                // Which will help us in showing enemy flipped tile
                if (scrollToAddTo.gameObject.name == "0")
                {
                    P1TilesOnScroll[0] += 1;
                }
                if (scrollToAddTo.gameObject.name == "1")
                {
                    P1TilesOnScroll[1] += 1;
                }
                if (scrollToAddTo.gameObject.name == "2")
                {
                    P1TilesOnScroll[2] += 1;
                }
            }
            else
            {
                P2HandTiles.Remove(tile);
                Destroy(tile);
                // This Updates the List that keps track which scroll have how many tiles
                if (scrollToAddTo.gameObject.name == "0")
                {
                    P2TilesOnScroll[0] += 1;
                }
                if (scrollToAddTo.gameObject.name == "1")
                {
                    P2TilesOnScroll[1] += 1;
                }
                if (scrollToAddTo.gameObject.name == "2")
                {
                    P2TilesOnScroll[2] += 1;
                }
            }
            ScrollClick.selectedScroll = "none";
            tileAdded = true;
            StartCoroutine(delayEnumerator());
        }
    }
        private void SpellCompendium_Load(object sender, EventArgs e)
        {
            //fill the spell list
            fullSpellContainer = new SpellContainer(@"DND5ESpellList.xml");

            //populate the controls
            DGVSpellList.DataSource = fullSpellContainer.Spells;
            DGVSpellList.Columns["EffectText"].Visible = false;
        }
示例#4
0
 public void Init(SpellContainer container)
 {
     spellStartTime = container.Time.Current;
 }
示例#5
0
 public void Init(SpellContainer container)
 {
 }
示例#6
0
 public void Update(SpellContainer container)
 {
     container.Position += SpellVelocity * (float)container.Time.Elapsed;
 }
        private void ApplyFilters()
        {
            filteredSpells = new SpellContainer();
            var filtered = fullSpellContainer.Spells.Where(p => !string.IsNullOrEmpty(p.Name));

            //apply class list filter if applicable
            if (classFilter.Count > 0)
            {
                filtered = filtered.Where(p => p.ClassList.Split(',').Where(s => classFilter.Contains(s.ToString().Trim())).Count() > 0);
            }

            //apply school list filter if applicable
            if (schoolFilter.Count > 0)
            {
                filtered = filtered.Where(p => schoolFilter.Contains(p.School));
            }

            //apply level list filter if applicable
            if (levelFilter.Count > 0)
            {
                filtered = filtered.Where(p => levelFilter.Contains(p.Level));
            }

            //apply ritual list filter if applicable
            if (ritualFilter.Count > 0)
            {
                filtered = filtered.Where(p => ritualFilter.Contains(p.IsRitual));
            }

            //apply casting time filter if applicable
            if (castingFilter.Count > 0)
            {
                if (castingFilter.Contains("Other"))
                {
                    filtered = filtered.Where(p => !castingTimeFilters.Contains(p.CastingTime) || castingFilter.Contains(p.CastingTime));
                }
                else
                {
                    filtered = filtered.Where(p => castingFilter.Contains(p.CastingTime));
                }
            }

            //apply components filter if applicable
            if (componentFilter.Count > 0)
            {
                filtered = filtered.Where(p => p.Components.Split(',').Where(s => componentFilter.Contains(s.ToString().Trim())).Count() > 0);
            }

            //apply concentration filter if applicable
            if (concentrationFilter.Count > 0)
            {
                filtered = filtered.Where(p => concentrationFilter.Contains(p.Concentration));
            }

            foreach (Spell s in filtered)
            {
                filteredSpells.Add(s);
            }

            DGVSpellList.DataSource = filteredSpells.Spells;
        }