| class FenceKit extends KitBase |
| { |
| override bool CanReceiveAttachment(EntityAI attachment, int slotId) |
| { |
| if ( !super.CanReceiveAttachment(attachment, slotId) ) |
| return false; |
| |
| ItemBase att = ItemBase.Cast(GetInventory().FindAttachment(slotId)); |
| if (att) |
| return false; |
| |
| return true; |
| } |
|
|
| |
| |
| |
| |
| override void OnPlacementComplete( Man player, vector position = "0 0 0", vector orientation = "0 0 0" ) |
| { |
| super.OnPlacementComplete( player, position, orientation ); |
| |
| if ( GetGame().IsServer() ) |
| { |
| |
| |
| Fence fence = Fence.Cast( GetGame().CreateObjectEx( "Fence", GetPosition(), ECE_PLACE_ON_SURFACE ) ); |
| fence.SetPosition( position ); |
| fence.SetOrientation( orientation ); |
| |
| |
| HideAllSelections(); |
| |
| SetIsDeploySound( true ); |
| } |
| } |
| |
| override bool DoPlacingHeightCheck() |
| { |
| return true; |
| } |
| |
| override float HeightCheckOverride() |
| { |
| return 2.54; |
| } |
| |
| override void DisassembleKit(ItemBase item) |
| { |
| if (!IsHologram()) |
| { |
| ItemBase stick = ItemBase.Cast(GetGame().CreateObjectEx("WoodenStick",GetPosition(),ECE_PLACE_ON_SURFACE)); |
| MiscGameplayFunctions.TransferItemProperties(this, stick); |
| stick.SetQuantity(2); |
| Rope rope = Rope.Cast(item); |
| CreateRope(rope); |
| } |
| } |
| |
| |
| override void OnDebugSpawn() |
| { |
| SpawnEntityOnGroundPos("Shovel", GetPosition()); |
| SpawnEntityOnGroundPos("Hammer", GetPosition()); |
| SpawnEntityOnGroundPos("Hammer", GetPosition()); |
| SpawnEntityOnGroundPos("Pliers", GetPosition()); |
|
|
| SpawnEntityOnGroundPos("WoodenLog", GetPosition()); |
| SpawnEntityOnGroundPos("WoodenLog", GetPosition()); |
| SpawnEntityOnGroundPos("Nail", GetPosition()); |
| SpawnEntityOnGroundPos("CamoNet", GetPosition()); |
| SpawnEntityOnGroundPos("BarbedWire", GetPosition()); |
| SpawnEntityOnGroundPos("BarbedWire", GetPosition()); |
| SpawnEntityOnGroundPos("MetalWire", GetPosition()); |
| SpawnEntityOnGroundPos("CombinationLock", GetPosition()); |
| SpawnEntityOnGroundPos("WoodenPlank", GetPosition()); |
| SpawnEntityOnGroundPos("WoodenPlank", GetPosition()); |
| SpawnEntityOnGroundPos("WoodenPlank", GetPosition()); |
| SpawnEntityOnGroundPos("WoodenPlank", GetPosition()); |
| } |
| } |
|
|