7 class SCR_ConsumableItemComponent : SCR_GadgetComponent
10 protected ref SCR_ConsumableEffectBase m_ConsumableEffect;
12 [
Attribute(
"0", UIWidgets.CheckBox,
"Switch model on use, f.e. from packaged version",
category:
"Consumable")]
15 [
Attribute(
"0", UIWidgets.CheckBox,
"Show the model of the item on the character after using",
category:
"Consumable")]
33 if (!m_ConsumableEffect)
36 m_ConsumableEffect.ApplyEffect(target, target, item, animParams);
41 RplComponent.DeleteRplEntity(
GetOwner(),
false);
65 if (animParams.GetCommandIntArg() == -1)
67 Print(
"Consumable item OnItemUseComplete event called with empty SCR_ConsumableEffectAnimationParameters", LogLevel.ERROR);
77 bool deleteItem =
true;
101 ChimeraCharacter targetChar;
103 targetChar = ChimeraCharacter.Cast(target);
110 if (!targetDamageMan)
113 targetDamageMan.SetGroupIsBeingHealed(targetDamageMan.FindAssociatedHitZoneGroup(group), healed);
122 if (!inventoryItemComp)
126 if (!attributeCollection)
130 if (!additionalModels)
133 ResourceName consumableModel;
135 consumableModel = additionalModels.GetAlternativeModel();
137 consumableModel =
SCR_Global.GetPrefabAttributeResource(
GetOwner(),
"MeshObject",
"Object");
139 Resource resource = Resource.Load(consumableModel);
143 BaseResourceObject baseResource = resource.GetResource();
146 VObject asset = baseResource.ToVObject();
162 override void ModeSwitch(EGadgetMode mode, IEntity charOwner)
164 super.ModeSwitch(mode, charOwner);
166 if (mode == EGadgetMode.IN_HAND)
177 if (mode == EGadgetMode.IN_HAND)
184 super.ModeClear(mode);
218 if (m_ConsumableEffect)
219 return m_ConsumableEffect.m_eConsumableType;
229 return m_ConsumableEffect;
235 return EGadgetType.CONSUMABLE;