Ejemplo n.º 1
0
Archivo: gods.cpp Proyecto: Attnam/ivan
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());
  }
}
Ejemplo n.º 2
0
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));
}
Ejemplo n.º 3
0
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;
}
Ejemplo n.º 4
0
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;
}
Ejemplo n.º 5
0
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);
}
Ejemplo n.º 6
0
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);
  }
}
Ejemplo n.º 7
0
void cruentus::PrayBadEffect()
{
  item* ToBe = PLAYER->GetMainWielded();

  if(ToBe)
  {
    if(!ToBe->IsDestroyable(0))
    {
      ToBe = PLAYER->GetSecondaryWielded();

      if(!ToBe || !ToBe->IsDestroyable(0))
	ADD_MESSAGE("%s tries to destroy your %s, but fails.", GetName(), PLAYER->GetMainWielded()->CHAR_NAME(UNARTICLED));
    }
  }
  else
  {
    ToBe = PLAYER->GetSecondaryWielded();

    if(ToBe && !ToBe->IsDestroyable(0))
      ADD_MESSAGE("%s tries to destroy your %s, but fails.", GetName(), ToBe->CHAR_NAME(UNARTICLED));
  }

  if(ToBe && ToBe->IsDestroyable(0))
  {
    ADD_MESSAGE("%s destroys your weapon.", GetName());
    ToBe->RemoveFromSlot();
    ToBe->SendToHell();
  }
  else
  {
    ADD_MESSAGE("%s gets mad and hits you!", GetName());
    PLAYER->ReceiveDamage(0, 1 + RAND() % 30, PHYSICAL_DAMAGE, ALL, RAND() & 7);
    PLAYER->CheckDeath(CONST_S("destroyed by ") + GetName(), 0);
  }
}
Ejemplo n.º 8
0
void loricatus::PrayBadEffect()
{
  item* MainWielded = PLAYER->GetMainWielded();

  if(MainWielded)
    if(MainWielded->IsMaterialChangeable())
    {
      festring Desc;
      item* SecondaryWielded;

      if(MainWielded->HandleInPairs() && (SecondaryWielded = PLAYER->GetSecondaryWielded()) && SecondaryWielded->CanBePiledWith(MainWielded, PLAYER))
      {
	MainWielded->AddName(Desc, PLURAL);
	Desc << " vibrate and soften";
	SecondaryWielded->ChangeMainMaterial(MAKE_MATERIAL(BANANA_FLESH));
      }
      else
      {
	MainWielded->AddName(Desc, UNARTICLED);
	Desc << " vibrates and softens";
      }

      MainWielded->ChangeMainMaterial(MAKE_MATERIAL(BANANA_FLESH));
      ADD_MESSAGE("Your %s.", Desc.CStr());
    }
    else
      ADD_MESSAGE("%s emits strange light but remain unchanged.", MainWielded->CHAR_NAME(DEFINITE));
  else
  {
    if(PLAYER->GetUsableArms())
      ADD_MESSAGE("You feel a slight tingling in your hands.");
    else
      ADD_MESSAGE("You feel a slight tingle.");
  }
}
Ejemplo n.º 9
0
truth commandsystem::GoDown(character* Char)
{
  if(!Char->TryToUnStickTraps(ZERO_V2))
    return false;

  /*if(!game::IsInWilderness() && game::WizardModeIsActive() && game::GetCurrentLevelIndex() < game::GetLevels() - 1)
    if(game::TryTravel(game::GetCurrentDungeonIndex(), game::GetCurrentLevelIndex() + 1, RANDOM, true))
    return true;*/

  oterrain* Terrain = Char->GetSquareUnder()->GetOTerrain();

  if(!Terrain)
  {
    if(game::IsInWilderness())
      ADD_MESSAGE("There seems to be nothing of interest here.");
    else
      ADD_MESSAGE("You can't go down.");

    return false;
  }

  if(Terrain->Enter(false))
  {
    Char->EditExperience(AGILITY, 150, 1 << 6);
    Char->EditNP(-10);
    Char->EditAP(-100000 / APBonus(Char->GetAttribute(AGILITY)));
    return true;
  }
  else
    return false;
}
Ejemplo n.º 10
0
void infuscor::PrayGoodEffect()
{
  ADD_MESSAGE("%s helps you.", GetName());

  if(!PLAYER->StateIsActivated(ESP))
  {
    PLAYER->BeginTemporaryState(ESP, 10000 + RAND() % 10000);
    return;
  }

  if(!PLAYER->StateIsActivated(TELEPORT_CONTROL))
  {
    PLAYER->BeginTemporaryState(TELEPORT_CONTROL, 10000 + RAND() % 10000);
    return;
  }

  if(!PLAYER->StateIsActivated(POLYMORPH_CONTROL))
  {
    PLAYER->BeginTemporaryState(POLYMORPH_CONTROL, 10000 + RAND() % 10000);
    return;
  }

  ADD_MESSAGE("Suddenly three scrolls appear almost under your feet.");

  for(int c = 0; c < 3; ++c)
    PLAYER->GetGiftStack()->AddItem(scrollofteleportation::Spawn());
}
Ejemplo n.º 11
0
void nefas::PrayGoodEffect()
{
  rect Rect;
  femath::CalculateEnvironmentRectangle(Rect, game::GetCurrentLevel()->GetBorder(), PLAYER->GetPos(), 10);
  bool AudiencePresent = false;

  for(int x = Rect.X1; x <= Rect.X2; ++x)
  {
    for(int y = Rect.Y1; y <= Rect.Y2; ++y)
    {
      character* Audience = game::GetCurrentLevel()->GetSquare(x, y)->GetCharacter();

      if(Audience && Audience->CanBeSeenByPlayer() && !Audience->TemporaryStateIsActivated(CONFUSED) && Audience->CanBeConfused() && PLAYER->GetRelation(Audience) == HOSTILE)
      {
	AudiencePresent = true;
	break;
      }
    }

    if(AudiencePresent)
      break;
  }

  if(AudiencePresent)
  {
    for(int x = Rect.X1; x <= Rect.X2; ++x)
      for(int y = Rect.Y1; y <= Rect.Y2; ++y)
      {
	character* Audience = game::GetCurrentLevel()->GetSquare(x, y)->GetCharacter();

	if(Audience && !Audience->TemporaryStateIsActivated(CONFUSED) && Audience->CanBeConfused() && PLAYER->GetRelation(Audience) == HOSTILE)
	{
	  if(Audience->CanBeSeenByPlayer())
	    ADD_MESSAGE("%s confuses %s with her sweet lies.", GetName(), Audience->CHAR_NAME(DEFINITE));

	  Audience->BeginTemporaryState(CONFUSED, 500 + RAND() % 500);
	}
      }
  }

  mistress* Mistress = mistress::Spawn(RAND() & 7 ? 0 : TORTURING_CHIEF);
  v2 Where = game::GetCurrentLevel()->GetNearestFreeSquare(Mistress, PLAYER->GetPos());

  if(Where == ERROR_V2)
  {
    if(PLAYER->CanHear())
      ADD_MESSAGE("You hear a strange scream from somewhere beneath.");
    else
      ADD_MESSAGE("You feel the air vibrating.");

    delete Mistress;
  }
  else
  {
    Mistress->SetTeam(PLAYER->GetTeam());
    Mistress->PutTo(Where);
    ADD_MESSAGE("You hear a sweet voice inside your head: \"Have fun, mortal!\"");
  }
}
Ejemplo n.º 12
0
Archivo: gods.cpp Proyecto: Attnam/ivan
void mellis::PrayGoodEffect()
{
  truth Success = false;

  if(!RAND_2)
  {
    itemvector OKItems;

    for(stackiterator i = PLAYER->GetStack()->GetBottom(); i.HasItem(); ++i)
    {
      if(!i->HasBetterVersion())
        continue;

      OKItems.push_back(*i);
      Success = true;
    }

    item* NewVersion;

    for(int c = 0; !OKItems.empty() && c < 4; ++c)
    {
      item* ToBeDeleted = OKItems[RAND() % OKItems.size()];
      NewVersion = ToBeDeleted->BetterVersion();
      ADD_MESSAGE("%s manages to trade %s into %s.", GetName(),
                  ToBeDeleted->CHAR_NAME(DEFINITE), NewVersion->CHAR_NAME(INDEFINITE));
      PLAYER->GetStack()->AddItem(NewVersion);
      ToBeDeleted->RemoveFromSlot();
      ToBeDeleted->SendToHell();
      OKItems.erase(std::find(OKItems.begin(), OKItems.end(), ToBeDeleted));
    }
  }

  if((Success && !(RAND() % 5)) || (!Success && !(RAND() % 3)))
  {
    int Possible[GODS];
    int PossibleSize = 0;

    for(int c = 1; c <= GODS; ++c)
      if(!game::GetGod(c)->IsKnown())
        Possible[PossibleSize++] = c;

    if(PossibleSize)
    {
      int NewKnownGod = Possible[RAND() % PossibleSize];
      game::LearnAbout(game::GetGod(NewKnownGod));
      ADD_MESSAGE("%s shares his knowledge of %s, the %s.", GetName(),
                  game::GetGod(NewKnownGod)->GetName(), game::GetGod(NewKnownGod)->GetDescription());
      return;
    }
  }

  if(!Success)
  {
    PLAYER->SetMoney(PLAYER->GetMoney() + (PLAYER->GetAttribute(WISDOM) * 2));
    ADD_MESSAGE("%s gives you some pocket money.", GetName());
  }
  return;
}
Ejemplo n.º 13
0
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;
}
Ejemplo n.º 14
0
truth commandsystem::Talk(character* Char)
{
  if(!Char->CheckTalk())
    return false;

  character* ToTalk = 0;
  int Characters = 0;

  for(int d = 0; d < 8; ++d)
  {
    lsquare* Square = Char->GetNaturalNeighbourLSquare(d);

    if(Square)
    {
      character* Dude = Square->GetCharacter();

      if(Dude)
      {
        ToTalk = Dude;
        ++Characters;
      }
    }
  }

  if(!Characters)
  {
    ADD_MESSAGE("Find yourself someone to talk to first!");
    return false;
  }
  else if(Characters == 1)
    return ToTalk->ChatMenu();
  else
  {
    int Dir = game::DirectionQuestion(CONST_S("To whom do you wish to talk to? [press a direction key]"), false, true);

    if(Dir == DIR_ERROR || !Char->GetArea()->IsValidPos(Char->GetPos() + game::GetMoveVector(Dir)))
      return false;

    character* Dude = Char->GetNearSquare(Char->GetPos() + game::GetMoveVector(Dir))->GetCharacter();

    if(Dude == Char)
    {
      ADD_MESSAGE("You talk to yourself for some time.");
      Char->EditExperience(WISDOM, -50, 1 << 7);
      Char->EditAP(-1000);
      return true;
    }
    else if(Dude)
      return Dude->ChatMenu();
    else
      ADD_MESSAGE("You get no response.");
  }

  return false;
}
Ejemplo n.º 15
0
void seges::PrayBadEffect()
{
  if(PLAYER->UsesNutrition())
  {
    ADD_MESSAGE("You feel Seges altering the contents of your stomach in an eerie way.");
    PLAYER->EditNP(-10000);
    PLAYER->CheckStarvationDeath(CONST_S("starved by ") + GetName());
  }
  else
    ADD_MESSAGE("Seges tries to alter the contents of your stomach, but fails.");
}
Ejemplo n.º 16
0
truth commandsystem::Drop(character* Char)
{
  if(!Char->GetStack()->GetItems())
  {
    ADD_MESSAGE("You have nothing to drop!");
    return false;
  }

  truth Success = false;
  stack::SetSelected(0);

  for(;;)
  {
    itemvector ToDrop;
    game::DrawEverythingNoBlit();
    Char->GetStack()->DrawContents(ToDrop, Char, CONST_S("What do you want to drop?"), REMEMBER_SELECTED);

    if(ToDrop.empty())
      break;

    if(game::IsInWilderness())
    {
      for(uint c = 0; c < ToDrop.size(); ++c)
      {
        if(game::TruthQuestion(CONST_S("Are you sure? You will never see ") + ToDrop[c]->CHAR_NAME(DEFINITE)
                               + " again! [y/N]"))
        {

          ADD_MESSAGE("You drop %s.", ToDrop[c]->CHAR_NAME(DEFINITE));
          ToDrop[c]->RemoveFromSlot();
          ToDrop[c]->SendToHell();
        }
      }
    }
    else if(!Char->GetRoom() || Char->GetRoom()->DropItem(Char, ToDrop[0], ToDrop.size()))
    {
      ADD_MESSAGE("%s dropped.", ToDrop[0]->GetName(INDEFINITE, ToDrop.size()).CStr());
      for(uint c = 0; c < ToDrop.size(); ++c)
      {
        ToDrop[c]->MoveTo(Char->GetStackUnder());
      }
      Success = true;
    }
  }

  if(Success)
  {
    Char->DexterityAction(2);
    return true;
  }

  return false;
}
Ejemplo n.º 17
0
void atavus::PrayGoodEffect()
{
  if(!Timer && Relation > 500 + RAND_N(500))
  {
    item* Reward = bodyarmor::Spawn(PLATE_MAIL, NO_MATERIALS);
    Reward->InitMaterials(MAKE_MATERIAL(ARCANITE));
    ADD_MESSAGE("%s materializes before you.", Reward->CHAR_NAME(INDEFINITE));
    PLAYER->GetGiftStack()->AddItem(Reward);
    AdjustTimer(45000);
    AdjustRelation(-300);
  }
  else
    ADD_MESSAGE("Nothing happens.");
}
Ejemplo n.º 18
0
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);
}
Ejemplo n.º 19
0
void scabies::PrayGoodEffect()
{
  if(!RAND_N(10))
  {
    for(int c = 0; c < game::GetTeams(); ++c)
      if(PLAYER->GetTeam()->GetRelation(game::GetTeam(c)) == HOSTILE)
	for(std::list<character*>::const_iterator i = game::GetTeam(c)->GetMember().begin(); i != game::GetTeam(c)->GetMember().end(); ++i)
	{
	  character* Char = *i;

	  if((*i)->IsEnabled() && !Char->IsImmuneToLeprosy())
	    Char->GainIntrinsic(LEPROSY);
	}

    ADD_MESSAGE("You feel a a horrible disease spreading.");
    return;
  }

  if(!(RAND() % 50))
  {
    ADD_MESSAGE("Five cans full of school food drop from somewhere above!");

    for(int c = 0; c < 5; ++c)
    {
      can* Reward = can::Spawn(0, NO_MATERIALS);
      Reward->InitMaterials(MAKE_MATERIAL(IRON), MAKE_MATERIAL(SCHOOL_FOOD));
      PLAYER->GetGiftStack()->AddItem(Reward);
    }

    return;
  }

  bool Success = false;

  for(int d = 0; d < PLAYER->GetNeighbourSquares(); ++d)
  {
    lsquare* Square = PLAYER->GetNeighbourLSquare(d);

    if(Square && Square->GetCharacter() && Square->GetCharacter()->GetRelation(PLAYER) == HOSTILE)
    {
      ADD_MESSAGE("%s throws poison on %s!", GetName(), Square->GetCharacter()->CHAR_DESCRIPTION(DEFINITE));
      Square->SpillFluid(PLAYER, liquid::Spawn(POISON_LIQUID, 500));
      Success = true;
    }
  }

  if(!Success)
    PLAYER->PolymorphRandomly(2500, 10000, 1000 + RAND() % 1000);
}
Ejemplo n.º 20
0
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;
}
Ejemplo n.º 21
0
Archivo: rooms.cpp Proyecto: Azba/ivan
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;
    }
  }
Ejemplo n.º 22
0
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;
}
Ejemplo n.º 23
0
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);
}
Ejemplo n.º 24
0
void mortifer::PrayGoodEffect()
{
  ADD_MESSAGE("The air vibrates violently around you. A terrible undead voice echoes "
              "through the caverns: \"SlAvE! ThOu HaSt PlAeSeD mE! lIfT tHy ReWaRd, "
              "ChAmPiOn!\" A heavy weapon of pure corruption materializes before you.");
  PLAYER->GetGiftStack()->AddItem(neercseulb::Spawn());
}
Ejemplo n.º 25
0
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);
}
Ejemplo n.º 26
0
truth commandsystem::Zap(character* Char)
{
  if(!Char->CheckZap())
    return false;

  if(!Char->PossessesItem(&item::IsZappable))
  {
    ADD_MESSAGE("You have nothing to zap with, %s.", game::Insult());
    return false;
  }

  item* Item = Char->SelectFromPossessions(CONST_S("What do you want to zap with?"), &item::IsZappable);

  if(Item)
  {
    int Answer = game::DirectionQuestion(CONST_S("In what direction do you wish to zap?  "
                                                 "[press a direction key or '.']"), false, true);

    if(Answer == DIR_ERROR)
      return false;

    if(Item->Zap(Char, Char->GetPos(), Answer))
    {
      Char->EditAP(-100000 / APBonus(Char->GetAttribute(PERCEPTION)));
      return true;
    }
    else
      return false;
  }
  else
    return false;
}
Ejemplo n.º 27
0
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());
}
Ejemplo n.º 28
0
Archivo: gods.cpp Proyecto: Attnam/ivan
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);
}
Ejemplo n.º 29
0
void valpurus::PrayGoodEffect()
{
  if(RAND() & 1)
  {
    ADD_MESSAGE("You hear booming voice: \"THIS WILL PROTECT THEE FROM MORTIFER, MY PALADIN!\" A shield glittering with holy might appears from nothing.");
    shield* Shield = shield::Spawn();
    Shield->InitMaterials(MAKE_MATERIAL(VALPURIUM));
    PLAYER->GetGiftStack()->AddItem(Shield);
  }
  else
  {
    ADD_MESSAGE("You hear booming voice: \"DEFEAT MORTIFER WITH THIS, MY PALADIN!\" A sword glittering with holy might appears from nothing.");
    meleeweapon* Weapon = meleeweapon::Spawn(TWO_HANDED_SWORD);
    Weapon->InitMaterials(MAKE_MATERIAL(VALPURIUM), MAKE_MATERIAL(VALPURIUM), true);
    PLAYER->GetGiftStack()->AddItem(Weapon);
  }
}
Ejemplo n.º 30
0
void mellis::PrayBadEffect()
{
  for(int c = 1; c <= GODS; ++c)
    if(c != GetType())
      game::GetGod(c)->AdjustRelation(-100);

  ADD_MESSAGE("%s spreads bad rumours about you to other gods.", GetName());
}