예제 #1
0
    void GiveAbilityToAll()
    {
        foreach (GameObject g in GameObject.FindGameObjectsWithTag("Player"))
        {
            AbilityFactory.GetAbility(AbilityName).Process(g.GetComponent <PlayerScript>());
        }

        /*
         * If you got some skills before you spawn a new player and you do not want to transfer previously gained skills,
         * basically use the code below and remove foreach statement above.
         *
         * AbilityFactory.GetAbility(AbilityName).Process(GameObject.FindWithTag("Player").GetComponent<PlayerScript>());
         *
         */

        Button selectedButton = EventSystem.current.currentSelectedGameObject.GetComponent <Button>();

        selectedButton.enabled = false;
        selectedButton.gameObject.transform.GetChild(1).GetComponent <Image>().enabled = true;

        PS.abilityCount++;

        if (PS.abilityCount >= 3)
        {
            foreach (Button b in transform.parent.GetComponentsInChildren <Button>())
            {
                b.enabled = false;
                b.gameObject.transform.GetChild(1).GetComponent <Image>().enabled = true;
            }
        }
    }
예제 #2
0
 public Hero(int instanceId, HeroStatsConfig stats)
 {
     InstanceId       = instanceId;
     Team             = stats.Team;
     HealthPoints     = new HealthPoints(stats.HealthPoints);
     MaxMovementForce = stats.MaxMovementForce;
     Attack           = AttackFactory.GetAttack(stats.AttackConfig);
     Ability          = AbilityFactory.GetAbility(stats.AbilityConfig);
 }
예제 #3
0
        protected override void OnActivate()
        {
            GraveChill     = AbilityFactory.GetAbility <visage_grave_chill>();
            SoulAssumption = AbilityFactory.GetAbility <visage_soul_assumption>();

            Context.Inventory.Attach(this);

            Config = new Config(this);
        }
예제 #4
0
        protected override void OnActivate()
        {
            Hook      = AbilityFactory.GetAbility <pudge_meat_hook>();
            Rot       = AbilityFactory.GetAbility <pudge_rot>();
            Dismember = AbilityFactory.GetAbility <pudge_dismember>();

            Context.Inventory.Attach(this);

            Config = new Config(this);
        }
예제 #5
0
        protected override void OnActivate()
        {
            OverwhelmingOdds = AbilityFactory.GetAbility <legion_commander_overwhelming_odds>();
            PressTheAttack   = AbilityFactory.GetAbility <legion_commander_press_the_attack>();
            Duel             = AbilityFactory.GetAbility <legion_commander_duel>();

            Context.Inventory.Attach(this);

            Config = new Config(this);
        }
예제 #6
0
    private void Start()
    {
        var abilityNames = AbilityFactory.GetAbilityNames();

        foreach (var abilityName in abilityNames)
        {
            var abilityButton = Instantiate(buttonPrefab, transform);
            abilityButton.GetComponent <AbilityButton>().ability = AbilityFactory.GetAbility(abilityName);
        }
    }
예제 #7
0
        protected override void OnActivate()
        {
            Config = new Config(this);

            Enchant           = AbilityFactory.GetAbility <enchantress_enchant>();
            NaturesAttendants = AbilityFactory.GetAbility <enchantress_natures_attendants>();
            Impetus           = AbilityFactory.GetAbility <enchantress_impetus>();

            Context.Inventory.Attach(this);
        }
예제 #8
0
        protected override void OnActivate()
        {
            ArcaneBolt     = AbilityFactory.GetAbility <skywrath_mage_arcane_bolt>();
            ConcussiveShot = AbilityFactory.GetAbility <skywrath_mage_concussive_shot>();
            AncientSeal    = AbilityFactory.GetAbility <skywrath_mage_ancient_seal>();
            MysticFlare    = AbilityFactory.GetAbility <skywrath_mage_mystic_flare>();

            Context.Inventory.Attach(this);

            Config = new Config(this);
        }
예제 #9
0
        protected override void OnActivate()
        {
            base.OnActivate();

            Context.Inventory.Attach(this);

            UpdateManager.Subscribe(OnUpdate, 25);

            MidnightPulse = AbilityFactory.GetAbility <enigma_midnight_pulse>();
            BlackHole     = AbilityFactory.GetAbility <enigma_black_hole>();
        }
예제 #10
0
        protected override void OnActivate()
        {
            Config = new Config(this);

            CurseOfSilent   = AbilityFactory.GetAbility <silencer_curse_of_the_silent>();
            GlaivesOfWisdom = AbilityFactory.GetAbility <silencer_glaives_of_wisdom>();
            LastWord        = AbilityFactory.GetAbility <silencer_last_word>();
            GlobalSilence   = AbilityFactory.GetAbility <silencer_global_silence>();

            Context.Inventory.Attach(this);
        }
예제 #11
0
        protected override void OnActivate()
        {
            ArcLightning     = AbilityFactory.GetAbility <zuus_arc_lightning>();
            LightningBolt    = AbilityFactory.GetAbility <zuus_lightning_bolt>();
            StaticField      = AbilityFactory.GetAbility <zuus_static_field>();
            Nimbus           = AbilityFactory.GetAbility <zuus_cloud>();
            ThundergodsWrath = AbilityFactory.GetAbility <zuus_thundergods_wrath>();

            Context.Inventory.Attach(this);

            Config = new Config(this);
        }
예제 #12
0
 public void install()
 {
     Skill1 = new Sdk.Abilities.npc_dota_hero_lion.lion_impale(_owner.Spellbook.Spell1);
     Skill2 = new Sdk.Abilities.npc_dota_hero_lion.lion_voodoo(_owner.Spellbook.Spell2);
     Skill3 = _factory.GetAbility <lion_mana_drain>();
     Skill4 = new Sdk.Abilities.npc_dota_hero_lion.lion_finger_of_death(_owner.Spellbook.Spell4);
     UpdateManager.BeginInvoke(() =>
     {
         _inventoryManager.Attach(this);
     },
                               3000);
 }
예제 #13
0
        protected override void OnActivate()
        {
            Impale         = AbilityFactory.GetAbility <nyx_assassin_impale>();
            ManaBurn       = AbilityFactory.GetAbility <nyx_assassin_mana_burn>();
            SpikedCarapace = AbilityFactory.GetAbility <nyx_assassin_spiked_carapace>();
            Burrow         = AbilityFactory.GetAbility <nyx_assassin_burrow>();
            UnBurrow       = AbilityFactory.GetAbility <nyx_assassin_unburrow>();
            Vendetta       = AbilityFactory.GetAbility <nyx_assassin_vendetta>();

            Context.Inventory.Attach(this);

            Config = new Config(this);
        }
예제 #14
0
        protected override void OnActivate()
        {
            Config = new Config(this);

            Shockwave       = AbilityFactory.GetAbility <magnataur_shockwave>();
            Empower         = AbilityFactory.GetAbility <magnataur_empower>();
            Skewer          = AbilityFactory.GetAbility <magnataur_skewer>();
            ReversePolarity = AbilityFactory.GetAbility <magnataur_reverse_polarity>();

            Context.Inventory.Attach(this);

            Context.TargetSelector.Config.ShowTargetParticle.Item.SetValue(false);
        }
예제 #15
0
        public Abilities(Config config)
        {
            AbilityFactory = config.Main.Context.AbilityFactory;
            Inventory      = config.Main.Context.Inventory;

            ArcaneBolt     = AbilityFactory.GetAbility <skywrath_mage_arcane_bolt>();
            ConcussiveShot = AbilityFactory.GetAbility <skywrath_mage_concussive_shot>();
            AncientSeal    = AbilityFactory.GetAbility <skywrath_mage_ancient_seal>();
            MysticFlare    = AbilityFactory.GetAbility <skywrath_mage_mystic_flare>();

            UpdateManager.BeginInvoke(() =>
            {
                Inventory.Attach(this);
            },
                                      3000);
        }
예제 #16
0
        protected override void OnActivate()
        {
            base.OnActivate();
            GraveChill     = AbilityFactory.GetAbility <visage_grave_chill>();
            SoulAssumption = AbilityFactory.GetAbility <visage_soul_assumption>();

            Context.Inventory.Attach(this);

            Config = new Config(this);

            LaneHelper = new LaneHelper(this);

            Updater = new Updater(this);

            foreach (var feature in features)
            {
                feature.Activate(Config);
                Log.Debug($"{feature.ToString()} activated.");
            }

            RendererManager.Draw += OnDraw;
        }
    public void OnClick()
    {
        Ability ability = AbilityFactory.GetAbility(this.name_);

        ability.Process();
    }
예제 #18
0
 public void SetAbilityName(string name)
 {
     this.GetComponentInChildren <Text>().text = name;
     ability = AbilityFactory.GetAbility(name);
 }