Atrinik Server 2.5
server/info.c
Go to the documentation of this file.
00001 /************************************************************************
00002 *            Atrinik, a Multiplayer Online Role Playing Game            *
00003 *                                                                       *
00004 *    Copyright (C) 2009-2011 Alex Tokar and Atrinik Development Team    *
00005 *                                                                       *
00006 * Fork from Daimonin (Massive Multiplayer Online Role Playing Game)     *
00007 * and Crossfire (Multiplayer game for X-windows).                       *
00008 *                                                                       *
00009 * This program is free software; you can redistribute it and/or modify  *
00010 * it under the terms of the GNU General Public License as published by  *
00011 * the Free Software Foundation; either version 2 of the License, or     *
00012 * (at your option) any later version.                                   *
00013 *                                                                       *
00014 * This program is distributed in the hope that it will be useful,       *
00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00017 * GNU General Public License for more details.                          *
00018 *                                                                       *
00019 * You should have received a copy of the GNU General Public License     *
00020 * along with this program; if not, write to the Free Software           *
00021 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.             *
00022 *                                                                       *
00023 * The author can be reached at admin@atrinik.org                        *
00024 ************************************************************************/
00025 
00031 #include <global.h>
00032 
00034 void dump_abilities()
00035 {
00036     archetype *at;
00037 
00038     for (at = first_archetype; at; at = at->next)
00039     {
00040         const char *ch, *gen_name = "";
00041         archetype *gen;
00042 
00043         if (!QUERY_FLAG(&at->clone, FLAG_MONSTER))
00044         {
00045             continue;
00046         }
00047 
00048         /* Get rid of e.g. multiple black puddings */
00049         if (QUERY_FLAG(&at->clone, FLAG_CHANGING))
00050         {
00051             continue;
00052         }
00053 
00054         for (gen = first_archetype; gen; gen = gen->next)
00055         {
00056             if (gen->clone.other_arch && gen->clone.other_arch == at)
00057             {
00058                 gen_name = gen->name;
00059                 break;
00060             }
00061         }
00062 
00063         ch = describe_item(&at->clone);
00064         LOG(llevInfo, "%-16s|%6"FMT64"|%4d|%3d|%s|%s|%s\n", at->clone.name, at->clone.stats.exp, at->clone.stats.hp, at->clone.stats.ac, ch, at->name, gen_name);
00065     }
00066 }
00067 
00069 void print_monsters()
00070 {
00071     archetype *at;
00072     object *op;
00073     int i;
00074 
00075     LOG(llevInfo, "               |     |   |    |    |                                  attacks/ resistances                                                                                              |\n");
00076     LOG(llevInfo, "monster        | hp  |dam| ac | wc | phy mag fir ele cld cfs acd drn wmg ght poi slo par tim fea cnc dep dth chs csp gpw hwd bln int lst sla cle pie net son dem psi |  exp   | new exp |\n");
00077     LOG(llevInfo, "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n");
00078 
00079     for (at = first_archetype; at != NULL; at = at->next)
00080     {
00081         op = arch_to_object(at);
00082 
00083         if (QUERY_FLAG(op, FLAG_MONSTER))
00084         {
00085             LOG(llevInfo, "%-15s|%5d|%3d|%4d|%4d|", op->arch->name, op->stats.maxhp, op->stats.dam, op->stats.ac, op->stats.wc);
00086 
00087             for (i = 0; i < NROFATTACKS; i++)
00088             {
00089                 LOG(llevInfo, "%4d", op->attack[i]);
00090             }
00091 
00092             LOG(llevInfo, " |\n               |     |   |    |    |");
00093 
00094             for (i = 0; i < NROFATTACKS; i++)
00095             {
00096                 LOG(llevInfo, "%4d", op->protection[i]);
00097             }
00098 
00099             LOG(llevInfo, " |%8"FMT64"|\n", op->stats.exp);
00100         }
00101     }
00102 }