#include <iostream>char player_name[40];////////////////////////////////////////////////////////////////////////////// Armorervoid armorer_dialog(std::string player_text) { // Have sword? if ((player_text.find("sword") != std::string::npos) || (player_text.find("swords") != std::string::npos)) { std::cout << "\n\"Yes, in fact, I have offe right here...\"\n" << std::endl; } // Have shield? else if ((player_text.find("shield") != std::string::npos) || (player_text.find("shields") != std::string::npos)) { std::cout << "\n\"I think I have offe lying around.\"\n" << std::endl; } // Have armor? else if (player_text.find("armor") != std::string::npos) { std::cout << "\n\"No, I sell food products. Dumbass...\" *rolls eyes*\n" << std::endl; } else { std::cout << "*sigh* Times are tough." << std::endl; } }////////////////////////////////////////////////////////////////////////////int main(int, char **) { // Gets Player's Name std::cout << "Name: "; std::cin >> player_name; std::cout << "\n" << std::endl; std::cin.ignore(1, '\n'); // Introduces Player's Surroundings std::cout << "The sun shines through the dense woods, making its way offto a small "; std::cout << "village \nof where you are. You stand near an armorer who greets you warmly.\n" << std::endl; // Player Input char buffer[512]; std::cout << player_name << " -> "; std::cin.getline(buffer, sizeof(buffer)); armorer_dialog(buffer); return 0;}/////////////////////////////////////////////////////////////////////////////
[edited by - philvaira on March 20, 2004 2:46:11 AM]
[edited by - philvaira on March 20, 2004 2:47:02 AM]