The Dink Network

Reply to Re: Stat Reliant Stats

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
December 30th 2005, 06:44 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
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.