I feel kinda stupid, but anywho:
I'm adding in a skill. Its in and everything compiles cleanly, but now I'm working on fixing it into can_see. Goal here is to make it so that only rangers can actually see people aff_camo, and there will be an image via infravision that someone is there, but looking at the can_see func, I'm kinda lost.
bool can_see( CHAR_DATA * ch, CHAR_DATA * victim )
{
if( !victim ) /* Gorog - panicked attempt to stop crashes */
return FALSE;
if( !ch )
{
if( IS_AFFECTED( victim, AFF_INVISIBLE ) || IS_AFFECTED( victim, AFF_HIDE ) || xIS_SET( victim->act, PLR_WIZINVIS ) || IS_AFFECTED( victim, AFF_CAMO ) )
return FALSE;
else
return TRUE;
}
if( ch == victim )
return TRUE;
if( !IS_NPC( victim ) && xIS_SET( victim->act, PLR_WIZINVIS ) && get_trust( ch ) < victim->pcdata->wizinvis )
return FALSE;
/*
* SB
*/
if( IS_NPC( victim ) && xIS_SET( victim->act, ACT_MOBINVIS ) && get_trust( ch ) < victim->mobinvis )
return FALSE;
/*
* Deadlies link-dead over 2 ticks aren't seen by mortals -- Blodkai
*/
if( !IS_IMMORTAL( ch ) && !IS_NPC( ch ) && !IS_NPC( victim ) && IS_PKILL( victim ) && victim->timer > 1 && !victim->desc )
return FALSE;
if( !IS_NPC( ch ) && xIS_SET( ch->act, PLR_HOLYLIGHT ) )
return TRUE;
/*
* The miracle cure for blindness? -- Altrag
*/
if( !IS_AFFECTED( ch, AFF_TRUESIGHT ) )
{
if( IS_AFFECTED( ch, AFF_BLIND ) )
return FALSE;
if( room_is_dark( ch->in_room ) && !IS_AFFECTED( ch, AFF_INFRARED ) )
return FALSE;
if( IS_AFFECTED( victim, AFF_INVISIBLE ) && !IS_AFFECTED( ch, AFF_DETECT_INVIS ) )
return FALSE;
if( IS_AFFECTED( victim, AFF_HIDE )
&& !IS_AFFECTED( ch, AFF_DETECT_HIDDEN )
&& !victim->fighting && ( IS_NPC( ch ) ? !IS_NPC( victim ) : IS_NPC( victim ) ) )
return FALSE;
}
/*
* Redone by Narn to let newbie council members see pre-auths.
*/
if( NOT_AUTHED( victim ) )
{
if( NOT_AUTHED( ch ) || IS_IMMORTAL( ch ) || IS_NPC( ch ) )
return TRUE;
if( ch->pcdata->council && !str_cmp( ch->pcdata->council->name, "Newbie Council" ) )
return TRUE;
return FALSE;
}
/* Commented out for who list purposes
if (!NOT_AUTHED(victim) && NOT_AUTHED(ch) && !IS_IMMORTAL(victim)
&& !IS_NPC(victim))
return FALSE;*/
return TRUE;
}
That is what I have. Its all stock pretty much cept for the first part where the bit about IS_AFFECTED( victim, AFF_CAMO ). Any hints or am I in the wrong function here? |