1*86d7f5d3SJohn Marino /*-
2*86d7f5d3SJohn Marino * Copyright (c) 1991 The Regents of the University of California.
3*86d7f5d3SJohn Marino * All rights reserved.
4*86d7f5d3SJohn Marino *
5*86d7f5d3SJohn Marino * Redistribution and use in source and binary forms, with or without
6*86d7f5d3SJohn Marino * modification, are permitted provided that the following conditions
7*86d7f5d3SJohn Marino * are met:
8*86d7f5d3SJohn Marino * 1. Redistributions of source code must retain the above copyright
9*86d7f5d3SJohn Marino * notice, this list of conditions and the following disclaimer.
10*86d7f5d3SJohn Marino * 2. Redistributions in binary form must reproduce the above copyright
11*86d7f5d3SJohn Marino * notice, this list of conditions and the following disclaimer in the
12*86d7f5d3SJohn Marino * documentation and/or other materials provided with the distribution.
13*86d7f5d3SJohn Marino * 3. Neither the name of the University nor the names of its contributors
14*86d7f5d3SJohn Marino * may be used to endorse or promote products derived from this software
15*86d7f5d3SJohn Marino * without specific prior written permission.
16*86d7f5d3SJohn Marino *
17*86d7f5d3SJohn Marino * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18*86d7f5d3SJohn Marino * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19*86d7f5d3SJohn Marino * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20*86d7f5d3SJohn Marino * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21*86d7f5d3SJohn Marino * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22*86d7f5d3SJohn Marino * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23*86d7f5d3SJohn Marino * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24*86d7f5d3SJohn Marino * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25*86d7f5d3SJohn Marino * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26*86d7f5d3SJohn Marino * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27*86d7f5d3SJohn Marino * SUCH DAMAGE.
28*86d7f5d3SJohn Marino *
29*86d7f5d3SJohn Marino * @(#)fortune.c 5.5 (Berkeley) 6/10/91
30*86d7f5d3SJohn Marino * $FreeBSD: src/games/larn/fortune.c,v 1.2 1999/11/30 03:48:59 billf Exp $
31*86d7f5d3SJohn Marino * $DragonFly: src/games/larn/fortune.c,v 1.3 2006/08/26 17:05:05 pavalos Exp $
32*86d7f5d3SJohn Marino */
33*86d7f5d3SJohn Marino
34*86d7f5d3SJohn Marino /* fortune.c Larn is copyrighted 1986 by Noah Morgan. */
35*86d7f5d3SJohn Marino #include "header.h"
36*86d7f5d3SJohn Marino
37*86d7f5d3SJohn Marino /*
38*86d7f5d3SJohn Marino * function to return a random fortune from the fortune file
39*86d7f5d3SJohn Marino */
40*86d7f5d3SJohn Marino
41*86d7f5d3SJohn Marino const char *flines[] = {
42*86d7f5d3SJohn Marino "gem value = gem * 2 ^ perfection",
43*86d7f5d3SJohn Marino "sitting down can have unexpected results",
44*86d7f5d3SJohn Marino "don't pry into the affairs of others",
45*86d7f5d3SJohn Marino "drinking can be hazardous to your health",
46*86d7f5d3SJohn Marino "beware of the gusher!",
47*86d7f5d3SJohn Marino "some monsters are greedy",
48*86d7f5d3SJohn Marino "nymphs have light fingers",
49*86d7f5d3SJohn Marino "try kissing a disenchantress!",
50*86d7f5d3SJohn Marino "hammers and brains don't mix",
51*86d7f5d3SJohn Marino "what does a potion of cure dianthroritis taste like?",
52*86d7f5d3SJohn Marino "hit point gain/loss when raising a level depends on constitution",
53*86d7f5d3SJohn Marino "healing a mighty wizard can be exhilarating",
54*86d7f5d3SJohn Marino "be sure to pay your taxes",
55*86d7f5d3SJohn Marino "are Vampires afraid of something?",
56*86d7f5d3SJohn Marino "some dragons can fly",
57*86d7f5d3SJohn Marino "dos thou strive for perfection?",
58*86d7f5d3SJohn Marino "patience is a virtue, unless your daughter dies",
59*86d7f5d3SJohn Marino "what does the Eye of Larn see in its guardian?",
60*86d7f5d3SJohn Marino "a level 25 player casts like crazy!",
61*86d7f5d3SJohn Marino "energy rings affect spell regeneration",
62*86d7f5d3SJohn Marino "difficulty affects regeneration",
63*86d7f5d3SJohn Marino "control of the pesty spirits is most helpful",
64*86d7f5d3SJohn Marino "don't fall into a bottomless pit",
65*86d7f5d3SJohn Marino "dexterity allows you to carry more",
66*86d7f5d3SJohn Marino "you can get 2 points of WC for the price of one",
67*86d7f5d3SJohn Marino "never enter the dungeon naked! the monsters will laugh at you!",
68*86d7f5d3SJohn Marino "did someone put itching powder in your armor?",
69*86d7f5d3SJohn Marino "you klutz!",
70*86d7f5d3SJohn Marino "avoid opening doors. you never know whats on the other side.",
71*86d7f5d3SJohn Marino "infinite regeneration ---> temptation",
72*86d7f5d3SJohn Marino "the greatest weapon in the game has not the highest Weapon Class",
73*86d7f5d3SJohn Marino "you can't buy the most powerful scroll",
74*86d7f5d3SJohn Marino "identify things before you use them",
75*86d7f5d3SJohn Marino "there's more than one way through a wall"
76*86d7f5d3SJohn Marino };
77*86d7f5d3SJohn Marino
78*86d7f5d3SJohn Marino #define NFORTUNES 34
79*86d7f5d3SJohn Marino
80*86d7f5d3SJohn Marino const char *
fortune(void)81*86d7f5d3SJohn Marino fortune(void)
82*86d7f5d3SJohn Marino {
83*86d7f5d3SJohn Marino return (flines[random() % NFORTUNES]);
84*86d7f5d3SJohn Marino }
85