|
-
September 10th, 2008, 11:54 PM
#1
Multiplying Values in a STRUCT
I find Structs a little intimidating, and I am unsure how to approach this problem.
I have a Struct of ints called StatisticsValue
it hold stuff like
int Hitpoints
int MagicPoints
int Strength....etc
I have a Spell and spells affect 1 or more values in the StatisticsValue
this gathers them
StatisticsValue statEffect = spell.TargetEffectValue;
but I need to multiply those statEffects by a modifier and doing it directly doesn't work.
int modifiedEffect = Math.Abs(statEffect * ARCmodifier);
My question is how do I multiply all of the possible values the Spell is effecting by the modifer int. And how do I know it doesn't modify all of the values in StatisticsValue???
for instance a spell might alter Strength and Hitpoints, but ignore everything else.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|