This calls for a random() function too: not only will be the British morale hit, but it will be randomly reduced by a value between one and three. Hard!
Here's the sample:
[*] A new function: inc_morale_shift() is used to increment / decrement the morale level depending the value given. We're decrementing, hence multiplying by -1 in the code.
[*] Another new function: debug() can be used to pop up a message but only if the lua file specifies it is used in debug mode, like here.
See the Brits with their morale down by 1 in the snippet there. Lucky guys, could have been worse.
Looking at this, maybe the Libyans should receive a little boost for their morale, for their achievement, too. That would spiff up the battle just nicely!




