From d981a2eea56f80a28c0946a5303c57693e630e98 Mon Sep 17 00:00:00 2001 From: loki5512344 Date: Sat, 4 Jul 2026 20:42:28 +0200 Subject: [PATCH] =?UTF-8?q?feat:=203=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B5=20me?= =?UTF-8?q?ter-=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D1=8B=20!rizz=20!luck?= =?UTF-8?q?=20!aura?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - RizzCommand: 🗿 ризз-метр (харизма) с уровнями - LuckCommand: 🍀 удача с уровнями - AuraCommand: ✨ аура от -50 до 100 с цветами - RatingConfig: уровни для rizz + luck - Все зарегистрированы в EntertainmentCommandRegistrar --- .../EntertainmentCommandRegistrar.java | 6 ++ .../feature/rating/commands/AuraCommand.java | 64 +++++++++++++++++++ .../feature/rating/commands/LuckCommand.java | 56 ++++++++++++++++ .../feature/rating/commands/RizzCommand.java | 56 ++++++++++++++++ .../feature/rating/config/RatingConfig.java | 26 ++++++++ 5 files changed, 208 insertions(+) create mode 100644 src/main/java/creator/loki/feature/rating/commands/AuraCommand.java create mode 100644 src/main/java/creator/loki/feature/rating/commands/LuckCommand.java create mode 100644 src/main/java/creator/loki/feature/rating/commands/RizzCommand.java diff --git a/src/main/java/creator/loki/feature/entertainment/EntertainmentCommandRegistrar.java b/src/main/java/creator/loki/feature/entertainment/EntertainmentCommandRegistrar.java index 135e105..8eec812 100644 --- a/src/main/java/creator/loki/feature/entertainment/EntertainmentCommandRegistrar.java +++ b/src/main/java/creator/loki/feature/entertainment/EntertainmentCommandRegistrar.java @@ -11,13 +11,16 @@ import creator.loki.feature.entertainment.commands.random.EightBallCommand; import creator.loki.feature.entertainment.commands.GlazbobaCommand; import creator.loki.feature.entertainment.commands.MemeCommand; import creator.loki.feature.entertainment.commands.random.RandomChoiceCommand; +import creator.loki.feature.rating.commands.AuraCommand; import creator.loki.feature.rating.commands.BoykisserCommand; import creator.loki.feature.rating.commands.FatCommand; import creator.loki.feature.rating.commands.GayCommand; import creator.loki.feature.rating.commands.IqCommand; +import creator.loki.feature.rating.commands.LuckCommand; import creator.loki.feature.rating.commands.MustacheCommand; import creator.loki.feature.rating.commands.PpCommand; import creator.loki.feature.rating.commands.RateCommand; +import creator.loki.feature.rating.commands.RizzCommand; import creator.loki.feature.entertainment.service.RatingService; import creator.loki.feature.ship.ShipCommand; import creator.loki.feature.ship.repository.ShipPairRepository; @@ -62,6 +65,9 @@ public class EntertainmentCommandRegistrar implements CommandRegistrar { registry.register(new BoykisserCommand(ratingService)); registry.register(new MustacheCommand(ratingService)); registry.register(new FatCommand(ratingService)); + registry.register(new RizzCommand(ratingService)); + registry.register(new LuckCommand(ratingService)); + registry.register(new AuraCommand(ratingService)); registry.register(new PatCommand(cooldownManager)); for (var flavor : SocialCommand.Flavor.values()) { diff --git a/src/main/java/creator/loki/feature/rating/commands/AuraCommand.java b/src/main/java/creator/loki/feature/rating/commands/AuraCommand.java new file mode 100644 index 0000000..bf79afd --- /dev/null +++ b/src/main/java/creator/loki/feature/rating/commands/AuraCommand.java @@ -0,0 +1,64 @@ +package creator.loki.feature.rating.commands; + +import java.awt.Color; + +import com.google.inject.Inject; +import creator.loki.command.Command; +import creator.loki.command.CommandContext; +import creator.loki.embed.EmbedFactory; +import creator.loki.feature.entertainment.service.RatingService; +import net.dv8tion.jda.api.entities.Member; + +public class AuraCommand implements Command { + + private final RatingService ratingService; + + @Inject + public AuraCommand(RatingService ratingService) { + this.ratingService = ratingService; + } + + @Override + public String getName() { return "aura"; } + + @Override + public String getDescription() { return "Проверить свою ауру (результат всегда одинаковый)"; } + + @Override + public String getUsage() { return "aura [@user]"; } + + @Override + public String getCategory() { return "Развлечения"; } + + @Override + public void execute(CommandContext context) { + if (!ratingService.checkAndApplyCooldown(context, "aura")) return; + Member target = ratingService.resolveTarget(context); + if (target == null) return; + + int aura = ratingService.getDeterministicValue(target.getId(), 999, -50, 100); + String emoji; + Color color; + if (aura >= 80) { emoji = "🌟"; color = new Color(255, 215, 0); } + else if (aura >= 50) { emoji = "✨"; color = new Color(100, 255, 150); } + else if (aura >= 20) { emoji = "😐"; color = new Color(52, 152, 219); } + else if (aura >= 0) { emoji = "💫"; color = new Color(128, 128, 128); } + else if (aura >= -25) { emoji = "🌑"; color = new Color(231, 76, 60); } + else { emoji = "💀"; color = new Color(100, 0, 0); } + + StringBuilder bar = new StringBuilder(); + int filled = Math.max(0, Math.min(10, (aura + 50) / 15)); + for (int i = 0; i < filled; i++) bar.append("✧"); + for (int i = filled; i < 10; i++) bar.append("◇"); + + context.getChannel().sendMessageEmbeds( + EmbedFactory.create() + .withTitle("✨ Аура") + .withDescription(target.getAsMention()) + .addField("Сила", emoji + " **" + aura + "**\n" + bar, false) + .withThumbnail(target.getUser().getAvatarUrl()) + .withColor(color) + .withFooter("💡 Детерминировано вашим Discord ID") + .build()).queue(); + } +} diff --git a/src/main/java/creator/loki/feature/rating/commands/LuckCommand.java b/src/main/java/creator/loki/feature/rating/commands/LuckCommand.java new file mode 100644 index 0000000..2fcae1f --- /dev/null +++ b/src/main/java/creator/loki/feature/rating/commands/LuckCommand.java @@ -0,0 +1,56 @@ +package creator.loki.feature.rating.commands; + +import com.google.inject.Inject; +import creator.loki.command.Command; +import creator.loki.command.CommandContext; +import creator.loki.embed.EmbedFactory; +import creator.loki.feature.entertainment.service.RatingService; +import creator.loki.feature.rating.config.RatingConfig; +import creator.loki.feature.rating.config.RatingLevel; +import net.dv8tion.jda.api.entities.Member; + +public class LuckCommand implements Command { + + private final RatingService ratingService; + + @Inject + public LuckCommand(RatingService ratingService) { + this.ratingService = ratingService; + } + + @Override + public String getName() { return "luck"; } + + @Override + public String getDescription() { return "Проверить свою удачу (результат всегда одинаковый)"; } + + @Override + public String getUsage() { return "luck [@user]"; } + + @Override + public String getCategory() { return "Развлечения"; } + + @Override + public void execute(CommandContext context) { + if (!ratingService.checkAndApplyCooldown(context, "luck")) return; + Member target = ratingService.resolveTarget(context); + if (target == null) return; + + int luck = ratingService.getDeterministicValue(target.getId(), 777, 0, 100); + StringBuilder bar = new StringBuilder(); + int filled = luck / 10; + for (int i = 0; i < filled; i++) bar.append("🍀"); + for (int i = filled; i < 10; i++) bar.append("⬜"); + + RatingLevel level = RatingLevel.findLevel(luck, RatingConfig.getLuckLevels()); + context.getChannel().sendMessageEmbeds( + EmbedFactory.create() + .withTitle("🍀 Удача") + .withDescription(target.getAsMention()) + .addField("Везение", bar + "\n**" + luck + "%** - " + level.getComment(), false) + .withThumbnail(target.getUser().getAvatarUrl()) + .withColor(level.getColor()) + .withFooter("💡 Детерминировано вашим Discord ID") + .build()).queue(); + } +} diff --git a/src/main/java/creator/loki/feature/rating/commands/RizzCommand.java b/src/main/java/creator/loki/feature/rating/commands/RizzCommand.java new file mode 100644 index 0000000..9dbcaa9 --- /dev/null +++ b/src/main/java/creator/loki/feature/rating/commands/RizzCommand.java @@ -0,0 +1,56 @@ +package creator.loki.feature.rating.commands; + +import com.google.inject.Inject; +import creator.loki.command.Command; +import creator.loki.command.CommandContext; +import creator.loki.embed.EmbedFactory; +import creator.loki.feature.entertainment.service.RatingService; +import creator.loki.feature.rating.config.RatingConfig; +import creator.loki.feature.rating.config.RatingLevel; +import net.dv8tion.jda.api.entities.Member; + +public class RizzCommand implements Command { + + private final RatingService ratingService; + + @Inject + public RizzCommand(RatingService ratingService) { + this.ratingService = ratingService; + } + + @Override + public String getName() { return "rizz"; } + + @Override + public String getDescription() { return "На сколько у тебя ризз (харизма)"; } + + @Override + public String getUsage() { return "rizz [@user]"; } + + @Override + public String getCategory() { return "Развлечения"; } + + @Override + public void execute(CommandContext context) { + if (!ratingService.checkAndApplyCooldown(context, "rizz")) return; + Member target = ratingService.resolveTarget(context); + if (target == null) return; + + int rizz = ratingService.getDeterministicValue(target.getId(), 555, 0, 100); + StringBuilder bar = new StringBuilder(); + int filled = rizz / 10; + for (int i = 0; i < filled; i++) bar.append("🗿"); + for (int i = filled; i < 10; i++) bar.append("⬜"); + + RatingLevel level = RatingLevel.findLevel(rizz, RatingConfig.getRizzLevels()); + context.getChannel().sendMessageEmbeds( + EmbedFactory.create() + .withTitle("🗿 Rizz Метр") + .withDescription(target.getAsMention()) + .addField("Харизма", bar + "\n**" + rizz + "%** - " + level.getComment(), false) + .withThumbnail(target.getUser().getAvatarUrl()) + .withColor(level.getColor()) + .withFooter("💡 Детерминировано вашим Discord ID") + .build()).queue(); + } +} diff --git a/src/main/java/creator/loki/feature/rating/config/RatingConfig.java b/src/main/java/creator/loki/feature/rating/config/RatingConfig.java index d82e96f..d98cbf4 100644 --- a/src/main/java/creator/loki/feature/rating/config/RatingConfig.java +++ b/src/main/java/creator/loki/feature/rating/config/RatingConfig.java @@ -56,6 +56,24 @@ public class RatingConfig { new RatingLevel(30, "🙂 Иногда целуется", new Color(255, 218, 185)), new RatingLevel(10, "😐 Редко целуется", new Color(176, 196, 222)), new RatingLevel(0, "😶 Не целуется", new Color(128, 128, 128)))); + m.put( + "rizz", + List.of( + new RatingLevel(90, "🗿 ЛЕГЕНДАРНЫЙ РИЗЗ!", new Color(255, 215, 0)), + new RatingLevel(70, "😎 Обаятельный", new Color(100, 255, 150)), + new RatingLevel(50, "🙂 Есть потенциал", new Color(52, 152, 219)), + new RatingLevel(30, "😐 Средний", new Color(128, 128, 128)), + new RatingLevel(10, "😬 Неловко", new Color(255, 165, 0)), + new RatingLevel(0, "💀 Кринж", new Color(231, 76, 60)))); + m.put( + "luck", + List.of( + new RatingLevel(90, "🍀 ИЗБРАННИК УДАЧИ!", new Color(255, 215, 0)), + new RatingLevel(70, "🍀 Везёт", new Color(100, 255, 150)), + new RatingLevel(50, "🙂 Бывает хуже", new Color(52, 152, 219)), + new RatingLevel(30, "😐 Ни туда ни сюда", new Color(128, 128, 128)), + new RatingLevel(10, "😬 Невезучий", new Color(255, 165, 0)), + new RatingLevel(0, "💀 Проклят", new Color(231, 76, 60)))); LEVELS = Collections.unmodifiableMap(m); } @@ -78,4 +96,12 @@ public class RatingConfig { public static List getBoykisserLevels() { return LEVELS.get("boykisser"); } + + public static List getRizzLevels() { + return LEVELS.get("rizz"); + } + + public static List getLuckLevels() { + return LEVELS.get("luck"); + } }