Esempio n. 1
0
        internal static void PopulateHenrysAssetsThatNoLongerExist()
        {
            if (!mainAssetBundle)
            {
                Debug.LogError("There is no AssetBundle to load assets from.");
                return;
            }

            // feel free to delete everything in here and load in your own assets instead
            // it should work fine even if left as is- even if the assets aren't in the bundle

            swordHitSoundEvent = CreateNetworkSoundEventDef("HenrySwordHit");

            bombExplosionEffect = LoadEffect("BombExplosionEffect", "HenryBombExplosion");

            if (bombExplosionEffect)
            {
                ShakeEmitter shakeEmitter = bombExplosionEffect.AddComponent <ShakeEmitter>();
                shakeEmitter.amplitudeTimeDecay             = true;
                shakeEmitter.duration                       = 0.5f;
                shakeEmitter.radius                         = 200f;
                shakeEmitter.scaleShakeRadiusWithLocalScale = false;

                shakeEmitter.wave = new Wave
                {
                    amplitude   = 1f,
                    frequency   = 40f,
                    cycleOffset = 0f
                };
            }

            swordSwingEffect     = Assets.LoadEffect("HenrySwordSwingEffect", true);
            swordHitImpactEffect = Assets.LoadEffect("ImpactHenrySlash");
        }
Esempio n. 2
0
        internal static void PopulateAssets()
        {
            if (mainAssetBundle == null)
            {
                using (var assetStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("HenryMod.pleasechangethisnameinyourprojectorelseyouwillcauseconflicts"))
                {
                    mainAssetBundle = AssetBundle.LoadFromStream(assetStream);
                    var provider = new AssetBundleResourcesProvider("@Henry", mainAssetBundle);
                    ResourcesAPI.AddProvider(provider);
                }
            }

            using (Stream manifestResourceStream2 = Assembly.GetExecutingAssembly().GetManifestResourceStream("HenryMod.HenryBank.bnk"))
            {
                byte[] array = new byte[manifestResourceStream2.Length];
                manifestResourceStream2.Read(array, 0, array.Length);
                SoundAPI.SoundBanks.Add(array);
            }

            swordHitSoundEvent = CreateNetworkSoundEventDef("HenrySwordHit");
            punchHitSoundEvent = CreateNetworkSoundEventDef("HenryPunchHit");

            dustEffect          = LoadEffect("HenryDustEffect");
            bombExplosionEffect = LoadEffect("BombExplosionEffect");

            ShakeEmitter shakeEmitter = bombExplosionEffect.AddComponent <ShakeEmitter>();

            shakeEmitter.amplitudeTimeDecay             = true;
            shakeEmitter.duration                       = 0.5f;
            shakeEmitter.radius                         = 200f;
            shakeEmitter.scaleShakeRadiusWithLocalScale = false;

            shakeEmitter.wave = new Wave
            {
                amplitude   = 1f,
                frequency   = 40f,
                cycleOffset = 0f
            };

            swordSwingEffect     = Assets.LoadEffect("HenrySwordSwingEffect");
            swordHitImpactEffect = Assets.LoadEffect("ImpactHenrySlash");

            punchSwingEffect = Assets.LoadEffect("HenryFistSwingEffect");
            //punchImpactEffect = Assets.LoadEffect("ImpactHenryPunch");
            // on second thought my effect sucks so imma just clone loader's
            punchImpactEffect = PrefabAPI.InstantiateClone(Resources.Load <GameObject>("Prefabs/Effects/OmniEffect/OmniImpactVFXLoader"), "ImpactHenryPunch");
            punchImpactEffect.AddComponent <NetworkIdentity>();

            EffectAPI.AddEffect(punchImpactEffect);
        }
Esempio n. 3
0
        internal static void PopulateAssets()
        {
            if (!mainAssetBundle)
            {
                Debug.LogError("There is no AssetBundle to load assets from.");
                return;
            }

            swordHitSoundEvent    = CreateNetworkSoundEventDef("HenrySwordHit");
            punchHitSoundEvent    = CreateNetworkSoundEventDef("HenryPunchHit");
            nemSwordHitSoundEvent = CreateNetworkSoundEventDef("NemrySwordHit");

            dustEffect             = LoadEffect("HenryDustEffect");
            bombExplosionEffect    = LoadEffect("BombExplosionEffect", "HenryBombExplosion");
            bazookaExplosionEffect = LoadEffect("HenryBazookaExplosionEffect", "HenryBazookaExplosion");
            bazookaMuzzleFlash     = LoadEffect("HenryBazookaMuzzleFlash");

            muzzleFlashEnergy = LoadEffect("NemryMuzzleFlashEnergy", true);
            minibossEffect    = mainAssetBundle.LoadAsset <GameObject>("NemryMinibossIndicator");

            swordChargeFinishEffect = LoadEffect("SwordChargeFinishEffect");
            swordChargeEffect       = mainAssetBundle.LoadAsset <GameObject>("SwordChargeEffect");

            if (swordChargeEffect)
            {
                swordChargeEffect.AddComponent <ScaleParticleSystemDuration>().particleSystems = swordChargeEffect.GetComponentsInChildren <ParticleSystem>();
                swordChargeEffect.GetComponent <ScaleParticleSystemDuration>().initialDuration = 1.5f;
            }

            if (bombExplosionEffect)
            {
                ShakeEmitter shakeEmitter = bombExplosionEffect.AddComponent <ShakeEmitter>();
                shakeEmitter.amplitudeTimeDecay             = true;
                shakeEmitter.duration                       = 0.5f;
                shakeEmitter.radius                         = 200f;
                shakeEmitter.scaleShakeRadiusWithLocalScale = false;

                shakeEmitter.wave = new Wave
                {
                    amplitude   = 1f,
                    frequency   = 40f,
                    cycleOffset = 0f
                };

                shakeEmitter = bazookaExplosionEffect.AddComponent <ShakeEmitter>();
                shakeEmitter.amplitudeTimeDecay             = true;
                shakeEmitter.duration                       = 0.4f;
                shakeEmitter.radius                         = 100f;
                shakeEmitter.scaleShakeRadiusWithLocalScale = false;

                shakeEmitter.wave = new Wave
                {
                    amplitude   = 1f,
                    frequency   = 30f,
                    cycleOffset = 0f
                };
            }

            swordSwingEffect     = Assets.LoadEffect("HenrySwordSwingEffect", true);
            swordHitImpactEffect = Assets.LoadEffect("ImpactHenrySlash");

            punchSwingEffect  = Assets.LoadEffect("HenryFistSwingEffect", true);
            punchImpactEffect = Assets.LoadEffect("ImpactHenryPunch");

            fistBarrageEffect = Assets.LoadEffect("FistBarrageEffect", true);
            if (fistBarrageEffect)
            {
                fistBarrageEffect.GetComponent <ParticleSystemRenderer>().material.shader = hotpoo;
            }

            bazookaCrosshair = PrefabAPI.InstantiateClone(LoadCrosshair("ToolbotGrenadeLauncher"), "HenryBazookaCrosshair", false);
            CrosshairController crosshair = bazookaCrosshair.GetComponent <CrosshairController>();

            crosshair.skillStockSpriteDisplays = new CrosshairController.SkillStockSpriteDisplay[0];
            bazookaCrosshair.transform.Find("StockCountHolder").gameObject.SetActive(false);
            bazookaCrosshair.transform.Find("Image, Arrow (1)").gameObject.SetActive(true);
            crosshair.spriteSpreadPositions[0].zeroPosition = new Vector3(32f, 34f, 0f);
            crosshair.spriteSpreadPositions[2].zeroPosition = new Vector3(-32f, 34f, 0f);
            bazookaCrosshair.transform.GetChild(1).gameObject.SetActive(false);

            trackerPrefab = PrefabAPI.InstantiateClone(Resources.Load <GameObject>("Prefabs/HuntressTrackingIndicator"), "HenryTrackerPrefab", false);
            trackerPrefab.transform.Find("Core Pip").gameObject.GetComponent <SpriteRenderer>().color = Color.white;
            trackerPrefab.transform.Find("Core Pip").localScale = new Vector3(0.15f, 0.15f, 0.15f);

            trackerPrefab.transform.Find("Core, Dark").gameObject.GetComponent <SpriteRenderer>().color = Color.black;
            trackerPrefab.transform.Find("Core, Dark").localScale = new Vector3(0.1f, 0.1f, 0.1f);

            foreach (SpriteRenderer i in trackerPrefab.transform.Find("Holder").gameObject.GetComponentsInChildren <SpriteRenderer>())
            {
                if (i)
                {
                    i.gameObject.transform.localScale = new Vector3(0.2f, 0.2f, 1f);
                    i.color = Color.white;
                }
            }

            shotgunTracer = Resources.Load <GameObject>("Prefabs/Effects/Tracers/TracerCommandoShotgun").InstantiateClone("HenryBulletTracer", true);

            if (!shotgunTracer.GetComponent <EffectComponent>())
            {
                shotgunTracer.AddComponent <EffectComponent>();
            }
            if (!shotgunTracer.GetComponent <VFXAttributes>())
            {
                shotgunTracer.AddComponent <VFXAttributes>();
            }
            if (!shotgunTracer.GetComponent <NetworkIdentity>())
            {
                shotgunTracer.AddComponent <NetworkIdentity>();
            }

            foreach (LineRenderer i in shotgunTracer.GetComponentsInChildren <LineRenderer>())
            {
                if (i)
                {
                    Material bulletMat = UnityEngine.Object.Instantiate <Material>(i.material);
                    bulletMat.SetColor("_TintColor", new Color(0.68f, 0.58f, 0.05f));
                    i.material   = bulletMat;
                    i.startColor = new Color(0.68f, 0.58f, 0.05f);
                    i.endColor   = new Color(0.68f, 0.58f, 0.05f);
                }
            }

            AddNewEffectDef(shotgunTracer);

            spearSwingEffect = Assets.LoadEffect("NemrySpearSwingEffect");

            nemSwordSwingEffect      = Assets.LoadEffect("NemrySwordSwingEffect", true);
            nemSwordStabSwingEffect  = Assets.LoadEffect("NemrySwordStabSwingEffect", true);
            nemSwordHeavySwingEffect = Assets.LoadEffect("NemryHeavySwordSwingEffect", true);
            nemSwordHitImpactEffect  = Assets.LoadEffect("ImpactNemrySlash");

            energyBurstEffect      = LoadEffect("EnergyBurstEffect");
            smallEnergyBurstEffect = LoadEffect("EnergySmallBurstEffect");

            energyTracer = CreateTracer("TracerHuntressSnipe", "NemryEnergyTracer");

            LineRenderer line      = energyTracer.transform.Find("TracerHead").GetComponent <LineRenderer>();
            Material     tracerMat = UnityEngine.Object.Instantiate <Material>(line.material);

            line.startWidth *= 0.25f;
            line.endWidth   *= 0.25f;
            // this did not work.
            //tracerMat.SetColor("_TintColor", new Color(78f / 255f, 80f / 255f, 111f / 255f));
            line.material = tracerMat;
        }