Age question - Down side to using a spell

  • Jan
  • Jan's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
2 months 1 week ago #6719 by Jan
Jan created the topic: Age question - Down side to using a spell
Im trying to make a downside to using haste by wanting to add 1 year each time cast on someone.

Here is what i tried but it doesnt add anyting, see attached picture. Any idea why it dont work ?

I also tried without the brackets and !IS_NPC. Just GET_AGE(victim) += 1;
Attachments:

Please Log in or Create an account to join the conversation.

More
2 months 1 week ago #6720 by Matt
Matt replied the topic: Age question - Down side to using a spell
APPLY_AGE does it by altering the birthday, like this:
ch->player.time.birth -= <amount>

Please Log in or Create an account to join the conversation.

  • Jan
  • Jan's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
2 months 1 week ago - 2 months 1 week ago #6721 by Jan
Jan replied the topic: Age question - Down side to using a spell
So

ch->player.time.birth -= 1;

Why -= ?

It needs to make the receiver of the spell 1 year older, each time haste is cast on them. Not the caster, or else the caster wont help anyone i think haha.

Makes good sinde that the receiver gets older from fighting more :)
Last Edit: 2 months 1 week ago by Jan.

Please Log in or Create an account to join the conversation.

  • Jan
  • Jan's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
2 months 1 week ago - 2 months 1 week ago #6722 by Jan
Jan replied the topic: Age question - Down side to using a spell
Hmm it compiled, but it didnt change the age :(

+= 1 didnt either.
Last Edit: 2 months 1 week ago by Jan.

Please Log in or Create an account to join the conversation.

  • Jan
  • Jan's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
2 months 1 week ago - 2 months 1 week ago #6728 by Jan
Jan replied the topic: Age question - Down side to using a spell
So maybe its not possible to change players age ?
Last Edit: 2 months 1 week ago by Jan.

Please Log in or Create an account to join the conversation.

More
2 months 1 week ago #6729 by Parna
Parna replied the topic: Age question - Down side to using a spell
To slightly derail this topic, does age actually do anything? I know it's there on the score but I always thought it was more of a record-keeper thing than anything, a sort of cute way of showing when you started playing. I've heard of muds where you get slower and weaker as you age but I didn't think that TBA did that. If it's just a record-keeper, why mess with it?

To get back on the tracks, I notice that age is a field in object applies. If you check the code for that, it might lead to a way for a more permanent application.

Please Log in or Create an account to join the conversation.

  • Jan
  • Jan's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
2 months 1 week ago #6731 by Jan
Jan replied the topic: Age question - Down side to using a spell
I do think that tbamud has something with age. I think regeneration is slower when getting old.

I have looked and looked and tried what i could come to think off. Without luck.

If anyone find something usefull in the code, pls post here.

Please Log in or Create an account to join the conversation.

  • Jan
  • Jan's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
2 months 1 week ago #6732 by Jan
Jan replied the topic: Age question - Down side to using a spell
Or other ideas to give a downside to using haste, is also welcome.

Please Log in or Create an account to join the conversation.

More
2 months 1 week ago #6734 by Thomas
Thomas replied the topic: Age question - Down side to using a spell

JTP wrote: So

ch->player.time.birth -= 1;

Why -= ?

It needs to make the receiver of the spell 1 year older, each time haste is cast on them. Not the caster, or else the caster wont help anyone i think haha.

Makes good sinde that the receiver gets older from fighting more :)


Did you try
if (!IS_NPC(victim))
  victim->player.time.birth -= 1;

Also - what currently happens with age is that the hitpoint, movement and mana gains are adjusted according to the current age. Quotes from limits.c:
/* When age < 15 return the value p0
   When age is 15..29 calculate the line between p1 & p2
   When age is 30..44 calculate the line between p2 & p3
   When age is 45..59 calculate the line between p3 & p4
   When age is 60..79 calculate the line between p4 & p5
   When age >= 80 return the value p6 */

// mana:
 gain = graf(age(ch)->year, 4, 8, 12, 16, 12, 10, 8);
// hit:
gain = graf(age(ch)->year, 8, 12, 20, 32, 16, 10, 4);
// move
gain = graf(age(ch)->year, 16, 20, 24, 20, 16, 12, 10);

So, in the age interval 45..59 you are most "vital" and will recover your points more quickly.
When you get above 80, expect to spend a lot of time sleeping to recover your points.

In some muds I have played, there have been higher consequences for high age:
- you hit slower with your weapons; instead of 1 attack/round (per attack you have), you may only get 85% change of a strike if you are too old.
- you may miscast magic (instead of the spell you were trying, you fire another spell. This can give hilarious results)
- you suffer from nearsightedness (so you miss more often, or hit the wrong people)
- you become worse at skills you don't use regularly.
- you use more movement points to get around (you are exhausted faster)

One mud I played had a pretty draconian rule - if you got over 90 years old, you perma-died. And the solutions to get 5 years younger were much more elaborate than the haste spell (think mud-day long rituals with lots of ingredients vs a simple cast). The haste spell didn't add full years in that game, though, so for most it wasn't a problem. But then I found a weapon with aff_haste. I aged at twice the rate when using it. I hit twice as often, though, so it was worth it.

To make something similar in tbamud, I would exploit that all age-calculations are done in the utils.c function age() and add a running tally of "mud days under influence of the haste spell" and "rejuvenations" and then add/subtract in the age function.

Please Log in or Create an account to join the conversation.

  • Jan
  • Jan's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
2 months 1 week ago #6735 by Jan
Jan replied the topic: Age question - Down side to using a spell
if (!IS_NPC(victim))
victim->player.time.birth -= 1;


Age didnt change when casting haste on a player :/

Please Log in or Create an account to join the conversation.

More
2 months 6 days ago #6736 by Parna
Parna replied the topic: Age question - Down side to using a spell
Try making an object with an age apply and see if you get older when you use it and younger when you remove it.

Please Log in or Create an account to join the conversation.

More
2 months 6 days ago #6738 by Matt
Matt replied the topic: Age question - Down side to using a spell
What if haste made the user blind too haha
Or unable to talk because they speak way too fast

Please Log in or Create an account to join the conversation.

  • Jan
  • Jan's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
2 months 6 days ago #6739 by Jan
Jan replied the topic: Age question - Down side to using a spell
Hey

Just tried making an item with +1 age.

That worked just fine. Age 47 without the item, 48 with the item. And removed it and was again 47.

Hmm

Please Log in or Create an account to join the conversation.

  • Jan
  • Jan's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
2 months 3 days ago #6746 by Jan
Jan replied the topic: Age question - Down side to using a spell
Any new ideas to make this ?

Please Log in or Create an account to join the conversation.

More
2 months 2 days ago #6750 by Parna
Parna replied the topic: Age question - Down side to using a spell
As a builder, not a coder, I don't have a clue. However, the reason I suggested it is that somewhere in the code, there should be a section that deals with how to handle the applies. From there, I'd think you could get an idea of what to do to make the affect permanent.

Please Log in or Create an account to join the conversation.

More
2 months 1 day ago - 2 months 1 day ago #6755 by Thomas
Thomas replied the topic: Age question - Down side to using a spell

JTP wrote: if (!IS_NPC(victim))
victim->player.time.birth -= 1;


Age didnt change when casting haste on a player :/


because player.time.birth is in seconds. Try this:
victim->player.time.birth -= (1 * SECS_PER_MUD_YEAR);
Last Edit: 2 months 1 day ago by Thomas. Reason: typo
The following user(s) said Thank You: Jan

Please Log in or Create an account to join the conversation.

  • Jan
  • Jan's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
2 months 1 hour ago #6764 by Jan
Jan replied the topic: Age question - Down side to using a spell
That worked like a charm,,,Thanks Thomas

Please Log in or Create an account to join the conversation.

Time to create page: 1.670 seconds