Ejemplo n.º 1
0
int main(int argc, char *argv[])
{
	log_info("My name: %s, age: %d", MY_NAME, get_age());

	set_age(100);

	log_info("My age is now: %d", get_age());

	log_info("THE_SIZE is; %d", THE_SIZE);
	print_size();

	THE_SIZE = 9;

	log_info("THE SIZE is now: %d", THE_SIZE);
	print_size();

	log_info("Ratio at first: %f", update_ratio(2.0));
	log_info("Ratio again: %f", update_ratio(10.0));
	log_info("Ratio once more: %f", update_ratio(300.0));

	int count = 4;
	scope_demo(count);
	scope_demo(count * 20);
	
	log_info("count after calling scope_demo: %d", count);
	
	log_info("The value of ratio is : %f", *RATIO_PTR);

	test_func();
	log_info("The value of x outside test_func is : %d", *xptr);
	scope_demo(14);
	log_info("The value of x outside test_func is : %d", *xptr);

	return 0;
}
Ejemplo n.º 2
0
int main(int argc, char *argv[])
{
	log_info("my name: %s, age: %d", MY_NAME, get_age());

	set_age(100);

	log_info("my age is now: %d", get_age());

	// test ou thte SIZE_EXTERN
	log_info("THE_SIZE is: %d", THE_SIZE);
	print_size();

	log_info("Ratio at first: %f", *update_ratio(2.0));
	log_info("Ratio again: %f", *update_ratio(10));
	log_info("Ratio once more: %f", *update_ratio(300.0));

	int count = 4;
	scope_demo(count);
	scope_demo(count * 20);

	log_info("count after calling scope_demo: %d", count);

	double *static_ratio = update_ratio(0.5);
	log_info("reaching in to the static ratio: %f", *static_ratio);

	*static_ratio = .001;
	
	log_info("changed the static ration in to the static ratio: %f", *static_ratio);

	return 0;
}
Ejemplo n.º 3
0
/** \brief Compute vital state (satiation, energy, age) for the next cycle.

    - Mark creature as aged, if age is greater as max age.
    - Mark creature as starved, if satiation falls under half of the maximum
    satiation.
    - Mark creature as underfed, if energy level falls under half of the maximum
    energy.
*/
void
Creature::next_vital_state() {

    if (living_state == LivingState::alive()) {

        set_age(get_age() + 1);
        if (get_age() == get_max_age()) {
            living_state = LivingState::aged();
        }
        else {
            set_satiation(get_raw_satiation() - get_satiation_consumption());
            if (get_satiation() == 0) {
                living_state = LivingState::starved();
            }
            else {

                // TODO (joobog#2#): code verbessern
                double value = 2 * get_energy_consumption() *
                    ((double) get_satiation() /
                     (double) get_max_satiation() - (double) 0.5);

                if ( value < 0) {
                    set_energy(get_raw_energy() - (unsigned int) (-value));
                }
                if ( value > 0) {
                    set_energy(get_raw_energy() + (unsigned int) value);
                }

                if (get_energy() == 0) {
                    living_state = LivingState::underfed();
                }
            }
        }
    }
}
Ejemplo n.º 4
0
int
main(int argc, char *argv[]) {
    const double    value = 2.0;
    NL;
    log_info("name in ex22-main.c = %s, static int THE_AGE in ex22.c is = %d",
             MY_NAME, get_age());

    log_info("nset static int THE_AGE in ex22.c to 30:");
    set_age(30);
    log_info("static int THE_AGE in ex22.c in main() is now: %d", get_age());
    NL;
    log_info("can't directly access static int THE_AGE in ex22.c in main:");
    log_info("-> log_info(\"THE_AGE = %%d\", THE_AGE);");
    NL;
    log_info("can't directly access int THE_SIZE in ex22.c in main:");
    log_info("-> log_info(\"THE_SIZE = %%d\", THE_SIZE);");
    NL;
    log_info("can directly access int THE_EXTERN_SIZE in ex22.c in main:");
    log_info("THE_EXTERN_SIZE = %d", THE_EXTERN_SIZE);
    NL;
    log_info("update value to (double) THE_EXTERN_SIZE from %.1f",
             update_static((double) THE_EXTERN_SIZE));
    log_info("update value to const double value from %.1f", update_static(value));
    log_info("update value to 10.0 from %.1f", update_static(10.0));
    NL;

    return 0;
}
Ejemplo n.º 5
0
int main()
{
	log_info("My name : %s, age: %d",MY_NAME,get_age());
	
	set_age(100);
	
	log_info("My name now is : %d",get_age());
	
	log_info("THE_SIZE is: %d", THE_SIZE);
	
	print_size();
	
	THE_SIZE = 9;

    log_info("THE SIZE is now: %d", THE_SIZE);
    print_size();
    
    log_info("Ratio at first: %f", update_ratio(2.0));
    log_info("Ratio again: %f", update_ratio(10.0));
    log_info("Ratio once more: %f", update_ratio(300.0));
    
    // test the scope demo
    int count = 4;
    scope_demo(count);
    scope_demo(count * 20);

    log_info("count after calling scope_demo: %d", count);
    
	return 0;
}
Ejemplo n.º 6
0
int main(int argc, char **argv) {
  log_info("My name is %s, age is %d", MY_NAME, get_age());

  set_age(100);

  log_info("My age is now %d", get_age());

  log_info("THE SIZE is %d", THE_SIZE);
  print_size();

  THE_SIZE = 9;

  log_info("THE SIZE is now %d", THE_SIZE);
  print_size();

  log_info("Ratio at first: %f", update_ratio(2.0));
  log_info("Ratio again: %f", update_ratio(10.0));
  log_info("Ratio once more: %f", update_ratio(300.0));

  int count = 4;
  scope_demo(count);
  scope_demo(count * 20);

  log_info("count after calling scope demo %d", count);

  return 0;
}
Ejemplo n.º 7
0
int main(int argc, char *argv[])
{
    log_info("my name %s, age %d", MY_NAME, get_age());

    set_age(100);

    log_info("my age is now %d", get_age());
    log_info("THE_SIZE is %d", THE_SIZE);
    print_size();

    THE_SIZE = 9;

    log_info("THE_SIZE is now %d ", THE_SIZE);
    print_size();

    log_info("ratio at first : %f", update_ratio(2.0));
    log_info("ratio now : %f", update_ratio(10.0));
    log_info("ratio finally : %f", update_ratio(300.0));

    int count = 4;
    scope_demo(count);
    scope_demo(count * 20);

    log_info("Count after calling scope_demo : %d", count);

    return 0;
}
Ejemplo n.º 8
0
int main(int argc, const char *argv[])
{
	log_info("My name: %s, age: %d",MY_NAME,get_age());
	set_age(24);
	log_info("My age is now: %d",get_age());

	log_info("The Size is: %d",THE_SIZE);
	print_size();

	THE_SIZE=9;
	log_info("The Size is now: %d",THE_SIZE);
	print_size();

	log_info("Ratio at first: %f",update_ratio(2.0));
	log_info("Ratio again: %f",update_ratio(10.0));
	log_info("Ratio once more: %f",update_ratio(300.0));

	int count=4;
	scope_demo(count);
	scope_demo(count*20);

	log_info("Count after calling scope_demo: %d",count);
	return 0;

	return 0;
}
Ejemplo n.º 9
0
int main(int argc, char *argv[])
{
    // test out THE_AGE accessors
    log_info("My name: %s, age: %d", MY_NAME, get_age());

    set_age(100);

    log_info("My age is now: %d", get_age());

    // test out THE_SIZE extern
    log_info("THE_SIZE is: %d", THE_SIZE);
    print_size();

    THE_SIZE = 9;

    log_info("THE_SIZE is now: %d", THE_SIZE);
    print_size();

    //test the ratio function static
    log_info("Ratio at first: %f", update_ratio(2.0));
    log_info("Ratio again: %f", update_ratio(10.0));
    log_info("Ratio once more: %f", update_ratio(300.0));

    // test the scope demo
    int count = 4;
    scope_demo(count);
    scope_demo(count * 20);

    log_info("count after calling scope_demo: %d", count);

    return 0;
}
Ejemplo n.º 10
0
int main(int argc, char *argv[])
{
    // test out THE_AGE accessors
    log_info("My name: %s, age: %d", MY_NAME, get_age());

    set_age(100);

    log_info("My age is now: %d", get_age());

    int new_age = 44;
    log_info("Setting age directly to %d", new_age);
    int *age = get_age_pointer();
    *age = new_age;

    log_info("My age is now: %d", get_age());

    // test out THE_SIZE extern
    log_info("THE_SIZE is: %d", THE_SIZE);
    print_size();

    THE_SIZE = 9;

    log_info("THE_SIZE is now: %d", THE_SIZE);
    print_size();

    // test the ratio function static
    log_info("Ratio at first: %f", update_ratio(2.0));
    log_info("Ratio again: %f", update_ratio(10.0));
    log_info("Ratio once more: %f", update_ratio(300.0));

    // accessing a function static
    double *func_static_value = get_function_static(4.0);
    log_info("get_function_static(4.0) = %.1f", *func_static_value);
    double new_func_static_value = 8.0;
    log_info("Setting the function static var directly to %.1f",
            new_func_static_value);
    *func_static_value = new_func_static_value;
    log_info("get_function_static(4.0) = %.1f", *get_function_static(4.0));

    // test the scope demo
    int count = 4;
    scope_demo(count);
    scope_demo(count * 20);

    log_info("count after calling scope_demo: %d", count);

    return 0;
}
Ejemplo n.º 11
0
/* Print pathogen content */
void print_pathogen(struct pathogen *in){
	int i, N=get_nb_snps(in);
	printf("\n age %d, %d snps:\n", get_age(in),N);
	if(N>0) {
		for(i=0;i<N;i++) printf("%d ", get_snps(in)[i]);
	}
}
Ejemplo n.º 12
0
/* Copy pathogen */
struct pathogen * copy_pathogen(struct pathogen *in){
	int i, N=get_nb_snps(in);
	struct pathogen *out = (struct pathogen *) malloc(sizeof(struct pathogen));

	if(out == NULL){
		fprintf(stderr, "\n[in: pathogen.c->copy_pathogen]\nNo memory left for copying pathogen. Exiting.\n");
		exit(1);
	}

	/* copy content */
	out->age = get_age(in);
	out->ances = get_ances(in);

	out->snps = create_vec_int(N);
	if(N>0 && get_snps(out) == NULL){
		fprintf(stderr, "\n[in: pathogen.c->copy_pathogen]\nNo memory left for copying pathogen genome. Exiting.\n");
		exit(1);
	}

	for(i=0;i<N;i++){ /* copy snps */
		out->snps->values[i] = get_snps(in)[i];
	}


	return out;
}
Ejemplo n.º 13
0
void do_arenajoin(CHAR_DATA *ch, char *argument)
{
  char buf[MAX_STRING_LENGTH];
  int arenapeople=0;
  DESCRIPTOR_DATA *d;

  if (IS_NPC(ch)) return;
  if (ch->fight_timer > 0)
  {
    send_to_char("You have a fighttimer.\n\r",ch);
    return;
  }
  if ((get_age(ch) - 17) < 2)
  {
    send_to_char("Your still a newbie.\n\r",ch);
    return;
  }
  if (!arenaopen)
  {
    send_to_char("The arena is closed.\n\r",ch);
    return;
  }
  if (arena_base && is_upgrade(ch))
  {
    send_to_char("Your an upgrade, not for you this time.\n\r",ch);
    return;
  }
  if (ch->in_room != NULL)
  {
    if (IS_SET (ch->in_room->room_flags, ROOM_ARENA))
    {
      send_to_char("Your in the arena.\n\r",ch);
      return;
    }
  }
  for ( d = descriptor_list; d != NULL; d = d->next )
  {
    if ( d->character != NULL )
    {
      if (!d->connected == CON_PLAYING) continue;
      if (d->character->in_room != NULL)
      {
        if (IS_SET (d->character->in_room->room_flags, ROOM_ARENA)) arenapeople++;
      }
    }
  }
  if (arenapeople > ARENA_PLAYERS)
  {
    send_to_char("The arena is crowded atm.\n\r",ch);
    return;
  }
  char_from_room(ch);
  char_to_room(ch, get_room_index(next_arena_room));
  next_arena_room += (ARENA_HVNUM - ARENA_LVNUM) / ARENA_PLAYERS;
  sprintf(buf,"%s has joined the arena!",ch->name);
  do_info(ch,buf);
  do_restore(ch,"self");
  SET_BIT(ch->act, PLR_FREEZE);
  return;
}
Ejemplo n.º 14
0
/* Uselessly useless age thing */
void do_age(CHAR_DATA *ch)
{
    char buf[MSL];
        sprintf(buf, "{YYou are {c%d {Yyears old, played {c%d {Yhours.{x\n\r", get_age(ch), (int)(ch->played+current_time-ch->logon)/3600);
        send_to_char(buf,ch);
        sprintf(buf, "{YYou have connected to RotK {c%d{Y times.{x\n\r", ch->pcdata->timesplayed);
        send_to_char(buf,ch);
        return;
}
Ejemplo n.º 15
0
int main(int argc, char *argv[])
{
	// test out THE_AGE accessors
	log_info("My names: %s, age: %d", MY_NAME, get_age());

	set_age(100);

	log_info("My age is now: %d", get_age());

	// test out THE_SIZE extern
	log_info("THE_SIZE is: %d", THE_SIZE);
	print_size();

	THE_SIZE = 9;

	log_info("THE_SIZE is now: %d", THE_SIZE);
	print_size();

	// test the ration function static
	log_info("Ratio at first: %f", update_ratio(2.0));
	log_info("Ratio again: %f", update_ratio(10.0));
	log_info("Ratio once more: %f", update_ratio(300.0));

	double *res = update_ratio_ptr(2.0);
	log_info("Ratio by pointer: %f\n", *res);
	*res = 100.0;
	res = update_ratio_ptr(15.0);
	log_info("Ratio by pointer: %f\n", *res);

	// test the scope demo
	int count = 4;
	scope_demo(count);
	scope_demo(count * 20);

	log_info("count after calling scope_demo: %d", count);

	log_info("Recursive result: %llu\n", recursive(100000, 0));

	return 0;
}
Ejemplo n.º 16
0
int main(int argc, char** argv) {
        log_info("My name is %s and I am %d years old.", MY_NAME, get_age());

        set_age(100);

        log_info("Now I'm older! I'm %d.", get_age());

        log_info("The size is: %d", THE_SIZE);
        print_size();

        THE_SIZE = 9;

        log_info("The size is now: %d", THE_SIZE);
        print_size();

        // test the ratio function static
        log_info("Ratio: %f", *update_ratio(2.0));
        log_info("Ratio: %f", *update_ratio(10.0));
        log_info("Ratio: %f", *update_ratio(300.0));

        double* evil = update_ratio(1.0);

        // H4X. I grabbed a static function variable and am changing its
        // contents here.
        log_info("%f", *evil);
        *evil = 123.0;
        log_info("%f", *evil);
        update_ratio(9);

        // test the scope demo
        int count = 4;
        scope_demo(count);
        scope_demo(count * 20);

        log_info("count after calling scope_demo: %d", count);

        return 0;
}
Ejemplo n.º 17
0
int main(int argc, char *argv[])
{
	// test out THE_AGE accessors
	log_info("My name: %s, age: %d", MY_NAME, get_age());
	set_age(200);
	log_info("My age is now: %d", get_age());
	// test out THE_SIZE extern
	log_info("THE_SIZE is: %d", THE_SIZE);
	log_info("The address of THE_SIZE is: %p", &THE_SIZE);
	print_size();

	THE_SIZE = 9;

	log_info("The SIZE is now: %d", THE_SIZE);
	print_size();

	// test the ratio function static
	log_info("Ratio at first: %f", update_ratio(2.0));
	log_info("Ratio again: %f", update_ratio(10.0));
	log_info("Ratio once more: %f", update_ratio(300.0));

	// test the scope demo
	int count = 4;
	scope_demo(count);
	scope_demo(count * 20);
/*	
	log_info("count after calling scope_demo: %d", count);
	log_info("The ratio is: %f", ratio);

	log_info("The address of THE_AGE: %p", &get_age());
	log_info("The current value of THE_AGE: %d", get_age());
	*get_age() = 0;
	log_info("After setting THE_AGE pointer to 0 THE_AGE value is: %d", THE_AGE);	
*/
	return 0;
}
Ejemplo n.º 18
0
void Human::show()
{
	cout << "--------------------------------------------------\n"
		<< get_name() << " " << get_last_name() << " ";
	if (sex == 1)
		cout << "male ";
	else if (sex == 2)
		cout << "female ";
	cout << get_age() << "\n";
	cout << "\n";

	if (get_nfavorite_books() != 0)
	{
		cout << get_nfavorite_books() << " favorite books:\n";
		for (int i = 0; i < get_nfavorite_books(); i++)
			cout << i + 1 << ". " << get_favorite_books()[i] << "\n";

		cout << "\n";
	}
}
Ejemplo n.º 19
0
void age_metapopulation(struct metapopulation * metapop, struct param * par){
	struct pathogen *ppat;
	int i, maxnpat = get_maxnpat(metapop);

	/* pathogens ages */
	for(i=0;i<maxnpat;i++){
		ppat = (metapop->pathogens)[i]; /* to make code more readable*/
		if(!isNULL_pathogen(ppat)){ /* if pathogen exists */
			ppat->age = ppat->age+1; /* get older */
			if(get_age(ppat) > par->t2) { /* die if you must */
				ppat->age = -1; /* inactivate pathogen */

				/* update nrec and ninf in corresponding population */
				(metapop->populations[ppat->popid])->nrec = (metapop->populations[ppat->popid])->nrec + 1;
				(metapop->populations[ppat->popid])->ninf = (metapop->populations[ppat->popid])->ninf - 1;
				ppat->popid = -1; /* inactivate pathogen */
			}
		}
	}
} /* end age_metapopulation */
Ejemplo n.º 20
0
int null_pointer_interproc() {
  struct Person* joe = Person_create(32, 64, 140);
  return get_age(joe);
}
Ejemplo n.º 21
0
void init_SN(void)
{
  int i, j, guess_on_Nsteps;

  double astep, meanweight;

  char buf[200], buffer[200], mode[2];

#if defined(LT_METAL_COOLING_WAL)
  double Redshift;
#endif
  
#if defined (UM_CHEMISTRY) && defined (UM_METAL_COOLING)
  um_FillEl_mu = 40.0;
#endif

  /* : ....................... : */
  if(ThisTask == 0)		/* :[ open some output file ]: */
    {
       printf("Initializing SN\n");

      if(RestartFlag == 0)
	strcpy(mode, "w");
      else
	strcpy(mode, "a");

      sprintf(buf, "%s%s", All.OutputDir, "sn_init.txt");	/*   this will list all the fundamental data */
      if((FdSnInit = fopen(buf, mode)) == 0x0)	/*   about supernonave                       */
	{
	  printf("error in opening file '%s'\n", buf);
	  endrun(1);
	}

      if(strcmp(mode, "a") == 0x0)
	fprintf(FdSnInit, "========================================\n" "restarting from a= %g\n\n", All.Time);

#ifdef LT_SEv_INFO_DETAILS
      sprintf(buf, "%s%s", All.OutputDir, "sn_details.dat");	/*   this file will contain all the details */
      /*   about all the sn evolution steps       */
      if((FdSnDetails = fopen(buf, mode)) == 0x0)
	{
	  printf("error in opening file '%s'\n", buf);
	  endrun(1);
	}
#endif
      sprintf(buf, "%s%s", All.OutputDir, "warnings.txt");	/*   this file will store all warnings      */
      if((FdWarn = fopen(buf, mode)) == 0x0)
	{
	  printf("error in opening file '%s'\n", buf);
	  endrun(1);
	}
    }

  UnitMassFact = All.UnitMass_in_g / SOLAR_MASS;

  /* : ................ : */
  /* :[ metals StartUp ]: */
  read_metals();

  /* : ................................ : */
  /* :[ allocate integration workspace ]: */
  w = gsl_integration_workspace_alloc(gsl_ws_dim);
  old_error_handler = gsl_set_error_handler(&fsolver_error_handler);
  /* : ................... : */
  /* :[ start the cooling ]: */

  All.Time = All.TimeBegin;
  set_cosmo_factors_for_current_time();
  InitCool();
#ifdef LT_METAL_COOLING_WAL
  WalCool_tables_load(0);                                                /* use z=0 tables for initializing */
#endif
  
  /* : ............................... :    */
  /* :[ start the IMF  and SF StartUp ]:    */
  
#ifndef LT_METAL_COOLING
  ZBins = 1;
  ThInst_onset = (double *) mymalloc("ThInst_onset", 1 * sizeof(double));
  ThInst_onset[0] = 5;
#endif

  allocate_IMF_integration_space();	/*    allocate memory for IMF integration */
  load_SFs_IMFs();		/*    load IMF and SF files               */
  All.Generations = 0;

  for(i = 0; i < IMFs_dim; i++)	/*    normalize IMFs by mass if they are not */
    {
      if(IMFs[i].NParams > 0 || IMFs[i].timedep)
	IMFs[i].getp(i, IMFs[i].Params, All.Time);	/*    get parameters for a (time-dependent) IMF */

      IMFs[i].Atot = 1.0 / IntegrateIMF_byMass(IMFs[i].Mm, IMFs[i].MU, &IMFs[i], INC_BH);
      if(IMFs[i].NSlopes == 1)
	IMFs[i].A[0] = IMFs[i].Atot;
    }

  for(i = 0; i < SFs_dim; i++)
    if(SFs[i].Generations > All.Generations)
      All.Generations = SFs[i].Generations;	/*    set All.Generations to the maximum */

  if(ThisTask == 0)
    for(i = 0; i < SFs_dim; i++)
      if(All.Generations % SFs[i].Generations != 0)
	{
	  printf("!!!! max # of generations %d is not an integer multiple of the # of gen. for SF %d\n",
		 All.Generations, i);
	  endrun(99119911);
	}

  for(All.StarBits = 0; All.Generations > (1 << All.StarBits); All.StarBits++);

  if(ThisTask == 0)		/*    write infos about IMFs */
    {
      for(i = 0; i < IMFs_dim; i++)
	write_IMF_info(i, stdout);
      for(i = 0; i < IMFs_dim; i++)
	write_IMF_info(i, FdSnInit);
      for(i = 0; i < IMFs_dim; i++)
	print_IMF(i, All.IMFfilename);

      for(i = 0; i < SFs_dim; i++)
	write_SF_info(i, stdout);
      for(i = 0; i < SFs_dim; i++)
	write_SF_info(i, FdSnInit);
    }
  /* : .................................. : */
  /* :[ initialize the packing stricture ]: */

#ifdef LT_TRACK_CONTRIBUTES
  init_packing();
#endif

  if(strcasecmp(All.SnIaDataFile, "none") == 0 || All.Ia_Nset_ofYields == 0)
    UseSnIa = 0;
  else
    UseSnIa = 1;

  if(strcasecmp(All.SnIIDataFile, "none") == 0 || All.II_Nset_ofYields == 0)
    UseSnII = 0;
  else
    UseSnII = 1;

  if(strcasecmp(All.AGBDataFile, "none") == 0 || All.AGB_Nset_ofYields == 0)
    UseAGB = 0;
  else
    UseAGB = 1;

  /* : ............................................... : */
  /* :[ initialize time scales for stellar evolutions ]: */
  initialize_star_lifetimes();

  if(ThisTask == 0)
    {
      fprintf(FdSnInit, "[stellar evolution initialization - lifetimes]");
      fprintf(FdSnInit, "\nstellar lifetimes: mean (%5.4g Msun) = %g Gyrs\n", All.Mup, All.mean_lifetime);
      for(i = 0; i < IMFs_dim; i++)
	fprintf(FdSnInit, "   IMF %3d         inf (%5.4g Msun) = %g Gyrs\n"
		"                   sup (%5.4g Msun) = %g Gyrs\n",
		i, IMFs[i].MU, IMFs[i].inf_lifetime, min(IMFs[i].Mm, All.MBms), IMFs[i].sup_lifetime);
    }

  /* : ............ : */
  /* :[ Sn StartUp ]: */

  /*    reading yields */

  ReadYields(1, 1, 1);
  /* : ............ : */
  /* :[ SF StartUp ]: */


  /* Set some SF-related Units (old set_units_sfr) */
  meanweight = 4 / (1 + 3 * HYDROGEN_MASSFRAC);	/* note: assuming NEUTRAL GAS */

  All.EgySpecCold = 1 / meanweight * (1.0 / GAMMA_MINUS1) * (BOLTZMANN / PROTONMASS) * All.TempClouds;
  All.EgySpecCold *= All.UnitMass_in_g / All.UnitEnergy_in_cgs;

  meanweight = 4 / (8 - 5 * (1 - HYDROGEN_MASSFRAC));	/* note: assuming FULL ionization */

  All.OverDensThresh =
    All.CritOverDensity * All.OmegaBaryon * 3 * All.Hubble * All.Hubble / (8 * M_PI * All.G);

#ifdef INTERNAL_CRIT_DENSITY
  All.PhysDensThresh = All.CritPhysDensity;
#else
  All.PhysDensThresh = All.CritPhysDensity * PROTONMASS / HYDROGEN_MASSFRAC / All.UnitDensity_in_cgs /
    (All.HubbleParam * All.HubbleParam);
#endif
#ifdef LT_STARBURSTS
  if(All.StarBurstCondition == SB_DENSITY)
    All.SB_Density_Thresh *= PROTONMASS / HYDROGEN_MASSFRAC / All.UnitDensity_in_cgs /
      (All.HubbleParam * All.HubbleParam);
#endif

  /* ----------- */

  SnII_ShortLiv_Yields = (double ***) mymalloc("SnII_ShortLiv_Yields", sizeof(double **) * SFs_dim);

  for(i = 0; i < SFs_dim; i++)
    {
      if(All.PhysDensThresh > 0 && SFs[i].PhysDensThresh[0] == 0)
	SFs[i].PhysDensThresh[0] = All.PhysDensThresh;
      else
	/* Phys Dens Thresh is supposed to be in hydrogen number density cm^-3 */
	SFs[i].PhysDensThresh[0] *= PROTONMASS / HYDROGEN_MASSFRAC / All.UnitDensity_in_cgs /
	  (All.HubbleParam * All.HubbleParam);
      if(All.egyIRA_ThMass > 0)
	SFs[i].egyShortLiv_MassTh = All.egyIRA_ThMass;
      if(All.metIRA_ThMass > 0)
	SFs[i].metShortLiv_MassTh = All.metIRA_ThMass;
      if(All.WindEfficiency > 0)
	SFs[i].WindEfficiency = All.WindEfficiency;
      if(All.WindEnergyFraction > 0)
	SFs[i].WindEnergyFraction = All.WindEnergyFraction;

      setup_SF_related(i);

      /* ................::................... */

      SFs[i].ShortLiv_MassTh = max(SFs[i].metShortLiv_MassTh, SFs[i].egyShortLiv_MassTh);
      SFs[i].ShortLiv_TimeTh = min(SFs[i].metShortLiv_TimeTh, SFs[i].egyShortLiv_TimeTh);

    }


#ifdef LT_METAL_COOLING_WAL
  Redshift = 1.0 / All.Time - 1.0;
  set_cooltable_index(-1);
  WalCool_tables_load(Redshift);
#endif
  
  /* ...........: initialize stepping :...................... */

  ShortLiv_Nsteps = (int *) mymalloc("ShortLiv_Nsteps", SFs_dim * sizeof(int));

  LongLiv_Nsteps = (int *) mymalloc("LongLiv_Nsteps", SFs_dim * sizeof(int));

  Nsteps = (int *) mymalloc("Nsteps", SFs_dim * sizeof(int));
  SNtimesteps = (double ***) mymalloc("SNtimesteps", SFs_dim * sizeof(double *));

  for(i = 0; i < SFs_dim; i++)
    {
      if(UseSnII)
	guess_on_Nsteps = (int) (1.3 / All.SnII_Step_Prec);
      else
	guess_on_Nsteps = 0;


      if(!IMFs[SFs[i].IMFi].timedep)
	ShortLiv_Nsteps[i] = guess_on_Nsteps;
      else
	ShortLiv_Nsteps[i] = 0;

      if(UseSnIa || UseAGB)
	guess_on_Nsteps = (int) (1.3 / All.LLv_Step_Prec);
      else
	guess_on_Nsteps = 0;

      if(!IMFs[SFs[i].IMFi].timedep)
	LongLiv_Nsteps[i] = guess_on_Nsteps;
      else
	LongLiv_Nsteps[i] = 0;


      Nsteps[i] = ShortLiv_Nsteps[i] + LongLiv_Nsteps[i];
      sprintf(buffer, "SNtimesteps_imf_%02d", i);
      SNtimesteps[i] = (double **) mymalloc(buffer, 2 * sizeof(double *));

      sprintf(buffer, "SNtimesteps_timebins_imf_%02d", i);
      SNtimesteps[i][0] = (double *) mymalloc(buffer, Nsteps[i] * sizeof(double));
      memset(SNtimesteps[i][0], 0, Nsteps[i] * sizeof(double));

      sprintf(buffer, "SNtimesteps_timedelta_imf_%02d", i);
      SNtimesteps[i][1] = (double *) mymalloc(buffer, Nsteps[i] * sizeof(double));
      memset(SNtimesteps[i][1], 0, Nsteps[i] * sizeof(double));

      build_SN_Stepping(i);

      /* ...........: write the SNtimestep table :................... */

      if(ThisTask == 0)
	{
	  fprintf(FdSnInit, "\n[time stepping :: %d]\n" "%10s\t%20s\n", i, "time (Gyr)", "timestep (Gyr)");
	  for(j = 0; j < Nsteps[i]; j++)
	    fprintf(FdSnInit, "%8.5lg \t%8.5lg\n", SNtimesteps[i][0][j], SNtimesteps[i][1][j]);
	  fflush(FdSnInit);
	}
    }

  /* ...........: build arrays to interpolate a vs t :................... */

  accel = gsl_interp_accel_alloc();
  spline = gsl_spline_alloc(gsl_interp_cspline, TIME_INTERP_SIZE);

  astep = pow(10, log10(1.0 / 0.001) / TIME_INTERP_SIZE);
  aarray[0] = 0.001;
  tarray[0] = 0;
  cosmic_time = get_age(0.001);

  for(i = 1; i < TIME_INTERP_SIZE; i++)
    {
      aarray[i] = aarray[i - 1] * astep;
      tarray[i] = cosmic_time - get_age(aarray[i]);
    }
  gsl_spline_init(spline, tarray, aarray, TIME_INTERP_SIZE);

  /* */

  if(ThisTask == 0)
    fflush(stdout);

  /* ....... */

#ifdef LT_SEvDbg
  do_spread_dbg_list = (int *) mymalloc("do_spread_dbg_list", NTask * sizeof(int));
#endif

#ifdef LT_SEv_INFO
  Zmass = (double *) mymalloc("Zmass", SFs_dim * (SPECIES * 2) * LT_NMet * 4 * sizeof(double));
  memset(Zmass, 0, SFs_dim * (SPECIES * 2) * LT_NMet * 4 * sizeof(double));
  tot_Zmass = Zmass + SFs_dim * (SPECIES * 2) * LT_NMet;
  SNdata = tot_Zmass + SFs_dim * (SPECIES * 2) * LT_NMet;
  tot_SNdata = SNdata + SFs_dim * (SPECIES * 2) * LT_NMet;
#endif

  sfrrates = (double *) mymalloc("sfrrates", sizeof(double) * SFs_dim);
  totsfrrates = (double *) mymalloc("ttosfrrates", sizeof(double) * SFs_dim);

  sum_sm = (double *) mymalloc("sum_sm", SFs_dim * 4 * sizeof(double));
  memset(sum_sm, 0, SFs_dim * sizeof(double));

  total_sm = sum_sm + SFs_dim;
  sum_mass_stars = total_sm + SFs_dim;
  total_sum_mass_stars = sum_mass_stars + SFs_dim;

  return;
}
Ejemplo n.º 22
0
int parse_condition(const char* condition, const Json::Value& input)
	{
	if ( !condition )
		{
		return -1;
		}

	if ( !*condition )
		{
		return 1;
		}

	std::string o_Location;
	std::string o_Uid;
	std::string dati;

	nlp::nlptime o_Time;

	if (input.isMember("usr_id"))		
	{
		o_Uid = input["usr_id"].asString();		
	}

	//o_Uid = input["usr_id"].asString();		
	dati = input["time"].asString();
	o_Location = input["pos"].asString();


	if ( dati.length() )
	{
		o_Time.set(dati.c_str());
	}
	else
	{
		o_Time.set(time(NULL));
	}

	char szStringValue[1024];	//规则中的字符串型值缓存
	char szNodeString[1024];	//节点中的字符串信息
	float nIntValue;		//规则中的整型值缓存
	float nNodeInt;		//节点中的整型信息

	const char* pChar = condition;
	int nReturnValue2 = 1;
	//条件部分
	int nFindPos;
	while (*pChar)
		{
		if (strchr("pu",*pChar))//char * 型:q
			{
			switch (*pChar)
				{
				case 'p'://place,地点信息
					pChar ++;
					sprintf(szNodeString,START_END_CHAR"%s"START_END_CHAR, o_Location.c_str());
					break;
				case 'u'://usrid
					pChar ++;
					sprintf(szNodeString,START_END_CHAR"%s"START_END_CHAR, o_Uid.c_str());
					break;
				default:
					return -1;
				}

			char cOp = *pChar;
			if (*(pChar+1) != '\"')
				{
				return -1;
				}
			nFindPos = (int)strcspn(pChar+2,"\"");
			strncpy(szStringValue,pChar+2,nFindPos);//取得规则中的字符串型数据
			nFindPos = (int)strcspn(pChar+2,"\"");
			szStringValue[nFindPos] = '\0';

			//printf("%s-------%s------\n", szNodeString, szStringValue);

			nReturnValue2 = 1;
			switch (cOp)
				{
				case '{':
					if (smstrstr(szStringValue,szNodeString,true)==NULL)	//Modified begin by zgchen	,2002-8-13 9:48:27

						{
						nReturnValue2 = 0;
						}
					break;
				case '}':
					if (smstrstr(szNodeString,szStringValue,true)==NULL) //Modified begin by zgchen	,2002-8-13 9:48:37

						{
						nReturnValue2 = 0;
						}
					break;
				case '#':
					//if (stricmp(szNodeString,szStringValue))
					if (strcasecmp(szNodeString,szStringValue))
						{
						nReturnValue2 = 0;
						}
					break;
				case '!':
					//Modifided begin by zgchen	,2003-3-18 11:58:39
					if (*(pChar+1) == '{')	//不被包括
						{
						if (smstrstr(szStringValue,szNodeString))
							{
							nReturnValue2 = 0;
							}
						}
					else if (*(pChar+1) == '}')	//不包括
						{
						if (smstrstr(szNodeString,szStringValue))
							{
							nReturnValue2 = 0;
							}
						}
					else 
						{
						if (!strcmp(szNodeString,szStringValue))
							{
							nReturnValue2 = 0;
							}
						}
					break;
					//Added/Modified end by zgchen2003-3-18 11:58:43
				default:
					//SMASSERT(0,"pChar must be in {}#");
					return -1;
					break;
				}
			}
		else if (strchr("hwdse",*pChar))//int 型
			{
			switch (*pChar)
				{
				case 'h'://小时
					nNodeInt = get_time(o_Time);
					break;
				case 'w'://周几
					nNodeInt = get_weekday(o_Time);
					break;
				case 'd'://日期
					nNodeInt = get_date(o_Time);
					break;
				case 's'://性别
					nNodeInt = get_sex();
					break;
				case 'e'://年龄
					nNodeInt = get_age();
					break;
				default:
					return -1;
					break;
				}
			pChar ++;
			nIntValue = (float)atof(pChar + 1);	//取得规则中的整型数据
			switch (*pChar)
				{
				case '<':
					if (nNodeInt > nIntValue)
						{
						nReturnValue2 = 0;						
						}
					break;
				case '>':
					if (nNodeInt < nIntValue)
						{
						nReturnValue2 = 0;						
						}
					break;
				case '=':
					if (nNodeInt != nIntValue)
						{
						nReturnValue2 = 0;						
						}
					break;
				case '!':
					if (nNodeInt == nIntValue)
						{
						nReturnValue2 = 0;
						}
					break;
				default:
					return -1;
					break;
				}
			}
		else
			{
			return -1;
			}

		if (nReturnValue2)
			{
			nFindPos = (int)strcspn(pChar,"+*");
			if(pChar[nFindPos])
				{
				if (pChar[nFindPos]=='+')
					{
					//nFindPos = strcspn(pChar,")");
					pChar += strlen(pChar);
					}
				else
					{
					pChar += nFindPos + 1;
					}
				}
			else
				{
				pChar +=nFindPos;
				}
			}
		else
			{
			nFindPos = (int)strcspn(pChar,"+");
			if (pChar[nFindPos]=='+')
				{
				pChar += nFindPos + 1;
				}
			else
				{
				pChar += nFindPos;
				}
			}
		}
	return nReturnValue2;
	}
Ejemplo n.º 23
0
void do_oldscore( CHAR_DATA * ch, const char *argument )
{
   AFFECT_DATA *paf;
   SKILLTYPE *skill;

   if( IS_AFFECTED( ch, AFF_POSSESS ) )
   {
      send_to_char( "You can't do that in your current state of mind!\r\n", ch );
      return;
   }

   set_char_color( AT_SCORE, ch );
   ch_printf( ch,
              "You are %s%s, level %d, %d years old (%d hours).\r\n",
              ch->name, IS_NPC( ch ) ? "" : ch->pcdata->title, ch->top_level, get_age( ch ), ( get_age( ch ) - 17 ) );

   if( get_trust( ch ) != ch->top_level )
      ch_printf( ch, "You are trusted at level %d.\r\n", get_trust( ch ) );

   if( IS_SET( ch->act, ACT_MOBINVIS ) )
      ch_printf( ch, "You are mobinvis at level %d.\r\n", ch->mobinvis );


   ch_printf( ch, "You have %d/%d hit, %d/%d movement.\r\n", ch->hit, ch->max_hit, ch->move, ch->max_move );

   ch_printf( ch,
              "You are carrying %d/%d items with weight %d/%d kg.\r\n",
              ch->carry_number, can_carry_n( ch ), ch->carry_weight, can_carry_w( ch ) );

   ch_printf( ch,
              "Str: %d  Int: %d  Wis: %d  Dex: %d  Con: %d  Cha: %d  Lck: ??  Frc: ??\r\n",
              get_curr_str( ch ),
              get_curr_int( ch ), get_curr_wis( ch ), get_curr_dex( ch ), get_curr_con( ch ), get_curr_cha( ch ) );

   ch_printf( ch, "You have have %d credits.\r\n", ch->gold );

   if( !IS_NPC( ch ) )
      ch_printf( ch,
                 "You have achieved %d glory during your life, and currently have %d.\r\n",
                 ch->pcdata->quest_accum, ch->pcdata->quest_curr );

   ch_printf( ch,
              "Autoexit: %s   Autoloot: %s   Autosac: %s   Autocred: %s\r\n",
              ( !IS_NPC( ch ) && IS_SET( ch->act, PLR_AUTOEXIT ) ) ? "yes" : "no",
              ( !IS_NPC( ch ) && IS_SET( ch->act, PLR_AUTOLOOT ) ) ? "yes" : "no",
              ( !IS_NPC( ch ) && IS_SET( ch->act, PLR_AUTOSAC ) ) ? "yes" : "no",
              ( !IS_NPC( ch ) && IS_SET( ch->act, PLR_AUTOGOLD ) ) ? "yes" : "no" );

   ch_printf( ch, "Wimpy set to %d hit points.\r\n", ch->wimpy );

   if( !IS_NPC( ch ) && ch->pcdata->condition[COND_DRUNK] > 10 )
      send_to_char( "You are drunk.\r\n", ch );
   if( !IS_NPC( ch ) && ch->pcdata->condition[COND_THIRST] == 0 )
      send_to_char( "You are thirsty.\r\n", ch );
   if( !IS_NPC( ch ) && ch->pcdata->condition[COND_FULL] == 0 )
      send_to_char( "You are hungry.\r\n", ch );

   switch ( ch->mental_state / 10 )
   {
      default:
         send_to_char( "You're completely messed up!\r\n", ch );
         break;
      case -10:
         send_to_char( "You're barely conscious.\r\n", ch );
         break;
      case -9:
         send_to_char( "You can barely keep your eyes open.\r\n", ch );
         break;
      case -8:
         send_to_char( "You're extremely drowsy.\r\n", ch );
         break;
      case -7:
         send_to_char( "You feel very unmotivated.\r\n", ch );
         break;
      case -6:
         send_to_char( "You feel sedated.\r\n", ch );
         break;
      case -5:
         send_to_char( "You feel sleepy.\r\n", ch );
         break;
      case -4:
         send_to_char( "You feel tired.\r\n", ch );
         break;
      case -3:
         send_to_char( "You could use a rest.\r\n", ch );
         break;
      case -2:
         send_to_char( "You feel a little under the weather.\r\n", ch );
         break;
      case -1:
         send_to_char( "You feel fine.\r\n", ch );
         break;
      case 0:
         send_to_char( "You feel great.\r\n", ch );
         break;
      case 1:
         send_to_char( "You feel energetic.\r\n", ch );
         break;
      case 2:
         send_to_char( "Your mind is racing.\r\n", ch );
         break;
      case 3:
         send_to_char( "You can't think straight.\r\n", ch );
         break;
      case 4:
         send_to_char( "Your mind is going 100 miles an hour.\r\n", ch );
         break;
      case 5:
         send_to_char( "You're high as a kite.\r\n", ch );
         break;
      case 6:
         send_to_char( "Your mind and body are slipping appart.\r\n", ch );
         break;
      case 7:
         send_to_char( "Reality is slipping away.\r\n", ch );
         break;
      case 8:
         send_to_char( "You have no idea what is real, and what is not.\r\n", ch );
         break;
      case 9:
         send_to_char( "You feel immortal.\r\n", ch );
         break;
      case 10:
         send_to_char( "You are a Supreme Entity.\r\n", ch );
         break;
   }

   switch ( ch->position )
   {
      case POS_DEAD:
         send_to_char( "You are DEAD!!\r\n", ch );
         break;
      case POS_MORTAL:
         send_to_char( "You are mortally wounded.\r\n", ch );
         break;
      case POS_INCAP:
         send_to_char( "You are incapacitated.\r\n", ch );
         break;
      case POS_STUNNED:
         send_to_char( "You are stunned.\r\n", ch );
         break;
      case POS_SLEEPING:
         send_to_char( "You are sleeping.\r\n", ch );
         break;
      case POS_RESTING:
         send_to_char( "You are resting.\r\n", ch );
         break;
      case POS_STANDING:
         send_to_char( "You are standing.\r\n", ch );
         break;
      case POS_FIGHTING:
         send_to_char( "You are fighting.\r\n", ch );
         break;
      case POS_MOUNTED:
         send_to_char( "Mounted.\r\n", ch );
         break;
      case POS_SHOVE:
         send_to_char( "Being shoved.\r\n", ch );
         break;
      case POS_DRAG:
         send_to_char( "Being dragged.\r\n", ch );
         break;
   }

   if( ch->top_level >= 25 )
      ch_printf( ch, "Evasion: %d.  \r\n", GET_EVASION( ch ) );

   if( ch->top_level >= 15 )
      ch_printf( ch, "Hitroll: %d  Damroll: %d.\r\n", GET_HITROLL( ch ), GET_DAMROLL( ch ) );

   if( ch->top_level >= 10 )
      ch_printf( ch, "Alignment: %d.  ", ch->alignment );

   send_to_char( "You are ", ch );
   if( ch->alignment > 900 )
      send_to_char( "angelic.\r\n", ch );
   else if( ch->alignment > 700 )
      send_to_char( "saintly.\r\n", ch );
   else if( ch->alignment > 350 )
      send_to_char( "good.\r\n", ch );
   else if( ch->alignment > 100 )
      send_to_char( "kind.\r\n", ch );
   else if( ch->alignment > -100 )
      send_to_char( "neutral.\r\n", ch );
   else if( ch->alignment > -350 )
      send_to_char( "mean.\r\n", ch );
   else if( ch->alignment > -700 )
      send_to_char( "evil.\r\n", ch );
   else if( ch->alignment > -900 )
      send_to_char( "demonic.\r\n", ch );
   else
      send_to_char( "satanic.\r\n", ch );

   if( ch->first_affect )
   {
      send_to_char( "You are affected by:\r\n", ch );
      for( paf = ch->first_affect; paf; paf = paf->next )
         if( ( skill = get_skilltype( paf->type ) ) != NULL )
         {
            ch_printf( ch, "Spell: '%s'", skill->name );

            if( ch->top_level >= 20 )
               ch_printf( ch,
                          " modifies %s by %d for %d rounds",
                          affect_loc_name( paf->location ), paf->modifier, paf->duration );

            send_to_char( ".\r\n", ch );
         }
   }

   if( !IS_NPC( ch ) && IS_IMMORTAL( ch ) )
   {
      ch_printf( ch, "WizInvis level: %d   WizInvis is %s\r\n",
                 ch->pcdata->wizinvis, IS_SET( ch->act, PLR_WIZINVIS ) ? "ON" : "OFF" );
      if( ch->pcdata->r_range_lo && ch->pcdata->r_range_hi )
         ch_printf( ch, "Room Range: %d - %d\r\n", ch->pcdata->r_range_lo, ch->pcdata->r_range_hi );
      if( ch->pcdata->o_range_lo && ch->pcdata->o_range_hi )
         ch_printf( ch, "Obj Range : %d - %d\r\n", ch->pcdata->o_range_lo, ch->pcdata->o_range_hi );
      if( ch->pcdata->m_range_lo && ch->pcdata->m_range_hi )
         ch_printf( ch, "Mob Range : %d - %d\r\n", ch->pcdata->m_range_lo, ch->pcdata->m_range_hi );
   }

   return;
}
Ejemplo n.º 24
0
int main()
{
	int age = get_age();
	printf("Your age: %i\n", age );
}
Ejemplo n.º 25
0
/*
 * New score command by Haus
 */
void do_score( CHAR_DATA * ch, const char *argument )
{
   AFFECT_DATA *paf;
   int iLang, x;

   if( IS_NPC( ch ) )
   {
      do_oldscore( ch, argument );
      return;
   }

   ch_printf( ch, "\r\n&zScore for %s.\r\n", ch->pcdata->title );
   if( get_trust( ch ) != ch->top_level )
      ch_printf( ch, "You are trusted at level %d.\r\n", get_trust( ch ) );

   send_to_char( "&r----------------------------------------------------------------------------&z\r\n", ch );
   ch_printf( ch, "&r|&zRace      &r:&W %-3d&z year old %-10.10s      Log In&r:&W %-25.24s&r|\r\n",
              get_age( ch ), capitalize( get_race( ch ) ), ctime( &( ch->logon ) ) );
   ch_printf( ch, "&r|&zHitroll   &r: &W%-5d    &zDamroll&r:&W %-5d      &zSaved &r:&W %-25.24s&r|\r\n",
              GET_HITROLL( ch ), GET_DAMROLL( ch ), ch->save_time ? ctime( &( ch->save_time ) ) : "no" );
   ch_printf( ch, "&r|&zGlobal AC &r: &W%-5d    &zEvasion&r: &W%-5d      &zTime  &r: &W%-25.24s&r|\r\n",
              GET_ARMOR( ch ), GET_EVASION( ch ), ctime( &current_time ) );
   ch_printf( ch, "&r|&zAlign     &r: &W%-5d    &zWimpy  &r:&W %-3d                                         &r|\r\n",
              ch->alignment, ch->wimpy  );
   send_to_char( "&r----------------------------------------------------------------------------&z\r\n", ch );
   send_to_char( " &zBarehand Damtypes&r:", ch );
   for( x = 0; x < MAX_DAMTYPE; x++ )
      if( xIS_SET( ch->damtype, x ) )
         ch_printf( ch, " &W%s&r,", d_type[x] );
   send_to_char( "\r\n", ch );
   ch_printf( ch, " &r&zHit Points&r: &W%d&z of&W %d &z    Move&r: &W%d&z of&W %d   &z  Force&r:&W %d&z of&W %d&z\r\n",
                 ch->hit, ch->max_hit, ch->move, ch->max_move, ch->mana, ch->max_mana );

   ch_printf( ch, " &zStr&r: &W%2d  &zDex&r:&W %2d  &zCon&r: &W%2d  &zAgi&r:&W %2d &z Int&r:&W %2d  &zWis&r:&W %2d&z  Cha&r: &w%2d&z\r\n",
              get_curr_str( ch ), get_curr_dex( ch ), get_curr_con( ch ), get_curr_agi( ch ), get_curr_int( ch ), get_curr_wis( ch ),
              get_curr_cha( ch ) );


   send_to_char( "&r----------------------------------------------------------------------------&z\r\n", ch );

   {
      int ability;

      for( ability = 0; ability < MAX_ABILITY; ability++ )
      {
          if( ch->skill_level[ability] < 1 )
             continue;
          ch_printf( ch, " &W%-15s   &zLevel&r: &W%-3d   &zMax&r: &W%-3d   &zExp&r: &W%-10ld   &zNext&r: &W%-10ld&z\r\n",
                     ability_name[ability], ch->skill_level[ability], max_level( ch, ability ), ch->experience[ability],
                     exp_level( ch->skill_level[ability] + 1 ) );
          if( ability == COMBAT_ABILITY )
          {
             for( x = 0; x < MAX_DISCIPLINE; x++ )
                if( ch->known_disciplines[x] != NULL )
                   ch_printf( ch, " - %s%s&g\r\n",
                              is_discipline_set( ch, ch->known_disciplines[x] ) ? "&z" : "&W",
                              ch->known_disciplines[x]->name );
          }
      }
   }

   send_to_char( "&r----------------------------------------------------------------------------\r\n", ch );
   send_to_char( "&r|&zDamage &zType      &r|    &zPenetrate     &r|      &zResist      &r|     &zPotency      &r|\r\n", ch );
   send_to_char( "&r----------------------------------------------------------------------------\r\n", ch );
   for( x = 0; x < MAX_DAMTYPE; x++ )
      ch_printf( ch, "&r|%-19.19s&r:       &W%3d        &r|       &W%3d        &r|       &W%3d        &r|\r\n",
             d_type_score[x], ch->penetration[x], ch->resistance[x], ch->damtype_potency[x] );
   send_to_char( "&r----------------------------------------------------------------------------&z\r\n", ch );

   ch_printf( ch, "&zCREDITS&r:&W %-10d   &zBANK&r: &W%-10d    &zPkills&r: &W%-5.5d   &zMkills&r:&W %-5.5d\r\n",
              ch->gold, ch->pcdata->bank, ch->pcdata->pkills, ch->pcdata->mkills );

   ch_printf( ch, "&zWeight&r: &W%5.5d &r(&zmax&W %7.7d&r)&z    Items&r: &W%5.5d &r(&zmax&W %5.5d&r)\r\n",
              ch->carry_weight, can_carry_w( ch ), ch->carry_number, can_carry_n( ch ) );

   ch_printf( ch, "&zPager&r: &r(&W%c&r)&W %3d &z  AutoExit&r(&W%c&r) &z AutoLoot&r(&W%c&r)&z  Autosac&r(&W%c&r)\r\n",
              IS_SET( ch->pcdata->flags, PCFLAG_PAGERON ) ? 'X' : ' ',
              ch->pcdata->pagerlen, IS_SET( ch->act, PLR_AUTOEXIT ) ? 'X' : ' ',
              IS_SET( ch->act, PLR_AUTOLOOT ) ? 'X' : ' ', IS_SET( ch->act, PLR_AUTOSAC ) ? 'X' : ' ' );

   send_to_char( "\r\n&zLanguages&r: ", ch );
   for( iLang = 0; lang_array[iLang] != LANG_UNKNOWN; iLang++ )
      if( knows_language( ch, lang_array[iLang], ch ) || ( IS_NPC( ch ) && ch->speaks == 0 ) )
      {
         if( lang_array[iLang] & ch->speaking || ( IS_NPC( ch ) && !ch->speaking ) )
            set_char_color( AT_RED, ch );
         send_to_char( lang_names[iLang], ch );
         send_to_char( " ", ch );
         set_char_color( AT_SCORE, ch );
      }

   send_to_char( "\r\n", ch );
   ch_printf( ch, "&zWANTED ON&r: &W%s\r\n", flag_string( ch->pcdata->wanted_flags, planet_flags ) );

   if( ch->pcdata->bestowments && ch->pcdata->bestowments[0] != '\0' )
      ch_printf( ch, "&zYou are bestowed with the command&r(&zs&r):&W %s.\r\n", ch->pcdata->bestowments );

   if( ch->pcdata->clan )
   {
      send_to_char( "&r----------------------------------------------------------------------------\r\n", ch );
      ch_printf( ch, "&zORGANIZATION&r:&W %-35s &zPkills&r/&zDeaths&r: &W%3.3d&r/&W%3.3d",
                 ch->pcdata->clan->name, ch->pcdata->clan->pkills, ch->pcdata->clan->pdeaths );
      send_to_char( "\r\n", ch );
   }
   if( IS_IMMORTAL( ch ) )
   {
      send_to_char( "&r----------------------------------------------------------------------------&z\r\n", ch );

      ch_printf( ch, "IMMORTAL DATA:  Wizinvis [%s]  Wizlevel (%d)\r\n",
                 IS_SET( ch->act, PLR_WIZINVIS ) ? "X" : " ", ch->pcdata->wizinvis );

      ch_printf( ch, "Bamfin:  %s\r\n", ( ch->pcdata->bamfin[0] != '\0' )
                 ? ch->pcdata->bamfin : "%s appears in a swirling mist.", ch->name );
      ch_printf( ch, "Bamfout: %s\r\n", ( ch->pcdata->bamfout[0] != '\0' )
                 ? ch->pcdata->bamfout : "%s leaves in a swirling mist.", ch->name );


      /*
       * Area Loaded info - Scryn 8/11
       */
      if( ch->pcdata->area )
      {
         ch_printf( ch, "Vnums:   Room (%-5.5d - %-5.5d)   Object (%-5.5d - %-5.5d)   Mob (%-5.5d - %-5.5d)\r\n",
                    ch->pcdata->area->low_r_vnum, ch->pcdata->area->hi_r_vnum,
                    ch->pcdata->area->low_o_vnum, ch->pcdata->area->hi_o_vnum,
                    ch->pcdata->area->low_m_vnum, ch->pcdata->area->hi_m_vnum );
         ch_printf( ch, "Area Loaded [%s]\r\n", ( IS_SET( ch->pcdata->area->status, AREA_LOADED ) ) ? "yes" : "no" );
      }
   }
   if( ch->first_affect )
   {
      int i;
      const char *skname;

      i = 0;
      send_to_char( "&r----------------------------------------------------------------------------&z\r\n", ch );
      send_to_char( "&zAFFECT DATA&r:\r\n", ch );
      for( paf = ch->first_affect; paf; paf = paf->next )
      {
         skname = paf->from;

         if( paf->modifier == 0 )
            ch_printf( ch, "&r[&W%-63.64s&r;&W%5d &zrds&r]", skname, (int)paf->duration );
         else if( paf->modifier > 999 )
            ch_printf( ch, "&r[&W%-54.55s&r; &W%7.7s&r;&W%5d &zrds&r]",
                       skname, tiny_affect_loc_name( paf->location ), (int)paf->duration );
         else
            ch_printf( ch, "&r[&W%-51.52s&r;&W%+-3.3d %7.7s&r;%5d &zrds&r]",
                       skname, paf->modifier, tiny_affect_loc_name( paf->location ), (int)paf->duration );
         if( i == 0 )
            i = 1;
         if( ( ++i % 1 ) == 0 )
            send_to_char( "\r\n", ch );
      }
   }
   send_to_char( "\r\n&w", ch );
   return;
}