Exemplo n.º 1
0
 public static void ReportSoulCollected(SoulType soulCollected)
 {
     if (OnSoulCollected != null)
     {
         OnSoulCollected(soulCollected);
     }
 }
Exemplo 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;
        }
Exemplo n.º 3
0
        private void AddSoul(SoulType soulType)
        {
            ActiveSouls.Add(soulType);
            var soul = Soul.New(soulType, LoadoutSouls);

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

            soul.DeactivateUniqueEffect();
            LoadoutSouls.DeregisterChild(soul);
        }
Exemplo n.º 5
0
 public void SetSoulReference(BaseSoul soul, bool overrideType = true)
 {
     this.soulReference = soul;
     if (overrideType)
     {
         this.soulType = this.soulReference?.soulType ?? SoulType.Red;
     }
 }
Exemplo 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);
 }
Exemplo 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;
     }
 }
Exemplo 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();
        }
    }
Exemplo 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);
        }
Exemplo 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));
 }
Exemplo n.º 14
0
 public virtual bool GetBindingValue(SoulType soul)
 {
     return(false);
 }
Exemplo n.º 15
0
 public virtual bool GetBindingVisibility(SoulType soul)
 {
     return(false);
 }
Exemplo n.º 16
0
 public virtual void ToggleSoul(SoulType soul)
 {
 }
Exemplo n.º 17
0
 public override bool GetBindingVisibility(SoulType soul)
 {
     return(SoulCollection.GetBindingValue(soul));
 }
Exemplo n.º 18
0
 public override bool GetBindingValue(SoulType soul)
 {
     return(ActiveSouls.Contains(soul));
 }
Exemplo n.º 19
0
 public void TestEnumHelper(string description, SoulType expected)
 {
     Assert.That(EnumHelper.GetEnumFromDescription <SoulType>(description), Is.EqualTo(expected));
 }
Exemplo n.º 20
0
 private void SetSoulColor(int colour)
 {
     soulKind      = (SoulType)colour;
     mesh.material = souls[Mathf.Min(souls.Count, colour)];
 }