2019-03-27 16:05:39

I would love to make something like a crazy party battle one day, but I definitely do not have some of the skills required for it. But the main problem is deciphering how to put the project together. Determining what objects are variables, are classes, and are arrays or timers. So, what is the analysis behind a crazy party battle?

Here is what I know:

hand, deck, discard, and exile are arrays.
Cards are classes with variables like type, success, and other flags.

here is what I do not know:
Is the player a variable or a class?
Does each card have an ID number for the randomizer?
How do you set up flags?
And how does the randomizer know what card to draw next without choosing an already discarded one?

2019-03-27 16:36:50

I'm asuming that when something is discarded, it is removed from the array, and moved to the discarded array. But I'm not sure how he made it, ask Pragma!

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)

2019-03-27 20:49:46

@2 this is how it would be done in bgt

void playcard()
{
if(key_pressed(KEY_RETURN))
{
discard.insert_last(hand_index);
hand.remove_at[hand_index];
}
}

2019-03-27 20:49:55

@1: Here are my thoughts:
1: Is the player a variable or a class?
A player is most likely a class. More over, I believe that a player is the same for minigames and battle. However, since bgt does not have variable restrictions a player could also be a simple variable, like so:
int health=30;
int type;
This would work, because the only thing we need to check is player's health. No timers, no attacks or defenses, just 2 variables. However, it is highly unlikely a player's health is not within the player class.
2: Does each card have an ID number for the randomizer?
You got it. I'm guessing that the cards do have the ID to be picked. That, or we have an array that contains only cards that are in your deck and we can pick random objects from the array, not the actual card list.
3: How do you set up flags and how does the randomizer know what card to draw next without choosing an already discarded one?
I'll give a more extensive explanation here. What could be happening is when you draw a card an object is moved from an array containing your deck to the discarded list. The random number generator, AKA the RNG now has one less things to pick from. It will not pick the same object, because it can't do so.
Imagine we have a list that contains numbers 1 through 10. Our list is 10 values long, so the lowest we want is 0 (the first item in most of coding languages when it comes to an array) to 9 (the highest item in the array). After that, we access the object stored within the list, use it to, say, do damage, and then remove and resize the array. Next time we draw, we have to choose between 0 and 8 (or array.length()-1), and so on.
As for setting up flags, I'm not sure what you mean. If we setup an environment, we simply change a variable, be it integer or a string (probably an int). Where the variable is stored is only known to the coder, but it could be anywhere. In the player class, outside of it... really, anywhere. Without more explanation as to what you mean when you say "Set up flags" I can't help you.

2019-03-28 00:15:58

I would make player classes to store values like health, type, and different values for attacks and defenses and such. Each player object would also store the different lists of cards because we need multiple players for a battle to work (bots are players as well). The difference with a bot player is that you would overwrite the act method or whatever you would have that would bring up the card selection for the player. The act method would only have access to the things the player does and it would choose a card to play and someone to target the card at. You could possibly have a class for effects too, like poison and burning that would have event methods so that the game would know when to trigger an effect either on card use, or on turn start, or on turn end after a card has been used etc etc.
You could try asking Pragma about the mechanics of the Crazy Party battle mode, I don't know how much information he will give but it can't hurt, I suppose.

2019-03-28 15:42:36

Flags are the words at the end of a card. For example, offensive, mouth, double try, support

2019-03-28 20:43:28 (edited by amerikranian 2019-03-28 20:43:58)

@6, then I'd say the flags are in the card class themselves. They might be even their own classes, who knows.