1// Solicitus' banana prayer.
2void solicitus::PrayBadEffect()
3{
4  if(PLAYER->HasAllBodyParts()) //Checks if Player has all his limbs! Important because this effect crashes if you try it with missing limbs.
5  {
6    ADD_MESSAGE("A voice speaks. \"BANANAAAAAAAAAAAAAAA.\"");
7    PLAYER->ChangeMainMaterial(MAKE_MATERIAL(BANANA_FLESH)); //Change whole body to banana flesh.
8    ADD_MESSAGE("You feel like a banana.");
9  }
10  else
11    ADD_MESSAGE("\"No banana for you.\"");
12}
13
14
15
16// Sappho belt
17ITEM(sappho, chastitybelt)
18{
19 public:
20  virtual truth TryKey(item*, character*);
21  long GetGearStates() const;
22};
23
24truth sappho::TryKey(item* Key, character* Applier)
25{
26  /* BROKEN_LOCK should not be possible. */
27
28  if(Key->CanOpenLockType(HEART_SHAPED_LOCK))
29  {
30    if(Locked)
31    {
32      if(Applier->IsPlayer())
33        ADD_MESSAGE("You unlock %s.", GetVirtualDescription(DEFINITE).CStr());
34      else if(Applier->CanBeSeenByPlayer())
35        ADD_MESSAGE("%s unlocks %s.", Applier->CHAR_NAME(DEFINITE), GetVirtualDescription(DEFINITE).CStr());
36    }
37    else
38    {
39      if(Applier->IsPlayer())
40        ADD_MESSAGE("You lock %s.", GetVirtualDescription(DEFINITE).CStr());
41      else if(Applier->CanBeSeenByPlayer())
42        ADD_MESSAGE("%s locks %s.", Applier->CHAR_NAME(DEFINITE), GetVirtualDescription(DEFINITE).CStr());
43    }
44
45    // Add a tiny chance that any key you use breaks.
46    if(!RAND_N(Key->GetMainMaterial()->GetStrengthValue()))
47    {
48      Key->Break(Applier);
49    }
50
51    // We're changing GearStates when the belt is locked/unlocked, so re-calculate.
52    if(Applier->Equips(this))
53      Applier->CalculateEquipmentState();
54
55    Locked = !Locked;
56  }
57  else
58  {
59    if(Applier->IsPlayer())
60      ADD_MESSAGE("%s doesn't fit in the lock.", Key->CHAR_NAME(DEFINITE));
61    else if(Applier->CanBeSeenByPlayer())
62      ADD_MESSAGE("%s tries to fit %s in the lock, but fails.",
63                  Applier->CHAR_NAME(DEFINITE), Key->CHAR_NAME(DEFINITE));
64  }
65
66  return true;
67}
68
69long sappho::GetGearStates() const
70{
71  if(IsBroken())
72    return 0;
73  else if(IsLocked())
74    return TELEPORT_LOCK|POLYMORPH_LOCK;
75  else
76    return LEVITATION;
77}
78
79sappho
80{
81  Possibility = 0;
82  Adjective = "seductive";
83  PostFix = "with a heart-shaped lock named Sappho";
84  Alias == "Sappho";
85  ArticleMode = FORCE_THE;
86  CanBeWished = false;
87  IsMaterialChangeable = false;
88  IsPolymorphable = false;
89  IsPolymorphSpawnable = false;
90  CanBeCloned = false;
91  CanBeMirrored = true;
92  CanBePiled = false;
93  CanBeBroken = false;
94  CreateLockConfigurations = false;
95  MainMaterialConfig == CHROME;
96  MaterialConfigChances == 100;
97  Price = 1000;
98}
99