char *affect_bit_name( int vector )
const struct flag_type affect_flags[] =
char *affect_bit_name (int vector)
{
static char buf[512];
buf[0] = '\0';
if (vector & AFF_CAMO)
strcat (buf, " camoflague");
if (vector & AFF_FOCUS)
strcat (buf, " focus");
etc
etc
return (buf[0] != '\0') ? buf + 1 : "none";
}
const struct flag_type affect_flags[] = {
{"blind", A, TRUE},
etc
etc
etc
{"camoflague", ee, TRUE},
{"focus", ff, TRUE},
{NULL, 0, 0}
};
if (victim->affected_by)
{
sprintf (buf, "Affected by %s\n\r",
affect_bit_name (victim->affected_by));
send_to_char (buf, ch);
}
if (victim->affected2_by)
{
sprintf(buf, "Also affected by %s\n\r",
affect2_bit_name(victim->affected2_by) );
/* line 1715 */ add_buf(buffer,buf);
}
char buffer[MAX_STRING_LENGTH]; /*added this line*/
char buf[MAX_STRING_LENGTH];
if (victim->affected_by)
{
sprintf (buf, "Affected by %s\n\r",
affect_bit_name (victim->affected_by));
send_to_char (buf, ch);
}
if (victim->affected2_by)
{
sprintf(buf, "Also affected by %s\n\r",
affect2_bit_name (victim->affected2_by));
send_to_char (buf, ch);
}
Searching for: AFF_HIDE
act_info.c(1208): && !IS_AFFECTED(victim, AFF_HIDE)
act_look.c(775): if ( IS_AFFECTED(victim, AFF_HIDE) ) strcat( buf, "`C(Hide)`x " );
act_move.c(1611): if ( IS_AFFECTED(ch, AFF_HIDE) )
act_move.c(1612): REMOVE_BIT(ch->affected_by, AFF_HIDE);
act_move.c(1631): SET_BIT(ch->affected_by, AFF_HIDE);
act_move.c(1650): REMOVE_BIT ( ch->affected_by, AFF_HIDE );
deep.h(1093): #define AFF_HIDE (Q)
extra.c(2387): if ( IS_AFFECTED(victim, AFF_HIDE) ) strcat( buf, "`C(Hide)`y " );
handler.c(3017): if ( IS_AFFECTED(victim, AFF_HIDE)
interp.c(475): REMOVE_BIT( ch->affected_by, AFF_HIDE );
magic2.c(200): REMOVE_BIT ( ich->affected_by, AFF_HIDE );
magic2.c(230): REMOVE_BIT ( ich->affected_by, AFF_HIDE );
tables1.c(1655): if ( vector & AFF_HIDE ) strcat( buf, " hide" );
Found 13 occurrence(s) in 9 file(s)
void do_focus (CHAR_DATA * ch, char *argument)
{
AFFECT_DATA af;
if (IS_AFFECTED2 (ch, AFF_FOCUS))
{
send_to_char ("You are already focusing on your surroundings.\n\r", ch);
return;
}
send_to_char ("You attempt to focus on your surroundings.\n\r", ch);
if (number_percent () < get_skill (ch, gsn_focus))
{
check_improve (ch, gsn_focus, TRUE, 3);
af.where = TO_AFFECTS2;
af.type = gsn_focus;
af.level = ch->level;
af.duration = ch->level;
af.location = APPLY_NONE;
af.modifier = 0;
af.bitvector = AFF_FOCUS;
affect_to_char (ch, &af);
}
else
{
check_improve (ch, gsn_focus, FALSE, 3);
send_to_char ("You cannot seem to focus on your surroundings.\n\r", ch);
affect_strip (ch, gsn_focus);
REMOVE_BIT (ch->affected2_by, AFF_FOCUS);
}
return;
}
void do_focus (CHAR_DATA * ch, char *argument)
{
AFFECT_DATA af;
if (IS_AFFECTED2 (ch, AFF_FOCUS))
{
send_to_char ("You are already focusing on your surroundings.\r\n", ch);
return;
}
send_to_char ("You attempt to focus on your surroundings.\r\n", ch);
if (number_percent () < get_skill (ch, gsn_focus))
{
send_to_char ("You begin to focus on your surroundings.\r\n", ch);
check_improve (ch, gsn_focus, TRUE, 3);
af.where = TO_AFFECTS2;
af.type = gsn_focus;
af.level = ch->level;
af.duration = ch->level;
af.location = APPLY_NONE;
af.modifier = 0;
af.bitvector = AFF_FOCUS;
affect_to_char (ch, &af);
}
else
{
check_improve (ch, gsn_focus, FALSE, 3);
send_to_char ("You try to focus but lose concentration.\r\n", ch);
}
return;
}
if (ch->affected_by != 0)
fprintf( fp, "AfBy %s\n", print_flags(ch->affected_by));
if (ch->affected_by != 0)
fprintf( fp, "AfBy %s\n", print_flags(ch->affected_by));
if (ch->affected2_by != 0)
fprintf( fp, "AfBy2 %s\n", print_flags(ch->affected2_by));
KEY( "AfBy", ch->affected_by, fread_flag( fp ) );
KEY( "AfBy", ch->affected_by, fread_flag( fp ) );
KEY( "AfBy2", ch->affected2_by, fread_flag( fp ) );
void do_focus (CHAR_DATA * ch, char *argument)
{
AFFECT_DATA af;
if (IS_AFFECTED2 (ch, AFF_FOCUS))
{
send_to_char ("You are already focusing on your surroundings.\r\n", ch);
return;
}
send_to_char ("You attempt to focus on your surroundings.\r\n", ch);
if (number_percent () < get_skill (ch, gsn_focus))
{
check_improve (ch, gsn_focus, TRUE, 3);
af.where = TO_AFFECTS2;
af.type = gsn_focus;
af.level = ch->level;
af.duration = ch->level;
af.location = APPLY_NONE;
af.modifier = 0;
af.bitvector = AFF_FOCUS;
affect_to_char (ch, &af);
}
else
{
check_improve (ch, gsn_focus, FALSE, 3);
send_to_char ("You try to focus but get distracted.\r\n", ch);
}
return;
}
(And was that 31 a typo? Why would it only allow 31-bits?)