Exemplo n.º 1
0
        public static void RecalculateOrbitals(this PlayerController player)
        {
            Dictionary <int, int> tiersAndCounts = new Dictionary <int, int>();

            foreach (var o in player.orbitals)
            {
                var orbital    = (PlayerOrbital)o;
                int targetTier = PlayerOrbital.CalculateTargetTier(player, o);
                orbital.SetOrbitalTier(targetTier);
                if (tiersAndCounts.ContainsKey(targetTier)) //Count starts at 0
                {
                    int existingCount = tiersAndCounts[targetTier];
                    tiersAndCounts[targetTier] = existingCount + 1;
                }
                else
                {
                    tiersAndCounts.Add(targetTier, 0);
                }
            }
            foreach (var o in player.orbitals)
            {
                var orbital     = (PlayerOrbital)o;
                int currentTier = orbital.GetOrbitalTier();
                if (tiersAndCounts.ContainsKey(currentTier))
                {
                    int currentAmtInTier = tiersAndCounts[currentTier];
                    orbital.SetOrbitalTierIndex(tiersAndCounts[currentTier]);
                    tiersAndCounts[currentTier] = currentAmtInTier - 1;
                }
                else
                {
                    orbital.SetOrbitalTierIndex(0);
                }
            }
        }
Exemplo n.º 2
0
        public static void BuildPrefab()
        {
            string kissMyButt = "If you're digging through my code you can kiss my butt";

            string.IsNullOrEmpty(kissMyButt);

            if (LightningGuon.orbitalPrefab != null)
            {
                return;
            }
            GameObject prefab = SpriteBuilder.SpriteFromResource("CustomItems/Resources/P1/swiftness_guon");

            prefab.name = "Swiftness 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.SetOrbitalTier(0);

            GameObject.DontDestroyOnLoad(prefab);
            FakePrefab.MarkAsFakePrefab(prefab);
            prefab.SetActive(false);
        }
        public static GameObject MakeAnimatedOrbital(string name, float orbitRadius, float orbitalDegreesPerSecond, int orbitalTier, PlayerOrbital.OrbitalMotionStyle motionStyle, float perfectOrbitalFactor, List <string> idleAnimPaths, int fps, Vector2 colliderDimensions, Vector2 colliderOffsets, tk2dBaseSprite.Anchor anchorMode, tk2dSpriteAnimationClip.WrapMode wrapMode)
        {
            GameObject prefab = SpriteBuilder.SpriteFromResource(idleAnimPaths[0]);

            prefab.name = name;
            var body = prefab.GetComponent <tk2dSprite>().SetUpSpeculativeRigidbody(colliderOffsets.ToIntVector2(), colliderDimensions.ToIntVector2());

            body.CollideWithTileMap = false;
            body.CollideWithOthers  = true;
            body.PrimaryPixelCollider.CollisionLayer = CollisionLayer.EnemyBulletBlocker;

            tk2dSpriteCollectionData spriteCollection = SpriteBuilder.ConstructCollection(prefab, $"{name}_Collection");

            prefab.AddAnimationToObject(spriteCollection, "start", idleAnimPaths, fps, colliderDimensions, colliderOffsets, anchorMode, wrapMode, true);

            PlayerOrbital orbitalPrefab = prefab.AddComponent <PlayerOrbital>();

            orbitalPrefab.motionStyle           = motionStyle;
            orbitalPrefab.shouldRotate          = false;
            orbitalPrefab.orbitRadius           = orbitRadius;
            orbitalPrefab.perfectOrbitalFactor  = perfectOrbitalFactor;
            orbitalPrefab.orbitDegreesPerSecond = orbitalDegreesPerSecond;
            orbitalPrefab.SetOrbitalTier(orbitalTier);

            prefab.MakeFakePrefab();
            return(prefab);
        }
Exemplo n.º 4
0
        public static void BuildSynergyPrefab()
        {
            bool flag = UltraVioletGuonStone.upgradeOrbitalPrefab == null;

            if (flag)
            {
                GameObject gameObject = SpriteBuilder.SpriteFromResource("NevernamedsItems/Resources/GuonStones/ultravioletguon_synergy", null);
                gameObject.name = "Ultraviolet Guon Orbital Synergy Form";
                SpeculativeRigidbody speculativeRigidbody = gameObject.GetComponent <tk2dSprite>().SetUpSpeculativeRigidbody(IntVector2.Zero, new IntVector2(14, 14));
                UltraVioletGuonStone.upgradeOrbitalPrefab = gameObject.AddComponent <PlayerOrbital>();
                speculativeRigidbody.CollideWithTileMap   = false;
                speculativeRigidbody.CollideWithOthers    = true;
                speculativeRigidbody.PrimaryPixelCollider.CollisionLayer        = CollisionLayer.EnemyBulletBlocker;
                UltraVioletGuonStone.upgradeOrbitalPrefab.shouldRotate          = true;
                UltraVioletGuonStone.upgradeOrbitalPrefab.orbitRadius           = 4.1f;
                UltraVioletGuonStone.upgradeOrbitalPrefab.orbitDegreesPerSecond = 500f;
                UltraVioletGuonStone.upgradeOrbitalPrefab.perfectOrbitalFactor  = 10f;
                UltraVioletGuonStone.upgradeOrbitalPrefab.SetOrbitalTier(0);

                EasyTrailMisc trail = gameObject.AddComponent <EasyTrailMisc>();
                trail.TrailPos    = gameObject.transform.position;
                trail.TrailPos.x += 0.4f;
                trail.StartWidth  = 0.4f;
                trail.EndWidth    = 0;
                trail.LifeTime    = 0.2f;
                trail.BaseColor   = ExtendedColours.charmPink;
                trail.EndColor    = ExtendedColours.pink;

                UnityEngine.Object.DontDestroyOnLoad(gameObject);
                FakePrefab.MarkAsFakePrefab(gameObject);
                gameObject.SetActive(false);
            }
        }
Exemplo n.º 5
0
        public static void BuildPrefab()
        {
            if (BrownGuonStone.orbitalPrefab != null)
            {
                return;
            }
            GameObject prefab = SpriteBuilder.SpriteFromResource("NevernamedsItems/Resources/brownguonstone_ingame");

            prefab.name = "Brown 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           = 5f;
            orbitalPrefab.orbitDegreesPerSecond = 40f;
            orbitalPrefab.SetOrbitalTier(0);

            GameObject.DontDestroyOnLoad(prefab);
            FakePrefab.MarkAsFakePrefab(prefab);
            prefab.SetActive(false);
        }
Exemplo n.º 6
0
        private void RebuildOrbitals()
        {
            if (orbitals.Any())
            {
                foreach (GameObject obj in orbitals)
                {
                    Destroy(obj);
                }
            }
            for (int i = 0; i < orbitalAmount; i++)
            {
                GameObject           gameObject           = ItemAPI.SpriteBuilder.SpriteFromResource("Items/Resources/VFX/magnorb_projectile");
                SpeculativeRigidbody speculativeRigidbody = gameObject.GetComponent <tk2dSprite>().SetUpSpeculativeRigidbody(IntVector2.Zero, new IntVector2(9, 9));
                PlayerOrbital        orbitalPrefab        = gameObject.AddComponent <PlayerOrbital>();
                speculativeRigidbody.CollideWithTileMap = false;
                speculativeRigidbody.CollideWithOthers  = false;
                orbitalPrefab.shouldRotate = true;
                orbitalPrefab.orbitRadius  = 2f;

                orbitalPrefab.orbitDegreesPerSecond = 10;
                orbitalPrefab.SetOrbitalTier(0);
                UnityEngine.Object.DontDestroyOnLoad(gameObject);
                FakePrefab.MarkAsFakePrefab(gameObject);
                gameObject.SetActive(false);
                GameObject gameobject2 = PlayerOrbitalItem.CreateOrbital(attachedPlayer, gameObject, false);
                orbitals.Add(gameobject2);
            }
        }
Exemplo n.º 7
0
        public static void BuildPrefab()
        {
            if (MaroonGuonStone.orbitalPrefab != null)
            {
                return;
            }
            GameObject prefab = SpriteBuilder.SpriteFromResource("NevernamedsItems/Resources/GuonStones/maroonguon_ingame");

            prefab.name = "Maroon Guon Orbital";
            var body = prefab.GetComponent <tk2dSprite>().SetUpSpeculativeRigidbody(IntVector2.Zero, new IntVector2(10, 16));

            //prefab.GetComponent<tk2dSprite>().GetCurrentSpriteDef().ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.MiddleCenter, body.GetComponent<tk2dSprite>().GetCurrentSpriteDef().position3);

            body.CollideWithTileMap                  = false;
            body.CollideWithOthers                   = true;
            body.UpdateCollidersOnRotation           = true;
            body.PrimaryPixelCollider.CollisionLayer = CollisionLayer.BulletBlocker;

            orbitalPrefab                       = prefab.AddComponent <PlayerOrbital>();
            orbitalPrefab.motionStyle           = PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS;
            orbitalPrefab.perfectOrbitalFactor  = 10f;
            orbitalPrefab.shouldRotate          = true;
            orbitalPrefab.orbitRadius           = 3.5f;
            orbitalPrefab.orbitDegreesPerSecond = 50f;
            orbitalPrefab.SetOrbitalTier(0);

            GameObject.DontDestroyOnLoad(prefab);
            FakePrefab.MarkAsFakePrefab(prefab);
            prefab.SetActive(false);
        }
Exemplo n.º 8
0
        public static void BuildSynergyPrefab()
        {
            bool flag = MaroonGuonStone.upgradeOrbitalPrefab == null;

            if (flag)
            {
                GameObject gameObject = SpriteBuilder.SpriteFromResource("NevernamedsItems/Resources/GuonStones/maroonguon_synergy", null);
                gameObject.name = "Maroon Guon Orbital Synergy Form";
                SpeculativeRigidbody speculativeRigidbody = gameObject.GetComponent <tk2dSprite>().SetUpSpeculativeRigidbody(IntVector2.Zero, new IntVector2(13, 20));
                //gameObject.GetComponent<tk2dSprite>().GetCurrentSpriteDef().ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.MiddleCenter, gameObject.GetComponent<tk2dSprite>().GetCurrentSpriteDef().position3);
                MaroonGuonStone.upgradeOrbitalPrefab                       = gameObject.AddComponent <PlayerOrbital>();
                speculativeRigidbody.CollideWithTileMap                    = false;
                speculativeRigidbody.CollideWithOthers                     = true;
                speculativeRigidbody.UpdateCollidersOnRotation             = true;
                speculativeRigidbody.PrimaryPixelCollider.CollisionLayer   = CollisionLayer.BulletBlocker;
                MaroonGuonStone.upgradeOrbitalPrefab.shouldRotate          = true;
                MaroonGuonStone.upgradeOrbitalPrefab.orbitRadius           = 3.5f;
                MaroonGuonStone.upgradeOrbitalPrefab.perfectOrbitalFactor  = 10f;
                MaroonGuonStone.upgradeOrbitalPrefab.orbitDegreesPerSecond = 30f;
                MaroonGuonStone.upgradeOrbitalPrefab.SetOrbitalTier(0);
                UnityEngine.Object.DontDestroyOnLoad(gameObject);
                FakePrefab.MarkAsFakePrefab(gameObject);
                gameObject.SetActive(false);
            }
        }
        public static void BuildSynergyPrefab() //here is where the synergy form is set up
        {
            bool flag = PrismaticGuonStone.upgradeOrbitalPrefab == null;

            if (flag)
            {
                GameObject prefab = ItemBuilder.AddSpriteToObject("prismatic_guon_synergy", "BleakMod/Resources/prismatic_guon_stone/prismatismer_guon_stone_001", null);
                prefab.name = "Prismatic Guon Orbital Synergy Form";
                FakePrefab.MarkAsFakePrefab(prefab);
                UnityEngine.Object.DontDestroyOnLoad(prefab);
                tk2dSpriteAnimator      animator      = prefab.AddComponent <tk2dSpriteAnimator>();
                tk2dSpriteAnimationClip animationClip = new tk2dSpriteAnimationClip();
                animationClip.fps      = 8;
                animationClip.wrapMode = tk2dSpriteAnimationClip.WrapMode.Loop;
                animationClip.name     = "start";

                GameObject spriteObject = new GameObject("spriteObject");
                ItemBuilder.AddSpriteToObject("spriteObject", $"BleakMod/Resources/prismatic_guon_stone/prismatismer_guon_stone_001", spriteObject);
                tk2dSpriteAnimationFrame starterFrame = new tk2dSpriteAnimationFrame();
                starterFrame.spriteId         = spriteObject.GetComponent <tk2dSprite>().spriteId;
                starterFrame.spriteCollection = spriteObject.GetComponent <tk2dSprite>().Collection;
                tk2dSpriteAnimationFrame[] frameArray = new tk2dSpriteAnimationFrame[]
                {
                    starterFrame
                };
                animationClip.frames = frameArray;
                for (int i = 2; i < 6; i++)
                {
                    GameObject spriteForObject = new GameObject("spriteForObject");
                    ItemBuilder.AddSpriteToObject("spriteForObject", $"BleakMod/Resources/prismatic_guon_stone/prismatismer_guon_stone_00{i}", spriteForObject);
                    tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame();
                    frame.spriteId         = spriteForObject.GetComponent <tk2dBaseSprite>().spriteId;
                    frame.spriteCollection = spriteForObject.GetComponent <tk2dBaseSprite>().Collection;
                    animationClip.frames   = animationClip.frames.Concat(new tk2dSpriteAnimationFrame[] { frame }).ToArray();
                }
                animator.Library           = animator.gameObject.AddComponent <tk2dSpriteAnimation>();
                animator.Library.clips     = new tk2dSpriteAnimationClip[] { animationClip };
                animator.DefaultClipId     = animator.GetClipIdByName("start");
                animator.playAutomatically = true;

                GameObject gameObject = animator.gameObject;
                gameObject.name = "Prismatic Guon Orbital Synergy Form";
                var body = gameObject.GetComponent <tk2dSprite>().SetUpSpeculativeRigidbody(IntVector2.Zero, new IntVector2(13, 15)); //Numbers at the end are the dimensions of the hitbox
                body.CollideWithTileMap = false;
                body.CollideWithOthers  = true;
                body.PrimaryPixelCollider.CollisionLayer = CollisionLayer.EnemyBulletBlocker;
                upgradeOrbitalPrefab                       = gameObject.AddComponent <PlayerOrbital>();
                upgradeOrbitalPrefab.motionStyle           = PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS;
                upgradeOrbitalPrefab.shouldRotate          = true;
                upgradeOrbitalPrefab.orbitRadius           = 1.5f;
                upgradeOrbitalPrefab.orbitDegreesPerSecond = 175f; //Guon Stats
                upgradeOrbitalPrefab.perfectOrbitalFactor  = 1000f;
                upgradeOrbitalPrefab.SetOrbitalTier(0);

                UnityEngine.Object.DontDestroyOnLoad(gameObject);
                FakePrefab.MarkAsFakePrefab(gameObject);
                gameObject.SetActive(false);
            }
        }
Exemplo n.º 10
0
 private void Start()
 {
     //you'll need code from PlayerOrbital and HoveringGunController (the base game one) to make this thing work
     //Add Lute support too
     if (owner == null)
     {
         owner = GameManager.Instance.PrimaryPlayer;
     }
     initialized = true;
     if (base.gameObject.GetComponent <tk2dSprite>() != null && !preventOutline) // needs a sprite to work!
     {
         sprite = base.gameObject.GetComponent <tk2dSprite>();
         SpriteOutlineManager.AddOutlineToSprite(sprite, outlineColor);
     }
     this.SetOrbitalTier(PlayerOrbital.CalculateTargetTier(owner, this));
     this.SetOrbitalTierIndex(PlayerOrbital.GetNumberOfOrbitalsInTier(owner, orbitalTier));
     owner.orbitals.Add(this);
     ownerCenterPos = owner.CenterPosition;
     if (base.gameObject.GetComponent <SpeculativeRigidbody>() == null)
     {
         body = sprite.SetUpSpeculativeRigidbody(specBodyOffsets, specBodyDimensions);
         if (pixelColliders.Any())
         {
             body.PixelColliders.Clear();
             body.PixelColliders.AddRange(pixelColliders);
             body.CollideWithOthers = true;
         }
         else
         {
             body.PixelColliders.Clear();
             body.PixelColliders.Add(new PixelCollider
             {
                 ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual,
                 CollisionLayer         = CollisionLayer.EnemyBlocker,
                 IsTrigger = false,
                 BagleUseFirstFrameOnly = false,
                 SpecifyBagelFrame      = string.Empty,
                 BagelColliderNumber    = 0,
                 ManualOffsetX          = specBodyOffsets.x,
                 ManualOffsetY          = specBodyOffsets.y,
                 ManualWidth            = specBodyDimensions.x,
                 ManualHeight           = specBodyDimensions.y,
                 ManualDiameter         = 0,
                 ManualLeftX            = 0,
                 ManualLeftY            = 0,
                 ManualRightX           = 0,
                 ManualRightY           = 0,
             });
             body.CollideWithOthers = false;
         }
         body.CollideWithTileMap = false;
     }
     if (projectile == null)
     {
         projectile         = ((Gun)ETGMod.Databases.Items[56]).DefaultModule.projectiles[0];
         projectile.Owner   = owner;
         projectile.Shooter = owner.specRigidbody;
     }
 }
Exemplo n.º 11
0
 public override void Pickup(PlayerController player)
 {
     foreach (IPlayerOrbital playerOrbital in player.orbitals)
     {
         PlayerOrbital playerOrbital2 = (PlayerOrbital)playerOrbital;
         playerOrbital2.orbitDegreesPerSecond = 90f;
     }
     base.Pickup(player);
 }
Exemplo n.º 12
0
 private void HandleNewFloor(PlayerController obj)
 {
     foreach (IPlayerOrbital f**k in obj.orbitals)
     {
         PlayerOrbital m_extantOrbital = (PlayerOrbital)f**k;
         m_extantOrbital.orbitDegreesPerSecond = UnityEngine.Random.Range(120f, 20f);
         m_extantOrbital.orbitRadius           = UnityEngine.Random.Range(7f, 2f);
     }
 }
Exemplo n.º 13
0
        private void HandleMotion() // Add rotations to facing the target enemy
        {
            if (orbitingMode == OrbitingMode.ENEMY)
            {
                // if(retargetOrbiter <= 0)
                // {
                //     currentOrbitTarget = null;
                // }
                if (currentOrbitTarget == null || !currentOrbitTarget || currentOrbitTarget.healthHaver.IsDead)
                {
                    FindOrbitTarget();
                }
            }
            Vector2 centerPosition = owner.CenterPosition;

            if (Vector2.Distance(centerPosition, base.transform.position.XY()) > 20f)
            {
                base.transform.position = centerPosition.ToVector3ZUp(0f);
                body.Reinitialize();
            }
            if (orbitingMode == OrbitingMode.ENEMY && currentOrbitTarget != null)
            {
                centerPosition = currentOrbitTarget.CenterPosition;
            }
            else if (orbitingMode == OrbitingMode.CUSTOM && currentCustomOrbitTarget != null)
            {
                centerPosition = currentCustomOrbitTarget.transform.position;
            }
            Vector2 vector  = centerPosition - ownerCenterPos;
            float   num     = Mathf.Lerp(0.1f, 15f, vector.magnitude / 4f);
            float   d       = Mathf.Min(num * BraveTime.DeltaTime, vector.magnitude);
            float   num2    = 360f / (float)PlayerOrbital.GetNumberOfOrbitalsInTier(owner, this.GetOrbitalTier()) * (float)this.GetOrbitalTierIndex() + BraveTime.ScaledTimeSinceStartup * orbitalSpeed;
            Vector2 vector2 = ownerCenterPos + (centerPosition - ownerCenterPos).normalized * d;

            vector2 = Vector2.Lerp(vector2, centerPosition, perfectOrbitFactor);
            Vector2 vector3 = vector2 + (Quaternion.Euler(0f, 0f, num2) * Vector3.right * orbitalRadius).XY();

            if (hasSinWaveMovement)
            {
                float d2 = Mathf.Sin(Time.time * sinWavelength) * sinAmplitude;
                vector3 += (Quaternion.Euler(0f, 0f, num2) * Vector3.right).XY().normalized *d2;
            }
            ownerCenterPos = vector2;
            vector3        = vector3.Quantize(0.0625f);
            Vector2 velocity = (vector3 - base.transform.position.XY()) / BraveTime.DeltaTime;

            body.Velocity     = velocity;
            this.currentAngle = num2 % 360f;
            if (shouldRotate && hasTarget && targetToShoot == null || !targetToShoot || targetToShoot.healthHaver.IsDead)
            {
                hasTarget = false;
            }
            //fix rotating to target

            base.transform.localRotation = Quaternion.Euler(0f, 0f, currentAngle);
        }
Exemplo n.º 14
0
        // Token: 0x060001AF RID: 431 RVA: 0x0000EFD8 File Offset: 0x0000D1D8
        public static void GuonInit(Action <PlayerOrbital, PlayerController> orig, PlayerOrbital self, PlayerController player)
        {
            orig(self, player);
            bool flag = self.name == "Rook Guon Orbital(Clone)";

            if (flag)
            {
                ArmourGuonStone.rookGuonOrbital = self;
            }
        }
Exemplo n.º 15
0
 public static void GuonInit(Action <PlayerOrbital, PlayerController> orig, PlayerOrbital self, PlayerController player)
 {
     orig(self, player);
     //ETGModConsole.Log(self.name);
     if (self.name == "Brown Guon Orbital(Clone)")
     {
         //ETGModConsole.Log("You have the Brown Guon");
         brownGuonOrbital = self;
     }
 }
Exemplo n.º 16
0
 public override void Pickup(PlayerController player)
 {
     foreach (IPlayerOrbital f**k in player.orbitals)
     {
         PlayerOrbital m_extantOrbital = (PlayerOrbital)f**k;
         m_extantOrbital.orbitDegreesPerSecond = UnityEngine.Random.Range(120f, 20f);
         m_extantOrbital.orbitRadius           = UnityEngine.Random.Range(7f, 2f);
     }
     player.OnNewFloorLoaded = (Action <PlayerController>)Delegate.Combine(player.OnNewFloorLoaded, new Action <PlayerController>(this.HandleNewFloor));
     base.Pickup(player);
 }
        private void MakeOrbital(GameObject prefab)
        {
            GameObject    gameObject = UnityEngine.Object.Instantiate <GameObject>(prefab, Owner.transform.position, Quaternion.identity);
            PlayerOrbital component  = gameObject.GetComponent <PlayerOrbital>();

            if (Owner)
            {
                component.Initialize(Owner);
                LibramOrbitalController orbcon = gameObject.GetComponent <LibramOrbitalController>();
                if (orbcon)
                {
                    orbcon.owner = Owner;
                }
            }
            currentOrbitals.Add(gameObject);
        }
        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);*/
        }
Exemplo n.º 19
0
 private void ResetOrbitals(PlayerController player)
 {
     if (player.orbitals != null && player.orbitals.Count > 0)
     {
         foreach (var o in Owner.orbitals)
         {
             var orbital = (PlayerOrbital)o;
             if (orbital.gameObject.GetComponent <BoostedByAlbedo>() != null)
             {
                 orbital.orbitDegreesPerSecond /= orbital.gameObject.GetComponent <BoostedByAlbedo>().currentMultiplier;
                 orbital.SetOrbitalTier(PlayerOrbital.CalculateTargetTier(player, o));
                 orbital.SetOrbitalTierIndex(PlayerOrbital.GetNumberOfOrbitalsInTier(player, orbital.gameObject.GetComponent <BoostedByAlbedo>().storedOrbitalTier));
                 UnityEngine.Object.Destroy(orbital.gameObject.GetComponent <BoostedByAlbedo>());
             }
         }
         RecalcOrbIndex();
     }
 }
        public static GameObject CreateOrbital(PlayerController owner, GameObject targetOrbitalPrefab, bool isFollower, PlayerOrbitalItem sourceItem = null)
        {
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(targetOrbitalPrefab, owner.transform.position, Quaternion.identity);

            if (!isFollower)
            {
                PlayerOrbital component = gameObject.GetComponent <PlayerOrbital>();
                component.Initialize(owner);
                component.SourceItem = sourceItem;
            }
            else
            {
                PlayerOrbitalFollower component2 = gameObject.GetComponent <PlayerOrbitalFollower>();
                if (component2)
                {
                    component2.Initialize(owner);
                }
            }
            return(gameObject);
        }
Exemplo n.º 21
0
 private void UpdateOrbitals()
 {
     foreach (var o in Owner.orbitals)
     {
         var orbital = (PlayerOrbital)o;
         if (orbital.name == "IounStone_Glass(Clone)")
         {
             if (orbital.gameObject.GetComponent <BoostedByAlbedo>() == null)
             {
                 int mult = 3;
                 if (Owner.PlayerHasActiveSynergy("White Ethesia"))
                 {
                     mult = 4;
                 }
                 BoostedByAlbedo boost = orbital.gameObject.AddComponent <BoostedByAlbedo>();
                 boost.currentMultiplier        = mult;
                 boost.storedOrbitalTier        = orbital.GetOrbitalTier();
                 orbital.orbitDegreesPerSecond *= mult;
                 orbital.SetOrbitalTier(1010);
                 orbital.SetOrbitalTierIndex(PlayerOrbital.GetNumberOfOrbitalsInTier(Owner, 1010));
             }
             else if (orbital.gameObject.GetComponent <BoostedByAlbedo>().currentMultiplier == 3 && Owner.PlayerHasActiveSynergy("White Ethesia"))
             {
                 orbital.orbitDegreesPerSecond /= 3;
                 orbital.orbitDegreesPerSecond *= 4;
                 orbital.gameObject.GetComponent <BoostedByAlbedo>().currentMultiplier = 4;
                 orbital.SetOrbitalTier(1010);
                 orbital.SetOrbitalTierIndex(PlayerOrbital.GetNumberOfOrbitalsInTier(Owner, 1010));
             }
             else if (orbital.gameObject.GetComponent <BoostedByAlbedo>().currentMultiplier == 4 && !Owner.PlayerHasActiveSynergy("White Ethesia"))
             {
                 orbital.orbitDegreesPerSecond /= 4;
                 orbital.orbitDegreesPerSecond *= 3;
                 orbital.gameObject.GetComponent <BoostedByAlbedo>().currentMultiplier = 3;
                 orbital.SetOrbitalTier(1010);
                 orbital.SetOrbitalTierIndex(PlayerOrbital.GetNumberOfOrbitalsInTier(Owner, 1010));
             }
         }
     }
     RecalcOrbIndex();
 }
Exemplo n.º 22
0
        public static void BuildSynergyPrefab()
        {
            if (InfraredGuonStone.upgradeOrbitalPrefab == null)
            {
                GameObject gameObject = SpriteBuilder.SpriteFromResource("NevernamedsItems/Resources/GuonStones/infraredguonstone_synergy", null);
                gameObject.name = "Infrared Guon Orbital Synergy Form";
                SpeculativeRigidbody speculativeRigidbody = gameObject.GetComponent <tk2dSprite>().SetUpSpeculativeRigidbody(IntVector2.Zero, new IntVector2(10, 10));
                InfraredGuonStone.upgradeOrbitalPrefab  = gameObject.AddComponent <PlayerOrbital>();
                speculativeRigidbody.CollideWithTileMap = false;
                speculativeRigidbody.CollideWithOthers  = true;
                speculativeRigidbody.PrimaryPixelCollider.CollisionLayer     = CollisionLayer.EnemyBulletBlocker;
                InfraredGuonStone.upgradeOrbitalPrefab.shouldRotate          = false;
                InfraredGuonStone.upgradeOrbitalPrefab.orbitRadius           = 2.5f;
                InfraredGuonStone.upgradeOrbitalPrefab.orbitDegreesPerSecond = 60f;
                InfraredGuonStone.upgradeOrbitalPrefab.perfectOrbitalFactor  = 10f;
                InfraredGuonStone.upgradeOrbitalPrefab.SetOrbitalTier(0);

                UnityEngine.Object.DontDestroyOnLoad(gameObject);
                FakePrefab.MarkAsFakePrefab(gameObject);
                gameObject.SetActive(false);
            }
        }
Exemplo n.º 23
0
        public static void BuildPrefab()
        {
            bool flag  = SharpGuon.orbitalPrefab != null;
            bool flag2 = !flag;

            if (flag2)
            {
                GameObject gameObject = SpriteBuilder.SpriteFromResource("Blunderbeast/Resources/sharpguon-orbital", null, true);
                gameObject.name = "Sharp Guon";

                SpeculativeRigidbody speculativeRigidbody = gameObject.GetComponent <tk2dSprite>().SetUpSpeculativeRigidbody(IntVector2.Zero, new IntVector2(17, 18));
                SharpGuon.orbitalPrefab = gameObject.AddComponent <PlayerOrbital>();
                speculativeRigidbody.CollideWithTileMap = false;
                speculativeRigidbody.CollideWithOthers  = true;
                speculativeRigidbody.PrimaryPixelCollider.CollisionLayer = CollisionLayer.Projectile;
                SharpGuon.orbitalPrefab.shouldRotate          = false;
                SharpGuon.orbitalPrefab.orbitRadius           = 6f;
                SharpGuon.orbitalPrefab.orbitDegreesPerSecond = 120f;
                SharpGuon.orbitalPrefab.SetOrbitalTier(0);
                UnityEngine.Object.DontDestroyOnLoad(gameObject);
                FakePrefab.MarkAsFakePrefab(gameObject);
                gameObject.SetActive(false);
            }
        }
Exemplo n.º 24
0
        public static void BuildPrefab()
        {
            if (UltraVioletGuonStone.orbitalPrefab != null)
            {
                return;
            }
            GameObject prefab = SpriteBuilder.SpriteFromResource("NevernamedsItems/Resources/GuonStones/ultravioletguon_ingame");

            prefab.name = "Ultraviolet Guon Orbital";
            var body = prefab.GetComponent <tk2dSprite>().SetUpSpeculativeRigidbody(IntVector2.Zero, new IntVector2(8, 9));

            body.CollideWithTileMap = false;
            body.CollideWithOthers  = true;
            body.PrimaryPixelCollider.CollisionLayer = CollisionLayer.EnemyBulletBlocker;

            orbitalPrefab                       = prefab.AddComponent <PlayerOrbital>();
            orbitalPrefab.motionStyle           = PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS;
            orbitalPrefab.shouldRotate          = true;
            orbitalPrefab.orbitRadius           = 4.1f;
            orbitalPrefab.orbitDegreesPerSecond = 420f;
            orbitalPrefab.SetOrbitalTier(0);

            EasyTrailMisc trail = prefab.AddComponent <EasyTrailMisc>();

            trail.TrailPos    = prefab.transform.position;
            trail.TrailPos.x += 0.2f;
            trail.StartWidth  = 0.2f;
            trail.EndWidth    = 0;
            trail.LifeTime    = 0.1f;
            trail.BaseColor   = ExtendedColours.charmPink;
            trail.EndColor    = ExtendedColours.pink;

            GameObject.DontDestroyOnLoad(prefab);
            FakePrefab.MarkAsFakePrefab(prefab);
            prefab.SetActive(false);
        }
        public IEnumerator RockGoBrrrrrrr(PlayerController user, PlayerOrbital wee)
        {
            wee.orbitDegreesPerSecond = 40 + (rockpoints);

            return(null);
        }
Exemplo n.º 26
0
		// Token: 0x0600025E RID: 606 RVA: 0x0000B3AF File Offset: 0x000095AF
		public static void GuonInit(Action<PlayerOrbital, PlayerController> orig, PlayerOrbital self, PlayerController player)
		{
			orig(self, player);
		}
Exemplo n.º 27
0
        public static void BuildPrefab()
        {
            if (GoonStone.orbitalPrefab != null)
            {
                return;
            }
            GameObject prefab = ItemBuilder.AddSpriteToObject("goon_orbital", "BleakMod/Resources/goon_stone/bodyguard_guon_stone_001", null);

            FakePrefab.MarkAsFakePrefab(prefab);
            UnityEngine.Object.DontDestroyOnLoad(prefab);
            tk2dSpriteAnimator      animator      = prefab.AddComponent <tk2dSpriteAnimator>();
            tk2dSpriteAnimationClip animationClip = new tk2dSpriteAnimationClip();

            animationClip.fps      = 10;
            animationClip.wrapMode = tk2dSpriteAnimationClip.WrapMode.Loop;
            animationClip.name     = "start";

            GameObject spriteObject = new GameObject("spriteObject");

            ItemBuilder.AddSpriteToObject("spriteObject", $"BleakMod/Resources/goon_stone/bodyguard_guon_stone_001", spriteObject);
            tk2dSpriteAnimationFrame starterFrame = new tk2dSpriteAnimationFrame();

            starterFrame.spriteId         = spriteObject.GetComponent <tk2dSprite>().spriteId;
            starterFrame.spriteCollection = spriteObject.GetComponent <tk2dSprite>().Collection;
            tk2dSpriteAnimationFrame[] frameArray = new tk2dSpriteAnimationFrame[]
            {
                starterFrame
            };
            animationClip.frames = frameArray;
            for (int i = 2; i < 10; i++)
            {
                GameObject spriteForObject = new GameObject("spriteForObject");
                ItemBuilder.AddSpriteToObject("spriteForObject", $"BleakMod/Resources/goon_stone/bodyguard_guon_stone_00{i}", spriteForObject);
                tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame();
                frame.spriteId         = spriteForObject.GetComponent <tk2dBaseSprite>().spriteId;
                frame.spriteCollection = spriteForObject.GetComponent <tk2dBaseSprite>().Collection;
                animationClip.frames   = animationClip.frames.Concat(new tk2dSpriteAnimationFrame[] { frame }).ToArray();
            }
            for (int i = 10; i < 29; i++)
            {
                GameObject spriteForObject = new GameObject("spriteForObject");
                ItemBuilder.AddSpriteToObject("spriteForObject", $"BleakMod/Resources/goon_stone/bodyguard_guon_stone_0{i}", spriteForObject);
                tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame();
                frame.spriteId         = spriteForObject.GetComponent <tk2dBaseSprite>().spriteId;
                frame.spriteCollection = spriteForObject.GetComponent <tk2dBaseSprite>().Collection;
                animationClip.frames   = animationClip.frames.Concat(new tk2dSpriteAnimationFrame[] { frame }).ToArray();
            }
            animator.Library           = animator.gameObject.AddComponent <tk2dSpriteAnimation>();
            animator.Library.clips     = new tk2dSpriteAnimationClip[] { animationClip };
            animator.DefaultClipId     = animator.GetClipIdByName("start");
            animator.playAutomatically = true;

            GameObject gameObject = animator.gameObject;

            gameObject.name = "Goon Orbital";
            var body = gameObject.GetComponent <tk2dSprite>().SetUpSpeculativeRigidbody(IntVector2.Zero, new IntVector2(15, 16)); //Numbers at the end are the dimensions of the hitbox

            body.CollideWithTileMap = false;
            body.CollideWithOthers  = true;
            body.PrimaryPixelCollider.CollisionLayer = CollisionLayer.EnemyBulletBlocker;
            orbitalPrefab                       = gameObject.AddComponent <PlayerOrbital>();
            orbitalPrefab.motionStyle           = PlayerOrbital.OrbitalMotionStyle.ORBIT_PLAYER_ALWAYS;
            orbitalPrefab.shouldRotate          = false;
            orbitalPrefab.orbitRadius           = 2f;
            orbitalPrefab.orbitDegreesPerSecond = 120; //Guon Stats
            orbitalPrefab.perfectOrbitalFactor  = 1000f;
            orbitalPrefab.SetOrbitalTier(0);

            UnityEngine.Object.DontDestroyOnLoad(gameObject);
            FakePrefab.MarkAsFakePrefab(gameObject);
            gameObject.SetActive(false);
        }
Exemplo n.º 28
0
 public static void GuonInit(Action <PlayerOrbital, PlayerController> orig, PlayerOrbital self, PlayerController player)
 {
     self.orbitDegreesPerSecond = speedUp ? 180f : 90f;
     orig(self, player);
 }
 private void HandleMotionCAT(AIActor host, PlayerOrbital ball)
 {
     ball.transform.position     = host.CenterPosition;
     ball.aiActor.OverrideTarget = host.specRigidbody;
 }