这篇教程C++ CONST_S函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CONST_S函数的典型用法代码示例。如果您正苦于以下问题:C++ CONST_S函数的具体用法?C++ CONST_S怎么用?C++ CONST_S使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CONST_S函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ADD_MESSAGEtruth commandsystem::Throw(character* Char){ if(!Char->CheckThrow()) return false; if(!Char->GetStack()->GetItems()) { ADD_MESSAGE("You have nothing to throw!"); return false; } item* Item = Char->GetStack()->DrawContents(Char, CONST_S("What do you want to throw?")); if(Item) { int Answer = game::DirectionQuestion(CONST_S("In what direction do you wish to throw? " "[press a direction key]"), false); if(Answer == DIR_ERROR) return false; Char->ThrowItem(Answer, Item); Char->EditExperience(ARM_STRENGTH, 75, 1 << 8); Char->EditExperience(DEXTERITY, 75, 1 << 8); Char->EditExperience(PERCEPTION, 75, 1 << 8); Char->EditNP(-50); Char->DexterityAction(5); return true; } else return false;}
开发者ID:AlexMooney,项目名称:ivan,代码行数:32,
示例2: Listvoid highscore::Draw() const{ if(Score.empty()) { iosystem::TextScreen(CONST_S("There are no entries yet. " "Play a game to correct this.")); return; } if(GetVersion() != HIGH_SCORE_VERSION) { iosystem::TextScreen(CONST_S("The highscore file is for an other version of IVAN.")); return; } felist List(CONST_S("Adventurers' Hall of Fame")); festring Desc; for(uint c = 0; c < Score.size(); ++c) { Desc.Empty(); Desc << c + 1; Desc.Resize(5, ' '); Desc << Score[c]; Desc.Resize(13, ' '); Desc << Entry[c]; List.AddEntry(Desc, c == uint(LastAdd) ? WHITE : LIGHT_GRAY, 13); } List.SetFlags(FADE); List.SetPageLength(40); List.Draw();}
开发者ID:znation,项目名称:ivan,代码行数:33,
示例3: Listtruth commandsystem::ShowWeaponSkills(character* Char){ felist List(CONST_S("Your experience in weapon categories")); List.AddDescription(CONST_S("")); List.AddDescription(CONST_S("Category name Level Points Needed Battle bonus")); truth Something = false; festring Buffer; for(int c = 0; c < Char->GetAllowedWeaponSkillCategories(); ++c) { cweaponskill* Skill = Char->GetCWeaponSkill(c); if(Skill->GetHits() / 100 || (Char->IsUsingWeaponOfCategory(c))) { Buffer = Skill->GetName(c); Buffer.Resize(30); Buffer << Skill->GetLevel(); Buffer.Resize(40); Buffer << Skill->GetHits() / 100; Buffer.Resize(50); if(Skill->GetLevel() != 20) Buffer << (Skill->GetLevelMap(Skill->GetLevel() + 1) - Skill->GetHits()) / 100; else Buffer << '-'; Buffer.Resize(60); Buffer << '+' << (Skill->GetBonus() - 1000) / 10; if(Skill->GetBonus() % 10) Buffer << '.' << Skill->GetBonus() % 10; Buffer << '%'; if(Char->IsUsingWeaponOfCategory(c)) List.AddEntry(Buffer, WHITE); else List.AddEntry(Buffer, LIGHT_GRAY); Something = true; } } if(Char->AddSpecialSkillInfo(List)) Something = true; if(Something) { game::SetStandardListAttributes(List); List.Draw(); } else ADD_MESSAGE("You are not experienced in any weapon skill yet!"); return false;}
开发者ID:AlexMooney,项目名称:ivan,代码行数:56,
示例4: CONST_Struth commandsystem::Quit(character* Char){ if(game::TruthQuestion(CONST_S("Your quest is not yet completed! Really quit? [y/N]"))) { Char->ShowAdventureInfo(); festring Msg = CONST_S("cowardly quit the game"); Char->AddScoreEntry(Msg, 0.75); game::End(Msg, !game::WizardModeIsActive() || game::TruthQuestion(CONST_S("Remove saves? [y/N]"))); return true; } else return false;}
开发者ID:AlexMooney,项目名称:ivan,代码行数:13,
示例5: switchvoid ivanconfig::DirectionKeyMapDisplayer(const cycleoption* O, festring& Entry){ switch(O->Value) { case DIR_NORM: Entry << CONST_S("Normal"); break; case DIR_ALT: Entry << CONST_S("Alternative"); break; case DIR_HACK: Entry << CONST_S("NetHack"); break; }}
开发者ID:hebob,项目名称:ivan,代码行数:15,
示例6: Terminatevoid consume::Handle(){ item* Consuming = game::SearchItem(ConsumingID); if(!Consuming || !Consuming->Exists() || !Actor->IsOver(Consuming)) { Terminate(false); return; } character* Actor = GetActor(); if(!InDNDMode() && Actor->GetHungerState() >= BLOATED) if(Actor->IsPlayer()) { ADD_MESSAGE("You have a really hard time getting all this down your throat."); if(game::TruthQuestion(CONST_S("Continue ") + GetDescription() + "? [y/N]")) ActivateInDNDMode(); else { Terminate(false); return; } } else { Terminate(false); return; } if(!Actor->IsPlayer() && !Consuming->CanBeEatenByAI(Actor)) // item may be spoiled after action was started { Terminate(false); return; } /* Note: if backupped Actor has died of food effect, Action is deleted automatically, so we mustn't Terminate it */ if(Consuming->Consume(Actor, 500) && Actor->GetAction() == this && Actor->IsEnabled()) Terminate(true); else if(Actor->GetHungerState() == OVER_FED) { Actor->DeActivateVoluntaryAction(CONST_S("You are about to choke on this stuff.")); Actor->Vomit(Actor->GetPos(), 500 + RAND() % 500); }}
开发者ID:harmonise,项目名称:ivan-f,代码行数:48,
示例7: Gotruth commandsystem::Go(character* Char){ int Dir = game::DirectionQuestion(CONST_S("In what direction do you want to go? [press a direction key]"), false); if(Dir == DIR_ERROR) return false; go* Go = go::Spawn(Char); Go->SetDirection(Dir); int OKDirectionsCounter = 0; for(int d = 0; d < Char->GetNeighbourSquares(); ++d) { lsquare* Square = Char->GetNeighbourLSquare(d); if(Square && Char->CanMoveOn(Square)) ++OKDirectionsCounter; } Go->SetIsWalkingInOpen(OKDirectionsCounter > 2); Char->SetAction(Go); Char->EditAP(Char->GetStateAPGain(100)); // gum solution Char->GoOn(Go, true); return truth(Char->GetAction());}
开发者ID:AlexMooney,项目名称:ivan,代码行数:25,
示例8: skiptruth ivanconfig::FrameSkipChangeInterface(numberoption* O){ O->ChangeValue(iosystem::NumberQuestion(CONST_S("Set frame skip (-2 = wait, -1 = auto, or 0 to 100):"), GetQuestionPos(), WHITE, !game::IsRunning())); clearToBackgroundAfterChangeInterface(); return false;}
开发者ID:Attnam,项目名称:ivan,代码行数:7,
示例9: ADD_MESSAGEvoid nefas::PrayBadEffect(){ ADD_MESSAGE("A potion drops on your head and shatters into small bits."); PLAYER->ReceiveDamage(0, 2 + RAND() % 7, PHYSICAL_DAMAGE, HEAD); PLAYER->GetStackUnder()->AddItem(brokenbottle::Spawn()); PLAYER->CheckDeath(CONST_S("killed while enjoying the company of ") + GetName(), 0);}
开发者ID:harmonise,项目名称:ivan-f,代码行数:7,
示例10: attruth ivanconfig::XBRZSquaresAroundPlayerChangeInterface(numberoption* O){ O->ChangeValue(iosystem::NumberQuestion(CONST_S("Set how many squares around player to use xBRZ at (0 for whole dungeon):"), GetQuestionPos(), WHITE, !game::IsRunning())); clearToBackgroundAfterChangeInterface(); return false;}
开发者ID:Attnam,项目名称:ivan,代码行数:7,
示例11: widthtruth ivanconfig::WindowWidthChangeInterface(numberoption* O){ O->ChangeValue(iosystem::NumberQuestion(CONST_S("Set new window width (from 640 to your monitor screen max width):"), GetQuestionPos(), WHITE, !game::IsRunning())); clearToBackgroundAfterChangeInterface(); return false;}
开发者ID:Attnam,项目名称:ivan,代码行数:7,
示例12: ADD_MESSAGEvoid atavus::PrayBadEffect(){ ADD_MESSAGE("You have not been good the whole year."); if(PLAYER->GetStack()->GetItems()) { int ToBeDeleted = RAND() % PLAYER->GetStack()->GetItems(); item* Disappearing = PLAYER->GetStack()->GetItem(ToBeDeleted); if(Disappearing->IsDestroyable(0)) { ADD_MESSAGE("Your %s disappears.", Disappearing->CHAR_NAME(UNARTICLED)); Disappearing->RemoveFromSlot(); Disappearing->SendToHell(); } else { ADD_MESSAGE("%s tries to remove your %s, but fails. You feel you are not so gifted anymore.", GetName(), Disappearing->CHAR_NAME(UNARTICLED)); PLAYER->EditAttribute(AGILITY, -1); PLAYER->EditAttribute(ARM_STRENGTH, -1); PLAYER->EditAttribute(ENDURANCE, -1); } } else { ADD_MESSAGE("You feel you are not so gifted anymore."); PLAYER->EditAttribute(AGILITY, -1); PLAYER->EditAttribute(ARM_STRENGTH, -1); PLAYER->EditAttribute(ENDURANCE, -1); } PLAYER->CheckDeath(CONST_S("killed by Atavus's humour"));}
开发者ID:AdrianGin,项目名称:ivan,代码行数:34,
示例13: pagestruth ivanconfig::StackListPageLengthChangeInterface(numberoption* O){ O->ChangeValue(iosystem::NumberQuestion(CONST_S("Set new length of list pages (in entries):"), GetQuestionPos(), WHITE, !game::IsRunning())); clearToBackgroundAfterChangeInterface(); return false;}
开发者ID:Attnam,项目名称:ivan,代码行数:7,
示例14: AltListItemWidthChangeInterfacetruth ivanconfig::AltListItemWidthChangeInterface(numberoption* O){ O->ChangeValue(iosystem::NumberQuestion(CONST_S("Set new item list width:"), GetQuestionPos(), WHITE, !game::IsRunning())); clearToBackgroundAfterChangeInterface(); return false;}
开发者ID:Attnam,项目名称:ivan,代码行数:7,
示例15: NormalNumberChangeInterfacetruth configsystem::NormalNumberChangeInterface(numberoption* O){ O->ChangeValue(iosystem::NumberQuestion(CONST_S("Set new ") + O->Description + ':', v2(30, 30), WHITE, true)); return false;}
开发者ID:Azba,项目名称:ivan,代码行数:7,
示例16: ForceVomittruth commandsystem::ForceVomit(character* Char){ if(Char->CanForceVomit()) { int Dir = game::DirectionQuestion(CONST_S("Where do you wish to vomit? [press a direction key]"), false, true); if(Dir != DIR_ERROR) { v2 VomitPos = Char->GetPos() + game::GetMoveVector(Dir); if(Char->GetArea()->IsValidPos(VomitPos)) { ccharacter* Other = Char->GetArea()->GetSquare(VomitPos)->GetCharacter(); if(Other && Other->GetTeam() != Char->GetTeam() && Other->GetRelation(Char) != HOSTILE && Other->CanBeSeenBy(Char) && !game::TruthQuestion("Do you really want to vomit at " + Other->GetObjectPronoun() + "? [y/N]")) return false; ADD_MESSAGE(Char->GetForceVomitMessage().CStr()); Char->Vomit(Char->GetPos() + game::GetMoveVector(Dir), 500 + RAND() % 500, false); Char->EditAP(-1000); return true; } } } else ADD_MESSAGE("You can't vomit."); return false;}
开发者ID:AlexMooney,项目名称:ivan,代码行数:32,
示例17: ADD_MESSAGEvoid legifer::PrayGoodEffect(){ // I think this is a remnant of past development that you call upon Inlux rather than Legifer. --red_kangaroo ADD_MESSAGE("A booming voice echoes: /"Inlux! Inlux! Save us!/" A huge firestorm engulfs everything around you."); //ADD_MESSAGE("You are surrounded by the righteous flames of %s.", GetName()); game::GetCurrentLevel()->Explosion(PLAYER, CONST_S("killed by the holy flames of ") + GetName(), PLAYER->GetPos(), (Max(20 * PLAYER->GetAttribute(WISDOM), 1) + Max(GetRelation(), 0)) >> 3, false);}
开发者ID:Attnam,项目名称:ivan,代码行数:8,
示例18: intervaltruth ivanconfig::AutoSaveIntervalChangeInterface(numberoption* O){ O->ChangeValue(iosystem::NumberQuestion(CONST_S("Set new autosave interval (1-50000 turns, 0 for never):"), GetQuestionPos(), WHITE, !game::IsRunning())); clearToBackgroundAfterChangeInterface(); return false;}
开发者ID:Attnam,项目名称:ivan,代码行数:9,
示例19: intervaltruth ivanconfig::AutoSaveIntervalChangeInterface(numberoption* O){ O->ChangeValue(iosystem::NumberQuestion(CONST_S("Set new autosave interval (1-50000 turns, 0 for never):"), GetQuestionPos(), WHITE, !game::IsRunning())); if(game::IsRunning()) igraph::BlitBackGround(v2(16, 6), v2(game::GetScreenXSize() << 4, 23)); return false;}
开发者ID:znation,项目名称:ivan,代码行数:9,
示例20: valuetruth ivanconfig::ContrastChangeInterface(numberoption* O){ iosystem::ScrollBarQuestion(CONST_S("Set new contrast value (0-200, '<' and '>' move the slider):"), GetQuestionPos(), O->Value, 5, 0, 200, O->Value, WHITE, LIGHT_GRAY, DARK_GRAY, game::GetMoveCommandKey(KEY_LEFT_INDEX), game::GetMoveCommandKey(KEY_RIGHT_INDEX), !game::IsRunning(), static_cast<scrollbaroption*>(O)->BarHandler); if(game::IsRunning()) igraph::BlitBackGround(v2(16, 6), v2(game::GetScreenXSize() << 4, 23)); return false;}
开发者ID:znation,项目名称:ivan,代码行数:9,
示例21: voidvoid configsystem::Show(void (*BackGroundDrawer)(), void (*ListAttributeInitializer)(felist&), truth SlaveScreen){ int Chosen; truth TruthChange = false; felist List(CONST_S("Which setting do you wish to configure?")); List.AddDescription(CONST_S("")); List.AddDescription(CONST_S("Setting Value")); for(;;) { if(SlaveScreen) BackGroundDrawer(); List.Empty(); for(int c = 0; c < Options; ++c) { festring Entry = Option[c]->Description; Entry.Capitalize(); Entry.Resize(60); Option[c]->DisplayeValue(Entry); List.AddEntry(Entry, LIGHT_GRAY); } if(SlaveScreen && ListAttributeInitializer) ListAttributeInitializer(List); List.SetFlags(SELECTABLE|(SlaveScreen ? DRAW_BACKGROUND_AFTERWARDS : 0) |(!SlaveScreen && !TruthChange ? FADE : 0)); Chosen = List.Draw(); festring String; if(Chosen < Options) TruthChange = Option[Chosen]->ActivateChangeInterface(); else { Save(); return; } }}
开发者ID:Azba,项目名称:ivan,代码行数:44,
示例22: Initializevoid ivanconfig::Initialize(const festring& UserName){ configsystem::AddOption(&DefaultPetName); configsystem::AddOption(&WarnAboutDanger); configsystem::AddOption(&AutoDropLeftOvers); configsystem::AddOption(&UseAlternativeKeys); configsystem::SetConfigFileName(CONST_S(LOCAL_STATE_DIR "/config/") + UserName + ".ivanrc"); configsystem::Load(); CalculateContrastLuminance();}
开发者ID:jarpiain,项目名称:ivan-tty,代码行数:10,
示例23: Polymorphtruth commandsystem::Polymorph(character* Char){ character* NewForm; if(!Char->GetNewFormForPolymorphWithControl(NewForm)) return true; Char->Polymorph(NewForm, game::NumberQuestion(CONST_S("For how long?"), WHITE)); return true;}
开发者ID:AlexMooney,项目名称:ivan,代码行数:10,
注:本文中的CONST_S函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CONST_STR_LEN函数代码示例 C++ CONST_INT_P函数代码示例 |