5 virtual cchar
*GetName () const;
6 virtual cchar
*GetDescription () const;
7 virtual int GetAlignment () const;
8 virtual int GetBasicAlignment () const;
9 virtual col16
GetColor () const;
10 virtual col16
GetEliteColor () const;
11 virtual int GetSex () const { return FEMALE
; }
14 virtual void PrayGoodEffect ();
15 virtual void PrayBadEffect ();
22 cchar
*silva::GetName () const { return "Silva"; }
23 cchar
*silva::GetDescription () const { return "goddess of nature"; }
24 int silva::GetAlignment () const { return ANP
; }
25 int silva::GetBasicAlignment () const { return NEUTRAL
; }
26 col16
silva::GetColor () const { return NEUTRAL_BASIC_COLOR
; }
27 col16
silva::GetEliteColor () const { return NEUTRAL_ELITE_COLOR
; }
30 void silva::PrayGoodEffect () {
31 if (PLAYER
->GetNP() < HUNGER_LEVEL
) {
32 ADD_MESSAGE("Your stomach feels full again.");
33 PLAYER
->SetNP(SATIATED_LEVEL
);
36 if (!game::GetCurrentLevel()->IsOnGround()) {
37 ADD_MESSAGE("Suddenly a horrible earthquake shakes the level.");
39 int Tunnels
= 2+RAND()%3;
40 int ToEmpty
= 10+RAND()%11;
41 int ToGround
= 20+RAND()%21;
42 int BoulderNumber
= 10+RAND()%10;
44 for (int c
= 0; c
< Tunnels
; ++c
) {
45 game::GetCurrentLevel()->AttachPos(game::GetCurrentLevel()->GetRandomSquare(0, NOT_WALKABLE
|ATTACHABLE
));
48 for (int c
= 0; c
< ToEmpty
; ++c
) {
49 for (int i
= 0; i
< 50; ++i
) {
50 v2 Pos
= game::GetCurrentLevel()->GetRandomSquare(0, NOT_WALKABLE
);
51 truth Correct
= false;
53 for (int d
= 0; d
< 8; ++d
) {
54 lsquare
*Square
= game::GetCurrentLevel()->GetLSquare(Pos
)->GetNeighbourLSquare(d
);
56 if (Square
&& Square
->IsFlyable()) { Correct
= true; break; }
60 game::GetCurrentLevel()->GetLSquare(Pos
)->ChangeOLTerrainAndUpdateLights(0);
66 for (int c
= 0; c
< ToGround
; ++c
) {
67 for (int i
= 0; i
< 50; ++i
) {
69 v2 Pos
= game::GetCurrentLevel()->GetRandomSquare(0, RAND() & 1 ? 0 : HAS_CHARACTER
);
71 if (Pos
== ERROR_V2
) continue;
73 lsquare
*Square
= game::GetCurrentLevel()->GetLSquare(Pos
);
74 character
*Char
= Square
->GetCharacter();
76 if (Square
->GetOLTerrain() || (Char
&& (Char
->IsPlayer() || PLAYER
->GetRelation(Char
) != HOSTILE
))) continue;
78 for (int d
= 0; d
< 8; ++d
) {
79 lsquare
*NearSquare
= game::GetCurrentLevel()->GetLSquare(Pos
)->GetNeighbourLSquare(d
);
81 if (NearSquare
&& NearSquare
->IsFlyable()) ++Walkables
;
85 Square
->ChangeOLTerrainAndUpdateLights(earth::Spawn());
87 if (Char
->CanBeSeenByPlayer()) {
88 ADD_MESSAGE("%s is hit by a brick of earth falling from the roof!", Char
->CHAR_NAME(DEFINITE
));
90 Char
->ReceiveDamage(0, 20 + RAND() % 21, PHYSICAL_DAMAGE
, HEAD
|TORSO
, 8, true);
91 Char
->CheckDeath(CONST_S("killed by an earthquake"), 0);
93 Square
->KickAnyoneStandingHereAway();
94 Square
->GetStack()->ReceiveDamage(0, 10 + RAND() % 41, PHYSICAL_DAMAGE
);
99 // Generate a few boulders in the level
100 for (int c
= 0; c
< BoulderNumber
; ++c
) {
101 v2 Pos
= game::GetCurrentLevel()->GetRandomSquare();
102 lsquare
*Square
= game::GetCurrentLevel()->GetLSquare(Pos
);
103 character
*MonsterHere
= Square
->GetCharacter();
105 if (!Square
->GetOLTerrain() && (!MonsterHere
|| MonsterHere
->GetRelation(PLAYER
) == HOSTILE
)) {
106 Square
->ChangeOLTerrainAndUpdateLights(boulder::Spawn(1+(RAND()&1)));
107 if (MonsterHere
) MonsterHere
->ReceiveDamage(0, 10+RAND()%10, PHYSICAL_DAMAGE
, HEAD
|TORSO
, 8, true);
108 Square
->GetStack()->ReceiveDamage(0, 10+RAND()%10, PHYSICAL_DAMAGE
);
111 // Damage to items in the level
112 for (int x
= 0; x
< game::GetCurrentLevel()->GetXSize(); ++x
) {
113 for (int y
= 0; y
< game::GetCurrentLevel()->GetYSize(); ++y
) {
114 game::GetCurrentLevel()->GetLSquare(x
, y
)->ReceiveEarthQuakeDamage();
118 int TryToCreate
= 1+RAND()%7;
122 for (; Created
< TryToCreate
; ++Created
) {
123 wolf
*Wolf
= wolf::Spawn();
124 v2 Pos
= game::GetCurrentLevel()->GetNearestFreeSquare(Wolf
, PLAYER
->GetPos());
126 if (Pos
== ERROR_V2
) { delete Wolf
; break; }
127 Wolf
->SetTeam(PLAYER
->GetTeam());
131 if (!Created
&& PLAYER
->CanHear()) ADD_MESSAGE("You hear a sad howling of a wolf imprisoned in the earth.");
132 if (Created
== 1) ADD_MESSAGE("Suddenly a tame wolf materializes beside you.");
133 if (Created
> 1) ADD_MESSAGE("Suddenly some tame wolves materialize around you.");
138 void silva::PrayBadEffect () {
140 case 0: PLAYER
->Polymorph(largerat::Spawn(), 1000+RAND()%1000); break;
141 case 1: PLAYER
->Polymorph(ass::Spawn(), 1000+RAND()%1000); break;
142 case 2: PLAYER
->Polymorph(jackal::Spawn(), 1000+RAND()%1000); break;