Ejemplo n.º 1
0
 void FinalizePixels(ISpellGrid grid, float damage)
 {
     if (!makePixels)
     {
         return;
     }
     ISpellPixel[,] pixels = grid.GetGrid();
     for (int x = 0; x < pixels.GetLength(0); x++)
     {
         for (int y = 0; y < pixels.GetLength(1); y++)
         {
             if (pixels[x, y].IsActive())
             {
                 SpellPixelFinal finalPix = new SpellPixelFinal(pixels[x, y].GetInk(), new Vector2(y - pixels.GetLength(1) / 2, x - pixels.GetLength(0) / 2));
                 finalPix.damage = finalPix.m_ink.GetDamageMod() * damage;
                 spellPixels.Add(finalPix);
             }
         }
     }
 }
Ejemplo n.º 2
0
    public ProjectileSpellBook MakeSpellBook()
    {
        List <SpellCreationSegment> spellSegs = GetSpellSegs();

        foreach (SpellCreationSegment seg in spellSegs)
        {
            if (source != ProjectileSpellBookBuilder.spellSource.player)
            {
                seg.SetSpeedMod(seg.GetSpeedMod() * .6f);
            }

            ISpellPixel[,] pixels = grid.GetGrid();
            seg.calculateValues(grid, GetDamage());
        }

        CalculateCost();
        ProjectileSpellBook spellBook = new ProjectileSpellBook();

        spellBook.Init(this);
        return(spellBook);
    }