Exemple #1
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("ARC Pistol", "arcpistol");

            Game.Items.Rename("outdated_gun_mods:arc_pistol", "nn:arc_pistol");
            gun.gameObject.AddComponent <ARCPistol>();
            gun.SetShortDescription("Shocked And Loaded");
            gun.SetLongDescription("Developed by the ARC Private Security company for easy manufacture and deployment, this electrotech blaster is the epittome of the ARC brand.");

            gun.SetupSprite(null, "arcpistol_idle_001", 8);

            gun.SetAnimationFPS(gun.shootAnimation, 15);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(153) as Gun).gunSwitchGroup;

            //GUN STATS
            gun.muzzleFlashEffects          = (PickupObjectDatabase.GetById(41) as Gun).muzzleFlashEffects;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 0.7f;
            gun.DefaultModule.cooldownTime           = 0.15f;
            gun.DefaultModule.numberOfShotsInClip    = 5;
            gun.barrelOffset.transform.localPosition = new Vector3(22f / 16f, 11f / 16f, 0f);
            gun.SetBaseMaxAmmo(300);
            gun.gunClass = GunClass.PISTOL;

            //BULLET STATS
            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.speed       *= 5f;
            projectile.baseData.damage       = 6f;
            projectile.SetProjectileSpriteRight("arc_proj", 8, 2, false, tk2dBaseSprite.Anchor.MiddleCenter, 8, 2);
            LightningProjectileComp lightning = projectile.gameObject.GetOrAddComponent <LightningProjectileComp>();

            projectile.gameObject.AddComponent <PierceDeadActors>();

            projectile.hitEffects.overrideMidairDeathVFX = VFXToolbox.CreateVFX("ARC Impact",
                                                                                new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/GunVFX/electricImpact1",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/electricImpact2",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/electricImpact3",
            },
                                                                                10,                                 //FPS
                                                                                new IntVector2(44, 43),             //Dimensions
                                                                                tk2dBaseSprite.Anchor.MiddleCenter, //Anchor
                                                                                false,                              //Uses a Z height off the ground
                                                                                0                                   //The Z height, if used
                                                                                );
            projectile.hitEffects.alwaysUseMidair = true;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("ARC Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/arcweapon_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/arcweapon_clipempty");

            gun.quality = PickupObject.ItemQuality.C;
            ETGMod.Databases.Items.Add(gun, null, "ANY");


            ID = gun.PickupObjectId;
        }
Exemple #2
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("ARC Cannon", "arccannon");

            Game.Items.Rename("outdated_gun_mods:arc_cannon", "nn:arc_cannon");
            gun.gameObject.AddComponent <ARCCannon>();
            gun.SetShortDescription("All Lightning");
            gun.SetLongDescription("The ARC Cannon was commissioned from the ARC Private Security Company by the Sultan of a distant planet, who now spends his free time striking ships from the sky and declaring himself a god.");

            gun.SetupSprite(null, "arccannon_idle_001", 8);

            gun.SetAnimationFPS(gun.shootAnimation, 15);
            gun.SetAnimationFPS(gun.reloadAnimation, 0);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(ARCPistol.ID) as Gun, true, false);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(153) as Gun).gunSwitchGroup;

            //GUN STATS
            gun.muzzleFlashEffects          = (PickupObjectDatabase.GetById(228) as Gun).muzzleFlashEffects;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 3f;
            gun.DefaultModule.cooldownTime           = 1f;
            gun.DefaultModule.numberOfShotsInClip    = 1;
            gun.barrelOffset.transform.localPosition = new Vector3(45f / 16f, 16f / 16f, 0f);
            gun.SetBaseMaxAmmo(40);
            gun.gunClass = GunClass.RIFLE;
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "ARC Bullets";

            //BULLET STATS
            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       = 20f;
            LightningProjectileComp lightning = projectile.gameObject.GetComponent <LightningProjectileComp>();

            lightning.lightningWidth = 7;

            ExplosiveModifier explode = projectile.gameObject.AddComponent <ExplosiveModifier>();

            explode.explosionData = new ExplosionData()
            {
                breakSecretWalls = false,
                //effect = (PickupObjectDatabase.GetById(36) as Gun).DefaultModule.chargeProjectiles[1].Projectile.projectile.hitEffects.overrideEarlyDeathVfx,
                effect               = EasyVFXDatabase.ShittyElectricExplosion,
                doDamage             = true,
                damageRadius         = 3,
                damageToPlayer       = 0,
                damage               = 40,
                debrisForce          = 20,
                doExplosionRing      = true,
                doDestroyProjectiles = true,
                doForce              = true,
                doScreenShake        = true,
                playDefaultSFX       = true,
                force = 20,
            };

            Projectile subLightning = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(ARCPistol.ID) as Gun).DefaultModule.projectiles[0]);

            subLightning.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(subLightning.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(subLightning);
            subLightning.baseData.damage = 5f;
            LightningProjectileComp lightning2 = subLightning.gameObject.GetComponent <LightningProjectileComp>();

            subLightning.projectile.gameObject.AddComponent <PierceProjModifier>();
            lightning2.targetEnemies = false;

            SpawnProjModifier flakLightning = projectile.gameObject.AddComponent <SpawnProjModifier>();

            flakLightning.numberToSpawnOnCollison           = 5;
            flakLightning.numToSpawnInFlight                = 0;
            flakLightning.PostprocessSpawnedProjectiles     = true;
            flakLightning.projectileToSpawnOnCollision      = subLightning;
            flakLightning.randomRadialStartAngle            = true;
            flakLightning.spawnCollisionProjectilesOnBounce = true;
            flakLightning.spawnOnObjectCollisions           = true;
            flakLightning.spawnProjecitlesOnDieInAir        = true;
            flakLightning.spawnProjectilesOnCollision       = true;
            flakLightning.spawnProjectilesInFlight          = false;
            flakLightning.alignToSurfaceNormal              = true;

            gun.quality = PickupObject.ItemQuality.A;
            ETGMod.Databases.Items.Add(gun, null, "ANY");


            ID = gun.PickupObjectId;
        }