Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл MiscGameplayFunctions.c

См. исходные тексты.

Структуры данных

class  ReplaceItemWithNewLambda
 adds automatic QuickBar handling Подробнее...
 
class  TurnItemIntoItemLambda
 
class  DropEquipAndDestroyRootLambda
 this one is a bit special: it drops all items and destroys the ex-root of the hierarchy Подробнее...
 
class  DestroyItemInCorpsesHandsAndCreateNewOnGndLambda
 

Перечисления

enum  TransferInventoryResult { Ok , DroppedSome }
 
enum  ThrowEntityFlags
 

Функции

class TurnItemIntoItemLambdaAnimSysNotifyLambda extends TurnItemIntoItemLambda OnSuccess (EntityAI new_item)
 
void DropEquipAndDestroyRootLambda (EntityAI old_item, string new_item_type, PlayerBase player)
 
override void CopyOldPropertiesToNew (notnull EntityAI old_item, EntityAI new_item)
 
void MoveEquipToExistingItemAndDestroyOldRootLambda (EntityAI old_item, string new_item_type, PlayerBase player, EntityAI new_item)
 
void RemoveNetworkObjectInfo ()
 
void UndoRemoveNetworkObjectInfo ()
 
void CreateNetworkObjectInfo (EntityAI new_item)
 
enum ThrowEntityFlags Truncate (float value, int decimals=2)
 truncate float to specified precision
 
static string TruncateToS (float value, int decimals=2)
 truncate float to specified precision, output as string
 
static vector TruncateVec (vector value, int decimals=2)
 truncate float to specified precision
 
static string TruncateVecToS (vector value, int decimals=2, string delimiter=" ")
 
static string GetColorString (float r, float g, float b, float a)
 
static string ValueToBar (float value, string bar="[----------]", string mark="x")
 Produces ACII "progress bar" based on an 0..1 'value' input.
 
static string InsertAtPos (string base, string insert, int pos)
 Insert 'insert' behind index 'pos' of the 'base' string.
 
static void TransferItemProperties (EntityAI source, notnull EntityAI target, bool transfer_agents=true, bool transfer_variables=true, bool transfer_health=true, bool exclude_quantity=false)
 will transform item' variables, agents and other local scripted properties as well as any relevant non-scripted properties like health
 
static void TransferItemVariables (ItemBase source, ItemBase target, bool exclude_quantity=false)
 
static TransferInventoryResult TransferInventory (EntityAI sourceItem, EntityAI targetItem, PlayerBase player)
 
static void UnlimitedAmmoDebugCheck (Weapon_Base weapon)
 
static void TurnItemIntoItem (notnull ItemBase old_item, string new_item_type, notnull PlayerBase player)
 
static void TurnItemIntoItemEx (notnull PlayerBase player, ReplaceItemWithNewLambdaBase lambda)
 
static void TurnItemInHandsIntoItem (notnull ItemBase old_item, string new_item_type, notnull PlayerBase player)
 
static void TurnItemInHandsIntoItemEx (notnull PlayerBase player, ReplaceItemWithNewLambdaBase lambda)
 
static array< ItemBaseCreateItemBasePiles (string item_name, vector ground_position, float quantity, float health, bool floaty_spawn=false)
 Spawns multiple piles of stackable ItemBase objects on ground (intended for generic use)
 
static array< MagazineCreateMagazinePiles (string item_name, vector ground_position, float quantity, float health)
 
static array< MagazineCreateMagazinePilesFromBullet (string bullet_type, vector ground_position, float quantity, float health)
 
static int GetHealthLevelForAmmo (string class_name, float health)
 
static float GetTypeMaxGlobalHealth (string class_name, string health_type="Health")
 
static bool GetProjectedCursorPos3d (out vector position, Weapon_Base weapon)
 
static void GetHeadBonePos (notnull PlayerBase player, out vector pos)
 
static vector GetHeadingVector (notnull PlayerBase player)
 
static float GetHeadingAngle (notnull DayZPlayerImplement player)
 
static float GetEnergyMetabolicSpeed (int movement_speed)
 
static float GetWaterMetabolicSpeed (int movement_speed)
 
static string ObtainRestrainItemTargetClassname (notnull EntityAI entity)
 
static void TransformRestrainItem (EntityAI current_item, EntityAI tool, PlayerBase player_source, PlayerBase player_target, bool destroy=false)
 
static bool IsValueInRange (float value, float from, float to)
 
static bool IsPlayerOrientedTowardPos (notnull DayZPlayerImplement player, vector target_pos, float cone_angle)
 Check if player direction(based on cone of defined angle) is oriented to target position.
 
static string SanitizeString (string input)
 
static bool ComplexBuildCollideCheckClient (PlayerBase player, ActionTarget target, ItemBase item, string partName="")
 
static bool ComplexBuildCollideCheckClient (PlayerBase player, ActionTarget target, ItemBase item, int constraction_index)
 
static bool BuildCondition (PlayerBase player, ActionTarget target, ItemBase item, bool camera_check)
 
static bool BuildCondition (PlayerBase player, ActionTarget target, ItemBase item, bool camera_check, int constraction_index)
 
static void IsUnderRoofFromToCalculation (EntityAI entity, out vector from, out vector to, float height=GameConstants.ROOF_CHECK_RAYCAST_DIST)
 
static bool IsUnderRoof (EntityAI entity, float height=GameConstants.ROOF_CHECK_RAYCAST_DIST)
 
static bool IsUnderRoofEx (EntityAI entity, float height=GameConstants.ROOF_CHECK_RAYCAST_DIST, int geometry=ObjIntersectView)
 
static vector GetSteamPosition (EntityAI parent)
 
static void DropAllItemsInInventoryInBounds (ItemBase ib, vector halfExtents)
 
static void ThrowAllItemsInInventory (notnull EntityAI parent, int flags)
 
static void ThrowEntityFromInventory (notnull EntityAI entity, vector position, float direction[4], vector force, int flags)
 
static float GetCurrentItemHeatIsolation (ItemBase pItem)
 
static void FilterObstructingObjects (array< Object > potentiallyObstructingObjects, out array< Object > obstructingObjects)
 
static bool CanIgnoreDistanceCheck (Object obj)
 
static void FilterObstructedObjectsByGrouping (vector origin, float range, float distanceDelta, array< Object > objects, array< Object > obstructingObjects, out array< Object > filteredObjects, bool doDistanceCheck=false, bool checkIfDistanceCanBeIgnored=false, float maxDist=0)
 group objects that are close to each other together
 
static void SplitArrayIntoGroupsByDistance (array< Object > objects, array< ref array< Object > > objectGroups, float squaredDistanceDelta)
 
static bool IsObjectObstructed (Object object, bool doDistanceCheck=false, vector distanceCheckPos="0 0 0", float maxDist=0)
 
static bool IsObjectObstructedEx (Object object, IsObjectObstructedCache cache, bool doDistanceCheck=false, vector distanceCheckPos="0 0 0", float maxDist=0)
 
static bool IsObjectObstructedProxy (Object object, IsObjectObstructedCache cache, PlayerBase player)
 
static bool IsObjectObstructedFilter (Object object, IsObjectObstructedCache cache, PlayerBase player)
 
static bool IsObjectObstructedFilterEx (Object object, IsObjectObstructedCache cache, PlayerBase player, int geometryTypeOverride=-1)
 groups 'RaycastRVProxy' and 'RaycastRV' approaches into one method, allowes for comprehensive geometry override, if desired
 
static void DealAbsoluteDmg (ItemBase item, float dmg)
 
static float Normalize (int val, int maxVal)
 
static float Bobbing (float period, float amplitude, float elapsedTime)
 
static float FModulus (float x, float y)
 
static void RemoveSplint (PlayerBase player)
 
static void TeleportCheck (notnull PlayerBase player, notnull array< ref array< float > > safe_positions)
 checks if we should teleport the player to a safe location and if so, performs the teleportation
 
static vector GetClosestSafePos (vector to_pos, notnull array< ref array< float > > positions)
 
static void GenerateAINoiseAtPosition (vector position, float lifeTime, NoiseParams noiseParams)
 
static float GetMinValue (array< float > pArray)
 
static float GetMaxValue (array< float > pArray)
 
static string GetItemDisplayName (string type)
 
static bool IsComponentInSelection (array< Selection > pSelection, string pCompName)
 
static int GetComponentIndex (array< Selection > pSelection, string pCompName)
 
static void RemoveAllAttachedChildrenByTypename (notnull EntityAI parent, array< typename > listOfTypenames)
 
static void GetAttachedChildren (IEntity parent, array< IEntity > outputObjects)
 Fills the provided array with all children entities in hierarchy of this entity.
 
static void SoakItemInsideParentContainingLiquidAboveThreshold (notnull ItemBase item, notnull ItemBase parent, float liquidQuantityThresholdPercentage=0.05)
 
void IsObjectObstructedCache (vector rayCastStart, int totalObjects)
 
void ClearCache ()
 

Переменные

PlayerBase m_Player
 
EntityAI m_NewItem
 
 NONE = 0
 
 SPLIT = 1
 
DestroyItemInCorpsesHandsAndCreateNewOnGndLambda RaycastStart = "0 0 0"
 
int TotalObjects = 0
 
vector ObjectCenterPos = "0 0 0"
 
vector ObjectContactPos = "0 0 0"
 
vector ObjectContactDir = "0 0 0"
 
int ContactComponent = -1
 
ref array< ref RaycastRVResultHitProxyObjects = new array<ref RaycastRVResult>
 
ref set< ObjectHitObjects = new set<Object>
 

Перечисления

◆ ThrowEntityFlags

208{
209 NONE = 0,
210 SPLIT = 1, //< Splits the item when it has quantity, recommended to use when called on an attachment
211}
SPLIT
Definition MiscGameplayFunctions.c:218
NONE
Definition MiscGameplayFunctions.c:217

◆ TransferInventoryResult

Элементы перечислений
Ok 
DroppedSome 
203{
205};
@ Ok
Definition MiscGameplayFunctions.c:204
@ DroppedSome
Definition MiscGameplayFunctions.c:204

Функции

◆ Bobbing()

static float Bobbing ( float period,
float amplitude,
float elapsedTime )
staticprotected
1433 {
1434 //Prevent division by 0
1435 if ( period == 0 )
1436 period = 1;
1437
1438 elapsedTime /= period;
1439
1440 float cycle;
1441 cycle += elapsedTime;
1442 cycle = FModulus(cycle, 360);
1444
1445 return cycle;
1446 }
static float FModulus(float x, float y)
Definition MiscGameplayFunctions.c:1449
Definition EnMath.c:7
Definition EntityAI.c:95
static proto float Sin(float angle)
Returns sinus of angle in radians.

Перекрестные ссылки FModulus() и Math::Sin().

◆ BuildCondition() [1/2]

static bool BuildCondition ( PlayerBase player,
ActionTarget target,
ItemBase item,
bool camera_check )
staticprotected
785 {
786 return true;
787 }

Используется в ComplexBuildCollideCheckClient().

◆ BuildCondition() [2/2]

static bool BuildCondition ( PlayerBase player,
ActionTarget target,
ItemBase item,
bool camera_check,
int constraction_index )
staticprotected
790 {
791 Object targetObject = target.GetObject();
792 if ( targetObject && targetObject.CanUseConstruction() )
793 {
795 ConstructionActionData construction_action_data = player.GetConstructionActionData();
797
799 if ( item )
800 {
802 }
803 else
804 {
806 }
807
808 //Debug
809 /*
810 if ( constrution_part )
811 {
812 Construction construction = base_building.GetConstruction();
813 construction.IsColliding( constrution_part.GetPartName() );
814 }
815 */
816
817 if ( constrution_part )
818 {
819 //camera and position checks
820 bool position_check = ( base_building.MustBeBuiltFromOutside() && !base_building.IsPlayerInside(player, constrution_part.GetMainPartName()) ) || ( !base_building.MustBeBuiltFromOutside() && base_building.IsPlayerInside(player, constrution_part.GetMainPartName()) );
821 if ( position_check && !player.GetInputController().CameraIsFreeLook() )
822 {
823 //Camera check (client-only)
824 if ( camera_check )
825 {
826 if ( GetGame() && ( !GetGame().IsDedicatedServer() ) )
827 {
828 return !base_building.IsFacingCamera( constrution_part.GetMainPartName() );
829 }
830 }
831
832 return true;
833 }
834 }
835 }
836
837 return false;
838 }
Definition Fence.c:2
Definition ConstructionActionData.c:2
Definition ConstructionPart.c:2
Definition ObjectTyped.c:2
proto native CGame GetGame()

Перекрестные ссылки GetGame().

◆ CanIgnoreDistanceCheck()

static bool CanIgnoreDistanceCheck ( Object obj)
staticprotected
1138 {
1139 return obj.IsTransport() || obj.CanUseConstruction();
1140 }

Используется в FilterObstructedObjectsByGrouping().

◆ ClearCache()

void ClearCache ( )
protected
1727 {
1728 ObjectCenterPos = "0 0 0";
1729 ObjectContactPos = "0 0 0";
1730 ObjectContactDir = "0 0 0";
1731 ContactComponent = -1;
1732 HitProxyObjects.Clear();
1733 HitObjects.Clear();
1734 }
ref array< ref RaycastRVResult > HitProxyObjects
Definition MiscGameplayFunctions.c:1716
vector ObjectContactDir
Definition MiscGameplayFunctions.c:1714
vector ObjectContactPos
Definition MiscGameplayFunctions.c:1713
vector ObjectCenterPos
Definition MiscGameplayFunctions.c:1712
ref set< Object > HitObjects
Definition MiscGameplayFunctions.c:1717
int ContactComponent
Definition MiscGameplayFunctions.c:1715

Перекрестные ссылки ContactComponent, HitObjects, HitProxyObjects, ObjectCenterPos, ObjectContactDir и ObjectContactPos.

◆ ComplexBuildCollideCheckClient() [1/2]

static bool ComplexBuildCollideCheckClient ( PlayerBase player,
ActionTarget target,
ItemBase item,
int constraction_index )
staticprotected
748 {
750 if (base_building)
751 {
752 Construction construction = base_building.GetConstruction();
754 {
755 ConstructionActionData construction_action_data = player.GetConstructionActionData();
756 string partName;
757 if ( item )
758 {
759 partName = construction_action_data.GetBuildPartAtIndex(constraction_index).GetPartName();
760 }
761 else
762 {
763 partName = construction_action_data.GetBuildPartNoToolAtIndex(constraction_index).GetPartName();
764 }
765 bool boo;
766 if (base_building.PerformRoofCheckForBase(partName,player,boo) && boo)
767 return false;
768 if ( player.IsPlacingLocal() || player.IsPlacingServer() )
769 return false;
770
771 /*float distance_root = vector.DistanceSq(target.GetCursorHitPos(), player.GetPosition());
772
773 if (!CfgGameplayHandler.GetDisableDistanceCheck() && distance_root < UAMaxDistances.BASEBUILDING_SHORT)
774 {
775 return false;
776 } */
777 return !construction.IsColliding( partName );
778 }
779 }
780 return false;
781 }
void Construction(BaseBuildingBase parent)
Definition Construction.c:26
static bool BuildCondition(PlayerBase player, ActionTarget target, ItemBase item, bool camera_check)
Definition MiscGameplayFunctions.c:784

Перекрестные ссылки BuildCondition() и Construction().

◆ ComplexBuildCollideCheckClient() [2/2]

static bool ComplexBuildCollideCheckClient ( PlayerBase player,
ActionTarget target,
ItemBase item,
string partName = "" )
staticprotected
743 {
744 return true;
745 }

◆ CopyOldPropertiesToNew()

override void CopyOldPropertiesToNew ( notnull EntityAI old_item,
EntityAI new_item )

We don't care if a valid transform couldn't be found, we just want to preferably use it instead of placing on the old item

125 {
126 super.CopyOldPropertiesToNew(old_item, new_item);
127
128 InventoryLocation understash_src = m_NewLocation; // m_NewLocation is a backup of original old_item's src before the operation started
129
131 old_item.GetInventory().EnumerateInventory(InventoryTraversalType.LEVELORDER, children);
132 int count = children.Count();
133 for (int i = 0; i < count; i++)
134 {
135 EntityAI child = children.Get(i);
136 if (child)
137 {
139 child.GetInventory().GetCurrentInventoryLocation(child_src);
140
142 //@TODO: modify _dst with place on gnd?
143
144 vector m4[4];
146
149
150 child_dst.SetGround(child,m4);
151
152 m_Player.LocalTakeToDst(child_src, child_dst);
153
154 GetGame().RemoteObjectTreeCreate(child); // this forces server to send CreateVehicle Message to client. This is needed for preserving the appearance of network operations on client (so that DeleteObject(old) arrives before CreateVehicle(new)). @NOTE: this does not delete the object on server, only it's network representation.
155 }
156 }
157 }
PlayerBase m_Player
Definition MiscGameplayFunctions.c:117
Definition Building.c:6
script counterpart to engine's class Inventory
Definition Inventory.c:79
static proto native bool PrepareDropEntityPos(EntityAI owner, notnull EntityAI item, out vector mat[4], bool useValuesInMatrix=false, int conflictCheckDepth=-1)
Finds a transformation for the item to be dropped to If the initial transforation overlaps with anoth...
InventoryLocation.
Definition InventoryLocation.c:28
Definition EnMath3D.c:28
Definition EnConvert.c:106
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
Definition gameplay.c:6
static void MatrixIdentity4(out vector mat[4])
Creates identity matrix.
Definition EnMath3D.c:256

◆ CreateItemBasePiles()

static array< ItemBase > CreateItemBasePiles ( string item_name,
vector ground_position,
float quantity,
float health,
bool floaty_spawn = false )
staticprotected

Spawns multiple piles of stackable ItemBase objects on ground (intended for generic use)

429 {
431 float max_stack_size;
433
435 max_stack_size = g_Game.ConfigGetInt("cfgVehicles " + item_name + " varStackMax");
436 if( max_stack_size < 1)
437 max_stack_size = g_Game.ConfigGetInt("cfgVehicles " + item_name + " varQuantityMax");
438 if( max_stack_size < 1)
439 max_stack_size = 1;
440
443
444 for ( int i = 0; i < full_piles_count; i++ )
445 {
446 if (floaty_spawn)
448 else
450 pile.SetQuantity(max_stack_size);
451 pile.SetHealth(health);
452 item_piles.Insert(pile);
453 }
454 if ( rest > 0 )
455 {
456 if (floaty_spawn)
458 else
460 pile.SetQuantity(rest);
461 pile.SetHealth(health);
462 item_piles.Insert(pile);
463 }
464 return item_piles;
465 }
const int ECE_PLACE_ON_SURFACE
Definition CentralEconomy.c:37
const int ECE_UPDATEPATHGRAPH
Definition CentralEconomy.c:13
const int ECE_CREATEPHYSICS
Definition CentralEconomy.c:16
DayZGame g_Game
Definition DayZGame.c:3746
Definition InventoryItem.c:731
static proto float Floor(float f)
Returns floor of value.

Перекрестные ссылки ECE_CREATEPHYSICS, ECE_PLACE_ON_SURFACE, ECE_UPDATEPATHGRAPH, Math::Floor(), g_Game и GetGame().

◆ CreateMagazinePiles()

static array< Magazine > CreateMagazinePiles ( string item_name,
vector ground_position,
float quantity,
float health )
staticprotected
468 {
470 float stack_size;
472
474 stack_size = g_Game.ConfigGetInt("cfgMagazines " + item_name + " count");
475
478
479 for ( int i = 0; i < piles_count; i++ )
480 {
482 pile.ServerSetAmmoCount(stack_size);
483 items.Insert(pile);
484 }
485 if ( rest > 0)
486 {
488 pile.ServerSetAmmoCount(rest);
489 items.Insert(pile);
490 }
491 return items;
492 }

Перекрестные ссылки ECE_PLACE_ON_SURFACE, Math::Floor(), g_Game и GetGame().

◆ CreateMagazinePilesFromBullet()

static array< Magazine > CreateMagazinePilesFromBullet ( string bullet_type,
vector ground_position,
float quantity,
float health )
staticprotected
495 {
498 float stack_size;
500 string item_name;
501 if( !g_Game.ConfigGetText("cfgAmmo " + bullet_type + " spawnPileType", item_name) )
502 return items;
503
504 stack_size = g_Game.ConfigGetInt("cfgMagazines " + item_name + " count");
505
506 if(stack_size > 0)
507 {
510
511 for ( int i = 0; i < piles_count; i++ )
512 {
514 pile.ServerSetAmmoCount(stack_size);
515 items.Insert(pile);
516 }
517 if ( rest > 0)
518 {
520 pile.ServerSetAmmoCount(rest);
521 items.Insert(pile);
522 }
523 }
524 return items;
525 }

Перекрестные ссылки ECE_PLACE_ON_SURFACE, Math::Floor(), g_Game и GetGame().

◆ CreateNetworkObjectInfo()

void CreateNetworkObjectInfo ( EntityAI new_item)
protected
196 {
197 super.CreateNetworkObjectInfo(new_item);
198 GetGame().RemoteObjectTreeCreate(m_NewItem);
199 }
EntityAI m_NewItem
Definition MiscGameplayFunctions.c:166

Перекрестные ссылки GetGame() и m_NewItem.

◆ DealAbsoluteDmg()

static void DealAbsoluteDmg ( ItemBase item,
float dmg )
staticprotected
1416 {
1417 item.DecreaseHealth(dmg, false);
1418 }

◆ DropAllItemsInInventoryInBounds()

static void DropAllItemsInInventoryInBounds ( ItemBase ib,
vector halfExtents )
staticprotected
946 {
947 if (!GetGame().IsServer())
948 return;
950 ib.GetInventory().EnumerateInventory(InventoryTraversalType.LEVELORDER, items);
951
952 vector direction = ib.GetDirection();
954
955 float angle = Math.Acos(dot);
956 if (direction[0] < 0)
957 angle = -angle;
958
959 float cos = Math.Cos(angle);
960 float sin = Math.Sin(angle);
961
963 int count = items.Count();
964 for ( int i = 0; i < count; ++i )
965 {
966 item = items.Get(i);
967 if ( item )
968 ib.GetInventory().DropEntityInBounds(InventoryMode.SERVER, ib, item, halfExtents, angle, cos, sin);
969 }
970 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Definition Inventory.c:22
static const vector Forward
Definition EnConvert.c:109
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Definition EnConvert.c:271
static proto float Acos(float c)
Returns angle in radians from cosinus.
static proto float Cos(float angle)
Returns cosinus of angle in radians.

Перекрестные ссылки Math::Acos(), Math::Cos(), vector::Dot(), vector::Forward, GetGame() и Math::Sin().

◆ DropEquipAndDestroyRootLambda()

void DropEquipAndDestroyRootLambda ( EntityAI old_item,
string new_item_type,
PlayerBase player )
120 {
122 }

◆ FilterObstructedObjectsByGrouping()

static void FilterObstructedObjectsByGrouping ( vector origin,
float range,
float distanceDelta,
array< Object > objects,
array< Object > obstructingObjects,
out array< Object > filteredObjects,
bool doDistanceCheck = false,
bool checkIfDistanceCanBeIgnored = false,
float maxDist = 0 )
staticprotected

group objects that are close to each other together

1144 {
1147
1148 int i = 0;
1149 int j = 0;
1150 int k = 0;
1151 int mCount = vicinityObjects.Count();
1152
1153 if (!filteredObjects)
1155
1156 // Remove objects that are too far from the player anyways
1157 if ( doDistanceCheck )
1158 {
1159 for ( i = vicinityObjects.Count() - 1; i >= 0; --i )
1160 {
1161 Object obj = vicinityObjects[i];
1162 if ( obj && !CanIgnoreDistanceCheck( obj ) && vector.DistanceSq(origin, obj.GetPosition()) > maxDist * maxDist )
1163 vicinityObjects.Remove(i);
1164 }
1165 }
1166
1167 // Sort obstructingObjects to have the furthest one first
1171 float distance, dist1, dist2;
1172
1173 for ( i = 0; i < obstructingObjects.Count(); ++i )
1174 {
1175 distance = vector.DistanceSq(obstructingObjects[i].GetWorldPosition(), origin);
1176 distanceHelper.Insert(distance);
1177 }
1178
1180 distanceHelper.Sort();
1181
1182 for ( i = distanceHelper.Count() - 1; i >= 0; --i )
1184
1188
1189 float cos = Math.Cos(90);
1190 float sin = Math.Sin(90);
1191
1192 // Iterate through sorted obstructingObjects
1193 for ( i = 0; i < sortedObstructingObjects.Count(); ++i )
1194 {
1196 vector worldPos = obstrObj.GetWorldPosition();
1197 vector min, max;
1198 vector minMax[2];
1199 if ( obstrObj.GetCollisionBox(minMax) )
1200 {
1201 min = minMax[0];
1202 max = minMax[1];
1203 max = max * (obstrObj.GetOrientation() * range);
1204
1205 vector center, dx, dy, dz, half;
1206 center = (min + max) * 0.5;
1207 dz = obstrObj.GetOrientation();
1210 half = (max - min) * 0.5;
1212
1213 group = new array<Object>;
1214
1215 // Group objects within the above box
1216 for ( j = vicinityObjects.Count() - 1; j >= 0; --j )
1217 {
1219 if ( vicObj )
1220 {
1221 vector d = vicObj.GetWorldPosition() - worldPos + center;
1222 if ( Math.AbsFloat(vector.Dot(d, dx)) <= half[0] && Math.AbsFloat(vector.Dot(d, dy)) <= half[1] && Math.AbsFloat(vector.Dot(d, dz)) <= half[2] )
1223 {
1224 group.Insert(vicObj);
1225 vicinityObjects.Remove(j);
1226 }
1227 }
1228 }
1229
1230 if ( group.Count() > 0 )
1231 tempGroups.Insert(group);
1232 }
1233 }
1234
1235 // Go through the objects grouped by obstruction to split them by distance too
1236 for ( i = 0; i < tempGroups.Count(); ++i )
1238
1239 // Split initial groups by distance
1241
1242 // Raycast accordingly to groups
1244 for ( i = 0; i < objectGroups.Count(); ++i )
1245 {
1248
1250 filteredObjects.InsertAll(objectGroup);
1251
1252 cache.ClearCache();
1253 }
1254 }
static bool CanIgnoreDistanceCheck(Object obj)
Definition MiscGameplayFunctions.c:1137
void IsObjectObstructedCache(vector rayCastStart, int totalObjects)
Definition MiscGameplayFunctions.c:1719
static bool IsObjectObstructedEx(Object object, IsObjectObstructedCache cache, bool doDistanceCheck=false, vector distanceCheckPos="0 0 0", float maxDist=0)
Definition MiscGameplayFunctions.c:1299
static void SplitArrayIntoGroupsByDistance(array< Object > objects, array< ref array< Object > > objectGroups, float squaredDistanceDelta)
Definition MiscGameplayFunctions.c:1256
static vector RotateAroundZero(vector pos, vector axis, float cosAngle, float sinAngle)
Rotate a vector around 0,0,0.
Definition EnConvert.c:477
static const vector Up
Definition EnConvert.c:107
static const vector Aside
Definition EnConvert.c:108
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float AbsFloat(float f)
Returns absolute value.

Перекрестные ссылки Math::AbsFloat(), vector::Aside, CanIgnoreDistanceCheck(), Math::Cos(), vector::DistanceSq(), vector::Dot(), IsObjectObstructedCache(), IsObjectObstructedEx(), vector::RotateAroundZero(), Math::Sin(), SplitArrayIntoGroupsByDistance(), vector::Up и Vector().

◆ FilterObstructingObjects()

static void FilterObstructingObjects ( array< Object > potentiallyObstructingObjects,
out array< Object > obstructingObjects )
staticprotected
1125 {
1126 if (!obstructingObjects)
1128
1129 for ( int i = 0; i < potentiallyObstructingObjects.Count(); ++i )
1130 {
1132 if ( obj && ( obj.CanObstruct() || obj.CanProxyObstruct() ) )
1133 obstructingObjects.Insert(obj);
1134 }
1135 }

◆ FModulus()

static float FModulus ( float x,
float y )
staticprotected
1450 {
1451 return Math.ModFloat(x, y);
1452 }
Icon x
Icon y
static proto float ModFloat(float x, float y)
Returns the floating-point remainder of x/y rounded towards zero.

Перекрестные ссылки Math::ModFloat(), x и y.

Используется в Bobbing().

◆ GenerateAINoiseAtPosition()

static void GenerateAINoiseAtPosition ( vector position,
float lifeTime,
NoiseParams noiseParams )
staticprotected
1554 {
1555 if (GetGame().IsServer())
1556 {
1557 NoiseSystem noise = GetGame().GetNoiseSystem();
1558 if (noise)
1559 {
1560 noise.AddNoiseTarget(position, lifeTime, noiseParams);
1561 }
1562 }
1563 }
Definition Noise.c:2

Перекрестные ссылки GetGame().

◆ GetAttachedChildren()

static void GetAttachedChildren ( IEntity parent,
array< IEntity > outputObjects )
staticprotected

Fills the provided array with all children entities in hierarchy of this entity.

1662 {
1663 IEntity child = parent.GetChildren();
1664 while (child)
1665 {
1666 outputObjects.Insert(child);
1667 child = child.GetSibling();
1668 }
1669 }
Definition EnEntity.c:165
proto native IEntity GetChildren()
Returns pointer to first child Entity in hierarchy.

Перекрестные ссылки IEntity::GetChildren().

◆ GetClosestSafePos()

static vector GetClosestSafePos ( vector to_pos,
notnull array< ref array< float > > positions )
staticprotected
1533 {
1535 float smallest_dist = float.MAX;
1536 foreach( array<float> pos:positions)
1537 {
1538 vector vpos = "0 0 0";
1539 vpos[0] = pos[0];
1540 vpos[2] = pos[1];
1541
1542 to_pos[1] = 0;
1543 float dist = vector.DistanceSq(to_pos, vpos);//2d dist sq
1544 if ( dist < smallest_dist)
1545 {
1547 closest_pos = vpos;
1548 }
1549 }
1550 return closest_pos;
1551 }

Перекрестные ссылки vector::DistanceSq().

◆ GetColorString()

static string GetColorString ( float r,
float g,
float b,
float a )
staticprotected
242 {
243 return string.Format("#(argb,8,8,3)color(%1,CO)", string.Format("%1,%2,%3,%4", r, g, b, a));
244 }

Перекрестные ссылки string::Format().

◆ GetComponentIndex()

static int GetComponentIndex ( array< Selection > pSelection,
string pCompName )
staticprotected
1618 {
1619 if (!MiscGameplayFunctions.IsComponentInSelection(pSelection, pCompName))
1620 {
1621 return INDEX_NOT_FOUND;
1622 }
1623
1624 for (int i = 0; i < pSelection.Count(); ++i)
1625 {
1626 pCompName.ToLower();
1627 if (pSelection[i] && pSelection[i].GetName() == pCompName)
1628 {
1629 return i;
1630 }
1631 }
1632
1633 return INDEX_NOT_FOUND;
1634 }
const int INDEX_NOT_FOUND
Definition gameplay.c:13
proto native owned string GetName()
Definition SyncedValue.c:117

Перекрестные ссылки GetName() и INDEX_NOT_FOUND.

◆ GetCurrentItemHeatIsolation()

static float GetCurrentItemHeatIsolation ( ItemBase pItem)
staticprotected

item heat isolation (from cfg)

item health (state)

item wetness

wet factor selection

health factor selection

apply factors

1063 {
1064 float wetFactor;
1065 float healthFactor;
1066
1067 float heatIsolation = pItem.GetHeatIsolation();
1068 float itemHealthLabel = pItem.GetHealthLevel();
1069 float itemWetness = pItem.GetWet();
1070
1073 {
1075 }
1077 {
1079 }
1081 {
1083 }
1085 {
1087 }
1089 {
1091 }
1092
1094 switch (itemHealthLabel)
1095 {
1098 break;
1099
1102 break;
1103
1106 break;
1107
1110 break;
1111
1114 break;
1115 }
1116
1120
1121 return heatIsolation;
1122 }
Definition constants.c:615
const float ENVIRO_ISOLATION_WETFACTOR_WET
Definition constants.c:714
const float ENVIRO_ISOLATION_HEALTHFACTOR_B_DAMAGED
Definition constants.c:721
const float ENVIRO_ISOLATION_WETFACTOR_SOAKED
Definition constants.c:715
const float ENVIRO_ISOLATION_WETFACTOR_DRENCHED
Definition constants.c:716
const float ENVIRO_ISOLATION_HEALTHFACTOR_DAMAGED
Definition constants.c:720
const float ENVIRO_ISOLATION_HEALTHFACTOR_RUINED
Definition constants.c:722
const float ENVIRO_ISOLATION_HEALTHFACTOR_WORN
Definition constants.c:719
const float ENVIRO_ISOLATION_HEALTHFACTOR_PRISTINE
impact of item health (state) to the heat isolation
Definition constants.c:718
const float ENVIRO_ISOLATION_WETFACTOR_DAMP
Definition constants.c:713
const float ENVIRO_ISOLATION_WETFACTOR_DRY
Heat buffer static timer tick (set for 2s enviro tick, 180s to 1.0)
Definition constants.c:712
const int STATE_RUINED
Definition constants.c:760
const int STATE_BADLY_DAMAGED
Definition constants.c:761
const int STATE_DAMAGED
Definition constants.c:762
const int STATE_PRISTINE
Definition constants.c:764
const int STATE_WORN
Definition constants.c:763
const float STATE_DRY
Definition constants.c:788
const float STATE_SOAKING_WET
Definition constants.c:785
const float STATE_WET
Definition constants.c:786
const float STATE_DRENCHED
Definition constants.c:784
const float STATE_DAMP
Definition constants.c:787

Перекрестные ссылки GameConstants::ENVIRO_ISOLATION_HEALTHFACTOR_B_DAMAGED, GameConstants::ENVIRO_ISOLATION_HEALTHFACTOR_DAMAGED, GameConstants::ENVIRO_ISOLATION_HEALTHFACTOR_PRISTINE, GameConstants::ENVIRO_ISOLATION_HEALTHFACTOR_RUINED, GameConstants::ENVIRO_ISOLATION_HEALTHFACTOR_WORN, GameConstants::ENVIRO_ISOLATION_WETFACTOR_DAMP, GameConstants::ENVIRO_ISOLATION_WETFACTOR_DRENCHED, GameConstants::ENVIRO_ISOLATION_WETFACTOR_DRY, GameConstants::ENVIRO_ISOLATION_WETFACTOR_SOAKED, GameConstants::ENVIRO_ISOLATION_WETFACTOR_WET, GameConstants::STATE_BADLY_DAMAGED, GameConstants::STATE_DAMAGED, GameConstants::STATE_DAMP, GameConstants::STATE_DRENCHED, GameConstants::STATE_DRY, GameConstants::STATE_PRISTINE, GameConstants::STATE_RUINED, GameConstants::STATE_SOAKING_WET, GameConstants::STATE_WET и GameConstants::STATE_WORN.

◆ GetEnergyMetabolicSpeed()

static float GetEnergyMetabolicSpeed ( int movement_speed)
staticprotected
613 {
614 float speed;
615 switch (movement_speed)
616 {
617 case DayZPlayerConstants.MOVEMENTIDX_WALK:
619 break;
620 case DayZPlayerConstants.MOVEMENTIDX_RUN:
622 break;
623 case DayZPlayerConstants.MOVEMENTIDX_SPRINT:
625 break;
626 default:
627 speed = 0;
628 break;
629 }
630
632 return speed;
633 }
Definition PlayerConstants.c:2
static const float METABOLIC_SPEED_ENERGY_BASAL
Definition PlayerConstants.c:67
static const float METABOLIC_SPEED_ENERGY_SPRINT
Definition PlayerConstants.c:71
static const float METABOLIC_SPEED_ENERGY_JOG
Definition PlayerConstants.c:70
static const float METABOLIC_SPEED_ENERGY_WALK
Definition PlayerConstants.c:69
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки PlayerConstants::METABOLIC_SPEED_ENERGY_BASAL, PlayerConstants::METABOLIC_SPEED_ENERGY_JOG, PlayerConstants::METABOLIC_SPEED_ENERGY_SPRINT и PlayerConstants::METABOLIC_SPEED_ENERGY_WALK.

◆ GetHeadBonePos()

static void GetHeadBonePos ( notnull PlayerBase player,
out vector pos )
staticprotected
585 {
586 // Get position of head for starting trace pos, otherwise use sane default
587 int headBoneIdx = player.GetBoneIndexByName("Head");
588 if ( headBoneIdx == -1 )
589 { pos = player.GetPosition()[1] + 1.6; }
590 else
591 { pos = player.GetBonePositionWS(headBoneIdx); }
592 }

◆ GetHeadingAngle()

static float GetHeadingAngle ( notnull DayZPlayerImplement player)
staticprotected
605 {
606 HumanInputController hic = player.GetInputController();
607 float headingAngle = hic.GetHeadingAngle();
608
609 return headingAngle;
610 }
Definition human.c:18

Используется в GetHeadingVector().

◆ GetHeadingVector()

static vector GetHeadingVector ( notnull PlayerBase player)
staticprotected
595 {
596 vector dir = vector.Zero;
598 dir[0] = Math.Cos(headingAngle + Math.PI_HALF);
599 dir[2] = Math.Sin(headingAngle + Math.PI_HALF);
600
601 return dir.Normalized();
602 }
static float GetHeadingAngle(notnull DayZPlayerImplement player)
Definition MiscGameplayFunctions.c:604
proto vector Normalized()
return normalized vector (keeps orginal vector untouched)
static const vector Zero
Definition EnConvert.c:110
static const float PI_HALF
Definition EnMath.c:14

Перекрестные ссылки Math::Cos(), GetHeadingAngle(), vector::Normalized(), Math::PI_HALF, Math::Sin() и vector::Zero.

◆ GetHealthLevelForAmmo()

static int GetHealthLevelForAmmo ( string class_name,
float health )
staticprotected
528 {
529 float health_normalized = health / 100;
530 string config_path = CFG_WEAPONSPATH + " " + class_name + " DamageSystem" + " GlobalHealth" + " healthLabels";
532 GetGame().ConfigGetFloatArray(config_path, CachedObjectsArrays.ARRAY_FLOAT);
533 for(int i = 0; i < CachedObjectsArrays.ARRAY_FLOAT.Count(); i++)
534 {
536 {
537 return i;
538 }
539 }
540 return -1;
541 }
class OptionSelectorMultistate extends OptionSelector class_name
Definition UtilityClasses.c:41
static ref TFloatArray ARRAY_FLOAT
Definition UtilityClasses.c:50
const string CFG_WEAPONSPATH
Definition constants.c:210

Перекрестные ссылки CachedObjectsArrays::ARRAY_FLOAT, CFG_WEAPONSPATH, class_name и GetGame().

◆ GetItemDisplayName()

static string GetItemDisplayName ( string type)
staticprotected
1594 {
1595 return GetGame().ConfigGetTextOut("CfgVehicles " + type + " displayName");
1596 }

Перекрестные ссылки GetGame().

◆ GetMaxValue()

static float GetMaxValue ( array< float > pArray)
staticprotected
1580 {
1581 float maxValue = 0.0;
1582 for (int i = 0; i < pArray.Count(); i++)
1583 {
1584 if (maxValue == 0 || pArray.Get(i) > maxValue)
1585 {
1586 maxValue = pArray.Get(i);
1587 }
1588 }
1589
1590 return maxValue;
1591 }

◆ GetMinValue()

static float GetMinValue ( array< float > pArray)
staticprotected
1566 {
1567 float minValue = 0.0;
1568 for (int i = 0; i < pArray.Count(); i++)
1569 {
1570 if (minValue == 0 || pArray.Get(i) < minValue)
1571 {
1572 minValue = pArray.Get(i);
1573 }
1574 }
1575
1576 return minValue;
1577 }

◆ GetProjectedCursorPos3d()

static bool GetProjectedCursorPos3d ( out vector position,
Weapon_Base weapon )
staticprotected
567 {
568 vector usti_hlavne_position = weapon.GetSelectionPositionMS( "usti hlavne" );
569 vector konec_hlavne_position = weapon.GetSelectionPositionMS( "konec hlavne" );
574
578
580 return true;
581 return false;
582 }
Definition DayZPhysics.c:124
static proto bool RaycastRV(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, set< Object > results=NULL, Object with=NULL, Object ignore=NULL, bool sorted=false, bool ground_only=false, int iType=ObjIntersectView, float radius=0.0, CollisionFlags flags=CollisionFlags.NEARESTCONTACT)
Raycasts world by given parameters.
const float PROJECTED_CURSOR_DISTANCE
Definition constants.c:594

Перекрестные ссылки PROJECTED_CURSOR_DISTANCE и DayZPhysics::RaycastRV().

◆ GetSteamPosition()

static vector GetSteamPosition ( EntityAI parent)
staticprotected
905 {
907 float steam_offset = 0;
908
909 if ( parent )
910 {
911 particle_pos = parent.GetPosition();
912
913 if ( parent.IsInherited( PortableGasStove ) )
914 {
915 steam_offset = 0.2;
916 }
917 else if ( parent.IsInherited( FireplaceBase ) )
918 {
919 FireplaceBase fireplace = FireplaceBase.Cast( parent );
920
921 if ( fireplace.IsBaseFireplace() )
922 {
923 steam_offset = 0.8;
924 }
925 else if ( fireplace.IsBarrelWithHoles() )
926 {
927 steam_offset = 1.1;
928 }
929 else if ( fireplace.IsFireplaceIndoor() )
930 {
931 steam_offset = 0.45;
932 }
933 else if ( fireplace.IsIndoorOven() )
934 {
935 steam_offset = 0.9;
936 }
937 }
938 }
939
941
942 return particle_pos;
943 }
Definition BarrelHoles_ColorBase.c:2

◆ GetTypeMaxGlobalHealth()

static float GetTypeMaxGlobalHealth ( string class_name,
string health_type = "Health" )
staticprotected
544 {
545 float max_health;
546 string cfg_path;
547
548 if ( GetGame().ConfigIsExisting(CFG_VEHICLESPATH+" "+class_name) )
549 {
551 }
552 else if ( GetGame().ConfigIsExisting(CFG_WEAPONSPATH+" "+class_name) )
553 {
555 }
556 else if ( GetGame().ConfigIsExisting(CFG_MAGAZINESPATH+" "+class_name) )
557 {
559 }
560 cfg_path = cfg_path + " "+class_name+" DamageSystem GlobalHealth " + health_type + " hitpoints";
561 max_health = GetGame().ConfigGetFloat(cfg_path);
562
563 return max_health;
564 }
const string CFG_VEHICLESPATH
Definition constants.c:209
const string CFG_MAGAZINESPATH
Definition constants.c:211

Перекрестные ссылки CFG_MAGAZINESPATH, CFG_VEHICLESPATH, CFG_WEAPONSPATH, class_name и GetGame().

◆ GetWaterMetabolicSpeed()

static float GetWaterMetabolicSpeed ( int movement_speed)
staticprotected
636 {
637 float speed;
638 switch (movement_speed)
639 {
640 case DayZPlayerConstants.MOVEMENTIDX_WALK:
642 break;
643 case DayZPlayerConstants.MOVEMENTIDX_RUN:
645 break;
646 case DayZPlayerConstants.MOVEMENTIDX_SPRINT:
648 break;
649 default:
650 speed = 0;
651 break;
652 }
653
655 return speed;
656 }
static const float METABOLIC_SPEED_WATER_WALK
Definition PlayerConstants.c:75
static const float METABOLIC_SPEED_WATER_JOG
Definition PlayerConstants.c:76
static const float METABOLIC_SPEED_WATER_BASAL
Definition PlayerConstants.c:73
static const float METABOLIC_SPEED_WATER_SPRINT
Definition PlayerConstants.c:77

Перекрестные ссылки PlayerConstants::METABOLIC_SPEED_WATER_BASAL, PlayerConstants::METABOLIC_SPEED_WATER_JOG, PlayerConstants::METABOLIC_SPEED_WATER_SPRINT и PlayerConstants::METABOLIC_SPEED_WATER_WALK.

◆ InsertAtPos()

static string InsertAtPos ( string base,
string insert,
int pos )
staticprotected

Insert 'insert' behind index 'pos' of the 'base' string.

259 {
260 int length_first = pos+1;
261 int length_base = base.Length();
263 string first = base.Substring(0,length_first);
264 string second = base.Substring(pos+1,length_second);
265 return first + insert + second;
266 }

Используется в ValueToBar().

◆ IsComponentInSelection()

static bool IsComponentInSelection ( array< Selection > pSelection,
string pCompName )
staticprotected
1599 {
1600 if (pSelection.Count() == 0 || pCompName.Length() == 0)
1601 {
1602 return false;
1603 }
1604
1605 for (int i = 0; i < pSelection.Count(); ++i)
1606 {
1607 pCompName.ToLower();
1608 if (pSelection[i] && pSelection[i].GetName() == pCompName)
1609 {
1610 return true;
1611 }
1612 }
1613
1614 return false;
1615 }

Перекрестные ссылки GetName().

◆ IsObjectObstructed()

static bool IsObjectObstructed ( Object object,
bool doDistanceCheck = false,
vector distanceCheckPos = "0 0 0",
float maxDist = 0 )
staticprotected
1291 {
1293 MiscGameplayFunctions.GetHeadBonePos(PlayerBase.Cast(GetGame().GetPlayer()), rayStart);
1295
1297 }
PlayerBase GetPlayer()
Definition ModifierBase.c:47
Definition PlayerBaseClient.c:2

Перекрестные ссылки GetGame(), GetPlayer(), IsObjectObstructedCache() и IsObjectObstructedEx().

◆ IsObjectObstructedCache()

void IsObjectObstructedCache ( vector rayCastStart,
int totalObjects )
protected
1720 {
1723 }
DestroyItemInCorpsesHandsAndCreateNewOnGndLambda RaycastStart
int TotalObjects
Definition MiscGameplayFunctions.c:1709

Перекрестные ссылки RaycastStart и TotalObjects.

Используется в ActionTargets::FilterObstructedObjects(), FilterObstructedObjectsByGrouping(), IsObjectObstructed() и ActionTargets::IsObstructed().

◆ IsObjectObstructedEx()

static bool IsObjectObstructedEx ( Object object,
IsObjectObstructedCache cache,
bool doDistanceCheck = false,
vector distanceCheckPos = "0 0 0",
float maxDist = 0 )
staticprotected
1300 {
1301 if (!object)
1302 return true;
1303
1304 PlayerBase player = PlayerBase.Cast(g_Game.GetPlayer());
1306 return true;
1307
1308 cache.ObjectCenterPos = object.GetCenter();
1309
1310 return IsObjectObstructedFilterEx(object, cache, player);
1311 }
static bool IsObjectObstructedFilterEx(Object object, IsObjectObstructedCache cache, PlayerBase player, int geometryTypeOverride=-1)
groups 'RaycastRVProxy' and 'RaycastRV' approaches into one method, allowes for comprehensive geometr...
Definition MiscGameplayFunctions.c:1370

Перекрестные ссылки vector::DistanceSq(), g_Game и IsObjectObstructedFilterEx().

Используется в FilterObstructedObjectsByGrouping() и IsObjectObstructed().

◆ IsObjectObstructedFilter()

static bool IsObjectObstructedFilter ( Object object,
IsObjectObstructedCache cache,
PlayerBase player )
staticprotected
1343 {
1344 for ( int m = 0; m < cache.HitObjects.Count(); m++ )
1345 {
1346 Object hit_object = cache.HitObjects.Get(m);
1347
1348 if ( hit_object.CanObstruct() )
1349 return true;
1350
1351 //4.3. ignore item if items are big and heavy >= OBJECT_OBSTRUCTION_WEIGHT
1352 //EntityAI eai;
1353 //if ( Class.CastTo( eai, hit_object ) )
1354 //{
1355 // if ( eai.GetWeight() >= OBJECT_OBSTRUCTION_WEIGHT )
1356 // {
1357 // if ( eai != filtered_object && eai.GetHierarchyRoot() != filtered_object )
1358 // {
1359 // //Print("!!!!!obstacle vaha: " + hit_object);
1360 // is_obstructed = true;
1361 // }
1362 // }
1363 //}
1364 }
1365
1366 return false;
1367 }

◆ IsObjectObstructedFilterEx()

static bool IsObjectObstructedFilterEx ( Object object,
IsObjectObstructedCache cache,
PlayerBase player,
int geometryTypeOverride = -1 )
staticprotected

groups 'RaycastRVProxy' and 'RaycastRV' approaches into one method, allowes for comprehensive geometry override, if desired

1371 {
1372 //first proxy geometries
1373 RaycastRVParams rayInput = new RaycastRVParams(cache.RaycastStart, cache.ObjectCenterPos, player);
1374 rayInput.flags = CollisionFlags.ALLOBJECTS;
1375 if (geometryTypeOverride != -1)
1376 rayInput.type = geometryTypeOverride; //default 'ObjIntersectView'
1377 DayZPhysics.RaycastRVProxy(rayInput, cache.HitProxyObjects);
1378 int count;
1379 int i;
1380
1381 if (cache.HitProxyObjects)
1382 {
1383 count = cache.HitProxyObjects.Count();
1384 Object parent;
1385 for (i = 0; i < count; i++)
1386 {
1387 if (cache.HitProxyObjects[i].hierLevel > 0) //parent has to exist, skipping nullcheck
1388 {
1389 parent = cache.HitProxyObjects[i].parent;
1390 if (parent && !parent.IsMan() && parent.CanProxyObstruct())
1391 {
1392 if (parent != object || (parent == object && object.CanProxyObstructSelf()))
1393 return true;
1394 }
1395 }
1396 }
1397 }
1398
1399 //second, regular raycast
1400 int geometry = ObjIntersectFire; //default for the RV raycast
1401 if (geometryTypeOverride != -1)
1403 DayZPhysics.RaycastRV(cache.RaycastStart, cache.ObjectCenterPos, cache.ObjectContactPos, cache.ObjectContactDir, cache.ContactComponent, cache.HitObjects, object, GetGame().GetPlayer(), false, false, geometry, 0.0, CollisionFlags.ALLOBJECTS);
1404 count = cache.HitObjects.Count();
1405 for (i = 0; i < count; i++ )
1406 {
1407 if (cache.HitObjects[i].CanObstruct())
1408 return true;
1409 }
1410
1411 return false;
1412 }
static proto bool RaycastRVProxy(notnull RaycastRVParams in, out notnull array< ref RaycastRVResult > results, array< Object > excluded=null)
Definition DayZPhysics.c:50
CollisionFlags
Definition EnDebug.c:141

Перекрестные ссылки GetGame(), GetPlayer(), DayZPhysics::RaycastRV() и DayZPhysics::RaycastRVProxy().

Используется в IsObjectObstructedEx().

◆ IsObjectObstructedProxy()

static bool IsObjectObstructedProxy ( Object object,
IsObjectObstructedCache cache,
PlayerBase player )
staticprotected
1314 {
1315 if (object.CanProxyObstruct())
1316 {
1317 RaycastRVParams rayInput = new RaycastRVParams(cache.RaycastStart, cache.ObjectCenterPos, player);
1318 DayZPhysics.RaycastRVProxy(rayInput, cache.HitProxyObjects);
1319 if (cache.HitProxyObjects)
1320 {
1321 if (cache.HitProxyObjects.Count() > 0)
1322 {
1323 if (cache.HitProxyObjects[0].hierLevel > 0)
1324 {
1325 // ignores attachments on player
1326 if (!cache.HitProxyObjects[0].parent.IsMan())
1327 {
1328 if (cache.HitProxyObjects[0].parent)
1329 {
1330 EntityAI proxyParent = EntityAI.Cast(cache.HitProxyObjects[0].parent);
1331 if (proxyParent.GetInventory() && proxyParent.GetInventory().GetCargo())
1332 return true;
1333 }
1334 }
1335 }
1336 }
1337 }
1338 }
1339 return false;
1340 }

Перекрестные ссылки DayZPhysics::RaycastRVProxy().

◆ IsPlayerOrientedTowardPos()

static bool IsPlayerOrientedTowardPos ( notnull DayZPlayerImplement player,
vector target_pos,
float cone_angle )
staticprotected

Check if player direction(based on cone of defined angle) is oriented to target position.

dir in cone or in a tip of cone

701 {
702 if (player)
703 {
704 vector player_dir = player.GetDirection();
705 vector to_target_dir = target_pos - player.GetPosition();
706
707 player_dir[1] = 0;
708 to_target_dir[1] = 0;
709
710 player_dir.Normalize();
711 to_target_dir.Normalize();
712
715
716 int dir = Math.Acos(cos_fi) * Math.RAD2DEG;
717
718 if( cross[1] < 0 )
719 dir = -dir;
720
722 if( (dir <= cone_angle && dir >= -cone_angle) || Math.AbsFloat(dir) == 90 )
723 {
724 return true;
725 }
726 }
727
728 return false;
729 }
static const float RAD2DEG
Definition EnMath.c:16

Перекрестные ссылки Math::AbsFloat(), Math::Acos(), vector::Dot() и Math::RAD2DEG.

◆ IsUnderRoof()

static bool IsUnderRoof ( EntityAI entity,
float height = GameConstants.ROOF_CHECK_RAYCAST_DIST )
staticprotected
871 {
873 }
static bool IsUnderRoofEx(EntityAI entity, float height=GameConstants.ROOF_CHECK_RAYCAST_DIST, int geometry=ObjIntersectView)
Definition MiscGameplayFunctions.c:875

Перекрестные ссылки IsUnderRoofEx().

◆ IsUnderRoofEx()

static bool IsUnderRoofEx ( EntityAI entity,
float height = GameConstants.ROOF_CHECK_RAYCAST_DIST,
int geometry = ObjIntersectView )
staticprotected
876 {
877 vector from;
878 vector to;
879
881
884
886 //set<Object> hit_object = new set<Object>;
887 bool boo = DayZPhysics.RaycastRV( from, to, contact_pos, contact_dir, contact_component, /*hit_object*/NULL, NULL, entity, false, false, geometry,0.25 );
888
889 /*if (boo)
890 {
891 Debug.DrawSphere(from , 0.8,Colors.YELLOW, ShapeFlags.ONCE);
892 Debug.DrawSphere(to , 0.8,Colors.RED, ShapeFlags.ONCE);
893 }
894 else
895 {
896 Debug.DrawSphere(from , 0.8,Colors.GREEN, ShapeFlags.ONCE);
897 Debug.DrawSphere(to , 0.8,Colors.RED, ShapeFlags.ONCE);
898 }*/
899
900 return boo;
901 }
static void IsUnderRoofFromToCalculation(EntityAI entity, out vector from, out vector to, float height=GameConstants.ROOF_CHECK_RAYCAST_DIST)
Definition MiscGameplayFunctions.c:840

Перекрестные ссылки IsUnderRoofFromToCalculation() и DayZPhysics::RaycastRV().

Используется в IsUnderRoof().

◆ IsUnderRoofFromToCalculation()

static void IsUnderRoofFromToCalculation ( EntityAI entity,
out vector from,
out vector to,
float height = GameConstants.ROOF_CHECK_RAYCAST_DIST )
staticprotected
841 {
842 vector minMax[2];
843 entity.GetCollisionBox(minMax);
844
845 vector size = Vector(0,0,0);
846 //size[1] = minMax[1][1] - minMax[0][1];
847 float from_override = entity.HeightStartCheckOverride();
848 if (from_override > 0.0)
849 {
850 size[1] = from_override;
851 }
852 else
853 {
854 size[1] = minMax[1][1] - minMax[0][1];
855 }
856
857 from = entity.GetPosition() + size;
858 if ( entity.HeightCheckOverride() > 0 )
859 {
860 to = entity.GetPosition() + Vector(0, entity.HeightCheckOverride(), 0);
861 }
862 else
863 {
864 vector ceiling = "0 0 0";
865 ceiling[1] = height;
866 to = from + ceiling; //+size ??? offset to cast same distance
867 }
868 }

Перекрестные ссылки Vector().

Используется в IsUnderRoofEx().

◆ IsValueInRange()

static bool IsValueInRange ( float value,
float from,
float to )
staticprotected
695 {
696 return (value >= from) && (value <= to);
697 }

◆ MoveEquipToExistingItemAndDestroyOldRootLambda()

void MoveEquipToExistingItemAndDestroyOldRootLambda ( EntityAI old_item,
string new_item_type,
PlayerBase player,
EntityAI new_item )
169 {
172 if (new_item_type != string.Empty)
173 Error("MoveEquipAndDestroyRootLambda expects new_item_type to be empty");
174 }
Empty
Definition Hand_States.c:14
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

Перекрестные ссылки Empty, Error(), m_NewItem и m_Player.

Используется в ActionPlaceFireplaceIntoBarrel::OnExecuteServer().

◆ Normalize()

static float Normalize ( int val,
int maxVal )
staticprotected
1422 {
1423 if (maxVal == 0)
1424 {
1425 Debug.LogError("Division by 0 is not allowed");
1426 return 0;
1427 }
1428
1429 return val / maxVal;
1430 }
Definition Debug.c:14
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Definition Debug.c:378

Перекрестные ссылки Debug::LogError().

◆ ObtainRestrainItemTargetClassname()

static string ObtainRestrainItemTargetClassname ( notnull EntityAI entity)
staticprotected
659 {
660 return entity.ConfigGetString( "OnRestrainChange");
661 }

◆ OnSuccess()

class TurnItemIntoItemLambdaAnimSysNotifyLambda extends TurnItemIntoItemLambda OnSuccess ( EntityAI new_item)
106 {
107 super.OnSuccess(new_item);
108 m_Player.SetRestrained(true);
109 }

◆ RemoveAllAttachedChildrenByTypename()

static void RemoveAllAttachedChildrenByTypename ( notnull EntityAI parent,
array< typename > listOfTypenames )
staticprotected
1637 {
1638 if (listOfTypenames.Count() > 0)
1639 {
1640 Object child = Object.Cast(parent.GetChildren());
1641 while (child)
1642 {
1644 child = Object.Cast(child.GetSibling());
1645
1646 if (childToRemove.IsAnyInherited(listOfTypenames))
1647 {
1648 vector pos = childToRemove.GetPosition();
1649 parent.RemoveChild(childToRemove, false);
1650
1651 vector m4[4];
1653 m4[3] = pos;
1654 childToRemove.SetTransform(m4);
1655 childToRemove.PlaceOnSurface();
1656 }
1657 }
1658 }
1659 }

Перекрестные ссылки Math3D::MatrixIdentity4().

◆ RemoveNetworkObjectInfo()

void RemoveNetworkObjectInfo ( )
protected
177 {
178 super.RemoveNetworkObjectInfo();
179 GetGame().RemoteObjectTreeDelete(m_NewItem);
180 }

Перекрестные ссылки GetGame() и m_NewItem.

◆ RemoveSplint()

static void RemoveSplint ( PlayerBase player)
staticprotected
1455 {
1456 EntityAI entity = player.GetInventory().CreateInInventory("Splint");
1457 if (!entity)
1458 entity = player.SpawnEntityOnGroundOnCursorDir("Splint", 0.5);
1459
1462 Class.CastTo(attachment, player.GetItemOnSlot("Splint_Right"));
1463 if ( attachment && attachment.GetType() == "Splint_Applied" )
1464 {
1465 if (new_item)
1466 {
1467 MiscGameplayFunctions.TransferItemProperties(attachment,new_item);
1468
1469 if (GetGame().IsServer())
1470 {
1471 //Lower health level of splint after use
1472 if (new_item.GetHealthLevel() < 4)
1473 {
1474 int newDmgLevel = new_item.GetHealthLevel() + 1;
1475
1476 float max = new_item.GetMaxHealth("","");
1477
1478 switch ( newDmgLevel )
1479 {
1482 break;
1483
1485 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_DAMAGED_VALUE );
1486 break;
1487
1489 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_WORN_VALUE );
1490 break;
1491
1493 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_RUINED_VALUE );
1494 break;
1495
1496 default:
1497 break;
1498 }
1499 }
1500 }
1501 }
1502
1503 attachment.Delete();
1504 }
1505 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const float DAMAGE_RUINED_VALUE
Definition constants.c:776
const float DAMAGE_DAMAGED_VALUE
Definition constants.c:774
const float DAMAGE_BADLY_DAMAGED_VALUE
Definition constants.c:775
const float DAMAGE_WORN_VALUE
Definition constants.c:773

Перекрестные ссылки Class::CastTo(), GameConstants::DAMAGE_BADLY_DAMAGED_VALUE, GameConstants::DAMAGE_DAMAGED_VALUE, GameConstants::DAMAGE_RUINED_VALUE, GameConstants::DAMAGE_WORN_VALUE, GetGame(), GameConstants::STATE_BADLY_DAMAGED, GameConstants::STATE_DAMAGED, GameConstants::STATE_RUINED и GameConstants::STATE_WORN.

◆ SanitizeString()

static string SanitizeString ( string input)
staticprotected
733 {
734 int max_length = 512;
735 string output = input;
736
737 output = output.Substring(0,Math.Clamp(max_length,0,output.Length()));
738 return output;
739 }
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.

Перекрестные ссылки Math::Clamp().

◆ SoakItemInsideParentContainingLiquidAboveThreshold()

static void SoakItemInsideParentContainingLiquidAboveThreshold ( notnull ItemBase item,
notnull ItemBase parent,
float liquidQuantityThresholdPercentage = 0.05 )
staticprotected
1672 {
1673 if (g_Game.IsServer())
1674 {
1675 if (parent.GetLiquidType() != 0 && parent.GetQuantityNormalized() > liquidQuantityThresholdPercentage)
1676 item.SetWetMax();
1677 }
1678 }

Перекрестные ссылки g_Game.

◆ SplitArrayIntoGroupsByDistance()

static void SplitArrayIntoGroupsByDistance ( array< Object > objects,
array< ref array< Object > > objectGroups,
float squaredDistanceDelta )
staticprotected
1257 {
1259 for ( int i = 0; i < objects.Count(); )
1260 {
1261 Object obj1 = objects[i];
1262 if ( obj1 )
1263 {
1264 group = new array<Object>;
1265 group.Insert(obj1);
1266 for ( int j = objects.Count() - 1; j > i; --j )
1267 {
1268 Object obj2 = objects[j];
1269 if ( obj1 && obj2 )
1270 {
1271 vector start = obj1.GetWorldPosition();
1272 vector end = obj2.GetWorldPosition();
1273
1276 {
1277 group.Insert(obj2);
1278 objects.Remove(j);
1279 }
1280 }
1281 }
1282 objectGroups.Insert(group);
1283 objects.Remove(i);
1284 continue;
1285 }
1286 ++i;
1287 }
1288 }

Перекрестные ссылки vector::DistanceSq().

Используется в FilterObstructedObjectsByGrouping().

◆ TeleportCheck()

static void TeleportCheck ( notnull PlayerBase player,
notnull array< ref array< float > > safe_positions )
staticprotected

checks if we should teleport the player to a safe location and if so, performs the teleportation

1509 {
1510 if( player.GetSimulationTimeStamp() < 20 && !player.IsPersistentFlag(PersistentFlag.AREA_PRESENCE) )
1511 {
1512 //simulation time is bellow a threshold, which means the player has recently connected,
1513 //the player does not have the AREA_PRESENCE flag set, which means they were not inside the area when they disconnected,
1514 //that means they just spawned into a contaminated area, lets move them somewhere safe
1515 vector player_pos = player.GetPosition();
1517
1519 {
1521
1522 player.SetPosition( closest_safe_pos );//...so lets teleport them somewhere safe
1523 //DeveloperTeleport.SetPlayerPosition(player, closest_safe_pos);
1524 GetGame().RPCSingleParam(player, ERPCs.RPC_WARNING_TELEPORT, null, true, player.GetIdentity());
1525 }
1526
1527 player.SetPersistentFlag(PersistentFlag.AREA_PRESENCE, false);
1528 }
1529 }
ERPCs
Definition ERPCs.c:2
PersistentFlag
Definition PersistentFlag.c:6

Перекрестные ссылки GetGame().

◆ ThrowAllItemsInInventory()

static void ThrowAllItemsInInventory ( notnull EntityAI parent,
int flags )
staticprotected
973 {
974 vector position = parent.GetPosition();
975 vector orientation = parent.GetOrientation();
977 float direction[4];
978
979 vector minmax[2];
980 parent.GetCollisionBox(minmax);
981
984
986 for ( int i = 0; i < parent.GetInventory().AttachmentCount(); ++i )
987 {
989 position[1] + Math.RandomFloat(minmax[0][1], minmax[1][1]),
990 position[2] + Math.RandomFloat(minmax[0][2], minmax[1][2]));
991
992 ThrowEntityFromInventory(parent.GetInventory().GetAttachmentFromIndex( i ), randomPos, direction, -GetVelocity(parent), ThrowEntityFlags.NONE);
993 }
994
995 for ( int j = 0; j < parent.GetInventory().GetCargo().GetItemCount(); ++j )
996 {
998 position[1] + Math.RandomFloat(minmax[0][1], minmax[1][1]),
999 position[2] + Math.RandomFloat(minmax[0][2], minmax[1][2]));
1000
1001 ThrowEntityFromInventory(parent.GetInventory().GetCargo().GetItem( j ), randomPos, direction, -GetVelocity(parent), ThrowEntityFlags.NONE);
1002 }
1003 }
ThrowEntityFlags
Definition MiscGameplayFunctions.c:208
static void ThrowEntityFromInventory(notnull EntityAI entity, vector position, float direction[4], vector force, int flags)
Definition MiscGameplayFunctions.c:1005
static proto void MatrixToQuat(vector mat[3], out float d[4])
Converts rotation matrix to quaternion.
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.

Перекрестные ссылки GetVelocity(), Math3D::MatrixToQuat(), Math::RandomFloat(), ThrowEntityFromInventory(), Vector() и Math3D::YawPitchRollMatrix().

◆ ThrowEntityFromInventory()

static void ThrowEntityFromInventory ( notnull EntityAI entity,
vector position,
float direction[4],
vector force,
int flags )
staticprotected
1006 {
1008 if ( !GetGame().IsMultiplayer() )
1009 invMode = InventoryMode.LOCAL;
1010
1012 if (CastTo(entityIB, entity))
1013 {
1015 dst.SetGroundEx(entity, position, direction);
1016
1017 if ( (flags & ThrowEntityFlags.SPLIT) && entityIB.CanBeSplit() )
1018 {
1019 for (int l = 0; l < entityIB.GetQuantity(); ++l)
1020 {
1022
1023 if ( new_item )
1024 {
1025 MiscGameplayFunctions.TransferItemProperties(entityIB, new_item);
1026 entityIB.AddQuantity( -1 );
1027 new_item.SetQuantity( 1 );
1028 new_item.ThrowPhysically(null, force, false);
1029 }
1030 }
1031 }
1032 else
1033 {
1034 float stackable = entityIB.GetTargetQuantityMax();
1035 if ( !(stackable == 0 || stackable >= entityIB.GetQuantity()) )
1036 {
1037 while (entityIB.GetQuantity() > stackable)
1038 {
1040 position[1] = position[1] + 0.1;
1041 spltDst.SetGroundEx(entity, position, direction);
1042
1043 ItemBase splitItem = entityIB.SplitIntoStackMaxToInventoryLocationEx( spltDst );
1044 splitItem.ThrowPhysically(null, force, false);
1045 }
1046 }
1047
1049 entity.GetInventory().GetCurrentInventoryLocation(src);
1050
1051 entity.GetInventory().TakeToDst(invMode, src, dst);
1052 entityIB.ThrowPhysically(null, force, false);
1053 }
1054 }
1055 else
1056 {
1057 entity.GetInventory().DropEntity(invMode, entity.GetHierarchyRoot(), entity);
1059 }
1060 }
const int ECE_NONE
Definition CentralEconomy.c:7
const int RF_DEFAULT
Definition CentralEconomy.c:65
static proto native EntityAI LocationCreateEntity(notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
creates new item directly at location
proto void dBodyApplyImpulse(notnull IEntity body, vector impulse)
Applies impuls on a rigidbody (origin)

Перекрестные ссылки dBodyApplyImpulse(), ECE_NONE, GetGame(), GameInventory::LocationCreateEntity() и RF_DEFAULT.

Используется в ThrowAllItemsInInventory().

◆ TransferInventory()

static TransferInventoryResult TransferInventory ( EntityAI sourceItem,
EntityAI targetItem,
PlayerBase player )
staticprotected
331 {
333
335 sourceItem.GetInventory().EnumerateInventory(InventoryTraversalType.LEVELORDER, children);
336 int count = children.Count();
337 for (int i = 0; i < count; i++)
338 {
339 EntityAI child = children.Get(i);
340 if (child)
341 {
343 child.GetInventory().GetCurrentInventoryLocation( child_src );
344
346 child_dst.Copy( child_src );
347 child_dst.SetParent( targetItem );
348
349 bool drop = false;
350
352 {
353 // try to move it to the same exact place in dst
354 targetItem.GetInventory().TakeToDst(InventoryMode.LOCAL, child_src, child_dst);
355 }
356 else
357 {
358 drop = true; // or drop otherwise
359 }
360
361 if (drop)
362 {
363 player.LocalDropEntity(child);
364 GetGame().RemoteObjectTreeCreate(child);
365 result = TransferInventoryResult.DroppedSome;
366 }
367 }
368 }
369 return result;
370 }
TransferInventoryResult
Definition MiscGameplayFunctions.c:203
static proto native bool LocationCanAddEntity(notnull InventoryLocation inv_loc)
queries if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/....

Перекрестные ссылки GetGame() и GameInventory::LocationCanAddEntity().

◆ TransferItemProperties()

static void TransferItemProperties ( EntityAI source,
notnull EntityAI target,
bool transfer_agents = true,
bool transfer_variables = true,
bool transfer_health = true,
bool exclude_quantity = false )
staticprotected

will transform item' variables, agents and other local scripted properties as well as any relevant non-scripted properties like health

270 {
273
274 if( transfer_agents ) target_ib.TransferAgents( source.GetAgents() );
275
277 {
279 }
280
281 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
282 {
283 if( transfer_health )
284 target_ib.SetHealth01("", "", source.GetHealth01("",""));
285 }
286 }

Перекрестные ссылки GetGame().

◆ TransferItemVariables()

static void TransferItemVariables ( ItemBase source,
ItemBase target,
bool exclude_quantity = false )
staticprotected
289 {
290 target.TransferVariablesFloat( source.GetVariablesFloat() );
291 //target.TransferVariablesString( source.GetVariablesString() );
292 if ( exclude_quantity )
293 {
294 target.RemoveItemVariable(VARIABLE_QUANTITY);
295 }
296 else if ( source.IsMagazine() && target.IsMagazine() )
297 {
300
301 target_mag.ServerSetAmmoCount( source_mag.GetAmmoCount() );
302 }
303
304 if ( source.IsWeapon() && target.IsWeapon() )
305 {
308
309 target_wpn.CopyWeaponStateFrom(source_wpn);
310 }
311 else if ( source.HasEnergyManager() && target.HasEnergyManager() )
312 {
313 ComponentEnergyManager ems = source.GetCompEM();
314 ComponentEnergyManager emt = target.GetCompEM();
315
316 emt.SetEnergy(ems.GetEnergy());
317
318 if (ems.IsSwitchedOn())
319 emt.SwitchOn();
320 }
321 else if ( source.CanDecay() && target.CanDecay() )
322 {
325
326 target_edb.TransferFoodStage(source_edb);
327 }
328 }
Definition ComponentEnergyManager.c:19
Definition Edible_Base.c:2
shorthand
Definition BoltActionRifle_Base.c:6
const int VARIABLE_QUANTITY
Definition constants.c:582

Перекрестные ссылки VARIABLE_QUANTITY.

◆ TransformRestrainItem()

static void TransformRestrainItem ( EntityAI current_item,
EntityAI tool,
PlayerBase player_source,
PlayerBase player_target,
bool destroy = false )
staticprotected
664 {
665 bool type;
666
667 if ( tool )
668 {
669 //is unrestrain and not struggle
670 type = tool.ConfigGetBool("RestrainUnlockType");
671 }
672 string new_item_name = current_item.ConfigGetString( "OnRestrainChange");
673
674 if ( new_item_name != "" )
675 {
676 if ( player_target )
677 {
678 if (player_target.IsAlive())
680 else
682 }
683 else
684 {
686 }
687 }
688 else
689 {
690 Error("current_item:" +current_item+ ", tool:" +tool +". No value for 'OnRestrainChange' config parameter");
691 }
692 }
Definition MiscGameplayFunctions.c:1682
Definition ActionUnrestrainTarget.c:174

Перекрестные ссылки Error().

◆ Truncate()

enum ThrowEntityFlags Truncate ( float value,
int decimals = 2 )
protected

truncate float to specified precision

217 {
218 int multiplier = Math.Pow(10,decimals);
219 return Math.Clamp(Math.Floor(value * multiplier),float.LOWEST, float.MAX) / multiplier;
220 }
static proto float Pow(float v, float power)
Return power of v ^ power.

Используется в TruncateToS().

◆ TruncateToS()

static string TruncateToS ( float value,
int decimals = 2 )
staticprotected

truncate float to specified precision, output as string

223 {
224 return Truncate(value, decimals).ToString();
225 }
enum ThrowEntityFlags Truncate(float value, int decimals=2)
truncate float to specified precision
Definition MiscGameplayFunctions.c:216

Перекрестные ссылки Truncate().

◆ TruncateVec()

static vector TruncateVec ( vector value,
int decimals = 2 )
staticprotected

truncate float to specified precision

228 {
229 int multiplier = Math.Pow(10,decimals);
230 float v1 = Math.Clamp(Math.Floor(value[0] * multiplier),float.LOWEST, float.MAX) / multiplier;
231 float v2 = Math.Clamp(Math.Floor(value[1] * multiplier),float.LOWEST, float.MAX) / multiplier;
232 float v3 = Math.Clamp(Math.Floor(value[2] * multiplier),float.LOWEST, float.MAX) / multiplier;
233 return Vector(v1,v2,v3);
234 }

Перекрестные ссылки Math::Clamp(), Math::Floor(), Math::Pow() и Vector().

◆ TruncateVecToS()

static string TruncateVecToS ( vector value,
int decimals = 2,
string delimiter = " " )
staticprotected
237 {
239 }

◆ TurnItemInHandsIntoItem()

static void TurnItemInHandsIntoItem ( notnull ItemBase old_item,
string new_item_type,
notnull PlayerBase player )
staticprotected
418 {
420 }
static void TurnItemInHandsIntoItemEx(notnull PlayerBase player, ReplaceItemWithNewLambdaBase lambda)
Definition MiscGameplayFunctions.c:422
Definition MiscGameplayFunctions.c:92

Перекрестные ссылки TurnItemInHandsIntoItemEx().

◆ TurnItemInHandsIntoItemEx()

static void TurnItemInHandsIntoItemEx ( notnull PlayerBase player,
ReplaceItemWithNewLambdaBase lambda )
staticprotected
423 {
424 player.ServerReplaceItemInHandsWithNew(lambda);
425 }

Используется в TurnItemInHandsIntoItem().

◆ TurnItemIntoItem()

static void TurnItemIntoItem ( notnull ItemBase old_item,
string new_item_type,
notnull PlayerBase player )
staticprotected
408 {
410 }
static void TurnItemIntoItemEx(notnull PlayerBase player, ReplaceItemWithNewLambdaBase lambda)
Definition MiscGameplayFunctions.c:412

Перекрестные ссылки TurnItemIntoItemEx().

◆ TurnItemIntoItemEx()

static void TurnItemIntoItemEx ( notnull PlayerBase player,
ReplaceItemWithNewLambdaBase lambda )
staticprotected
413 {
414 player.ServerReplaceItemWithNew(lambda);
415 }

Используется в TurnItemIntoItem().

◆ UndoRemoveNetworkObjectInfo()

void UndoRemoveNetworkObjectInfo ( )
protected
182 {
183 super.UndoRemoveNetworkObjectInfo();
184 GetGame().RemoteObjectTreeCreate(m_NewItem);
185 }

Перекрестные ссылки GetGame() и m_NewItem.

◆ UnlimitedAmmoDebugCheck()

static void UnlimitedAmmoDebugCheck ( Weapon_Base weapon)
staticprotected
373 {
374 if ( ItemBase.GetDebugActionsMask() & DebugActionType.UNLIMITED_AMMO )
375 {
377 if ( GetGame().IsServer() )
378 {
379 magazine = weapon.GetMagazine(weapon.GetCurrentMuzzle());
380
381 if (magazine)
382 {
383 if (magazine.GetAmmoCount() <= 5)
384 {
385 magazine.ServerSetAmmoMax();
386 }
387 }
388 }
389 else
390 {
391 magazine = weapon.GetMagazine(weapon.GetCurrentMuzzle());
392
393 if (magazine)
394 {
395 if (magazine.GetAmmoCount() <= 5)
396 {
397 magazine.LocalSetAmmoMax();
398 }
399 }
400
401 }
402 }
403 }
DebugActionType
Definition PluginDiagMenu.c:7

Перекрестные ссылки GetGame().

◆ ValueToBar()

static string ValueToBar ( float value,
string bar = "[----------]",
string mark = "x" )
staticprotected

Produces ACII "progress bar" based on an 0..1 'value' input.

248 {
249 int length = bar.Length() - 2;
250 float index = Math.Lerp(0,length, value);
253
254 return InsertAtPos(bar,mark,index);
255 }
static string InsertAtPos(string base, string insert, int pos)
Insert 'insert' behind index 'pos' of the 'base' string.
Definition MiscGameplayFunctions.c:258
static proto float Round(float f)
Returns mathematical round of value.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.

Перекрестные ссылки Math::Clamp(), InsertAtPos(), Math::Lerp() и Math::Round().

Переменные

◆ ContactComponent

int ContactComponent = -1
protected

Используется в ClearCache().

◆ HitObjects

ref set<Object> HitObjects = new set<Object>
protected

Используется в ClearCache().

◆ HitProxyObjects

ref array<ref RaycastRVResult> HitProxyObjects = new array<ref RaycastRVResult>
protected

Используется в ClearCache().

◆ m_NewItem

◆ m_Player

◆ NONE

@ NONE = 0

◆ ObjectCenterPos

vector ObjectCenterPos = "0 0 0"
protected

Используется в ClearCache().

◆ ObjectContactDir

vector ObjectContactDir = "0 0 0"
protected

Используется в ClearCache().

◆ ObjectContactPos

vector ObjectContactPos = "0 0 0"
protected

Используется в ClearCache().

◆ RaycastStart

DestroyItemInCorpsesHandsAndCreateNewOnGndLambda RaycastStart = "0 0 0"
protected

Используется в IsObjectObstructedCache().

◆ SPLIT

SPLIT = 1

◆ TotalObjects

int TotalObjects = 0
protected

Используется в IsObjectObstructedCache().