12 {
13 if (!super.CanPutAsAttachment(parent))
14 return false;
15
16 const int SLOTS_ARRAY = 8;
17 bool isBarrel;
18 bool isBarrelOpened;
19 bool slotsEmptyTest = true;
20 string slotNames[SLOTS_ARRAY] = {"BerryR", "BerryB", "Plant", "Nails", "OakBark", "BirchBark", "Lime", "Guts"};
21
22 if (parent.IsKindOf("Barrel_ColorBase"))
23 isBarrel = true;
24
25 if (isBarrel && parent.GetAnimationPhase("Lid") == 1)
26 isBarrelOpened = true;
27
28 for (int i = 0; i < SLOTS_ARRAY ; ++i)
29 {
30 if (parent.FindAttachmentBySlotName(slotNames[i]) != null)
31 {
32 slotsEmptyTest = false;
33 break;
34 }
35 }
36
37 if ((isBarrelOpened && slotsEmptyTest) || !isBarrel)
38 return true;
39
40 return false;
41 }