示例#1
0
 public override void Load()
 {
     instance              = this;
     tremorLoaded          = ModLoader.GetMod("Tremor") != null;
     thoriumLoaded         = ModLoader.GetMod("ThoriumMod") != null;
     enigmaLoaded          = ModLoader.GetMod("Laugicality") != null;
     battlerodsLoaded      = ModLoader.GetMod("UnuBattleRods") != null;
     MyPlayer.KaiokenKey   = RegisterHotKey("Kaioken", "J");
     MyPlayer.EnergyCharge = RegisterHotKey("Energy Charge", "C");
     MyPlayer.Transform    = RegisterHotKey("Transform", "X");
     MyPlayer.PowerDown    = RegisterHotKey("Power Down", "V");
     MyPlayer.SpeedToggle  = RegisterHotKey("Speed Toggle", "Z");
     MyPlayer.QuickKi      = RegisterHotKey("Quick Ki", "N");
     MyPlayer.TransMenu    = RegisterHotKey("Transformation Menu", "K");
     if (!Main.dedServ)
     {
         GFX.LoadGFX(this);
         KiBar.visible = true;
         transMenu     = new TransMenu();
         transMenu.Activate();
         TransMenuInterface = new UserInterface();
         TransMenuInterface.SetState(transMenu);
         kibar = new KiBar();
         kibar.Activate();
         KiBarInterface = new UserInterface();
         KiBarInterface.SetState(kibar);
     }
 }
示例#2
0
 public override void Unload()
 {
     GFX.UnloadGFX();
     KiBar.visible    = false;
     SSJHairDraw.Hair = null;
     instance         = null;
 }
示例#3
0
 public override void Unload()
 {
     GFX.UnloadGFX();
     KiBar.visible                  = false;
     instance                       = null;
     TransMenu.menuvisible          = false;
     TransMenu.SSJ1On               = false;
     TransMenu.SSJ2On               = false;
     UIFlatPanel._backgroundTexture = null;
 }
示例#4
0
 public override void PostUpdate()
 {
     if (!_initialized)
     {
         _initialized = true;
         HandleRetrogradeCleanup();
     }
     else
     {
         // every 10 seconds, check dragon ball locations, but don't run the full cleanup detail.
         if (Main.netMode != NetmodeID.MultiplayerClient && DBZMOD.IsTickRateElapsed(600))
         {
             CleanupAndRegenerateDragonBalls(false);
         }
     }
 }
示例#5
0
        public override void Load()
        {
            // loads the mod's configuration file.
            ConfigModel.Load();

            //Loot.EMMLoader.RegisterMod(this);
            //Loot.EMMLoader.SetupContent(this);
            instance = this;

            tremorLoaded                 = ModLoader.GetMod("Tremor") != null;
            thoriumLoaded                = ModLoader.GetMod("ThoriumMod") != null;
            enigmaLoaded                 = ModLoader.GetMod("Laugicality") != null;
            battlerodsLoaded             = ModLoader.GetMod("UnuBattleRods") != null;
            expandedSentriesLoaded       = ModLoader.GetMod("ExpandedSentries") != null;
            MyPlayer.KaiokenKey          = RegisterHotKey("Kaioken", "J");
            MyPlayer.EnergyCharge        = RegisterHotKey("Energy Charge", "C");
            MyPlayer.Transform           = RegisterHotKey("Transform", "X");
            MyPlayer.PowerDown           = RegisterHotKey("Power Down", "V");
            MyPlayer.SpeedToggle         = RegisterHotKey("Speed Toggle", "Z");
            MyPlayer.QuickKi             = RegisterHotKey("Quick Ki", "N");
            MyPlayer.TransMenu           = RegisterHotKey("Transformation Menu", "K");
            MyPlayer.InstantTransmission = RegisterHotKey("Instant Transmission", "I");
            //MyPlayer.ProgressionMenuKey = RegisterHotKey("Progression Menu", "P");
            MyPlayer.FlyToggle  = RegisterHotKey("Flight Toggle", "Q");
            MyPlayer.ArmorBonus = RegisterHotKey("Armor Bonus", "Y");
            if (!Main.dedServ)
            {
                GFX.LoadGFX(this);
                KiBar.visible = true;

                ActivateTransMenu();
                ActivateWishmenu();
                ActivateProgressionMenu();
                ActivateKiBar();
                ActivateOverloadBar();

                InstantTransmissionMapTeleporter = new InstantTransmissionMapTeleporter();

                Circle = new CircleShader(new Ref <Effect>(GetEffect("Effects/CircleShader")), "Pass1");

                Filters.Scene["DBZMOD:GodSky"]        = new Filter(new ScreenShaderData("FilterMiniTower").UseColor(0.9f, 0.1f, 0.1f).UseOpacity(0.7f), EffectPriority.VeryHigh);
                SkyManager.Instance["DBZMOD:GodSky"]  = new GodSky();
                Filters.Scene["DBZMOD:WishSky"]       = new Filter(new ScreenShaderData("FilterMiniTower").UseColor(0.1f, 0.1f, 0.1f).UseOpacity(0.7f), EffectPriority.VeryHigh);
                SkyManager.Instance["DBZMOD:WishSky"] = new WishSky();
            }
        }
示例#6
0
        public override void PostAI()
        {
            projectile.netUpdate = true;
            player           = Main.player[projectile.owner];
            finalChargeLimit = chargeLimit + MyPlayer.ModPlayer(player).chargeLimitAdd;
            if (!chargeBall)
            {
                projectile.scale = projectile.scale + chargeLevel;
            }

            if (beamTrail && projectile.scale > 0 && sizeTimer > 0)
            {
                sizeTimer = 120;
                sizeTimer--;
                projectile.scale = (projectile.scale * sizeTimer / 120f);
            }
            if (chargeBall)
            {
                if (MyPlayer.ModPlayer(player).IsKiDepleted())
                {
                    player.channel = false;
                }
                projectile.hide = true;

                if (projectile.timeLeft < 4)
                {
                    projectile.timeLeft = 10;
                }

                projectile.position.X = player.Center.X + (player.direction * 20 + xoffset) - 5;
                projectile.position.Y = player.Center.Y - 3 + yoffset;
                projectile.netUpdate2 = true;

                if (!player.channel && chargeLevel < 1)
                {
                    projectile.Kill();
                }

                // if the player is channeling, increment the timer and apply some slowdown
                if (player.channel && projectile.active)
                {
                    chargeTimer++;
                    player.ApplyChannelingSlowdown();
                }

                //ChargeTimerMax -= MyPlayer.ModPlayer(player).chargeTimerMaxAdd;

                if (chargeTimer > chargeTimerMax && chargeLevel < finalChargeLimit)
                {
                    chargeLevel += 1;
                    CombatText.NewText(new Rectangle((int)player.position.X, (int)player.position.Y, player.width, player.height), new Color(51, 204, 255), chargeLevel, false, false);
                    chargeTimer = 0;
                }
                if (DBZMOD.IsTickRateElapsed(2) && !MyPlayer.ModPlayer(player).IsKiDepleted())
                {
                    MyPlayer.ModPlayer(player).AddKi(-kiDrainRate, true, false);
                }
                for (int d = 0; d < 4; d++)
                {
                    float   angle    = Main.rand.NextFloat(360);
                    float   angleRad = MathHelper.ToRadians(angle);
                    Vector2 position = new Vector2((float)Math.Cos(angleRad), (float)Math.Sin(angleRad));

                    Dust tDust = Dust.NewDustDirect(projectile.position + (position * (10 + 2.0f * projectile.scale)), projectile.width, projectile.height, dustType, 0f, 0f, 213, default(Color), ballscale);
                    tDust.velocity  = Vector2.Normalize((projectile.position + (projectile.Size / 2)) - tDust.position) * 2;
                    tDust.noGravity = true;
                }
            }
        }
示例#7
0
        public static void Update(Player player)
        {
            // this might seem weird but the server isn't allowed to control the flight system.
            if (Main.netMode == NetmodeID.Server)
            {
                return;
            }

            MyPlayer modPlayer = MyPlayer.ModPlayer(player);

            //check for ki or death lol
            if ((modPlayer.IsKiDepleted() || player.dead || player.mount.Type != -1 || player.ropeCount != 0) && modPlayer.IsFlying)
            {
                modPlayer.IsFlying = false;
                AddKatchinFeetBuff(player);
            }

            if (modPlayer.IsFlying)
            {
                // cancel platform collision
                player.DryCollision(true, true);

                //prepare vals
                player.fullRotationOrigin = new Vector2(11, 22);
                Vector2 m_rotationDir = Vector2.Zero;

                int FlightDustType = 261;

                //Input checks
                float boostSpeed                 = (BURST_SPEED)*(modPlayer.IsCharging ? 1 : 0);
                int   totalFlightUsage           = Math.Max(1, FLIGHT_KI_DRAIN - modPlayer.FlightUsageAdd);
                float totalHorizontalFlightSpeed = FLIGHT_SPEED + boostSpeed + (player.moveSpeed / 3) + modPlayer.FlightSpeedAdd;
                float totalVerticalFlightSpeed   = FLIGHT_SPEED + boostSpeed + (Player.jumpSpeed / 2) + modPlayer.FlightSpeedAdd;

                if (modPlayer.IsUpHeld)
                {
                    // for some reason flying up is way, way faster than flying down.
                    player.velocity.Y -= (totalVerticalFlightSpeed / 3.8f);
                    m_rotationDir      = Vector2.UnitY;
                }
                else if (modPlayer.IsDownHeld)
                {
                    player.maxFallSpeed = 20f;
                    player.velocity.Y  += totalVerticalFlightSpeed / 3.6f;
                    m_rotationDir       = -Vector2.UnitY;
                }

                if (modPlayer.IsRightHeld)
                {
                    player.velocity.X += totalHorizontalFlightSpeed;
                    m_rotationDir     += Vector2.UnitX;
                }
                else if (modPlayer.IsLeftHeld)
                {
                    player.velocity.X -= totalHorizontalFlightSpeed;
                    m_rotationDir     -= Vector2.UnitX;
                }

                if (player.velocity.Length() > 0.5f)
                {
                    SpawnFlightDust(player, boostSpeed, FlightDustType, 0f);
                }

                if (Transformations.IsSSJ(player) && !Transformations.IsSSJG(player))
                {
                    FlightDustType = 170;
                }
                else if (Transformations.IsLSSJ(player))
                {
                    FlightDustType = 107;
                }
                else if (Transformations.IsSSJG(player))
                {
                    FlightDustType = 174;
                }
                else if (Transformations.IsAnyKaioken(player))
                {
                    FlightDustType = 182;
                }
                else
                {
                    FlightDustType = 267;
                }

                //calculate velocity
                player.velocity.X = MathHelper.Lerp(player.velocity.X, 0, 0.1f);
                player.velocity.Y = MathHelper.Lerp(player.velocity.Y, 0, 0.1f);
                // keep the player suspended at worst.
                player.velocity = player.velocity - (player.gravity * Vector2.UnitY);

                // handles keeping legs from moving when the player is in flight/moving fast/channeling.
                if (player.velocity.X > 0)
                {
                    player.legFrameCounter = -player.velocity.X;
                }
                else
                {
                    player.legFrameCounter = player.velocity.X;
                }

                //calculate rotation
                float radRot = GetPlayerFlightRotation(m_rotationDir, player);

                player.fullRotation = MathHelper.Lerp(player.fullRotation, radRot, 0.1f);

                //drain ki
                if (!modPlayer.flightUpgraded)
                {
                    if (DBZMOD.IsTickRateElapsed(2))
                    {
                        modPlayer.AddKi((totalFlightUsage + (totalFlightUsage * (int)boostSpeed)) * -1, false, false);
                    }
                }
                else
                {
                    if (DBZMOD.IsTickRateElapsed(4))
                    {
                        modPlayer.AddKi(-1, false, false);
                    }
                }
            }

            // altered to only fire once, the moment you exit flight, to avoid overburden of sync packets when moving normally.
            if (!modPlayer.IsFlying)
            {
                player.fullRotation = MathHelper.Lerp(player.fullRotation, 0, 0.1f);
            }
        }