3 static private const float SOUND_CONTACT_SKIP = 0.33;
11 private bool m_IsMeleeWeapon =
false;
35 InitImpactSoundData();
37 if (ConfigIsExisting(
"isMeleeWeapon"))
38 m_IsMeleeWeapon = ConfigGetBool(
"isMeleeWeapon");
56 if (!DescriptionOverride(temp))
57 temp = ConfigGetString(
"descriptionShort");
83 return m_IsMeleeWeapon;
94 if (!m_SoundImpactTable)
98 if (soundBuilder != null)
105 if (soundObject != null)
107 soundObject.SetKind(
WaveKind.WAVEEFFECTEX);
117 string soundImpactType =
"default";
118 if ( ConfigIsExisting(
"soundImpactType") )
119 soundImpactType = ConfigGetString(
"soundImpactType");
140 AnimSoundEvent soundEvent = GetInventoryItemType().GetSoundEvent(
id);
156 return GetImpactSurfaceTypeEx(other, impact, liquid);
163 GetWorldBounds(mins, maxs);
164 vector size = maxs - mins;
167 string surfaceImpact;
174 return surfaceImpact;
178 return surfaceImpact;
191 return ProcessImpactSoundEx(other, extra, weight, surfaceHash,liquidType);
199 if ( impactVelocity < 0.3 )
203 if ( m_SoundContactTickTime + SOUND_CONTACT_SKIP > tickTime )
206 string surfaceName = GetImpactSurfaceTypeEx(other, extra, liquidType);
207 if ( surfaceName ==
"" )
211 string infoText =
"Surface: " + surfaceName +
", Weight: " + weight +
", Speed: " + impactVelocity;
213 if ( s_ImpactSoundsInfo.Count() == 10 )
214 s_ImpactSoundsInfo.Remove(9);
216 s_ImpactSoundsInfo.InsertAt(infoText, 0);
219 m_SoundContactTickTime = tickTime;
221 surfaceHash = surfaceName.
Hash();
222 return impactVelocity;
226 static void DrawImpacts()
230 for (
int i = 0; i < s_ImpactSoundsInfo.Count(); ++i )
232 string line = (i + 1).
ToString() +
". " + s_ImpactSoundsInfo.
Get(i);
class AnimSoundObjectBuilderBank AnimSoundLookupTableBank()
class SoundObjectBuilder SoundObject(SoundParams soundParams)
class JsonUndergroundAreaTriggerData GetPosition
proto void SetPosition(vector position)
static AnimSoundObjectBuilderBank GetInstance()
proto void SurfaceUnderObjectEx(notnull Object object, out string type, out string impact, out int liquidType)
proto native AbstractSoundScene GetSoundScene()
proto native float GetTickTime()
Returns current time from start of the game.
static proto bool GetHitSurface(Object other, vector begPos, vector endPos, string surface)
private float m_SoundContactTickTime
protected void InitImpactSoundData()
private SoundLookupTable m_SoundImpactTable
AbstractWave PlaySound(SoundObject so, SoundObjectBuilder sob)
proto native bool HasCollisionsWithCharacter()
override bool IsMeleeWeapon()
float ProcessImpactSoundEx(IEntity other, Contact extra, float weight, out int surfaceHash, out int liquidType)
proto native void EnableCollisionsWithCharacter(bool state)
collisions with character
proto native void ForceFarBubble(bool state)
Sets the item to use the server configured 'networkRangeFar' instead of 'networkRangeNear'.
proto native void ThrowPhysically(DayZPlayer player, vector force, bool collideWithCharacters=true)
event bool OnUseFromInventory(Man owner)
override bool IsInventoryItem()
string GetImpactSurfaceTypeEx(IEntity other, Contact impact, out int liquid)
void PlayImpactSound(float weight, float velocity, int surfaceHash)
string GetImpactSurfaceType(IEntity other, Contact impact)
float ProcessImpactSound(IEntity other, Contact extra, float weight, out int surfaceHash)
string GetTooltip()
Get tooltip text.
proto native bool IsOn()
Some inventoryItem devices can be switched on/off (radios, transmitters)
void PlaySoundByAnimEvent(EAnimSoundEventID id)
proto native MeleeCombatData GetMeleeCombatData()
string GetRuinedMeleeAmmoType()
returns ammo (projectile) used in melee if the item is destroyed. Override higher for specific use
proto native InventoryItemType GetInventoryItemType()
proto native void SwitchOn(bool onOff)
Some inventoryItem devices can be switched on/off (radios, transmitters)
SoundObjectBuilder GetSoundBuilder(int parameterHash)
proto native void SetVariable(string name, float value)
proto native void UpdateEnvSoundControllers(vector position)
SoundObject BuildSoundObject()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto vector Normalized()
return normalized vector (keeps orginal vector untouched)
proto native float Length()
Returns length of vector (magnitude)
proto native CGame GetGame()
vector RelativeVelocityBefore
static proto native void Begin(string windowTitle, float x=0, float y=0)
static proto native void Text(string label)
static proto native void End()
string Get(int index)
Gets n-th character from string.
proto native int Hash()
Returns hash of string.