
It seems to me the monster just uses on_attack_ranged and on_attack_close
And decides to use a missile close in depending only on "prefer_ranged".
In fact, there seem to be no use of "should_attack_ranged", and also the code to determine the use of ranged attack close up is a bit arbitrary :
If prefer_ranged is true, the monster has 3/4th chance to attack ranged at close range.
If it is nil, the monster has 1/4th to do it IF it has a ranged attack available.
That's a bit of a personal opinion, but I would have done things another way :
- should_attack_ranged, would determine if the monster use a ranged attack when at close range.
- prefer_ranged would be checked when determining movement, to see if the monster would rather close in toward the party, or stay at a shoot distance...
- I would have used an integer to determine the prefered range of a monster attack. A monster would always try to stay at given distance for his attack. That would allow for sniper monsters etc.

Maybe I'm wrong but in any case, it raises a question :
Is there any difference in combat whether the monster is on the front or back row ?
I didn't see one, but I might be wrong (and hope I'm wrong, it would be cool to have such a difference)...

[For dsb beginners : power affects the range, damage is obvious, and delta is the value by which power and damage are decreased at each step of flight -- the missiles fall/disappear when power or damage < 0 ]
(adding "power_delta" and "damage_delta" instead of just "delta" to the dsb_shoot function ...)
It would allow :
- to make a missile that loose no damage but goes very far.
- a missile with very low range and high power in any case.
- any other configuration [even a missile that grows in power with range!]
It seems it can be an innocuous change (accepting the last parameter "damage_delta" to be nil, and in that case set it internally to be equal to "power_delta")
EDIT : also, considering wounds zones, is it possible to set a monster to deal multiple wounds ?