$(eval r = () => Math.floor(Math.random() * 100) + 1; u = r(); t = r(); s = [`$(user)'s ${u} crushed $(1)'s ${t}`, `$(user)'s ${u} was crushed by $(1)'s ${t}`, `$(user)'s ${u} and $(1)'s ${t} are evenly matched`]; v = u - t; v > 0 ? w = 0 : v < 0 ? w = 1 : w = 2; s[w] + '!';)
While I was testing it I had two more ideas. Not sure if they’re possible of if they’d make the code so long I’ve have to use a pastebin, but
Right now if I type !battle by itself it will fight “null”. I don’t know if there’s a way to make it say “Choose An Opponent” instead.
I thought it would be fun if the describing-words in the middle changed depending on the difference between the two numbers
The range-breakdown would be:
defeated / was defeated by (1 to 19)
destroyed / was destroyed by (20 to 39)
crushed / was crushed by (40 to 59)
demolished / was demolished by (60 to 79)
obliterated / was obliterated by (80 to 99)
The list on the left of the “/” above would be used if the first number was higher than the second number
The list on the right of the “/” above would be used if the first number was lower than the second number
So if for example the random number generator in the command chose the numbers 20 and 80 it would return
$(user)'s [first number] was demolished by $(1)'s [second number]!
choosing the phrase “was demolished by” because the difference between the numbers is 60 (80-20), AND because the first number was lower than the second number (if the first number was HIGHER than the second number, the chosen phrase would have been “demolished”)
I hope this makes sense and I’m curious to hear if this is within the realm of possibility!