Ejemplo n.º 1
0
        private void CreateOrbital(PlayerController player)
        {
            psiGun = SpriteBuilder.SpriteFromResource("Items/Resources/psi_gun_idle_001.png");
            ItemAPI.FakePrefab.MarkAsFakePrefab(psiGun);
            DontDestroyOnLoad(psiGun);
            tk2dSprite sprite = psiGun.GetComponent <tk2dSprite>();

            sprite.HeightOffGround = .1f;
            sprite.UpdateZDepth();
            sprite.PlaceAtPositionByAnchor(player.CenterPosition, tk2dBaseSprite.Anchor.MiddleCenter);
            SpecialOrbital specialOrbital = psiGun.AddComponent <SpecialOrbital>();

            specialOrbital.owner                         = player;
            specialOrbital.shouldRotate                  = true;
            specialOrbital.orbitingMode                  = cachedOrbitingMode;
            specialOrbital.perfectOrbitFactor            = 10;
            specialOrbital.canShoot                      = true;
            specialOrbital.doesBurstshot                 = false;
            specialOrbital.burstAmount                   = 3;
            specialOrbital.timeBetweenBurstShots         = .08f;
            specialOrbital.canShootEnemyOrbiter          = true;
            specialOrbital.doesReload                    = false;
            specialOrbital.reloadTime                    = 1.2f;
            specialOrbital.doesPostProcess               = true;
            specialOrbital.fireCooldown                  = .6f;
            specialOrbital.damageAffectedByPlayerStats   = true;
            specialOrbital.cooldownAffectedByPlayerStats = true;
            Projectile proj = Instantiate <Projectile>(psiGunProj);

            specialOrbital.projectile = proj;
            //Fix orbital shooting
        }
Ejemplo n.º 2
0
        private void TestOrbital(PlayerController player)
        {
            GameObject newOBJ = SpriteBuilder.SpriteFromResource("Items/Resources/hat_i_stole.png");

            ItemAPI.FakePrefab.MarkAsFakePrefab(newOBJ);
            tk2dSprite sprite = newOBJ.GetComponent <tk2dSprite>();

            sprite.HeightOffGround = .1f;
            sprite.UpdateZDepth();
            sprite.PlaceAtPositionByAnchor(player.CenterPosition, tk2dBaseSprite.Anchor.MiddleCenter);
            SpecialOrbital specialOrbital = newOBJ.AddComponent <SpecialOrbital>();

            specialOrbital.owner        = player;
            specialOrbital.orbitingMode = SpecialOrbital.OrbitingMode.ENEMY;
        }
Ejemplo n.º 3
0
        private void ToggleTargetting(PlayerController player)
        {
            SpecialOrbital orbital = psiGun.GetComponent <SpecialOrbital>();

            switch (orbital.orbitingMode)
            {
            case SpecialOrbital.OrbitingMode.PLAYER:
                orbital.orbitingMode = SpecialOrbital.OrbitingMode.ENEMY;
                break;

            case SpecialOrbital.OrbitingMode.ENEMY:
                orbital.orbitingMode = SpecialOrbital.OrbitingMode.PLAYER;
                break;

            case SpecialOrbital.OrbitingMode.CUSTOM:
                orbital.orbitingMode = SpecialOrbital.OrbitingMode.PLAYER;
                break;
            }
        }