Comment 7 for bug 894916

Revision history for this message
Marshall (m-edward) wrote :

Perhaps the modder could specify a new flag, Risk=integer with default = 0

if (FreePowerNow - PowerSurplus) < 0 then
    //below surplus (possibly even in low power) so critical!
    pick cheapest available power plant that brings power back online (ignore risk)
    if no such power plant then pick most cost effective power plant (ignore risk)
else
    //at or above surplus so not critical
    consider which buildings we are planning to build, calculate how much power we will need, consider total current power Risk, random number to determine max risk willing to take (flag for modder to control this per difficulty level?), pick highest-risk power plant that the random number affords (this of course assumes that higher risk means more cost effective power)
endif

Or, to avoid the need for the Risk= flag, you could calculate risk internally based on death weapon damage and building HP.