Esempio n. 1
0
 public static void ReportSoulCollected(SoulType soulCollected)
 {
     if (OnSoulCollected != null)
     {
         OnSoulCollected(soulCollected);
     }
 }
Esempio n. 2
0
        public override void ToggleSoul(SoulType soul)
        {
            var maxPowerSoulCount = SoulCollection.PowerSoulsCount;

            if (maxPowerSoulCount == 0)
            {
                return;
            }

            if (ActiveSouls.Contains(soul))
            {
                RemoveSoul(soul);
            }
            else if (ActiveSouls.Count < maxPowerSoulCount)
            {
                AddSoul(soul);
            }
            else
            {
                RemoveFirst();
                AddSoul(soul);
            }

            OnPropertyChanged(nameof(PowerSoulsCount));
            OnPropertyChanged(nameof(TotalUniques));
            LoadoutSouls.RefreshPropertyBinding("PowerSoul1");
            LoadoutSouls.RefreshPropertyBinding("PowerSoul2");
            HasChanges = true;
        }
Esempio n. 3
0
        private void AddSoul(SoulType soulType)
        {
            ActiveSouls.Add(soulType);
            var soul = Soul.New(soulType, LoadoutSouls);

            soul.ActivateUniqueEffect();
            LoadoutSouls.DeregisterChild(soul);
        }
Esempio n. 4
0
        void RemoveSoul(SoulType soulType)
        {
            ActiveSouls.Remove(soulType);
            var soul = Soul.New(soulType, LoadoutSouls);

            soul.DeactivateUniqueEffect();
            LoadoutSouls.DeregisterChild(soul);
        }
Esempio n. 5
0
 public void SetSoulReference(BaseSoul soul, bool overrideType = true)
 {
     this.soulReference = soul;
     if (overrideType)
     {
         this.soulType = this.soulReference?.soulType ?? SoulType.Red;
     }
 }
Esempio n. 6
0
 public SoulPickup(SoulType type, World world, float x, float y)
     : base(new RXRect(0, -7, 7, 12), world)
 {
     this.SetPosition(x, y - 3);
     Go.to(this, 2.0f, new TweenConfig().floatProp("y", 6, true).setEaseType(EaseType.QuadInOut).setIterations(-1, LoopType.PingPong));
     this.type = type;
     sprite = new FSprite(type.ToString().ToLower() + "Soul");
     this.AddChild(sprite);
 }
Esempio n. 7
0
        public SoulIndexUISoulSlot(BaseSoul soulReference = null)
        {
            this.soulReference = soulReference;
            this.soulType      = this.soulReference?.soulType ?? SoulType.Red;

            this.Height.Pixels = 26;

            this.soulTexture = GetTexture("MysticHunter/Souls/Items/BasicSoulItem");
        }
 public void ToggleSoul(SoulType soul)
 {
     if (DiscoveredSouls.Any(s => s == soul))
     {
         DiscoveredSouls.Remove(soul);
         HasChanges = true;
     }
     else
     {
         DiscoveredSouls.Add(soul);
         HasChanges = true;
     }
 }
Esempio n. 9
0
    public void OnSoulCollected(SoulType soul)
    {
        for (int i = 0; i < currSouls.Count; i++)
        {
            if (currSouls[i] == soul)
            {
                souls[i].DOColor(Color.red, 0.5f);
                souls[i].rectTransform.DOScale(Vector3.one * 1.5f, 0.5f);
                StartCoroutine(ReturnSoulIcon(souls[i]));
            }
        }
        List <SoulType> collected = currSouls.FindAll(x => x.isCollected == true);

        if (currSouls.Count == collected.Count) //play room clear animation after collect all souls in a room.
        {
            FadeInPanel(roomClearPanel);
            _CAMERA.RoomClear();
        }
    }
Esempio n. 10
0
        public static Soul New(SoulType type, VLoadoutSouls collection)
        {
            if (type == SoulType.None)
            {
                return(new EmptySoul());
            }
            var soulName = type.AsString(EnumFormat.Name) + "Soul";
            var soulType = System.Type.GetType($"VBusiness.Souls.{soulName}");

            if (soulType == null)
            {
                ErrorReporter.ReportDebug($"Please create a class named VBusiness.Souls.{soulName}");
                return(new EmptySoul());
            }

            var soul = (Soul)Activator.CreateInstance(soulType, collection);

            return(soul);
        }
Esempio n. 11
0
 public static string GetDescription(this SoulType type)
 {
     return(type.AsString(EnumFormat.Description, EnumFormat.Name));
 }
 public bool GetBindingVisibility(SoulType soul)
 {
     return(soul != SoulType.None);
 }
 public bool GetBindingValue(SoulType soul)
 {
     return(DiscoveredSouls.Any(s => s == soul));
 }
Esempio n. 14
0
 public virtual bool GetBindingValue(SoulType soul)
 {
     return(false);
 }
Esempio n. 15
0
 public virtual bool GetBindingVisibility(SoulType soul)
 {
     return(false);
 }
Esempio n. 16
0
 public virtual void ToggleSoul(SoulType soul)
 {
 }
Esempio n. 17
0
 public override bool GetBindingVisibility(SoulType soul)
 {
     return(SoulCollection.GetBindingValue(soul));
 }
Esempio n. 18
0
 public override bool GetBindingValue(SoulType soul)
 {
     return(ActiveSouls.Contains(soul));
 }
Esempio n. 19
0
 public void TestEnumHelper(string description, SoulType expected)
 {
     Assert.That(EnumHelper.GetEnumFromDescription <SoulType>(description), Is.EqualTo(expected));
 }
Esempio n. 20
0
 private void SetSoulColor(int colour)
 {
     soulKind      = (SoulType)colour;
     mesh.material = souls[Mathf.Min(souls.Count, colour)];
 }