/* * Write a line to the spoiler file and then "underline" it with hyphens */ static void spoiler_underline(cptr str) { text_out(str); text_out("\n"); spoiler_out_n_chars(strlen(str), '-'); text_out("\n"); }
/* * Describe an item's random attributes for "character dumps" */ void identify_random_gen(const object_type *o_ptr) { /* Set hooks for character dump */ object_info_out_flags = object_flags_known; /* Set the indent/wrap */ text_out_indent = 3; text_out_wrap = 65; /* Dump the info */ if (object_info_out(o_ptr, FALSE)) text_out("\n"); /* Dump object history if necessary */ if (history_interesting(o_ptr)) { char buf[200]; /* Get the history and dump it */ if (format_object_history(buf, sizeof(buf), o_ptr)) { text_out(buf); text_out("\n"); } } /* Reset indent/wrap */ text_out_indent = 0; text_out_wrap = 0; }
/* * Write a line to the spoiler file and then "underline" it with hypens */ static void spoiler_underline(const char *str, char c) { text_out("%s", str); text_out("\n"); spoiler_out_n_chars(strlen(str), c); text_out("\n"); }
static bool TestWarehouseItem(ref<CWarehouseReceipt> const& whr, ref<CWarehouseItem> const wh_item) { if (wh_item->GetWarehouseReceipt() != whr) { text_out("item has a wrong warehouse receipt or is missing"); return false; } const auto whr_item_list = whr->GetItems(); const auto whr_item_list_member = wh_item->GetIndexMember(WarehouseItemIndexMemberEnum::WarehouseReceiptList); if (whr_item_list_member->owner != whr_item_list) { text_out("item has a wrong warehouse item list member or is missing"); return false; } const auto item_definition = wh_item->GetItemDefinition(); if (wh_item->GetPackage() != item_definition->GetPackage()) { text_out("item package is different to its item definition package"); return false; } return true; }
static void describe_monster_toughness(int r_idx, const monster_lore *l_ptr) { const monster_race *r_ptr = &r_info[r_idx]; int msex = 0; /* Extract a gender (if applicable) */ if (r_ptr->flags1 & RF1_FEMALE) msex = 2; else if (r_ptr->flags1 & RF1_MALE) msex = 1; /* Describe monster "toughness" */ if (know_armour(r_idx, l_ptr)) { /* Armor */ text_out(format("%^s has an armor rating of %d", wd_he[msex], r_ptr->ac)); /* Maximized hitpoints */ if (l_ptr->flags1 & RF1_FORCE_MAXHP) { text_out(format(" and a life rating of %d. ", r_ptr->hdice * r_ptr->hside)); } /* Variable hitpoints */ else { text_out(format(" and a life rating of %dd%d. ", r_ptr->hdice, r_ptr->hside)); } } }
static bool TestItemDefinitionsIntegrity() { const auto item_definitions_list = db::item_def::GetList(); return std::all_of(begin(item_definitions_list), end(item_definitions_list), [&item_definitions_list] (ref<CItemDefinition> const& item_def) { const auto code = item_def->GetCode(); const auto code_member = item_definitions_list->FindByCode(code); if (code_member.is_nil() || code_member->obj != item_def) { text_out("item definition is not in the index by code"); return false; } const auto description = item_def->GetDescription(); const auto desc_member = item_definitions_list->FindByDescription(description); if (desc_member.is_nil() || desc_member->obj != item_def) { text_out("item definition is not in the index by description"); return false; } const auto image = item_def->GetImage(); if (0 != memcmp(image->get_body(), item_def->GetDescription().c_str(), image->get_size())) { text_out("item definition image (external blob) failed"); return false; } return true; }); }
void text_out_to_row_fillSpace(unsigned char row,const unsigned char *buff) { unsigned char temp[MaxByteOneLine+2]; my_strcpy_fillspace(temp,buff); text_out(0,ALineContainDotLine*row,temp); text_out(ALinePixNum-AAscciiPixNum,ALineContainDotLine*row," "); }
static void p_text_out(cptr str) { if (new_paragraph) { text_out("\n\n "); new_paragraph = FALSE; } text_out(str); }
static void describe_monster_desc(int r_idx) { const monster_race *r_ptr = &r_info[r_idx]; char buf[2048]; /* Simple method */ my_strcpy(buf, r_text + r_ptr->text, sizeof(buf)); /* Dump it */ text_out(buf); text_out("\n"); }
static void describe_monster_exp(int r_idx, const monster_lore *l_ptr) { const monster_race *r_ptr = &r_info[r_idx]; cptr p, q; long i, j; /* Describe experience if known */ if (l_ptr->tkills) { /* Introduction */ if (l_ptr->flags1 & RF1_UNIQUE) text_out("Killing"); else text_out("A kill of"); text_out(" this creature"); /* calculate the integer exp part */ i = (long)r_ptr->mexp * r_ptr->level / p_ptr->lev; /* calculate the fractional exp part scaled by 100, */ /* must use long arithmetic to avoid overflow */ j = ((((long)r_ptr->mexp * r_ptr->level % p_ptr->lev) * (long)1000 / p_ptr->lev + 5) / 10); /* Mention the experience */ text_out(format(" is worth %ld.%02ld point%s", (long)i, (long)j, (((i == 1) && (j == 0)) ? "" : "s"))); /* Take account of annoying English */ p = "th"; i = p_ptr->lev % 10; if ((p_ptr->lev / 10) == 1) /* nothing */; else if (i == 1) p = "st"; else if (i == 2) p = "nd"; else if (i == 3) p = "rd"; /* Take account of "leading vowels" in numbers */ q = ""; i = p_ptr->lev; if ((i == 8) || (i == 11) || (i == 18)) q = "n"; /* Mention the dependance on the player's level */ text_out(format(" for a%s %lu%s level character. ", q, (long)i, p)); } }
void mpeg_ts_reader_c::process_chapter_entries() { if (m_chapter_timecodes.empty() || m_ti.m_no_chapters) return; std::stable_sort(m_chapter_timecodes.begin(), m_chapter_timecodes.end()); mm_mem_io_c out{nullptr, 0, 1000}; out.set_file_name(m_ti.m_fname); out.write_bom("UTF-8"); size_t idx = 0; for (auto &timecode : m_chapter_timecodes) { ++idx; auto ms = timecode.to_ms(); out.puts(boost::format("CHAPTER%|1$02d|=%|2$02d|:%|3$02d|:%|4$02d|.%|5$03d|\n" "CHAPTER%|1$02d|NAME=Chapter %1%\n") % idx % ( ms / 60 / 60 / 1000) % ((ms / 60 / 1000) % 60) % ((ms / 1000) % 60) % ( ms % 1000)); } mm_text_io_c text_out(&out, false); try { m_chapters = parse_chapters(&text_out, 0, -1, 0, m_ti.m_chapter_language, "", true); align_chapter_edition_uids(m_chapters.get()); } catch (mtx::chapter_parser_x &ex) { } }
void GaussElimComputation::start_computation() { if (status() == COMP_DONE) return; for (; row >= 0; row--) { if (gb_list[row] == NULL) continue; while (reduce_list[row] != NULL) { gm_elem *p = reduce_list[row]; reduce_list[row] = p->next; p->next = NULL; reduce(gb_list[row], p); // replaces p if (M2_gbTrace >= 3) { if (p->f == NULL) { if (p->fsyz == NULL) emit_wrapped("o"); else emit_wrapped("z"); } else emit_wrapped("r"); } else { } insert(p); n_pairs++; if (system_interrupted()) { set_status(COMP_INTERRUPTED); return; } if (n_pairs == stop_.pair_limit) { set_status(COMP_DONE_PAIR_LIMIT); return; } if (n_syz == stop_.syzygy_limit) { set_status(COMP_DONE_SYZYGY_LIMIT); return; } } } // Now auto reduce these for (int r = 1; r < gens->n_rows(); r++) { if (gb_list[r] == 0) continue; reduce(gb_list[r]->f, gb_list[r]->fsyz, true); } if (M2_gbTrace >= 1) { buffer o; text_out(o); emit(o.str()); } set_status(COMP_DONE); }
/* * Hack -- display object recall in sub-windows */ static void fix_object(void) { s32b j; /* Scan windows */ for (j = 0; j < 8; j++) { term *old = Term; /* No window */ if (!angband_term[j]) continue; /* No relevant flags */ if (!flag_exists(&window_flag[j], FLAG_PW_OBJECT)) continue; /* Activate */ Term_activate(angband_term[j]); /* Clear */ Term_clear(); /* Display object info */ if (tracked_object) if (!object_out_desc(tracked_object, NULL, FALSE, FALSE)) text_out("You see nothing special."); /* Fresh */ Term_fresh(); /* Restore */ Term_activate(old); } }
static void describe_monster_toughness(const monster_race *r_ptr, const monster_lore *l_ptr) { int msex = 0; bool intro = FALSE; /* Extract a gender (if applicable) */ if (r_ptr->flags1 & RF1_FEMALE) msex = 2; else if (r_ptr->flags1 & RF1_MALE) msex = 1; /* Describe monster "toughness" */ if (know_armour(r_ptr, l_ptr)) { /* Armor */ text_out(format("%^s has an armor rating of %d", wd_he[msex], r_ptr->ac)); } /* Describe monster "toughness" */ if (know_life_rating(r_ptr, l_ptr)) { if (intro) { text_out(" and"); } else { text_out(format("%^s has ", wd_he[msex])); } /* Maximized hitpoints */ if (l_ptr->flags1 & RF1_FORCE_MAXHP) { text_out(format(" a life rating of %d. ", r_ptr->hp)); } /* Variable hitpoints */ else { text_out(format(" and an average life rating of %d. ", r_ptr->hp)); } } }
void text_out_length(char x,char y,const unsigned char *buff,unsigned char length) { unsigned char temp[22]; if(length>21)length=21; memcpy(temp,buff,length); temp[length]=0; text_out(x,y,temp); }
bool db::db_filler::TestIntegrity() { if (!TestItemDefinitionsIntegrity()) { text_out("Item definitions integrity check failed"); return false; } text_out("Item definitions integrity check passed succesfully"); if (!TestWarehouseReceiptsIntegrity()) { text_out("warehouse receipts integrity check failed"); return false; } text_out("warehouse receipts integrity passed succesfully"); text_out("integrity test passed succesfully"); return true; }
extern "C" VOID SQL_API TraceDebugOut( unsigned int length, char* szBuffer, char* text, int format) { #ifndef DISABLE_TRACE /* * TraceReturn calls GrabErrors(). GrabErrors() goes in and gets diagnostics - now if there is * any kind of debug tracing going on there TraceDebygOut gets called and * we could get into a problem with deadlocks. To avoid that condition we will attempt to lock the mutex * if the calling thread owns the lock, EDEADLK will be returned and we can proceed * otherwise EBUSY is returned and we can call the normal lock and wait * */ int status; int wasAlreadyLocked = false; status = g_csWrite.TryLock(); if(status == EBUSY) EnterCriticalSection2(&g_csWrite); else if(status == EDEADLK) wasAlreadyLocked = true; if (g_fNoTrace) { if(!wasAlreadyLocked) LeaveCriticalSection2(&g_csWrite); return; } if (!fhTraceFile) { (void) TraceOpenLogFile((LPWSTR)szGlobalTraceFileName,NULL,0); if (!fhTraceFile) { if(!wasAlreadyLocked) LeaveCriticalSection2(&g_csWrite); return; } } if(FORMAT_TEXT==format) { text_out(szBuffer,text); } else if(FORMAT_DUMP==format) { hex_out(length, szBuffer, text); } fflush(fhTraceFile); if(!wasAlreadyLocked) LeaveCriticalSection2(&g_csWrite); #endif }
static bool TestWarehouseReceiptIntegrity(ref<CWarehouseReceipt> const& whr) { if (!TestCustomFields(whr)) { text_out("failed testing custom fields"); return false; } if (!TestShipperEmail(whr)) { text_out("failed testing warehouse receipt shipper e-mail"); return false; } const auto items = whr->GetItems(); return std::all_of(begin(items), end(items), [&whr] (ref<CWarehouseItem> const& wh_item) { return TestWarehouseItem(whr, wh_item); }); }
static void FillPackages() { if (db::package::GetCount() > 0) { text_out("packagees already created"); return; } InsertPackage(L"BOX", L"Box"); InsertPackage(L"CTN", L"Carton"); InsertPackage(L"DRM", L"Drum"); InsertPackage(L"PLT", L"Pallet"); InsertPackage(L"TNK", L"Tank"); }
static bool TestWarehouseReceiptsIntegrity() { const auto whr_list = db::warehouse_receipt::GetList(); return std::all_of(begin(whr_list), end(whr_list), [&whr_list] (ref<CWarehouseReceipt> const& whr) { const auto found_mbr = whr_list->FindByNumber(whr->GetNumber()); if (found_mbr.is_nil() || found_mbr->obj != whr) { text_out("warehouse receipt not found in list by number"); return false; } return TestWarehouseReceiptIntegrity(whr); }); }
/** * Show spell long description when browsing */ static void curse_menu_browser(int oid, void *data, const region *loc) { int *choice = data; /* Redirect output to the screen */ text_out_hook = text_out_to_screen; text_out_wrap = 0; text_out_indent = loc->col - 1; text_out_pad = 1; Term_gotoxy(loc->col, loc->row + loc->page_rows); text_out("\n%s\n", curses[choice[oid]].desc); /* XXX */ text_out_pad = 0; text_out_indent = 0; }
void LFont::test_font( SDL_Surface* surface ) ////////////////////////////////////////// { //this was just a quick testing function, nothing important here fill_surface( surface, LWHITE32 ); text_out( 0, 0, surface, "" ); /* ABCDEFGHIJKLM NOPQRSTUVWXYZ abcdefghijklm nopqrstuvwxyz 0123456789 !@#$%^&*() -_=+[]{};:\'\",.<>?/\\|`~ */ update_screen(); SDL_Delay( 5000 ); }
/** * Show spell long description when browsing */ static void curse_menu_browser(int oid, void *data, const region *loc) { struct curse_menu_data *choice = data; char buf[80]; /* Redirect output to the screen */ text_out_hook = text_out_to_screen; text_out_wrap = 0; text_out_indent = loc->col - 1; text_out_pad = 1; Term_gotoxy(loc->col, loc->row + loc->page_rows); my_strcpy(buf, curses[choice[oid].index].desc, sizeof(buf)); my_strcap(buf); text_out(" %s.\n", buf); /* XXX */ text_out_pad = 0; text_out_indent = 0; }
/** * Show spell long description when browsing */ static void spell_menu_browser(int oid, void *data, const region *loc) { struct spell_menu_data *d = data; int spell_index = d->spells[oid]; if (d->show_description) { /* Redirect output to the screen */ text_out_hook = text_out_to_screen; text_out_wrap = 0; text_out_indent = loc->col - 1; text_out_pad = 1; Term_gotoxy(loc->col, loc->row + loc->page_rows); text_out("\n%s\n", spell_by_index(spell_index)->text); /* XXX */ text_out_pad = 0; text_out_indent = 0; } }
const wxString wxExGetEndOfText( const wxString& text, size_t max_chars) { wxString text_out(text); if (text_out.length() > max_chars) { if (4 + text_out.length() - max_chars < text_out.length()) { text_out = "..." + text_out.substr(4 + text_out.length() - max_chars); } else { text_out = text.substr(text.length() - max_chars); } } return text_out; }
static void describe_monster_power(const monster_race *r_ptr, const monster_lore *l_ptr) { int msex = 0; /* Extract a gender (if applicable) */ if (r_ptr->flags1 & RF1_FEMALE) msex = 2; else if (r_ptr->flags1 & RF1_MALE) msex = 1; /* Describe experience if known */ if (l_ptr->tkills) { text_out(format("%^s is ", wd_he[msex])); if (r_ptr->power > 100) text_out("over powered"); else if (r_ptr->power > 50) text_out("deadly"); else if (r_ptr->power > 10) text_out("dangerous"); else if (r_ptr->power > 5) text_out("challenging"); else if (r_ptr->power > 1) text_out("threatening"); else text_out("not threatening"); text_out(format(" at %s native depth. ", wd_his[msex])); } }
/* * Show artifact lore */ static void desc_art_fake(int a_idx) { object_type *o_ptr; object_type object_type_body = { 0 }; char header[120]; textblock *tb; region area = { 0, 0, 0, 0 }; o_ptr = find_artifact(&a_info[a_idx]); /* If it's been lost, make a fake artifact for it */ if (!o_ptr) { o_ptr = &object_type_body; make_fake_artifact(o_ptr, &a_info[a_idx]); o_ptr->ident |= IDENT_NAME; /* Check the history entry, to see if it was fully known before it * was lost */ if (history_is_artifact_known(o_ptr->artifact)) object_notice_everything(o_ptr); } /* Hack -- Handle stuff */ handle_stuff(p_ptr); tb = object_info(o_ptr, OINFO_NONE); object_desc(header, sizeof(header), o_ptr, ODESC_PREFIX | ODESC_FULL); textui_textblock_show(tb, area, format("%^s", header)); textblock_free(tb); #if 0 /* XXX This should be in object_info */ if (lost) text_out("\nThis artifact has been lost."); #endif }
static void FillItemDefinitions() { if (db::item_def::GetCount() > 0) { text_out("item definitions already created"); return; } const auto box = db::package::FindByCode(L"BOX"); InsertItemDefinition(L"PRN001", L"Printer", box, 10); InsertItemDefinition(L"MON002", L"Monitor", box, 20); InsertItemDefinition(L"KBD003", L"Keyboard", box, 2); InsertItemDefinition(L"OPH002", L"Office Phone", box, 4); InsertItemDefinition(L"TBM002", L"Three Bottons Mouse", box, 1); const auto carton = db::package::FindByCode(L"CTN"); InsertItemDefinition(L"PSH001", L"Paper Sheets", carton, 2); InsertItemDefinition(L"LBL001", L"Labels", carton, 2); const auto tank = db::package::FindByCode(L"TNK"); InsertItemDefinition(L"KER001", L"Kerosene", tank, 10, CItemDefinitionFlags::HazMat); }
static void describe_monster_kills(int r_idx, const monster_lore *l_ptr) { const monster_race *r_ptr = &r_info[r_idx]; int msex = 0; bool out = TRUE; /* Extract a gender (if applicable) */ if (r_ptr->flags1 & RF1_FEMALE) msex = 2; else if (r_ptr->flags1 & RF1_MALE) msex = 1; /* Treat uniques differently */ if (l_ptr->flags1 & RF1_UNIQUE) { /* Hack -- Determine if the unique is "dead" */ bool dead = (r_ptr->max_num == 0) ? TRUE : FALSE; /* We've been killed... */ if (l_ptr->deaths) { /* Killed ancestors */ text_out(format("%^s has slain %d of your ancestors", wd_he[msex], l_ptr->deaths)); /* But we've also killed it */ if (dead) { text_out(", but you have taken revenge! "); } /* Unavenged (ever) */ else { text_out(format(", who %s unavenged. ", plural(l_ptr->deaths, "remains", "remain"))); } } /* Dead unique who never hurt us */ else if (dead) { text_out("You have slain this foe. "); } else { /* Alive and never killed us */ out = FALSE; } } /* Not unique, but killed us */ else if (l_ptr->deaths) { /* Dead ancestors */ text_out(format("%d of your ancestors %s been killed by this creature, ", l_ptr->deaths, plural(l_ptr->deaths, "has", "have"))); /* Some kills this life */ if (l_ptr->pkills) { text_out(format("and you have exterminated at least %d of the creatures. ", l_ptr->pkills)); } /* Some kills past lives */ else if (l_ptr->tkills) { text_out(format("and %s have exterminated at least %d of the creatures. ", "your ancestors", l_ptr->tkills)); } /* No kills */ else { text_out_c(TERM_RED, format("and %s is not ever known to have been defeated. ", wd_he[msex])); } } /* Normal monsters */ else { /* Killed some this life */ if (l_ptr->pkills) { text_out(format("You have killed at least %d of these creatures. ", l_ptr->pkills)); } /* Killed some last life */ else if (l_ptr->tkills) { text_out(format("Your ancestors have killed at least %d of these creatures. ", l_ptr->tkills)); } /* Killed none */ else { text_out("No battles to the death are recalled. "); } } /* Separate */ if (out) text_out("\n"); }
static void describe_monster_abilities(int r_idx, const monster_lore *l_ptr) { const monster_race *r_ptr = &r_info[r_idx]; int n; int vn; cptr vp[64]; int msex = 0; /* Extract a gender (if applicable) */ if (r_ptr->flags1 & RF1_FEMALE) msex = 2; else if (r_ptr->flags1 & RF1_MALE) msex = 1; /* Collect special abilities. */ vn = 0; if (l_ptr->flags2 & RF2_OPEN_DOOR) vp[vn++] = "open doors"; if (l_ptr->flags2 & RF2_BASH_DOOR) vp[vn++] = "bash down doors"; if (l_ptr->flags2 & RF2_PASS_WALL) vp[vn++] = "pass through walls"; if (l_ptr->flags2 & RF2_KILL_WALL) vp[vn++] = "bore through walls"; if (l_ptr->flags2 & RF2_MOVE_BODY) vp[vn++] = "push past weaker monsters"; if (l_ptr->flags2 & RF2_KILL_BODY) vp[vn++] = "destroy weaker monsters"; if (l_ptr->flags2 & RF2_TAKE_ITEM) vp[vn++] = "pick up objects"; if (l_ptr->flags2 & RF2_KILL_ITEM) vp[vn++] = "destroy objects"; /* Describe special abilities. */ if (vn) { /* Intro */ text_out(format("%^s", wd_he[msex])); /* Scan */ for (n = 0; n < vn; n++) { /* Intro */ if (n == 0) text_out(" can "); else if (n < vn-1) text_out(", "); else text_out(" and "); /* Dump */ text_out(vp[n]); } /* End */ text_out(". "); } /* Describe special abilities. */ if (l_ptr->flags2 & RF2_INVISIBLE) { text_out(format("%^s is invisible. ", wd_he[msex])); } if (l_ptr->flags2 & RF2_COLD_BLOOD) { text_out(format("%^s is cold blooded. ", wd_he[msex])); } if (l_ptr->flags2 & RF2_EMPTY_MIND) { text_out(format("%^s is not detected by telepathy. ", wd_he[msex])); } if (l_ptr->flags2 & RF2_WEIRD_MIND) { text_out(format("%^s is rarely detected by telepathy. ", wd_he[msex])); } if (l_ptr->flags2 & RF2_MULTIPLY) { text_out(format("%^s breeds explosively. ", wd_he[msex])); } if (l_ptr->flags2 & RF2_REGENERATE) { text_out(format("%^s regenerates quickly. ", wd_he[msex])); } /* Collect susceptibilities */ vn = 0; if (l_ptr->flags3 & RF3_HURT_ROCK) vp[vn++] = "rock remover"; if (l_ptr->flags3 & RF3_HURT_LITE) vp[vn++] = "bright light"; if (l_ptr->flags3 & RF3_HURT_FIRE) vp[vn++] = "fire"; if (l_ptr->flags3 & RF3_HURT_COLD) vp[vn++] = "cold"; /* Describe susceptibilities */ if (vn) { /* Intro */ text_out(format("%^s", wd_he[msex])); /* Scan */ for (n = 0; n < vn; n++) { /* Intro */ if (n == 0) text_out(" is hurt by "); else if (n < vn-1) text_out(", "); else text_out(" and "); /* Dump */ text_out_c(TERM_YELLOW, vp[n]); } /* End */ text_out(". "); } /* Collect immunities */ vn = 0; if (l_ptr->flags3 & RF3_IM_ACID) vp[vn++] = "acid"; if (l_ptr->flags3 & RF3_IM_ELEC) vp[vn++] = "lightning"; if (l_ptr->flags3 & RF3_IM_FIRE) vp[vn++] = "fire"; if (l_ptr->flags3 & RF3_IM_COLD) vp[vn++] = "cold"; if (l_ptr->flags3 & RF3_IM_POIS) vp[vn++] = "poison"; /* Describe immunities */ if (vn) { /* Intro */ text_out(format("%^s", wd_he[msex])); /* Scan */ for (n = 0; n < vn; n++) { /* Intro */ if (n == 0) text_out(" resists "); else if (n < vn-1) text_out(", "); else text_out(" and "); /* Dump */ text_out_c(TERM_ORANGE, vp[n]); } /* End */ text_out(". "); } /* Collect resistances */ vn = 0; if (l_ptr->flags3 & RF3_RES_NETH) vp[vn++] = "nether"; if (l_ptr->flags3 & RF3_RES_WATE) vp[vn++] = "water"; if (l_ptr->flags3 & RF3_RES_PLAS) vp[vn++] = "plasma"; if (l_ptr->flags3 & RF3_RES_NEXU) vp[vn++] = "nexus"; if (l_ptr->flags3 & RF3_RES_DISE) vp[vn++] = "disenchantment"; /* Describe resistances */ if (vn) { /* Intro */ text_out(format("%^s", wd_he[msex])); /* Scan */ for (n = 0; n < vn; n++) { /* Intro */ if (n == 0) text_out(" resists "); else if (n < vn-1) text_out(", "); else text_out(" and "); /* Dump */ text_out_c(TERM_ORANGE, vp[n]); } /* End */ text_out(". "); } /* Collect non-effects */ vn = 0; if (l_ptr->flags3 & RF3_NO_STUN) vp[vn++] = "stunned"; if (l_ptr->flags3 & RF3_NO_FEAR) vp[vn++] = "frightened"; if (l_ptr->flags3 & RF3_NO_CONF) vp[vn++] = "confused"; if (l_ptr->flags3 & RF3_NO_SLEEP) vp[vn++] = "slept"; /* Describe non-effects */ if (vn) { /* Intro */ text_out(format("%^s", wd_he[msex])); /* Scan */ for (n = 0; n < vn; n++) { /* Intro */ if (n == 0) text_out(" cannot be "); else if (n < vn-1) text_out(", "); else text_out(" or "); /* Dump */ text_out_c(TERM_YELLOW, vp[n]); } /* End */ text_out(". "); } /* Do we know how aware it is? */ if ((((int)l_ptr->wake * (int)l_ptr->wake) > r_ptr->sleep) || (l_ptr->ignore == MAX_UCHAR) || ((r_ptr->sleep == 0) && (l_ptr->tkills >= 10))) { cptr act; if (r_ptr->sleep > 200) { act = "prefers to ignore"; } else if (r_ptr->sleep > 95) { act = "pays very little attention to"; } else if (r_ptr->sleep > 75) { act = "pays little attention to"; } else if (r_ptr->sleep > 45) { act = "tends to overlook"; } else if (r_ptr->sleep > 25) { act = "takes quite a while to see"; } else if (r_ptr->sleep > 10) { act = "takes a while to see"; } else if (r_ptr->sleep > 5) { act = "is fairly observant of"; } else if (r_ptr->sleep > 3) { act = "is observant of"; } else if (r_ptr->sleep > 1) { act = "is very observant of"; } else if (r_ptr->sleep > 0) { act = "is vigilant for"; } else { act = "is ever vigilant for"; } text_out(format("%^s %s intruders, which %s may notice from %d feet. ", wd_he[msex], act, wd_he[msex], 10 * r_ptr->aaf)); } /* Describe escorts */ if ((l_ptr->flags1 & RF1_ESCORT) || (l_ptr->flags1 & RF1_ESCORTS)) { text_out(format("%^s usually appears with escorts. ", wd_he[msex])); } /* Describe friends */ else if ((l_ptr->flags1 & RF1_FRIEND) || (l_ptr->flags1 & RF1_FRIENDS)) { text_out(format("%^s usually appears in groups. ", wd_he[msex])); } }