13 return base.GetParam(1,
null);
19 public override bool IsTool
28 public bool IsValidTarget(
Thing t)
39 if (!(
id ==
"storage") && !(
id ==
"fridge"))
47 public bool Upgrade(
Thing t)
52 if (!(
id ==
"storage"))
54 if (!(
id ==
"fridge"))
56 if (
id ==
"extend_v" ||
id ==
"extend_h")
58 bool flag = this.ID ==
"extend_v";
60 if (t.things.GridSize == 0)
66 if (t.things.height != traitContainer.Height)
70 t.things.SetSize(t.things.width, t.things.height + 1);
74 if (t.things.width != traitContainer.Width)
78 t.things.SetSize(t.things.width + 1, t.things.height);
84 if (t.c_containerUpgrade.cool != 0)
88 t.c_containerUpgrade.cool = 1;
89 t.elements.SetBase(405, 50, 0);
94 t.c_containerUpgrade.cap += 20;
99 int c_containerSize = t.c_containerSize;
100 t.c_containerSize = c_containerSize + 1;
102 if (
EClass.Branch !=
null)
104 EClass.Branch.resources.SetDirty();
110 public override void TrySetHeldAct(
ActPlan p)
112 p.pos.Things.ForEach(delegate(
Thing t)
114 if (!this.IsValidTarget(t))
118 p.TrySetAct(
"actWrench".lang(t.Name,
null,
null,
null,
null), delegate()
122 Msg.Say(
"upgrade", t, this.owner.GetName(NameStyle.Full, 1),
null,
null);
123 SE.Play(
"build_area");
124 t.PlayEffect(
"buff",
true, 0f,
default(Vector3));
125 this.owner.ModNum(-1,
true);
126 EClass._zone.RefreshElectricity();
130 Msg.Say(
"noMoreUpgrade", t, this.owner.GetName(NameStyle.Full, 1),
null,
null);