This was the easy part. When a weapon is ready to fire, it adds a shot object to the combat context, giving it a direction and velocity. The shot then receives regular time ticks like everything else. Once it arrives at the position it was aimed at, it looks up what tile on the target ship it has hit, if any, and tells the tile that it's just been hit.
Any 2D game about something three-dimensional ends up having to fudge things a bit. In this case, shots don't hit the first thing they move across, but are rather assumed to intersect the "plane" of the target airship at the point where they were aimed at. So for shots, it's as if all ships were cardboard cutouts that can only be hit from the sides. Logically coherent? Not really, but it works, and I think it's pretty understandable.
Once a shot hits a tile, damage is first absorbed by armour. There are two kinds of damage: blast and penetrating. Roughly, steel armour is better at absorbing the former and wooden is better at the latter. After absorption, damage is then applied to the armour plate's hit points.
If there's any damage left (or indeed if the armour plate has been destroyed and didn't absorb any), it's applied to the underlying module. Obviously, once a module hits 0 HP, it stops working, but even partial damage can reduce effectiveness. For example, weapons take longer to reload.
Module types also define a flammability amount, which is where fire comes in.
Fire and explosions
Once a module has taken enough damage, it may catch fire. Fire further degrades its hit points, and also slowly increases in intensity. Moreover, it has a small chance each time unit of jumping over to adjacent modules. Fire can be put out with water, which essentially "damages" the fire.
Both firefighting and repair are tied into the jobs system in the same way as fetching coal is: modules request a particular resource with a particular priority, and crewmen are assigned to fulfill these requests.
Some modules, like ammo stores, can also explode, which does a lot of damage to the surrounding modules as well.
Of course, crew is also affected by this: damage from shots, explosions and fire has a chance of reducing a crewman's hit points, which start at 5. They are up and working at 3-5 HP, albeit more slowly if injured. At 1-2 HP they are immobile and need to be carried to sickbay. Somewhat weirdly, the jobs for carrying people to sickbay are modeled as the sickbay requesting the "resource" of injured people - it's simpler to code that way.
Modules' hit points can go down further than zero. Once a module hits -100%, it disintegrates, which means ships can be torn apart and reduced to nothingness given enough damage. However, removing modules from a ship is a tricky business: what if the module is in the middle of the ship, or only one that makes moving from one part of the ship to the other possible? The way the game deals with this will be dealt with in the next installment: crashing, collision and breaking apart.