I split damage into structural damage against ships and the number of fighters a ship can destroy.
I suggest to base blockade etc on the ability of causing structural damage to ships. So flak or interceptors would not be able to blockade. Also if your ship has such a high shield value .
We are going for this: "if it can't do structural damage to your ship, it is not able to blockade it". Note that not everything which is able to do damage is necessarily able to blockade (e.g. planetary defenses).
Before there were the Ship::IsArmed and Fleet::HasArmedShips, which returned true if there were (hangars or direct weapons) with more than zero damage. I keep this as a notion: yes, this might be dangerous (sometimes). This is a simple best effort and might be wrong.
I introduce CanDamageShips and CanDestroyFighters which only return true if they are currently able to actually do damage (so CanDamageShips actually takes a target_shields argument). So at least CanDamageShips has to be true in order to be effectively Obstructive.
While it also follows the simple rule, stealth and detection is orthogonal in implementation.
Old uses of Ship::IsArmed
- CombatSystem::ObjectCanAttack, needs both types of dameg -> fine
- As alternative to HasFighters in FleetWnd::AggressionForFleet to make newly built ships Obstructive -> CanDamageShips
- MapWnd: Display Armed/unarmed ships in map fleet statistics popup (top row) -> fine
- To determine if to show amount structural ship damage and fighter destruction of a ship -> any type of damage is fine (or could be split)
- Empire: Decision if to include newly built ship in combat fleet (alternative to HasFighters, CanHaveTroops or CanBombard) -> fine
- Fleet::GenerateFleetName for new fleets (Fleet::IsCombatShip, alternative to HasFighters, CanHaveTroops or CanBombard)) -> fine
- Effects: deciding default aggression for fleets created by CreateNewShip effect -> fine
- Effects:keep aggression for armed fleets updated by SetOwner effect -> fine
- Effects:keep aggression for armed fleets if having to create new fleet in MoveTo effect -> fine
- Effects:keep aggression for armed fleets if having to create new fleet in MoveTowards effec -> fine
- used in python (?)
- Prevent unarmed monsters from starting combat -> CanDamageShips (or base this rather on monster aggressiveness which also can be scripted)
- Prevent colonization -> CanDamageShips
- Prevent monsters from leaving -> CanDamageShips
- Block enemy Supply propagation (Supply.cpp) -> CanDamageShips
- Block enemy Supply propagation (Empire::UpdateSupplyUnobstructedSystems) -> CanDamageShips
- Fleet::BlockadedAtSystem -> CanDamageShips
- As alternative to HasFighterShips for deciding the FleetHeadIcons -> this could be OK? maybe its more concise to also use CanDamageShips -> CanDamageShips
- To determine if to show amount structural ship damage of a fleet -> CanDamageShips (could be merged with below)
- To determine if to show amount of fighter destruction of a fleet -> CanDestroyFighters (could be merged with above)
- Empire::CheckProductionProgress - Decide aggression for newly built ships -> any kind of damage should be ok
- ObjectListWnd: Filtering in object list window -> fine, probably add CanDamageShips condition.
- increase stability if armed ships in system for terror suppression policy -> in principle the bonus probably should only come from ships which can target planets(?), if we say the suppression comes from the military people this should actually include troop ships, fine for the moment
- prevent monster_fleets from spawning in systems with armed ships or monsters -> ok
- only apply species weapon traits for SR_WEAPON_ for armed ships -> any type of damage is good
- only apply species weapon traits for FT_HANGAR_ for armed ships -> any type of damage is good
- increase stealth of unarmed ships with krill spawner -> probably also support military craft should not get that stealth bonus, so fine
- empire statistics: armed monsters, armed battleships -> fine, could add CanDamageShips condition
edit1: update after deciding to go for the "obstruction simple rule"