Angband Forums My Thoughts on 4.2
 Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 October 23, 2019, 02:30 #81 Pete Mack Prophet   Join Date: Apr 2007 Location: Seattle, WA Posts: 6,189 Donated: \$40 But both expressions are in terms of PLAYER_LEVEL, not PLAYER_MHP (or whatever.) So i am still confused
October 23, 2019, 02:39   #82
DavidMedley
Knight

Join Date: Oct 2019
Posts: 964
Quote:
 Originally Posted by Pete Mack But both expressions are in terms of PLAYER_LEVEL, not PLAYER_MHP (or whatever.) So i am still confused
The first is in terms of HP (1 = 1 HP) the second is in terms of % of max HP (1 = 1% of max HP).

October 23, 2019, 03:48   #83
Nick
Vanilla maintainer

Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,757
Donated: \$60
Quote:
 Originally Posted by Pete Mack But both expressions are in terms of PLAYER_LEVEL, not PLAYER_MHP (or whatever.) So i am still confused
That's because the amounts restored (whether flat or percentage) increase as the player levels up. So, for example, a CL20 character gets 5% of their max HP restored - the player level tells you it's 5%, and then you go away, find their max HP, and restore 5% of that. When they get to CL40, it's 10% and you do the same thing.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.

 October 23, 2019, 20:59 #84 sanedragon Rookie   Join Date: Jul 2019 Posts: 8 Ok, I think I get this now. The dice expression sets the base to PLAYER_LEVEL + 10 and the m_bonus to PLAYER_LEVEL / 4. (z-dice.c) HEAL_HP interprets the base as a number of hit points and the m_bonus as a percentage of missing HP, and chooses the greater of those as the healing power. (effects.c) The challenge in interpreting these dice expressions is that the code for different effects can interpret the meaning of the 4 parts of the dice struct in different ways, or ignore them entirely. HEAL_HP appears to ignore the number and sides of dice, for example.
October 23, 2019, 22:01   #85
DavidMedley
Knight

Join Date: Oct 2019
Posts: 964
Quote:
 Originally Posted by sanedragon m_bonus as a percentage of missing HP
Ooh, good catch. I thought it was a percentage of *max* HP.

From effects.c:
num = ((player->mhp - player->chp) * context->value.m_bonus) / 100;

October 23, 2019, 23:49   #86
Nick
Vanilla maintainer

Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,757
Donated: \$60
Quote:
 Originally Posted by DavidMedley Ooh, good catch. I thought it was a percentage of *max* HP. From effects.c: num = ((player->mhp - player->chp) * context->value.m_bonus) / 100;
Wow, I guess I must have known that at some point. That makes the percentage less useful unless you really need it, I guess.

I'd just like to say, too, I really like the way this thread is getting more airtime for the details of game mechanics. There's been a lot of work gone into this over a long time (some of it mine, but mostly other people's), and it's good to see that get recognition - as well as healthy for the codebase to be exposed to the light.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.

October 24, 2019, 00:21   #87
DavidMedley
Knight

Join Date: Oct 2019
Posts: 964
Quote:
 Originally Posted by Nick I really like the way this thread is getting more airtime for the details of game mechanics.
Hey, Nick, it's all thanks to you!! ...not updating the documentation. LOL

Seriously, tho, I'm a fan of your work. Keep it up!

 October 24, 2019, 02:40 #88 Pete Mack Prophet   Join Date: Apr 2007 Location: Seattle, WA Posts: 6,189 Donated: \$40 One thing is very confusing: m\$M can be read in two ways: as concatenation and as multiplication. I recommend requiring '*' here so it is easuer to read--'m' really needs to stand out in that expression.
 October 24, 2019, 02:54 #89 sanedragon Rookie   Join Date: Jul 2019 Posts: 8 From what I understand, the dice expression "m\$M" sets the m_bonus to the M expression, and doesn't have to do with concatenation or multiplication.
 October 24, 2019, 14:15 #90 DavidMedley Knight   Join Date: Oct 2019 Posts: 964 Perhaps a | which can mean "or"?

 Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Angband     AAR     Vanilla     Development     ToME     Sil     Variants     Competition The real world     Idle chatter     Oook! Obsolete     v4

 Similar Threads Thread Thread Starter Forum Replies Last Post EpicMan Vanilla 5 March 28, 2014 23:45 CunningGabe v4 11 March 2, 2012 00:11 Philip Variants 5 June 19, 2011 16:30 TJS Vanilla 2 August 14, 2009 04:20 TJS Vanilla 11 January 15, 2009 16:39

All times are GMT +1. The time now is 04:03.