Esempio n. 1
0
        /// <summary>
        /// Spawns the test units for debugging.
        /// </summary>
        private void SpawnTestUnits()
        {
            Unit wizard = new Unit(
                0, "Wizard", 10, 3, players[1],
                new List <Ability>()
            {
                AbilityFactory.Frostbolt()
            },
                new Animation(Unit.Diameter, Unit.Diameter, 1000, 2, Resources.Textures.Wizard));

            Unit knight = new Unit(
                1, "Knight", 20, 3, players[2],
                new List <Ability>()
            {
                AbilityFactory.Lunge()
            },
                new Animation(Unit.Diameter, Unit.Diameter, 1000, 2, Resources.Textures.Knight));

            board.TrySpawnUnit(wizard, 2, 5);
            board.TrySpawnUnit(knight, 8, 5);
            board.TrySpawnGenerator(0, 5);
        }
Esempio n. 2
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;
        }
Esempio n. 3
0
    public void ActivateAbility(AbilityFormat abilityEffect, Button abilityButton)
    {
        if (abilityEffect != null)
        {
            //default target is the playing field because it has references to everyting under playing Field Objects
            //this gives us more flexibility since ability effects needs to look at everything
            GameObject playingField = gameObject.transform.parent.gameObject;

            //if requirement check returns true
            if (AbilityFactory.GetAbilityEffect(abilityEffect.enumAbilityName).RequirementCheck(playingField))
            {
                //activates effect then disables button because abilities are once per turn only
                //second parameter gameObject is for sending the gameObject as the actor
                AbilityFactory.GetAbilityEffect(abilityEffect.enumAbilityName).CardEffectActivate(playingField, gameObject);
                abilityButton.interactable = false;
            }
            else
            {
                Debug.Log("not enough Energy");
            }
        }
    }
Esempio n. 4
0
    public void InitializePart(HeadPartInfo headPartInfo)
    {
        //this mainly is used to check whether the part is attached to the player
        PlayerController player = GetComponentInParent <PlayerController>();

        if (headPartInfo != null)
        {
            partInfo = headPartInfo;

            //checking whether this part has an ability
            if (partInfo.abilityName != null && player != null)
            {
                //populating the partAbility field with the appropriate ability delegate
                partAbility = AbilityFactory.GetPartAbility(partInfo.abilityName);

                //if the type is Passive, run the delegate method to apply the buff to the player
                if (partInfo.abilityType == "Passive")
                {
                    partAbility();
                }//if the type is Activate, set the ability to the Player action delegate
                else if (partInfo.abilityType == "Activate")
                {
                    player.headAbilityDelegate = partAbility;
                }
            }

            if (GetComponentInParent <Enemy>() == null)
            {
                idleFaceSprite   = Helper.CreateSprite(partInfo.mainSprite, Helper.HeadImporter);
                hurtFaceSprite   = Helper.CreateSprite(partInfo.hurtSprite, Helper.HeadImporter);
                attackFaceSprite = Helper.CreateSprite(partInfo.attackSprite, Helper.HeadImporter);
                neckSprite       = Helper.CreateSprite(partInfo.neckSprite, Helper.HeadImporter);
            }

            face.sprite = idleFaceSprite;
            neck.sprite = neckSprite;
        }
    }
    private void Awake()
    {
        SharedInstance = this;

        // Load all abilities from the Resource folder
        //LoadAbilities();

        // This is for mapping the selected abilties
        mapper = new AbilityMapper();

        // This is the container of all abilities
        // We will move all abilities from an array to a map because it is faster to access them
        abilityMap = new Dictionary <string, Ability>();

        // Fill the AbilityMap
        for (int i = 0; i < abilityContainerArray.Length; i++)
        {
            abilityMap.Add(abilityContainerArray[i].name, abilityContainerArray[i]);
        }

        // Remove reference
        abilityContainerArray = null;
    }
Esempio n. 6
0
 public EnchantressPlus([Import] IServiceContext context)
 {
     Context        = context;
     AbilityFactory = context.AbilityFactory;
 }
Esempio n. 7
0
    public void InitializePart(ArmPartInfo armPartInfo)
    {
        //this mainly is used to check whether the part is attached to the player
        PlayerController player = GetComponentInParent <PlayerController>();

        Enemy enemy = GetComponentInParent <Enemy>();

        Boss boss = GetComponentInParent <Boss>();

        if (armPartInfo != null)
        {
            partInfo = armPartInfo;

            if (player != null)
            {
                weapon = WeaponFactory.GetWeapon(partInfo.equippedWeapon, partType, "Player", weaponRenderer);
            }
            else if (enemy != null || boss != null)
            {
                weapon = WeaponFactory.GetWeapon(partInfo.equippedWeapon, partType, "Enemy", weaponRenderer);
            }

            //checking whether this part has an ability
            if (partInfo.abilityName != null && player != null)
            {
                //populating the partAbility field with the appropriate ability delegate
                ability = AbilityFactory.GetArmPartAbility(partInfo.abilityName);

                //if the type is Passive, run the delegate method to apply the buff to the player
                if (partInfo.abilityType == "Passive")
                {
                    ability(partType);
                }//if the type is Activate, set the ability to the Player action delegate
                else if (partInfo.abilityType == "Activate")
                {
                    //checking which arm to apply the ability to
                    if (partType == Helper.PartType.RightArm)
                    {
                        player.rightAttackDelegate = ability;
                    }
                    else if (partType == Helper.PartType.LeftArm)
                    {
                        player.leftAttackDelegate = ability;
                    }
                }
            }

            if (GetComponentInParent <Enemy>() == null)
            {
                //setting all of the sprite fields
                bicepSprite              = Helper.CreateSprite(partInfo.bicepSprite, Helper.BicepImporter);
                forearmSprite            = Helper.CreateSprite(partInfo.forearmSprite, Helper.ForearmImporter);
                handBackSprite           = Helper.CreateSprite(partInfo.handBackSprite, Helper.HandImporter);
                handFrontSprite          = Helper.CreateSprite(partInfo.handFrontSprite, Helper.HandImporter);
                fingersOpenBackSprite    = Helper.CreateSprite(partInfo.fingersOpenBackSprite, Helper.HandImporter);
                fingersOpenFrontSprite   = Helper.CreateSprite(partInfo.fingersOpenFrontSprite, Helper.HandImporter);
                fingersClosedBackSprite  = Helper.CreateSprite(partInfo.fingersClosedBackSprite, Helper.HandImporter);
                fingersClosedFrontSprite = Helper.CreateSprite(partInfo.fingersClosedFrontSprite, Helper.HandImporter);
            }

            if (weapon != null)
            {
                ability = weapon.AttackDelegate;

                fingersBack  = fingersClosedBackSprite;
                fingersFront = fingersClosedFrontSprite;

                weaponSprite          = weapon.WeaponSprite;
                weaponRenderer.sprite = weaponSprite;

                if (partType == Helper.PartType.RightArm)
                {
                    if (player != null)
                    {
                        player.rightAttackDelegate = ability;
                        player.RightAttackCooldown = weapon.AttackCooldown;
                    }
                    else if (boss != null)
                    {
                        boss.rightAttackDelegate = ability;
                        boss.rightAttackCooldown = weapon.AttackCooldown;
                        weapon.Damage            = boss.rightAttackDamage;
                        if (weapon.WeaponType == Helper.WeaponType.Melee)
                        {
                            boss.rightAttackRange = weapon.AttackRange - 0.8f;
                        }
                        else if (weapon.WeaponType == Helper.WeaponType.Projectile)
                        {
                            weapon.AttackRange = boss.rightAttackRange;
                        }
                    }
                    else if (enemy != null)
                    {
                        enemy.attackDelegate = ability;
                        enemy.attackCooldown = weapon.AttackCooldown;
                        weapon.Damage        = enemy.damage;
                        if (weapon.WeaponType == Helper.WeaponType.Melee)
                        {
                            enemy.attackRange = weapon.AttackRange - 0.8f;
                        }
                        else if (weapon.WeaponType == Helper.WeaponType.Projectile)
                        {
                            weapon.AttackRange = enemy.attackRange;
                        }
                    }
                }
                else if (partType == Helper.PartType.LeftArm)
                {
                    if (player != null)
                    {
                        player.leftAttackDelegate = ability;
                        player.LeftAttackCooldown = weapon.AttackCooldown;
                    }
                    else if (boss != null)
                    {
                        boss.leftAttackDelegate = ability;
                        boss.leftAttackCooldown = weapon.AttackCooldown;
                        weapon.Damage           = boss.leftAttackDamage;
                        if (weapon.WeaponType == Helper.WeaponType.Melee)
                        {
                            boss.leftAttackRange = weapon.AttackRange - 0.8f;
                        }
                        else if (weapon.WeaponType == Helper.WeaponType.Projectile)
                        {
                            weapon.AttackRange = boss.leftAttackRange;
                        }
                    }
                    else if (enemy != null)
                    {
                        enemy.attackDelegate = ability;
                        enemy.attackCooldown = weapon.AttackCooldown;
                        if (weapon.WeaponType == Helper.WeaponType.Melee)
                        {
                            enemy.attackRange = weapon.AttackRange - 0.8f;
                        }
                        else if (weapon.WeaponType == Helper.WeaponType.Projectile)
                        {
                            weapon.AttackRange = enemy.attackRange;
                        }
                        weapon.Damage = enemy.damage;
                    }
                }
            }
            else
            {
                fingersBack  = fingersOpenBackSprite;
                fingersFront = fingersOpenFrontSprite;
                weaponSprite = null;
                if (weaponRenderer != null)
                {
                    weaponRenderer.sprite = null;
                }
            }

            bicep.sprite   = bicepSprite;
            forearm.sprite = forearmSprite;

            if (partType == Helper.PartType.RightArm)
            {
                hand.sprite    = handBackSprite;
                fingers.sprite = fingersBack;
            }
            else if (partType == Helper.PartType.LeftArm)
            {
                hand.sprite    = handFrontSprite;
                fingers.sprite = fingersFront;
            }
        }
    }
Esempio n. 8
0
 public ZeusPlus([Import] IServiceContext context)
 {
     Context        = context;
     AbilityFactory = context.AbilityFactory;
 }
Esempio n. 9
0
 private void CreateAbility()
 {
     Ability       = AbilityFactory.CreateRandomAbility();
     containerMesh = Instantiate(Ability.Data.ContainerMesh, transform);
 }
Esempio n. 10
0
 public NyxAssassinPlus([Import] IServiceContext context)
 {
     Context        = context;
     AbilityFactory = context.AbilityFactory;
 }
Esempio n. 11
0
        public void SetEntry(MonsterStaticData p_data, Int32 p_amountKilled)
        {
            m_stages        = p_data.BestiaryThresholds;
            m_currentAmount = p_amountKilled;
            if (p_data.Grade == EMonsterGrade.CHAMPION || p_data.Grade == EMonsterGrade.BOSS)
            {
                m_currentAmount = p_data.BestiaryThresholds[2];
            }
            m_progressBar.SetCurrentAmount(m_currentAmount, p_data.BestiaryThresholds[2]);
            Int32 num;

            if (LegacyLogic.Instance.WorldManager.Difficulty == EDifficulty.HARD)
            {
                switch (p_data.Grade)
                {
                case EMonsterGrade.CORE:
                    num = (Int32)(p_data.MaxHealthpoints * ConfigManager.Instance.Game.MonsterHealthCoreFactor);
                    break;

                case EMonsterGrade.ELITE:
                    num = (Int32)(p_data.MaxHealthpoints * ConfigManager.Instance.Game.MonsterHealthEliteFactor);
                    break;

                case EMonsterGrade.CHAMPION:
                    num = (Int32)(p_data.MaxHealthpoints * ConfigManager.Instance.Game.MonsterHealthChampionFactor);
                    break;

                default:
                    num = p_data.MaxHealthpoints;
                    break;
                }
            }
            else
            {
                num = p_data.MaxHealthpoints;
            }
            String p_text = String.Empty;

            if (p_data.MeleeAttackDamageMin == p_data.MeleeAttackDamageMax)
            {
                p_text = p_data.MeleeAttackDamageMin.ToString();
            }
            else
            {
                p_text = p_data.MeleeAttackDamageMin + "-" + p_data.MeleeAttackDamageMax;
            }
            m_maxHp.UpdateLabel(num.ToString(), LocaManager.GetText("BESTIARY_STAT_ATTRIBUTE_HEALTH_TT"));
            m_meleeDmg.UpdateLabel(p_text, LocaManager.GetText("BESTIARY_STAT_ATTACK_DAMAGE_TT"));
            m_meleeStrikes.UpdateLabel(p_data.MeleeAttackStrikesAmount.ToString(), LocaManager.GetText("BESTIARY_STAT_STRIKES_TT"));
            m_critMelee.UpdateLabel(p_data.CriticalDamageMelee.ToString(), LocaManager.GetText("BESTIARY_STAT_ATTACK_CRIT_DAMAGE_TT", p_data.CriticalDamageMelee * 100f));
            m_meleeAttackValue.UpdateLabel(p_data.MeleeAttackValue.ToString(), LocaManager.GetText("BESTIARY_STAT_ATTACK_VALUE_TT"));
            for (Int32 i = 0; i < m_spells.Count; i++)
            {
                m_spells[i].ShowEntry(true);
                if (p_data.Spells.Length > i)
                {
                    MonsterSpellStaticData staticData   = StaticDataHandler.GetStaticData <MonsterSpellStaticData>(EDataType.MONSTER_SPELLS, p_data.Spells[i].SpellID);
                    MonsterSpell           monsterSpell = SpellFactory.CreateMonsterSpell((EMonsterSpell)staticData.StaticID, staticData.EffectKey, p_data.Spells[i].SpellProbability);
                    m_spells[i].ShowEntry(true);
                    m_spells[i].UpdateEntry(staticData.Icon);
                    StringBuilder stringBuilder = new StringBuilder();
                    stringBuilder.Append(m_headLineColorHex);
                    stringBuilder.Append(LocaManager.GetText(monsterSpell.NameKey));
                    stringBuilder.Append("[-]");
                    stringBuilder.Append(Environment.NewLine);
                    stringBuilder.Append(m_textColorHex);
                    stringBuilder.Append(monsterSpell.GetDescriptionForCaster(p_data));
                    stringBuilder.Append("[-]");
                    m_spells[i].SetTooltip(stringBuilder.ToString());
                }
                else
                {
                    m_spells[i].ShowEntry(false);
                }
            }
            if (p_data.AttackRange > 1 && p_data.Spells.Length == 0)
            {
                m_rangeDmg.gameObject.SetActive(true);
                m_rangeStrikes.gameObject.SetActive(true);
                m_rangeAttackValue.gameObject.SetActive(true);
                m_rangeAttackRange.gameObject.SetActive(true);
                m_critRange.gameObject.SetActive(true);
                m_critMagic.gameObject.SetActive(false);
                String p_text2 = String.Empty;
                if (p_data.RangedAttackDamageMin == p_data.RangedAttackDamageMax)
                {
                    p_text2 = p_data.RangedAttackDamageMin.ToString();
                }
                else
                {
                    p_text2 = p_data.RangedAttackDamageMin + "-" + p_data.RangedAttackDamageMax;
                }
                m_rangeDmg.UpdateLabel(p_text2, LocaManager.GetText("BESTIARY_STAT_ATTACK_DAMAGE_TT", p_data.RangedAttackDamage.Value.ToString()));
                m_rangeStrikes.UpdateLabel(p_data.RangedAttackStrikesAmount.ToString(), LocaManager.GetText("BESTIARY_STAT_STRIKES_TT", p_data.RangedAttackStrikesAmount.ToString()));
                m_rangeAttackValue.UpdateLabel(p_data.RangedAttackValue.ToString(), LocaManager.GetText("BESTIARY_STAT_ATTACK_VALUE_TT", p_data.RangedAttackValue.ToString()));
                m_rangeAttackRange.UpdateLabel(p_data.AttackRange.ToString(), LocaManager.GetText("MONSTER_ATTACK_RANGE_TT", p_data.AttackRange.ToString()));
                m_critRange.UpdateLabel(p_data.CriticalDamageRanged.ToString(), LocaManager.GetText("BESTIARY_STAT_ATTACK_CRIT_DAMAGE_TT", p_data.CriticalDamageRanged * 100f));
                m_labelRangedMagic.text = LocaManager.GetText("GUI_CHARACTER_STATS_RANGED");
                for (Int32 j = 0; j < m_spells.Count; j++)
                {
                    m_spells[j].ShowEntry(false);
                }
            }
            else if (p_data.Spells.Length > 0)
            {
                m_rangeDmg.gameObject.SetActive(false);
                m_rangeStrikes.gameObject.SetActive(false);
                m_rangeAttackValue.gameObject.SetActive(false);
                m_rangeAttackRange.gameObject.SetActive(false);
                m_critRange.gameObject.SetActive(false);
                m_critMagic.gameObject.SetActive(true);
                m_labelRangedMagic.text = LocaManager.GetText("GUI_CHARACTER_STATS_MAGIC");
            }
            else
            {
                m_rangeDmg.gameObject.SetActive(true);
                m_rangeStrikes.gameObject.SetActive(true);
                m_rangeAttackValue.gameObject.SetActive(true);
                m_rangeAttackRange.gameObject.SetActive(true);
                m_critRange.gameObject.SetActive(true);
                m_critMagic.gameObject.SetActive(false);
                for (Int32 k = 0; k < m_spells.Count; k++)
                {
                    m_spells[k].ShowEntry(false);
                }
                m_labelRangedMagic.text = LocaManager.GetText("GUI_CHARACTER_STATS_RANGED");
                m_rangeDmg.UpdateLabel("-", LocaManager.GetText("BESTIARY_STAT_ATTACK_DAMAGE_TT", "-"));
                m_rangeStrikes.UpdateLabel("-", LocaManager.GetText("BESTIARY_STAT_STRIKES_TT", "-"));
                m_rangeAttackValue.UpdateLabel("-", LocaManager.GetText("BESTIARY_STAT_ATTACK_VALUE_TT", "-"));
                m_rangeAttackRange.UpdateLabel("-", LocaManager.GetText("MONSTER_ATTACK_RANGE_TT", "-"));
                m_critRange.UpdateLabel("-", LocaManager.GetText("BESTIARY_STAT_ATTACK_CRIT_DAMAGE_TT", "-"));
            }
            m_armor.UpdateLabel(p_data.ArmorValue.ToString(), LocaManager.GetText("BESTIARY_STAT_ARMOR_VALUE_TT", p_data.ArmorValue.ToString()));
            m_blockAttempts.UpdateLabel(p_data.GeneralBlockAttemptsPerTurn.ToString(), LocaManager.GetText("BESTIARY_STAT_BLOCK_ATTEMPTS_TT", p_data.GeneralBlockAttemptsPerTurn.ToString()));
            m_evade.UpdateLabel(p_data.EvadeValue.ToString(), LocaManager.GetText("BESTIARY_STAT_EVADE_VALUE_TT", p_data.EvadeValue.ToString()));
            if (p_data.CriticalDamageSpells > 0f)
            {
                m_critMagic.UpdateLabel(p_data.CriticalDamageSpells.ToString(), LocaManager.GetText("BESTIARY_STAT_MAGIC_CRIT_CHANCE_TT", p_data.CriticalDamageSpells * 100f));
            }
            else
            {
                m_critMagic.UpdateLabel("-", LocaManager.GetText("BESTIARY_STAT_MAGIC_CRIT_CHANCE_TT", "-"));
            }
            NGUITools.SetActive(m_abilityFrame, true);
            if (p_data.Abilities.Length == 0)
            {
                NGUITools.SetActive(m_abilityFrame, false);
            }
            for (Int32 l = 0; l < m_specials.Count; l++)
            {
                if (p_data.Abilities.Length > l)
                {
                    m_specials[l].ShowEntry(true);
                    MonsterAbilityBase monsterAbilityBase = AbilityFactory.CreateMonsterAbility(p_data.Abilities[l].AbilityType, p_data.MagicPower);
                    monsterAbilityBase.Level = p_data.Abilities[l].Level;
                    m_specials[l].UpdateEntry(monsterAbilityBase.StaticData.Icon);
                    StringBuilder stringBuilder2 = new StringBuilder();
                    stringBuilder2.Append(m_headLineColorHex);
                    stringBuilder2.Append(LocaManager.GetText(monsterAbilityBase.StaticData.NameKey));
                    stringBuilder2.Append("[-]");
                    stringBuilder2.Append(Environment.NewLine);
                    stringBuilder2.Append(m_textColorHex);
                    stringBuilder2.Append(monsterAbilityBase.GetDescription());
                    stringBuilder2.Append("[-]");
                    m_specials[l].SetTooltip(stringBuilder2.ToString());
                }
                else
                {
                    m_specials[l].ShowEntry(false);
                }
            }
            m_resiPrimordial.UpdateLabel("0", LocaManager.GetText("BESTIARY_STAT_RESISTANCE_PRIMORDIAL_TT", 0, 0));
            m_resiFire.UpdateLabel("0", LocaManager.GetText("BESTIARY_STAT_RESISTANCE_FIRE_TT", 0, 0));
            m_resiWater.UpdateLabel("0", LocaManager.GetText("BESTIARY_STAT_RESISTANCE_WATER_TT", 0, 0));
            m_resiEarth.UpdateLabel("0", LocaManager.GetText("BESTIARY_STAT_RESISTANCE_EARTH_TT", 0, 0));
            m_resiAir.UpdateLabel("0", LocaManager.GetText("BESTIARY_STAT_RESISTANCE_AIR_TT", 0, 0));
            m_resiLight.UpdateLabel("0", LocaManager.GetText("BESTIARY_STAT_RESISTANCE_LIGHT_TT", 0, 0));
            m_resiDark.UpdateLabel("0", LocaManager.GetText("BESTIARY_STAT_RESISTANCE_DARK_TT", 0, 0));
            foreach (Resistance resistance in p_data.MagicResistances)
            {
                switch (resistance.Type)
                {
                case EDamageType.AIR:
                    m_resiAir.UpdateLabel(resistance.Value.ToString(), LocaManager.GetText("BESTIARY_STAT_RESISTANCE_AIR_TT", resistance.Value * (p_data.EvadeValue / 100), resistance.Value));
                    break;

                case EDamageType.EARTH:
                    m_resiEarth.UpdateLabel(resistance.Value.ToString(), LocaManager.GetText("BESTIARY_STAT_RESISTANCE_EARTH_TT", resistance.Value * (p_data.EvadeValue / 100), resistance.Value));
                    break;

                case EDamageType.FIRE:
                    m_resiFire.UpdateLabel(resistance.Value.ToString(), LocaManager.GetText("BESTIARY_STAT_RESISTANCE_FIRE_TT", resistance.Value * (p_data.EvadeValue / 100), resistance.Value));
                    break;

                case EDamageType.WATER:
                    m_resiWater.UpdateLabel(resistance.Value.ToString(), LocaManager.GetText("BESTIARY_STAT_RESISTANCE_WATER_TT", resistance.Value * (p_data.EvadeValue / 100), resistance.Value));
                    break;

                case EDamageType.DARK:
                    m_resiDark.UpdateLabel(resistance.Value.ToString(), LocaManager.GetText("BESTIARY_STAT_RESISTANCE_DARK_TT", resistance.Value * (p_data.EvadeValue / 100), resistance.Value));
                    break;

                case EDamageType.LIGHT:
                    m_resiLight.UpdateLabel(resistance.Value.ToString(), LocaManager.GetText("BESTIARY_STAT_RESISTANCE_LIGHT_TT", resistance.Value * (p_data.EvadeValue / 100), resistance.Value));
                    break;

                case EDamageType.PRIMORDIAL:
                    m_resiPrimordial.UpdateLabel(resistance.Value.ToString(), LocaManager.GetText("BESTIARY_STAT_RESISTANCE_PRIMORDIAL_TT", resistance.Value * (p_data.EvadeValue / 100), resistance.Value));
                    break;
                }
            }
            HideLockedEntries();
        }
 public static void Initialize()
 {
     AbilityFactory.Register("Undying", typeof(UndyingAbility));
 }
 public SampleOrbOrbwalkingModeWithAsync(IServiceContext context)
     : base(context, Key.Space)
 {
     this.targetSelectorManager = context.TargetSelector;
     this.abilityFactory        = context.AbilityFactory;
 }
Esempio n. 14
0
 public SilencerPlus([Import] IServiceContext context)
 {
     Context        = context;
     AbilityFactory = context.AbilityFactory;
 }
Esempio n. 15
0
 public AbilityRepository(AbilityVariablesRegistry abilityRegistry, AbilityFactory abilityFactory)
 {
     _abilityRegistry = abilityRegistry;
     _abilityFactory  = abilityFactory;
 }
    public void OnClick()
    {
        Ability ability = AbilityFactory.GetAbility(this.name_);

        ability.Process();
    }
Esempio n. 17
0
 public void SetAbilityName(string name)
 {
     this.GetComponentInChildren <Text>().text = name;
     ability = AbilityFactory.GetAbility(name);
 }
Esempio n. 18
0
 public SampleOrbOrbwalkingModeWithAsync(IOrbwalker orbwalker, IInputManager input, ITargetSelectorManager targetSelectorManager, AbilityFactory abilityFactory)
     : base(orbwalker, input, Key.Space)
 {
     this.targetSelectorManager = targetSelectorManager;
     this.abilityFactory        = abilityFactory;
 }
 public AbilityRepository(AbilityVariablesRegistry abilityRegistry, AbilityFactory abilityFactory) //gets abilityfactory from installer
 {
     _abilityRegistry = abilityRegistry;
     _abilityFactory  = abilityFactory;
 }
Esempio n. 20
0
        //Update the input during gameplay
        public static void UpdateInput(GameTime gameTime)
        {
            if (OrusTheGame.Instance.GameInformation.Character.AttackAnimation.IsActive || OrusTheGame.Instance.GameInformation.Character.Health == 0 ||
                OrusTheGame.Instance.GameInformation.Character.IsUsingAbility)
            {
                return;
            }
            var keyState   = Keyboard.GetState();
            var mouseState = Mouse.GetState();

            if (keyState.IsKeyDown(Keys.Escape))
            {
                OrusTheGame.Instance.GameInformation.GameMenu.IsMenuActive = true;
                OrusTheGame.Instance.IsMouseVisible = true;
            }
            else if (keyState.IsKeyDown(Keys.Right) || keyState.IsKeyDown(Keys.D))
            {
                OrusTheGame.Instance.GameInformation.Character.TryToMove(gameTime, true);
            }
            else if (keyState.IsKeyDown(Keys.Left) || keyState.IsKeyDown(Keys.A))
            {
                OrusTheGame.Instance.GameInformation.Character.TryToMove(gameTime, false);
            }
            else
            {
                OrusTheGame.Instance.GameInformation.Character.StopMovement();
            }
            if (keyState.IsKeyDown(Keys.Space))
            {
                IsSpacePressed = true;
            }
            if (keyState.IsKeyUp(Keys.Space) && IsSpacePressed)
            {
                foreach (var questGiver in OrusTheGame.Instance.GameInformation.Levels[OrusTheGame.Instance.GameInformation.CurrentLevelIndex].QuestGivers)
                {
                    if (questGiver.Collides(OrusTheGame.Instance.GameInformation.Character))
                    {
                        questGiver.Interact();
                        break;
                    }
                }
                foreach (var interactiveItem in OrusTheGame.Instance.GameInformation.Levels[OrusTheGame.Instance.GameInformation.CurrentLevelIndex].Interactives)
                {
                    if (interactiveItem.Collides(OrusTheGame.Instance.GameInformation.Character))
                    {
                        interactiveItem.Interact();
                        break;
                    }
                }
                IsSpacePressed = false;
            }
            if (keyState.IsKeyDown(Keys.Q) && !OrusTheGame.Instance.GameInformation.Character.MoveAnimation.IsActive)
            {
                AbilityFactory.UseAbility(1, OrusTheGame.Instance.GameInformation.Character);
            }
            else if (keyState.IsKeyDown(Keys.E) && !OrusTheGame.Instance.GameInformation.Character.MoveAnimation.IsActive)
            {
                AbilityFactory.UseAbility(2, OrusTheGame.Instance.GameInformation.Character);
            }
            if (mouseState.LeftButton == ButtonState.Pressed)
            {
                OrusTheGame.Instance.GameInformation.Character.Attack(OrusTheGame.Instance.GameInformation.Levels[OrusTheGame.Instance.GameInformation.CurrentLevelIndex].Enemies.ConvertAll <AttackingGameObject>(enemy => enemy));
            }
        }