]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - hack/hack.mkobj.c
1 /* $NetBSD: hack.mkobj.c,v 1.4 1997/10/19 16:58:29 christos Exp $ */
4 * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
9 __RCSID("$NetBSD: hack.mkobj.c,v 1.4 1997/10/19 16:58:29 christos Exp $");
15 char mkobjstr
[] = "))[[!!!!????%%%%/=**))[[!!!!????%%%%/=**(%";
21 struct obj
*otmp
= mkobj(let
);
33 struct obj
*otmp
= mksobj(otyp
);
45 let
= mkobjstr
[rn2(sizeof(mkobjstr
) - 1)];
49 CORPSE
+ ((let
> 'Z') ? (let
- 'a' + 'Z' - '@' + 1) : (let
- '@'))
63 char let
= objects
[otyp
].oc_olet
;
68 otmp
->o_id
= flags
.ident
++;
72 otmp
->dknown
= strchr("/=!?*", let
) ? 0 : 1;
75 otmp
->quan
= (otmp
->otyp
<= ROCK
) ? rn1(6, 6) : 1;
84 if (otmp
->otyp
>= CORPSE
)
86 #ifdef NOT_YET_IMPLEMENTED
87 /* if tins are to be identified, need to adapt doname() etc */
88 if (otmp
->otyp
== TIN
)
90 #endif /* NOT_YET_IMPLEMENTED */
91 /* fall into next case */
93 otmp
->quan
= rn2(6) ? 1 : 2;
113 if (otmp
->otyp
== WAN_WISHING
)
117 (objects
[otmp
->otyp
].bits
& NODIR
) ? 11 : 4);
120 if (objects
[otmp
->otyp
].bits
& SPEC
) {
126 } else if (otmp
->otyp
== RIN_TELEPORTATION
||
127 otmp
->otyp
== RIN_AGGRAVATE_MONSTER
||
128 otmp
->otyp
== RIN_HUNGER
|| !rn2(9))
132 panic("impossible mkobj");
134 otmp
->owt
= weight(otmp
);
142 return (('@' <= c
&& c
<= 'Z') || ('a' <= c
&& c
<= 'z'));
149 int wt
= objects
[obj
->otyp
].oc_weight
;
150 return (wt
? wt
* obj
->quan
: (obj
->quan
+ 1) / 2);
158 long amount
= (num
? num
: 1 + (rnd(dlevel
+ 2) * rnd(30)));
160 if ((gold
= g_at(x
, y
)) != NULL
)
161 gold
->amount
+= amount
;
167 gold
->amount
= amount
;
169 /* do sth with display? */