[ad_1]
This week was a little light for me as other classes’ final projects have begun, but I have set the groundwork for what I hope will become a fairly robust project in the next few weeks!
This week, I created a custom dice roller for a game of 1st edition pathfinder game I am playing. So far it isn’t much, but again I really only had time to work on it between other projects, so I have plans for expansion and more customization.
For now, I have a script that contains all of the different types of dice I can be rolling as functions (I tested the random.range function in large quantities to ensure that it would simulate a fair set of dice).
Each of the functions are structured the same at this one, but with different ranges. I made it like this so elsewhere when using them, I could just specify how many dice of each kind I would like to roll so it is easier to read.
Next, I made a signaling system so that I could decouple my functionality as much as possible, and set up some button commands to trigger those signals.
Lastly, I set up a basic UI using unity defaults to test everything out and get basic functionality!
So, as it works right now, the “To Hit” box just rolls a D20. I want to be able to have it add all of my character’s bonuses, but that is going to take much more toggleable buttons as those bonuses change throughout a round of combat. You will notice, I have buttons to toggle for if I crit (doubles the appropriate damage), or if I am fighting a dragon (or “THE” dragon). This is custom to my character, which is a ranger whose favored enemy is a dragon. The weapon I am using also has specific effects against the specific dragon my character hates most. All of these buttons are toggleable so that I get the appropriate output of damage! I have the damage separated out as well so that I can, in the future, add the option for an enemy to resist the specific damage types, and therefore half the amount dealt.
For this week, that is all I have! However, as noted, I have plans for lots of expansion already and I want to make this UI more customizable as well, so a user could create custom weapons on the fly. Thanks for the read!
[ad_2]
Source link