The Dink Network

damage

January 18th 2006, 03:21 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
what is the formula the game uses to calculate the randomized damage reguarding the strength of something. say a fireball has strength of 10, doesn't always hit worth 10 pts of damage.
January 18th 2006, 04:00 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
It's a random number between 1/2 * &str and &str, where &str is the strenght.

int &damage;
int &crap;
&crap = sp_strength(&sprite, -1);
//use &strength if &sprite = 1
&crap / 2;
&damage = random(&crap, &crap);

Would be the DinkC code.

LATE ADDITION: In earlier versions of Dink (1.06 and 1.07) you can't use &str as a variable, becuase it would conflict with &strength. Just to warn you for the consequences.
January 19th 2006, 11:43 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
That's also the reason why my new DMODs will not be playable for 1.06/1.07. I love the new possibilities in terms of variable names.