Ejemplo n.º 1
0
    void Awake()
    {
        GameObject player = GameObject.Find("player");

        unlockedSkills = player.GetComponentInChildren <PlayerSkills>();
        equippedSkills = player.GetComponentInChildren <EquippedSkills>();
    }
 private bool TestEquippedSkills(IPlayerPowerInfo powers)
 {
     if (EquippedSkills != null)
     {
         return(AllEquippedSkills
             ? EquippedSkills.All(skill => powers.UsedSkills.Any(playerSkill => (skill.Icon.HasValue ? playerSkill.SnoPower.Sno == skill.Sno && playerSkill.Rune == skill.Icon.Value : playerSkill.SnoPower.Sno == skill.Sno) && (!playerSkill.IsOnCooldown || !CheckSkillCooldowns)))
             : EquippedSkills.Any(skill => powers.UsedSkills.Any(playerSkill => (skill.Icon.HasValue ? playerSkill.SnoPower.Sno == skill.Sno && playerSkill.Rune == skill.Icon.Value : playerSkill.SnoPower.Sno == skill.Sno) && (!playerSkill.IsOnCooldown || !CheckSkillCooldowns))));
     }
     return(true);
 }
Ejemplo n.º 3
0
        public CcBreakByInputModifier(ModifierInfo info, Entity casterEntity, Entity targetEntity,
                                      Modifier parentModifier, CcBreakByInputModifierEventConfig eventConfig,
                                      Environment environment,
                                      CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
        {
            this.info           = (CcBreakByInputInfo)info;
            this.parentModifier = parentModifier;
            this.eventConfig    = eventConfig;
            this.environment    = environment;
            this.modifierInteractionCollection = modifierInteractionCollection;

            mainLifetimes.Add(new ParentModifierLifetime(parentModifier));
            smComponent = targetEntity.GetComponent <HeroStateMachineComponent>();
            if (smComponent == null)
            {
                smComponent = targetEntity.GetComponent <MonsterStateMachineComponent>();
            }
            userInput = (DefaultUserInput)smComponent.UserInput;
            EquippedSkills equippedSkills = targetEntity.GetComponent <EquippedSkillsComponent>().EquippedSkills;

            skillId = equippedSkills.PassiveRecovery2.SkillId;

            character = targetEntity.GetComponent <SkillComponent>().Character;
        }
Ejemplo n.º 4
0
 // Start is called before the first frame update
 void Start()
 {
     equippedSkills          = GameObject.Find("player/EquippedSkills").GetComponent <EquippedSkills>();
     currentSkillIcon.sprite = equippedSkills.currentSkill.GetIcon();
 }
Ejemplo n.º 5
0
 void OnEnable()
 {
     equippedSkills = GameObject.Find("player/EquippedSkills").GetComponent <EquippedSkills>();
     myIcon.sprite  = equippedSkills.skills[slotNumber - 1].GetIcon();
 }
Ejemplo n.º 6
0
        public bool IsVisible(IController controller)
        {
            if (HeroClass != HeroClass.None && Hud.Game.Me.HeroClassDefinition.HeroClass != HeroClass)
            {
                return(false);
            }
            if (controller.Game.IsInTown && !ShowInTown)
            {
                return(false);
            }
            //return true;
            var visible = true;
            var player  = controller.Game.Me;
            var powers  = player.Powers;

            if (EquippedSkills != null)
            {
                visible = AllEquippedSkills
                    ? EquippedSkills.All(skill => powers.UsedSkills.Any(playerSkill => (skill.Icon.HasValue ? playerSkill.SnoPower.Sno == skill.Sno && playerSkill.Rune == skill.Icon.Value : playerSkill.SnoPower.Sno == skill.Sno) && (!playerSkill.IsOnCooldown || !CheckSkillCooldowns)))
                    : EquippedSkills.Any(skill => powers.UsedSkills.Any(playerSkill => (skill.Icon.HasValue ? playerSkill.SnoPower.Sno == skill.Sno && playerSkill.Rune == skill.Icon.Value : playerSkill.SnoPower.Sno == skill.Sno) && (!playerSkill.IsOnCooldown || !CheckSkillCooldowns)));
            }

            if (visible && MissingSkills != null)
            {
                visible = MissingSkills.Any(skill => powers.UsedSkills.All(playerSkill => playerSkill.SnoPower.Sno != skill.Sno));
            }

            if (visible && EquippedPassives != null)
            {
                visible = EquippedPassives.All(passive => powers.UsedPassives.Any(playerPassive => playerPassive.Sno == passive));
            }

            if (visible && MissingPassives != null)
            {
                visible = MissingPassives.Any(passive => powers.UsedPassives.All(playerPassive => playerPassive.Sno != passive));
            }

            if (visible && ActiveBuffs != null)
            {
                visible = AllActiveBuffs
                    ? ActiveBuffs.All(buff => buff.Icon.HasValue ? powers.BuffIsActive(buff.Sno, buff.Icon.Value) : powers.BuffIsActive(buff.Sno))
                    : ActiveBuffs.Any(buff => buff.Icon.HasValue ? powers.BuffIsActive(buff.Sno, buff.Icon.Value) : powers.BuffIsActive(buff.Sno));
            }
            if (visible && InactiveBuffs != null)
            {
                visible = AllInactiveBuffs
                    ? InactiveBuffs.All(buff => buff.Icon.HasValue ? !powers.BuffIsActive(buff.Sno, buff.Icon.Value) : !powers.BuffIsActive(buff.Sno))
                    : InactiveBuffs.Any(buff => buff.Icon.HasValue ? !powers.BuffIsActive(buff.Sno, buff.Icon.Value) : !powers.BuffIsActive(buff.Sno));
            }

            if (visible && ActorSnoIds != null)
            {
                visible = Hud.Game.Actors.Any(a => ActorSnoIds.Contains(a.SnoActor.Sno));
            }

            if (visible && InvocationActorSnoIds != null)
            {
                visible = !Hud.Game.Actors.Any(a => a.SummonerAcdDynamicId == Hud.Game.Me.SummonerId && InvocationActorSnoIds.Contains(a.SnoActor.Sno));
            }

            if (visible && CustomCondition != null)
            {
                visible = CustomCondition.Invoke(Hud);
            }

            return(visible);
        }