本文整理汇总了C++中OLC_MODE函数的典型用法代码示例。如果您正苦于以下问题:C++ OLC_MODE函数的具体用法?C++ OLC_MODE怎么用?C++ OLC_MODE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OLC_MODE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: zedit_disp_arg1
/*
* Print the appropriate message for the command type for arg1 and set
* up the input catch clause
*/
void zedit_disp_arg1(struct descriptor_data *d)
{
switch (OLC_CMD(d).command) {
case 'M':
SEND_TO_Q("Input mob's vnum : ", d);
OLC_MODE(d) = ZEDIT_ARG1;
break;
case 'O':
case 'E':
case 'P':
case 'G':
SEND_TO_Q("Input object vnum : ", d);
OLC_MODE(d) = ZEDIT_ARG1;
break;
case 'D':
case 'R':
/*
* Arg1 for these is the room number, skip to arg2
*/
OLC_CMD(d).arg1 = real_room(OLC_NUM(d));
zedit_disp_arg2(d);
break;
default:
/*
* We should never get here.
*/
cleanup_olc(d, CLEANUP_ALL);
mudlog("SYSERR: OLC: zedit_disp_arg1(): Help!", BRF, LVL_BUILDER, TRUE);
SEND_TO_Q("Oops...\r\n", d);
return;
}
}
示例2: redit_disp_exit_edit
void redit_disp_exit_edit( DESCRIPTOR_DATA *d )
{
char flags[MSL];
EXIT_DATA *pexit = d->character->spare_ptr;
int x;
flags[0] = '\0';
for ( x = 0; x < MAX_EXIT; x++ )
{
if ( pexit->flags && HAS_BIT(pexit->flags, x) )
{
strcat( flags, code_name(NULL, x, CODE_EXIT) );
strcat( flags, " " );
}
}
OLC_MODE(d) = REDIT_EXIT_EDIT;
write_to_buffer( d, "50\x1B[;H\x1B[2J", 0 );
ch_printf( d->character, "&g1&w) Direction : &c%s\r\n", code_name(NULL, pexit->vdir, CODE_DIR) );
ch_printf( d->character, "&g2&w) To Vnum : &c%d\r\n", (pexit->to_room) ? pexit->to_room->vnum : -1 );
ch_printf( d->character, "&g3&w) Key : &c%d\r\n", pexit->key );
ch_printf( d->character, "&g4&w) Keyword : &c%s\r\n", (VALID_STR(pexit->keyword)) ? pexit->keyword : "(none)" );
ch_printf( d->character, "&g5&w) Flags : &c%s\r\n", (VALID_STR(flags)) ? flags : "(none)" );
ch_printf( d->character, "&g6&w) Description: &c%s\r\n", (VALID_STR(pexit->description)) ? pexit->description : "(none)" );
send_to_char( d->character, "&gQ&w) Quit\r\n" );
send_to_char( d->character, "\r\nEnter choice: " );
}
示例3: redit_disp_exit_flag_menu
/* For exit flags */
void redit_disp_exit_flag_menu( DESCRIPTOR_DATA *d )
{
EXIT_DATA *pexit = d->character->spare_ptr;
char buf[MSL];
int x;
write_to_buffer( d, "50\x1B[;H\x1B[2J", 0 );
for ( x = 0; x < MAX_EXIT; x++ )
{
if ( (x == EXIT_RES1) || (x == EXIT_RES2) || (x == EXIT_PORTAL) )
continue;
ch_printf( d->character, "&g%2d&w) %-20.20s\r\n", x+1, code_name(NULL, x, CODE_EXIT) );
}
buf[0] = '\0';
for ( x = 0; x < MAX_EXIT; x++ )
{
if ( HAS_BIT(pexit->flags, x) )
{
strcat( buf, code_name(NULL, x, CODE_EXIT) );
strcat( buf, " " );
}
}
ch_printf( d->character, "\r\nExit flags: &c%s&w\r\n"
"Enter room flags, 0 to quit: ", buf );
OLC_MODE(d) = REDIT_EXIT_FLAGS;
}
示例4: sedit_rooms_menu
static void sedit_rooms_menu(struct descriptor_data *d)
{
struct shop_data *shop;
int i;
room_rnum rnum;
shop = OLC_SHOP(d);
get_char_colors(d->character);
clear_screen(d);
write_to_output(d, "## VNUM Room\r\n\r\n");
for (i = 0; S_ROOM(shop, i) != NOWHERE; i++) {
rnum = real_room(S_ROOM(shop, i));
/* if the room has been deleted, this may crash us otherwise. */
/* set to 0 to be deletable. -- Welcor 09/04 */
if (rnum == NOWHERE)
S_ROOM(shop, i) = rnum = 0;
write_to_output(d, "%2d - [%s%5d%s] - %s%s%s\r\n", i, cyn, S_ROOM(shop, i), nrm,
yel, world[rnum].name, nrm);
}
write_to_output(d, "\r\n"
"%sA%s) Add a new room.\r\n"
"%sD%s) Delete a room.\r\n"
"%sC%s) Compact Display.\r\n"
"%sQ%s) Quit\r\n"
"Enter choice : ", grn, nrm, grn, nrm, grn, nrm, grn, nrm);
OLC_MODE(d) = SEDIT_ROOMS_MENU;
}
示例5: sedit_compact_rooms_menu
static void sedit_compact_rooms_menu(struct descriptor_data *d)
{
struct shop_data *shop;
int i;
shop = OLC_SHOP(d);
get_char_colors(d->character);
clear_screen(d);
for (i = 0; S_ROOM(shop, i) != NOWHERE; i++) {
if (real_room(S_ROOM(shop, i)) != NOWHERE) {
write_to_output(d, "%2d - [@\t%5d\tn] - \ty%s\tn\r\n", i, S_ROOM(shop, i), world[real_room(S_ROOM(shop, i))].name);
} else {
write_to_output(d, "%2d - [\tR!Removed Room!\tn]\r\n", i);
}
}
write_to_output(d, "\r\n"
"%sA%s) Add a new room.\r\n"
"%sD%s) Delete a room.\r\n"
"%sL%s) Long display.\r\n"
"%sQ%s) Quit\r\n"
"Enter choice : ", grn, nrm, grn, nrm, grn, nrm, grn, nrm);
OLC_MODE(d) = SEDIT_ROOMS_MENU;
}
示例6: find_context_medit
int find_context_medit(struct descriptor_data *d)
{
switch (OLC_MODE(d)) {
case MEDIT_MAIN_MENU: return CONTEXT_MEDIT_MAIN_MENU;
case MEDIT_ALIAS: return CONTEXT_MEDIT_ALIAS;
case MEDIT_S_DESC: return CONTEXT_MEDIT_S_DESC;
case MEDIT_L_DESC: return CONTEXT_MEDIT_L_DESC;
case MEDIT_D_DESC: return CONTEXT_MEDIT_D_DESC;
case MEDIT_NPC_FLAGS: return CONTEXT_MEDIT_NPC_FLAGS;
case MEDIT_AFF_FLAGS: return CONTEXT_MEDIT_AFF_FLAGS;
case MEDIT_CONFIRM_SAVESTRING:return CONTEXT_MEDIT_CONFIRM_SAVESTRING;
case MEDIT_SEX: return CONTEXT_MEDIT_SEX;
case MEDIT_HITROLL: return CONTEXT_MEDIT_HITROLL;
case MEDIT_DAMROLL: return CONTEXT_MEDIT_DAMROLL;
case MEDIT_NDD: return CONTEXT_MEDIT_NDD;
case MEDIT_SDD: return CONTEXT_MEDIT_SDD;
case MEDIT_NUM_HP_DICE: return CONTEXT_MEDIT_NUM_HP_DICE;
case MEDIT_SIZE_HP_DICE: return CONTEXT_MEDIT_SIZE_HP_DICE;
case MEDIT_ADD_HP: return CONTEXT_MEDIT_ADD_HP;
case MEDIT_AC: return CONTEXT_MEDIT_AC;
case MEDIT_EXP: return CONTEXT_MEDIT_EXP;
case MEDIT_GOLD: return CONTEXT_MEDIT_GOLD;
case MEDIT_POS: return CONTEXT_MEDIT_POS;
case MEDIT_DEFAULT_POS: return CONTEXT_MEDIT_DEFAULT_POS;
case MEDIT_ATTACK: return CONTEXT_MEDIT_ATTACK;
case MEDIT_LEVEL: return CONTEXT_MEDIT_LEVEL;
case MEDIT_ALIGNMENT: return CONTEXT_MEDIT_ALIGNMENT;
case OLC_SCRIPT_EDIT: return find_context_script_edit(d);
default: return NOTHING;
}
}
示例7: find_context_sedit
int find_context_sedit(struct descriptor_data *d)
{
switch (OLC_MODE(d)) {
case SEDIT_MAIN_MENU: return CONTEXT_SEDIT_MAIN_MENU;
case SEDIT_CONFIRM_SAVESTRING:return CONTEXT_SEDIT_CONFIRM_SAVESTRING;
case SEDIT_NOITEM1: return CONTEXT_SEDIT_NOITEM1;
case SEDIT_NOITEM2: return CONTEXT_SEDIT_NOITEM2;
case SEDIT_NOCASH1: return CONTEXT_SEDIT_NOCASH1;
case SEDIT_NOCASH2: return CONTEXT_SEDIT_NOCASH2;
case SEDIT_NOBUY: return CONTEXT_SEDIT_NOBUY;
case SEDIT_BUY: return CONTEXT_SEDIT_BUY;
case SEDIT_SELL: return CONTEXT_SEDIT_SELL;
case SEDIT_PRODUCTS_MENU: return CONTEXT_SEDIT_PRODUCTS_MENU;
case SEDIT_ROOMS_MENU: return CONTEXT_SEDIT_ROOMS_MENU;
case SEDIT_NAMELIST_MENU: return CONTEXT_SEDIT_NAMELIST_MENU;
case SEDIT_NAMELIST: return CONTEXT_SEDIT_NAMELIST;
case SEDIT_OPEN1: return CONTEXT_SEDIT_OPEN1;
case SEDIT_OPEN2: return CONTEXT_SEDIT_OPEN2;
case SEDIT_CLOSE1: return CONTEXT_SEDIT_CLOSE1;
case SEDIT_CLOSE2: return CONTEXT_SEDIT_CLOSE2;
case SEDIT_KEEPER: return CONTEXT_SEDIT_KEEPER;
case SEDIT_BUY_PROFIT: return CONTEXT_SEDIT_BUY_PROFIT;
case SEDIT_SELL_PROFIT: return CONTEXT_SEDIT_SELL_PROFIT;
case SEDIT_TYPE_MENU: return CONTEXT_SEDIT_TYPE_MENU;
case SEDIT_DELETE_TYPE: return CONTEXT_SEDIT_DELETE_TYPE;
case SEDIT_DELETE_PRODUCT: return CONTEXT_SEDIT_DELETE_PRODUCT;
case SEDIT_NEW_PRODUCT: return CONTEXT_SEDIT_NEW_PRODUCT;
case SEDIT_DELETE_ROOM: return CONTEXT_SEDIT_DELETE_ROOM;
case SEDIT_NEW_ROOM: return CONTEXT_SEDIT_NEW_ROOM;
case SEDIT_SHOP_FLAGS: return CONTEXT_SEDIT_SHOP_FLAGS;
case SEDIT_NOTRADE: return CONTEXT_SEDIT_NOTRADE;
default: return NOTHING;
}
}
示例8: oedit_disp_val3_menu
/*
* Object value #3
*/
void oedit_disp_val3_menu(struct descriptor_data *d)
{
OLC_MODE(d) = OEDIT_VALUE_3;
switch (GET_OBJ_TYPE(OLC_OBJ(d))) {
case ITEM_LIGHT:
write_to_output(d, "Number of hours (0 = burnt, -1 is infinite) : ");
break;
case ITEM_SCROLL:
case ITEM_POTION:
oedit_disp_spells_menu(d);
break;
case ITEM_WAND:
case ITEM_STAFF:
write_to_output(d, "Number of charges remaining : ");
break;
case ITEM_WEAPON:
write_to_output(d, "Size of damage dice : ");
break;
case ITEM_CONTAINER:
write_to_output(d, "Vnum of key to open container (-1 for no key) : ");
break;
case ITEM_DRINKCON:
case ITEM_FOUNTAIN:
oedit_liquid_type(d);
break;
default:
oedit_disp_menu(d);
}
}
示例9: oedit_disp_val2_menu
/*
* Object value #2
*/
void oedit_disp_val2_menu(struct descriptor_data *d)
{
OLC_MODE(d) = OEDIT_VALUE_2;
switch (GET_OBJ_TYPE(OLC_OBJ(d))) {
case ITEM_SCROLL:
case ITEM_POTION:
oedit_disp_spells_menu(d);
break;
case ITEM_WAND:
case ITEM_STAFF:
write_to_output(d, "Max number of charges : ");
break;
case ITEM_WEAPON:
write_to_output(d, "Number of damage dice : ");
break;
case ITEM_FOOD:
/*
* Values 2 and 3 are unused, jump to 4...Odd.
*/
oedit_disp_val4_menu(d);
break;
case ITEM_CONTAINER:
/*
* These are flags, needs a bit of special handling.
*/
oedit_disp_container_flags_menu(d);
break;
case ITEM_DRINKCON:
case ITEM_FOUNTAIN:
write_to_output(d, "Initial drink units : ");
break;
default:
oedit_disp_menu(d);
}
}
示例10: find_context_oedit
int find_context_oedit(struct descriptor_data *d)
{
switch (OLC_MODE(d)) {
case OEDIT_MAIN_MENU: return CONTEXT_OEDIT_MAIN_MENU;
case OEDIT_EDIT_NAMELIST: return CONTEXT_OEDIT_EDIT_NAMELIST;
case OEDIT_SHORTDESC: return CONTEXT_OEDIT_SHORTDESC;
case OEDIT_LONGDESC: return CONTEXT_OEDIT_LONGDESC;
case OEDIT_ACTDESC: return CONTEXT_OEDIT_ACTDESC;
case OEDIT_TYPE: return CONTEXT_OEDIT_TYPE;
case OEDIT_EXTRAS: return CONTEXT_OEDIT_EXTRAS;
case OEDIT_WEAR: return CONTEXT_OEDIT_WEAR;
case OEDIT_WEIGHT: return CONTEXT_OEDIT_WEIGHT;
case OEDIT_COST: return CONTEXT_OEDIT_COST;
case OEDIT_COSTPERDAY: return CONTEXT_OEDIT_COSTPERDAY;
case OEDIT_TIMER: return CONTEXT_OEDIT_TIMER;
case OEDIT_VALUE_1: return CONTEXT_OEDIT_VALUE_1;
case OEDIT_VALUE_2: return CONTEXT_OEDIT_VALUE_2;
case OEDIT_VALUE_3: return CONTEXT_OEDIT_VALUE_3;
case OEDIT_VALUE_4: return CONTEXT_OEDIT_VALUE_4;
case OEDIT_APPLY: return CONTEXT_OEDIT_APPLY;
case OEDIT_APPLYMOD: return CONTEXT_OEDIT_APPLYMOD;
case OEDIT_EXTRADESC_KEY: return CONTEXT_OEDIT_EXTRADESC_KEY;
case OEDIT_CONFIRM_SAVEDB: return CONTEXT_OEDIT_CONFIRM_SAVEDB;
case OEDIT_CONFIRM_SAVESTRING: return CONTEXT_OEDIT_CONFIRM_SAVESTRING;
case OEDIT_PROMPT_APPLY: return CONTEXT_OEDIT_PROMPT_APPLY;
case OEDIT_EXTRADESC_DESCRIPTION: return CONTEXT_OEDIT_EXTRADESC_DESCRIPTION;
case OEDIT_EXTRADESC_MENU: return CONTEXT_OEDIT_EXTRADESC_MENU;
case OEDIT_LEVEL: return CONTEXT_OEDIT_LEVEL;
case OEDIT_PERM: return CONTEXT_OEDIT_PERM;
case OLC_SCRIPT_EDIT: return find_context_script_edit(d);
default: return NOTHING;
}
}
示例11: zedit_disp_arg2
/*
* Print the appropriate message for the command type for arg2 and set
* up the input catch clause.
*/
void zedit_disp_arg2(struct descriptor_data *d)
{
int i;
switch (OLC_CMD(d).command) {
case 'M':
case 'O':
case 'E':
case 'P':
case 'G':
SEND_TO_Q("Input the maximum number that can exist on the mud : ", d);
break;
case 'D':
for (i = 0; *dirs[i] != '\n'; i++) {
sprintf(buf, "%d) Exit %s.\r\n", i, dirs[i]);
SEND_TO_Q(buf, d);
}
SEND_TO_Q("Enter exit number for door : ", d);
break;
case 'R':
SEND_TO_Q("Input object's vnum : ", d);
break;
default:
/*
* We should never get here, but just in case...
*/
cleanup_olc(d, CLEANUP_ALL);
mudlog("SYSERR: OLC: zedit_disp_arg2(): Help!", BRF, LVL_BUILDER, TRUE);
SEND_TO_Q("Oops...\r\n", d);
return;
}
OLC_MODE(d) = ZEDIT_ARG2;
}
示例12: zedit_disp_arg4
void zedit_disp_arg4(struct descriptor_data *d)
{
switch (OLC_CMD(d).command) {
case 'M':
case 'O':
case 'E':
case 'G':
SEND_TO_Q("Enter The Load % : ", d);
break;
case 'P':
case 'D':
case 'R':
break;
default:
/*
* We should never get here, but just in case...
*/
cleanup_olc(d, CLEANUP_ALL);
mudlog("SYSERR: OLC: zedit_disp_arg4(): Help!", BRF, LVL_BUILDER, TRUE);
SEND_TO_Q("Oops...\r\n", d);
return;
}
OLC_MODE(d) = ZEDIT_ARG4;
}
示例13: redit_disp_exit_menu
/* For exits */
void redit_disp_exit_menu( DESCRIPTOR_DATA *d )
{
ROOM_DATA *room = d->character->dest_buf;
EXIT_DATA *pexit;
int cnt;
OLC_MODE(d) = REDIT_EXIT_MENU;
write_to_buffer( d, "50\x1B[;H\x1B[2J", 0 );
for ( cnt = 0, pexit = room->first_exit; pexit; pexit = pexit->next )
{
ch_printf( d->character,
"&g%2d&w) %-10.10s to %-5d. Key: %d Keywords: %s Flags: %s.\r\n",
++cnt,
code_name(NULL, pexit->vdir, CODE_DIR),
(pexit->to_room) ? pexit->to_room->vnum : 0,
pexit->key,
code_bit(NULL, pexit->flags, CODE_EXIT),
(VALID_STR(pexit->keyword)) ? pexit->keyword : "(none)" );
}
if ( room->first_exit )
send_to_char( d->character, "\r\n" );
send_to_char( d->character, "&gA&w) Add a new exit\r\n" );
send_to_char( d->character, "&gR&w) Remove an exit\r\n" );
send_to_char( d->character, "&gQ&w) Quit\r\n" );
send_to_char( d->character, "\r\nEnter choice: " );
}
示例14: zedit_disp_arg3
/*
* Print the appropriate message for the command type for arg3 and set
* up the input catch clause.
*/
void zedit_disp_arg3(struct descriptor_data *d)
{
int i = 0;
switch (OLC_CMD(d).command) {
case 'E':
while (*equipment_types[i] != '\n') {
sprintf(buf, "%2d) %26.26s %2d) %26.26s\r\n", i,
equipment_types[i], i + 1, (*equipment_types[i + 1] != '\n') ?
equipment_types[i + 1] : "");
SEND_TO_Q(buf, d);
if (*equipment_types[i + 1] != '\n')
i += 2;
else
break;
}
SEND_TO_Q("Location to equip : ", d);
break;
case 'P':
SEND_TO_Q("Virtual number of the container : ", d);
break;
case 'D':
SEND_TO_Q( "0) Door open\r\n"
"1) Door closed\r\n"
"2) Door locked\r\n"
"Enter state of the door : ", d);
break;
case 'V':
send_to_char("Enter the global name: ", d->character);
OLC_MODE(d) = ZEDIT_SARG1;
return;
case 'M':
case 'O':
case 'R':
case 'G':
default:
/*
* We should never get here, just in case.
*/
cleanup_olc(d, CLEANUP_ALL);
mudlog("SYSERR: OLC: zedit_disp_arg3(): Help!", BRF, LVL_BUILDER, TRUE);
SEND_TO_Q("Oops...\r\n", d);
return;
}
OLC_MODE(d) = ZEDIT_ARG3;
}
示例15: oedit_disp_apply_menu
/* The actual apply to set. */
static void oedit_disp_apply_menu(struct descriptor_data *d)
{
get_char_colors(d->character);
clear_screen(d);
column_list(d->character, 0, apply_types, NUM_APPLIES, TRUE);
write_to_output(d, "\r\nEnter apply type (0 is no apply) : ");
OLC_MODE(d) = OEDIT_APPLY;
}