dpr/cnf/
dpr/lib/
dpr/lib/house/
dpr/lib/misc/
dpr/lib/text/clan/
dpr/lib/text/help/
dpr/lib/world/
dpr/lib/world/qst/
dpr/src-backup/src/util/
dpr/src/
dpr/src/src code added/
/* ************************************************************************
*   File: pushup.c                                      Part of CircleMUD *
*  Usage: Does several forms of exerciseing pretaing to Dragonball Z      *
*  Name: Exerciseing                                                      *
*                                                                         *
*  All rights reserved.  See license.doc for complete information.        *
*  Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University *
*  CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991.               *
************************************************************************ */
/*I thank Jimih for giving me this modified code of Daphiner's.  =D*/


#include "conf.h"
#include "sysdep.h"

#include "structs.h"
#include "utils.h"
#include "spells.h"
#include "comm.h"
#include "db.h"
#include "handler.h"
#include "interpreter.h"

extern struct char_data *character_list;
extern struct obj_data *object_list;
extern struct room_data *world;



void check_exercise(void)
{
  struct char_data *i, *next_char;
int is_altered = FALSE;
int num_levels = 0;

  /* characters */
  for (i = character_list; i; i = next_char) {
    next_char = i->next;
	
    if (GET_POS(i) == POS_EXERCISE) {
	if (GET_HIT(i) < 10)
	{
		send_to_char("You stop doing exercises because you are to tired.\r\n", i);
        act("$n stops exercising.", FALSE, i, 0, 0, TO_ROOM);
		GET_POS(i) = POS_STANDING;
	    return;
	}
      send_to_char("&12You do a random exercise.&00\r\n", i);
      GET_EXP(i) += number(GET_LEVEL(i)*100,GET_LEVEL(i)*100);
	  GET_HIT(i) -= number(0,8);
      act("$n does a random exercise.", FALSE, i, 0, 0, TO_ROOM);
if (!IS_NPC(i) && GET_LEVEL(i) < LVL_IMMORT && GET_EXP(i) >= GET_LEVEL(i)*2000) {
GET_LEVEL(i) += 1;
GET_EXP(i) = 1;
num_levels++;
advance_level(i);
is_altered = TRUE;
send_to_char("&10You feel your power increase substantially.&00\r\n", i);
}

	}
  }
}

void check_pushup(void)
{
  struct char_data *i, *next_char;
int is_altered = FALSE;
int num_levels = 0;

  /* characters */
  for (i = character_list; i; i = next_char) {
    next_char = i->next;
	
    if (GET_POS(i) == POS_PUSHUP) {
	if (GET_HIT(i) < 10)
	{
		send_to_char("You stop doing pushups because you are to tired.\r\n", i);
        act("$n stops exercising.", FALSE, i, 0, 0, TO_ROOM);
		GET_POS(i) = POS_STANDING;
	    return;
	}
      send_to_char("&12You do a pushup.&00\r\n", i);
      GET_EXP(i) += number(GET_LEVEL(i)*100,GET_LEVEL(i)*100);
	  GET_HIT(i) -= number(0,8);
      act("$n does a pushup.", FALSE, i, 0, 0, TO_ROOM);
if (!IS_NPC(i) && GET_LEVEL(i) < LVL_IMMORT && GET_EXP(i) >= GET_LEVEL(i)*2000) {
GET_LEVEL(i) += 1;
GET_EXP(i) = 1;
num_levels++;
advance_level(i);
is_altered = TRUE;
send_to_char("&10You feel your power increase substantially.&00\r\n", i);
}
	}
  }
}

void check_situp(void)
{
  struct char_data *i, *next_char;
int is_altered = FALSE;
int num_levels = 0;

  /* characters */
  for (i = character_list; i; i = next_char) {
    next_char = i->next;

    if (GET_POS(i) == POS_SITUP) {
        if (GET_HIT(i) < 10)
        {
                send_to_char("You stop doing situps because you are to tired.\r\n", i);
        act("$n stops exercising.", FALSE, i, 0, 0, TO_ROOM);
                GET_POS(i) = POS_STANDING;
            return;
        }
      send_to_char("&12You do a situp.&00\r\n", i);
      GET_EXP(i) += number(GET_LEVEL(i)*100,GET_LEVEL(i)*100);
          GET_HIT(i) -= number(0,8);
      act("$n does a situp.", FALSE, i, 0, 0, TO_ROOM);
if (!IS_NPC(i) && GET_LEVEL(i) < LVL_IMMORT && GET_EXP(i) >= GET_LEVEL(i)*2000) {
GET_LEVEL(i) += 1;
GET_EXP(i) = 1;
num_levels++;
advance_level(i);
is_altered = TRUE;
send_to_char("&10You feel your power increase substantially.&00\r\n", i);
}

        }
  }
}

void check_bench(void)
{
  struct char_data *i, *next_char;
int is_altered = FALSE;
int num_levels = 0;

  /* characters */
  for (i = character_list; i; i = next_char) {
    next_char = i->next;

    if (GET_POS(i) == POS_BENCH) {
        if (GET_HIT(i) < 10)
        {
                send_to_char("You stop doing benchpress because you are to tired.\r\n", i);
        act("$n stops exercising.", FALSE, i, 0, 0, TO_ROOM);
                GET_POS(i) = POS_STANDING;
            return;
        }
      send_to_char("&12You do a benchpress.&00\r\n", i);
      GET_EXP(i) += number(GET_LEVEL(i)*100,GET_LEVEL(i)*100);
          GET_HIT(i) -= number(0,8);
      act("$n does a benchpress.", FALSE, i, 0, 0, TO_ROOM);
if (!IS_NPC(i) && GET_LEVEL(i) < LVL_IMMORT && GET_EXP(i) >= GET_LEVEL(i)*2000) {
GET_LEVEL(i) += 1;
GET_EXP(i) = 1;
num_levels++;
advance_level(i);
is_altered = TRUE;
send_to_char("&10You feel your power increase substantially.&00\r\n", i);
}

        }
  }
}

const char *EXERCISE =
"&12Notice&00: Automatic Exercise System\r\n"
"This system will allow your charcter to do random\r\n"
"exercises.  You will gain experience, but not gain\r\n"
"any other stat.  Your health and move pints will\r\n"
"slowly lower while you exercise.  Be very careful of\r\n"
"where you exercise at.  Aggresive by passers\r\n"
"may think you are a much better target.\r\n";

const char *PUSHUP =
"&12Notice&00: Automatic Exercise System\r\n"
"This system will allow your charcter to do pushups.\r\n"
"You will gain experience, but not gain\r\n"
"any other stat.  Your health and move points will\r\n"
"slowly lower while you exercise.  Be very careful of\r\n"
"where you exercise at.  Aggresive by passers\r\n"
"may think you are a much better target.\r\n";

const char *SITUP =
"&12Notice&00: Automatic Exercise System\r\n"
"This system will allow your charcter to do situps.\r\n"
"You will gain experience, but not gain\r\n"
"any other stat.  Your health and move points will\r\n"
"slowly lower while you exercise.  Be very careful of\r\n"
"where you exercise at.  Aggresive by passers\r\n"
"may think you are a much better target.\r\n";

const char *BENCH =
"&12Notice&00: Automatic Exercise System\r\n"
"This system will allow your charcter to do benchpresses.\r\n"
"You will gain experience, but not gain\r\n"
"any other stat.  Your health and move points will\r\n"
"slowly lower while you exercise.  Be very careful of\r\n"
"where you exercise at.  Aggresive by passers\r\n"
"may think you are a much better target.\r\n";

ACMD(do_exercise)
{

	if (GET_HIT(ch) < 10)
	{
		send_to_char("You can't exercise. You are to tired.\r\n", ch);
	    return;
	}

	if (GET_POS(ch) == POS_EXERCISE)
	{
		send_to_char("You are already exercising.\r\n", ch);
		log("Warning: Someone entered default in exercise.");
		return;
	}

	if (GET_POS(ch) == POS_FLOATING)
	{
		send_to_char("You can not exercise while floating.\r\n", ch);
		return;
	}
    if  (GET_POS(ch) == POS_STANDING)
	{
		send_to_char(EXERCISE,ch);
	    send_to_char("&12You begin doing random exerciseing.&00\r\n", ch);
        act("$n begins doing random exercises.", FALSE, ch, 0, 0, TO_ROOM);
		GET_POS(ch) = POS_EXERCISE;
		return;
	}

	send_to_char("You must be standing to begin doing exercises", ch);
}

ACMD(do_pushup)
{

	if (GET_HIT(ch) < 10)
	{
		send_to_char("You can't exercise. You are to tired.\r\n", ch);
	    return;
	}

	if (GET_POS(ch) == POS_PUSHUP)
	{
		send_to_char("You are already exercising.\r\n", ch);
		log("Warning: Someone entered default in exercise.");
		return;
	}

	if (GET_POS(ch) == POS_FLOATING)
	{
		send_to_char("You can not pushup while floating.\r\n", ch);
		return;
	}
    if  (GET_POS(ch) == POS_STANDING)
	{
		send_to_char(PUSHUP,ch);
	    send_to_char("&12You begin doing some pushups.&00\r\n", ch);
        act("$n begins doing some pushups.", FALSE, ch, 0, 0, TO_ROOM);
		GET_POS(ch) = POS_PUSHUP;
		return;
	}

	send_to_char("You must be standing to begin doing pushups", ch);
}

ACMD(do_situp)
{

        if (GET_HIT(ch) < 10)
        {
                send_to_char("You can't exercise. You are to tired.\r\n", ch);
            return;
        }

        if (GET_POS(ch) == POS_SITUP)
        {
                send_to_char("You are already exercising.\r\n", ch);
                log("Warning: Someone entered default in exercise.");
                return;
        }

        if (GET_POS(ch) == POS_FLOATING)
        {
                send_to_char("You can not situp while floating.\r\n", ch);
                return;
        }
    if  (GET_POS(ch) == POS_STANDING)
        {
                send_to_char(SITUP,ch);
            send_to_char("&12You begin doing some situps.&00\r\n", ch);
        act("$n begins doing some situps.", FALSE, ch, 0, 0, TO_ROOM);
                GET_POS(ch) = POS_SITUP;
                return;
        }

        send_to_char("You must be standing to begin doing pushups", ch);
}

ACMD(do_benchpress)
{

        if (GET_HIT(ch) < 10)
        {
                send_to_char("You can't exercise. You are to tired.\r\n", ch);
            return;
        }

        if (GET_POS(ch) == POS_SITUP)
        {
                send_to_char("You are already exercising.\r\n", ch);
                log("Warning: Someone entered default in exercise.");
                return;
        }

        if (GET_POS(ch) == POS_FLOATING)
        {
                send_to_char("You can not benchpress while floating.\r\n", ch);
                return;
        }
    if  (GET_POS(ch) == POS_STANDING)
        {
                send_to_char(BENCH,ch);
            send_to_char("&12You begin doing some benchpresses.&00\r\n", ch);
        act("$n begins doing some benchpresses.", FALSE, ch, 0, 0, TO_ROOM);
                GET_POS(ch) = POS_BENCH;
                return;
        }

        send_to_char("You must be standing to begin doing pushups", ch);
}
void check_powerup1(void)
{
  int MANA = 0;
  struct char_data *i, *next_char;

  /* characters */
  for (i = character_list; i; i = next_char) {
    next_char = i->next;

    if (GET_POS(i) == POS_POWERUP) {
        if (GET_MANA(i) >= GET_MAX_MANA(i))
        {
                send_to_char("You stop powering up as your body is at it's limits.\r\n", i);
        act("$n stops powering up.", FALSE, i, 0, 0, TO_ROOM);
                GET_POS(i) = POS_STANDING;
            return;
        }
               send_to_char("You begin screaming as your aura bursts out around you, and rocks begin to float up.\r\n", i);
        GET_POS(i) = POS_POWERUP;
        MANA = number(0, GET_MAX_MANA(i)/2);
        GET_MANA(i) = GET_MANA(i) + MANA;
        }
  }
}