Hmm. Let's say you have some sort of mirror armor, that almost completely reflects lasers, does alright against projectiles, but is melted by fireballs and completely shattered by missiles.
You also have a hardened armor that melts under lasers, is very resistant to projectiles, but melts under fireballs and is fairly damaged by missiles.
#Armor Type
$Name: Happy Armor factors
$Type: multiplicative
;;This means that all values in the table will be the product of the damage times the number entered
;;Lasers Projectiles Fireballs Missiles
$0: (0.2 1.0 1.3 1.0 ) ;;Mirror armor
$1: (1.2 0.5 1.5 1.0 ) ;;Hardened armor
#End
#Armor Type
$Name: Happy Armor bonuses
$Type: additive
;;This means that all values in the table will be added to the damage entered
;;Lasers Projectiles Fireballs Missiles
$0: (-20.0 0.0 0.0 10.0 ) ;;Mirror armor
$1: (0.0 0.0 0.0 0.0 ) ;;Hardened armor
#End
Weapons.tbl:
$Name: Laser
...
$Armor Damage Index: 0 ;;Use the Lasers column
...
$Name: Projectile
...
$Armor Damage Index: 1
...
$Name: Fireball
...
$Armor Damage Index: 2
...
$Name: Missile
...
$Armor Damage Index: 3
...
$Name: Tood-o-Love
...
$Armor Damage Index: 4 ;;This will mean that damage will be applied directly to any ships who do not have armor that includes this column.
;;Since no ships in my example do, every time the Todd-o-Love hits something it will do exactly the amount specified in the table,
;;aside from any damage scaled by "Huge" flags and such
;;(which can be disabled with the new ships.tbl flag I implemented; that's in this build too)
...
Ships.tbl
$Name: MirrorShip
...
$Armor Type: Happy Armor factors ;;Factor things first
$Armor Type: Happy Armor bonuses ;;Then add the bonuses (so bonuses will not be scaled)
$Armor Index: 0 ;;Use the mirror armor row
$Name: HardenedShip
...
$Armor Type: Happy Armor factors ;;Factor things first
$Armor Type: Happy Armor bonuses ;;Then add the bonuses (so bonuses will not be scaled)
$Armor Index: 1 ;;Use the hardened armor row
I'm open to suggestions on how to make it less convoluted to use multiple damage types - I could allow multiple $Types in an armor, each followed by a table. Or, I could allow you to group armors and specify the groups in ships.tbl. (I like the first better, seems to make more sense to me)
I could also make armor indexes named, so instead of 0 and one you might put:
$Mirror: (table row)
$Hardened: (table row)
$Armor Type: Happy Armor factors
$Armor Type: Happy Armor bonuses
$Armor Index: Mirror
Hmm...