/***************************************************************************
* Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, *
* Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe. *
* *
* Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael *
* Chastain, Michael Quan, and Mitchell Tse. *
* *
* In order to use any part of this Merc Diku Mud, you must comply with *
* both the original Diku license in 'license.doc' as well the Merc *
* license in 'license.txt'. In particular, you may not remove either of *
* these copyright notices. *
* *
* Much time and thought has gone into this software and you are *
* benefitting. We hope that you share your changes too. What goes *
* around, comes around. *
***************************************************************************/
#include <glib.h>
#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <merc.h>
#include <interp.h>
#include <fight.h>
#include <tables.h>
#include <power.h>
int has_sphere( CHAR_DATA *ch, int discipline_no )
{
sh_int count;
if (IS_NPC(ch))
return 0;
for ( count = 0 ; count <= 9 ; count++ )
{
if ( ch->pcdata->discipline[discipline_no] > count )
continue;
else
break;
}
return count;
}
int get_disc( CHAR_DATA * ch, int discipline_no )
{
sh_int count;
if (IS_NPC(ch))
return 0;
for ( count = 0 ; count < 10 ; count++ )
{
if ( ch->pcdata->disc[discipline_no] > count )
continue;
else
break;
}
return count;
}
int get_breed( CHAR_DATA *ch, int disc )
{
int max = 5;
if (disc < BREED_HOMID || disc > BREED_METIS)
{
bug( "Get_breed: Out of breed range.", 0 );
return 0;
}
if (IS_NPC(ch)) return 0;
if (ch->pcdata->breed[disc] > max)
return max;
else if (ch->pcdata->breed[disc] < 0)
return 0;
return ch->pcdata->breed[disc];
}
int get_auspice( CHAR_DATA *ch, int disc )
{
int max = 5;
if (disc < AUSPICE_RAGABASH || disc > AUSPICE_AHROUN)
{
bug( "Get_auspice: Out of auspice range.", 0 );
return 0;
}
if (IS_NPC(ch)) return 0;
if (ch->pcdata->auspice[disc] > max)
return max;
else if (ch->pcdata->auspice[disc] < 0)
return 0;
return ch->pcdata->auspice[disc];
}
int get_tribe( CHAR_DATA *ch, int disc )
{
int max = 5;
if (disc < TRIBE_BLACK_FURIES || disc > TRIBE_GLASSWALKERS)
{
bug( "Get_tribe: Out of tribe range.", 0 );
return 0;
}
if (IS_NPC(ch)) return 0;
if (ch->pcdata->tribes[disc] > max)
return max;
else if (ch->pcdata->tribes[disc] < 0)
return 0;
return ch->pcdata->tribes[disc];
}