9 private bool m_bIsOnFire =
false;
13 private float m_Lifetime = 10.0;
14 private bool m_bIsDead =
false;
33 m_bIsOnFire = !m_bIsOnFire;
34 if (m_bIsOnFire && particle !=
string.Empty)
40 spawnParams.Transform[3] = offset;
79 string GetActionDescription()
83 return "Start dragging this object around.";
87 return "Let go of this object.";
93 string GetFireActionDescription()
97 return "Use lighter to set this object on fire!";
101 return "Attempt to extinguish this object.";
121 bool CanPerformDragAction()
131 bool CanPerformToggleFire()
141 void CancelDragAction()
150 void PerformDragAction(
IEntity user)
184 m_User.GetWorldTransform(userMat);
185 vector userTgtPos = userMat[3] + userMat[2] * 1.3;
187 vector dir = userTgtPos - selfOrigin;
188 dir[1] = Math.Clamp(dir[1], -0.5, 0.5);
189 float distance = vector.Distance(userTgtPos, selfOrigin);
197 float upMag = userMat[3][1] - selfOrigin[1];
198 dir +=
Vector(0, upMag, 0);
199 physics.ApplyImpulse(dir * physics.GetMass());
204 private void OnDeath()
207 string materials[256];
208 int numMats = obj.GetMaterials(materials);
210 for (
int i = 0; i < numMats; i++)
212 remap +=
"$remap '" + materials[i] +
"' '{DD86C0AE16B22569}Assets/Props/Garbage/Data/MI_RubberForTrashBinContainer_01.emat';";
216 ToggleIsOnFire(
string.Empty, vector.Zero);
223 m_Lifetime -= timeSlice;
238 super.OnPostInit(owner);
247 void SCR_InteractableBoxComponent(IEntityComponentSource src,
IEntity ent,
IEntity parent)
SCR_InteractableBoxComponentClass m_bIsDragging
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
string GetFireActionName()
void ParticleEffectEntity(IEntitySource src, IEntity parent)
enum EVehicleType IEntity
proto external int SetEventMask(notnull IEntity owner, int mask)
proto external vector GetOrigin()
proto external Physics GetPhysics()
proto external VObject GetVObject()
Returns visual object set to this Entity. No reference is added.
void EOnFrame(IEntity owner, float timeSlice)
void EOnSimulate(IEntity owner, float timeSlice)
EntityEvent
Various entity events.
proto native vector Vector(float x, float y, float z)