Ejemplo n.º 1
0
 public override void HitTest(Tornado tornado, List<Victim> victimsToCollideCheck)
 {
     foreach (Victim victim in victimsToCollideCheck)
     {
         HitCheck(victim);
     }
 }
Ejemplo n.º 2
0
 public override void HitTest(Tornado tornado, List<Victim> victimsToCollideCheck)
 {
     foreach (Victim vict in victimsToCollideCheck)
     {
         HitCheck(vict);
     }
     state = State.Flying;
     this.requestRemoveTornado = false;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Recieve a hit at a certain damange and returns if the building was destroyed
        /// </summary>
        /// <returns>0 = building wad destroyed. Positive values represent the building's remaining health</returns>
        protected virtual float RecieveHit(float Damage, Tornado tornado)
        {
            float tempvar = this.GroundHealth - Damage; //How much damage we would do negative is overkill

            switch (this.state)
            {
                case State.Ground:
                    if (tempvar <= 0)
                    {
                        if (soundHit != "" && Damage > 0)
                            SoundEffectEngine.Play(soundHit, SoundEffectEngine.Priority.Normal);
                        //INFO: Inform object it is dead change state to flying and get picked up by tornado

                        this.GroundHealth = 0;
                        this.tornado = tornado;
                        this.state = State.Flying;
                        Victim newVictim = this.Clone();
                        newVictim.requestRemoveFromMegaTile = true;
                        newVictim.megatile = null;
                        tornado.AddVictim(newVictim);
                        this.state = State.Stump;
                        //if (megatile != null)
                        //{
                            this.requestRemoveFromMegaTile = removeFromMegaTileOnDeath;
                        //}
                    }
                    else
                    {
                        this.GroundHealth = tempvar;
                    }
                    break;
            }

            return tempvar;
        }
Ejemplo n.º 4
0
 public abstract void HitTest(Tornado tornado, List<Victim> victimsToCollideCheck);