Question about SDG's/SPG's

01/22/2011 02:12 { Angelius }#1
ok so i was recalculating the player attack/Defense today an i stopped at one point an im wondering .


if i had 10k attack points 15% of that attack well be added once i use an SDG. my attack gose up to 11,500.
ok cool but the Question is ...
when i use another SDG the next 15% that well be added is it gonna be added based on the main attack which is 10k or well be added based on the current attack which is 11,500 ?

next

im using something like this to fix the gems Extra attack .

PHP Code:
                    Player.maxattack Player.BaseMaxAttack;
                    
Player.minattack Player.BaseMinAttack;
                    for (
byte SDG 0SDG Player.SDGSDG++)
                    {
                        
Player.maxattack += Convert.ToUInt16(Player.maxattack 6.67);
                        
Player.minattack += Convert.ToUInt16(Player.minattack 6.67);
                    }
                    for (
byte RDG 0RDG Player.RDGRDG++)
                    {
                        
Player.maxattack += Convert.ToUInt16(Player.maxattack 10.0);
                        
Player.minattack += Convert.ToUInt16(Player.minattack 10.0);
                    }
                    for (
byte NDG 0NDG Player.NDGNDG++)
                    {
                        
Player.maxattack += Convert.ToUInt16(Player.maxattack 20.0);
                        
Player.minattack += Convert.ToUInt16(Player.minattack 20.0);
                    } 
its gonna be recalculating the gems attack everytime the player replace/Equip/take of an item

Looping .... Dose it slow shit out ??
and if the looping CAN slow the server work is there a better way to control that .cus if not and looping it is fine than im gonna use the same thing to control the SPG/SRG/etc .
01/22/2011 03:05 Syst3m_W1z4rd#2
Put it inside your damage calculation, so that it will be calculated only when you attack, but also instead doing for loops, you can easily use cases for this.

uint Attack = 0;
switch (Gem)
{
case NormalDragonGem:
{
Attack = Damage / 100 * 5;
}
case RefinedDragonGem:
{
Attack = Damage / 100 * 10;
}
case SuperDragonGem:
{
Attack = Damage / 100 * 15;
}
}

Char.FinalDamage += Attack;

//Send attacking here
01/22/2011 03:08 pro4never#3
It's very simple... you calculate all your base attack (min/max attack on all items) and then you calculate your dragon/nix percentage.

You then take your min/attack overall and use the dragon pcts to boost it.