public override void PostAI() { if (State == StandState.SpecialMove0 && _attackCounter > 10 && _attackCounter < 75 || State == StandState.SpecialMove1) { StandTexture = TBMTextures.TheWorldTimeStop; } else { StandTexture = TBMTextures.TheWorld; } if (State == StandState.RushAttackShort || State == StandState.RushAttackLong) { FrameCap = 4; FrameOffset = 1; } else { FrameCap = 1; FrameOffset = 0; } if (TBMWorld.Get().TimeStopDuration > 0) { SpecialCosts[0] = 0; } else { SpecialCosts[0] = 50; } }
public override void OnHitPvp(Player target, int damage, bool crit) { if (TBMWorld.Get().TimeStopDuration <= 0) { TBMPlayer.Get(Main.player[projectile.owner]).Stamina += 1; } TBMUtils.CircleDust(projectile.Center, projectile.velocity, DustID.AncientLight); Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Punch" + Main.rand.Next(1, 5)).WithVolume(0.35f)); }
public override void PostAI() { if (State == StandState.RushAttackShort || State == StandState.RushAttackLong) { FrameOffset = 4; } else { FrameOffset = 0; } if (TBMWorld.Get().TimeStopDuration > 0) { SpecialCosts[0] = 0; } else { SpecialCosts[0] = 100; } }
public override bool PreAI() { if (_prestopvelocity == Vector2.Zero) { _prestopvelocity = projectile.velocity; } if (!_setFrame) { CurrentFrame = Main.rand.Next(2) == 0 ? 1 : 0; _setFrame = true; } if (TBMWorld.Get().TimeStopDuration > 0) { foreach (NPC npc in Main.npc) { if (!npc.active) { continue; } if (_startSlowDown) { break; } for (float i = 0.5f; i < 4f; i += 0.5f) { if (new Rectangle((int)(projectile.Center.X + projectile.velocity.X * i), (int)(projectile.Center.Y + projectile.velocity.Y * i), 8, 8).Intersects(npc.Hitbox)) { _startSlowDown = true; } } } foreach (Player player in Main.player) { if (!player.active || player.whoAmI == projectile.owner) { continue; } if (_startSlowDown) { break; } for (float i = 0.5f; i < 4f; i += 0.5f) { if (new Rectangle((int)(projectile.Center.X + projectile.velocity.X * i), (int)(projectile.Center.Y + projectile.velocity.Y * i), 8, 8).Intersects(player.Hitbox)) { _startSlowDown = true; } } } } else { _startSlowDown = false; projectile.velocity = _prestopvelocity; } if (_startSlowDown && Math.Abs(projectile.velocity.X) > Math.Abs(_prestopvelocity.X * 0.00005f)) { projectile.velocity *= 0.5f; } return(base.PreAI()); }