コード例 #1
0
        // Casting the spell
        public void CastSpell(SpellCreator spell, CharacterValues caster, Tile currentMouseTile)
        {
            playerBehaviour.aControll.PlayAttack(caster);
            playerBehaviour.aControll.PlaySpell(spell);
            Tile casterTile = gridController.GetTile(caster.currentTile.x, caster.currentTile.z);
            Tile targetTile = currentMouseTile;
            //Tile temp1 = gridController.GetTile(caster.currentTile.x,caster.currentTile.z);
            //Tile temp2 = gridController.GetTile(target.currentTile.x,target.currentTile.z);

            // V V V gets a list of tiles in AOE
            List <Tile> targetsList = spellHandler.AreaType(spell.areaType);

            // V V V goes through every attribute in the spells attribute list
            foreach (var temp in spell.spellArvot)
            {
                // V V V i need to make stuff here for attributes that dont need target and are single use
                if (temp.isSingleUse == true)
                {
                    TargetChecker(spell, temp, caster, currentMouseTile, currentMouseTile);
                }
                else
                {
                    foreach (var item in targetsList)
                    {
                        TargetChecker(spell, temp, caster, currentMouseTile, item);
                    }
                }
            }
            // V V V update UI and cooldowns
            spellCalculators.HandleCoolDownIncrease(spell);
            spellButtons.UpdateHpApMp();
        }
コード例 #2
0
        public List <CharacterValues> TargetChecker(SpellCreator currentSpell)
        {
            List <Tile>            targetTileList = spellHandler.AreaType(currentSpell.areaType);
            List <CharacterValues> targetList     = new List <CharacterValues>();

            foreach (var item in targetTileList)
            {
                PlayerInfo      checker = item.CharCurrentlyOnTile;
                CharacterValues target  = null;
                if (checker)
                {
                    target = checker.thisCharacter;
                    targetList.Add(target);
                }
            }
            return(targetList);
        }