-
Notifications
You must be signed in to change notification settings - Fork 1
/
LegendaryDogsPetTitlePart.cs
44 lines (38 loc) · 1.2 KB
/
LegendaryDogsPetTitlePart.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using XRL.UI;
namespace XRL.World.Parts
{
[Serializable]
public class LegendaryDogsPetTitlePart : IPart
{
public string Descriptor;
public LegendaryDogsPetTitlePart() : this("soft")
{
}
public LegendaryDogsPetTitlePart(string Descriptor)
{
this.Descriptor = Descriptor;
}
public override bool SameAs(IPart p)
{
return false;
}
public override void Register(GameObject Object)
{
Object.RegisterPartEvent(this, "ObjectPetted");
}
public override bool FireEvent(Event E)
{
if (E.ID == "ObjectPetted")
{
GameObject Petter = E.GetParameter<GameObject>("Petter");
GameObject Petted = E.GetParameter<GameObject>("Object");
if (Petter.IsPlayer() && Petted.SameAs(ParentObject))
{
Popup.Show("You can't help but stop and notice how " + this.Descriptor + " " + ParentObject.the + ParentObject.DisplayNameOnlyDirect + "&y" + "'s fur is. It's incredible!");
}
}
return base.FireEvent(E);
}
}
}