Beispiel #1
0
        private IEnumerator DoSlash(float angle, float delay)
        {
            yield return(new WaitForSeconds(delay));

            if (SlashDamageUsesBaseProjectileDamage)
            {
                SlashDamage     = this.m_projectile.baseData.damage;
                SlashBossMult   = this.m_projectile.BossDamageMultiplier;
                SlashJammedMult = this.m_projectile.BlackPhantomDamageMultiplier;
                slashKnockback  = this.m_projectile.baseData.force;
            }
            if (UsesAngleVariance)
            {
                angle += UnityEngine.Random.Range(MinSlashAngleOffset, MaxSlashAngleOffset);
            }
            ProjectileSlashingBehaviour slash = this.GetComponent <ProjectileSlashingBehaviour>();

            if (slash != null)//just to be safe, who knows what stupid shit could possibly happen. i literally cant think of any way it would ever be null.
            {
                if (PostProcessSlash != null)
                {
                    PostProcessSlash(GameManager.Instance.PrimaryPlayer, slash);
                }
            }
            SlashDoer.GrabBoolsAndValuesAndShitForTheFuckingSlashingApplyEffect(AppliesStun, StunApplyChance, StunTime);
            SlashDoer.DoSwordSlash(this.m_projectile.specRigidbody.UnitCenter, (this.m_projectile.Direction.ToAngle() + angle), owner, playerKnockback, this.InteractMode, SlashDamage, slashKnockback, effects, null, SlashJammedMult, SlashBossMult, SlashRange, SlashDimensions);
            if (DoSound)
            {
                AkSoundEngine.PostEvent(soundToPlay, this.m_projectile.gameObject);
            }
            SlashVFX.SpawnAtPosition(this.m_projectile.specRigidbody.UnitCenter, this.m_projectile.Direction.ToAngle() + angle, null, null, null, -0.05f);
            if (DestroyBaseAfterFirstSlash)
            {
                Suicide();
            }

            yield break;
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Royal Guard's Knife", "royal_guard's_knife");

            Game.Items.Rename("outdated_gun_mods:royal_guard's_knife", "sts:royal_guard's_knife");
            gun.gameObject.AddComponent <RoyalGuardsKnife>();
            gun.SetShortDescription("Stab Stab Stab");
            gun.SetLongDescription("A weak hunting knife used by The Royal Guard for cutting up game or sawing rope.");
            gun.SetupSprite(null, "royal_guard's_knife_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 12);
            gun.SetAnimationFPS(gun.reloadAnimation, 2);
            gun.AddProjectileModuleFrom("38_special", true, false);
            gun.DefaultModule.ammoType      = GameUIAmmoType.AmmoType.SMALL_BULLET;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 0f;
            gun.DefaultModule.angleVariance       = 0f;
            gun.DefaultModule.cooldownTime        = .2f;
            gun.DefaultModule.numberOfShotsInClip = 350;
            Gun gun2 = PickupObjectDatabase.GetById(151) as Gun;

            gun.muzzleFlashEffects.type = VFXPoolType.None;
            gun.SetBaseMaxAmmo(350);
            gun.barrelOffset.transform.localPosition = new Vector3(0.75f, 0f, 0f);
            gun.quality = PickupObject.ItemQuality.EXCLUDED;
            gun.encounterTrackable.EncounterGuid = "Fuckfuckfuckfuckpleaseworkpleasefuckingworkpleasepleasework.";
            gun.sprite.IsPerpendicular           = true;
            gun.gunClass = GunClass.NONE;
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.transform.parent      = gun.barrelOffset;
            projectile.baseData.damage      *= .5f;
            VFXPool fuckyouyoustupidfuckingvfxihateyousofuckingmuchyougoddamnmistakefuckyourubelaswellihateyousomuchformakingthevfxpoolcodesofuckingbadAAAAAAAAAAAAAAAAAAAAAAAAA = VFXLibrary.CreateMuzzleflash("royal_guard's_knife_slash", new List <string> {
                "royal_guard's_knife_slash_001", "royal_guard's_knife_slash_002", "royal_guard's_knife_slash_003", "royal_guard's_knife_slash_004",
            }, 10, new List <IntVector2> {
                new IntVector2(27, 27), new IntVector2(27, 27), new IntVector2(27, 27), new IntVector2(27, 27),
            }, new List <tk2dBaseSprite.Anchor> {
                tk2dBaseSprite.Anchor.MiddleLeft, tk2dBaseSprite.Anchor.MiddleLeft, tk2dBaseSprite.Anchor.MiddleLeft, tk2dBaseSprite.Anchor.MiddleLeft
            }, new List <Vector2> {
                Vector2.zero, Vector2.zero, Vector2.zero, Vector2.zero,
            }, false, false, false, false, 0, VFXAlignment.Fixed, true, new List <float> {
                0, 0, 0, 0
            }, new List <Color> {
                VFXLibrary.emptyColor, VFXLibrary.emptyColor, VFXLibrary.emptyColor, VFXLibrary.emptyColor,
            });

            ProjectileSlashingBehaviour slashingBehaviour = projectile.gameObject.AddComponent <ProjectileSlashingBehaviour>();

            slashingBehaviour.SlashVFX        = fuckyouyoustupidfuckingvfxihateyousofuckingmuchyougoddamnmistakefuckyourubelaswellihateyousomuchformakingthevfxpoolcodesofuckingbadAAAAAAAAAAAAAAAAAAAAAAAAA;
            slashingBehaviour.SlashDimensions = 65;
            slashingBehaviour.SlashRange      = 2.5f;

            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToSubShop(ItemBuilder.ShopType.Goopton);
            gun.AddToSubShop(ItemBuilder.ShopType.Trorc);
        }
Beispiel #3
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Photon Blade", "Photon Blade");

            Game.Items.Rename("outdated_gun_mods:photon_blade", "sts:photon_blade");
            gun.gameObject.AddComponent <PhotonBlade>();
            gun.SetShortDescription("Not Just The Children...");
            gun.SetLongDescription("Slices with deadly power.");
            gun.SetupSprite(null, "photon_blade_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 10);
            gun.SetAnimationFPS(gun.reloadAnimation, 2);
            gun.AddProjectileModuleFrom("38_special", true, false);
            gun.DefaultModule.ammoType      = GameUIAmmoType.AmmoType.SMALL_BULLET;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 0f;
            gun.DefaultModule.angleVariance       = 0f;
            gun.DefaultModule.cooldownTime        = .5f;
            gun.DefaultModule.numberOfShotsInClip = 350;
            Gun gun2 = PickupObjectDatabase.GetById(151) as Gun;

            gun.muzzleFlashEffects.type = VFXPoolType.None;
            gun.SetBaseMaxAmmo(350);
            gun.barrelOffset.transform.localPosition = new Vector3(1.5f, 0f, 0f);
            gun.quality = PickupObject.ItemQuality.EXCLUDED;
            gun.encounterTrackable.EncounterGuid = "zwoooop.";
            gun.sprite.IsPerpendicular           = true;
            gun.gunClass = GunClass.NONE;
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.transform.parent      = gun.barrelOffset;
            projectile.baseData.damage      *= 3f;
            projectile.baseData.speed        = 0;
            ProjectileSlashingBehaviour slashingBehaviour = projectile.gameObject.AddComponent <ProjectileSlashingBehaviour>();

            slashingBehaviour.SlashDimensions = 90;
            slashingBehaviour.SlashRange      = 2.5f;
            VFXPool SlashVFX = VFXLibrary.CreateMuzzleflash("photon_blade_slice", new List <string> {
                "katanaslice_001", "katanaslice_002", "katanaslice_003",
            }, 10, new List <IntVector2> {
                new IntVector2(72, 67), new IntVector2(72, 67), new IntVector2(72, 67),
            }, new List <tk2dBaseSprite.Anchor> {
                tk2dBaseSprite.Anchor.MiddleLeft, tk2dBaseSprite.Anchor.MiddleLeft, tk2dBaseSprite.Anchor.MiddleLeft
            }, new List <Vector2> {
                Vector2.zero, Vector2.zero, Vector2.zero
            }, false, false, false, false, 0, VFXAlignment.Fixed, true, new List <float> {
                0, 0, 0
            }, new List <Color> {
                VFXLibrary.emptyColor, VFXLibrary.emptyColor, VFXLibrary.emptyColor
            });

            slashingBehaviour.SlashVFX = SlashVFX;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToSubShop(ItemBuilder.ShopType.Goopton);
            gun.AddToSubShop(ItemBuilder.ShopType.Trorc);
        }
Beispiel #4
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Ancient Katana", "ancient_katana");

            Game.Items.Rename("outdated_gun_mods:ancient_katana", "sts:ancient_katana");
            gun.gameObject.AddComponent <Katana>();
            gun.SetShortDescription("Blade Breathing, 1st Form");
            gun.SetLongDescription("Can be charged to release a flurry of attacks.");
            gun.SetupSprite(null, "ancient_katana_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 12);
            gun.SetAnimationFPS(gun.reloadAnimation, 2);
            gun.AddProjectileModuleFrom("38_special", true, false);
            gun.DefaultModule.ammoType      = GameUIAmmoType.AmmoType.SMALL_BULLET;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 0f;
            gun.DefaultModule.angleVariance       = 0f;
            gun.DefaultModule.cooldownTime        = .5f;
            gun.DefaultModule.numberOfShotsInClip = 350;
            Gun gun2 = PickupObjectDatabase.GetById(151) as Gun;

            gun.muzzleFlashEffects.type = VFXPoolType.None;
            gun.SetBaseMaxAmmo(350);
            gun.barrelOffset.transform.localPosition = new Vector3(2.5f, 0f, 0f);
            gun.quality = PickupObject.ItemQuality.EXCLUDED;
            gun.encounterTrackable.EncounterGuid = "wht the f**k did this break MTG AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAAAA.";
            gun.sprite.IsPerpendicular           = true;
            gun.gunClass = GunClass.NONE;
            Projectile projectile  = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);
            Projectile projectile2 = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            projectile.transform.parent = gun.barrelOffset;
            projectile.baseData.damage *= 3f;
            projectile.baseData.speed   = 0;
            ProjectileSlashingBehaviour slashingBehaviour = projectile.gameObject.AddComponent <ProjectileSlashingBehaviour>();

            slashingBehaviour.SlashDimensions  = 135;
            slashingBehaviour.SlashRange       = 5f;
            slashingBehaviour.delayBeforeSlash = .1f;


            projectile2.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile2.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile2);
            projectile2.transform.parent = gun.barrelOffset;
            projectile2.baseData.damage *= 3f;
            projectile2.baseData.speed   = 0;
            ProjectileSlashingBehaviour slashingBehaviour2 = projectile2.gameObject.AddComponent <ProjectileSlashingBehaviour>();

            slashingBehaviour2.SlashDimensions          = 135;
            slashingBehaviour2.SlashRange               = 5f;
            slashingBehaviour2.delayBeforeSlash         = .2f;
            slashingBehaviour2.DoesMultipleSlashes      = true;
            slashingBehaviour2.AmountOfMultiSlashes     = 5;
            slashingBehaviour2.DelayBetweenMultiSlashes = .2f;
            slashingBehaviour2.UsesAngleVariance        = true;
            slashingBehaviour2.MinSlashAngleOffset      = -8;
            slashingBehaviour2.MaxSlashAngleOffset      = 8;
            ProjectileModule.ChargeProjectile chargeProjectile1 = new ProjectileModule.ChargeProjectile()
            {
                Projectile = projectile,
                ChargeTime = 0
            };
            ProjectileModule.ChargeProjectile chargeProjectile2 = new ProjectileModule.ChargeProjectile()
            {
                Projectile = projectile2,
                ChargeTime = .7f
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
            {
                chargeProjectile1,
                chargeProjectile2
            };
            VFXPool SlashVFX = VFXLibrary.CreateMuzzleflash("katanaslice", new List <string> {
                "katanaslice_001", "katanaslice_002", "katanaslice_003",
            }, 10, new List <IntVector2> {
                new IntVector2(72, 67), new IntVector2(72, 67), new IntVector2(72, 67),
            }, new List <tk2dBaseSprite.Anchor> {
                tk2dBaseSprite.Anchor.MiddleLeft, tk2dBaseSprite.Anchor.MiddleLeft, tk2dBaseSprite.Anchor.MiddleLeft
            }, new List <Vector2> {
                Vector2.zero, Vector2.zero, Vector2.zero
            }, false, false, false, false, 0, VFXAlignment.Fixed, true, new List <float> {
                0, 0, 0
            }, new List <Color> {
                VFXLibrary.emptyColor, VFXLibrary.emptyColor, VFXLibrary.emptyColor
            });

            slashingBehaviour.SlashVFX  = SlashVFX;
            slashingBehaviour2.SlashVFX = SlashVFX;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToSubShop(ItemBuilder.ShopType.Goopton);
            gun.AddToSubShop(ItemBuilder.ShopType.Trorc);
        }
        public static void Add()
        {
            string shorthandName = "reloaded_rifle";
            Gun    gun           = ETGMod.Databases.Items.NewGun("Reloaded Rifle", shorthandName);

            Game.Items.Rename("outdated_gun_mods:" + shorthandName, "cel:" + shorthandName);
            var behav = gun.gameObject.AddComponent <ReloadedRifle>();

            gun.SetShortDescription("Of The Highest Quality");
            gun.SetLongDescription("Has multiple active reloads with different effects. If the first active reload is performed with an empty clip, the empty clip is thrown, stunning hit enemies.\n\nNothing is more satisfying, more sweet to a gunslinger than a crisp, fluid reload.");
            gun.SetupSprite(null, shorthandName + "_idle_001", 6);
            gun.SetAnimationFPS(gun.shootAnimation, 12);
            gun.AddProjectileModuleFrom("ak-47", true, false);
            gun.SetBaseMaxAmmo(500);
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1.4f;
            gun.DefaultModule.cooldownTime = 0.11f;
            gun.gunClass = GunClass.RIFLE;
            gun.DefaultModule.numberOfShotsInClip = 25;
            gun.quality = PickupObject.ItemQuality.S;
            Gun gun2 = PickupObjectDatabase.GetById(15) as Gun;

            gun.muzzleFlashEffects = gun2.muzzleFlashEffects;
            gun.gunSwitchGroup     = gun2.gunSwitchGroup;
            gun.gunHandedness      = GunHandedness.TwoHanded;
            gun.barrelOffset.transform.localPosition = new Vector3(2.5f, .5f, 0f);
            gun.DefaultModule.angleVariance          = 4f;
            gun.encounterTrackable.EncounterGuid     = "r/HighQualityReloads";
            gun.sprite.IsPerpendicular = true;

            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage      *= 1f;
            projectile.baseData.speed       *= 1f;
            projectile.baseData.force       *= 1f;
            projectile.transform.parent      = gun.barrelOffset;
            ProjectileSlashingBehaviour projectileSlashing = projectile.gameObject.AddComponent <ProjectileSlashingBehaviour>();

            projectileSlashing.SlashDimensions = 45;

            ETGMod.Databases.Items.Add(gun, null, "ANY");
            behav.activeReloadEnabled = true;
            behav.reloads             = new List <MultiActiveReloadData>
            {
                new MultiActiveReloadData(0.675f, 65, 69, 1, 1 * 3, false, true, new ActiveReloadData
                {
                    damageMultiply = 2f,
                }, true, "DamageUp"),
                new MultiActiveReloadData(.5f, 48, 52, 1, 1 * 3, false, true, new ActiveReloadData
                {
                    damageMultiply = 1,
                }, true, "AccuracyUp"),
                new MultiActiveReloadData(.85f, 83, 87, 1, 1 * 3, true, true, new ActiveReloadData
                {
                    damageMultiply = 1,
                }, true, "FireRateUp")
            };
        }