Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old October 23, 2019, 03:30   #81
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,385
Donated: $40
Pete Mack is on a distinguished road
But both expressions are in terms of PLAYER_LEVEL, not PLAYER_MHP (or whatever.) So i am still confused
Pete Mack is offline   Reply With Quote
Old October 23, 2019, 03:39   #82
DavidMedley
Adept
 
Join Date: Oct 2019
Posts: 123
DavidMedley is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
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).
DavidMedley is offline   Reply With Quote
Old October 23, 2019, 04:48   #83
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,841
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by Pete Mack View Post
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.
Nick is offline   Reply With Quote
Old October 23, 2019, 21:59   #84
sanedragon
Rookie
 
Join Date: Jul 2019
Posts: 8
sanedragon is on a distinguished road
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.
sanedragon is offline   Reply With Quote
Old October 23, 2019, 23:01   #85
DavidMedley
Adept
 
Join Date: Oct 2019
Posts: 123
DavidMedley is on a distinguished road
Quote:
Originally Posted by sanedragon View Post
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;
DavidMedley is offline   Reply With Quote
Old October 24, 2019, 00:49   #86
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,841
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by DavidMedley View Post
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.
Nick is offline   Reply With Quote
Old October 24, 2019, 01:21   #87
DavidMedley
Adept
 
Join Date: Oct 2019
Posts: 123
DavidMedley is on a distinguished road
Quote:
Originally Posted by Nick View Post
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!
DavidMedley is offline   Reply With Quote
Old October 24, 2019, 03:40   #88
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,385
Donated: $40
Pete Mack is on a distinguished road
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.
Pete Mack is offline   Reply With Quote
Old October 24, 2019, 03:54   #89
sanedragon
Rookie
 
Join Date: Jul 2019
Posts: 8
sanedragon is on a distinguished road
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.
sanedragon is offline   Reply With Quote
Old October 24, 2019, 15:15   #90
DavidMedley
Adept
 
Join Date: Oct 2019
Posts: 123
DavidMedley is on a distinguished road
Perhaps a | which can mean "or"?
DavidMedley is offline   Reply With Quote
Reply


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

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 Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
3.5 Thoughts EpicMan Vanilla 5 March 29, 2014 00:45
Thoughts on v4 CunningGabe v4 11 March 2, 2012 01:11
S thoughts Philip Variants 5 June 19, 2011 17:30
My thoughts on 3.1.1 TJS Vanilla 2 August 14, 2009 05:20
3.1.0 thoughts TJS Vanilla 11 January 15, 2009 17:39


All times are GMT +1. The time now is 01:37.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.