5 if(!super.CanPutAsAttachment(parent)) {
return false;}
6 const int SLOTS_ARRAY = 8;
7 bool is_barrel =
false;
8 bool is_opened_barrel =
false;
10 string slot_names[SLOTS_ARRAY] = {
"BerryR",
"BerryB",
"Plant",
"Nails",
"OakBark",
"Lime",
"Disinfectant",
"Guts" };
14 if ( parent.IsKindOf(
"Barrel_ColorBase") )
20 if ( is_barrel && parent.GetAnimationPhase(
"Lid") == 1 )
22 is_opened_barrel =
true;
26 for (
int i = 0; i < SLOTS_ARRAY ; i++ )
28 if ( parent.FindAttachmentBySlotName(slot_names[i]) != NULL )
35 if ( ( is_opened_barrel && slot_test ) || !is_barrel )
42 override bool CanDetachAttachment(
EntityAI parent )
45 bool is_barrel =
false;
46 bool is_opened_barrel =
false;
49 if ( parent.IsKindOf(
"Barrel_ColorBase") )
55 if ( is_barrel && parent.GetAnimationPhase(
"Lid") == 1 )
57 is_opened_barrel =
true;
60 if ( is_opened_barrel || !is_barrel )