Exemple #1
0
    public float getRange()
    {
        StatBit sb = GetStatBit(EffectType.Range);

        if (sb == null)
        {
            return(-2);
        }

        float range = sb.getStats()[0];

        if (runetype == RuneType.Vexing)
        {
            StatBit extra = GetStatBit(EffectType.Focus);
            if (extra != null && extra.Level > 0)
            {
                range += extra.getStats()[0];
            }


            extra = GetStatBit(EffectType.RapidFire);
            if (extra != null && extra.Level > 0)
            {
                range += extra.getStats()[4];
            }
        }


        return(range);
    }
Exemple #2
0
    public override void Activate(StatBit skill)
    {
        float[] _stats = skill.getStats();
        level     = skill.level;
        am_active = true;

        my_firearm = Peripheral.Instance.getHeroFirearm(RuneType.Sensible);



        my_line.gameObject.SetActive(true);
        collider.enabled = true;
        StatBit[] sb = new StatBit[1];
        //sb[0] = new StatBit(EffectType.Force, _stats[0], 1, false);
        sb[0]           = new StatBit(EffectType.Force, _stats[0], 1, false);
        lava_life       = _stats[1];// / 5f;
        sb[0].very_dumb = true;
        bullets         = Mathf.CeilToInt(_stats[2]);
        if (Monitor.Instance != null)
        {
            Monitor.Instance.my_spyglass.DisableByDragButton(true);
        }
        stats = new StatSum(1, 0, sb, RuneType.Sensible);



        stats.factor = 1;// / (lava_life * lava_size);
        //    Debug.Log("Activating Air Attack! Damage " + _stats[0] + " factor " + stats.factor + " bullets " + bullets + " lava_life " + lava_life + "\n");

        my_line.clearLine();
    }
Exemple #3
0
    public override void Activate(StatBit skill)
    {
        float[] _stats = skill.getStats();
        level      = skill.level;
        am_active  = true;
        my_firearm = Peripheral.Instance.getHeroFirearm(RuneType.Airy);

        my_line.gameObject.SetActive(true);
        collider.enabled = true;
        StatBit[] sb = new StatBit[2];


        sb[0] = new StatBit(EffectType.Speed, _stats[0], 1, false);
        sb[0].effect_sub_type = EffectSubType.Freeze;
        sb[0].very_dumb       = true;
        sb[0].dumb            = true;

        sb[1]           = new StatBit(EffectType.Force, _stats[1], 1, false);
        sb[1].very_dumb = true;
        sb[1].dumb      = true;

        Debug.Log("Activating Quicksand! Speed " + _stats[0] + " force " + _stats[1] + "\n");

        if (Monitor.Instance != null)
        {
            Monitor.Instance.my_spyglass.DisableByDragButton(true);
        }
        stats = new StatSum(3, 0, sb, RuneType.Airy);
        //stats doesn't have a factor because of speed
        bullets      = Mathf.CeilToInt(_stats[3]);
        stats.factor = 1;
        lava_life    = _stats[2];
        lava_size    = _stats[5];
        my_line.clearLine();
    }
Exemple #4
0
    public override void Activate(StatBit skill)
    {
        float[] _stats = skill.getStats();
        level = skill.level;

        my_firearm = Peripheral.Instance.getHeroFirearm(RuneType.Sensible);

        am_active        = true;
        collider.enabled = true;

        speed     = _stats[2];
        lava_size = _stats[4];
        lava_life = _stats[1];// / 5f;

        StatBit[] sb = new StatBit[2];
        sb[0]           = new StatBit(EffectType.Force, _stats[0], 1, false);
        sb[0].very_dumb = true;
        sb[0].dumb      = true;

        sb[1]           = new StatBit(EffectType.Stun, speed, 1, false);
        sb[1].very_dumb = true;
        sb[1].dumb      = true;

        if (Monitor.Instance != null)
        {
            Monitor.Instance.my_spyglass.DisableByDragButton(true);
        }
        stats        = new StatSum(1, 0, sb, RuneType.Sensible);
        stats.factor = 1;
    }
Exemple #5
0
    public float getReloadTime(bool basic)
    {
        float reload_time = GetStatBit(EffectType.ReloadTime).getStats()[0];

        if (!basic)
        {
            if (runetype == RuneType.Vexing)
            {
                StatBit extra = GetStatBit(EffectType.Focus);
                if (extra != null)
                {
                    reload_time += extra.getStats()[2];
                }
            }
            if (runetype == RuneType.Sensible)
            {
                StatBit extra = GetStatBit(EffectType.Diffuse);
                if (extra != null)
                {
                    reload_time += extra.getStats()[4];
                }
            }
        }

        return(reload_time);
    }
Exemple #6
0
 void CheckIfRapidFireSkill()
 {
     if (toy.rune.runetype == RuneType.Vexing && toy.rune.getLevel(EffectType.RapidFire) > 0)
     {
         InitRapidFire();
         StatBit rf = toy.rune.getStatBit(EffectType.RapidFire);
         rapid_fire.Init(rf.getStats(), toy.rune.get(EffectType.VexingForce), rf.level);
     }
 }
Exemple #7
0
    public override void Activate(StatBit skill)
    {
        float[] _stats = skill.getStats();
        level = skill.level;

        my_firearm       = Peripheral.Instance.getHeroFirearm(RuneType.Airy);
        stats            = _stats;
        am_active        = true;
        collider.enabled = true;
        //    Debug.Log("plaguesummoner activated\n");
    }
Exemple #8
0
    public override void Activate(StatBit skill)
    {
        castle          = Peripheral.Instance.castle;
        castle_position = castle.transform.position;

        float[] _stats = skill.getStats();
        rate      = _stats[0];
        frequency = _stats[1];
        am_active = true;

        StopAllCoroutines();
        StartCoroutine(Fire());
    }
Exemple #9
0
    public void initStats(StatBit skill, int ID)
    {
        float[] stats = skill.getStats();

        bullets   = Mathf.RoundToInt(stats[0]);
        fire_time = stats[1];

        //        if (!am_firing)       {
        my_statsum          = new StatSum();
        my_statsum.towerID  = ID;
        my_statsum.runetype = RuneType.Sensible;
        StatBit[] statbits;

        float finisher_percent = (stats.Length == StaticStat.StatLength(EffectType.Sparkles, true)) ? stats[3] : 0;

        if (finisher_percent > 0 && UnityEngine.Random.Range(0, 1) < finisher_percent)
        {
            statbits                = new StatBit[3];
            statbits[2]             = new StatBit();
            statbits[2].effect_type = EffectType.Sparkles;
            statbits[2].Base_stat   = stats[4];
            statbits[2].level       = skill.level;
        }
        else
        {
            statbits = new StatBit[2];
        }

        statbits[0]             = new StatBit();
        statbits[0].effect_type = EffectType.Force;
        statbits[1]             = new StatBit();
        statbits[1].effect_type = EffectType.Range;
        statbits[1].Base_stat   = 1.5f + skill.level / 2f;
        my_statsum.stats        = statbits;
        //      }

        //lets_make_sparkles = false;
        my_statsum.stats[0].Base_stat = stats[2];
        my_statsum.stats[0].dumb      = true;
        my_statsum.stats[0].very_dumb = true;
        my_statsum.stats[0].level     = skill.level;
        //this works like a lava

        am_firing = true;
        is_active = true;

        if (colors == null)
        {
            InitColors();
        }
    }
Exemple #10
0
    public override void Activate(StatBit skill)
    {
        castle = Peripheral.Instance.castle;


        float[] _stats = skill.getStats();
        percent = _stats[0];

        am_active = true;

        Central.Instance.base_toy_cost_mult = Get.getPercent(percent);
        Central.Instance.updateCost(Peripheral.Instance.getToys());
        am_active = true;
    }
Exemple #11
0
    public override void Activate(StatBit skill)
    {
        float[] _stats = skill.getStats();
        level = skill.level;

        collider.enabled = true;
        my_firearm       = Peripheral.Instance.getHeroFirearm(RuneType.Vexing); //only used for bees right now
        if (start_from == Vector3.zero)
        {
            Firearm f = Peripheral.Instance.getHero(rune_type);
            if (f == null)
            {
                Peripheral.Instance.my_skillmaster.CancelSkill(skill_effect_type);
                Noisemaker.Instance.Click(ClickType.Error);
                Debug.Log("Cannot use Sentient Cloud skill " + skill_effect_type + " " + rune_type + ", no appropriate hero found\n");
                return;
            }
            start_from = f.transform.position;
        }

        am_active = true;
        StatBit[] sb = new StatBit[1];

        how_many = Mathf.FloorToInt(_stats[0]);

        sb[0]             = new StatBit();
        sb[0].effect_type = lava_effect_type;
        sb[0].updateStat(_stats[1]);
        sb[0].dumb      = true;
        sb[0].very_dumb = true;
        //range = -s.stat * 2;
        range     = _stats[2];
        lava_life = _stats[3];
        //bullets = 0, damage = 1, range = 2, lava kife = 3

        stats = new StatSum(1, 0, sb, rune_type);

        Tracker.Log(PlayerEvent.SpecialSkillUsed, true,
                    customAttributes: new Dictionary <string, string>()
        {
            { "attribute_1", EffectType.Bees.ToString() }
        },
                    customMetrics: new Dictionary <string, double>()
        {
            { "metric_1", level }
        });
    }
Exemple #12
0
    public void MakeDiffuse(Vector3 pos)
    {
        //    Debug.Log("Diffuse doing diffusion\n");
        //force
        StatBit diffuse_statbit = stats.GetStatBit(EffectType.Diffuse);

        //StatSum lava_statsum_old = stats.cloneAndRemoveStat(EffectType.Diffuse);
        float[] stat_floats  = diffuse_statbit.getStats();
        StatSum lava_statsum = new StatSum();

        lava_statsum.runetype = RuneType.Sensible;
        lava_statsum.stats    = new StatBit[1];

        StatBit lava_statbit = new StatBit();

        lava_statbit.effect_type = EffectType.Force;
        lava_statbit.base_stat   = stat_floats[5];
        lava_statbit.rune_type   = RuneType.Sensible;
        lava_statbit.dumb        = true;
        lava_statbit.very_dumb   = true;

        lava_statsum.stats[0] = lava_statbit;

        float range    = stat_floats[0];
        float lifespan = stat_floats[1];
        float factor   = stat_floats[2];

        //this statbit is not dumb. Diffuse just diffuses whatever Vexing force the arrow has.

        //get your own lava since lavas live for much longer than arrows, arrows get reused much faster.
        //each arrow does not have its own lava
        lava = Zoo.Instance.getObject("Wishes/diffuse_lava", false).GetComponent <Lava>();

        lava.SetLocation(null, pos, range, Quaternion.identity);
        lava.gameObject.SetActive(true);
        //   Debug.Log("Diffuse lava lifetime " + lifespan + "\n");
        lava.Init(EffectType.Diffuse, diffuse_statbit.level, lava_statsum, lifespan, true, arrow.myFirearm);
        lava.SetFactor(factor);


        arrow.MakeMeDie(false);
    }
Exemple #13
0
    public override void Activate(StatBit skill)
    {
        float[] _stats = skill.getStats();
        level            = skill.level;
        am_active        = true;
        collider.enabled = true;
        StatBit[] sb = new StatBit[1];

        sb[0]             = new StatBit();
        sb[0].effect_type = effect_type;
        sb[0].updateStat(_stats[0]);
        sb[0].dumb = true;
        //range = -s.stat * 2;
        range     = _stats[1];
        lava_life = _stats[3];
        if (Monitor.Instance != null)
        {
            Monitor.Instance.my_spyglass.DisableByDragButton(true);
        }
        stats = new StatSum(1, 0, sb, rune_type);
    }
Exemple #14
0
    public float getPrimary()
    {
        switch (runetype)
        {
        case RuneType.Sensible:
            return(GetStatBit(EffectType.Force).getStats()[0]);

        case RuneType.Airy:
            return(GetStatBit(EffectType.Speed).getStats()[0]);

        case RuneType.Vexing:
            float   damage = GetStatBit(EffectType.VexingForce).getStats()[0];
            StatBit extra  = GetStatBit(EffectType.Focus);
            if (extra != null && extra.Level > 0)
            {
                damage += extra.getStats()[1];
            }
            return(damage);
        }
        return(0f);
    }
Exemple #15
0
    public override void Activate(StatBit skill)
    {
        float[] _stats = skill.getStats();
        level            = skill.level;
        my_firearm       = Peripheral.Instance.getHeroFirearm(RuneType.Vexing);
        am_active        = true;
        collider.enabled = true;
        StatBit[] sb = new StatBit[1];

        sb[0]             = new StatBit();
        sb[0].effect_type = EffectType.Teleport;
        sb[0].updateStat(_stats[0]);
        sb[0].dumb = true;

        range = _stats[1];

        if (Monitor.Instance != null)
        {
            Monitor.Instance.my_spyglass.DisableByDragButton(true);
        }
        stats = new StatSum(1, 0, sb, RuneType.Vexing);
    }
Exemple #16
0
    public void Prepare(StatBit bit, Firearm firearm, EffectType type)
    {
        StatSum stats = firearm.toy.rune.GetStats(false);

        float[] calamity_stats = bit.getStats();

        if (TIME < next_time_to_make_new_lava || (my_lava != null && my_lava.gameObject.activeSelf))
        {
            return;
        }

        //2 =make new timer, 3 = lava life
        next_time_to_disable_lava  = TIME + calamity_stats[3];
        next_time_to_make_new_lava = TIME + calamity_stats[2];



        StatBit[] sb = new StatBit[1];
        if (type == EffectType.Foil) //Foil summons EMP lava, EMP does the thing
        {
            sb[0] = new StatBit(EffectType.Foil, calamity_stats[3], 1, false);
        }
        else
        {
            sb[0] = new StatBit(EffectType.Force, calamity_stats[0], 1, false);
        }

        sb[0].very_dumb = true;
        lava_stats      = new StatSum(1, 0, sb, RuneType.Airy);

        lava_timer        = calamity_stats[3];
        lava_stats.factor = 1;

        //  lava_size = (type == EffectType.Calamity) ? stats.getRange() * calamity_stats[1] / 2f : stats.getRange() * calamity_stats[1];
        //this shit should be handled by StatBit, the lazy bum
        lava_size = calamity_stats[1];
    }
Exemple #17
0
    void GetVictims()
    {
        if (monsters == null)
        {
            monsters = Peripheral.Instance.targets;
        }

        HitMe closest_target   = null;
        float closest_distance = 999f;

        bool previous_status = halo_active;

        List <HitMe> targets = new List <HitMe>();

        //  Debug.Log("Potential targets " + monsters.Count + " range is " + range + " tilesize " + tileSize + "\n");
        for (int i = 0; i < monsters.max_count; i++)
        {
            HitMe enemy = monsters.array[i];
            if (enemy == null || enemy.amDying() || !enemy.gameObject.activeSelf)
            {
                continue;
            }

            float distance = Vector2.Distance(enemy.transform.position, transform.position);
            if (distance < closest_distance)
            {
                closest_target   = enemy;
                closest_distance = distance;
            }
            if (distance < my_firearm.getCurrentRange() * tileSize)
            {
                targets.Add(enemy);
                halo_active = true;
            }
        }
        //  Debug.Log("Got " + targets.Count + " victims, previous status is " + previous_status + "\n");
        if (targets.Count > 0)
        {
            type = my_firearm.toy.rune.GetStats(false);


            if (previous_status == false)
            {
                if (my_calamity != null)
                {
                    StatBit bit = type.GetStatBit(EffectType.Calamity);
                    if (bit != null)
                    {
                        my_calamity.Init(bit, closest_target, my_firearm, EffectType.Calamity);
                    }
                }

                if (my_foil != null)
                {
                    StatBit bit = type.GetStatBit(EffectType.Foil);
                    if (bit != null)
                    {
                        my_foil.Init(bit, closest_target, my_firearm, EffectType.Foil);
                    }
                }

                if (my_swarm != null)
                {
                    StatBit bit = type.GetStatBit(EffectType.Swarm);
                    if (bit != null)
                    {
                        my_swarm.Init(bit, transform, my_firearm, EffectType.Swarm);
                    }
                }
            }
        }
        //    Debug.Log("Gonna hurt " + targets.Count + " victims\n");
        for (int i = 0; i < targets.Count; i++)
        {
            targets[i].HurtMe(type, my_firearm, EffectType.Null);

            if (my_wish_catcher != null)
            {
                StatBit bit = type.GetStatBit(EffectType.WishCatcher);
                if (bit != null)
                {
                    my_wish_catcher.Init(targets[i], bit.getStats());
                }
            }
        }

        if (!previous_status && halo_active)
        {
            ShowHalo(true);
            if (!previous_status)
            {
                my_firearm.UseAmmo();
            }
            if (previous_status == false)
            {
            }
        }
    }