FIX BEAMLAZER PLOX!
Moderator: Moderators
-
- Posts: 854
- Joined: 28 Jan 2005, 18:15
Re: FIX BEAMLAZER PLOX!
What else is salvoSize used for though? If it is also used for bursts and/or multiple projectile weapons that won't work, because the damage for those isn't divided out. Well... not anything one conditional t check weapon type wouldn't be able to fix.
Re: FIX BEAMLAZER PLOX!
This function is only used by beam weapons, due to their raytracing nature.Archangel of Death wrote:What else is salvoSize used for though? If it is also used for bursts and/or multiple projectile weapons that won't work, because the damage for those isn't divided out. Well... not anything one conditional t check weapon type wouldn't be able to fix.
Though someone does need to make sure it doesn't screw up lightning.
Re: FIX BEAMLAZER PLOX!
CPlasmaRepulser::BeamIntercepted(CWeapon *) only appears to interact with CBeamLaser and CLightingCannon. However, CLightingCannon can have a salvoSize, which does not affect the damage the same way it does on CBeamLaser (or at all).
It should look something like that. I may commit this soon.
Edit: What do I need to do to test to make sure that this does infact fix the problem? AKA, what units do I need to use to test this?
Code: Select all
bool CPlasmaRepulser::BeamIntercepted(CWeapon* emitter)
{
if (weaponDef->shieldPower > 0) {
if (CBeamLaser* laserEmitter = dynamic_cast<CBeamLaser*>(emitter)){
curPower -= emitter->weaponDef->damages[0] * laserEmitter->damageMul;
} else {
curPower -= emitter->weaponDef->damages[0];
}
}
return weaponDef->shieldRepulser;
}
Edit: What do I need to do to test to make sure that this does infact fix the problem? AKA, what units do I need to use to test this?
Re: FIX BEAMLAZER PLOX!
As far as beamlasers, you can grab evolution, wait for the shield to charge, and .give a couple theavyraidtank s. It should take longer to drain the outer shield than to kill the com from point blank range.
Edit: I would have tested it but that code doesn't compile and I don't understand how to manipulate classes that way.
Edit: I would have tested it but that code doesn't compile and I don't understand how to manipulate classes that way.
Re: FIX BEAMLAZER PLOX!
Also a beamlaser can do its full damage with every shot if beamburst is enabled. A cleaner fix IMO is to just pass the projectile's damage to the shield so the damage is calculated in the weapon's code instead of the shield's.
Re: FIX BEAMLAZER PLOX!
I committed the first thing but when you figured out what actually the correct code is you can commit that 

Re: FIX BEAMLAZER PLOX!
I fixed it, now a ray weapon can supply a damage multiplier. Theoretically this could later be extended into special anti-shield damage.