• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ADD_MESSAGE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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());
  }
}
开发者ID:Attnam,项目名称:ivan,代码行数:25,代码来源:gods.cpp


示例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));
}
开发者ID:AdrianGin,项目名称:ivan,代码行数:30,代码来源:gods.cpp


示例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;
}
开发者ID:AlexMooney,项目名称:ivan,代码行数:32,代码来源:command.cpp


示例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;
}
开发者ID:Attnam,项目名称:ivan,代码行数:25,代码来源:traps.cpp


示例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);
}
开发者ID:harmonise,项目名称:ivan-f,代码行数:33,代码来源:actions.cpp


示例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);
  }
}
开发者ID:harmonise,项目名称:ivan-f,代码行数:31,代码来源:gods.cpp


示例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;
}
开发者ID:AdrianGin,项目名称:ivan,代码行数:9,代码来源:lterra.cpp


示例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);
}
开发者ID:harmonise,项目名称:ivan-f,代码行数:14,代码来源:actions.cpp


示例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;
    }
  }
开发者ID:Azba,项目名称:ivan,代码行数:30,代码来源:rooms.cpp


示例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;
}
开发者ID:Evanglie,项目名称:libipc,代码行数:28,代码来源:reg.c


示例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);
}
开发者ID:harmonise,项目名称:ivan-f,代码行数:31,代码来源:actions.cpp


示例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());
}
开发者ID:AdrianGin,项目名称:ivan,代码行数:47,代码来源:gods.cpp



注:本文中的ADD_MESSAGE函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ADD_POINTERS函数代码示例发布时间:2022-05-30
下一篇:
C++ ADD_LATENT_AUTOMATION_COMMAND函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap