void sword_in_stone() { if (psel("THERE IS A SWORD SET IN STONE HERE\n" "\n" "<- DRAW IT#LEAVE IT ->") == 0) { if (player->strength < SWORD_IN_STONE_STR) { draw_board(); pwait("ALAS, YOU ARE NOT STRONG ENOUGH"); } else { give_weapon(WPN_RUNESWORD); stile(player->y, player->x, TL_VOID); stile(player->y - 1, player->x, TL_VOID); stile(player->y - 2, player->x, TL_VOID); draw_board(); pwait("YOU DRAW THE SWORD FROM THE STONE\n" "\n" "THIS IS THE FABLED *RUNESWORD* !!!"); } } return; }
// Render an outlined rectangle. void ClsDC::OutlinedRectangle( LPCRECT pRect, COLORREF crOuter, COLORREF crInner ) { _ASSERT_VALID( m_hDC ); // Create GDI objects. ClsBrush inner( crInner ); ClsPen outer( PS_SOLID, 1, crOuter ); // Select them into the DC. ClsSelector bsel( this, inner ); ClsSelector psel( this, outer ); // Render rectangle. Rectangle( pRect ); }
void idol() { stile(player->y, player->x, TL_IDOL_BASE); if (psel("YOU FIND THE BLOOD-STAINED IDOL\n" "OF A DARK AND NAMELESS GOD\n" "\n" "<- SMASH IT#SACRIFICE ->") == 0) { decorate(player->y, player->x, DEC_BROKEN_IDOL); game->piety += IDOL_SMASH_PIETY + rand() % IDOL_SMASH_PIETY; game->sacrifice -= IDOL_SACRIFICE_PEN; } else { stile(player->y - 3, player->x, TL_IDOL_HEAD_LIT); player->hp--; draw_bars(); draw_board(); pwait("YOU DRAW A SINGLE DROP\n" "OF BLOOD AS TRIBUTE"); game->sacrifice += IDOL_SACRIFICE_GAIN; game->piety -= IDOL_SMASH_PIETY + rand() % IDOL_SMASH_PIETY; if (player->hp <= 0) { draw_board(); pwait("YOU HAVE GIVEN YOUR LIFE!!!"); draw_board(); game_over("YOU SACRIFICED YOURSELF\n" "TO A DARK AND NAMELESS GOD", false); } else if (rand() % MAX(1, game->sacrifice) > IDOL_SACRIFICE_LIMIT) { draw_board(); game->sacrifice -= IDOL_SACRIFICE_LIMIT; draw_board(); switch(rand() % 2) { case 0: pwait("YOU HAVE BEEN REWARDED"); refill_hp(IDOL_HP_REFILL); break; case 1: pwait("YOU HEAR A MOCKING LAUGHTER"); refill_hp(5); player->strength = MAX(1, player->strength - 4 + rand() % 9); player->speed = MAX(1, player->speed - 4 + rand() % 9); break; } } } return; }
void altar() { char line[DEFLEN]; int temp; char * p; stile(player->y, player->x, TL_GR_HL); /* Praying increases piety (hidden from the player); when the player has enough it will cause a beneficial effect. If the player chooses to loot the altar they will lose all piety. */ if (psel("YOU APPROACH THE ALTAR\n" "\n" "<- LOOT IT#PRAY ->") == 0) { stile(player->y - 2, player->x - 3, TL_VOID); stile(player->y - 2, player->x + 3, TL_VOID); stile(player->y - 3, player->x, TL_VOID); stile(player->y - 2, player->x - 1, TL_VOID); stile(player->y - 2, player->x, TL_VOID); stile(player->y - 2, player->x + 1, TL_VOID); draw_board(); give_gold("YOU LOOT THE ALTAR\n\n", 1 + rand() % ALTAR_LOOT_GOLD); game->piety -= ALTAR_LOOT_PENALTY + (rand() % ALTAR_LOOT_PENALTY); if (game->piety < -3000 && rand() % 3 == 0) { draw_board(); pwait("A MIGHTY VOICE BOOMS OUT:\n" "\"THOU HATH DEFILED MY ALTAR\n" " TOO MANY TIMES, MORTAL!\""); draw_board(); if (rand() % 2 == 0) { pwait("YOU ARE STRUCK BY LIGHTNING!"); draw_board(); lightning(player->y - view_y, player->x - view_x); player->hp -= 25 + rand() % 46; if (player->hp <= 0) game_over("YOU DIED FOR YOUR SINS", false); draw_bars(); } else { pwait("YOU FEEL WEAK!"); player->strength = MAX(1, player->strength - 1 - rand() % 3); player->speed = MAX(1, player->speed - 1 - rand() % 3); } } else if (game->piety < -2000 && rand() % 3 == 0) { tremor(5); draw_board(); pwait("YOU HEAR A RUMBLE IN THE DISTANCE"); } else if (game->piety < -1000 && rand() % 3 == 0) { draw_board(); pwait("YOU GET AN UNEASY FEELING"); } } else { stile(player->y - 3, player->x - 1, TL_YDOT); stile(player->y - 3, player->x, TL_YDOT); stile(player->y - 3, player->x + 1, TL_YDOT); // Update board with lit candles draw_board(); strcpy(line, "YOU PRAY AT THE ALTAR"); if (game->piety < 0) game->piety += 500; game->piety += ALTAR_PRAYER_PIETY + (rand() % ALTAR_PRAYER_PIETY); if (game->piety < 0) { strcat(line, "\n\nYOU ARE LEFT WITH A DISAPPROVING\n" "SENSATION OF EMPTINESS"); pwait(line); } else if (rand() % MAX(1, game->piety) > ALTAR_HEAL_PIETY) { game->piety -= ALTAR_HEAL_PIETY; strcat(line, "\n\n YOU ARE EMBRACED BY\n" " A WARM FEELING! "); pwait(line); draw_board(); refill_hp(ALTAR_EMBRACE_HEAL); } else if (rand() % MAX(1, game->piety) > ALTAR_WISDOM_PIETY) { game->piety -= ALTAR_WISDOM_PIETY; temp = (1 + rand() % game->current_floor) * 100; temp += MAX(0, game->current_floor - 7) * 200; // Find end of string for (p = line; *p != '\0'; p++) { } sprintf(p, "\n\nYOU HAVE BEEN ENLIGHTENED!\n\n" "YOU GET %d EXP", temp); pwait(line); draw_board(); give_exp(temp); } else { pwait(line); } } return; }