Exemple #1
0
    protected override void UpgradeStatus()
    {
        string _damage = "damage";

        if (upgrades[_damage] < UpgradeHandler.data.towerUpgrades[transform.parent.parent.name][_damage])
        {
            damage += damageUpgrade;
            upgrades[_damage]++;
            print("damage upgraded");
        }

        string _intensity = "debuffIntensity";

        if (upgrades[_intensity] < UpgradeHandler.data.towerUpgrades[transform.parent.parent.name][_intensity])
        {
            debuffIntensity += intensityUpgrade;
            upgrades[_intensity]++;
        }

        string _duration = "debuffDuration";

        if (upgrades[_duration] < UpgradeHandler.data.towerUpgrades[transform.parent.parent.name][_duration])
        {
            debuffDuration += durationUpgrade;
            upgrades[_duration]++;
        }

        Flames flames = GetComponentInChildren <Flames>();

        flames.UpdateBurnData(this);
    }
Exemple #2
0
 //Changes the flame from a spark back to a flame.
 public void ChangeBackFromSpark()
 {
     if (currentState == Flames.SPARK)
     {
         currentState   = (int)Flames.NORMAL;
         this.particles = this.fireParticles;
     }
 }
Exemple #3
0
 //Changes the flame into a spark.
 public void ChangeToSpark()
 {
     if (currentState != Flames.SPARK)
     {
         currentState = Flames.SPARK;
         //Lauches this object into the sky.
         this.Velocity  = Vector3.Add(this.Velocity, launchVelocity);
         this.particles = this.sparkParticles;
     }
 }
Exemple #4
0
        public override void Initialize()
        {
            this.currentState           = Flames.NORMAL;
            this.velocity               = new Vector3(0, 0, 0);
            this.gravity                = new Vector3(0, 0.00125f, 0);
            this.launchVelocity         = new Vector3(0, 0.25f, 0);
            this.drag                   = 0.6f;
            this.maxVelocity            = new Vector3(0.02f, -0.01f, 0.02f);
            this.velocityMultiplication = 1;
            this.leftThumbstickDeadzone = new Vector2(0.1f, 0.1f);
            this.spreadManager          = new FireSpreadManager(this.game);
            this.Game.Components.Add(this.spreadManager);
            this.timeTillSpread = SPREADTIME;
            this.isKilled       = false;

            //Particles.
            this.fireParticles  = new FireParticleSystem(game, Game.Content);
            this.sparkParticles = new ParticleSpark(game, Game.Content);
            this.particles      = this.fireParticles;
            this.Game.Components.Add(this.fireParticles);
            this.Game.Components.Add(this.sparkParticles);

            this.fireParticles.DrawOrder  = 100;
            this.sparkParticles.DrawOrder = 100;

            //Sets the dimensions of the flame.
            flameSize = 200;
            minSize   = 0;
            maxSize   = 400;

            rnd = new Random();
            sandSparkSizeMod = -0.7f;
            sandHeight       = 7.8f;

            base.Initialize();
        }
Exemple #5
0
 public void Setup()
 {
     f = new Flames();
 }
    /// <summary>
    /// fire the param canon
    /// </summary>
    /// <param name="canon"></param>
    /// <returns></returns>
    IEnumerator Fire(Canon canon)
    {
        yield return(new WaitForSeconds(Random.Range(0.0f, 0.5f)));

        if (canon.canonball == null)
        {
            canon.canonball = Static_Resources.defaultCanonball;
        }

        GameObject canonballObj;
        Canonball  canonball;
        float      lifetime;

        string soundName = "FireCanon";

        switch (canon.canonType)
        {
        default:
        case CanonType.Normal:
            canonballObj = Instantiate(canon.canonball, null);
            canonball    = canonballObj.GetComponent <Canonball>();
            lifetime     = Random.Range(0.75f, 1.10f);

            canonball.InitCanonball(canon.shootPoint.up, canon.GetDamage(), CollidingTag, lifetime);
            canonball.transform.position = canon.shootPoint.position;
            soundName = "FireCanon";
            break;

        case CanonType.TirTriple:

            for (int i = 0; i < 3; i++)
            {
                canonballObj = Instantiate(canon.canonball, null);
                canonball    = canonballObj.GetComponent <Canonball>();

                GameObject temp = new GameObject();
                temp.transform.SetParent(canon.shootPoint);
                temp.transform.rotation = canon.shootPoint.rotation;

                if (i == 0)
                {
                    temp.transform.Rotate(temp.transform.forward, -12);
                }
                else if (i == 2)
                {
                    temp.transform.Rotate(temp.transform.forward, 12);
                }

                lifetime = Random.Range(0.75f, 1.10f);

                canonball.InitCanonball(temp.transform.up, canon.GetDamage(), CollidingTag, lifetime);
                canonball.transform.position = canon.shootPoint.position;

                Destroy(temp);
            }

            soundName = "FireCanon";
            break;

        case CanonType.LanceFlammes:
            canonballObj = Instantiate(canon.canonball, null);
            Flames flames = canonballObj.GetComponent <Flames>();
            lifetime = canon.baseCooldown * 0.75f;

            GameObject t = new GameObject();
            t.transform.SetParent(canon.shootPoint);
            t.transform.position = canon.shootPoint.position + canon.shootPoint.up;
            t.transform.rotation = canon.shootPoint.rotation;

            flames.InitFlame(t.transform, t.transform.up, canon.GetDamage(), CollidingTag, lifetime);

            Destroy(t, lifetime);


            soundName = "FlameThrower";
            break;
        }

        SoundManager.Play(soundName, canon.shootPoint.position);

        yield return(null);
    }