本文整理匯總了C++中ADD_MESSAGE函數的典型用法代碼示例。如果您正苦於以下問題:C++ ADD_MESSAGE函數的具體用法?C++ ADD_MESSAGE怎麽用?C++ ADD_MESSAGE使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ADD_MESSAGE函數的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: ADD_MESSAGE
void valpurus::PrayGoodEffect()
{
if(!game::PlayerIsGodChampion())
{
ADD_MESSAGE("You hear a booming voice: \"I RECOGNIZETH THEE AS MINE OWN CHAMPION! "
"JOURNEY FORTH WITH THESE ARMAMENTS TO DEFEAT MORTIFER AND ALL "
"THE CHAOS HE HADST SOWN!\" A set of holy arms appear from nothing.");
meleeweapon* Weapon = meleeweapon::Spawn(TWO_HANDED_SWORD);
Weapon->InitMaterials(MAKE_MATERIAL(VALPURIUM), MAKE_MATERIAL(VALPURIUM), true);
PLAYER->GetGiftStack()->AddItem(Weapon);
shield* Shield = shield::Spawn();
Shield->InitMaterials(MAKE_MATERIAL(VALPURIUM));
PLAYER->GetGiftStack()->AddItem(Shield);
game::MakePlayerGodChampion();
}
else // Player already received championship gift, give holy handgrenade instead.
{
ADD_MESSAGE("You hear a booming voice: \"I GRANT THEE THIS HOLY HAND GRENADE "
"THAT WITH IT THOU MAYEST BLOW THY ENEMIES TO TINY BITS, MY PALADIN!\"");
PLAYER->GetGiftStack()->AddItem(holyhandgrenade::Spawn());
}
}
示例2: ADD_MESSAGE
void infuscor::PrayBadEffect()
{
truth Success = false;
if(GetRelation() < -200)
{
uint c;
for(c = 1; c < uint(PLAYER->GetBodyParts()); ++c) // annoying :(
{
bodypart* BodyPart = PLAYER->GetBodyPart(c);
if(BodyPart && BodyPart->IsDestroyable(PLAYER))
if(BodyPart->GetMainMaterial())
if(BodyPart->CanBeBurned()
&& (BodyPart->GetMainMaterial()->GetInteractionFlags() & CAN_BURN)
&& !BodyPart->IsBurning())
{
if(BodyPart->TestActivationEnergy(50))
{
Success = true;
}
}
}
if(Success)
ADD_MESSAGE("\"I'm going to enjoy watching you burn, insolent mortal!\"");
}
ADD_MESSAGE("Vile and evil knowledge pumps into your brain. It's too much for you to handle; you faint.");
PLAYER->LoseConsciousness(1000 + RAND_N(1000));
}
示例3: ADD_MESSAGE
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;
}
示例4: GetRemoveTrapModifier
truth web::TryToTearDown(character* Actor,int Modifier)
{
if(Modifier==-1)
Modifier = GetRemoveTrapModifier(Actor);
if(!RAND_N(Max(Modifier << 1, 2)))
{
//if(GetLSquareUnder()->GetPos()==Actor->GetPos())C->RemoveTrap(GetTrapID());else
if(GetLSquareUnder()->GetCharacter())
GetLSquareUnder()->GetCharacter()->RemoveTrap(GetTrapID());
TrapData.VictimID = 0;
GetLSquareUnder()->RemoveTrap(this);
SendToHell();
if(Actor->IsPlayer())
ADD_MESSAGE("You tear the web down.");
else if(Actor->CanBeSeenByPlayer())
ADD_MESSAGE("%s tears the web down.", Actor->CHAR_NAME(DEFINITE));
Actor->EditAP(-500);
return true;
}
return false;
}
示例5: GetActor
void consume::Terminate(bool Finished)
{
if(Flags & TERMINATING)
return;
Flags |= TERMINATING;
item* Consuming = game::SearchItem(ConsumingID);
character* Actor = GetActor();
if(Actor->IsPlayer())
ADD_MESSAGE("You %s %s.", Finished ? "finish" : "stop", Description.CStr());
else if(Actor->CanBeSeenByPlayer())
ADD_MESSAGE("%s %s %s.", Actor->CHAR_NAME(DEFINITE), Finished ? "finishes" : "stops", Description.CStr());
if(Finished)
{
if(Consuming->Exists() && !game::IsInWilderness() && (!Actor->IsPlayer() || ivanconfig::GetAutoDropLeftOvers()))
{
Consuming->RemoveFromSlot();
Actor->GetStackUnder()->AddItem(Consuming);
Actor->DexterityAction(2);
}
}
else if(Consuming && Consuming->Exists())
{
material* ConsumeMaterial = Consuming->GetConsumeMaterial(Actor);
if(ConsumeMaterial)
ConsumeMaterial->FinishConsuming(Actor);
}
action::Terminate(Finished);
}
示例6: 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);
}
}
示例7: ADD_MESSAGE
truth olterrain::Enter(truth DirectionUp) const
{
if(DirectionUp)
ADD_MESSAGE("You can't go up.");
else
ADD_MESSAGE("You can't go down.");
return false;
}
示例8: ADD_MESSAGE
void unconsciousness::Terminate(bool Finished)
{
if(Flags & TERMINATING)
return;
Flags |= TERMINATING;
if(GetActor()->IsPlayer())
ADD_MESSAGE("You wake up.");
else if(GetActor()->CanBeSeenByPlayer())
ADD_MESSAGE("%s wakes up.", GetActor()->CHAR_NAME(DEFINITE));
action::Terminate(Finished);
}
示例9: GetMaster
truth shop::PickupItem(character* Customer, item* ForSale, int Amount)
{
if(!MasterIsActive() || Customer == GetMaster()
|| GetMaster()->GetRelation(Customer) == HOSTILE)
return true;
if(ForSale->IsLanternOnWall())
{
ADD_MESSAGE("\"I'd appreciate it if you left my "
"light sources alone, thank you!\"");
return false;
}
long Price = ForSale->GetTruePrice();
if(Price)
{
Price = Amount * (Price * 100
/ (100 + Customer->GetAttribute(CHARISMA)) + 1);
if(GetMaster()->GetConfig() == NEW_ATTNAM)
{
if(ForSale->IsBanana())
Price = (Price >> 2) + 1;
else if(ForSale->IsEatable(GetMaster()))
Price <<= 2;
else
Price = 0;
}
}
示例10: x_ipc_msgCreate
MSG_PTR x_ipc_msgCreate(MSG_DATA_PTR msgData)
{
MSG_PTR msg;
msg = NEW(MSG_TYPE);
msg->direct = FALSE;
msg->parsedFormats = FALSE;
msg->msgData = msgData;
msg->hndList = x_ipc_listCreate();
msg->tapList = NULL;
msg->excepList = NULL;
msg->directList = NULL;
#ifdef NMP_IPC
msg->priority = DEFAULT_PRIORITY;
msg->limit = MAX_INT;
msg->notifyHandlerChange = FALSE;
#endif
/* 11-Jun-91: fedor: Blah! storing the parse string should
not be done here - but didnt want to mess with msgData for now ! */
msg->msgFormatStr = NULL;
msg->resFormatStr = NULL;
LOCK_CM_MUTEX;
ADD_MESSAGE(msgData->name, msg);
UNLOCK_CM_MUTEX;
return msg;
}
示例11: Terminate
void study::Handle()
{
item* Literature = game::SearchItem(LiteratureID);
if(!Literature || !Literature->Exists() || !Actor->IsOver(Literature))
{
Terminate(false);
return;
}
if(GetActor()->GetLSquareUnder()->IsDark() && !game::GetSeeWholeMapCheatMode())
{
ADD_MESSAGE("It is too dark to read now.");
Terminate(false);
return;
}
if(game::CompareLightToInt(GetActor()->GetLSquareUnder()->GetLuminance(), 115) < 0)
GetActor()->EditExperience(PERCEPTION, -50, 1 << 1);
if(!Counter)
{
Terminate(true);
return;
}
if(GetActor()->GetAttribute(INTELLIGENCE) >= Counter)
Counter = 0;
else
Counter -= GetActor()->GetAttribute(INTELLIGENCE);
}
示例12: GetRelation
void atavus::PrayGoodEffect()
{
item* Enchantable;
item* PairEnchantable;
int LowEnchant = 99;
truth Pair = false;
for(int c = 0; c < PLAYER->GetEquipments(); ++c)
{
item* Equipment = PLAYER->GetEquipment(c);
if(Equipment && Equipment->CanBeEnchanted() && !Equipment->IsWeapon(PLAYER)
&& (Equipment->GetEnchantment() < LowEnchant))
{
Enchantable = Equipment;
LowEnchant = Enchantable->GetEnchantment();
Pair = false;
continue;
}
if(Enchantable && Equipment && Equipment->HandleInPairs()
&& Equipment->CanBePiledWith(Enchantable, PLAYER))
{
Pair = true;
PairEnchantable = Equipment;
}
}
if(LowEnchant < 99)
{
int EnchDiff = ((Enchantable->GetEnchantment()+2)*250 - GetRelation()) / 50;
if(EnchDiff <= 1 || !RAND_N(EnchDiff)) {
if(Pair)
{
ADD_MESSAGE("Your %s glow briefly blue. They feel very warm now.", Enchantable->CHAR_NAME(PLURAL));
Enchantable->EditEnchantment(1);
PairEnchantable->EditEnchantment(1);
}
else
{
ADD_MESSAGE("Your %s glows briefly blue. It feels very warm now.", Enchantable->CHAR_NAME(UNARTICLED));
Enchantable->EditEnchantment(1);
}
return;
}
}
ADD_MESSAGE("You feel that %s is watching your actions closely.", GetName());
}