cosmetix
[k8-i-v-a-n.git] / src / game / gods / god_valpurus.cpp
blob9c76ab338425a4d2273125e4ab0f8013aa6efb9a
1 #ifdef HEADER_PHASE
2 GOD(valpurus, god)
4 public:
5 virtual cchar *GetName () const;
6 virtual cchar *GetDescription () const;
7 virtual int GetAlignment () const;
8 virtual void Pray ();
9 virtual int GetBasicAlignment () const;
10 virtual col16 GetColor () const;
11 virtual col16 GetEliteColor () const;
12 virtual int GetSex () const { return MALE; }
14 protected:
15 virtual void PrayGoodEffect ();
16 virtual void PrayBadEffect ();
20 #else
23 cchar *valpurus::GetName () const { return "Valpurus"; }
24 cchar *valpurus::GetDescription () const { return "King of Gods"; }
25 int valpurus::GetAlignment () const { return ALPP; }
26 int valpurus::GetBasicAlignment () const { return GOOD; }
27 col16 valpurus::GetColor () const { return LAWFUL_BASIC_COLOR; }
28 col16 valpurus::GetEliteColor () const { return LAWFUL_ELITE_COLOR; }
31 void valpurus::PrayGoodEffect () {
32 if (RAND()&1) {
33 shield *Shield = shield::Spawn();
35 Shield->InitMaterials(MAKE_MATERIAL(VALPURIUM));
36 PLAYER->GetGiftStack()->AddItem(Shield);
37 ADD_MESSAGE("You hear booming voice: \"THIS WILL PROTECT THEE FROM MORTIFER, MY PALADIN!\" A shield glittering with holy might appears from nothing.");
38 } else {
39 meleeweapon *Weapon = meleeweapon::Spawn(TWO_HANDED_SWORD);
41 Weapon->InitMaterials(MAKE_MATERIAL(VALPURIUM), MAKE_MATERIAL(VALPURIUM), true);
42 PLAYER->GetGiftStack()->AddItem(Weapon);
43 ADD_MESSAGE("You hear booming voice: \"DEFEAT MORTIFER WITH THIS, MY PALADIN!\" A sword glittering with holy might appears from nothing.");
48 void valpurus::PrayBadEffect () {
49 ADD_MESSAGE("Valpurus smites you with a small hammer.");
50 PLAYER->ReceiveDamage(0, 10, PHYSICAL_DAMAGE, HEAD, RAND() & 7);
51 PLAYER->CheckDeath(CONST_S("faced the hammer of Justice from the hand of ") + GetName(), 0);
55 void valpurus::Pray () {
56 if (!Timer && Relation == 1000) {
57 ADD_MESSAGE("You feel %s is very pleased.", GetName());
58 PrayGoodEffect();
59 AdjustTimer(100000);
60 AdjustRelation(-500);
61 game::ApplyDivineAlignmentBonuses(this, 100, true);
62 PLAYER->EditExperience(WISDOM, 400, 1 << 11);
63 if (Relation > 250 && !(RAND()%2)) {
64 character *Angel = CreateAngel(PLAYER->GetTeam());
66 if (Angel) ADD_MESSAGE("%s seems to be very friendly towards you.", Angel->CHAR_DESCRIPTION(DEFINITE));
68 } else if (Relation < 0 || (!TryToAttachBodyPart(PLAYER) && !TryToHardenBodyPart(PLAYER))) {
69 ADD_MESSAGE("You feel you are not yet worthy enough for %s.", GetName());
70 PrayBadEffect();
71 AdjustTimer(50000);
72 AdjustRelation(-100);
73 game::ApplyDivineAlignmentBonuses(this, 20, false);
74 PLAYER->EditExperience(WISDOM, -50, 1 << 10);
75 if (Relation < -250 && !(RAND()%3)) {
76 character *Angel = CreateAngel(game::GetTeam(VALPURUS_ANGEL_TEAM), 10000);
78 if (Angel) ADD_MESSAGE("%s seems to be hostile.", Angel->CHAR_DESCRIPTION(DEFINITE));
84 #endif