2022-06-18 00:05:30 -05:00
|
|
|
void initializeNewGame() {
|
|
|
|
sGameState = STATE_TURN_MENU;
|
|
|
|
pMoney = 2000;
|
|
|
|
pLoanAmount = 5000;
|
|
|
|
pSavingsAmount = 0;
|
|
|
|
pLocation = LOC_BRONX;
|
|
|
|
pGuns = 0;
|
|
|
|
pCapacity = 100;
|
|
|
|
pHealth = 50;
|
|
|
|
|
|
|
|
for (int i = 0; i < 6; i++) {
|
|
|
|
pInventory[i] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
sCurrentDay = 0;
|
|
|
|
incrementDay(); // start on day 1
|
|
|
|
|
|
|
|
sRandomEvent = 0; // no event on first day
|
|
|
|
}
|
|
|
|
|
|
|
|
void incrementDay() {
|
|
|
|
sCurrentDay++;
|
|
|
|
|
|
|
|
// TODO: check for game over
|
|
|
|
|
|
|
|
// generate new drug prices
|
2022-06-18 13:20:04 -05:00
|
|
|
sDrugPrices[DRUG_COCAINE] = random(12001) + 16000;
|
|
|
|
sDrugPrices[DRUG_HEROINE] = random(7001) + 5000;
|
|
|
|
sDrugPrices[DRUG_ACID] = (random(35) + 10) * 100;
|
|
|
|
sDrugPrices[DRUG_WEED] = (random(43) + 33) * 10;
|
|
|
|
sDrugPrices[DRUG_SPEED] = (random(16) + 7) * 10;
|
|
|
|
sDrugPrices[DRUG_LUDES] = (random(5) + 1) * 10;
|
2022-06-18 00:05:30 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void handleMenuAction() {
|
|
|
|
screenInitialized = false;
|
|
|
|
switch (sGameState) {
|
|
|
|
case STATE_TITLE:
|
|
|
|
switch (menuSelected) {
|
|
|
|
case 0: // new game
|
|
|
|
initializeNewGame();
|
|
|
|
break;
|
|
|
|
// TODO: continue/load saved
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case STATE_TURN_MENU:
|
|
|
|
switch (menuSelected) {
|
|
|
|
case 0: // trenchcoat
|
|
|
|
sGameState = STATE_INVENTORY;
|
|
|
|
break;
|
|
|
|
case 1: // buy drugs
|
2022-06-18 13:20:04 -05:00
|
|
|
sGameState = STATE_BUY_MENU;
|
|
|
|
break;
|
2022-06-18 00:05:30 -05:00
|
|
|
case 2: // sell drugs
|
2022-06-18 13:20:04 -05:00
|
|
|
sGameState = STATE_SELL_MENU;
|
|
|
|
break;
|
2022-06-18 00:05:30 -05:00
|
|
|
case 3: // jet
|
2022-06-18 13:20:04 -05:00
|
|
|
sGameState = STATE_JET_MENU;
|
|
|
|
break;
|
2022-06-18 00:05:30 -05:00
|
|
|
case 4: // loan shark
|
2022-06-18 13:20:04 -05:00
|
|
|
sGameState = STATE_SHARK_MENU;
|
|
|
|
break;
|
2022-06-18 00:05:30 -05:00
|
|
|
case 5: // bank
|
2022-06-18 13:20:04 -05:00
|
|
|
sGameState = STATE_BANK_MENU;
|
2022-06-18 00:05:30 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case STATE_JET_MENU:
|
|
|
|
case STATE_BUY_MENU:
|
|
|
|
case STATE_SELL_MENU:
|
|
|
|
case STATE_SHARK_MENU:
|
|
|
|
case STATE_BANK_MENU:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|