// ****************************************************************************
//
// Logic 90: Game-specific functions
//
// You should use this logic to perform any game specific functions, such as
// counting down timers, etc and processing player input related to the game
// (such as examining/using inventory items) and any other things that are
// required in several rooms that you don't want to duplicate in each room.
//
// This logic is called from logic 0, on every cycle.
// If you like, you could only make it called only when disable_game_functions
// is not set.
//
// Sierra did not use a separate logic for all this - they just did it all
// from logic 0. I find it is neater this way, as you can keep your game
// specific processing separate from other system-related things (although
// these may require some modification for your game). Also, this makes logic 0
// easier to manage.
//
// ****************************************************************************

#include "defines.txt"

// put all non-input-reponse game functions here

if (input_recieved &&
    unknown_word_no == 0 &&
    !input_parsed) {

// put various input responses here
  
  if (said("die")) {     
        print("You're too young to die!");
  }

  if (said("look","floor")) {     
        print("It's still there. You think. You stamp on it just to make sure.");
  }

  if (said("sleep")) {     
        print("Wouldn't that be a little fatuous?");
  }

if ((said("draw","circle") ||
     said("draw","magic","circle") ||
     said("draw","circle","circle") ||
     said("draw","magic","circle","circle") ||
     said("draw","circle","crayon") ||
     said("draw","magic","circle","crayon") ||
     said("draw","magic","circle","circle","crayon"))) {
     if(has("Crayon")) {
      print("Nah, this place won't do. Magic circles work best in dark, damp places.");
     }
     else {
      print("You need some chalk or something to do that.");
     }
}

  if ((said("cast","viogra") ||
       said("cast","viogra","spell"))) {  
    if (has("Viogra spell")) {
      print("The Viogra spell has to be cast on something.");
    }
    else {
      print("How do you know about the Viogra spell? Have you played this game before?");
    }
  }
  
  if ((said("viogra","anyword") ||
       said("cast","viogra","anyword") ||
       said("cast","viogra","magic","anyword"))) {  
    if (has("Viogra spell")) {
      print("The Viogra spell only works on animals.");
    }
    else {
      print("How do you know about the Viogra spell? Have you played this game before?");
    }
  }

  if (said("look", "skull")) {  
    if (has("Skull")) {
      show.obj(230);
    }
    else {
      if(has("Skull powder")) {
        show.obj(234);
      }
      else {
      print("You don't have it.");
      }
    }
  }

  if (said("look", "fish")) {  
    if (has("Dead fish")) {
      show.obj(235);
    }
    else {
      if(has("Bloody fish")) {
        show.obj(236);
      }
      else {
      print("You don't have it.");
      }
    }
  }

  if ((said("cut", "fish") ||  
       said("open", "fish") ||
       said("cut", "open", "fish") ||
       said("cut", "fish", "shard") ||
       said("open", "fish", "shard") ||
       said("cut", "open", "fish", "shard"))) {
    if (has("Dead fish")) {
      print("Just because you haven't victimised it enough already, you cut open the fish with your metal shard. It bleeds quite a lot.");
      get("Bloody fish");
      drop("Dead fish");
    }
    else {
      print("Don't be nasty.");
    }
  }

  if (said("look", "crystals")) {  
    if (has("Glowing crystals")) {
      show.obj(232);
    }
    else {
      print("You don't have it.");
    }
  }

  if (said("look", "gun")) {  
    if (has("Shotgun")) {
      show.obj(231);
    }
    else {
      print("You don't have it.");
    }
  }

  if (said("look", "metal")) {  
    if (has("Metal shard")) {
      show.obj(229);
    }
    else {
      if(has("Bloody shard")) {
       show.obj(233);
      }
      else {
      print("You don't have it.");
      }
    }
  }

  if (said("look", "rock")) {  
    if (has("Rock")) {
      show.obj(227);
    }
    else {
      print("You don't have it.");
    }
  }

  if (said("look", "blood")) {  
    if (has("Blood")) {
      show.obj(226);
    }
    else {
      if(has("Bloody shard")) {
       show.obj(233);
      }
      else {
      print("You don't have it.");
      }
    }
  }

  if (said("look", "candles")) {  
    if (has("Candles")) {
      show.obj(225);
    }
    else {
      print("You don't have it.");
    }
  }

  if ((said("look", "salt") ||  
       said("look","salt","salt"))) {
    if (has("Salt")) {
      show.obj(224);
    }
    else {
      print("You don't have it.");
    }
  }

  if (said("look", "knife")) {  
    if (has("Kitchen knife")) {
      show.obj(223);
    }
    else {
      print("You don't have it.");
    }
  }

  if (said("look", "crayon")) {  
    if (has("Crayon")) {
      show.obj(222);
    }
    else {
      print("You don't have it.");
    }
  }

  if (said("look", "book")) {  
    if (has("Notebook")) {
      show.obj(221);
    }
    else {
      print("You don't have it.");
    }
  }

  if ((said("look", "viogra") ||  
       said("look","viogra","magic"))) {
    if (has("Viogra spell")) {
      show.obj(228);
    }
    else {
      print("You don't have it.");
    }
  }

  if ((said("look", "fissop") ||  
       said("look","fissop","magic"))) {
    if (has("Fissop spell")) {
      show.obj(220);
    }
    else {
      print("You don't have it.");
    }
  }
  
  if ((said("look", "anyword") ||
       said("look", "anyword", "anyword"))) {
    print("I don't see anything like that.");
  }
  
  if ((said("attack", "anyword") ||
       said("attack", "anyword", "anyword"))) {
    print("Violence never solved anything.");
  }

  if ((said("jump") ||
       said("jump", "anyword"))) {
    print("Sorcerors are men of words, not action.");
  }

  if ((said("get", "anyword") ||
       said("get", "anyword", "anyword"))) {
    print("You can't get that here!");
  }
  
  if ((said("use", "anyword") ||
       said("use", "anyword", "anyword"))) {
    print("Could you just be a little bit more specific?");
  }

  if ((said("magic", "fissop") ||
       said("fissop"))) {
    print("There's already enough light around here.");
  }

  if ((said("use", "magic") ||
       said("magic", "magic") ||
       said("magic", "anyword"))) {
    print("No, magic doesn't work like that. A spell in its most simplistic form can be a single word of power.");
    print("When you have such a word, just type <SPELL> <OBJECT> or CAST <SPELL>.");
    print("Of course, some spells require lengthy rituals and page upon page of eldritch dialogue. Magic is a fickle mistress.");
  }
}

return();