Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   Development (http://angband.oook.cz/forum/forumdisplay.php?f=10)
-   -   blocked on some minor development. (http://angband.oook.cz/forum/showthread.php?t=9791)

Pete Mack January 22, 2020 05:19

blocked on some minor development.
 
I was trying to get my hand back in to coding for angband.

I am trying to implement this:
http://angband.oook.cz/forum/showpos...5&postcount=16

but i am blocked by this:
https://github.com/angband/angband/issues/4260
Note: see my final comment on what confuses me: why does each element_info record have an associated bitflag???

Nick, can you explain how element_info is actually used, so i can finish this? It is a pretty easy problem otherwise.

Nick January 22, 2020 11:28

The bitflag field is for recording how the item itself reacts to the element - so it can contain the EL_INFO_HATES flag if the element can destroy it, or the EL_INFO_IGNORE flag if the element can't destroy it. The HATES flag is assigned to object bases (tvals), and then the IGNORE flag can be applied to exceptions.

Pete Mack January 22, 2020 11:55

thanks much. Adding a comment to this effect. Also: if the object gets a random resist, shouldn't it also get set to
obj-init.c:356,362
Code:

    obj_info[effect].flags |= EL_INFO_RESIST | EL_INFO_RANDOM;
not just:
Code:

    obj_info[effect].flags |=  EL_INFO_RANDOM;
That is, it should resist the element if it has a resistance from any source.

Nick January 22, 2020 12:10

Quote:

Originally Posted by Pete Mack (Post 142597)
thanks much. Adding a comment to this effect. Also: if the object gets a random resist, shouldn't it also get set to
obj-init.c:356,362
Code:

    obj_info[effect].flags |= EL_INFO_RESIST | EL_INFO_RANDOM;
not just:
Code:

    obj_info[effect].flags |=  EL_INFO_RANDOM;
That is, it should resist the element if it has a resistance from any source.

No, the actual resist is handled by the res_level field (1 being single resist, 3 immunity). Some of the reason for the way this stuff is structured is to allow for use in variants with more resistance levels than V.

Pete Mack January 22, 2020 12:20

Sure, but as written, the object can get destroyed by an element if it has a random resist, but not if it has a default resist. Or that is what it looks like.

Nick January 22, 2020 20:27

Quote:

Originally Posted by Pete Mack (Post 142600)
Sure, but as written, the object can get destroyed by an element if it has a random resist, but not if it has a default resist. Or that is what it looks like.

Oh, I get it. Yes it should. Bug filed.


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

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