|
|
#1 |
|
Swordsman
Join Date: Apr 2008
Posts: 450
![]() |
A question to the dev team regarding new ID-by-use (possible bug)
Looking at spells1.c, there seems to be some incoherence regarding how object flags are "known" when the character is hit by various elements. For example:
- base elements (GF_FIRE/COLD/ELEC/ACID): immunity, resistance and susceptibility are always noticed in the xxx_dam() functions - poison (GF_POIS) and other elements: resistance is only noticed if the character actually resists poison (same for other elements) Some other incoherences of the same type seem to occur for other object flags: for example, sustain flag is always noticed when a character is subject to stat drain; flags are always noticed when triggering a trap from the floor (feather falling, resist poison, ...), but only when the character actually resists the effect when triggering a trap from a chest; drain life is always noticed when a character is attacked in melee by a monster that can drain life, but only when the character actually resists life drain when hit by chaos/nether attacks. I think the calls to wieldeds_notice_flag() should be more consistent. Any thought?
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant! |
|
|
|
|
|
#2 |
|
Prophet
Join Date: Mar 2008
Posts: 2,588
![]() |
What version are you using? Have you actually tested and found incorrect learning? I am not saying you are wrong, but it seems strange I would have missed so many. I haven't looked in a long time.
IMO there shouldn't be any tests in the trap code. E.g. there ought to be calls to a function that does poison damage, and that code should do the learning. There should be a call to lower a stat, which should do that learning. Etc. The problem is [IMO] bad code that e.g. tests if you have FA and does not call the paralyzation routine if you have it. The codebase is haphazard, and things added late are hard to incorporate with good design. |
|
|
|
|
|
#3 |
|
Swordsman
Join Date: Apr 2008
Posts: 450
![]() |
Just look at the source code from current trunk:
Learning resist poison from a trap Code:
/* Extra spike damage */
if (one_in_(2))
{
msg_print("You are impaled on poisonous spikes!");
dam = dam * 2;
(void)inc_timed(TMD_CUT, randint1(dam), TRUE);
if (p_ptr->state.resist_pois || p_ptr->timed[TMD_OPP_POIS])
{
msg_print("The poison does not affect you!");
}
else
{
dam = dam * 2;
(void)inc_timed(TMD_POISONED, randint1(dam), TRUE);
}
wieldeds_notice_flag(OF_RES_POIS);
}
Code:
/* Poison */
if (trap & (CHEST_POISON))
{
msg_print("A puff of green gas surrounds you!");
if (!(p_ptr->state.resist_pois || p_ptr->timed[TMD_OPP_POIS]))
(void)inc_timed(TMD_POISONED, 10 + randint1(20), TRUE);
else if (p_ptr->state.resist_pois)
wieldeds_notice_flag(OF_RES_POIS);
}
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant! |
|
|
|
|
|
#4 |
|
Prophet
Join Date: Mar 2008
Posts: 2,588
![]() |
The chest code is not buggy as written. The inc_timed on poison ought to do poison learning. If it doesn't, that would be a bug in inc_timed.
The code ought to migrate to no if clause, just call inc_timed without checking resistances, and all checks and damage mods done there. The question is how to migrate slowly, when volunteers don't have the patience to do everything at once. You could take the notice_flag out of the if/else, but then someone might not do some later cleanup. Or maybe it would be easier to clean up. I don't know. |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| deep descent bug 3.1.2 dev r1886 | Tatami | Vanilla | 15 | January 21, 2010 22:06 |
| Dev Bug | rdermyer | Vanilla | 13 | December 24, 2008 02:49 |
| Fear Bug In Dev Version | LordArcher | Vanilla | 2 | November 30, 2008 20:04 |
| [Dev] major Fear bug. | Irashtar | Vanilla | 1 | August 31, 2008 03:03 |
| Ironband dev question | Antoine | Variants | 1 | January 11, 2008 05:10 |