Exemplo n.º 1
0
 public override void OnCatalogRefresh()
 {
     base.OnCatalogRefresh();
     Addressables.LoadAssetAsync <GameObject>("Lyneca.DaggerSpell.BlackHole").Task.Then(obj => blackHolePrefab = obj);
     daggerBase  = Catalog.GetData <ItemPhysic>(weaponId, true);
     throwEffect = Catalog.GetData <EffectData>("SpellTelekinesisPush");
 }
Exemplo n.º 2
0
        public void Initialize(Item item, AthenasSword module)
        {
            LoadBossWeapon(item);
            fireRainDuration  = module.fireRainDuration;
            fireRainHeight    = module.fireRainHeight;
            fireRainIntensity = module.fireRainIntensity;
            fireRainRadius    = module.fireRainRadius;

            fireLaserDelay    = module.fireLaserDelay;
            fireLaserVelocity = module.fireLaserVelocity;

            fireBallItemData = Catalog.GetData <ItemPhysic>(module.fireBallItemId);

            // Enemy
            OnCollisionCreatureEnemyHoldingEvent += CreatureCollisionEnemyHolding;

            //Player
            swordTip = item.definition.GetCustomReference("swordTip");
            if (!swordTip)
            {
                Debug.LogError("Weapon does not have swordTip reference, defaulting to flyref");
                swordTip = item.definition.flyDirRef;
            }
            OnHeldActionPlayer += OnHeldAction;
        }
Exemplo n.º 3
0
 public override void OnItemDataRefresh(ItemPhysic data)
 {
     base.OnItemDataRefresh(data);
     if (!string.IsNullOrEmpty(useSound))
     {
         Catalog.LoadAssetAsync <AudioContainer>(useSound, ac => useSoundAsset = ac, null);
     }
 }
Exemplo n.º 4
0
 public override void OnCatalogRefresh()
 {
     base.OnCatalogRefresh();
     Addressables.LoadAssetAsync <GameObject>("Lyneca.DaggerSpell.BlackHole").Task.Then(obj => blackHolePrefab = obj);
     blackHoleEffect = Catalog.GetData <EffectData>("SpellDaggerSummonSound");
     daggerBase      = Catalog.GetData <ItemPhysic>(weaponId ?? Catalog.GetData <DaggerSpell>("DaggerSpell").weaponId, true);
     daggers         = new List <FloatingDagger>();
 }
Exemplo n.º 5
0
        public static Task <Item> SpawnItem(ItemPhysic itemData)
        {
            var promise = new TaskCompletionSource <Item>();

            System.Action action = () => itemData.SpawnAsync(item => promise.SetResult(item));
            Task.Run(action);
            return(promise.Task);
        }
Exemplo n.º 6
0
 public override void Load(Mana mana)
 {
     base.Load(mana);
     sunData               = Catalog.GetData <ItemPhysic>("CosmicSun");
     fireballItem          = Catalog.GetData <ItemPhysic>("DynamicProjectile");
     fireballEffect        = Catalog.GetData <EffectData>("SpellFireball");
     fireballDeflectEffect = Catalog.GetData <EffectData>("SpellFireBallHitBlade");
     fireballDamager       = Catalog.GetData <DamagerData>("Fireball");
 }
Exemplo n.º 7
0
        public virtual Item Init(ItemPhysic itemData)
        {
            foreach (Item existingInteractiveObject in this.gameObject.GetComponents <Item>())
            {
                Destroy(existingInteractiveObject);
            }
            itemId      = itemData.id;
            initialized = true;
            Item item = itemData.CreateComponent(this.gameObject);

            if (Initialized != null)
            {
                Initialized.Invoke(item);
            }
            return(item);
        }
Exemplo n.º 8
0
 public FloatingDagger(ItemPhysic daggerBase, GameObject blackHolePrefab, EffectData soundEffect, int number, int count)
 {
     daggerBase.SpawnAsync(dagger => {
         item = dagger;
         item.transform.localScale = Vector3.one * charge;
         item.transform.position   = GetTarget(number, count);
         soundEffect.Spawn(dagger.transform).Play();
         PointItemFlyRefAtTarget(item, GetHandsPointingQuaternion() * Vector3.forward, 1.0f);
         item.rb.collisionDetectionMode = CollisionDetectionMode.Discrete;
         item.GetComponent <Rigidbody>().isKinematic = true;
         item.disallowDespawn              = false;
         blackHole                         = UnityEngine.Object.Instantiate(blackHolePrefab, item.transform.position, Quaternion.identity);
         blackHole.transform.localScale    = Vector3.one * 0.25f;
         blackHole.transform.localPosition = Vector3.zero;
         blackHole.GetComponent <Renderer>().material.SetFloat("HoleSize", 0);
         blackHole.GetComponent <Renderer>().material.SetFloat("DistortionStrength", 0);
     });
 }
Exemplo n.º 9
0
 public override void OnItemDataRefresh(ItemPhysic data)
 {
     base.OnItemDataRefresh(data);
     if (!string.IsNullOrEmpty(idleSound))
     {
         Catalog.LoadAssetAsync <AudioContainer>(idleSound, ac => idleSoundAsset = ac, null);
     }
     if (!string.IsNullOrEmpty(startSound))
     {
         Catalog.LoadAssetAsync <AudioContainer>(startSound, ac => startSoundAsset = ac, null);
     }
     if (!string.IsNullOrEmpty(stopSound))
     {
         Catalog.LoadAssetAsync <AudioContainer>(stopSound, ac => stopSoundAsset = ac, null);
     }
     if (!string.IsNullOrEmpty(whooshFX))
     {
         whoosh = Catalog.GetData <EffectData>(whooshFX, true);
     }
 }
Exemplo n.º 10
0
        protected void SpawnAndSnap(string spawnedItemID, ObjectHolder holder)
        {
            ItemPhysic spawnedItemData = Catalog.GetData <ItemPhysic>(spawnedItemID, true);

            //Debug.Log("[HoldingBag][Fetch][Spawn] Item Categories: " + spawnedItemData.categoryPath + ", Item Name: " + spawnedItemData.displayName);
            if (spawnedItemData == null)
            {
                return;
            }
            else
            {
                Item thisSpawnedItem = spawnedItemData.Spawn(true);
                if (!thisSpawnedItem.gameObject.activeInHierarchy)
                {
                    thisSpawnedItem.gameObject.SetActive(true);
                }
                holder.Snap(thisSpawnedItem);
                return;
            }
        }
Exemplo n.º 11
0
 public override void OnCatalogRefresh()
 {
     base.OnCatalogRefresh();
     daggerBase  = Catalog.GetData <ItemPhysic>(weaponId ?? Catalog.GetData <DaggerSpell>("DaggerSpell").weaponId, true);
     spellCharge = Catalog.GetData <SpellCastCharge>(spellCastName);
 }
Exemplo n.º 12
0
        public override void OnItemDataRefresh(ItemPhysic data)
        {
            base.OnItemDataRefresh(data);
            if (!string.IsNullOrEmpty(altFireSoundPath))
            {
                Catalog.LoadAssetAsync <AudioContainer>(altFireSoundPath, ac => altFireSoundAsset = ac, null);
            }
            if (!string.IsNullOrEmpty(altFireSoundPath2))
            {
                Catalog.LoadAssetAsync <AudioContainer>(altFireSoundPath2, ac => altFireSoundAsset2 = ac, null);
            }

            if (!string.IsNullOrEmpty(chargeFireSoundPath))
            {
                Catalog.LoadAssetAsync <AudioContainer>(chargeFireSoundPath, ac => chargeFireSoundAsset = ac, null);
            }
            if (!string.IsNullOrEmpty(chargeFireSoundPath2))
            {
                Catalog.LoadAssetAsync <AudioContainer>(chargeFireSoundPath2, ac => chargeFireSoundAsset2 = ac, null);
            }
            if (!string.IsNullOrEmpty(chargeFireSoundPath3))
            {
                Catalog.LoadAssetAsync <AudioContainer>(chargeFireSoundPath3, ac => chargeFireSoundAsset3 = ac, null);
            }

            if (!string.IsNullOrEmpty(chargeSoundPath))
            {
                Catalog.LoadAssetAsync <AudioContainer>(chargeSoundPath, ac => chargeSoundAsset = ac, null);
            }
            if (!string.IsNullOrEmpty(chargeSoundPath2))
            {
                Catalog.LoadAssetAsync <AudioContainer>(chargeSoundPath2, ac => chargeSoundAsset2 = ac, null);
            }

            if (!string.IsNullOrEmpty(chargeReadySoundPath))
            {
                Catalog.LoadAssetAsync <AudioContainer>(chargeReadySoundPath, ac => chargeReadySoundAsset = ac, null);
            }
            if (!string.IsNullOrEmpty(chargeReadySoundPath2))
            {
                Catalog.LoadAssetAsync <AudioContainer>(chargeReadySoundPath2, ac => chargeReadySoundAsset2 = ac, null);
            }

            if (!string.IsNullOrEmpty(chargeStartSoundPath))
            {
                Catalog.LoadAssetAsync <AudioContainer>(chargeStartSoundPath, ac => chargeStartSoundAsset = ac, null);
            }
            if (!string.IsNullOrEmpty(chargeStartSoundPath2))
            {
                Catalog.LoadAssetAsync <AudioContainer>(chargeStartSoundPath2, ac => chargeStartSoundAsset2 = ac, null);
            }

            if (!string.IsNullOrEmpty(emptySoundPath))
            {
                Catalog.LoadAssetAsync <AudioContainer>(emptySoundPath, ac => emptySoundAsset = ac, null);
            }
            if (!string.IsNullOrEmpty(emptySoundPath2))
            {
                Catalog.LoadAssetAsync <AudioContainer>(emptySoundPath2, ac => emptySoundAsset2 = ac, null);
            }

            if (!string.IsNullOrEmpty(fireSoundPath))
            {
                Catalog.LoadAssetAsync <AudioContainer>(fireSoundPath, ac => fireSoundAsset = ac, null);
            }
            if (!string.IsNullOrEmpty(fireSoundPath2))
            {
                Catalog.LoadAssetAsync <AudioContainer>(fireSoundPath2, ac => fireSoundAsset2 = ac, null);
            }
            if (!string.IsNullOrEmpty(fireSoundPath3))
            {
                Catalog.LoadAssetAsync <AudioContainer>(fireSoundPath3, ac => fireSoundAsset3 = ac, null);
            }

            if (!string.IsNullOrEmpty(fireModeSoundPath))
            {
                Catalog.LoadAssetAsync <AudioContainer>(fireModeSoundPath, ac => fireModeSoundAsset = ac, null);
            }
            if (!string.IsNullOrEmpty(fireModeSoundPath2))
            {
                Catalog.LoadAssetAsync <AudioContainer>(fireModeSoundPath2, ac => fireModeSoundAsset2 = ac, null);
            }

            if (!string.IsNullOrEmpty(overheatSoundPath))
            {
                Catalog.LoadAssetAsync <AudioContainer>(overheatSoundPath, ac => overheatSoundAsset = ac, null);
            }
            if (!string.IsNullOrEmpty(overheatSoundPath2))
            {
                Catalog.LoadAssetAsync <AudioContainer>(overheatSoundPath2, ac => overheatSoundAsset2 = ac, null);
            }

            if (!string.IsNullOrEmpty(preFireSoundPath))
            {
                Catalog.LoadAssetAsync <AudioContainer>(preFireSoundPath, ac => preFireSoundAsset = ac, null);
            }
            if (!string.IsNullOrEmpty(preFireSoundPath2))
            {
                Catalog.LoadAssetAsync <AudioContainer>(preFireSoundPath2, ac => preFireSoundAsset2 = ac, null);
            }

            if (!string.IsNullOrEmpty(reloadSoundPath))
            {
                Catalog.LoadAssetAsync <AudioContainer>(reloadSoundPath, ac => reloadSoundAsset = ac, null);
            }
            if (!string.IsNullOrEmpty(reloadSoundPath2))
            {
                Catalog.LoadAssetAsync <AudioContainer>(reloadSoundPath2, ac => reloadSoundAsset2 = ac, null);
            }

            if (!string.IsNullOrEmpty(reloadEndSoundPath))
            {
                Catalog.LoadAssetAsync <AudioContainer>(reloadEndSoundPath, ac => reloadEndSoundAsset = ac, null);
            }
            if (!string.IsNullOrEmpty(reloadEndSoundPath2))
            {
                Catalog.LoadAssetAsync <AudioContainer>(reloadEndSoundPath2, ac => reloadEndSoundAsset2 = ac, null);
            }

            if (!string.IsNullOrEmpty(scopeReticle))
            {
                Catalog.LoadAssetAsync <Texture2D>(scopeReticle, texture => scopeReticleTexture = texture, null);
            }
        }
Exemplo n.º 13
0
 public static Item SpawnItemSync(ItemPhysic itemData)
 {
     return(SpawnItem(itemData).GetAwaiter().GetResult());
 }
Exemplo n.º 14
0
 public override void Load(Mana mana)
 {
     base.Load(mana);
     blackHoleData = Catalog.GetData <ItemPhysic>("CosmicBlackHole");
     whiteHoleData = Catalog.GetData <ItemPhysic>("CosmicWhiteHole");
 }