<Someone>'s touchstone code and a bee swarm bit.

This commit is contained in:
nethack.allison
2002-01-09 03:31:30 +00:00
parent 40e0f19b53
commit 767335698b
10 changed files with 227 additions and 115 deletions

View File

@@ -9,7 +9,7 @@
static const char tools[] = { TOOL_CLASS, WEAPON_CLASS, WAND_CLASS, 0 };
static const char tools_too[] = { ALL_CLASSES, TOOL_CLASS, POTION_CLASS,
WEAPON_CLASS, WAND_CLASS, 0 };
WEAPON_CLASS, WAND_CLASS, GEM_CLASS, 0 };
#ifdef TOURIST
STATIC_DCL int FDECL(use_camera, (struct obj *));
@@ -1761,6 +1761,73 @@ reset_trapset()
trapinfo.tobj = 0;
}
STATIC_OVL void
use_stone(otmp)
struct obj *otmp;
{
struct obj *obj;
char allowall[2];
const char *color = 0;
static const char *ambiguous = "You make scratch marks on the stone";
allowall[0] = ALL_CLASSES;
allowall[1] = '\0';
if (!(obj = getobj(allowall, "rub on the stone")))
return;
if (otmp->cursed && obj->oclass == GEM_CLASS && rnd(5) == 1) {
pline(
(Blind ? "You feel something shatter" :
(Hallucination ? "Oh, wow, look at the pretty shards" :
"A sharp crack shatters %s %s")),
(obj->quan == 1 ? "the" : "a"),
lcase(makesingular(let_to_name(obj->oclass, FALSE))));
useup(obj);
return;
}
if (Blind) {
pline("\"scritch, scritch\"");
return;
}
if (Hallucination) {
pline("Oh wow, man: Fractals!");
return;
}
if (otmp->otyp != TOUCHSTONE) {
pline(ambiguous);
return;
}
switch (obj->oclass) {
case GOLD:
color = "golden";
break;
case GEM_CLASS:
if (otmp->blessed) {
makeknown(TOUCHSTONE);
makeknown(obj->otyp);
prinv((char *)0, obj, 0L);
return;
}
/* FALLTHROUGH */
case RING_CLASS:
if (objects[obj->otyp].oc_material == GLASS) {
pline(ambiguous); /* yet not amibguous if a known touchstone */
return;
}
color = c_obj_colors[objects[obj->otyp].oc_color];
break;
default:
pline("\"scritch, scritch\"");
return;
}
pline("You see %s streaks on the stone", color);
return;
}
/* Place a landmine/bear trap. Helge Hafting */
STATIC_OVL void
use_trap(otmp)
@@ -2417,7 +2484,8 @@ doapply()
register int res = 1;
if(check_capacity((char *)0)) return (0);
obj = getobj(carrying(POT_OIL) ? tools_too : tools, "use or apply");
obj = getobj(carrying(POT_OIL) || carrying(TOUCHSTONE)
? tools_too : tools, "use or apply");
if(!obj) return 0;
if (obj->oclass == WAND_CLASS)
@@ -2601,6 +2669,9 @@ doapply()
case BEARTRAP:
use_trap(obj);
break;
case TOUCHSTONE:
use_stone(obj);
break;
default:
/* Pole-weapons can strike at a distance */
if (is_pole(obj)) {

View File

@@ -210,6 +210,25 @@ NEARDATA struct c_color_names c_color_names = {
"white"
};
const char *c_obj_colors[] = {
"black", /* CLR_BLACK */
"red", /* CLR_RED */
"green", /* CLR_GREEN */
"brown", /* CLR_BROWN */
"blue", /* CLR_BLUE */
"magenta", /* CLR_MAGENTA */
"cyan", /* CLR_CYAN */
"gray", /* CLR_GRAY */
"transparent", /* no_color */
"orange", /* CLR_ORANGE */
"bright green", /* CLR_BRIGHT_GREEN */
"yellow", /* CLR_YELLOW */
"bright blue", /* CLR_BRIGHT_BLUE */
"bright magenta", /* CLR_BRIGHT_MAGENTA */
"bright cyan", /* CLR_BRIGHT_CYAN */
"white", /* CLR_WHITE */
};
struct c_common_strings c_common_strings = {
"Nothing happens.", "That's enough tries!",
"That is a silly thing to %s.", "shudder for a moment.",

View File

@@ -873,7 +873,7 @@ dokick()
int cnt = rnl(5);
coord mm;
mm.x = x; mm.y = y;
pline("You've disturbed the occupants!");
pline("You've attracted the tree's former occupants!");
while (cnt--)
if (enexto(&mm, mm.x, mm.y, &mons[PM_KILLER_BEE]))
(void) makemon(&mons[PM_KILLER_BEE],

View File

@@ -927,7 +927,8 @@ GEM("worthless piece of violet glass", "violet", 77, 1, 0, 6, 5, GLASS, CLR_MAGE
ROCK("luckstone", "gray", 0, 10, 10, 60, 3, 3, 1, 10, 7, MINERAL, CLR_GRAY),
ROCK("loadstone", "gray", 0, 10, 500, 1, 3, 3, 1, 10, 6, MINERAL, CLR_GRAY),
ROCK("flint", "gray", 0, 18, 10, 1, 6, 6, 0, 10, 7, MINERAL, CLR_GRAY),
ROCK("flint", "gray", 0, 10, 10, 1, 6, 6, 0, 10, 7, MINERAL, CLR_GRAY),
ROCK("touchstone", "gray", 0, 8, 10, 45, 3, 3, 1, 10, 6, MINERAL, CLR_GRAY),
ROCK("rock", (char *)0, 1,100, 10, 0, 3, 3, 0, 10, 7, MINERAL, CLR_GRAY),
#undef GEM
#undef ROCK

View File

@@ -33,6 +33,7 @@ static struct trobj Archeologist[] = {
{ FOOD_RATION, 0, FOOD_CLASS, 3, 0 },
{ PICK_AXE, UNDEF_SPE, TOOL_CLASS, 1, UNDEF_BLESS },
{ TINNING_KIT, UNDEF_SPE, TOOL_CLASS, 1, UNDEF_BLESS },
{ TOUCHSTONE, 0, GEM_CLASS, 1, 1 },
{ SACK, 0, TOOL_CLASS, 1, 0 },
{ 0, 0, 0, 0, 0 }
};
@@ -606,7 +607,6 @@ u_init()
if(!rn2(10)) ini_inv(Tinopener);
else if(!rn2(4)) ini_inv(Lamp);
else if(!rn2(10)) ini_inv(Magicmarker);
knows_class(GEM_CLASS);
knows_object(SACK);
skill_init(Skill_A);
break;