FIX BEAMLAZER PLOX! - Page 2

FIX BEAMLAZER PLOX!

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Archangel of Death
Posts: 854
Joined: 28 Jan 2005, 18:15

Re: FIX BEAMLAZER PLOX!

Post by Archangel of Death »

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.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: FIX BEAMLAZER PLOX!

Post by lurker »

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.
This function is only used by beam weapons, due to their raytracing nature.

Though someone does need to make sure it doesn't screw up lightning.
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Re: FIX BEAMLAZER PLOX!

Post by ILMTitan »

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).

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;
}
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?
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: FIX BEAMLAZER PLOX!

Post by lurker »

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.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: FIX BEAMLAZER PLOX!

Post by KDR_11k »

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.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: FIX BEAMLAZER PLOX!

Post by Tobi »

I committed the first thing but when you figured out what actually the correct code is you can commit that :P
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: FIX BEAMLAZER PLOX!

Post by KDR_11k »

I fixed it, now a ray weapon can supply a damage multiplier. Theoretically this could later be extended into special anti-shield damage.
Post Reply

Return to “Engine”