6 super.InitItemVariables();
12 if(!super.CanPutAsAttachment(parent)) {
return false;}
13 const int SLOTS_ARRAY = 8;
14 bool is_barrel =
false;
15 bool is_opened_barrel =
false;
16 bool slot_test =
true;
17 string slot_names[SLOTS_ARRAY] = {
"BerryR",
"BerryB",
"Plant",
"Nails",
"OakBark",
"BirchBark",
"Lime",
"Guts" };
21 if ( parent.IsKindOf(
"Barrel_ColorBase") )
27 if ( is_barrel && parent.GetAnimationPhase(
"Lid") == 1 )
29 is_opened_barrel =
true;
33 for (
int i = 0; i < SLOTS_ARRAY ; i++ )
35 if ( parent.FindAttachmentBySlotName(slot_names[i]) != NULL )
42 if ( ( is_opened_barrel && slot_test ) || !is_barrel )
49 override bool CanDetachAttachment(
EntityAI parent )
52 bool is_barrel =
false;
53 bool is_opened_barrel =
false;
56 if ( parent.IsKindOf(
"Barrel_ColorBase") )
62 if ( is_barrel && parent.GetAnimationPhase(
"Lid") == 1 )
64 is_opened_barrel =
true;
67 if ( is_opened_barrel || !is_barrel )