$MaxSSBVelocityScale = 9;
package SSBDamagePackage {
function ShapeBase::addVelocity(%this, %velocity) {
if (%this.usesSSBDamage()) {
%velocity = vectorScale(%velocity, %this.getSSBVelocityScale());
}
Parent::addVelocity(%this, %velocity);
}
function ShapeBase::applyImpulse(%this, %origin, %velocity) {
if (%this.usesSSBDamage()) {
%velocity = vectorScale(%velocity, %this.getSSBVelocityScale());
}
Parent::applyImpulse(%this, %origin, %velocity);
}
function ShapeBase::setDamageFlash(%this, %scalar) {
if (!%this.usesSSBDamage()) {
Parent::setDamageFlash(%this, %scalar);
}
}
};
activatePackage("SSBDamagePackage");
function ShapeBase::usesSSBDamage(%this) {
return 1;
}
function ShapeBase::getSSBVelocityScale(%this) {
return 1 + (%this.getDamageLevel() / %this.getDataBlock().maxDamage) * $MaxSSBVelocityScale;
}