/
lib/banish/
lib/d/coronos/
lib/d/coronos/w/alena/
lib/d/coronos/w/angel/
lib/d/coronos/w/angel/caves/
lib/d/coronos/w/angel/caves/monst/
lib/d/coronos/w/angel/city/chambers/
lib/d/coronos/w/angel/city/monst/
lib/d/coronos/w/angel/city/obj/
lib/d/coronos/w/angel/city/streets/
lib/d/coronos/w/angel/farms/plains/
lib/d/coronos/w/angel/monst/
lib/d/tempus/
lib/d/tempus/w/angel/
lib/d/tempus/w/kingbill/
lib/d/tempus/w/mirak/
lib/d/tempus/w/mirak/monst/
lib/d/tempus/w/mirak/obj/
lib/d/tempus/w/relgar/planes/baat/
lib/d/tempus/w/sarak/
lib/d/tempus/w/serepion/mon/
lib/d/tempus/w/valrejn/
lib/doc/
lib/doc/domains/
lib/doc/efun/
lib/include/fn_specs/
lib/info/
lib/inherit/base/
lib/log/
lib/log/mailbox/
lib/log/main/
lib/news/
lib/obj/party/
lib/objects/componen/
lib/open/
lib/open/party/
lib/open/paste/
lib/open/spells/
lib/open/valrejn/
lib/players/
lib/players/alena/
lib/players/alena/obj/
lib/players/alena/open/
lib/players/alena/private/
lib/players/angel/
lib/players/angel/obj/
lib/players/ash/
lib/players/biggs/
lib/players/biggs/food/
lib/players/biggs/gobkeep/
lib/players/biggs/mnstr/
lib/players/biggs/town/caves/
lib/players/biggs/town/tower/
lib/players/biggs/wpns/
lib/players/calris/
lib/players/deathurg/
lib/players/deathurg/open/
lib/players/deathurg/private/thief/
lib/players/dogberry/
lib/players/dogberry/library/
lib/players/dogberry/open/
lib/players/epsilon/
lib/players/epsilon/private/
lib/players/farewell/
lib/players/hippo/
lib/players/hippo/open/
lib/players/hippo/tools/
lib/players/jimpa/
lib/players/josh/
lib/players/josh/room/
lib/players/josh/room/mage/dungeon/
lib/players/josh/room/mage/dungeon/obj/
lib/players/josh/wep/
lib/players/kingbill/
lib/players/metatron/
lib/players/miette/
lib/players/mirak/
lib/players/mirak/open/
lib/players/parsilan/
lib/players/relgar/
lib/players/relgar/private/
lib/players/sarak/
lib/players/sarak/bugs/
lib/players/sarak/feelings/
lib/players/sarak/magical/
lib/players/sarak/minotaur/island/
lib/players/sarak/open/
lib/players/sarak/private/
lib/players/serepion/
lib/players/serepion/open/
lib/players/serepion/private/
lib/players/spike/
lib/players/spike/open/
lib/players/spike/private/
lib/players/spike/seaworld/
lib/players/valrejn/
lib/players/valrejn/open/
lib/players/valrejn/private/
lib/players/virus/
lib/players/wrath/
lib/players/wrath/arm/
lib/players/wrath/mon/
lib/players/wrath/room/
lib/players/wrath/room/entry/
lib/players/wrath/room/zolgath/
lib/players/wrath/weap/
lib/players/zil/
lib/room/
lib/room/city/arena/
lib/room/city/creator/
lib/room/city/garden/monst/
lib/room/city/library/
lib/room/city/library/open/books/
lib/room/city/shop/
lib/room/death/
lib/room/death/open/
lib/room/island/
lib/room/keeps/
lib/room/registry/
lib/room/ships/crew/
lib/room/ships/open/
lib/room/ships/open/types/bounty/
lib/room/ships/open/types/nebula/
lib/room/ships/open/types/phoenix/
lib/secure/udp_cmd_/
lib/skills/
lib/skills/fighter/
lib/skills/psionici/
lib/skills/thief/
lib/usr/
lib/usr/creators/
lib/usr/no_banis/
lib/usr/players/
/** Identify; by Serepion  **/

/* updated feb. 94 */


status identify(string targ, mixed alt_type) {
   int level, i;
   string file;

   if(!targ) {
     notify_fail("identify what?\n");
     return 0;
   }    
   if (!alt_type) alt_type = "divination";
   level = (objectp(alt_type))
         ? (int)alt_type->query_cast_level()
         : (int)call_other(this_player(),"query_"+ alt_type);
   file = file_name(this_object());
   sscanf(file,"%s#%d",file,i);

   this_player()->load_spell(({
   "target",       targ,
   "name",         "Identify",
   "sphere",       alt_type,
   "cost",         5,
   "immune",       "divination",
   "damage",       level,
   "level",        5,
   "cast time",    1,
   "spell object", file,
   "passive",
   }));
   return 1;
}

#define TARG_DEX (int)ob->query_dexterity()
#define CAST_COM (int)caster->query_combat()
#define CAST_INT (int)caster->query_intelligence()
#define PRONOUN  capitalize((string)ob->query_pronoun())

status cast_spell(object caster,object ob,object prev,int level) {
  int ac, wc, mon_level, p_level, level_dif;
  int accuracy, value;
  string *classes;

  accuracy = (random(50) > level + CAST_INT) /* level 25 always accurate */
           ? random(10) - 5
           : 0;

  ac = (int)ob->query_ac() + (accuracy/3);
  wc = (int)ob->query_wc() + accuracy;
  value = (int)ob->query_value();
  value = (accuracy < 0)
        ? value/(accuracy*(-2))
        : (accuracy > 0)
        ? value * accuracy * 2
        : value;

  if(living(ob)) {
    if(random(TARG_DEX) > random(CAST_COM)) {
      write("You attempt to place your hands on "+ ob->query_name()
           +", but "+ob->query_pronoun()+" dodges out of the way.\n");
      say(this_player()->query_name() +" fails to touch "+
          ob->query_name()+".\n");
    }
    else { 
      write("You place your hands on "+ ob->query_name() 
           +" and attempt to identify "+ ob->query_objective() +".\n");
      say(this_player()->query_name() +" touches "+ ob->query_name()
         +" and seems enlightened.\n");
      mon_level = (int)ob->query_level() + accuracy;
      p_level = (int)this_player()->query_level() + accuracy;
      level_dif = mon_level - p_level;
      if(ac > 20)
        write(PRONOUN +" is extremely well armored.\n");
      else if(ac > 15)
        write(PRONOUN +" is rather well armored.\n");
      else if(ac > 10)
        write(PRONOUN +" is well armored.\n");
      else if(ac > 5)
        write(PRONOUN +" is somewhat armored.\n");
      else
        write(PRONOUN +" is nearly naked.\n");
      if(wc > 25)
        write(PRONOUN +" can turn you into a bloody mess before you think.\n");
      else if(wc > 20)
        write(PRONOUN +" can massacre on a good day.\n");
      else if(wc > 15)
        write(PRONOUN +" can knock you unconcious without thinking.\n");
      else if(wc > 10)
        write(PRONOUN +" can rip out your heart for lunch.\n");
      else if(wc > 5)
        write(PRONOUN +" can knock you around a bit.\n");
      else
        write(PRONOUN +" might leave a scar or two.\n");
      if(level_dif > 20)
        write(PRONOUN +" towers over you like a tall building.\n");
      else if(level_dif > 10)
        write(PRONOUN +" is head and shoulders above you.\n");
      else if(level_dif > 0)
        write(PRONOUN +" is a little bigger than you.\n");
      else if(level_dif == 0)
        write(PRONOUN +" is just your size.\n");
      else if(level_dif >= -10)
        write(PRONOUN +" is a little smaller than you.\n");
      else if(level_dif >= -20)
        write("You stand head and shoulders above it.\n");
      else
        write("You tower over it like a tall building.\n");
      if((classes = (string *)ob->query_classes())) {
        write(PRONOUN +" looks skilled as a "+ implode(classes, ", ") +".\n");
      }
    }
  }
  else {
    if(ac > 0) {
      if(ac >= 5)
        write("It can take anything that is dished out to it.\n");
      else if(ac == 4)
        write("It can take a beating.\n");
      else if(ac == 3 || ac == 2)
        write("It can take a little pounding.\n");
      else
        write("It can't take much of a pounding.\n");
    }
    if(wc > 0) {
      if(wc > 25)
        write("It can turn anything into a bloody mess before your eyes.\n");
      else if(wc > 20)
        write("It can massacre on a good day.\n");
      else if(wc > 15)
        write("It can knock anything unconscious without effort.\n");
      else if(wc > 10)
        write("You can rip out someone's heart for lunch.\n");
      else if(wc > 5)
        write("You can knock someone around with it.\n");
      else
        write("You might leave a scar or two.\n");
    }
    if(value <= 0)
      write("It might be worth some old lead.\n");
    else if(value < 10)
      write("It might buy you a drink.\n");
    else if(value < 100)
      write("It is worth at least a hearty meal.\n");
    else if(value < 1000)
      write("It is very valuable.\n");
    else
      write("It isn't something to be displaying at a thief's guild.\n");
  }
  destruct(this_object());
  return 1;
}

/* Native Mode Move */

#include <move.h>