Anpassung Befehle und Roll darstellung

This commit is contained in:
Ocame
2019-02-22 14:01:02 +01:00
parent cc346d5858
commit 3dea42842f
2 changed files with 26 additions and 39 deletions

View File

@ -21,9 +21,9 @@ public class balance extends ListenerAdapter {
public balance() { public balance() {
this.prefixPromote = "!konto"; this.prefixPromote = "/konto";
this.prefixDegradation = "!pay "; this.prefixDegradation = "/pay ";
this.prefixDetail = "!detail"; this.prefixDetail = "/detail";
} }
@Override @Override

View File

@ -23,9 +23,9 @@ public class dice extends ListenerAdapter {
public dice() { public dice() {
this.prefixSr = "!sr"; this.prefixSr = "/sr";
this.prefixTest = "!rollTest"; this.prefixTest = "/rollTest";
this.prefixZitat = "!zitat"; this.prefixZitat = "/zitat";
} }
@Override @Override
@ -125,7 +125,6 @@ public class dice extends ListenerAdapter {
int hits = 0; int hits = 0;
boolean glitches = false; boolean glitches = false;
boolean critGlitches = false;
boolean edge = false; boolean edge = false;
@ -145,6 +144,7 @@ public class dice extends ListenerAdapter {
try { try {
diceart = Integer.parseInt(diceInterpreter[1]); diceart = Integer.parseInt(diceInterpreter[1]);
numberOfDice = Integer.parseInt(diceInterpreter[0]); numberOfDice = Integer.parseInt(diceInterpreter[0]);
verteilung = new int[diceart];
} }
catch (NumberFormatException e) { catch (NumberFormatException e) {
event.getChannel().sendMessage(event.getMember().getAsMention() + " Irgent was dummes ist passiert beim Verstehen von " + MsgParts[1].trim().toLowerCase()).queue(); event.getChannel().sendMessage(event.getMember().getAsMention() + " Irgent was dummes ist passiert beim Verstehen von " + MsgParts[1].trim().toLowerCase()).queue();
@ -194,51 +194,38 @@ public class dice extends ListenerAdapter {
hits++; hits++;
} }
verteilung[dice1]++; verteilung[dice1]++;
if((dice1 >= 4) || (dice1 == 0))
result.append("**" + (dice1+1) + "**");
else
result.append(dice1+1); result.append(dice1+1);
result.append(" "); result.append(" ");
} }
if (verteilung[0] >= (numberOfDice+bonusEdegeDice)/2 && verteilung[0] > 0) { if (verteilung[0] >= (numberOfDice+bonusEdegeDice)/2f) {
glitches = true; glitches = true;
} }
if(hits == 0) { if(hits == 0 && glitches == false) { // kein Erfolg, kein Patzer
outputBox.setColor(Color.gray);
}
else if(hits == 0 && glitches == true) { // kriischer Patzer
outputBox.setColor(Color.red); outputBox.setColor(Color.red);
if(glitches == true) {
outputBox.setDescription("**Kritischer Patzer** :,(");
} }
else { else if(glitches == true) { // Patzer
outputBox.setDescription("**nicht geschafft**");
}
}
else if(glitches == true) {
outputBox.setColor(Color.yellow); outputBox.setColor(Color.yellow);
outputBox.setDescription("**Patzer** :(");
} }
else { else { // Efolg
outputBox.setColor(Color.green); outputBox.setColor(Color.green);
if(hits == 1) {
outputBox.setDescription("**" + String.valueOf(hits) + " Erfolg**");
}
else if(hits < 4) {
outputBox.setDescription("**" + String.valueOf(hits) + " Erfolge**");
}
else if(hits < 6) {
outputBox.setDescription("**" + String.valueOf(hits) + " Erfolge**, das ist schon ordentlich");
}
else if(hits < 10) {
outputBox.setDescription("**" + String.valueOf(hits) + " Erfolge**, WOW sowas mal nachmachen");
}
else {
outputBox.setDescription("**" + String.valueOf(hits) + " Erfolge**, bist du Wahnsinnig?");
}
} }
outputBox.setTitle(event.getMember().getEffectiveName() + " dein Wurf " + MsgParts[1] + " ergibt:"); String zusatz = "";
if(bonusEdegeDice > 0) {
zusatz = " + " + bonusEdegeDice + "d" + diceart;
}
outputBox.setTitle(event.getMember().getEffectiveName() + " " + numberOfDice + "d" + diceart + zusatz+ ":\tErfolge: " + String.valueOf(hits)+ "\tMisserfolge: " + String.valueOf(verteilung[0]));
outputBox.addField("Erfolge", String.valueOf(hits), true);
outputBox.addField("Misserfolge", String.valueOf(verteilung[0]), true); outputBox.setDescription("(" + result.toString().trim() + ")");
outputBox.addField("Ergbenise", result.toString(), false);
for(int i = 0; i < diceart; i++) { for(int i = 0; i < diceart; i++) {
float pro = verteilung[i]*100f/numberOfDice; float pro = verteilung[i]*100f/numberOfDice;
@ -263,7 +250,7 @@ public class dice extends ListenerAdapter {
quotes[0] = "*quiek quiek quiek*"; quotes[0] = "*quiek quiek quiek*";
quotes[1] = "" + quotes[1] = "" +
"(\\\\_____/)\n" + "(\\\\______/)\n" +
"( ͡ ͡° ͜ ʖ ͡ ͡°) *snuff snuff*\n" + "( ͡ ͡° ͜ ʖ ͡ ͡°) *snuff snuff*\n" +
"\\\\╭☞ \\\\╭☞\n" + "\\\\╭☞ \\\\╭☞\n" +
""; "";