-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExtendedMod.cs
73 lines (63 loc) · 1.62 KB
/
ExtendedMod.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
using System;
using System.Text;
namespace XRL.World.Parts
{
[Serializable]
public class acegiak_ModExtended : IModification
{
public acegiak_ModExtended()
{
}
public acegiak_ModExtended(int Tier)
: base(Tier)
{
}
public override void Configure()
{
WorksOnSelf = true;
NameForStatus = "ExtendedEnhancement";
}
public override bool ModificationApplicable(GameObject Object)
{
MeleeWeapon part = Object.GetPart<MeleeWeapon>();
if (part == null)
{
return false;
}
acegiak_Reach part2 = Object.GetPart<acegiak_Reach>();
if(part2 != null){
return false;
}
return true;
}
public override void ApplyModification(GameObject Object)
{
Object.AddPart<XRL.World.Parts.acegiak_Reach>();
Object.GetPart<XRL.World.Parts.Render>().Tile = "items/polearm.png";
IncreaseDifficultyAndComplexityIfComplex(1, 1);
}
public override bool AllowStaticRegistration()
{
return true;
}
public override void Register(GameObject Object)
{
Object.RegisterPartEvent(this, "GetDisplayName");
Object.RegisterPartEvent(this, "GetShortDisplayName");
Object.RegisterPartEvent(this, "GetShortDescription");
base.Register(Object);
}
public override bool FireEvent(Event E)
{
if (E.ID == "GetShortDescription")
{
E.SetParameter("Postfix", E.GetParameter("Postfix") + "\n&CExtended: Can be used as a polearm.");
}
if ((E.ID == "GetDisplayName" || E.ID == "GetShortDisplayName") && (!ParentObject.Understood() || !ParentObject.HasProperName))
{
E.GetParameter<StringBuilder>("Prefix").Append("extended ");
}
return base.FireEvent(E);
}
}
}