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