コード例 #1
0
        public static void BuildPrefab()
        {
            if (GreyGuonStone.orbitalPrefab != null)
            {
                return;
            }

            GameObject orbital = GuonToolbox.MakeAnimatedOrbital("Grey Guon Orbital",
                                                                 2.5f,                                                 //Orbital radius
                                                                 120f,                                                 //Orbital degrees per second
                                                                 0,                                                    //Orbital Tier
                                                                 PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS, //Orbit mode
                                                                 0,                                                    //Perfect orbital factor (synergy guons have it set around 10, other guons are 0)
                                                                 new List <string>()
            {
                "NevernamedsItems/Resources/GuonStones/greyguon_animated_ingame1",
                "NevernamedsItems/Resources/GuonStones/greyguon_animated_ingame2",
                "NevernamedsItems/Resources/GuonStones/greyguon_animated_ingame3",
                "NevernamedsItems/Resources/GuonStones/greyguon_animated_ingame4",
            },
                                                                 6,                                      //FPS
                                                                 new Vector2(9, 9),                      //Collider Dimensions
                                                                 new Vector2(0, 0),                      //Collider Offsets
                                                                 tk2dBaseSprite.Anchor.LowerLeft,        //Sprite Anchor
                                                                 tk2dSpriteAnimationClip.WrapMode.Loop); //Wrap mode

            orbitalPrefab = orbital.GetComponent <PlayerOrbital>();


            /* GameObject prefab = SpriteBuilder.SpriteFromResource("NevernamedsItems/Resources/greyguon_ingame");
             * prefab.name = "Grey Guon Orbital";
             * var body = prefab.GetComponent<tk2dSprite>().SetUpSpeculativeRigidbody(IntVector2.Zero, new IntVector2(7, 13));
             * body.CollideWithTileMap = false;
             * body.CollideWithOthers = true;
             * body.PrimaryPixelCollider.CollisionLayer = CollisionLayer.EnemyBulletBlocker;
             *
             * orbitalPrefab = prefab.AddComponent<PlayerOrbital>();
             * orbitalPrefab.motionStyle = PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS;
             * orbitalPrefab.shouldRotate = false;
             * orbitalPrefab.orbitRadius = 2.5f;
             * orbitalPrefab.orbitDegreesPerSecond = 120f;
             * orbitalPrefab.SetOrbitalTier(0);
             *
             * GameObject.DontDestroyOnLoad(prefab);
             * FakePrefab.MarkAsFakePrefab(prefab);
             * prefab.SetActive(false);*/
        }
コード例 #2
0
        public static void LateInit()
        {
            GameObject YellowChamberOrbital = GuonToolbox.MakeAnimatedOrbital("Yellow Chamber LibramOrbital",
                                                                              3f,                                                   //Orbital radius
                                                                              120f,                                                 //Orbital degrees per second
                                                                              0,                                                    //Orbital Tier
                                                                              PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS, //Orbit mode
                                                                              0,                                                    //Perfect orbital factor (synergy guons have it set around 10, other guons are 0)
                                                                              new List <string>()
            {
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_yellow_001",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_yellow_002",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_yellow_003",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_yellow_004",
            },
                                                                              6,                               //FPS
                                                                              new Vector2(9, 9),               //Collider Dimensions
                                                                              new Vector2(1, 2),               //Collider Offsets
                                                                              tk2dBaseSprite.Anchor.LowerLeft, //Sprite Anchor
                                                                              tk2dSpriteAnimationClip.WrapMode.Loop);
            LibramOrbitalController YellowController = YellowChamberOrbital.AddComponent <LibramOrbitalController>();

            YellowController.shoots       = true;
            YellowController.gunIDToShoot = LovePistol.LovePistolID;

            GameObject SixthChamberOrbital = GuonToolbox.MakeAnimatedOrbital("Sixth Chamber LibramOrbital",
                                                                             3f,                                                   //Orbital radius
                                                                             120f,                                                 //Orbital degrees per second
                                                                             0,                                                    //Orbital Tier
                                                                             PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS, //Orbit mode
                                                                             0,                                                    //Perfect orbital factor (synergy guons have it set around 10, other guons are 0)
                                                                             new List <string>()
            {
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_sixth_001",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_sixth_002",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_sixth_003",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_sixth_004",
            },
                                                                             6,                               //FPS
                                                                             new Vector2(9, 9),               //Collider Dimensions
                                                                             new Vector2(1, 2),               //Collider Offsets
                                                                             tk2dBaseSprite.Anchor.LowerLeft, //Sprite Anchor
                                                                             tk2dSpriteAnimationClip.WrapMode.Loop);
            LibramOrbitalController SixthController = SixthChamberOrbital.AddComponent <LibramOrbitalController>();

            SixthController.shoots       = true;
            SixthController.shootDelay   = 5;
            SixthController.curseShot    = true;
            SixthController.gunIDToShoot = 45;

            GameObject OiledCylinderOrbital = GuonToolbox.MakeAnimatedOrbital("Oiled Cylinder LibramOrbital",
                                                                              3.5f,                                                 //Orbital radius
                                                                              240f,                                                 //Orbital degrees per second
                                                                              0,                                                    //Orbital Tier
                                                                              PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS, //Orbit mode
                                                                              0,                                                    //Perfect orbital factor (synergy guons have it set around 10, other guons are 0)
                                                                              new List <string>()
            {
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_oiled_001",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_oiled_002",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_oiled_003",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_oiled_004",
            },
                                                                              6,                               //FPS
                                                                              new Vector2(9, 9),               //Collider Dimensions
                                                                              new Vector2(1, 2),               //Collider Offsets
                                                                              tk2dBaseSprite.Anchor.LowerLeft, //Sprite Anchor
                                                                              tk2dSpriteAnimationClip.WrapMode.Loop);

            GameObject NitroglycylinderOrbital = GuonToolbox.MakeAnimatedOrbital("Nitroglycylinder LibramOrbital",
                                                                                 3f,                                                   //Orbital radius
                                                                                 120f,                                                 //Orbital degrees per second
                                                                                 0,                                                    //Orbital Tier
                                                                                 PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS, //Orbit mode
                                                                                 0,                                                    //Perfect orbital factor (synergy guons have it set around 10, other guons are 0)
                                                                                 new List <string>()
            {
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_nitro_001",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_nitro_002",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_nitro_003",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_nitro_004",
            },
                                                                                 6,                               //FPS
                                                                                 new Vector2(9, 9),               //Collider Dimensions
                                                                                 new Vector2(1, 2),               //Collider Offsets
                                                                                 tk2dBaseSprite.Anchor.LowerLeft, //Sprite Anchor
                                                                                 tk2dSpriteAnimationClip.WrapMode.Loop);
            LibramOrbitalController NitroController = NitroglycylinderOrbital.AddComponent <LibramOrbitalController>();

            NitroController.shoots       = true;
            NitroController.gunIDToShoot = 81;
            NitroController.shootDelay   = 8f;

            GameObject GlassChamberOrbital = GuonToolbox.MakeAnimatedOrbital("Glass Chamber LibramOrbital",
                                                                             3f,                                                   //Orbital radius
                                                                             120f,                                                 //Orbital degrees per second
                                                                             0,                                                    //Orbital Tier
                                                                             PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS, //Orbit mode
                                                                             0,                                                    //Perfect orbital factor (synergy guons have it set around 10, other guons are 0)
                                                                             new List <string>()
            {
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_glass_001",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_glass_002",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_glass_003",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_glass_004",
            },
                                                                             6,                               //FPS
                                                                             new Vector2(9, 9),               //Collider Dimensions
                                                                             new Vector2(1, 2),               //Collider Offsets
                                                                             tk2dBaseSprite.Anchor.LowerLeft, //Sprite Anchor
                                                                             tk2dSpriteAnimationClip.WrapMode.Loop);
            LibramOrbitalController GlassController = GlassChamberOrbital.AddComponent <LibramOrbitalController>();

            GlassController.shoots       = true;
            GlassController.gunIDToShoot = Glasster.GlassterID;
            GlassController.isGlass      = true;

            GameObject FlamechamberOrbital = GuonToolbox.MakeAnimatedOrbital("Flamechamber LibramOrbital",
                                                                             3f,                                                   //Orbital radius
                                                                             120f,                                                 //Orbital degrees per second
                                                                             0,                                                    //Orbital Tier
                                                                             PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS, //Orbit mode
                                                                             0,                                                    //Perfect orbital factor (synergy guons have it set around 10, other guons are 0)
                                                                             new List <string>()
            {
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_flame_001",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_flame_002",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_flame_003",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_flame_004",
            },
                                                                             6,                               //FPS
                                                                             new Vector2(9, 9),               //Collider Dimensions
                                                                             new Vector2(1, 2),               //Collider Offsets
                                                                             tk2dBaseSprite.Anchor.LowerLeft, //Sprite Anchor
                                                                             tk2dSpriteAnimationClip.WrapMode.Loop);
            LibramOrbitalController FlameController = FlamechamberOrbital.AddComponent <LibramOrbitalController>();

            FlameController.shoots       = true;
            FlameController.gunIDToShoot = 336;

            GameObject SpringloadedChamberOrbital = GuonToolbox.MakeAnimatedOrbital("Springloaded Chamber LibramOrbital",
                                                                                    3f,                                                   //Orbital radius
                                                                                    120f,                                                 //Orbital degrees per second
                                                                                    0,                                                    //Orbital Tier
                                                                                    PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS, //Orbit mode
                                                                                    0,                                                    //Perfect orbital factor (synergy guons have it set around 10, other guons are 0)
                                                                                    new List <string>()
            {
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_spring_001",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_spring_002",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_spring_003",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_spring_004",
            },
                                                                                    6,                               //FPS
                                                                                    new Vector2(9, 9),               //Collider Dimensions
                                                                                    new Vector2(1, 2),               //Collider Offsets
                                                                                    tk2dBaseSprite.Anchor.LowerLeft, //Sprite Anchor
                                                                                    tk2dSpriteAnimationClip.WrapMode.Loop);
            LibramOrbitalController SpringloadedController = SpringloadedChamberOrbital.AddComponent <LibramOrbitalController>();

            SpringloadedController.shoots       = true;
            SpringloadedController.shootDelay   = 1f;
            SpringloadedController.gunIDToShoot = 50;

            GameObject WitheringChamberOrbital = GuonToolbox.MakeAnimatedOrbital("Withering Chamber LibramOrbital",
                                                                                 3f,                                                   //Orbital radius
                                                                                 120f,                                                 //Orbital degrees per second
                                                                                 0,                                                    //Orbital Tier
                                                                                 PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS, //Orbit mode
                                                                                 0,                                                    //Perfect orbital factor (synergy guons have it set around 10, other guons are 0)
                                                                                 new List <string>()
            {
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_withered_001",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_withered_002",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_withered_003",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_withered_004",
            },
                                                                                 6,                               //FPS
                                                                                 new Vector2(9, 9),               //Collider Dimensions
                                                                                 new Vector2(1, 2),               //Collider Offsets
                                                                                 tk2dBaseSprite.Anchor.LowerLeft, //Sprite Anchor
                                                                                 tk2dSpriteAnimationClip.WrapMode.Loop);
            LibramOrbitalController WitheringController = WitheringChamberOrbital.AddComponent <LibramOrbitalController>();

            WitheringController.shoots       = true;
            WitheringController.gunIDToShoot = Redhawk.ID;

            GameObject HeavyChamberOrbital = GuonToolbox.MakeAnimatedOrbital("Heavy Chamber LibramOrbital",
                                                                             1.7f,                                                 //Orbital radius
                                                                             60f,                                                  //Orbital degrees per second
                                                                             0,                                                    //Orbital Tier
                                                                             PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS, //Orbit mode
                                                                             5,                                                    //Perfect orbital factor (synergy guons have it set around 10, other guons are 0)
                                                                             new List <string>()
            {
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_heavy_001",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_heavy_002",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_heavy_003",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_heavy_004",
            },
                                                                             6,                               //FPS
                                                                             new Vector2(9, 9),               //Collider Dimensions
                                                                             new Vector2(1, 2),               //Collider Offsets
                                                                             tk2dBaseSprite.Anchor.LowerLeft, //Sprite Anchor
                                                                             tk2dSpriteAnimationClip.WrapMode.Loop);

            GameObject CyclopeanChamberOrbital = GuonToolbox.MakeAnimatedOrbital("Cyclopean Chamber LibramOrbital",
                                                                                 3f,                                                   //Orbital radius
                                                                                 120f,                                                 //Orbital degrees per second
                                                                                 0,                                                    //Orbital Tier
                                                                                 PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS, //Orbit mode
                                                                                 0,                                                    //Perfect orbital factor (synergy guons have it set around 10, other guons are 0)
                                                                                 new List <string>()
            {
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_cyclop_001",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_cyclop_002",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_cyclop_003",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_cyclop_004",
            },
                                                                                 6,                               //FPS
                                                                                 new Vector2(9, 9),               //Collider Dimensions
                                                                                 new Vector2(1, 2),               //Collider Offsets
                                                                                 tk2dBaseSprite.Anchor.LowerLeft, //Sprite Anchor
                                                                                 tk2dSpriteAnimationClip.WrapMode.Loop);
            LibramOrbitalController CyclopeanController = CyclopeanChamberOrbital.AddComponent <LibramOrbitalController>();

            CyclopeanController.shoots       = true;
            CyclopeanController.shootDelay   = 6;
            CyclopeanController.gunIDToShoot = 404;
            CyclopeanController.isCyclops    = true;

            GameObject RecyclinderOrbital = GuonToolbox.MakeAnimatedOrbital("Recyclinder LibramOrbital",
                                                                            3f,                                                   //Orbital radius
                                                                            120f,                                                 //Orbital degrees per second
                                                                            0,                                                    //Orbital Tier
                                                                            PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS, //Orbit mode
                                                                            0,                                                    //Perfect orbital factor (synergy guons have it set around 10, other guons are 0)
                                                                            new List <string>()
            {
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_recycle_001",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_recycle_002",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_recycle_003",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_recycle_004",
            },
                                                                            6,                               //FPS
                                                                            new Vector2(9, 9),               //Collider Dimensions
                                                                            new Vector2(1, 2),               //Collider Offsets
                                                                            tk2dBaseSprite.Anchor.LowerLeft, //Sprite Anchor
                                                                            tk2dSpriteAnimationClip.WrapMode.Loop);
            LibramOrbitalController RecycleController = RecyclinderOrbital.AddComponent <LibramOrbitalController>();

            RecycleController.shoots        = false;
            RecycleController.respondsToHit = true;
            RecycleController.isRecycle     = true;

            GameObject BarrelChamberOrbital = GuonToolbox.MakeAnimatedOrbital("Barrel Chamber LibramOrbital",
                                                                              3f,                                                   //Orbital radius
                                                                              120f,                                                 //Orbital degrees per second
                                                                              0,                                                    //Orbital Tier
                                                                              PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS, //Orbit mode
                                                                              0,                                                    //Perfect orbital factor (synergy guons have it set around 10, other guons are 0)
                                                                              new List <string>()
            {
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_barrel_001",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_barrel_002",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_barrel_003",
                "NevernamedsItems/Resources/GuonStones/LibramOrbitals/libramorbtial_barrel_004",
            },
                                                                              6,                               //FPS
                                                                              new Vector2(9, 9),               //Collider Dimensions
                                                                              new Vector2(1, 2),               //Collider Offsets
                                                                              tk2dBaseSprite.Anchor.LowerLeft, //Sprite Anchor
                                                                              tk2dSpriteAnimationClip.WrapMode.Loop);
            LibramOrbitalController BarrelController = BarrelChamberOrbital.AddComponent <LibramOrbitalController>();

            BarrelController.shoots     = false;
            BarrelController.shootDelay = 1;
            BarrelController.isBarrel   = true;

            chamberOrbitalPrefabs.Add(570, YellowChamberOrbital);                                    //Charm shots
            chamberOrbitalPrefabs.Add(407, SixthChamberOrbital);
            chamberOrbitalPrefabs.Add(165, OiledCylinderOrbital);                                    //No shots
            chamberOrbitalPrefabs.Add(Nitroglycylinder.NitroglycylinderID, NitroglycylinderOrbital); //Explosive shots
            chamberOrbitalPrefabs.Add(GlassChamber.GlassChamberID, GlassChamberOrbital);             //Glass shots, shoots an extra bullet for each guon held
            chamberOrbitalPrefabs.Add(FlameChamber.ID, FlamechamberOrbital);                         //Fireballs
            chamberOrbitalPrefabs.Add(SpringloadedChamber.ID, SpringloadedChamberOrbital);
            chamberOrbitalPrefabs.Add(WitheringChamber.ID, WitheringChamberOrbital);
            chamberOrbitalPrefabs.Add(HeavyChamber.HeavyChamberID, HeavyChamberOrbital); //No Shots
            chamberOrbitalPrefabs.Add(CyclopeanChamber.ID, CyclopeanChamberOrbital);
            chamberOrbitalPrefabs.Add(Recyclinder.RecyclinderID, RecyclinderOrbital);    //Gives +1 ammo when blocking a bullet
            chamberOrbitalPrefabs.Add(BarrelChamber.ID, BarrelChamberOrbital);
        }