diff -Ncr src/angband.h src.new/angband.h
*** src/angband.h	Tue Jul 25 13:57:49 2000
--- src.new/angband.h	Mon Oct 16 12:11:31 2000
***************
*** 32,37 ****
--- 32,38 ----
  #include "defines.h"
  #include "types.h"
  #include "externs.h"
+ #include "spells.h"
  
  
  
diff -Ncr src/cmd5.c src.new/cmd5.c
*** src/cmd5.c	Tue Jul 25 13:57:47 2000
--- src.new/cmd5.c	Mon Oct 16 12:14:41 2000
***************
*** 633,639 ****
  		/* Spells.  */
  		switch (spell)
  		{
! 			case 0:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_bolt_or_beam(beam-10, GF_MISSILE, dir,
--- 633,639 ----
  		/* Spells.  */
  		switch (spell)
  		{
! 			case M_MAGIC_MISSILE:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_bolt_or_beam(beam-10, GF_MISSILE, dir,
***************
*** 641,685 ****
  				break;
  			}
  
! 			case 1:
  			{
  				(void)detect_monsters_normal();
  				break;
  			}
  
! 			case 2:
  			{
  				teleport_player(10);
  				break;
  			}
  
! 			case 3:
  			{
  				(void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
  				break;
  			}
  
! 			case 4:
  			{
  				(void)detect_treasure();
  				(void)detect_objects_gold();
  				break;
  			}
  
! 			case 5:
  			{
  				(void)hp_player(damroll(2, 8));
  				(void)set_cut(p_ptr->cut - 15);
  				break;
  			}
  
! 			case 6:
  			{
  				(void)detect_objects_normal();
  				break;
  			}
  
! 			case 7:
  			{
  				(void)detect_traps();
  				(void)detect_doors();
--- 641,685 ----
  				break;
  			}
  
! 			case M_DETECT_MONSTERS:
  			{
  				(void)detect_monsters_normal();
  				break;
  			}
  
! 			case M_PHASE_DOOR:
  			{
  				teleport_player(10);
  				break;
  			}
  
! 			case M_LIGHT_AREA:
  			{
  				(void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
  				break;
  			}
  
! 			case M_TREASURE_DETECTION:
  			{
  				(void)detect_treasure();
  				(void)detect_objects_gold();
  				break;
  			}
  
! 			case M_CURE_LIGHT_WOUNDS:
  			{
  				(void)hp_player(damroll(2, 8));
  				(void)set_cut(p_ptr->cut - 15);
  				break;
  			}
  
! 			case M_OBJECT_DETECTION:
  			{
  				(void)detect_objects_normal();
  				break;
  			}
  
! 			case M_FIND_HIDDEN_TRAPS:
  			{
  				(void)detect_traps();
  				(void)detect_doors();
***************
*** 687,693 ****
  				break;
  			}
  
! 			case 8:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_POIS, dir,
--- 687,693 ----
  				break;
  			}
  
! 			case M_STINKING_CLOUD:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_POIS, dir,
***************
*** 695,708 ****
  				break;
  			}
  
! 			case 9:
  			{
  				if (!get_aim_dir(&dir)) return;
  				(void)confuse_monster(dir, plev);
  				break;
  			}
  
! 			case 10:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_bolt_or_beam(beam-10, GF_ELEC, dir,
--- 695,708 ----
  				break;
  			}
  
! 			case M_CONFUSE_MONSTER:
  			{
  				if (!get_aim_dir(&dir)) return;
  				(void)confuse_monster(dir, plev);
  				break;
  			}
  
! 			case M_LIGHTNING_BOLT:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_bolt_or_beam(beam-10, GF_ELEC, dir,
***************
*** 710,741 ****
  				break;
  			}
  
! 			case 11:
  			{
  				(void)destroy_doors_touch();
  				break;
  			}
! 
! 			case 12:
  			{
  				if (!get_aim_dir(&dir)) return;
  				(void)sleep_monster(dir);
  				break;
  			}
  
! 			case 13:
  			{
  				(void)set_poisoned(0);
  				break;
  			}
  
! 			case 14:
  			{
  				teleport_player(plev * 5);
  				break;
  			}
  
! 			case 15:
  			{
  				if (!get_aim_dir(&dir)) return;
  				msg_print("A line of blue shimmering light appears.");
--- 710,745 ----
  				break;
  			}
  
! 			case M_TRAP_DOOR_DESTRUCTION:
  			{
  				(void)destroy_doors_touch();
  				break;
  			}
! 			case M_DETECT_MAGIC:
! 			{
! 				(void)detect_spell();
! 				break;
! 			}
! 			case M_SLEEP_I:
  			{
  				if (!get_aim_dir(&dir)) return;
  				(void)sleep_monster(dir);
  				break;
  			}
  
! 			case M_CURE_POISON:
  			{
  				(void)set_poisoned(0);
  				break;
  			}
  
! 			case M_TELEPORT_SELF:
  			{
  				teleport_player(plev * 5);
  				break;
  			}
  
! 			case M_SPEAR_OF_LIGHT:
  			{
  				if (!get_aim_dir(&dir)) return;
  				msg_print("A line of blue shimmering light appears.");
***************
*** 743,749 ****
  				break;
  			}
  
! 			case 16:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_bolt_or_beam(beam-10, GF_COLD, dir,
--- 747,753 ----
  				break;
  			}
  
! 			case M_FROST_BOLT:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_bolt_or_beam(beam-10, GF_COLD, dir,
***************
*** 751,801 ****
  				break;
  			}
  
! 			case 17:
  			{
  				if (!get_aim_dir(&dir)) return;
  				(void)wall_to_mud(dir);
  				break;
  			}
  
! 			case 18:
  			{
  				(void)set_food(PY_FOOD_MAX - 1);
  				break;
  			}
  
! 			case 19:
  			{
  				(void)recharge(5);
  				break;
  			}
  
! 			case 20:
  			{
  				(void)sleep_monsters_touch();
  				break;
  			}
  
! 			case 21:
  			{
  				if (!get_aim_dir(&dir)) return;
  				(void)poly_monster(dir);
  				break;
  			}
  
! 			case 22:
  			{
  				(void)ident_spell();
  				break;
  			}
  
! 			case 23:
  			{
  				(void)sleep_monsters();
  				break;
  			}
  
! 			case 24:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_bolt_or_beam(beam, GF_FIRE, dir,
--- 755,805 ----
  				break;
  			}
  
! 			case M_TURN_STONE_TO_MUD:
  			{
  				if (!get_aim_dir(&dir)) return;
  				(void)wall_to_mud(dir);
  				break;
  			}
  
! 			case M_SATISFY_HUNGER:
  			{
  				(void)set_food(PY_FOOD_MAX - 1);
  				break;
  			}
  
! 			case M_RECHARGE_ITEM_I:
  			{
  				(void)recharge(5);
  				break;
  			}
  
! 			case M_SLEEP_II:
  			{
  				(void)sleep_monsters_touch();
  				break;
  			}
  
! 			case M_POLYMORPH_OTHER:
  			{
  				if (!get_aim_dir(&dir)) return;
  				(void)poly_monster(dir);
  				break;
  			}
  
! 			case M_IDENTIFY:
  			{
  				(void)ident_spell();
  				break;
  			}
  
! 			case M_SLEEP_III:
  			{
  				(void)sleep_monsters();
  				break;
  			}
  
! 			case M_FIRE_BOLT:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_bolt_or_beam(beam, GF_FIRE, dir,
***************
*** 803,816 ****
  				break;
  			}
  
! 			case 25:
  			{
  				if (!get_aim_dir(&dir)) return;
  				(void)slow_monster(dir);
  				break;
  			}
  
! 			case 26:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_COLD, dir,
--- 807,820 ----
  				break;
  			}
  
! 			case M_SLOW_MONSTER:
  			{
  				if (!get_aim_dir(&dir)) return;
  				(void)slow_monster(dir);
  				break;
  			}
  
! 			case M_FROST_BALL:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_COLD, dir,
***************
*** 818,837 ****
  				break;
  			}
  
! 			case 27:
  			{
  				(void)recharge(40);
  				break;
  			}
  
! 			case 28:
  			{
  				if (!get_aim_dir(&dir)) return;
  				(void)teleport_monster(dir);
  				break;
  			}
  
! 			case 29:
  			{
  				if (!p_ptr->fast)
  				{
--- 822,841 ----
  				break;
  			}
  
! 			case M_RECHARGE_ITEM_II:
  			{
  				(void)recharge(40);
  				break;
  			}
  
! 			case M_TELEPORT_OTHER:
  			{
  				if (!get_aim_dir(&dir)) return;
  				(void)teleport_monster(dir);
  				break;
  			}
  
! 			case M_HASTE_SELF:
  			{
  				if (!p_ptr->fast)
  				{
***************
*** 844,850 ****
  				break;
  			}
  
! 			case 30:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_FIRE, dir,
--- 848,854 ----
  				break;
  			}
  
! 			case M_FIRE_BALL:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_FIRE, dir,
***************
*** 852,900 ****
  				break;
  			}
  
! 			case 31:
  			{
  				destroy_area(py, px, 15, TRUE);
  				break;
  			}
  
! 			case 32:
  			{
  				(void)genocide();
  				break;
  			}
  
! 			case 33:
  			{
  				(void)door_creation();
  				break;
  			}
  
! 			case 34:
  			{
  				(void)stair_creation();
  				break;
  			}
  
! 			case 35:
  			{
  				(void)teleport_player_level();
  				break;
  			}
  
! 			case 36:
  			{
  				earthquake(py, px, 10);
  				break;
  			}
  
! 			case 37:
  			{
  				set_recall();
  				break;
  			}
  
! 			case 38:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_bolt_or_beam(beam, GF_ACID, dir,
--- 856,905 ----
  				break;
  			}
  
! 			case M_WORD_OF_DESTRUCTION:
  			{
  				destroy_area(py, px, 15, TRUE);
  				break;
  			}
  
! 			case M_GENOCIDE:
! 			case M_GENOCIDE2:
  			{
  				(void)genocide();
  				break;
  			}
  
! 			case M_DOOR_CREATION:
  			{
  				(void)door_creation();
  				break;
  			}
  
! 			case M_STAIR_CREATION:
  			{
  				(void)stair_creation();
  				break;
  			}
  
! 			case M_TELEPORT_LEVEL:
  			{
  				(void)teleport_player_level();
  				break;
  			}
  
! 			case M_EARTHQUAKE:
  			{
  				earthquake(py, px, 10);
  				break;
  			}
  
! 			case M_WORD_OF_RECALL:
  			{
  				set_recall();
  				break;
  			}
  
! 			case M_ACID_BOLT:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_bolt_or_beam(beam, GF_ACID, dir,
***************
*** 902,908 ****
  				break;
  			}
  
! 			case 39:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_POIS, dir,
--- 907,913 ----
  				break;
  			}
  
! 			case M_CLOUD_KILL:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_POIS, dir,
***************
*** 910,916 ****
  				break;
  			}
  
! 			case 40:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_ACID, dir,
--- 915,921 ----
  				break;
  			}
  
! 			case M_ACID_BALL:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_ACID, dir,
***************
*** 918,924 ****
  				break;
  			}
  
! 			case 41:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_COLD, dir,
--- 923,929 ----
  				break;
  			}
  
! 			case M_ICE_STORM:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_COLD, dir,
***************
*** 926,932 ****
  				break;
  			}
  
! 			case 42:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_METEOR, dir,
--- 931,937 ----
  				break;
  			}
  
! 			case M_METEOR_SWARM:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_METEOR, dir,
***************
*** 934,940 ****
  				break;
  			}
  
! 			case 43:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_MANA, dir,
--- 939,945 ----
  				break;
  			}
  
! 			case M_MANA_STORM:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_MANA, dir,
***************
*** 942,1002 ****
  				break;
  			}
  
! 			case 44:
  			{
  				(void)detect_monsters_evil();
  				break;
  			}
  
! 			case 45:
  			{
  				(void)detect_objects_magic();
  				break;
  			}
  
! 			case 46:
  			{
  				recharge(100);
  				break;
  			}
  
! 			case 47:
! 			{
! 				(void)genocide();
! 				break;
! 			}
! 
! 			case 48:
  			{
  				(void)mass_genocide();
  				break;
  			}
  
! 			case 49:
  			{
  				(void)set_oppose_fire(p_ptr->oppose_fire + randint(20) + 20);
  				break;
  			}
  
! 			case 50:
  			{
  				(void)set_oppose_cold(p_ptr->oppose_cold + randint(20) + 20);
  				break;
  			}
  
! 			case 51:
  			{
  				(void)set_oppose_acid(p_ptr->oppose_acid + randint(20) + 20);
  				break;
  			}
  
! 			case 52:
  			{
  				(void)set_oppose_pois(p_ptr->oppose_pois + randint(20) + 20);
  				break;
  			}
  
! 			case 53:
  			{
  				int time = randint(20) + 20;
  				(void)set_oppose_acid(p_ptr->oppose_acid + time);
--- 947,1001 ----
  				break;
  			}
  
! 			case M_DETECT_EVIL:
  			{
  				(void)detect_monsters_evil();
  				break;
  			}
  
! 			case M_DETECT_ENCHANTMENT:
  			{
  				(void)detect_objects_magic();
  				break;
  			}
  
! 			case M_RECHARGE_ITEM_III:
  			{
  				recharge(100);
  				break;
  			}
  
! 			case M_MASS_GENOCIDE:
  			{
  				(void)mass_genocide();
  				break;
  			}
  
! 			case M_RESIST_FIRE:
  			{
  				(void)set_oppose_fire(p_ptr->oppose_fire + randint(20) + 20);
  				break;
  			}
  
! 			case M_RESIST_COLD:
  			{
  				(void)set_oppose_cold(p_ptr->oppose_cold + randint(20) + 20);
  				break;
  			}
  
! 			case M_RESIST_ACID:
  			{
  				(void)set_oppose_acid(p_ptr->oppose_acid + randint(20) + 20);
  				break;
  			}
  
! 			case M_RESIST_POISON:
  			{
  				(void)set_oppose_pois(p_ptr->oppose_pois + randint(20) + 20);
  				break;
  			}
  
! 			case M_RESISTANCE:
  			{
  				int time = randint(20) + 20;
  				(void)set_oppose_acid(p_ptr->oppose_acid + time);
***************
*** 1007,1013 ****
  				break;
  			}
  
! 			case 54:
  			{
  				(void)hp_player(10);
  				(void)set_hero(p_ptr->hero + randint(25) + 25);
--- 1006,1012 ----
  				break;
  			}
  
! 			case M_HEROISM:
  			{
  				(void)hp_player(10);
  				(void)set_hero(p_ptr->hero + randint(25) + 25);
***************
*** 1015,1027 ****
  				break;
  			}
  
! 			case 55:
  			{
  				(void)set_shield(p_ptr->shield + randint(20) + 30);
  				break;
  			}
  
! 			case 56:
  			{
  				(void)hp_player(30);
  				(void)set_shero(p_ptr->shero + randint(25) + 25);
--- 1014,1026 ----
  				break;
  			}
  
! 			case M_SHIELD:
  			{
  				(void)set_shield(p_ptr->shield + randint(20) + 30);
  				break;
  			}
  
! 			case M_BERSERKER:
  			{
  				(void)hp_player(30);
  				(void)set_shero(p_ptr->shero + randint(25) + 25);
***************
*** 1029,1035 ****
  				break;
  			}
  
! 			case 57:
  			{
  				if (!p_ptr->fast)
  				{
--- 1028,1034 ----
  				break;
  			}
  
! 			case M_ESSENCE_OF_SPEED:
  			{
  				if (!p_ptr->fast)
  				{
***************
*** 1042,1048 ****
  				break;
  			}
  
! 			case 58:
  			{
  				(void)set_invuln(p_ptr->invuln + randint(8) + 8);
  				break;
--- 1041,1047 ----
  				break;
  			}
  
! 			case M_GLOBE_OF_INVULNERABILITY:
  			{
  				(void)set_invuln(p_ptr->invuln + randint(8) + 8);
  				break;
***************
*** 1275,1388 ****
  	{
  		switch (spell)
  		{
! 			case 0:
  			{
  				(void)detect_monsters_evil();
  				break;
  			}
  
! 			case 1:
  			{
  				(void)hp_player(damroll(2, 10));
  				(void)set_cut(p_ptr->cut - 10);
  				break;
  			}
  
! 			case 2:
  			{
  				(void)set_blessed(p_ptr->blessed + randint(12) + 12);
  				break;
  			}
  
! 			case 3:
  			{
  				(void)set_afraid(0);
  				break;
  			}
  
! 			case 4:
  			{
  				(void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
  				break;
  			}
  
! 			case 5:
  			{
  				(void)detect_traps();
  				break;
  			}
  
! 			case 6:
  			{
  				(void)detect_doors();
  				(void)detect_stairs();
  				break;
  			}
  
! 			case 7:
  			{
  				(void)set_poisoned(p_ptr->poisoned / 2);
  				break;
  			}
  
! 			case 8:
  			{
  				if (!get_aim_dir(&dir)) return;
  				(void)fear_monster(dir, plev);
  				break;
  			}
  
! 			case 9:
  			{
  				teleport_player(plev * 3);
  				break;
  			}
  
! 			case 10:
  			{
  				(void)hp_player(damroll(4, 10));
  				(void)set_cut((p_ptr->cut / 2) - 20);
  				break;
  			}
  
! 			case 11:
  			{
  				(void)set_blessed(p_ptr->blessed + randint(24) + 24);
  				break;
  			}
  
! 			case 12:
  			{
  				(void)sleep_monsters_touch();
  				break;
  			}
  
! 			case 13:
  			{
  				(void)set_food(PY_FOOD_MAX - 1);
  				break;
  			}
  
! 			case 14:
  			{
  				remove_curse();
  				break;
  			}
  
! 			case 15:
  			{
  				(void)set_oppose_fire(p_ptr->oppose_fire + randint(10) + 10);
  				(void)set_oppose_cold(p_ptr->oppose_cold + randint(10) + 10);
  				break;
  			}
  
! 			case 16:
  			{
  				(void)set_poisoned(0);
  				break;
  			}
  
! 			case 17:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_HOLY_ORB, dir,
--- 1274,1387 ----
  	{
  		switch (spell)
  		{
! 			case P_DETECT_EVIL:
  			{
  				(void)detect_monsters_evil();
  				break;
  			}
  
! 			case P_CURE_LIGHT_WOUNDS:
  			{
  				(void)hp_player(damroll(2, 10));
  				(void)set_cut(p_ptr->cut - 10);
  				break;
  			}
  
! 			case P_BLESS:
  			{
  				(void)set_blessed(p_ptr->blessed + randint(12) + 12);
  				break;
  			}
  
! 			case P_REMOVE_FEAR:
  			{
  				(void)set_afraid(0);
  				break;
  			}
  
! 			case P_CALL_LIGHT:
  			{
  				(void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
  				break;
  			}
  
! 			case P_FIND_TRAPS:
  			{
  				(void)detect_traps();
  				break;
  			}
  
! 			case P_DETECT_DOORS:
  			{
  				(void)detect_doors();
  				(void)detect_stairs();
  				break;
  			}
  
! 			case P_SLOW_POISON:
  			{
  				(void)set_poisoned(p_ptr->poisoned / 2);
  				break;
  			}
  
! 			case P_SCARE_MONSTER:
  			{
  				if (!get_aim_dir(&dir)) return;
  				(void)fear_monster(dir, plev);
  				break;
  			}
  
! 			case P_PORTAL:
  			{
  				teleport_player(plev * 3);
  				break;
  			}
  
! 			case P_CURE_SERIOUS_WOUNDS:
  			{
  				(void)hp_player(damroll(4, 10));
  				(void)set_cut((p_ptr->cut / 2) - 20);
  				break;
  			}
  
! 			case P_CHANT:
  			{
  				(void)set_blessed(p_ptr->blessed + randint(24) + 24);
  				break;
  			}
  
! 			case P_SANCTUARY:
  			{
  				(void)sleep_monsters_touch();
  				break;
  			}
  
! 			case P_SATISFY_HUNGER:
  			{
  				(void)set_food(PY_FOOD_MAX - 1);
  				break;
  			}
  
! 			case P_REMOVE_CURSE:
  			{
  				remove_curse();
  				break;
  			}
  
! 			case P_RESIST_HEAT_AND_COLD:
  			{
  				(void)set_oppose_fire(p_ptr->oppose_fire + randint(10) + 10);
  				(void)set_oppose_cold(p_ptr->oppose_cold + randint(10) + 10);
  				break;
  			}
  
! 			case P_NEUTRALIZE_POISON:
  			{
  				(void)set_poisoned(0);
  				break;
  			}
  
! 			case P_ORB_OF_DRAINING:
  			{
  				if (!get_aim_dir(&dir)) return;
  				fire_ball(GF_HOLY_ORB, dir,
***************
*** 1392,1429 ****
  				break;
  			}
  
! 			case 18:
  			{
  				(void)hp_player(damroll(6, 10));
  				(void)set_cut(0);
  				break;
  			}
  
! 			case 19:
  			{
  				(void)set_tim_invis(p_ptr->tim_invis + randint(24) + 24);
  				break;
  			}
  
! 			case 20:
  			{
  				(void)set_protevil(p_ptr->protevil + randint(25) + 3 * p_ptr->lev);
  				break;
  			}
  
! 			case 21:
  			{
  				earthquake(py, px, 10);
  				break;
  			}
  
! 			case 22:
  			{
  				map_area();
  				break;
  			}
  
! 			case 23:
  			{
  				(void)hp_player(damroll(8, 10));
  				(void)set_stun(0);
--- 1391,1428 ----
  				break;
  			}
  
! 			case P_CURE_CRITICAL_WOUNDS:
  			{
  				(void)hp_player(damroll(6, 10));
  				(void)set_cut(0);
  				break;
  			}
  
! 			case P_SENSE_INVISIBLE:
  			{
  				(void)set_tim_invis(p_ptr->tim_invis + randint(24) + 24);
  				break;
  			}
  
! 			case P_PROTECTION_FROM_EVIL:
  			{
  				(void)set_protevil(p_ptr->protevil + randint(25) + 3 * p_ptr->lev);
  				break;
  			}
  
! 			case P_EARTHQUAKE:
  			{
  				earthquake(py, px, 10);
  				break;
  			}
  
! 			case P_SENSE_SURROUNDINGS:
  			{
  				map_area();
  				break;
  			}
  
! 			case P_CURE_MORTAL_WOUNDS:
  			{
  				(void)hp_player(damroll(8, 10));
  				(void)set_stun(0);
***************
*** 1431,1455 ****
  				break;
  			}
  
! 			case 24:
  			{
  				(void)turn_undead();
  				break;
  			}
  
! 			case 25:
  			{
  				(void)set_blessed(p_ptr->blessed + randint(48) + 48);
  				break;
  			}
  
! 			case 26:
  			{
  				(void)dispel_undead(randint(plev * 3));
  				break;
  			}
  
! 			case 27:
  			{
  				(void)hp_player(300);
  				(void)set_stun(0);
--- 1430,1454 ----
  				break;
  			}
  
! 			case P_TURN_UNDEAD:
  			{
  				(void)turn_undead();
  				break;
  			}
  
! 			case P_PRAYER:
  			{
  				(void)set_blessed(p_ptr->blessed + randint(48) + 48);
  				break;
  			}
  
! 			case P_DISPEL_UNDEAD:
  			{
  				(void)dispel_undead(randint(plev * 3));
  				break;
  			}
  
! 			case P_HEAL:
  			{
  				(void)hp_player(300);
  				(void)set_stun(0);
***************
*** 1457,1475 ****
  				break;
  			}
  
! 			case 28:
  			{
  				(void)dispel_evil(randint(plev * 3));
  				break;
  			}
  
! 			case 29:
  			{
  				warding_glyph();
  				break;
  			}
  
! 			case 30:
  			{
  				(void)dispel_evil(randint(plev * 4));
  				(void)hp_player(1000);
--- 1456,1474 ----
  				break;
  			}
  
! 			case P_DISPEL_EVIL:
  			{
  				(void)dispel_evil(randint(plev * 3));
  				break;
  			}
  
! 			case P_GLYPH_OF_WARDING:
  			{
  				warding_glyph();
  				break;
  			}
  
! 			case P_HOLY_WORD:
  			{
  				(void)dispel_evil(randint(plev * 4));
  				(void)hp_player(1000);
***************
*** 1480,1523 ****
  				break;
  			}
  
! 			case 31:
  			{
  				(void)detect_monsters_normal();
  				break;
  			}
  
! 			case 32:
  			{
  				(void)detect_all();
  				break;
  			}
  
! 			case 33:
  			{
  				(void)ident_spell();
  				break;
  			}
  
! 			case 34:
  			{
  				(void)probing();
  				break;
  			}
  
! 			case 35:
  			{
  				wiz_lite();
  				break;
  			}
  
! 			case 36:
  			{
  				(void)hp_player(damroll(4, 10));
  				(void)set_cut(0);
  				break;
  			}
  
! 			case 37:
  			{
  				(void)hp_player(damroll(8, 10));
  				(void)set_stun(0);
--- 1479,1522 ----
  				break;
  			}
  
! 			case P_DETECT_MONSTERS:
  			{
  				(void)detect_monsters_normal();
  				break;
  			}
  
! 			case P_DETECTION:
  			{
  				(void)detect_all();
  				break;
  			}
  
! 			case P_PERCEPTION:
  			{
  				(void)ident_spell();
  				break;
  			}
  
! 			case P_PROBING:
  			{
  				(void)probing();
  				break;
  			}
  
! 			case P_CLAIRVOYANCE:
  			{
  				wiz_lite();
  				break;
  			}
  
! 			case P_CURE_SERIOUS_WOUNDS2:
  			{
  				(void)hp_player(damroll(4, 10));
  				(void)set_cut(0);
  				break;
  			}
  
! 			case P_CURE_MORTAL_WOUNDS2:
  			{
  				(void)hp_player(damroll(8, 10));
  				(void)set_stun(0);
***************
*** 1525,1531 ****
  				break;
  			}
  
! 			case 38:
  			{
  				(void)hp_player(2000);
  				(void)set_stun(0);
--- 1524,1530 ----
  				break;
  			}
  
! 			case P_HEALING:
  			{
  				(void)hp_player(2000);
  				(void)set_stun(0);
***************
*** 1533,1539 ****
  				break;
  			}
  
! 			case 39:
  			{
  				(void)do_res_stat(A_STR);
  				(void)do_res_stat(A_INT);
--- 1532,1538 ----
  				break;
  			}
  
! 			case P_RESTORATION:
  			{
  				(void)do_res_stat(A_STR);
  				(void)do_res_stat(A_INT);
***************
*** 1544,1568 ****
  				break;
  			}
  
! 			case 40:
  			{
  				(void)restore_level();
  				break;
  			}
  
! 			case 41:
  			{
  				(void)dispel_undead(randint(plev * 4));
  				break;
  			}
  
! 			case 42:
  			{
  				(void)dispel_evil(randint(plev * 4));
  				break;
  			}
  
! 			case 43:
  			{
  				if (banish_evil(100))
  				{
--- 1543,1567 ----
  				break;
  			}
  
! 			case P_REMEMBRANCE:
  			{
  				(void)restore_level();
  				break;
  			}
  
! 			case P_DISPEL_UNDEAD2:
  			{
  				(void)dispel_undead(randint(plev * 4));
  				break;
  			}
  
! 			case P_DISPEL_EVIL2:
  			{
  				(void)dispel_evil(randint(plev * 4));
  				break;
  			}
  
! 			case P_BANISHMENT:
  			{
  				if (banish_evil(100))
  				{
***************
*** 1571,1657 ****
  				break;
  			}
  
! 			case 44:
  			{
  				destroy_area(py, px, 15, TRUE);
  				break;
  			}
  
! 			case 45:
  			{
  				if (!get_aim_dir(&dir)) return;
  				drain_life(dir, 200);
  				break;
  			}
  
! 			case 46:
  			{
  				(void)destroy_doors_touch();
  				break;
  			}
  
! 			case 47:
  			{
  				(void)recharge(15);
  				break;
  			}
  
! 			case 48:
  			{
  				(void)remove_all_curse();
  				break;
  			}
  
! 			case 49:
  			{
  				(void)enchant_spell(rand_int(4) + 1, rand_int(4) + 1, 0);
  				break;
  			}
  
! 			case 50:
  			{
  				(void)enchant_spell(0, 0, rand_int(3) + 2);
  				break;
  			}
  
! 			case 51:
  			{
  				brand_weapon();
  				break;
  			}
  
! 			case 52:
  			{
  				teleport_player(10);
  				break;
  			}
  
! 			case 53:
  			{
  				teleport_player(plev * 8);
  				break;
  			}
  
! 			case 54:
  			{
  				if (!get_aim_dir(&dir)) return;
  				(void)teleport_monster(dir);
  				break;
  			}
  
! 			case 55:
  			{
  				(void)teleport_player_level();
  				break;
  			}
  
! 			case 56:
  			{
  				set_recall();
  				break;
  			}
  
! 			case 57:
  			{
  				msg_print("The world changes!");
  
--- 1570,1656 ----
  				break;
  			}
  
! 			case P_WORD_OF_DESTRUCTION:
  			{
  				destroy_area(py, px, 15, TRUE);
  				break;
  			}
  
! 			case P_ANNIHILATION:
  			{
  				if (!get_aim_dir(&dir)) return;
  				drain_life(dir, 200);
  				break;
  			}
  
! 			case P_UNBARRING_WAYS:
  			{
  				(void)destroy_doors_touch();
  				break;
  			}
  
! 			case P_RECHARGING:
  			{
  				(void)recharge(15);
  				break;
  			}
  
! 			case P_DISPEL_CURSE:
  			{
  				(void)remove_all_curse();
  				break;
  			}
  
! 			case P_ENCHANT_WEAPON:
  			{
  				(void)enchant_spell(rand_int(4) + 1, rand_int(4) + 1, 0);
  				break;
  			}
  
! 			case P_ENCHANT_ARMOUR:
  			{
  				(void)enchant_spell(0, 0, rand_int(3) + 2);
  				break;
  			}
  
! 			case P_ELEMENTAL_BRAND:
  			{
  				brand_weapon();
  				break;
  			}
  
! 			case P_BLINK:
  			{
  				teleport_player(10);
  				break;
  			}
  
! 			case P_TELEPORT_SELF:
  			{
  				teleport_player(plev * 8);
  				break;
  			}
  
! 			case P_TELEPORT_OTHER:
  			{
  				if (!get_aim_dir(&dir)) return;
  				(void)teleport_monster(dir);
  				break;
  			}
  
! 			case P_TELEPORT_LEVEL:
  			{
  				(void)teleport_player_level();
  				break;
  			}
  
! 			case P_WORD_OF_RECALL:
  			{
  				set_recall();
  				break;
  			}
  
! 			case P_ALTER_REALITY:
  			{
  				msg_print("The world changes!");
  
diff -Ncr src/config.h src.new/config.h
*** src/config.h	Tue Jul 25 13:57:49 2000
--- src.new/config.h	Mon Oct 16 13:15:25 2000
***************
*** 46,52 ****
   * OPTION: define "SPECIAL_BSD" for using certain versions of UNIX
   * that use the 4.4BSD Lite version of Curses in "main-gcu.c"
   */
! /* #define SPECIAL_BSD */
  
  
  /*
--- 46,52 ----
   * OPTION: define "SPECIAL_BSD" for using certain versions of UNIX
   * that use the 4.4BSD Lite version of Curses in "main-gcu.c"
   */
! #define SPECIAL_BSD
  
  
  /*
***************
*** 229,235 ****
   * about 15K of code in "save-old.c" to parse the old savefile format.
   * Angband 2.8.0 will ignore a lot of info from pre-2.7.0 savefiles.
   */
! #define ALLOW_OLD_SAVEFILES
  
  
  /*
--- 229,235 ----
   * about 15K of code in "save-old.c" to parse the old savefile format.
   * Angband 2.8.0 will ignore a lot of info from pre-2.7.0 savefiles.
   */
! /* #define ALLOW_OLD_SAVEFILES */
  
  
  /*
***************
*** 449,455 ****
   * or "/usr/games/lib/angband/", or "/pkg/angband/lib".
   */
  #ifndef DEFAULT_PATH
! # define DEFAULT_PATH "./lib/"
  #endif
  
  
--- 449,455 ----
   * or "/usr/games/lib/angband/", or "/pkg/angband/lib".
   */
  #ifndef DEFAULT_PATH
! # define DEFAULT_PATH "/usr/libdata/angband/"
  #endif
  
  
diff -Ncr src/dungeon.c src.new/dungeon.c
*** src/dungeon.c	Tue Jul 25 13:57:48 2000
--- src.new/dungeon.c	Mon Oct 16 12:19:10 2000
***************
*** 12,88 ****
  
  
  /*
-  * Return a "feeling" (or NULL) about an item.  Method 1 (Heavy).
-  */
- static int value_check_aux1(object_type *o_ptr)
- {
- 	/* Artifacts */
- 	if (artifact_p(o_ptr))
- 	{
- 		/* Cursed/Broken */
- 		if (cursed_p(o_ptr) || broken_p(o_ptr)) return (INSCRIP_TERRIBLE);
- 
- 		/* Normal */
- 		return (INSCRIP_SPECIAL);
- 	}
- 
- 	/* Ego-Items */
- 	if (ego_item_p(o_ptr))
- 	{
- 		/* Cursed/Broken */
- 		if (cursed_p(o_ptr) || broken_p(o_ptr)) return (INSCRIP_WORTHLESS);
- 
- 		/* Normal */
- 		return (INSCRIP_EXCELLENT);
- 	}
- 
- 	/* Cursed items */
- 	if (cursed_p(o_ptr)) return (INSCRIP_CURSED);
- 
- 	/* Broken items */
- 	if (broken_p(o_ptr)) return (INSCRIP_BROKEN);
- 
- 	/* Good "armor" bonus */
- 	if (o_ptr->to_a > 0) return (INSCRIP_GOOD);
- 
- 	/* Good "weapon" bonus */
- 	if (o_ptr->to_h + o_ptr->to_d > 0) return (INSCRIP_GOOD);
- 
- 	/* Default to "average" */
- 	return (INSCRIP_AVERAGE);
- }
- 
- 
- /*
-  * Return a "feeling" (or NULL) about an item.  Method 2 (Light).
-  */
- static int value_check_aux2(object_type *o_ptr)
- {
- 	/* Cursed items (all of them) */
- 	if (cursed_p(o_ptr)) return (INSCRIP_CURSED);
- 
- 	/* Broken items (all of them) */
- 	if (broken_p(o_ptr)) return (INSCRIP_BROKEN);
- 
- 	/* Artifacts -- except cursed/broken ones */
- 	if (artifact_p(o_ptr)) return (INSCRIP_GOOD);
- 
- 	/* Ego-Items -- except cursed/broken ones */
- 	if (ego_item_p(o_ptr)) return (INSCRIP_GOOD);
- 
- 	/* Good armor bonus */
- 	if (o_ptr->to_a > 0) return (INSCRIP_GOOD);
- 
- 	/* Good weapon bonuses */
- 	if (o_ptr->to_h + o_ptr->to_d > 0) return (INSCRIP_GOOD);
- 
- 	/* No feeling */
- 	return (0);
- }
- 
- 
- 
- /*
   * Sense the inventory
   *
   *   Class 0 = Warrior --> fast and heavy
--- 12,17 ----
***************
*** 100,111 ****
  
  	bool heavy = FALSE;
  
- 	int feel;
- 
  	object_type *o_ptr;
  
- 	char o_name[80];
- 
  
  	/*** Check for "sensing" ***/
  
--- 29,36 ----
***************
*** 233,277 ****
  		/* Occasional failure on inventory items */
  		if ((i < INVEN_WIELD) && (0 != rand_int(5))) continue;
  
! 		/* Check for a feeling */
! 		feel = (heavy ? value_check_aux1(o_ptr) : value_check_aux2(o_ptr));
! 
! 		/* Skip non-feelings */
! 		if (!feel) continue;
! 
! 		/* Stop everything */
! 		if (disturb_minor) disturb(0, 0);
! 
! 		/* Get an object description */
! 		object_desc(o_name, o_ptr, FALSE, 0);
! 
! 		/* Message (equipment) */
! 		if (i >= INVEN_WIELD)
! 		{
! 			msg_format("You feel the %s (%c) you are %s %s %s...",
! 			           o_name, index_to_label(i), describe_use(i),
! 			           ((o_ptr->number == 1) ? "is" : "are"),
! 			           inscrip_text[feel - INSCRIP_NULL]);
! 		}
! 
! 		/* Message (inventory) */
! 		else
! 		{
! 			msg_format("You feel the %s (%c) in your pack %s %s...",
! 			           o_name, index_to_label(i),
! 			           ((o_ptr->number == 1) ? "is" : "are"),
! 			           inscrip_text[feel - INSCRIP_NULL]);
! 		}
! 
! 		/* Sense the object */
! 		o_ptr->discount = feel;
! 
! 		/* The object has been "sensed" */
! 		o_ptr->ident |= (IDENT_SENSE);
! 
! 
! 		/* Combine / Reorder the pack (later) */
! 		p_ptr->notice |= (PN_COMBINE | PN_REORDER);
  
  		/* Window stuff */
  		p_ptr->window |= (PW_INVEN | PW_EQUIP);
--- 158,164 ----
  		/* Occasional failure on inventory items */
  		if ((i < INVEN_WIELD) && (0 != rand_int(5))) continue;
  
! 		sense_object(o_ptr, heavy);
  
  		/* Window stuff */
  		p_ptr->window |= (PW_INVEN | PW_EQUIP);
diff -Ncr src/externs.h src.new/externs.h
*** src/externs.h	Tue Jul 25 13:57:49 2000
--- src.new/externs.h	Mon Oct 16 12:11:37 2000
***************
*** 577,582 ****
--- 577,583 ----
  extern bool do_res_stat(int stat);
  extern bool do_inc_stat(int stat);
  extern void identify_pack(void);
+ extern bool sense_object(object_type *, bool);
  extern bool remove_curse(void);
  extern bool remove_all_curse(void);
  extern bool restore_level(void);
***************
*** 598,604 ****
--- 599,607 ----
  extern bool enchant(object_type *o_ptr, int n, int eflag);
  extern bool enchant_spell(int num_hit, int num_dam, int num_ac);
  extern bool ident_spell(void);
+ extern bool detect_spell(void);
  extern bool identify_fully(void);
+ extern bool identify_some(void);
  extern bool recharge(int num);
  extern bool speed_monsters(void);
  extern bool slow_monsters(void);
diff -Ncr src/h-config.h src.new/h-config.h
*** src/h-config.h	Tue Jul 25 13:57:49 2000
--- src.new/h-config.h	Mon Oct 16 12:11:37 2000
***************
*** 264,270 ****
  # define FILE_TYPE_SAVE 'SAVE'
  # define FILE_TYPE(X) (_ftype = (X))
  #else
! # define FILE_TYPE(X) ((void)0)
  #endif
  
  
--- 264,270 ----
  # define FILE_TYPE_SAVE 'SAVE'
  # define FILE_TYPE(X) (_ftype = (X))
  #else
! # define FILE_TYPE(X) 
  #endif
  
  
diff -Ncr src/main-gcu.c src.new/main-gcu.c
*** src/main-gcu.c	Tue Jul 25 13:57:48 2000
--- src.new/main-gcu.c	Mon Oct 16 13:13:19 2000
***************
*** 1,5 ****
--- 1,6 ----
  /* File: main-gcu.c */
  
+ #define SPECIAL_BSD
  /*
   * Copyright (c) 1997 Ben Harrison, and others
   *
***************
*** 472,477 ****
--- 473,479 ----
  		/* Flush the curses buffer */
  		(void)refresh();
  
+ #if 0
  #ifdef SPECIAL_BSD
  		/* this moves curses to bottom right corner */
  		mvcur(curscr->cury, curscr->curx, LINES - 1, 0);
***************
*** 479,485 ****
  		/* this moves curses to bottom right corner */
  		mvcur(curscr->_cury, curscr->_curx, LINES - 1, 0);
  #endif
! 
  		/* Exit curses */
  		endwin();
  
--- 481,487 ----
  		/* this moves curses to bottom right corner */
  		mvcur(curscr->_cury, curscr->_curx, LINES - 1, 0);
  #endif
! #endif
  		/* Exit curses */
  		endwin();
  
***************
*** 555,566 ****
--- 557,570 ----
  	start_color();
  #endif
  
+ #if 0
  #ifdef SPECIAL_BSD
  	/* This moves curses to bottom right corner */
  	mvcur(curscr->cury, curscr->curx, LINES - 1, 0);
  #else
  	/* This moves curses to bottom right corner */
  	mvcur(curscr->_cury, curscr->_curx, LINES - 1, 0);
+ #endif
  #endif
  
  	/* Flush the curses buffer */
diff -Ncr src/melee1.c src.new/melee1.c
*** src/melee1.c	Tue Jul 25 13:57:49 2000
--- src.new/melee1.c	Mon Oct 16 12:11:37 2000
***************
*** 237,242 ****
--- 237,243 ----
  			    (p_ptr->lev >= rlev) &&
  			    ((rand_int(100) + p_ptr->lev) > 50))
  			{
+ 				/* SEEBSXXX */
  				/* Remember the Evil-ness */
  				if (m_ptr->ml)
  				{
diff -Ncr src/object2.c src.new/object2.c
*** src/object2.c	Tue Jul 25 13:57:49 2000
--- src.new/object2.c	Mon Oct 16 12:11:38 2000
***************
*** 4398,4431 ****
  		/* Analyze the spell */
  		switch (spell)
  		{
! 			case 0: sprintf(p, " dam %dd4", 3+((plev-1)/5)); break;
! 			case 2: strcpy(p, " range 10"); break;
! 			case 5: strcpy(p, " heal 2d8"); break;
! 			case 8: sprintf(p, " dam %d", 10 + (plev / 2)); break;
! 			case 10: sprintf(p, " dam %dd8", (3+((plev-5)/4))); break;
! 			case 14: sprintf(p, " range %d", plev * 10); break;
! 			case 15: strcpy(p, " dam 6d8"); break;
! 			case 16: sprintf(p, " dam %dd8", (5+((plev-5)/4))); break;
! 			case 24: sprintf(p, " dam %dd8", (8+((plev-5)/4))); break;
! 			case 26: sprintf(p, " dam %d", 30 + plev); break;
! 			case 29: sprintf(p, " dur %d+d20", plev); break;
! 			case 30: sprintf(p, " dam %d", 55 + plev); break;
! 			case 38: sprintf(p, " dam %dd8", (6+((plev-5)/4))); break;
! 			case 39: sprintf(p, " dam %d", 40 + plev/2); break;
! 			case 40: sprintf(p, " dam %d", 40 + plev); break;
! 			case 41: sprintf(p, " dam %d", 70 + plev); break;
! 			case 42: sprintf(p, " dam %d", 65 + plev); break;
! 			case 43: sprintf(p, " dam %d", 300 + plev*2); break;
! 			case 49: strcpy(p, " dur 20+d20"); break;
! 			case 50: strcpy(p, " dur 20+d20"); break;
! 			case 51: strcpy(p, " dur 20+d20"); break;
! 			case 52: strcpy(p, " dur 20+d20"); break;
! 			case 53: strcpy(p, " dur 20+d20"); break;
! 			case 54: strcpy(p, " dur 25+d25"); break;
! 			case 55: strcpy(p, " dur 30+d20"); break;
! 			case 56: strcpy(p, " dur 25+d25"); break;
! 			case 57: sprintf(p, " dur %d+d25", 30+plev); break;
! 			case 58: strcpy(p, " dur 6+d8"); break;
  		}
  	}
  
--- 4398,4487 ----
  		/* Analyze the spell */
  		switch (spell)
  		{
! 			case M_MAGIC_MISSILE:
! 				sprintf(p, " dam %dd4", 3+((plev-1)/5));
! 				break;
! 			case M_PHASE_DOOR:
! 				strcpy(p, " range 10");
! 				break;
! 			case M_CURE_LIGHT_WOUNDS:
! 				strcpy(p, " heal 2d8");
! 				break;
! 			case M_STINKING_CLOUD:
! 				sprintf(p, " dam %d", 10 + (plev / 2));
! 				break;
! 			case M_LIGHTNING_BOLT:
! 				sprintf(p, " dam %dd8", (3+((plev-5)/4)));
! 				break;
! 			case M_TELEPORT_SELF:
! 				sprintf(p, " range %d", plev * 10);
! 				break;
! 			case M_SPEAR_OF_LIGHT:
! 				strcpy(p, " dam 6d8");
! 				break;
! 			case M_FROST_BOLT:
! 				sprintf(p, " dam %dd8", (5+((plev-5)/4)));
! 				break;
! 			case M_FIRE_BOLT:
! 				sprintf(p, " dam %dd8", (8+((plev-5)/4)));
! 				break;
! 			case M_FROST_BALL:
! 				sprintf(p, " dam %d", 30 + plev);
! 				break;
! 			case M_HASTE_SELF:
! 				sprintf(p, " dur %d+d20", plev);
! 				break;
! 			case M_FIRE_BALL:
! 				sprintf(p, " dam %d", 55 + plev);
! 				break;
! 			case M_ACID_BOLT:
! 				sprintf(p, " dam %dd8", (6+((plev-5)/4)));
! 				break;
! 			case M_CLOUD_KILL:
! 				sprintf(p, " dam %d", 40 + plev/2);
! 				break;
! 			case M_ACID_BALL:
! 				sprintf(p, " dam %d", 40 + plev);
! 				break;
! 			case M_ICE_STORM:
! 				sprintf(p, " dam %d", 70 + plev);
! 				break;
! 			case M_METEOR_SWARM:
! 				sprintf(p, " dam %d", 65 + plev);
! 				break;
! 			case M_MANA_STORM:
! 				sprintf(p, " dam %d", 300 + plev*2);
! 				break;
! 			case M_RESIST_FIRE:
! 				strcpy(p, " dur 20+d20");
! 				break;
! 			case M_RESIST_COLD:
! 				strcpy(p, " dur 20+d20");
! 				break;
! 			case M_RESIST_ACID:
! 				strcpy(p, " dur 20+d20");
! 				break;
! 			case M_RESIST_POISON:
! 				strcpy(p, " dur 20+d20");
! 				break;
! 			case M_RESISTANCE:
! 				strcpy(p, " dur 20+d20");
! 				break;
! 			case M_HEROISM:
! 				strcpy(p, " dur 25+d25");
! 				break;
! 			case M_SHIELD:
! 				strcpy(p, " dur 30+d20");
! 				break;
! 			case M_BERSERKER:
! 				strcpy(p, " dur 25+d25");
! 				break;
! 			case M_ESSENCE_OF_SPEED:
! 				sprintf(p, " dur %d+d25", 30+plev);
! 				break;
! 			case M_GLOBE_OF_INVULNERABILITY:
! 				strcpy(p, " dur 6+d8");
! 				break;
  		}
  	}
  
***************
*** 4440,4469 ****
  		/* Analyze the spell */
  		switch (spell)
  		{
! 			case 1: strcpy(p, " heal 2d10"); break;
! 			case 2: strcpy(p, " dur 12+d12"); break;
! 			case 9: sprintf(p, " range %d", 3*plev); break;
! 			case 10: strcpy(p, " heal 4d10"); break;
! 			case 11: strcpy(p, " dur 24+d24"); break;
! 			case 15: strcpy(p, " dur 10+d10"); break;
! 			case 17: sprintf(p, " %d+3d6", plev + orb); break;
! 			case 18: strcpy(p, " heal 6d10"); break;
! 			case 19: strcpy(p, " dur 24+d24"); break;
! 			case 20: sprintf(p, " dur %d+d25", 3*plev); break;
! 			case 23: strcpy(p, " heal 8d10"); break;
! 			case 25: strcpy(p, " dur 48+d48"); break;
! 			case 26: sprintf(p, " dam d%d", 3*plev); break;
! 			case 27: strcpy(p, " heal 300"); break;
! 			case 28: sprintf(p, " dam d%d", 3*plev); break;
! 			case 30: strcpy(p, " heal 1000"); break;
! 			case 36: strcpy(p, " heal 4d10"); break;
! 			case 37: strcpy(p, " heal 8d10"); break;
! 			case 38: strcpy(p, " heal 2000"); break;
! 			case 41: sprintf(p, " dam d%d", 4*plev); break;
! 			case 42: sprintf(p, " dam d%d", 4*plev); break;
! 			case 45: strcpy(p, " dam 200"); break;
! 			case 52: strcpy(p, " range 10"); break;
! 			case 53: sprintf(p, " range %d", 8*plev); break;
  		}
  	}
  }
--- 4496,4573 ----
  		/* Analyze the spell */
  		switch (spell)
  		{
! 			case P_CURE_LIGHT_WOUNDS:
! 			      	strcpy(p, " heal 2d10");
! 			      	break;
! 			case P_BLESS:
! 			      	strcpy(p, " dur 12+d12");
! 			      	break;
! 			case P_PORTAL:
! 			       	sprintf(p, " range %d", 3*plev);
! 			       	break;
! 			case P_CURE_SERIOUS_WOUNDS:
! 			      	strcpy(p, " heal 4d10");
! 			      	break;
! 			case P_CHANT:
! 			      	strcpy(p, " dur 24+d24");
! 			      	break;
! 			case P_RESIST_HEAT_AND_COLD:
! 			      	strcpy(p, " dur 10+d10");
! 			      	break;
! 			case P_ORB_OF_DRAINING:
! 			        	sprintf(p, " %d+3d6", plev + orb);
! 			        	break;
! 			case P_CURE_CRITICAL_WOUNDS:
! 			      	strcpy(p, " heal 6d10");
! 			      	break;
! 			case P_SENSE_INVISIBLE:
! 			      	strcpy(p, " dur 24+d24");
! 			      	break;
! 			case P_PROTECTION_FROM_EVIL:
! 			       	sprintf(p, " dur %d+d25", 3*plev);
! 			       	break;
! 			case P_CURE_MORTAL_WOUNDS:
! 			      	strcpy(p, " heal 8d10");
! 			      	break;
! 			case P_PRAYER:
! 			      	strcpy(p, " dur 48+d48");
! 			      	break;
! 			case P_DISPEL_UNDEAD:
! 			       	sprintf(p, " dam d%d", 3*plev);
! 			       	break;
! 			case P_HEAL:
! 			      	strcpy(p, " heal 300");
! 			      	break;
! 			case P_DISPEL_EVIL:
! 			       	sprintf(p, " dam d%d", 3*plev);
! 			       	break;
! 			case P_HOLY_WORD:
! 			      	strcpy(p, " heal 1000");
! 			      	break;
! 			case P_CURE_SERIOUS_WOUNDS2:
! 			      	strcpy(p, " heal 4d10");
! 			      	break;
! 			case P_CURE_MORTAL_WOUNDS2:
! 			      	strcpy(p, " heal 8d10");
! 			      	break;
! 			case P_HEALING:
! 			      	strcpy(p, " heal 2000");
! 			      	break;
! 			case P_DISPEL_UNDEAD2:
! 			       	sprintf(p, " dam d%d", 4*plev);
! 			       	break;
! 			case P_DISPEL_EVIL2:
! 			       	sprintf(p, " dam d%d", 4*plev);
! 			       	break;
! 			case P_ANNIHILATION:
! 			      	strcpy(p, " dam 200");
! 			      	break;
! 			case P_BLINK:
! 			      	strcpy(p, " range 10");
! 			      	break;
! 			case P_TELEPORT_SELF:
! 			       	sprintf(p, " range %d", 8*plev);
! 			       	break;
  		}
  	}
  }
diff -Ncr src/spells.h src.new/spells.h
*** src/spells.h	Wed Dec 31 18:00:00 1969
--- src.new/spells.h	Mon Oct 16 12:21:46 2000
***************
*** 0 ****
--- 1,130 ----
+ enum mage_spells {
+ 	M_MAGIC_MISSILE,
+ 	M_DETECT_MONSTERS,
+ 	M_PHASE_DOOR,
+ 	M_LIGHT_AREA,
+ 	M_TREASURE_DETECTION,
+ 	M_CURE_LIGHT_WOUNDS,
+ 	M_OBJECT_DETECTION,
+ 	M_FIND_HIDDEN_TRAPS,
+ 	M_STINKING_CLOUD,
+ 	M_CONFUSE_MONSTER,
+ 	M_LIGHTNING_BOLT,
+ 	M_TRAP_DOOR_DESTRUCTION,
+ 	M_DETECT_MAGIC,
+ 	M_SLEEP_I,
+ 	M_CURE_POISON,
+ 	M_TELEPORT_SELF,
+ 	M_SPEAR_OF_LIGHT,
+ 	M_FROST_BOLT,
+ 	M_TURN_STONE_TO_MUD,
+ 	M_SATISFY_HUNGER,
+ 	M_RECHARGE_ITEM_I,
+ 	M_SLEEP_II,
+ 	M_POLYMORPH_OTHER,
+ 	M_IDENTIFY,
+ 	M_SLEEP_III,
+ 	M_FIRE_BOLT,
+ 	M_SLOW_MONSTER,
+ 	M_FROST_BALL,
+ 	M_RECHARGE_ITEM_II,
+ 	M_TELEPORT_OTHER,
+ 	M_HASTE_SELF,
+ 	M_FIRE_BALL,
+ 	M_WORD_OF_DESTRUCTION,
+ 	M_GENOCIDE,
+ 	M_DOOR_CREATION,
+ 	M_STAIR_CREATION,
+ 	M_TELEPORT_LEVEL,
+ 	M_EARTHQUAKE,
+ 	M_WORD_OF_RECALL,
+ 	M_ACID_BOLT,
+ 	M_CLOUD_KILL,
+ 	M_ACID_BALL,
+ 	M_ICE_STORM,
+ 	M_METEOR_SWARM,
+ 	M_MANA_STORM,
+ 	M_DETECT_EVIL,
+ 	M_DETECT_ENCHANTMENT,
+ 	M_RECHARGE_ITEM_III,
+ 	M_GENOCIDE2,
+ 	M_MASS_GENOCIDE,
+ 	M_RESIST_FIRE,
+ 	M_RESIST_COLD,
+ 	M_RESIST_ACID,
+ 	M_RESIST_POISON,
+ 	M_RESISTANCE,
+ 	M_HEROISM,
+ 	M_SHIELD,
+ 	M_BERSERKER,
+ 	M_ESSENCE_OF_SPEED,
+ 	M_GLOBE_OF_INVULNERABILITY,
+ };
+ 
+ enum priest_spells {
+ 	P_DETECT_EVIL,
+ 	P_CURE_LIGHT_WOUNDS,
+ 	P_BLESS,
+ 	P_REMOVE_FEAR,
+ 	P_CALL_LIGHT,
+ 	P_FIND_TRAPS,
+ 	P_DETECT_DOORS,
+ 	P_SLOW_POISON,
+ 	P_SCARE_MONSTER,
+ 	P_PORTAL,
+ 	P_CURE_SERIOUS_WOUNDS,
+ 	P_CHANT,
+ 	P_SANCTUARY,
+ 	P_SATISFY_HUNGER,
+ 	P_REMOVE_CURSE,
+ 	P_RESIST_HEAT_AND_COLD,
+ 	P_NEUTRALIZE_POISON,
+ 	P_ORB_OF_DRAINING,
+ 	P_CURE_CRITICAL_WOUNDS,
+ 	P_SENSE_INVISIBLE,
+ 	P_PROTECTION_FROM_EVIL,
+ 	P_EARTHQUAKE,
+ 	P_SENSE_SURROUNDINGS,
+ 	P_CURE_MORTAL_WOUNDS,
+ 	P_TURN_UNDEAD,
+ 	P_PRAYER,
+ 	P_DISPEL_UNDEAD,
+ 	P_HEAL,
+ 	P_DISPEL_EVIL,
+ 	P_GLYPH_OF_WARDING,
+ 	P_HOLY_WORD,
+ 	P_DETECT_MONSTERS,
+ 	P_DETECTION,
+ 	P_PERCEPTION,
+ 	P_PROBING,
+ 	P_CLAIRVOYANCE,
+ 	P_CURE_SERIOUS_WOUNDS2,
+ 	P_CURE_MORTAL_WOUNDS2,
+ 	P_HEALING,
+ 	P_RESTORATION,
+ 	P_REMEMBRANCE,
+ 	P_DISPEL_UNDEAD2,
+ 	P_DISPEL_EVIL2,
+ 	P_BANISHMENT,
+ 	P_WORD_OF_DESTRUCTION,
+ 	P_ANNIHILATION,
+ 	P_UNBARRING_WAYS,
+ 	P_RECHARGING,
+ 	P_DISPEL_CURSE,
+ 	P_ENCHANT_WEAPON,
+ 	P_ENCHANT_ARMOUR,
+ 	P_ELEMENTAL_BRAND,
+ 	P_BLINK,
+ 	P_TELEPORT_SELF,
+ 	P_TELEPORT_OTHER,
+ 	P_TELEPORT_LEVEL,
+ 	P_WORD_OF_RECALL,
+ 	P_ALTER_REALITY
+ };
+ 
+ #define B1(x) (((x) < 0) ? 0 : (x) < 32 ? (1 << (x)) : 0)
+ #define B2(x) (((x) < 0) ? 0 : (x) < 32 ? 0 : (1 << (x % 32)))
+ 
+ #define BK(a, b, c, d, e, f, g, h, i) { \
+ (B1(a) | B1(b) | B1(c) | B1(d) | B1(e) | B1(f) | B1(g) | B1(h) | B1(i)), \
+ (B2(a) | B2(b) | B2(c) | B2(d) | B2(e) | B2(f) | B2(g) | B2(h) | B2(i)) }
diff -Ncr src/spells1.c src.new/spells1.c
*** src/spells1.c	Tue Jul 25 13:57:49 2000
--- src.new/spells1.c	Mon Oct 16 12:11:38 2000
***************
*** 83,88 ****
--- 83,90 ----
  	/* Save the old location */
  	oy = m_ptr->fy;
  	ox = m_ptr->fx;
+ 	ny = m_ptr->fy;
+ 	nx = m_ptr->fx;
  
  	/* Minimum distance */
  	min = dis / 2;
diff -Ncr src/spells2.c src.new/spells2.c
*** src/spells2.c	Tue Jul 25 13:57:49 2000
--- src.new/spells2.c	Mon Oct 16 13:01:10 2000
***************
*** 10,18 ****
--- 10,83 ----
  
  #include "angband.h"
  
+ /*
+  * Return a "feeling" (or NULL) about an item.  Method 1 (Heavy).
+  */
+ static cptr value_check_aux1(object_type *o_ptr)
+ {
+ 	/* Artifacts */
+ 	if (artifact_p(o_ptr))
+ 	{
+ 		/* Cursed/Broken */
+ 		if (cursed_p(o_ptr) || broken_p(o_ptr)) return "terrible";
+ 
+ 		/* Normal */
+ 		return "special";
+ 	}
+ 
+ 	/* Ego-Items */
+ 	if (ego_item_p(o_ptr))
+ 	{
+ 		/* Cursed/Broken */
+ 		if (cursed_p(o_ptr) || broken_p(o_ptr)) return "worthless";
+ 
+ 		/* Normal */
+ 		return "excellent";
+ 	}
+ 
+ 	/* Cursed items */
+ 	if (cursed_p(o_ptr)) return "cursed";
+ 
+ 	/* Broken items */
+ 	if (broken_p(o_ptr)) return "broken";
+ 
+ 	/* Good "armor" bonus */
+ 	if (o_ptr->to_a > 0) return "good";
+ 
+ 	/* Good "weapon" bonus */
+ 	if (o_ptr->to_h + o_ptr->to_d > 0) return "good";
+ 
+ 	/* Default to "average" */
+ 	return "average";
+ }
+ 
  
+ /*
+  * Return a "feeling" (or NULL) about an item.  Method 2 (Light).
+  */
+ static cptr value_check_aux2(object_type *o_ptr)
+ {
+ 	/* Cursed items (all of them) */
+ 	if (cursed_p(o_ptr)) return "cursed";
+ 
+ 	/* Broken items (all of them) */
+ 	if (broken_p(o_ptr)) return "broken";
+ 
+ 	/* Artifacts -- except cursed/broken ones */
+ 	if (artifact_p(o_ptr)) return "good";
  
+ 	/* Ego-Items -- except cursed/broken ones */
+ 	if (ego_item_p(o_ptr)) return "good";
  
+ 	/* Good armor bonus */
+ 	if (o_ptr->to_a > 0) return "good";
+ 
+ 	/* Good weapon bonuses */
+ 	if (o_ptr->to_h + o_ptr->to_d > 0) return "good";
+ 
+ 	/* No feeling */
+ 	return (NULL);
+ }
  
  /*
   * Increase players hit points, notice effects
***************
*** 71,77 ****
  }
  
  
- 
  /*
   * Leave a "glyph of warding" which prevents monster movement
   */
--- 136,141 ----
***************
*** 968,981 ****
  			if ((cave_feat[y][x] >= FEAT_TRAP_HEAD) &&
  			    (cave_feat[y][x] <= FEAT_TRAP_TAIL))
  			{
  				/* Hack -- Memorize */
  				cave_info[y][x] |= (CAVE_MARK);
  
  				/* Redraw */
  				lite_spot(y, x);
- 
- 				/* Obvious */
- 				detect = TRUE;
  			}
  		}
  	}
--- 1032,1045 ----
  			if ((cave_feat[y][x] >= FEAT_TRAP_HEAD) &&
  			    (cave_feat[y][x] <= FEAT_TRAP_TAIL))
  			{
+ 				if (!(cave_info[y][x] & CAVE_MARK))
+ 					detect = TRUE;
+ 
  				/* Hack -- Memorize */
  				cave_info[y][x] |= (CAVE_MARK);
  
  				/* Redraw */
  				lite_spot(y, x);
  			}
  		}
  	}
***************
*** 1020,1033 ****
  			    ((cave_feat[y][x] == FEAT_OPEN) ||
  			     (cave_feat[y][x] == FEAT_BROKEN)))
  			{
  				/* Hack -- Memorize */
  				cave_info[y][x] |= (CAVE_MARK);
  
  				/* Redraw */
  				lite_spot(y, x);
- 
- 				/* Obvious */
- 				detect = TRUE;
  			}
  		}
  	}
--- 1084,1097 ----
  			    ((cave_feat[y][x] == FEAT_OPEN) ||
  			     (cave_feat[y][x] == FEAT_BROKEN)))
  			{
+ 				if (!(cave_info[y][x] & CAVE_MARK))
+ 					detect = TRUE;
+ 
  				/* Hack -- Memorize */
  				cave_info[y][x] |= (CAVE_MARK);
  
  				/* Redraw */
  				lite_spot(y, x);
  			}
  		}
  	}
***************
*** 1062,1075 ****
  			if ((cave_feat[y][x] == FEAT_LESS) ||
  			    (cave_feat[y][x] == FEAT_MORE))
  			{
  				/* Hack -- Memorize */
  				cave_info[y][x] |= (CAVE_MARK);
  
  				/* Redraw */
  				lite_spot(y, x);
- 
- 				/* Obvious */
- 				detect = TRUE;
  			}
  		}
  	}
--- 1126,1140 ----
  			if ((cave_feat[y][x] == FEAT_LESS) ||
  			    (cave_feat[y][x] == FEAT_MORE))
  			{
+ 				/* Not so obvious */
+ 				if (!(cave_info[y][x] & CAVE_MARK))
+ 					detect = TRUE;
+ 
  				/* Hack -- Memorize */
  				cave_info[y][x] |= (CAVE_MARK);
  
  				/* Redraw */
  				lite_spot(y, x);
  			}
  		}
  	}
***************
*** 1112,1125 ****
  			if ((cave_feat[y][x] == FEAT_MAGMA_K) ||
  			    (cave_feat[y][x] == FEAT_QUARTZ_K))
  			{
  				/* Hack -- Memorize */
  				cave_info[y][x] |= (CAVE_MARK);
  
  				/* Redraw */
  				lite_spot(y, x);
- 
- 				/* Detect */
- 				detect = TRUE;
  			}
  		}
  	}
--- 1177,1190 ----
  			if ((cave_feat[y][x] == FEAT_MAGMA_K) ||
  			    (cave_feat[y][x] == FEAT_QUARTZ_K))
  			{
+ 				if (!(cave_info[y][x] & CAVE_MARK))
+ 					detect = TRUE;
+ 
  				/* Hack -- Memorize */
  				cave_info[y][x] |= (CAVE_MARK);
  
  				/* Redraw */
  				lite_spot(y, x);
  			}
  		}
  	}
***************
*** 1167,1180 ****
  		/* Detect "gold" objects */
  		if (o_ptr->tval == TV_GOLD)
  		{
  			/* Hack -- memorize it */
  			o_ptr->marked = TRUE;
  
  			/* Redraw */
  			lite_spot(y, x);
- 
- 			/* Detect */
- 			detect = TRUE;
  		}
  	}
  
--- 1232,1245 ----
  		/* Detect "gold" objects */
  		if (o_ptr->tval == TV_GOLD)
  		{
+ 			if (!o_ptr->marked)
+ 				detect = TRUE;
+ 
  			/* Hack -- memorize it */
  			o_ptr->marked = TRUE;
  
  			/* Redraw */
  			lite_spot(y, x);
  		}
  	}
  
***************
*** 1220,1233 ****
  		/* Detect "real" objects */
  		if (o_ptr->tval != TV_GOLD)
  		{
  			/* Hack -- memorize it */
  			o_ptr->marked = TRUE;
  
  			/* Redraw */
  			lite_spot(y, x);
- 
- 			/* Detect */
- 			detect = TRUE;
  		}
  	}
  
--- 1285,1298 ----
  		/* Detect "real" objects */
  		if (o_ptr->tval != TV_GOLD)
  		{
+ 			if (!o_ptr->marked)
+ 				detect = TRUE;
+ 
  			/* Hack -- memorize it */
  			o_ptr->marked = TRUE;
  
  			/* Redraw */
  			lite_spot(y, x);
  		}
  	}
  
***************
*** 1287,1300 ****
  		    (tv == TV_MAGIC_BOOK) || (tv == TV_PRAYER_BOOK) ||
  		    ((o_ptr->to_a > 0) || (o_ptr->to_h + o_ptr->to_d > 0)))
  		{
  			/* Memorize the item */
  			o_ptr->marked = TRUE;
  
  			/* Redraw */
  			lite_spot(y, x);
- 
- 			/* Detect */
- 			detect = TRUE;
  		}
  	}
  
--- 1352,1365 ----
  		    (tv == TV_MAGIC_BOOK) || (tv == TV_PRAYER_BOOK) ||
  		    ((o_ptr->to_a > 0) || (o_ptr->to_h + o_ptr->to_d > 0)))
  		{
+ 			if (!o_ptr->marked)
+ 				detect = TRUE;
+ 
  			/* Memorize the item */
  			o_ptr->marked = TRUE;
  
  			/* Redraw */
  			lite_spot(y, x);
  		}
  	}
  
***************
*** 1341,1354 ****
  			/* Optimize -- Repair flags */
  			repair_mflag_mark = repair_mflag_show = TRUE;
  
  			/* Hack -- Detect the monster */
  			m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
  
  			/* Update the monster */
  			update_mon(i, FALSE);
- 
- 			/* Detect */
- 			flag = TRUE;
  		}
  	}
  
--- 1406,1419 ----
  			/* Optimize -- Repair flags */
  			repair_mflag_mark = repair_mflag_show = TRUE;
  
+ 			if (!(m_ptr->mflag & (MFLAG_MARK | MFLAG_SHOW)))
+ 				flag = TRUE;
+ 
  			/* Hack -- Detect the monster */
  			m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
  
  			/* Update the monster */
  			update_mon(i, FALSE);
  		}
  	}
  
***************
*** 1407,1420 ****
  			/* Optimize -- Repair flags */
  			repair_mflag_mark = repair_mflag_show = TRUE;
  
  			/* Hack -- Detect the monster */
  			m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
  
  			/* Update the monster */
  			update_mon(i, FALSE);
- 
- 			/* Detect */
- 			flag = TRUE;
  		}
  	}
  
--- 1472,1485 ----
  			/* Optimize -- Repair flags */
  			repair_mflag_mark = repair_mflag_show = TRUE;
  
+ 			if (!(m_ptr->mflag & (MFLAG_MARK | MFLAG_SHOW)))
+ 				flag = TRUE;
+ 
  			/* Hack -- Detect the monster */
  			m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
  
  			/* Update the monster */
  			update_mon(i, FALSE);
  		}
  	}
  
***************
*** 1474,1487 ****
  			/* Optimize -- Repair flags */
  			repair_mflag_mark = repair_mflag_show = TRUE;
  
  			/* Detect the monster */
  			m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
  
  			/* Update the monster */
  			update_mon(i, FALSE);
- 
- 			/* Detect */
- 			flag = TRUE;
  		}
  	}
  
--- 1539,1552 ----
  			/* Optimize -- Repair flags */
  			repair_mflag_mark = repair_mflag_show = TRUE;
  
+ 			if (!(m_ptr->mflag & (MFLAG_MARK | MFLAG_SHOW)))
+ 				flag = TRUE;
+ 
  			/* Detect the monster */
  			m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
  
  			/* Update the monster */
  			update_mon(i, FALSE);
  		}
  	}
  
***************
*** 1846,1851 ****
--- 1911,1966 ----
  }
  
  
+ bool
+ sense_object(object_type *o_ptr, bool heavy)
+ {
+ 	char o_name[256];
+ 	cptr feel;
+ 	int i;
+ 
+ 	/* Check for a feeling */
+ 	feel = (heavy ? value_check_aux1(o_ptr) : value_check_aux2(o_ptr));
+ 
+ 	/* Get an object description */
+ 	object_desc(o_name, o_ptr, FALSE, 0);
+ 
+ 	for (i = 0; i < INVEN_TOTAL; ++i) {
+ 		if (o_ptr == inventory + i)
+ 			break;
+ 	}
+ 	/* Message (equipment) */
+ 	if (i == INVEN_TOTAL)
+ 	{
+ 		msg_format("You feel the %s on the ground %s %s...",
+ 			   o_name,
+ 			   ((o_ptr->number == 1) ? "is" : "are"), feel);
+ 	}
+ 	else if (i >= INVEN_WIELD)
+ 	{
+ 		msg_format("You feel the %s (%c) you are %s %s %s...",
+ 			   o_name, index_to_label(i), describe_use(i),
+ 			   ((o_ptr->number == 1) ? "is" : "are"), feel);
+ 	}
+ 	/* Message (inventory) */
+ 	else
+ 	{
+ 		msg_format("You feel the %s (%c) in your pack %s %s...",
+ 			   o_name, index_to_label(i),
+ 			   ((o_ptr->number == 1) ? "is" : "are"), feel);
+ 	}
+ 
+ 	/* We have "felt" it */
+ 	o_ptr->ident |= (IDENT_SENSE);
+ 
+ 	/* Inscribe it textually */
+ 	if (!o_ptr->note) o_ptr->note = quark_add(feel);
+ 
+ 	/* Combine / Reorder the pack (later) */
+ 	p_ptr->notice |= (PN_COMBINE | PN_REORDER);
+ 
+ 	return (TRUE);
+ }
+ 
  /*
   * Identify an object in the inventory (or on the floor)
   * This routine does *not* automatically combine objects.
***************
*** 1921,1926 ****
--- 2036,2108 ----
  }
  
  
+ /*
+  * Detect magic an object in the inventory (or on the floor)
+  * This routine does *not* automatically combine objects.
+  * Returns TRUE if something was identified, else FALSE.
+  */
+ bool detect_spell(void)
+ {
+ 	int item;
+ 
+ 	object_type *o_ptr;
+ 
+ 	char o_name[80];
+ 
+ 	cptr q, s;
+ 
+ 
+ 	/* Get an item */
+ 	q = "Detect which item? ";
+ 	s = "You have nothing to detect.";
+ 	if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR)))
+ 	{
+ 		msg_format("Didn't detect anything.\n");
+ 		return (FALSE);
+ 	}
+ 
+ 	/* Get the item (in the pack) */
+ 	if (item >= 0)
+ 	{
+ 		o_ptr = &inventory[item];
+ 	}
+ 
+ 	/* Get the item (on the floor) */
+ 	else
+ 	{
+ 		o_ptr = &o_list[0 - item];
+ 	}
+ 
+ 
+ 	/* Detect magic on it */
+ 	sense_object(o_ptr, TRUE);
+ 
+ 	/* Window stuff */
+ 	p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER_0 | PW_PLAYER_1);
+ 
+ 	/* Description */
+ 	object_desc(o_name, o_ptr, TRUE, 3);
+ 
+ 	/* Describe */
+ 	if (item >= INVEN_WIELD)
+ 	{
+ 		msg_format("%^s: %s (%c).",
+ 		           describe_use(item), o_name, index_to_label(item));
+ 	}
+ 	else if (item >= 0)
+ 	{
+ 		msg_format("In your pack: %s (%c).",
+ 		           o_name, index_to_label(item));
+ 	}
+ 	else
+ 	{
+ 		msg_format("On the ground: %s.",
+ 		           o_name);
+ 	}
+ 
+ 	/* Something happened */
+ 	return (TRUE);
+ }
  
  /*
   * Fully "identify" an object in the inventory
diff -Ncr src/tables.c src.new/tables.c
*** src/tables.c	Tue Jul 25 13:57:49 2000
--- src.new/tables.c	Mon Oct 16 12:11:39 2000
***************
*** 1455,1476 ****
  			{  1,  1, 23,   4},
  			{  1,  2, 24,   4},
  			{  1,  2, 26,   4},
! 			{ 99,  0,  0,   0},
  			{  3,  3, 25,   3},
- 			{ 99,  0,  0,   0},
  			{  3,  3, 25,   1},
  			{  3,  3, 27,   3},
  
  			{  3,  4, 30,   1},
  			{  5,  4, 30,   4},
  			{  5,  5, 30,   6},
  			{  5,  5, 30,   4},
  			{  5,  5, 35,   4},
  			{  7,  6, 35,   5},
  			{  7,  6, 30,   5},
  			{  7,  6, 40,   6},
- 			{  9,  7, 44,   8},
  
  			{  9,  7, 45,   8},
  			{  9,  7, 75,   9},
  			{  9,  7, 45,   8},
--- 1455,1477 ----
  			{  1,  1, 23,   4},
  			{  1,  2, 24,   4},
  			{  1,  2, 26,   4},
! 			{  3,  2, 25,   3},
! 			{  3,  3, 25,   3},
  			{  3,  3, 25,   3},
  			{  3,  3, 25,   1},
  			{  3,  3, 27,   3},
  
  			{  3,  4, 30,   1},
  			{  5,  4, 30,   4},
+ 			{  5,  5, 60,   6},	/* detect magic? */
  			{  5,  5, 30,   6},
  			{  5,  5, 30,   4},
  			{  5,  5, 35,   4},
  			{  7,  6, 35,   5},
  			{  7,  6, 30,   5},
  			{  7,  6, 40,   6},
  
+ 			{  9,  7, 44,   8},
  			{  9,  7, 45,   8},
  			{  9,  7, 75,   9},
  			{  9,  7, 45,   8},
***************
*** 1522,1528 ****
  			{ 99,  0,  0,   0},
  			{ 99,  0,  0,   0},
  			{ 99,  0,  0,   0},
- 			{ 99,  0,  0,   0},
  			{ 99,  0,  0,   0}
  		}
  	},
--- 1523,1528 ----
***************
*** 1889,1916 ****
  {
  	{
  		/*** Mage spell books ***/
! 		{ 0x000001ff, 0x00000000 },
! 		{ 0x0003fe00, 0x00000000 },
! 		{ 0x03fc0000, 0x00000000 },
! 		{ 0xfc000000, 0x00000001 },
! 		{ 0x00000000, 0x003e0000 },
! 		{ 0x00000000, 0x0000003e },
! 		{ 0x00000000, 0x0001f000 },
! 		{ 0x00000000, 0x07c00000 },
! 		{ 0x00000000, 0x00000fc0 }
  	},
  
  	{
  		/*** Priest spell books ***/
! 		{ 0x000000ff, 0x00000000 },
! 		{ 0x0000ff00, 0x00000000 },
! 		{ 0x01ff0000, 0x00000000 },
! 		{ 0x7e000000, 0x00000000 },
! 		{ 0x00000000, 0x03f00000 },
! 		{ 0x80000000, 0x0000000f },
! 		{ 0x00000000, 0x000001f0 },
! 		{ 0x00000000, 0x000fc000 },
! 		{ 0x00000000, 0x00003e00 }
  	}
  };
  
--- 1889,2030 ----
  {
  	{
  		/*** Mage spell books ***/
! 		BK(M_MAGIC_MISSILE,
! 			M_DETECT_MONSTERS,
! 			M_PHASE_DOOR,
! 			M_LIGHT_AREA,
! 			M_TREASURE_DETECTION,
! 			M_CURE_LIGHT_WOUNDS,
! 			M_OBJECT_DETECTION,
! 			M_FIND_HIDDEN_TRAPS,
! 			M_STINKING_CLOUD),
! 		BK(M_CONFUSE_MONSTER,
! 			M_LIGHTNING_BOLT,
! 			M_TRAP_DOOR_DESTRUCTION,
! 			M_DETECT_MAGIC,
! 			M_SLEEP_I,
! 			M_CURE_POISON,
! 			M_TELEPORT_SELF,
! 			M_SPEAR_OF_LIGHT,
! 			M_FROST_BOLT),
! 		BK(M_TURN_STONE_TO_MUD,
! 			M_SATISFY_HUNGER,
! 			M_RECHARGE_ITEM_I,
! 			M_SLEEP_II,
! 			M_POLYMORPH_OTHER,
! 			M_IDENTIFY,
! 			M_SLEEP_III,
! 			M_FIRE_BOLT,
! 			M_SLOW_MONSTER),
! 		BK(M_FROST_BALL,
! 			M_RECHARGE_ITEM_II,
! 			M_TELEPORT_OTHER,
! 			M_HASTE_SELF,
! 			M_FIRE_BALL,
! 			M_WORD_OF_DESTRUCTION,
! 			M_GENOCIDE,
! 			-1, -1),
! 		BK(M_RESIST_FIRE,
! 			M_RESIST_COLD,
! 			M_RESIST_ACID,
! 			M_RESIST_POISON,
! 			M_RESISTANCE,
! 			-1, -1, -1, -1),
! 		BK(M_DOOR_CREATION,
! 			M_STAIR_CREATION,
! 			M_TELEPORT_LEVEL,
! 			M_EARTHQUAKE,
! 			M_WORD_OF_RECALL,
! 			-1, -1, -1, -1),
! 		BK(M_DETECT_EVIL,
! 			M_DETECT_ENCHANTMENT,
! 			M_RECHARGE_ITEM_III,
! 			M_GENOCIDE2,
! 			M_MASS_GENOCIDE,
! 			-1, -1, -1, -1),
! 		BK(M_HEROISM,
! 			M_SHIELD,
! 			M_BERSERKER,
! 			M_ESSENCE_OF_SPEED,
! 			M_GLOBE_OF_INVULNERABILITY,
! 			-1, -1, -1, -1),
! 		BK(M_ACID_BOLT,
! 			M_CLOUD_KILL,
! 			M_ACID_BALL,
! 			M_ICE_STORM,
! 			M_METEOR_SWARM,
! 			M_MANA_STORM,
! 			-1, -1, -1)
  	},
  
  	{
  		/*** Priest spell books ***/
! 		BK(P_DETECT_EVIL,
! 			P_CURE_LIGHT_WOUNDS,
! 			P_BLESS,
! 			P_REMOVE_FEAR,
! 			P_CALL_LIGHT,
! 			P_FIND_TRAPS,
! 			P_DETECT_DOORS,
! 			P_SLOW_POISON,
! 			-1),
! 		BK(P_SCARE_MONSTER,
! 			P_PORTAL,
! 			P_CURE_SERIOUS_WOUNDS,
! 			P_CHANT,
! 			P_SANCTUARY,
! 			P_SATISFY_HUNGER,
! 			P_REMOVE_CURSE,
! 			P_RESIST_HEAT_AND_COLD,
! 			-1),
! 		BK(P_NEUTRALIZE_POISON,
! 			P_ORB_OF_DRAINING,
! 			P_CURE_CRITICAL_WOUNDS,
! 			P_SENSE_INVISIBLE,
! 			P_PROTECTION_FROM_EVIL,
! 			P_EARTHQUAKE,
! 			P_SENSE_SURROUNDINGS,
! 			P_CURE_MORTAL_WOUNDS,
! 			P_TURN_UNDEAD),
! 		BK(P_PRAYER,
! 			P_DISPEL_UNDEAD,
! 			P_HEAL,
! 			P_DISPEL_EVIL,
! 			P_GLYPH_OF_WARDING,
! 			P_HOLY_WORD,
! 			-1, -1, -1),
! 		BK(P_BLINK,
! 			P_TELEPORT_SELF,
! 			P_TELEPORT_OTHER,
! 			P_TELEPORT_LEVEL,
! 			P_WORD_OF_RECALL,
! 			P_ALTER_REALITY,
! 			-1, -1, -1),
! 		BK(P_DETECT_MONSTERS,
! 			P_DETECTION,
! 			P_PERCEPTION,
! 			P_PROBING,
! 			P_CLAIRVOYANCE,
! 			-1, -1, -1, -1),
! 		BK(P_CURE_SERIOUS_WOUNDS2,
! 			P_CURE_MORTAL_WOUNDS2,
! 			P_HEALING,
! 			P_RESTORATION,
! 			P_REMEMBRANCE,
! 			-1, -1, -1, -1),
! 		BK(P_UNBARRING_WAYS,
! 			P_RECHARGING,
! 			P_DISPEL_CURSE,
! 			P_ENCHANT_WEAPON,
! 			P_ENCHANT_ARMOUR,
! 			P_ELEMENTAL_BRAND,
! 			-1, -1, -1),
! 		BK(P_DISPEL_UNDEAD2,
! 			P_DISPEL_EVIL2,
! 			P_BANISHMENT,
! 			P_WORD_OF_DESTRUCTION,
! 			P_ANNIHILATION,
! 			-1, -1, -1, -1)
  	}
  };
  
***************
*** 1938,1951 ****
  		"Confuse Monster",
  		"Lightning Bolt",
  		"Trap/Door Destruction",
  		"Sleep I",
  		"Cure Poison",
  		"Teleport Self",
  		"Spear of Light",
  		"Frost Bolt",
- 		"Turn Stone to Mud",
  
  		/* Incantations and Illusions (sval 2) */
  		"Satisfy Hunger",
  		"Recharge Item I",
  		"Sleep II",
--- 2052,2066 ----
  		"Confuse Monster",
  		"Lightning Bolt",
  		"Trap/Door Destruction",
+ 		"Detect Magic",
  		"Sleep I",
  		"Cure Poison",
  		"Teleport Self",
  		"Spear of Light",
  		"Frost Bolt",
  
  		/* Incantations and Illusions (sval 2) */
+ 		"Turn Stone to Mud",
  		"Satisfy Hunger",
  		"Recharge Item I",
  		"Sleep II",
***************
*** 2000,2006 ****
  		"Essence of Speed",
  		"Globe of Invulnerability",
  
- 		"(blank)",
  		"(blank)",
  		"(blank)",
  		"(blank)",
--- 2115,2120 ----
diff -Ncr src/util.c src.new/util.c
*** src/util.c	Tue Jul 25 13:57:49 2000
--- src.new/util.c	Mon Oct 16 12:11:40 2000
***************
*** 24,29 ****
--- 24,30 ----
  char *memset(char *s, int c, huge n)
  {
  	char *t;
+ 	/* SEEBSXXX */
  	for (t = s; len--; ) *t++ = c;
  	return (s);
  }
***************
*** 209,215 ****
  	/* File needs no parsing */
  	if (file[0] != '~')
  	{
! 		strcpy(buf, file);
  		return (0);
  	}
  
--- 210,216 ----
  	/* File needs no parsing */
  	if (file[0] != '~')
  	{
! 		strncat(buf, file, max);
  		return (0);
  	}
  
***************
*** 242,251 ****
  	if (!pw) return (1);
  
  	/* Make use of the info */
! 	strcpy(buf, pw->pw_dir);
  
  	/* Append the rest of the filename, if any */
! 	if (s) strcat(buf, s);
  
  	/* Success */
  	return (0);
--- 243,252 ----
  	if (!pw) return (1);
  
  	/* Make use of the info */
! 	strncat(buf, pw->pw_dir, max);
  
  	/* Append the rest of the filename, if any */
! 	if (s) strncat(buf, s, max - strlen(buf));
  
  	/* Success */
  	return (0);
diff -Ncr src/z-virt.h src.new/z-virt.h
*** src/z-virt.h	Tue Jul 25 13:57:49 2000
--- src.new/z-virt.h	Mon Oct 16 12:11:40 2000
***************
*** 75,103 ****
  
  /* Wipe an array of type T[N], at location P, and return P */
  #define C_WIPE(P,N,T) \
! 	(T*)(memset((char*)(P),0,C_SIZE(N,T)))
  
  /* Wipe a thing of type T, at location P, and return P */
  #define WIPE(P,T) \
! 	(T*)(memset((char*)(P),0,SIZE(T)))
  
  
  /* Load an array of type T[N], at location P1, from another, at location P2 */
  #define C_COPY(P1,P2,N,T) \
! 	(T*)(memcpy((char*)(P1),(char*)(P2),C_SIZE(N,T)))
  
  /* Load a thing of type T, at location P1, from another, at location P2 */
  #define COPY(P1,P2,T) \
! 	(T*)(memcpy((char*)(P1),(char*)(P2),SIZE(T)))
  
  
  /* Free an array of N things of type T at P, return NULL */
  #define C_FREE(P,N,T) \
! 	(T*)(rnfree(P,C_SIZE(N,T)))
  
  /* Free one thing of type T at P, return NULL */
  #define FREE(P,T) \
! 	(T*)(rnfree(P,SIZE(T)))
  
  
  /* Allocate, and return, an array of type T[N] */
--- 75,103 ----
  
  /* Wipe an array of type T[N], at location P, and return P */
  #define C_WIPE(P,N,T) \
! 	(memset((char*)(P),0,C_SIZE(N,T)))
  
  /* Wipe a thing of type T, at location P, and return P */
  #define WIPE(P,T) \
! 	(memset((char*)(P),0,SIZE(T)))
  
  
  /* Load an array of type T[N], at location P1, from another, at location P2 */
  #define C_COPY(P1,P2,N,T) \
! 	(memcpy((char*)(P1),(char*)(P2),C_SIZE(N,T)))
  
  /* Load a thing of type T, at location P1, from another, at location P2 */
  #define COPY(P1,P2,T) \
! 	(memcpy((char*)(P1),(char*)(P2),SIZE(T)))
  
  
  /* Free an array of N things of type T at P, return NULL */
  #define C_FREE(P,N,T) \
! 	(rnfree(P,C_SIZE(N,T)))
  
  /* Free one thing of type T at P, return NULL */
  #define FREE(P,T) \
! 	(rnfree(P,SIZE(T)))
  
  
  /* Allocate, and return, an array of type T[N] */
