Currently, I have made a system where player can choose from a list of classes, and their stat increase is based on which type of classes they chose as well as the number of classes chosen.
This is how it is coded currently:
(1) Slots 1~5 defined at the beginning of the script.
Code: Select all
default slot1 = "undefined"
default slot2 = "undefined"
default slot3 = "undefined"
default slot4 = "undefined"
default slot5 = "undefined"
Code: Select all
menu:
"Select a course for Day 1."
"Class A":
$ slot1 = "Class A"
"Class B":
$ slot1 = "Class B"
"Class C":
$ slot1 = "Class C"
menu:
"Select a course for Day 2."
"Class A":
$ slot2 = "Class A"
"Class B":
$ slot2 = "Class B"
"Class C":
$ slot2 = "Class C"
(3) Actually calculating the stat increases.
Code: Select all
if slot 1 == "Class A":
$ skillA =+ 5
if slot 1 == "Class B":
$ skillB =+ 5
if slot 1 == "Class C":
$ skillC =+ 5
Currently, this is fine with only 3 or so classes, but in the future, this is probably a problem if I add more classes, like 20~30, because there will be too many if statements.
Main Question:
Is there a way to streamline this process, such as checking slots 1~5 for the number of instance which a class appears, and assigning stat increase based on the name and the number of times each class has appeared.
Hopefully this made sense. Thank you in advance for reading so far.