Reply to Re: Stat Reliant Stats
If you don't have an account, just leave the password field blank.
For these kind of things I use semi-functions.
Make a global &argument1 and you can set, for example:
&argument1 = 1;
external("stats","add_agility");
then in stats.c,
void add_agility( void )
{
int &crap = &argument1;
//Say we want to raise Dink's defense for every two points of agility
//this standing for his ability to better evade incoming blows
//Silly, I know, but for example's sake
&agility += &crap;
&crap = &agility;
&crap / 2;
&defense = &crap;
}
Of course this doesn't work.
What if there are other defensive bonuses active, not based on agility (like Dink has equipped a shield, or some magical shielding charm). What if there's another stat, like Luck, that improves defense as well?
Globals are usually my friend: simply count the amount of points invested in Agility, and see for each point if it should raise the defense (and maybe other stats) as well.
Make a global &argument1 and you can set, for example:
&argument1 = 1;
external("stats","add_agility");
then in stats.c,
void add_agility( void )
{
int &crap = &argument1;
//Say we want to raise Dink's defense for every two points of agility
//this standing for his ability to better evade incoming blows
//Silly, I know, but for example's sake
&agility += &crap;
&crap = &agility;
&crap / 2;
&defense = &crap;
}
Of course this doesn't work.
What if there are other defensive bonuses active, not based on agility (like Dink has equipped a shield, or some magical shielding charm). What if there's another stat, like Luck, that improves defense as well?
Globals are usually my friend: simply count the amount of points invested in Agility, and see for each point if it should raise the defense (and maybe other stats) as well.