There are many nice shield models on the site. There are various energy shield in other games. But implementing shields is an old problem. The main part of it is how to track soldier's stats when the shield is dropped, picked up etc. Having thought about it for some time, I came up with a solution which doesn't need any soldier stat modifications at all, nor any new types of numbers to track. For me it seems logical enough but maybe it can be perfected further.
This shield requires a new battletype (12?), to communicate the game that the Ammo parameter isn't used for shooting but for tracking shield's hitpoints.
Mechanics: if an unit is hit, shield routine kicks in. The game prepares a list of shields the unit has. The shields are calculated one after next. If all shields have been calculated, the remaining damage is returned (and hits the unit as normal).
New ruleset Parametres:
shieldType: (1..3)
#This line determines how the shield behaves.
#1: Osmotic: Good for simulating energy shields. Hits reduce the shield value until it is spent, but some damage may seep through. The game checks Resistance parameter of the shield item regarding to the damage that has been dealt. The % of the damage, equal to % resistance to that 'element' reduces shield's HP (ammo); the rest is returned. If the hitpoints run out, the missing number is added to the number returned as well.
#2: Deflection: Good for simulating melee shields and "invulnerable saves". It either stops all damage, or lets all damage through, depending on the dice roll. Again, the Resistance parameter is checked, but this time a percentile dice is rolled. If the rolled number is equal or below the resistance in question, ALL damage goes to shield's HP. Else, ALL damage is returned.
#3. Solid: Good for combat shields, but the shieldDT normally needs to be defined as well. Ignores Shield's Resistances. 10% the damage taken reduces shield's HP (the bullet penetrates the shield & damages it somewhat). The rest is returned.
shieldDT
#"Armor" of a shield. Decreases the initial damage by a number equal to shieldDT times shield's % resistance to that type of attack (shieldDT works less efficiently against attacks it wasn't designed to protect against).
resistances:
-
-
-
#as with an armor, % resistances to damage types. How they affect the unit is determined by the ShieldType.
shieldInventorySlots:
#Inventory slots where the shield needs to be put to work. Ex. you need to grab a Combat Shield in your hand else it's just dead weight. You need to keep force belt on your, well, waist else it won't work. Etc. Else the routine ignores the item.
frontCoef
sideCoef
backCoef
bottomCoef
#Percentage values (100 by default). If the unit is hit from an angle where Coef !=100, the Resistance & shieldDT are reduced accordingly before going further (ex. a combat shield protects from the front fully, from the sides a bit, from the back not at all).
Playing with all these values (and allowing shields to take clips, like firearms, if the modder wants to), would, in my belief, allow to mod in any kind of shield, from a combat shield, to energy shield, to medieval shields and so on, some requiring clips, some not etc.