feat: 3 новые meter-команды !rizz !luck !aura

- RizzCommand: 🗿 ризз-метр (харизма) с уровнями
- LuckCommand: 🍀 удача с уровнями
- AuraCommand: ✨ аура от -50 до 100 с цветами
- RatingConfig: уровни для rizz + luck
- Все зарегистрированы в EntertainmentCommandRegistrar
This commit is contained in:
loki5512344 2026-07-04 20:42:28 +02:00
parent 98ea510c49
commit d981a2eea5
5 changed files with 208 additions and 0 deletions

View file

@ -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.GlazbobaCommand;
import creator.loki.feature.entertainment.commands.MemeCommand; import creator.loki.feature.entertainment.commands.MemeCommand;
import creator.loki.feature.entertainment.commands.random.RandomChoiceCommand; 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.BoykisserCommand;
import creator.loki.feature.rating.commands.FatCommand; import creator.loki.feature.rating.commands.FatCommand;
import creator.loki.feature.rating.commands.GayCommand; import creator.loki.feature.rating.commands.GayCommand;
import creator.loki.feature.rating.commands.IqCommand; 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.MustacheCommand;
import creator.loki.feature.rating.commands.PpCommand; import creator.loki.feature.rating.commands.PpCommand;
import creator.loki.feature.rating.commands.RateCommand; 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.entertainment.service.RatingService;
import creator.loki.feature.ship.ShipCommand; import creator.loki.feature.ship.ShipCommand;
import creator.loki.feature.ship.repository.ShipPairRepository; import creator.loki.feature.ship.repository.ShipPairRepository;
@ -62,6 +65,9 @@ public class EntertainmentCommandRegistrar implements CommandRegistrar {
registry.register(new BoykisserCommand(ratingService)); registry.register(new BoykisserCommand(ratingService));
registry.register(new MustacheCommand(ratingService)); registry.register(new MustacheCommand(ratingService));
registry.register(new FatCommand(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)); registry.register(new PatCommand(cooldownManager));
for (var flavor : SocialCommand.Flavor.values()) { for (var flavor : SocialCommand.Flavor.values()) {

View file

@ -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();
}
}

View file

@ -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();
}
}

View file

@ -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();
}
}

View file

@ -56,6 +56,24 @@ public class RatingConfig {
new RatingLevel(30, "🙂 Иногда целуется", new Color(255, 218, 185)), new RatingLevel(30, "🙂 Иногда целуется", new Color(255, 218, 185)),
new RatingLevel(10, "😐 Редко целуется", new Color(176, 196, 222)), new RatingLevel(10, "😐 Редко целуется", new Color(176, 196, 222)),
new RatingLevel(0, "😶 Не целуется", new Color(128, 128, 128)))); 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); LEVELS = Collections.unmodifiableMap(m);
} }
@ -78,4 +96,12 @@ public class RatingConfig {
public static List<RatingLevel> getBoykisserLevels() { public static List<RatingLevel> getBoykisserLevels() {
return LEVELS.get("boykisser"); return LEVELS.get("boykisser");
} }
public static List<RatingLevel> getRizzLevels() {
return LEVELS.get("rizz");
}
public static List<RatingLevel> getLuckLevels() {
return LEVELS.get("luck");
}
} }