Diff,
release build,
debug build,
test mod.
This is a reimplementation of the old "surface shields" feature I wrote back in the day. This code is
not currently in the CVS repository. This allows a ship without a shield mesh to have a shield. Shots that strike the hull of a surface-shielded ship will simply disappear and do damage to its shields rather than the hull, as though they struck a shield mesh instead of the hull.
Note that there is no graphical impact effect for surface shields. Some types of shots (laserish weapons, like the Subach HL-7) will simply disappear when striking a surface shield, while others (missiles, beams) will make an explosion effect.
This patch also gives an implicit surface shield to ships with a normal shield (i.e. the kind with a shield mesh). This is to work around a very mysterious bug in which shots will sometimes pass right through the shield mesh when they shouldn't (because the shield is up and should have absorbed it). Shots that pass through the shield mesh like this will strike the surface shield instead of damaging the hull (unless the shield is depleted, obviously).
The implicit surface shield could conceivably pose a compatibility issue because this means you can't fly through a shield mesh and fire at a ship's hull from inside its own shield. Your shots will then strike the implicit surface shield instead of its hull. In order for this to matter, you would have to have a shield mesh big enough that you can fit a fighter inside of it. As far as I know, nobody has ever done this. For this reason, I do not believe this is a problem. If the purity police demand it, though, the implicit surface shield can be removed.
To test surface shields, load up the included test mod in one of the test builds. In the tech room mission simulator, run the single mission "Surface Shield Test". You'll be put in a Bakha (because I like Bakhas
) with four different ships that will just sit still. They are a Cain (modified to have a surface shield), a Rakshasa (with no shield), a Seraphim (with a normal shield), and a Mjolnir (which is specified to have shields in the table but has no shield mesh -- a
oversight that causes it to have no shield in the retail game, and it does not have a surface shield only because the "surface shields" flag is not present in ships.tbl). Use the change primary weapon type cheat (type "
www.freespace2.com" while in game to enable cheats, then hit 0 while holding down ~ repeatedly to change your primary weapon) to change your primary to SRed, which I've changed to be relatively weak and not shield-piercing. You can use it to test how the surface shields work with non-shield-piercing beams. Beams that do pierce shields, like LRed, are not affected by surface shields at all, and you can test them this way too.
Please post comments. If everyone approves, I will commit this to CVS.
Added to the website.//redmenace