Esempio n. 1
0
 public override void OnCrystalUse(Side side, bool active)
 {
     staffActive = active;
     if (active)
     {
         staffEffect = chargeEffectData.Spawn(imbue.colliderGroup.imbueShoot.position, Quaternion.identity);
         staffEffect.SetSource(imbue.colliderGroup.imbueShoot);
         staffEffect.SetParent(imbue.colliderGroup.collisionHandler.item.transform);
         ((EffectVfx)staffEffect.effects.Find(effect => effect is EffectVfx)).vfx.SetInt("State", 1);
         staffEffect.Play();
         Player.currentCreature.mana.StartCoroutine(StaffCoroutine());
     }
     else
     {
         if (previousItems != null)
         {
             previousItems.ForEach(item => item?.HeldItem().Reset(CastSource.Staff));
         }
         if (items != null)
         {
             items.ForEach(item => item?.HeldItem()?.Reset(CastSource.Staff));
         }
         staffEffect?.Stop();
         Throw(imbue.colliderGroup.collisionHandler.item.rb.GetPointVelocity(imbue.colliderGroup.imbueShoot.position), CastSource.Staff);
     }
     base.OnCrystalUse(side, active);
 }