Wrote up a draft for the first version of my battle system, looking for critique.

Doinathing

That Guy
Veteran
Joined
Sep 4, 2020
Messages
120
Reaction score
95
First Language
English
Primarily Uses
RMXP
Hi.

So, I wanted to make a unique card battle system, and I decided to write up a draft for how the base of it all should look.
I just wanted to post the draft here and see if there's anything wrong with it. I'd hate to wind up with some in efficient code as the base for my combat.
I'm going to program the whole thing using Common Events, because scripts terrify me.

Here's the draft.

Pre-Battle
set variable for enemy to 0(or whatever)
move to battle map, display player image.
check variable for enemy
if 0, set variable for enemy HP to 100

show image for enemy0
set variable for card number to 0

Card Choosing

check variable for card number
if >3, go to label for turn start
else, continue

randomize variable for card type, (0-6)
if 0, go to label for defensive cards
if 1-2, go to label for passive cards
if 3-5, go to label for aggressive cards

AGR Cards

randomize variable for card (0-14)


)REPEAT THESE STEPS FOR ALL 15 CARDS(

if 0, check for card number variable

if 0, display image for acard0 on the left
set variable for card 1 to card variable

if 1, display image for acard0 in the middle
set variable for card 2 to card variable

if 2, display image for acard0 on the right
set variable for card 3 to card variable
)-------------------------------------------(

add 1 to variable for card number
go to label for card choosing

PAS Cards

randomize variable for card (15-29)


)REPEAT THESE STEPS FOR ALL 15 CARDS(

if 0, check for card number variable

if 0, display image for pcard0 on the left
set variable for card 1 to card variable

if 1, display image for pcard0 in the middle
set variable for card 2 to card variable

if 2, display image for pcard0 on the right
set variable for card 3 to card variable
)-------------------------------------------(

add 1 to variable for card number
go to label for card choosing

DEF Cards

randomize variable for card (30-44)


)REPEAT THESE STEPS FOR ALL 5 CARDS(

if 31, check for card number variable

if 0, display image for dcard0 on the left
set variable for card 1 to card variable

if 1, display image for dcard0 in the middle
set variable for card 2 to card variable

if 2, display image for dcard0 on the right
set variable for card 3 to card variable
)-------------------------------------------(

add 1 to variable for card number
go to label for card choosing

Turn Start

show text: First Card?
show choices
>card 1
change variable for first card to 0

>card 2
change variable for first card to 1

>card 3
change variable for first card to 2


show text: Second Card?
show choices
>card 1
change variable for second card to 0

>card 2
change variable for second card to 1

>card 3
change variable for second card to 2

erase all card images

comment: this is where the turn happens


check variable for card 1

------------------------------------------------------------------
if 0, check variable for enemy hp
multiply variable for enemy hp by 4, divide by 10 put into enemy damage variable
subtract enemy damage variable from enemy hp
show text, [ENEMY] took [ENEMY DAMAGE VARIABLE] damage.
--------------------------------------------------------------------
if 15, randomize variable for misc cards, (0-9)

if between 0 and 3, set variable for instant karma to 1
else, do nothing.
--------------------------------------------------------------------
if 30, randomize variable for misc cards, (0-9)

if between 0 and 5, set variable for negate damage to 1
else, do nothing
-----------------------------------------------

check variable for card 2, repeat above steps.

if enemy health is less than 10, show text: you won! fade to player coords on starting map using x and y variables
else, continue



Enemy Turn

check variable for instant karma
if 1,

check negate damage, if 1, jump to label for enemy turn end

subtract 1 from variable for Mist's health.
if less than 1, transfer to death map

else, continue

check variable for instant karma
if 1, check variable for enemy hp
multiply variable for enemy hp by 7, divide by 10 put into enemy damage variable
show text, [ENEMY] received [ENEMY DAMAGE VARIABLE] HP of karma.

else, continue

go to label for card picking

Any advice is appreciated. Thank you!

Edit: Wait, should this be in game ideas and prototypes?

Edit 2: yeah, I tried putting the code in, and it's got a few oversights. Mostly forgot to reset variables

edit 3: this is all broken and inefficient. just for 35 cards is gonna be a nightmare to navigate, there's gotta be a better way

Edit 4: Okay! I got a very basic version of this system working! Here's each part to the new code.

1610493843313.png
1610493892680.png1610493912638.png1610493942495.png1610493963797.png
1610494022390.png1610494044872.png
1610494097773.png
1610494119457.png
1610494178025.png1610494197725.png1610494235505.png1610494279760.png1610494300525.png1610494316723.png
1610494355491.png1610494367269.png

All of this is a work in progress, but I still wanted to show it off and see what the more professional RMXP users think.
 
Last edited:

Doinathing

That Guy
Veteran
Joined
Sep 4, 2020
Messages
120
Reaction score
95
First Language
English
Primarily Uses
RMXP
This post has been updated.
 

Latest Threads

Latest Profile Posts

A surprising number of plugins have appeared for MZ since last year. I'm currently making a "shopping list" so that I'll know what I need to test when I switch over to MZ later this year. Much of it is stuff updated from MV plugins, but there are also a good number of new things. It'll be fun to test it all out.
A little dental dilemma this week. One my temp crowns was sized incorrectly and needs some sanding. And dentist was out till Tuesday. Pain is minimal though. Hope everyone here is well. :)
Got like a sudden surge of wish lists overnight. :)
headshot_headshot.jpg
The theory has been proved. Based on an invisible image's data(the big red dot in the previous image), RM can identify different parts of an enemy and do something respectively. :kaojoy:

Forum statistics

Threads
115,382
Messages
1,089,451
Members
150,104
Latest member
Zwloky
Top