%damage = %this.directDamage * 0.5 - %this.directDamage; %damageType = $DamageType::Direct; if(%this.directDamageType) { %damageType = %this.directDamageType; } %col.damage(%obj,%pos,%damage,%damageType);
The multiplier just doesn't seem to work. It works fine with anything above 1.Code: [Select] %damage = %this.directDamage * 0.5 - %this.directDamage; %damageType = $DamageType::Direct; if(%this.directDamageType) { %damageType = %this.directDamageType; } %col.damage(%obj,%pos,%damage,%damageType);
why do you need this if the value is always negative.why are you trying to deal negative damage.please explain.if you are trying to heal a person %col.addHealth(positivevalue);
yeah math error there%var*0.5 - %var will be equal to -0.5*%var
-%this.directDamage*0.5
Basically what it's doing is justCode: [Select] -%this.directDamage*0.5. This is because the code doesn't overwrite the damage that is being done i.e. it overlaps it. So using this method I would need to subtract half of the direct damage on impact.
IF you are trying to add 0.5 damage, then the damage will be 0.5.
The former.
if you are trying to add 0.5 ontop of the regular damage, then the multiplier isn't 0.5, it's 1.5.
so it's %damage *= 1.5;
%dmg = %col.getDamageLevel();%pow = %this.directDamage;%sub = 0.5 * %pow;%col.setDamageLevel(%dmg - %sub);
so what you're doing is taking the current damage, then subtracting half the damage from a weapon?what. you don't/ shouldn't be doing that.just do %dmg = %this.directDamage * 0.5;%col.damage(%obj,%pos,%dmg ,%damageType);