public void OverloadEffects() { if (DBTMod.IsTickRateElapsed(300)) { OverloadDamageMultiplier = Main.rand.NextFloat(0.25f, 2f); } if (DBTMod.IsTickRateElapsed(120)) { OverloadKiMultiplier -= 0.01f; } player.allDamage *= OverloadDamageMultiplier; }
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 && DBTMod.IsTickRateElapsed(600)) { CleanupAndRegenerateDragonBalls(false); } } }
public void DBSummonEffects() { if (NPC.CountNPCS(ModContent.NPCType <ShenronNPC>()) == 0) { int dust = Dust.NewDust(player.Center, player.width, player.height / 3, 133, 0, -25f); dust = Dust.NewDust(player.Center, player.width, player.height / 3, 133, 0, -25f); Main.dust[dust].noGravity = true; if (DBTMod.IsTickRateElapsed(80)) { Main.dust[dust].velocity.Y = -25f; Main.dust[dust].scale = 1f; } if (DBTMod.IsTickRateElapsed(160)) { Main.dust[dust].velocity.X = Main.rand.Next(-30, 30); Main.dust[dust].velocity.Y = 0; Main.dust[dust].scale = 1f; } if (DBTMod.IsTickRateElapsed(80)) { Projectile.NewProjectile(player.Center + new Vector2(Main.rand.Next(-700, 700), -50), Vector2.Zero, ModContent.ProjectileType <YellowLightning>(), 0, 0); SoundHelper.PlayCustomSound("Sounds/Lightning", player, 0.5f); } if (DBTMod.IsTickRateElapsed(500)) { Main.time = 72000; NPC.NewNPC((int)player.position.X, (int)player.position.Y, ModContent.NPCType <ShenronNPC>()); NetMessage.SendData(MessageID.SyncNPC); } } else { if (DBTMod.IsTickRateElapsed(500)) { WishMenu.menuVisible = true; } } }
private void PostUpdateOverload() { if (!IsTransformed(TransformationDefinitionManager.Instance.SSJC) && !IsTransformed(TransformationDefinitionManager.Instance.LSSJ)) { overloadDecreaseTimer++; if (overloadDecreaseTimer >= 180) { if (DBTMod.IsTickRateElapsed(OverloadDecayRate)) { if (Overload > 0) { Overload--; } } } } else { overloadDecreaseTimer = 0; } if (IsOverloading) { OverloadEffects(); } else if (!IsOverloading) { OverloadDamageMultiplier = 1f; if (DBTMod.IsTickRateElapsed(60)) { if (OverloadKiMultiplier < 1f) { OverloadKiMultiplier += 0.01f; } } } if (player.dead) { Overload = 0; } if (Overload >= MaxOverload && !IsOverloading) { OnMaxOverload(); } if (Overload > MaxOverload) { Overload = MaxOverload; } if (Overload > 0) { DBTMod.Instance.overloadBar.Visible = true; } else { DBTMod.Instance.overloadBar.Visible = false; } if (IsOverloading && Overload <= 0) { IsOverloading = false; player.AddBuff(mod.BuffType <KiOverusage>(), 60 * 60); } }
public override void AI() { npc.TargetClosest(true); Player player = Main.player[npc.target]; float distanceX = Vector2.Distance(new Vector2(0, npc.Center.X), new Vector2(0, player.Center.X)); if (!player.active || player.dead) { npc.TargetClosest(false); player = Main.player[npc.target]; if (!player.active || player.dead) { //npc.velocity = new Vector2(0f, -10f); if (npc.timeLeft > 10) { npc.timeLeft = 10; } return; } } if (!HasDoneStartingStuff) { ChangeStage(); } if (AIStage == STAGE_WALK) { npc.velocity.X = 1.5f * npc.direction; if (distanceX <= 50) { npc.velocity.X = 0; AITimer1++; } if (AITimer1 >= 120) { ChangeStage(); } } if (AIStage == STAGE_LEAP) { if (!HasDoneStartingStuff && !IsRoaring) { if (!HasDoneStartingPosition) { npc.position = player.position + new Vector2(600, -800); npc.velocity.X -= 0.2f; HasDoneStartingPosition = true; } if (npc.velocity.Y == 0 && npc.velocity.X != 0) { npc.velocity.X = 0; } if (_frame == 0) { if (DBTMod.IsTickRateElapsed(30)) { DoRoar(); } } } else { DoLeap(); } } if (AIStage == STAGE_BEAM) { AITimer1++; if (AITimer1 == 1 && _frame != 0) { _frame = 0; } if (AITimer1 == 20) { DoRoar(); } if (!IsRoaring) { IsBeaming = true; } if (IsRoaringAnimation && !HasFinishedFiringBeam) { AITimer2++; if (AITimer2 <= 90) { DoLineDust(npc.getRect().TopLeft() - new Vector2(12, -85), -60f); } if (AITimer2 == 140) { Projectile.NewProjectile(npc.getRect().TopLeft() - new Vector2(20, -80), new Vector2(-30f, 0f), ModContent.ProjectileType <ApeBeamBlast>(), npc.damage / 3, 2f, npc.whoAmI); npc.netUpdate = true; } if (AITimer2 == 280) { HasFinishedFiringBeam = true; } } } //Main.NewText("AIStage is: " + AIStage); //Main.NewText("Is Roaring? " + IsRoaring); //Main.NewText("Is Beaming? " + IsBeaming); //Main.NewText("AITimer2 is: " + AITimer2); }