17 proto native
void SetNextChannel();
18 proto native
void SetPrevChannel();
19 proto native
float GetTunedFrequency();
20 proto native
void EnableBroadcast(
bool state);
21 proto native
void EnableReceive(
bool state);
22 proto native
bool IsBroadcasting();
23 proto native
bool IsReceiving();
24 proto native
int GetTunedFrequencyIndex();
25 proto native
void SetFrequencyByIndex(
int index);
48 class UnderSlugLauncher
extends Weapon
62 super.OnInventoryEnter(player);
65 if ( pb && IsTurnedOn() )
67 pb.MapNavigationItemInPossession(
this);
73 super.OnInventoryExit(player);
78 pb.MapNavigationItemNotInPossession(
this);
84 super.OnWasAttached(parent, slot_id);
87 if ( parent.GetHierarchyRoot() )
89 player =
PlayerBase.Cast(parent.GetHierarchyRoot());
92 if ( player && IsTurnedOn() )
94 player.MapNavigationItemInPossession(
this);
100 super.OnWasDetached(parent, slot_id);
103 if ( parent.GetHierarchyRoot() )
105 player =
PlayerBase.Cast(parent.GetHierarchyRoot());
110 player.MapNavigationItemNotInPossession(
this);
120 super.OnInventoryEnter(player);
130 pb.MapNavigationItemInPossession(
this);
136 super.OnInventoryExit(player);
146 pb.MapNavigationItemNotInPossession(
this);
152 super.OnWasAttached(parent, slot_id);
160 if ( parent.GetHierarchyParent() )
162 player =
PlayerBase.Cast(parent.GetHierarchyParent());
167 player.MapNavigationItemInPossession(
this);
173 super.OnWasDetached(parent, slot_id);
181 if ( parent.GetHierarchyParent() )
183 player =
PlayerBase.Cast(parent.GetHierarchyParent());
188 player.MapNavigationItemNotInPossession(
this);
196 protected string m_AttachSound =
"Offroad_Wheel_Attach_SoundSet";
197 protected string m_DetachSound =
"Offroad_Wheel_Remove_SoundSet";
203 proto native
float GetWidth();
205 override bool DisplayNameRuinAttach()
217 super.EEHealthLevelChanged(oldLevel, newLevel, zone);
221 string newWheel =
"";
224 case "HatchbackWheel":
225 newWheel =
"HatchbackWheel_Ruined";
228 case "CivSedanWheel":
229 newWheel =
"CivSedanWheel_Ruined";
232 case "Hatchback_02_Wheel":
233 newWheel =
"Hatchback_02_Wheel_Ruined";
236 case "Sedan_02_Wheel":
237 newWheel =
"Sedan_02_Wheel_Ruined";
240 case "Truck_01_Wheel":
241 newWheel =
"Truck_01_Wheel_Ruined";
244 case "Truck_01_WheelDouble":
245 newWheel =
"Truck_01_WheelDouble_Ruined";
248 case "Offroad_02_Wheel":
249 newWheel =
"Offroad_02_Wheel_Ruined";
256 if (IsLockedInSlot())
264 GetTransform(matrix);
270 lambda.SetTransferParams(
true,
true,
true);
271 GetInventory().ReplaceItemWithNew(
InventoryMode.SERVER, lambda);
276 override int GetMeleeTargetType()
290 super.OnWasAttached(parent, slot_id);
294 effect.SetAutodestroy(
true);
300 super.OnWasDetached(parent, slot_id);
304 effect.SetAutodestroy(
true);
311 override bool CanPutAsAttachment(
EntityAI parent)
314 if (parent.IsInherited(
Transport) && parent.IsRuined())
317 if (GetInventory().GetCurrentInventoryLocation(loc))
325 if (!super.CanPutAsAttachment(parent))
331 override void EEHealthLevelChanged(
int oldLevel,
int newLevel,
string zone)
333 super.EEHealthLevelChanged( oldLevel, newLevel, zone );
338 string newWheel =
"";
341 case "HatchbackWheel_Ruined":
342 newWheel =
"HatchbackWheel";
345 case "CivSedanWheel_Ruined":
346 newWheel =
"CivSedanWheel";
349 case "Hatchback_02_Wheel_Ruined":
350 newWheel =
"Hatchback_02_Wheel";
353 case "Sedan_02_Wheel_Ruined":
354 newWheel =
"Sedan_02_Wheel";
357 case "Truck_01_Wheel_Ruined":
358 newWheel =
"Truck_01_Wheel";
361 case "Truck_01_WheelDouble_Ruined":
362 newWheel =
"Truck_01_WheelDouble";
365 case "Offroad_02_Wheel_Ruined":
366 newWheel =
"Offroad_02_Wheel";
373 if (IsLockedInSlot())
377 lambda.SetTransferParams(
true,
true,
true);
378 GetInventory().ReplaceItemWithNew(
InventoryMode.SERVER, lambda);
395 return m_OldItem !=
null;
400 super.CopyOldPropertiesToNew(old_item, new_item);
401 m_oldOri = old_item.GetOrientation();
406 super.OnSuccess(new_item);
416 class Sedan_02_Wheel
extends CarWheel {};
419 class HatchbackWheel
extends CarWheel {};
422 class CivSedanWheel
extends CarWheel {};
425 class Truck_01_Wheel
extends CarWheel {};
428 class Truck_01_WheelDouble
extends CarWheel {};
431 class Offroad_02_Wheel
extends CarWheel {};
437 override bool CanDetachAttachment(
EntityAI parent)
441 bool isPresent = GetInventory().GetCurrentInventoryLocation( loc );
443 if ( !isPresent || loc.GetSlot() == -1 )
454 override int GetMeleeTargetType()
461 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
469 PlaySoundSet( sound_plug,
"offroad_hit_window_small_SoundSet", 0, 0 );
475 override bool DisplayNameRuinAttach()
485 override void SetActions()
525 class Sedan_02_Door_1_1_YellowRust
extends CarDoor {};
526 class Sedan_02_Door_1_2_YellowRust
extends CarDoor {};
527 class Sedan_02_Door_2_1_YellowRust
extends CarDoor {};
528 class Sedan_02_Door_2_2_YellowRust
extends CarDoor {};
529 class Sedan_02_Hood_YellowRust
extends CarDoor {};
530 class Sedan_02_Trunk_YellowRust
extends CarDoor {};
663 class Offroad_02_Door_1_1
extends CarDoor {};
664 class Offroad_02_Door_1_2
extends CarDoor {};
665 class Offroad_02_Door_2_1
extends CarDoor {};
666 class Offroad_02_Door_2_2
extends CarDoor {};
667 class Offroad_02_Trunk
extends CarDoor {};
669 class Offroad_02_Hood
extends CarDoor
680 class Offroad_02_Door_1_1_Rust
extends CarDoor {};
681 class Offroad_02_Door_1_2_Rust
extends CarDoor {};
682 class Offroad_02_Door_2_1_Rust
extends CarDoor {};
683 class Offroad_02_Door_2_2_Rust
extends CarDoor {};
684 class Offroad_02_Trunk_Rust
extends CarDoor {};
689 override bool DisplayNameRuinAttach()
704 EntityAI parent = GetHierarchyParent();
706 Class.CastTo( car, parent );
711 float amount = car.GetFluidFraction(
CarFluid.COOLANT );
712 float newAmount =
Math.RandomFloat( amount * 0.2, amount * 0.75 );
714 car.Leak(
CarFluid.COOLANT, newAmount );
750 class BrakeFluid
extends ItemBase {};
762 class TireRepairKit
extends ItemBase {};
766 override bool DisplayNameRuinAttach()
782 class WindscreenBox
extends ItemBase {};
797 override bool DisplayNameRuinAttach()
820 float m_ItemVisibilityModifier;
824 m_ItemVisibilityModifier = ConfigGetFloat(
"visibilityModifier");
829 HandleVoiceEffect(
false,
PlayerBase.Cast(GetHierarchyRootPlayer()));
832 override bool IsClothing()
837 float GetItemVisibility()
839 return m_ItemVisibilityModifier;
842 void UpdateNVGStatus(
PlayerBase player,
bool attaching =
false,
bool force_disable =
false)
844 NVGoggles NVGAttachment;
845 NVGAttachment = NVGoggles.Cast(FindAttachmentBySlotName(
"NVG"));
847 for (
int i = 0; i < GetInventory().GetAttachmentSlotsCount(); i++)
849 has_nvg_slot = GetInventory().GetAttachmentSlotId(i) ==
InventorySlots.GetSlotIdFromString(
"NVG");
854 if ( player && has_nvg_slot )
858 NVGAttachment.LoweredCheck();
860 if ( attaching && NVGAttachment.m_Strap && NVGAttachment.m_IsLowered )
862 NVGAttachment.SetPlayer(player);
863 player.SetNVGLowered(
true);
865 if ( player.IsControlledPlayer() )
867 if ( NVGAttachment.IsWorking() )
869 player.AddActiveNV(
NVTypes.NV_GOGGLES);
875 player.RemoveActiveNV(
NVTypes.NV_GOGGLES);
881 NVGAttachment.SetPlayer(
null);
882 player.SetNVGLowered(
false);
884 if ( player.IsControlledPlayer() )
886 player.RemoveActiveNV(
NVTypes.NV_GOGGLES);
891 else if ( player.IsNVGWorking() && force_disable )
893 player.SetNVGLowered(
false);
895 if ( player.IsControlledPlayer() )
897 player.RemoveActiveNV(
NVTypes.NV_GOGGLES);
906 super.OnWasAttached(parent, slot_id);
909 HandleVoiceEffect(
true,
PlayerBase.Cast(GetHierarchyRootPlayer()));
914 super.OnWasDetached(parent, slot_id);
916 HandleVoiceEffect(
false,
PlayerBase.Cast(parent));
920 bool IsObstructingVoice()
927 void MutePlayer(
PlayerBase player,
bool state)
930 if (
GetGame() && player.GetIdentity() !=
null)
932 GetGame().SetVoiceEffect(player, GetVoiceEffect(), state);
938 void HandleVoiceEffect(
bool enable,
PlayerBase player)
940 if ( IsObstructingVoice() && player )
941 MutePlayer(player, enable);
974 proto native
bool SetPinned ();
979 proto native
bool SetUnpinned ();
984 proto native
bool SetIgnited ();
988 proto native
bool IsPinned ();
992 proto native
bool IsActivated ();
1003 string m_TextureClosed;
1004 string m_TextureOpened;
1005 string m_TextureLegend;
1006 string m_DisplayName;
1016 string path =
"CfgWorlds " +
GetGame().GetWorldName();
1018 GetGame().ConfigGetText(
path +
" mapDisplayNameKey",m_DisplayName);
1020 GetGame().ConfigGetText(
path +
" mapTextureClosed",m_TextureClosed);
1021 GetGame().ConfigGetText(
path +
" mapTextureOpened",m_TextureOpened);
1022 GetGame().ConfigGetText(
path +
" mapTextureLegend",m_TextureLegend);
1024 SetObjectTexture(0,m_TextureClosed);
1025 SetObjectTexture(1,m_TextureOpened);
1026 SetObjectTexture(2,m_TextureLegend);
1038 super.OnItemLocationChanged(old_owner,new_owner);
1040 SetMapStateOpen(
false,
PlayerBase.Cast(old_owner));
1044 void SetMapStateOpen(
bool state,
PlayerBase player)
1048 player.SetMapOpen(state);
1050 player.OnItemInHandsChanged();
1055 ShowSelection(
"map_opened");
1056 HideSelection(
"map_closed");
1060 ShowSelection(
"map_closed");
1061 HideSelection(
"map_opened");
1065 bool GetMapStateAnimation()
1067 if (GetAnimationPhase(
"map_opened") == 0)
1072 void SyncMapMarkers()
1074 if (m_MapMarkerArray.Count() <= 0)
1079 Param1<ref array<ref MapMarker>> params =
new Param1<ref array<ref MapMarker>>( m_MapMarkerArray );
1081 if (
GetGame().IsServer() && GetHierarchyRootPlayer())
1083 pid = GetHierarchyRootPlayer().GetIdentity();
1084 RPCSingleParam(
ERPCs.RPC_SEND_MAP_MARKERS,params,
true,pid);
1088 RPCSingleParam(
ERPCs.RPC_SEND_MAP_MARKERS,params,
true);
1094 super.OnRPC(sender, rpc_type, ctx);
1098 Param1<ref array<ref MapMarker>> params =
new Param1<ref array<ref MapMarker>>( m_MapMarkerArray );
1100 if (rpc_type ==
ERPCs.RPC_SEND_MAP_MARKERS)
1102 if (ctx.Read(params))
1111 if ( !super.OnStoreLoad(ctx, version) )
1114 if (version >= 108 && !ctx.Read(m_MapMarkerArray))
1123 super.OnStoreSave(ctx);
1125 ctx.Write(m_MapMarkerArray);
1128 override bool NameOverride(out
string output)
1130 output = m_DisplayName;
1135 override bool DescriptionOverride(out
string output)
1142 void InsertMarker(
vector pos,
string text,
int color,
int idx)
1145 m_MapMarkerArray.Insert(marker);
1150 return m_MapMarkerArray;
1156 protected vector m_Position;
1157 protected int m_Color;
1158 protected int m_IconIdx;
1159 protected string m_Text;
1174 string GetMarkerText()
1179 int GetMarkerColor()