Check progress of the user, and send him messages about it. */
| 75 | |
| 76 | /** Check progress of the user, and send him messages about it. */ |
| 77 | void Micropolis::sendMessages() |
| 78 | { |
| 79 | short PowerPop; |
| 80 | float TM; |
| 81 | |
| 82 | // Running a scenario, and waiting it to 'end' so we can give a score |
| 83 | if (scenario > SC_NONE && scoreType > SC_NONE && scoreWait > 0) { |
| 84 | scoreWait--; |
| 85 | if (scoreWait == 0) { |
| 86 | doScenarioScore(scoreType); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | checkGrowth(); |
| 91 | |
| 92 | totalZonePop = resZonePop + comZonePop + indZonePop; |
| 93 | PowerPop = nuclearPowerPop + coalPowerPop; |
| 94 | |
| 95 | switch (cityTime & 63) { |
| 96 | |
| 97 | case 1: |
| 98 | if (totalZonePop / 4 >= resZonePop) { |
| 99 | sendMessage(MESSAGE_NEED_MORE_RESIDENTIAL); |
| 100 | } |
| 101 | break; |
| 102 | |
| 103 | case 5: |
| 104 | if (totalZonePop / 8 >= comZonePop) { |
| 105 | sendMessage(MESSAGE_NEED_MORE_COMMERCIAL); |
| 106 | } |
| 107 | break; |
| 108 | |
| 109 | case 10: |
| 110 | if (totalZonePop / 8 >= indZonePop) { |
| 111 | sendMessage(MESSAGE_NEED_MORE_INDUSTRIAL); |
| 112 | } |
| 113 | break; |
| 114 | |
| 115 | case 14: |
| 116 | if (totalZonePop > 10 && totalZonePop * 2 > roadTotal) { |
| 117 | sendMessage(MESSAGE_NEED_MORE_ROADS); |
| 118 | } |
| 119 | break; |
| 120 | |
| 121 | case 18: |
| 122 | if (totalZonePop > 50 && totalZonePop > railTotal) { |
| 123 | sendMessage(MESSAGE_NEED_MORE_RAILS); |
| 124 | } |
| 125 | break; |
| 126 | |
| 127 | case 22: |
| 128 | if (totalZonePop > 10 && PowerPop == 0) { |
| 129 | sendMessage(MESSAGE_NEED_ELECTRICITY); |
| 130 | } |
| 131 | break; |
| 132 | |
| 133 | case 26: |
| 134 | if (resPop > 500 && stadiumPop == 0) { |
nothing calls this directly
no outgoing calls
no test coverage detected