本文整理汇总了C++中CONST_S函数的典型用法代码示例。如果您正苦于以下问题:C++ CONST_S函数的具体用法?C++ CONST_S怎么用?C++ CONST_S使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CONST_S函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ADD_MESSAGE
truth 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,代码来源:command.cpp
示例2: List
void 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,代码来源:hscore.cpp
示例3: List
truth 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,代码来源:command.cpp
示例4: CONST_S
truth 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,代码来源:command.cpp
示例5: switch
void 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,代码来源:iconf.cpp
示例6: Terminate
void 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,代码来源:actions.cpp
示例7: Go
truth 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,代码来源:command.cpp
示例8: skip
truth 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,代码来源:iconf.cpp
示例9: ADD_MESSAGE
void 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,代码来源:gods.cpp
示例10: at
truth 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,代码来源:iconf.cpp
示例11: width
truth 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,代码来源:iconf.cpp
示例12: ADD_MESSAGE
void 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,代码来源:gods.cpp
示例13: pages
truth 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,代码来源:iconf.cpp
示例14: AltListItemWidthChangeInterface
truth 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,代码来源:iconf.cpp
示例15: NormalNumberChangeInterface
truth 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,代码来源:config.cpp
示例16: ForceVomit
truth 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,代码来源:command.cpp
示例17: ADD_MESSAGE
void 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,代码来源:gods.cpp
示例18: interval
truth 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,代码来源:iconf.cpp
示例19: interval
truth 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,代码来源:iconf.cpp
示例20: value
truth 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,代码来源:iconf.cpp
注:本文中的CONST_S函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论