Esempio n. 1
-1
 public override void activated(Entity activator)
 {
     if (startTimer <= 0)
     {
         if (activator is Living)
         {
             ((Living)activator).damage(ATTACK_DAMAGE * this.powerLevel, Living.DamageType.Spike);
             this.acted = true;
             Sparker s = new Sparker(100, new Vector2(position.X + 32, position.Y + 32));
             s.SetGradient(Color.Yellow, Color.DarkGray);
             s.Fire();
             Living.gameParent.GetSparkerList().Add(s);
         }
     }
 }
Esempio n. 2
-1
        public override void activated(Entity activator)
        {
            MarkRune m = null;
            for(int i = 0; i < Living.gameParent.GetRuneList().Count; i++)
            {
                if(Living.gameParent.GetRuneList()[i] is MarkRune)
                {
                    m = (MarkRune)Living.gameParent.GetRuneList()[i];
                    break;
                }
            }
            if (m != null) return;
            activator.setPos(new Vector2(m.getPos().X + 64, m.getPos().Y + 64));

            Sparker s = new Sparker(50, new Vector2(activator.getPos().X - 32,
                    activator.getPos().Y - 32));
            s.SetGradient(Color.Magenta, Color.Maroon);
            s.Fire();
            Living.gameParent.GetSparkerList().Add(s);
        }
Esempio n. 3
-1
        private void die()
        {
            this.renderCode = 7;
            if (deadTimer == 0)
            {
                deadTimer = 1;
                rotation = 0.0f; //So that the death anims line up
            }
            else
            {
                deadTimer++;
                if (deadTimer > 64)
                {
                    this.position.X = -300;
                    this.position.Y = -300;
                }
                if (deadTimer > 100)
                {
                    deathFlag = true;

                    health = 100;
                    this.renderCode = 1;
                    for (int i = 0; i < Living.gameParent.GetRuneList().Count; i++)
                    {
                        if (Living.gameParent.GetRuneList()[i].GetType() == new SoulAnchorRune(null, Vector2.Zero, 0.0f, 0, 0).GetType())
                        {
                            this.position = Living.gameParent.GetRuneList()[i].getPos();
                            this.position.X += 64;
                            this.position.Y += 64;
                            Living.gameParent.GetRuneList().RemoveAt(i);
                            Sparker sp = new Sparker(100, new Vector2(position.X - 32, position.Y));
                            sp.SetGradient(Color.Multiply(Color.Magenta, 0.5f), Color.White);
                            sp.Fire();
                            Living.gameParent.GetSparkerList().Add(sp);
                            deadTimer = 0;
                            return;
                        }
                    }
                    deadTimer = 0;
                    this.position = new Vector2(spawnLocation.X, spawnLocation.Y);
                }
            }
        }
Esempio n. 4
-1
 public void PlaceRune(Rune rune, Vector2 position, Color sparkColor)
 {
     for (int i = 0; i < rune_list.Count; i++)
     {
         if (rune.GetType() == rune_list[i].GetType())
             return;
     }
     rune.setPos(position);
     rune_list.Add(rune);
     Sparker sp = new Sparker(100, new Vector2(position.X + 32, position.Y + 32));
     sp.SetGradient(sparkColor, Color.Multiply(sparkColor, 0.2f));
     sp.Fire();
     Living.gameParent.GetSparkerList().Add(sp);
 }