Archived from groups: rec.games.roguelike.nethack (
More info?)
On Wed, 06 Apr 2005 20:26:36 +0100, Dylan O'Donnell wrote:
> Mark Healey <die@spammer.die> writes:
>> On Wed, 06 Apr 2005 17:50:59 +0100, Dylan O'Donnell wrote:
>>
>> > Mark Healey <die@spammer.die> writes:
>> >> How do I force a redraw of the hero such as when he polymorphs. I've
>> >> tried newsym(u.ux, u.uy) and display_self without results.
>> >
>> > newsym(u.ux,u.uy) will cause the square you're on to be remapped (and
>> > will handle the display_self() call if there needs to be one); if
>> > changes you want to display aren't showing up when you do this, then
>> > it's a problem with those changes, not the redraw code, and we'd need
>> > more information.
>>
>> I want to have the hero change color under certain emergency conditions
>> (fainting, really low hitpoints, slimed, etc). It is relatively easy to do
>> in mapglyph. The problem is that it only seems to be called when the hero
>> moves.
>
> newsym() for the hero's location will only usually be called when the
> hero moves, or turns invisible, or polymorphs, or otherwise does
> something needing remapping. If you decide that a condition leads to a
> need for remapping, then you'll need to add newsym() calls manually at
> the point that condition begins to apply. (You could do so in the main
> game loop, but that wouldn't be quite accurate.)
Here's what I got.
check_alarm(){
if((u.uhp/u.uhp)*4 < 4)/*this isn't the condition*/
/*I'm really going to use.*/
{
pline("should change color");
newsym(u.ux, u.uy);
}
}
which is called from the "once per turn" secition of moveloop()
I have some temporary experimental code in mapglyph() that changes the
color.
I see the pline message when appropriate but the color change only happens
if I've moved.
And didn't we have
> this conversation some months ago?
Maybe a year or more. I got busy with real life stuff. I started again
and got sick of dying because of things that are indicated in the
periphery.
--
Mark Healey
marknews(at)healeyonline(dot)com