Beispiel #1
0
        public void Add(Behaviour behaviour)
        {
            var item = Instantiate(this.behaviourPrefab, this.behaviourContainer);

            item.Initialize(behaviour);
            this.behaviourViews.Add(item);
        }
Beispiel #2
0
 private void OnBehaviourApplied(Behaviour behaviour)
 {
     if (this.behaviours.IsImmobilized || this.behaviours.IsUncontrollable)
     {
         Stop();
     }
 }
Beispiel #3
0
        private void OnBehaviourRemoved(Behaviour behaviour)
        {
            View.SetPoisoned(this.behaviours.IsPoisoned);

            if (!behaviour.IsHidden)
            {
                View.RemoveBehaviour(behaviour);
            }
        }
Beispiel #4
0
        private void OnAnyBehaviourAppliedOrRemoved(Behaviour behaviour)
        {
            if (Slot.Skill.Caster != behaviour.Target)
            {
                return;
            }

            MaybeMarkAsUnavailable();
        }
Beispiel #5
0
        private void OnBehaviourApplied(Behaviour behaviour)
        {
            View.SetPoisoned(this.behaviours.IsPoisoned);

            if (!behaviour.IsHidden)
            {
                View.AddBehaviour(behaviour);
            }
        }
Beispiel #6
0
        private void OnBehaviourApplied(Behaviour behaviour)
        {
            if (!this.behaviours.IsUncontrollable && !this.behaviours.IsImmobilized)
            {
                return;
            }

            this.path.Clear();
            this.mover.Stop();
        }
Beispiel #7
0
 public Food(FoodData data, Behaviour behaviour)
 {
     Id          = data.Id;
     Name        = I18N.Instance.Get(data.NameKey);
     Description = I18N.Instance.Get(data.DescriptionKey);
     Type        = data.Type;
     Icon        = data.Icon;
     Price       = data.Price;
     Behaviour   = behaviour;
 }
Beispiel #8
0
 public Relic(RelicData data, Rarity rarity, Behaviour behaviour)
 {
     Id          = data.Id;
     Name        = I18N.Instance.Get(data.NameKey);
     Description = I18N.Instance.Get(data.DescriptionKey);
     Lore        = I18N.Instance.Get(data.LoreKey);
     Icon        = data.Icon;
     Rarity      = rarity;
     Behaviour   = behaviour;
 }
Beispiel #9
0
 public Talent(TalentData data, Behaviour behaviour, TalentCategory category)
 {
     Id          = data.Id;
     Tier        = data.Tier;
     Index       = data.Index;
     Name        = I18N.Instance.Get(data.NameKey);
     Description = I18N.Instance.Get(data.DescriptionKey);
     Icon        = data.Icon;
     Behaviour   = behaviour;
     Category    = category;
 }
Beispiel #10
0
        public void Initialize(Behaviour behaviour)
        {
            Behaviour = behaviour;
            Behaviour.RemainingDurationChanged += OnDurationChanged;
            Behaviour.StackCountChanged        += OnStackCountChanged;

            OnDurationChanged(behaviour);
            OnStackCountChanged(behaviour);

            this.image.sprite     = Resources.Load <Sprite>(behaviour.Icon);
            this.background.color = behaviour.IsHarmful ? new Color(0.4f, 0, 0) : new Color(0, 0.4f, 0);
        }
Beispiel #11
0
        private void OnAnyBehaviourApplied(Behaviour behaviour)
        {
            if (!behaviour.Target.GetComponent <BehavioursComponent>().IsUncontrollable)
            {
                return;
            }

            Timer.Instance.WaitForEndOfFrame(() =>
            {
                SkillQueue.Clear(behaviour.Target);
                MaybeEndTurn(behaviour.Target);
            });
        }
Beispiel #12
0
        public void Remove(Behaviour behaviour)
        {
            var behaviourView = this.behaviourViews.Find(item => item.Behaviour.Equals(behaviour));

            if (behaviourView == null)
            {
                return;
            }

            behaviourView.Terminate();
            Destroy(behaviourView.gameObject);
            this.behaviourViews.Remove(behaviourView);
        }
Beispiel #13
0
 private void OnStackCountChanged(Behaviour behaviour)
 {
     this.stackText.text = behaviour.StackCount < 2 ? "" : $"x{behaviour.StackCount}";
 }
Beispiel #14
0
 public void Construct(Behaviour behaviour)
 {
     this.behaviour = behaviour;
     this.text.text = behaviour.Name;
 }
Beispiel #15
0
 private void OnDurationChanged(Behaviour behaviour)
 {
     this.durationText.text = behaviour.RemainingDuration > 0 ? behaviour.RemainingDuration.ToString() : "";
 }
Beispiel #16
0
 public void RemoveBehaviour(Behaviour behaviour)
 {
     this.behaviourFrame.Remove(behaviour);
 }
Beispiel #17
0
 public void AddBehaviour(Behaviour behaviour)
 {
     this.behaviourFrame.Add(behaviour);
 }