[BACK]Return to fortune.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / games / larn

Annotation of src/games/larn/fortune.c, Revision 1.6

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

CVSweb <webmaster@jp.NetBSD.org>