这篇教程C++ turn_off函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中turn_off函数的典型用法代码示例。如果您正苦于以下问题:C++ turn_off函数的具体用法?C++ turn_off怎么用?C++ turn_off使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了turn_off函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: mainint main(int argc, char *argv[]){ char* line = NULL; size_t len = 0; ssize_t read; char action[8]; int lights[1000][1000]; int from[2] = {0, 0}; int to[2] = {0, 0}; init(lights); while ((read = getline(&line, &len, stdin)) != -1) { sscanf(line, "%[ togleurnf] %d,%d through %d,%d", action, &from[0], &from[1], &to[0], &to[1]); if (strcmp(action, "turn on ") == 0) { turn_on(lights, from, to); } else if (strcmp(action, "turn off ") == 0) { turn_off(lights, from, to); } else if (strcmp(action, "toggle ") == 0) { toggle(lights, from, to); } else { puts("bad action"); return 1; } } printf("%d/n", count(lights)); return 0;}
开发者ID:sinisterstuf,项目名称:adventofcode,代码行数:33,
示例2: electrificatevoidelectrificate(void){ int affect_dist = 4 + player.t_stats.s_lvl / 4; struct linked_list *item, *nitem; for (item = mlist; item != NULL; item = nitem) { struct thing *tp = THINGPTR(item); char *mname = monsters[tp->t_index].m_name; nitem = next(item); if (DISTANCE(tp->t_pos, hero) < affect_dist) { int damage = roll(2, player.t_stats.s_lvl); debug("Charge does %d (%d)", damage, tp->t_stats.s_hpt - damage); if (on(*tp, NOBOLT)) continue; if ((tp->t_stats.s_hpt -= damage) <= 0) { msg("The %s is killed by an electric shock.", mname); killed(&player, item, NOMESSAGE, POINTS); continue; } if (rnd(tp->t_stats.s_intel / 5) == 0) { turn_on(*tp, ISFLEE); msg("The %s is shocked by electricity.", mname); } else msg("The %s is zapped by your electricity.", mname); summon_help(tp, NOFORCE); turn_off(*tp, ISFRIENDLY); turn_off(*tp, ISCHARMED); turn_on(*tp, ISRUN); turn_off(*tp, ISDISGUISE); chase_it(&tp->t_pos, &player); fighting = after = running = FALSE; } }}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:47,
示例3: scentfusescent(fuse_arg *arg){ NOOP(arg); turn_off(player, ISUNSMELL); msg("You begin to smell the damp dungeon air again.");}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:8,
示例4: unscentfuseunscent(fuse_arg *arg){ NOOP(arg); turn_off(player, CANSCENT); msg("The smell of monsters goes away.");}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:8,
示例5: unsupereatfuseunsupereat(fuse_arg *arg){ NOOP(arg); turn_off(player, SUPEREAT); msg("You stop feeling so hungry.");}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:8,
示例6: shero/* * shero: * restore lost abilities from cursed potion of shero */voidshero(void){ msg("You feel normal again."); chg_str(2, FALSE, TRUE); chg_dext(2, FALSE, TRUE); turn_off(player, ISUNHERO);}
开发者ID:RoguelikeRestorationProject,项目名称:urogue1.02,代码行数:12,
示例7: undisguise/* * undisguise: * player stops looking like a monster */voidundisguise(void){ msg("Your skin feels itchy for a moment."); turn_off(player, ISDISGUISE); PLAYER = VPLAYER; light(&hero);}
开发者ID:RoguelikeRestorationProject,项目名称:urogue1.02,代码行数:12,
示例8: unbhero/* * unbhero: * super heroism wears off, but no bad effects */voidunbhero(void){ msg("Your feeling of invincibility goes away."); turn_off(player, SUPERHERO); chg_str(-10, FALSE, FALSE); chg_dext(-5, FALSE, FALSE);}
开发者ID:RoguelikeRestorationProject,项目名称:urogue1.02,代码行数:12,
示例9: appear/* * appear: * Become visible again */voidappear(void){ turn_off(player, ISINVIS); PLAYER = VPLAYER; msg("The tingling feeling leaves your body."); light(&hero);}
开发者ID:RoguelikeRestorationProject,项目名称:urogue1.02,代码行数:12,
示例10: cure_disease/* * daemon for curing the diseased */voidcure_disease(void){ turn_off(player, HASDISEASE); if (off (player, HASINFEST)) msg(terse ? "You feel yourself improving." : "You begin to feel yourself improving again.");}
开发者ID:RoguelikeRestorationProject,项目名称:urogue1.02,代码行数:11,
示例11: unphase/* * unphase: * Player can no longer walk through walls */voidunphase(void){ turn_off(player, CANINWALL); msg("Your dizzy feeling leaves you."); if (!step_ok(hero.y, hero.x, NOMONST, &player)) death(D_PETRIFY);}
开发者ID:RoguelikeRestorationProject,项目名称:urogue1.02,代码行数:12,
示例12: unsee/* * unsee: * He lost his see invisible power */voidunsee(void){ if (!ISWEARING(R_SEEINVIS)) { turn_off(player, CANSEE); msg("The tingling feeling leaves your eyes."); }}
开发者ID:RoguelikeRestorationProject,项目名称:urogue1.02,代码行数:12,
示例13: unhearfuseunhear(fuse_arg *arg){ NOOP(arg); turn_off(player, CANHEAR); msg("The sounds of monsters fades away.");}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:8,
示例14: unmshieldfuseunmshield(fuse_arg *arg){ NOOP(arg); turn_off(player, HASMSHIELD); msg("The fog dissapates.");}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:8,
示例15: hearfusehear(fuse_arg *arg){ NOOP(arg); turn_off(player, ISDEAF); msg("You can hear again.");}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:8,
示例16: ungazefuseungaze(fuse_arg *arg){ NOOP(arg); msg("The shiny particles swirl to the floor."); turn_off(player, CANREFLECT);}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:8,
示例17: noslowfusenoslow(fuse_arg *arg){ NOOP(arg); turn_off(player, ISSLOW); msg("You feel yourself speeding up.");}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:8,
示例18: nohastefusenohaste(fuse_arg *arg){ NOOP(arg); turn_off(player, ISHASTE); msg("You feel yourself slowing down.");}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:8,
示例19: unclrheadfuseunclrhead(fuse_arg *arg){ NOOP(arg); turn_off(player, ISCLEAR); msg("The blue aura about your head fades away.");}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:8,
示例20: unconfusefuseunconfuse(fuse_arg *arg){ NOOP(arg); turn_off(player, ISHUH); msg("You feel less confused now."); return;}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:9,
示例21: un_itch/* * daemon for adding back dexterity */voidun_itch(void){ if (lost_dext) { chg_dext(lost_dext, FALSE, FALSE); lost_dext = 0; turn_off(player, HASITCH); }}
开发者ID:RoguelikeRestorationProject,项目名称:urogue1.02,代码行数:12,
示例22: unelectrifyfuseunelectrify(fuse_arg *arg){ NOOP(arg); turn_off(player, ISELECTRIC); msg("The sparks and violet glow from your body fade away."); light(&hero);}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:9,
示例23: close void close () { if (fd >= 0) { turn_off (); // close (fd); tcp_abort (fd); fd = -1; } }
开发者ID:LeadsPlus,项目名称:okws,代码行数:9,
示例24: _off_colornevil::object::object(int x, int y, double size_x, double size_y , double height, const Enki::Color &off_color, const Enki::Color &on_color) : _off_color(off_color) , _on_color(on_color){ pos = Enki::Point(x, y); setRectangular(size_x, size_y, height, -1); turn_off();}
开发者ID:ou-real,项目名称:nevil-base,代码行数:9,
示例25: gb_vibrator_workerstatic void gb_vibrator_worker(struct work_struct *work){ struct delayed_work *delayed_work = to_delayed_work(work); struct gb_vibrator_device *vib = container_of(delayed_work, struct gb_vibrator_device, delayed_work); turn_off(vib);}
开发者ID:AshishNamdev,项目名称:linux,代码行数:10,
示例26: unhotfuseunhot(fuse_arg *arg){ NOOP(arg); turn_off(player, NOFIRE); if (!is_wearing(R_FIRERESIST)) msg("You feel a flush of warmth.");}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:10,
示例27: unflyfuseunfly(fuse_arg *arg){ NOOP(arg); turn_off(player, CANFLY); if (!is_wearing(R_LEVITATION)) msg("You float gently to the ground.");}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:10,
示例28: unshieldfuseunshield(fuse_arg *arg){ NOOP(arg); turn_off(player, HASSHIELD); pstats.s_arm -= pstats.s_acmod; pstats.s_acmod = 0; msg("Your skin feels normal.");}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:10,
示例29: unbreathefuseunbreathe(fuse_arg *arg){ NOOP(arg); turn_off(player, HASOXYGEN); if (!is_wearing(R_BREATHE)) msg("You start huffing and puffing.");}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:10,
示例30: unregenfuseunregen(fuse_arg *arg){ NOOP(arg); turn_off(player, ISREGEN); if (!is_wearing(R_REGEN)) msg("Your metabolism slows down.");}
开发者ID:RoguelikeRestorationProject,项目名称:urogue,代码行数:10,
注:本文中的turn_off函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ tvAsCVarRef函数代码示例 C++ turnRight函数代码示例 |