Well, not much appears
to have been done on the surface, because I spent the majority of the week
cleaning code and making it smoother.
And the cards are shaped like cards. |
Now, the enemy can do everything the player can do, and uses
the same functions. A simple Boolean
keeps track of whether it's the player's turn or not.
I also created a separate message box (in the bottom-right)
for most text. The text above the health
of the player and enemy are there mostly to show what their current condition
is (stunned, confused, etc.).
I think some of the messages still go unseen because I don't
have enough timers to wait between messages, so there still needs a bit of work
to be done in figuring out exactly where the timers are needed.
I have also capped each character's health (at 10 for the
test), so neither the player nor the enemy can heal above their max.
At the moment, the enemy chooses a card at random, which can
result in the enemy doing some very silly moves, so eventually I'll have to
come up with some AI for the enemy so they don't act so dumb. They should act as if they have a five-card
hand as well, and pick the best card for their situation.
The battle ends when one character loses their health, but
since there is no overworld to go back to,
it simply ends, and erases everything after a second. I need to add a pretty win statement in the
message box, but at the moment, have no fear when the screen goes away; it's
not broken.
I currently have the win/loss check on ENTER_FRAME, but I
think there ought to be a better way to do it, such as only when a character
takes damage, but the win condition check is in Main, not in the Battle class itself, so
things might get a little convoluted for a while.
I am finding I have to reference strings multiple times, and
that always makes me a bit uncomfortable.
Often, a case will throw out an error because of a typo or change in
vocabulary that I did not completely implement.
The "Confused" condition adds a secondary case
(since if you're confused, either your move doesn't work or affects the
opposite of the target), so I'm thinking of getting rid of it, just to simplify
things a ton. Besides, while confusing
the enemy is fun, being confused is not, and I want all player actions to be
playable by the enemy as well.
I've also added some code to make sure the player doesn't
have duplicate cards (an odd recursive check ensures that the index of the card
in the deck array is not the same as any other card in hand).
I think I had a non-recursive function originally, which
lowered the odds of having duplicate cards, but did not wholly take care of the
problem. Now there should be no
duplicates. (The player may have more
than one of the same type of card,
because there is often more than one of each card in the deck, but since the
player only has one Confuse card, for instance, the player should never get two
of them in hand).
I think I may still have an error or two in the logic,
because being stunned appears to last way too long (unless the enemy is
stunning me multiple times, and the output is not particularly clear). I have an int that keeps track of how many
turns a character has been in a condition which -=1 each turn.
Man, I feel like I need to write daily notes, rather than
summing up a week, because I forget what I've done since last week.
No comments:
Post a Comment