Ejemplo n.º 1
0
 void SpellCast(SpellCastEvent e)
 {
     if (Selected)
     {
         Selected = false;
     }
 }
Ejemplo n.º 2
0
    public void Cast()
    {
        SpellCastEvent e = new SpellCastEvent();

        e.FireEvent();
        castingBehaviour.Cast(spellParams);
    }
Ejemplo n.º 3
0
 private void SpellCast(SpellCastEvent obj)
 {
     if (obj.Projectile != null)
     {
         obj.Projectile.Scale  *= 1.75f;
         obj.Projectile.Damage *= 2;
     }
 }
Ejemplo n.º 4
0
 private void SpellCast(SpellCastEvent obj)
 {
     if (obj.Projectile != null)
     {
         obj.Projectile.Scale *= 1.75f;
         obj.Projectile.Damage *= 2;
     }
 }
Ejemplo n.º 5
0
    void SpellCast(SpellCastEvent e)
    {
        stamina    -= staminaCost;
        staminaCost = -1;
        float percent = (float)stamina / maxStamina;

        //lastIndex = pixelList.Count - (int)(percent * pixelList.Count);
        changed = true;
        //clearTexture();
    }
Ejemplo n.º 6
0
 void initializeEventCallbacks()
 {
     StartedCastingEvent.RegisterListener(castingStarted);
     StoppedCastingEvent.RegisterListener(castingStopped);
     SpellSelectedEvent.RegisterListener(SpellSelected);
     SpellCastEvent.RegisterListener(SpellCast);
     SpellUnSelectedEvent.RegisterListener(SpellUnselected);
     CastingProjectionDestroyedEvent.RegisterListener(CastingProjectionDestroyed);
     CastingProjectionCreatedEvent.RegisterListener(CastingProjectionCreated);
     CastingLocationChangedEvent.RegisterListener(CastingLocationChanged);
 }
Ejemplo n.º 7
0
    public float GetTotalDamage(float runeDamage, float pageDamage, ISpellGrid grid)
    {
        float totalDmg = 0;

        // Add up the cost of each pixel
        foreach (KeyValuePair <Ink, int> entry in grid.GetInkToNumberOfActiveInksOfThatType())
        {
            totalDmg += (entry.Key.GetDamageMod() + runeDamage + pageDamage) * entry.Value / 3;
        }

        // Add up the cost of other spells this segment is casting
        foreach (SpellEvent sEvent in events)
        {
            if (sEvent is SpellCastEvent)
            {
                SpellCastEvent sce = (SpellCastEvent)sEvent;
                //totalDmg += sce.spell.cost;
            }
        }
        return(totalDmg);
    }
Ejemplo n.º 8
0
 private void OnSpellCasted(object sender, SpellCastEvent e)
 {
     _spellEvent.SpellCasted -= OnSpellCasted;
     if (e.Sucess)
     {
         _totalSpellLauch++;
         if (_totalSpellLauch < _currentSpell.Relaunchs)
         {
             ExecuteSpell();
         }
         else
         {
             _totalSpellLauch = 0;
             _account.Character.Fight.EndTurn();
         }
     }
     else
     {
         _totalSpellLauch = 0;
         _account.Character.Fight.EndTurn();
     }
 }
Ejemplo n.º 9
0
    public float GetCost(float runeCost, float pageCost, ISpellGrid grid)
    {
        float totalCost = 0;

        // Add up the cost of each pixel

        foreach (KeyValuePair <Ink, int> entry in grid.GetInkToNumberOfActiveInksOfThatType())
        {
            totalCost += (entry.Key.GetCost() + pageCost) * runeCost * entry.Value;
        }

        // Add up the cost of other spells this segment is casting
        foreach (SpellEvent sEvent in events)
        {
            if (sEvent is SpellCastEvent)
            {
                SpellCastEvent sce = (SpellCastEvent)sEvent;
                totalCost += sce.spell.cost;
            }
        }
        return(totalCost);
    }
Ejemplo n.º 10
0
 void unRegisterCallbacks()
 {
     StoppedCastingEvent.UnregisterListener(StoppedCasting);
     SpellCastEvent.UnregisterListener(SpellCast);
 }
Ejemplo n.º 11
0
    void initializeCallbacks()
    {
        StoppedCastingEvent.RegisterListener(StoppedCasting);

        SpellCastEvent.RegisterListener(SpellCast);
    }