![]() |
#291 |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,592
Donated: $60
![]() |
All looks great. I'm going to do an updated build fairly soon, and I'll pull your stuff in then.
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
![]() |
![]() |
![]() |
#292 |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,592
Donated: $60
![]() |
New builds now up on the nightlies page and angband.live with the following changes:
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
![]() |
![]() |
![]() |
#293 |
Rookie
Join Date: Jul 2019
Location: Lakewood, OH
Age: 44
Posts: 10
![]() |
I like the new character expanded screen.
I picked up a wicker shield on Angband.Live with "makes you slow to recover hit points". I would expect a + in the ImpHP but nothing was there. |
![]() |
![]() |
![]() |
#294 | |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,592
Donated: $60
![]() |
Quote:
What *should* happen is that when you learn the curse you learn the property. Could you check the knowledge menu ('~') for runes and se whether you have both? The curse is under "Curses", the property under "Other".
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
|
![]() |
![]() |
![]() |
#295 | |
Rookie
Join Date: Jul 2019
Location: Lakewood, OH
Age: 44
Posts: 10
![]() |
Quote:
Thanks! I didn't know about the Runes knowledge menu. Cool. They're both there. |
|
![]() |
![]() |
![]() |
#296 |
Prophet
Join Date: Apr 2008
Posts: 2,826
![]() |
I thought I'd post this here. It's a little function that I added while porting the struct loc refactoring to PWMAngband to make some code clearer. Here it is:
Code:
bool loc_iterator(struct loc *iter, struct loc *grid1, struct loc *grid2, bool strict) { iter->x++; if (iter->x == (strict? grid2->x: grid2->x + 1)) { iter->x = grid1->x; iter->y++; if (iter->y == (strict? grid2->y: grid2->y + 1)) return false; } return true; } Code:
for (y = y1; y < y2; y++) { for (x = x1; x < x2; x++) { foo(y, x); } } Code:
loc_copy(&iter, &grid1); do { foo(&iter); } while (loc_iterator(&iter, &grid1, &grid2, true)); (or "false" to do "<=" instead of "<")
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant! |
![]() |
![]() |
![]() |
#297 |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,592
Donated: $60
![]() |
What a great idea! Now I can go and implement that all over the place instead of fixing bugs
![]()
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
![]() |
![]() |
![]() |
#298 |
Veteran
Join Date: Apr 2007
Posts: 1,947
Donated: $40
![]() |
Nice. Though I think it would be clearer if split into loc_iterate_inside and loc_iterate instead of passing a flag. (Also, you can just write iter = grid1 instead of loc_copy, surely?)
__________________
takkaria whispers something about options. -more- |
![]() |
![]() |
![]() |
#299 |
Rookie
Join Date: Jan 2019
Posts: 9
![]() |
It's nice but I think something like this is nicer because you can keep using for loop, though bit wordy.
Code:
struct loc_iterator { struct loc cur; struct loc begin; struct loc end; }; struct loc_iterator loc_iterator(struct loc begin, struct loc end) { struct loc_iterator iter; iter.cur = iter.begin = begin; iter.end = end; return iter; } bool loc_iterator_test(const struct loc_iterator* iter) { return iter->cur.y != iter->end.y; } void loc_iterator_next(struct loc_iterator* iter) { iter->cur.x++; if (iter->cur.x == iter->end.x) { iter->cur.x = iter->begin.x; iter->cur.y++; } } Code:
for (y = y1; y < y2; y++) { for (x = x1; x < x2; x++) { Code:
for (struct loc_iterator iter = loc_iterator(loc(x1, y1), loc(x2, y2)); loc_iterator_test(&iter); loc_iterator_next(&iter)) { /* use iter.cur */ int x = iter.cur.x; int y = iter.cur.y; Code:
for (y = y1 - 1; y < y2 + 1; y++) { for (x = x1 - 1; x < x2 + 1; x++) { Code:
for (struct loc_iterator iter = loc_iterator(loc(x1 - 1, y1 - 1), loc(x2 + 1, y2 + 1)); loc_iterator_test(&iter); loc_iterator_next(&iter)) { Last edited by Kusunose; July 31, 2019 at 10:34. |
![]() |
![]() |
![]() |
#300 |
Prophet
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,913
Donated: $40
![]() |
Too bad C doesnt have anonymous functions. Then you could package up the loop contents in a function, and execute the whole thing with a single subroutine call.
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
First release | Quirk | Sil | 18 | November 14, 2017 23:45 |
3.4.0 Release Candidate is available | fizzix | Vanilla | 111 | July 5, 2012 13:39 |
3.2 release candidate is upon us! | d_m | Vanilla | 147 | January 19, 2011 11:10 |
Release HellBand 0.8.7 | konijn_ | Variants | 4 | December 27, 2009 05:14 |
reactions to changes in new V release | will_asher | Vanilla | 50 | April 9, 2008 19:47 |