3 typename ATTACHMENT_BARBED_WIRE = BarbedWire;
4 typename ATTACHMENT_CAMONET =
CamoNet;
6 const float MAX_FLOOR_VERTICAL_DISTANCE = 0.5;
8 const float MIN_ACTION_DETECTION_ANGLE_RAD = 0.35;
9 const float MAX_ACTION_DETECTION_DISTANCE = 2.0;
11 static const string BASE_VIEW_NAME =
"level_";
12 static const string BASE_WALL_NAME =
"_wall_";
13 static const string BASE_ROOF_NAME =
"_roof";
14 static const int MAX_WATCHTOWER_FLOORS = 3;
15 static const int MAX_WATCHTOWER_WALLS = 3;
23 return "WatchtowerKit";
46 super.UpdateVisuals();
48 SetAnimationPhase(
"level_1", 0);
49 SetAnimationPhase(
"level_1_wall_1", 0);
50 SetAnimationPhase(
"level_1_wall_2", 0);
51 SetAnimationPhase(
"level_1_wall_3", 0);
68 SetAnimationPhase(BASE_VIEW_NAME + (
i + 1), 0);
69 for (
int j = 1;
j < MAX_WATCHTOWER_WALLS + 1; ++
j)
73 SetAnimationPhase(BASE_VIEW_NAME + (
i + 1) + BASE_WALL_NAME +
j, 0);
78 SetAnimationPhase(BASE_VIEW_NAME + (
i + 1), 1);
79 for (
j = 1;
j < MAX_WATCHTOWER_WALLS + 1; ++
j)
83 SetAnimationPhase(BASE_VIEW_NAME + (
i + 1) + BASE_WALL_NAME +
j, 1);
98 if (!
GetGame().IsDedicatedServer())
153 min_max[0] = GetMemoryPointPos(
"level_2_wall_1_down_min");
154 min_max[1] = GetMemoryPointPos(
"level_2_roof_max");
156 else if (
partName ==
"level_3_base")
158 min_max[0] = GetMemoryPointPos(
"level_3_wall_1_down_min");
159 min_max[1] = GetMemoryPointPos(
"level_3_wall_2_up_max");
161 else if (
partName ==
"level_3_roof")
163 min_max[0] = GetMemoryPointPos(
"level_3_roof_min");
164 min_max[1] = GetMemoryPointPos(
"level_3_roof_max");
170 min_max[0] = GetMemoryPointPos(
"level_1_collisioncheck_min");
171 min_max[1] = GetMemoryPointPos(
"level_1_roof_max");
186 if (Building.Cast(
o))
321 if (MemoryPointExists(selection))
322 pos = ModelToWorld(GetMemoryPointPos(selection));
351 super.AfterStoreLoad();
389 ref_pos = ModelToWorld(GetMemoryPointPos(selection));
428 if (MemoryPointExists(selection))
430 ref_pos = ModelToWorld(GetMemoryPointPos(selection));
462 min = -GetMemoryPointPos(
"interact_min");
463 max = -GetMemoryPointPos(
"interact_max");
486 if (MemoryPointExists(selection))
490 if (
distance >= MAX_ACTION_DETECTION_DISTANCE)
537 super.OnDebugSpawn();
542 GetInventory().CreateInInventory(
"CamoNet");
546 BarbedWire
wire = BarbedWire.Cast(GetInventory().CreateInInventory(
"BarbedWire"));
547 wire.SetMountedState(
true);
ActionFoldBaseBuildingObjectCB ActionContinuousBaseCB ActionFoldBaseBuildingObject()
void AddAction(typename actionName)
Construction GetConstruction()
class JsonUndergroundAreaTriggerData GetPosition
override bool CanDisplayAttachmentCategory(string category_name)
override void OnDebugSpawn()
override bool IsPlayerInside(PlayerBase player, string selection)
override bool CanDisplayAttachmentSlot(int slot_id)
override string GetConstructionKitType()
static const int MAX_WATCHTOWER_WALLS
override bool CheckLevelVerticalDistance(float max_dist, string selection, PlayerBase player)
override bool CanPutIntoHands(EntityAI parent)
override array< string > OnDebugSpawnBuildExcludes()
Excludes certain parts from being built by OnDebugSpawn, uses Contains to compare.
override void UpdateVisuals()
override bool PerformRoofCheckForBase(string partName, PlayerBase player, out bool result)
override void OnPartBuiltServer(notnull Man player, string part_name, int action_id)
override void SetActions()
override bool CheckSlotVerticalDistance(int slot_id, PlayerBase player)
override bool IsFacingCamera(string selection)
override bool IsFacingPlayer(PlayerBase player, string selection)
override void AfterStoreLoad()
override int GetMeleeTargetType()
override bool HasProperDistance(string selection, PlayerBase player)
override void OnPartDestroyedServer(Man player, string part_name, int action_id, bool destroyed_by_connected_part=false)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanBeRepairedToPristine()
static const int MAX_WATCHTOWER_FLOORS
override bool CheckMemoryPointVerticalDistance(float max_dist, string selection, PlayerBase player)
static const string BASE_ROOF_NAME
override void OnPartDismantledServer(notnull Man player, string part_name, int action_id)
static bool GetDisablePerformRoofCheck()
provides access to slot configuration
static proto native owned string GetSlotName(int id)
converts slot_id to string
static proto bool GetSelectionForSlotId(int slot_Id, out string selection)
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto native CGame GetGame()
static proto float AbsFloat(float f)
Returns absolute value.
bool Contains(string sample)
Returns true if sample is substring of string.