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.
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.
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.
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
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.
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.