On Wed, 27 Aug 1997, John Evans wrote: > Greetings, > > I'm working on a command that will give the player some temorary benefits > (to-hit, to-dam, haste, etc..) but it will age them 5 years. > > I've dug and dug through the code and the man pages, but have just come > out more confused than when I started. I guess I'm not clear on what to > do to age the character.... There's already an APPLY_AGE that can be used as object and spell affects. All you need to do is add an affect to the player as if it were a spell (don't know the details on that). > I found the following in structs.h: > struct char_player_data { > /* SNIP */ > struct time_data time; /* PC's AGE in days */ > /* SNIP */ > } The comment is misleading. It's a structure, not a time variable. It's also not days, but seconds. The real PC age in *mud years* is ch->player.time.birth. > With this info, I would assume that the following would age the player 5 > DAYS: > ch->player.time += 5; > > >From that assumption, I would say that the following would would age the > player 5 years. : > /* 35 days * 17 months = 1 year = 595 days */ > /* 5 * 595 = 2975 days = 5 years */ > ch->player.time += 2975; > > Am I right in this logic, or not? I think that I am, but I have the gut > feeling that if I used that code, then I would definately screw things up. I think you'd be stopped cold by the compiler for trying to increment a structure. Your logic is fine, but your basic assumptions are way off because of the bad comment. I guess time used to be an int but was changed to a struct without changing the comment. So the best way to add a temporary age change would be to use a spell-like affect, or you can change it directly with: ch->player.time.birth += 5 * SECS_PER_MUD_YEAR; Sam +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/08/00 PST