// Base for all cash lootables
var lootableWadOfCash = { extend: userPickableItemBase, components: [
	{
		c: TransformComponent
	},
	{
		c: LootableComponent,
		d: {
			spawnWhenLooted: "getCash",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "wadCash",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 100,
			stackable: true,
			inventorySpriteName: "ui-base-icon-dollar",
			// Swap all lootables to pile of cash when put to inventory
			inventoryEntityDefinition: "lootablePileOfCash",
			removeAfterLevel: true,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemUsableCashWadA",
		}
	},
]};

var lootableMinimartCash = { extend: userPickableItemBase, components: [
	{
		c: TransformComponent
	},
	{
		c: LootableComponent,
		d: {
			spawnWhenLooted: "getCash",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "wadCash",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 100,
			stackable: true,
			inventorySpriteName: "ui-base-icon-dollar",
			// Swap all lootables to pile of cash when put to inventory
			inventoryEntityDefinition: "lootablePileOfCash",
			removeAfterLevel: true,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemUsableCashWadA",
		}
	},
]};

var lootableMinimartCashLot = { extend: lootableWadOfCash, components: [
	{
		c: ItemComponent,
		d: {
			name: "lotsCash",
			amount: 2500,
		}
	},
	{
		c: SpriteComponent,
		d: {
			name: "droppedCash",
		}
	},
]};

var lootablePileOfCash = { extend: userPickableItemBase, components: [
	{
		c: TransformComponent
	},
	{
		c: LootableComponent,
		d: {
			spawnWhenLooted: "getCash",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "pileCash",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 4800,
			stackable: true,
			inventorySpriteName: "ui-base-icon-dollar",
			removeAfterLevel: true,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemUsableCashWadA",
		}
	},
]};

var lootableDinerCash = { extend: userPickableItemBase, components: [
	{
		c: TransformComponent
	},
	{
		c: LootableComponent,
		d: {
			spawnWhenLooted: "getCash",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "pileCash",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 3500,
			stackable: true,
			inventorySpriteName: "ui-base-icon-dollar",
			removeAfterLevel: true,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "droppedCash",
		}
	},
]};

var lootableVanCash = { extend: userPickableItemBase, components: [
	{
		c: TransformComponent
	},
	{
		c: LootableComponent,
		d: {
			spawnWhenLooted: "getCash",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "pileCash",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 2000,
			stackable: true,
			inventorySpriteName: "ui-base-icon-dollar",
			removeAfterLevel: true,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "droppedCash",
		}
	},
]};

var truckloadOfGold = { extend: userPickableItemBase, components: [
	{
		c: TransformComponent
	},
	{
		c: LootableComponent,
		d: {
			spawnWhenLooted: "getCash",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "pileCash",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 1000000,
			stackable: true,
			inventorySpriteName: "ui-base-icon-dollar",
			removeAfterLevel: true,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "droppedCash",
		}
	},
]};

var lootableBitOfCash = { extend: lootableWadOfCash, components: [
	{
		c: ItemComponent,
		d: {
			amount: 20,
			removeAfterLevel: true,
		}
	},
]};

var dollarCoin = { extend: lootableWadOfCash, components: [
	{
		c: ItemComponent,
		d: {
			name: "coin",
			amount: 1,
		}
	},
	{
		c: SpriteComponent,
		d: {
			name: "itemUsableCashSingleA",
		}
	},
]};

var dollarBill = { extend: lootableWadOfCash, components: [
	{
		c: ItemComponent,
		d: {
			name: "singleBill",
			amount: 1,
		}
	},
	{
		c: SpriteComponent,
		d: {
			name: "itemUsableCashSingleB",
		}
	},
]};

var smallChange = { extend: lootableWadOfCash, components: [
	{
		c: ItemComponent,
		d: {
			name: "smallChange",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 50,
			stackable: true
		}
	},
	{
		c: SpriteComponent,
		d: {
			name: "itemUsableCashSingleB",
		}
	},
]};

var lootableRandomPileOfCash = { extend: lootableWadOfCash, components: [
	{
		c: ItemComponent,
		d: {
			name: "pileCash",
			amount: 500,
		}
	},
	{
		c: SpriteComponent,
		d: {
			name: "droppedCash",
		}
	},
]};

var theBigPrize = { extend: lootableWadOfCash, components: [
	{
		c: ItemComponent,
		d: {
			name: "bigPrize",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 5000,
			stackable: true
		}
	},
	{
		c: SpriteComponent,
		d: {
			name: "droppedCash",
		}
	},
]};

var stolenLoot = { extend: lootableWadOfCash, components: [
	{
		c: ItemComponent,
		d: {
			name: "stolenLoot",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 5000,
			stackable: false
		}
	},
	{
		c: SpriteComponent,
		d: {
			name: "droppedCash",
		}
	},
]};

var burnedPileOfCash = { components: [
	{
		c: TransformComponent,
	},
	{
		c: ColliderComponent,
		d: {
			width: 0.1,
			height: 0.1,
			collisionGroup: CollisionCategoryDefinitions.CC_LIGHT_DYNAMIC_OBSTACLE,
			collidesWith: [
				CollisionCategoryDefinitions.CC_CHARACTERS,
				CollisionCategoryDefinitions.CC_WALLS,
			],
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: true,
			density: 0.001,

		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_FLOOR_OBJECTS,
			sheet: "inventory",
			name: "droppedCash",
			tint: 0x1b0e06,
		}
	},
], children: [
	embers
]};

var flammablePileOfCash = { extend: lootableWadOfCash, components: [
	{
		c: ItemComponent,
		d: {
			name: "pileCash",
			type: "loot",
			lootable: false,
			equippable: false,
			amount: 100,
			stackable: true
		}
	},
	{
		c: ColliderComponent,
		d: {
			collisionGroup: CollisionCategoryDefinitions.CC_LIGHT_DYNAMIC_OBSTACLE,
			collidesWith: [
				CollisionCategoryDefinitions.CC_CHARACTERS,
				CollisionCategoryDefinitions.CC_WALLS,
				CollisionCategoryDefinitions.CC_BULLETS
			],
		}
	},
	{
		c: SpriteComponent,
		d: {
			name: "droppedCash",
		}
	},
	{
		c: HealthComponent,
		d: {
			currentHealth: 0.1,
			maxHealth: 0.1,

			spawnOnDamage: {
				base: ["fxHitElectric"],
			},
			spawnAsBody: {
				base: ["burnedPileOfCash"],
			},
		}
	},
]};

var lootableJewelsA = { extend: lootableWadOfCash, components: [
	{
		c: LootableComponent,
		d: {
			lootingTime: 0.1
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "cheapEarrings",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 50,
			stackable: false,
			respawnable: true,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemLootEarringsA",
			defaultAnimationName: "default",
		}
	},
]};

var lootableJewelsB = { extend: lootableWadOfCash, components: [
	{
		c: LootableComponent,
		d: {
			lootingTime: 0.1
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Cheap Necklace",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 50,
			stackable: false,
			respawnable: true,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemLootNecklaceA",
			defaultAnimationName: "default",
		}
	},
]};

var lootableJewelsC = { extend: lootableWadOfCash, components: [
	{
		c: LootableComponent,
		d: {
			lootingTime: 0.1
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "niceIshNecklace",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 100,
			stackable: false,
			respawnable: true,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemLootNecklaceB",
			defaultAnimationName: "default",
		}
	},
]};

var lootableTunaCans = { extend: userPickableItemBase, components: [
	{
		c: LootableComponent,
		d: {
			lootingTime: 0.5,
			spawnWhenLooted: "getCash",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Tuna",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 2,
			stackable: true,
			inventorySpriteName: "ui-base-icon-dollar",
			// Swap all lootables to pile of cash when put to inventory
			inventoryEntityDefinition: "lootablePileOfCash",
			removeAfterLevel: true,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemPickableTuna",
		}
	},
]};

var lootableCandyBars = { extend: userPickableItemBase, components: [
	{
		c: LootableComponent,
		d: {
			lootingTime: 0.5,
			spawnWhenLooted: "getCash",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Candy",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 1,
			stackable: true,
			inventorySpriteName: "ui-base-icon-dollar",
			// Swap all lootables to pile of cash when put to inventory
			inventoryEntityDefinition: "lootablePileOfCash",
			removeAfterLevel: true,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemPickableCandy",
		}
	},
]};

var lootableJunk = { extend: userPickableItemBase, components: [
	{
		c: ColliderComponent,
		d: {
			width: 1,
			height: 0.8
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false
		}
	},
	{
		c: LootableComponent,
		d: {
			lootingTime: 2,
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Useless Junk",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 5,
			stackable: true,
			inventorySpriteName: "ui-base-icon-dollar",
			// Swap all lootables to pile of cash when put to inventory
			inventoryEntityDefinition: "lootablePileOfCash",
		}
	},
	/*
	{
		c: SpriteComponent,
		d: {
			name: "junk",
		}
	},
	*/
]};

var lootableBeans = { extend: userPickableItemBase, components: [
	{
		c: ColliderComponent,
		d: {
			width: 0.8,
			height: 1
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false
		}
	},
	{
		c: LootableComponent,
		d: {
			lootingTime: 1,
			spawnWhenLooted: "getCash",
			inventorySpriteName: "ui-base-icon-dollar",
			// Swap all lootables to pile of cash when put to inventory
			inventoryEntityDefinition: "lootablePileOfCash",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Can of Beans",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 1,
			stackable: true,
			removeAfterLevel: true,
		}
	},
	/*
	{
		c: SpriteComponent,
		d: {
			name: "beans",
		}
	},
	*/
]};

var lootItem = { extend: lootableWadOfCash, components: [
	{
		c: ItemComponent,
		d: {
			name: "Loot",
			type: "loot",
			lootable: true,
			amount: 0,
			equippable: false,
			stackable: false,
			inventorySpriteName: "ui-base-icon-dollar",
			// Swap all lootables to pile of cash when put to inventory
			inventoryEntityDefinition: "lootablePileOfCash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "droppedCash"
		}
	},
]};

var cashieringHotspot = { extend: hotspotBase, components: [
	{
		c: TransformComponent,
		d: {
			y: 100 / 128,
			zIndex: 1
		}
	},
	{
		c: ColliderComponent,
		d: {
			radius: 0.2,
		}
	},
	{
		c: HotspotComponent,
		d: {
			name: "cashier",
			category: "cashier",
			facing: "180"
		}
	},
]};

var lootedCashRegister = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "cashRegisterStore",
			defaultAnimationName: "looted",
			loop: false,
		}
	},
	{
		c: TransformComponent
	},
], children: [
//	cashieringHotspot
]};

var lootableCashRegisterDestroyed = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "cashRegisterStore",
			defaultAnimationName: "destroyed",
			loop: false,
		}
	},
	{
		c: SuspicionIncreaserComponent,
		d:{
			increaseAmount: 1,
		}
	},
	{
		c: TransformComponent
	},
]};

var lootableCashRegisterBDestroyed = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "cashRegisterB",
			defaultAnimationName: "destroyed",
			loop: false,
		}
	},
	{
		c: SuspicionIncreaserComponent,
		d:{
			increaseAmount: 1,
		}
	},
	{
		c: TransformComponent
	},
]};

var lootableCashRegister = { components: [
	// PLACEHOLDER COLLIDER
	{
		c: ColliderComponent,
		d: {
			collisionGroup: CollisionCategoryDefinitions.CC_STATIC_OBSTACLE,
			collidesWith: [
				//CollisionCategoryDefinitions.CC_CHARACTERS,
				CollisionCategoryDefinitions.CC_WALLS,
				CollisionCategoryDefinitions.CC_DOORS,
				CollisionCategoryDefinitions.CC_STATIC_OBSTACLE,
				//CollisionCategoryDefinitions.CC_DYNAMIC_OBSTACLE,
				//CollisionCategoryDefinitions.CC_AI_PATH_GENERATION_RAY,
				//CollisionCategoryDefinitions.CC_PLANNING_TARGET,
				CollisionCategoryDefinitions.CC_BULLETS],
			senses: [CollisionCategoryDefinitions.CC_PLANNING_TARGET],
			width: 1 * 0.65,
			height: 1
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "cashRegisterStore",
			defaultAnimationName: "default",
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false,
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.attack, ActionDefinitions.shoot, ActionDefinitions.drill],
		}
	},
	{
		c: FieldOfViewMarkerComponent,
	},
	{
		c: InventoryComponent,
		d: {
			dropItemsWithinAngle: 60,
            dropItemsWithinRadius: 3,
			items: [
				smallChange,
				smallChange,
				smallChange
			]
		}
	},
	{
		c: HealthComponent,
		d: {
			currentHealth: 2,
			maxHealth: 2,
			spawnOnDamage: {
				base: ["fxHitElectric"],
			},
			spawnAsBody: {
				base: ["lootableCashRegisterDestroyed"],
			},
		}
	},
	{
		c: HealthBarComponent,
		d: {
			onlyDrawIfNotFull: true,
		}
	},
	{
		c: IndicatorComponent,
		d: {
			iconDefinition: indicatorIconBase,
			aboveTextDefinition: indicatorAboveBase,
			belowTextDefinition: indicatorBelowBase,
			overwriteAbove: "Cash register",
		}
	},
], children: [
//	cashieringHotspot
]};

var cashieringHotspotB = { extend: hotspotBase, components: [
	{
		c: TransformComponent,
		d: {
			y: 100 / 128,
			zIndex: 1
		}
	},
	{
		c: ColliderComponent,
		d: {
			radius: 0.2,
		}
	},
	{
		c: HotspotComponent,
		d: {
			name: "cashier",
			category: "cashier",
			facing: "180"
		}
	},
]};

var lootedCashRegisterB = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "cashRegisterB",
			defaultAnimationName: "looted",
			loop: false,
		}
	},
	{
		c: TransformComponent
	},
], children: [
//	cashieringHotspotB
]};


var lootableCashRegisterB = { components: [
	// PLACEHOLDER COLLIDER
	{
		c: ColliderComponent,
		d: {
			collisionGroup: CollisionCategoryDefinitions.CC_STATIC_OBSTACLE,
			collidesWith: [
				//CollisionCategoryDefinitions.CC_CHARACTERS,
				CollisionCategoryDefinitions.CC_WALLS,
				CollisionCategoryDefinitions.CC_DOORS,
				CollisionCategoryDefinitions.CC_STATIC_OBSTACLE,
				//CollisionCategoryDefinitions.CC_DYNAMIC_OBSTACLE,
				//CollisionCategoryDefinitions.CC_AI_PATH_GENERATION_RAY,
				//CollisionCategoryDefinitions.CC_PLANNING_TARGET,
				CollisionCategoryDefinitions.CC_BULLETS],
			senses: [CollisionCategoryDefinitions.CC_PLANNING_TARGET],
			width: 1 * 0.8,
			height: 1 * 0.65,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "cashRegisterB",
			defaultAnimationName: "default",
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false,
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.attack, ActionDefinitions.shoot, ActionDefinitions.drill],
		}
	},
	{
		c: FieldOfViewMarkerComponent,
	},
	{
		c: InventoryComponent,
		d: {
			dropItemsWithinAngle: 60,
            dropItemsWithinRadius: 3,
			items: [
				smallChange,
				smallChange,
				smallChange
			]
		}
	},
	{
		c: HealthComponent,
		d: {
			currentHealth: 2,
			maxHealth: 2,
			spawnOnDamage: {
				base: ["fxHitElectric"],
			},
			spawnAsBody: {
				base: ["lootableCashRegisterBDestroyed"],
			},
		}
	},
	{
		c: HealthBarComponent,
		d: {
			onlyDrawIfNotFull: true,
		}
	},
	{
		c: IndicatorComponent,
		d: {
			iconDefinition: indicatorIconBase,
			aboveTextDefinition: indicatorAboveBase,
			belowTextDefinition: indicatorBelowBase,
			overwriteAbove: "Cash register",
		}
	},
], children: [
//	cashieringHotspotB
]};

var lootedSafeSmall = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "safeSmall",
			loop: false,
		}
	},
	{
		c: SuspicionIncreaserComponent,
		d:{
			increaseAmount: 1,
		}
	},
	{
		c: TransformComponent
		},
]};

var lootableSafeSmall = { extend: lowBlock ,components: [
	{
		c: ColliderComponent,
		d: {
			width: 0.7,
			height: 0.7
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.steal],
		}
	},
	{
		c: LootableComponent,
		d: {
			indicatorDefinition: lootIndicatorBase,
			replaceWith: lootedSafeSmall,
			lootingTime: 10,
			spawnWhenLooted: "chaching",
		}
	},
	{
		c: InventoryComponent,
		d: {
			items: [
				theBigPrize
			]
		}
	},
]};

//START MINIMART SAFE
var safeMinimartDoor = { components: [
	{
		c: TransformComponent,
		d: {
			x: -50 / 128,
			y: 30 / 128,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "safeSmall",
			defaultAnimationName: "door",
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "TransformComponent",
			field: "localRotation",
			duration: 0.7,
			values: [0 , 1.1 * -Math.PI],
			repeat: false
		}
	}
]};

var safe2CashNull1 = { components: [
	{
		c: TransformComponent,
	},
	{
		c: TweenerComponent,
		d: {
			component: "TransformComponent",
			field: "localPosition",
			duration: 0.6,
			values: [{ x: 0, y: 0 }, { x: -0.4, y: 0.5 }],
			easing: EasingFunctions.easeOut,
			repeat: false
		}
	}
], children: [
	lootableMinimartCash,
]};

var safe2CashNull2 = { components: [
	{
		c: TransformComponent,
	},
	{
		c: TweenerComponent,
		d: {
			component: "TransformComponent",
			field: "localPosition",
			duration: 0.6,
			values: [{ x: 0, y: 0 }, { x: -0, y: 0.7 }],
			easing: EasingFunctions.easeOut,
			repeat: false
		}
	}
], children: [
	lootableMinimartCashLot,
]};

var safe2CashNull3 = { components: [
	{
		c: TransformComponent,
	},
	{
		c: TweenerComponent,
		d: {
			component: "TransformComponent",
			field: "localPosition",
			duration: 0.6,
			values: [{ x: 0, y: 0 }, { x: 0.4, y: 0.5 }],
			easing: EasingFunctions.easeOut,
			repeat: false
		}
	},
], children: [
	lootableMinimartCash,
]};

var lootedSafeMinimart = { extend: lowBlock, components: [
	{
		c: ColliderComponent,
		d: {
			width: 0.7,
			height: 0.7
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "safeSmall",
			defaultAnimationName: "looted",
		}
	},
	{
		c: SuspicionIncreaserComponent,
		d:{
			increaseAmount: 1,
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false
		}
	},
], children: [
	safeMinimartDoor,
	safe2CashNull1,
	safe2CashNull2,
	safe2CashNull3,
]};

var lootableSafeMinimart = { extend: lowBlock, components: [
	{
		c: ColliderComponent,
		d: {
			width: 0.7,
			height: 0.7
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OVERHEAD,
			sheet: "tiles",
			name: "safeSmall",
			defaultAnimationName: "default",
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.steal],
		}
	},
	{
		c: LootableComponent,
		d: {
			indicatorDefinition: lootIndicatorBase,
			replaceWith: lootedSafeMinimart,
			lootingTime: 2,
			spawnWhenLooted: "fxHitElectric",
		}
	},
	{
		c: InventoryComponent,
	},
]};
//END MINIMART SAFE

//START JEWELS SAFE
var diamondBoxSafe = { extend: userPickableItemBase, components: [
	{
		c: LootableComponent,
		d: {
			lootingTime: 0.1,
			spawnWhenLooted: "chaching",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "diamonds",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 8000,
			stackable: true,
			inventorySpriteName: "ui-base-icon-dollar",
			// Swap all lootables to pile of cash when put to inventory
			inventoryEntityDefinition: "lootablePileOfCash",
			removeAfterLevel: true,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemLootJewelsA",
			defaultAnimationName: "default",
		}
	},
]};

var safeJewelsDoor = { components: [
	{
		c: TransformComponent,
		d: {
			x: -50 / 128,
			y: 30 / 128,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "safeJewels",
			defaultAnimationName: "door",
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "TransformComponent",
			field: "localRotation",
			duration: 0.7,
			values: [0 , 1.1 * -Math.PI],
			repeat: false
		}
	}
]};

var safeCashNull1 = { components: [
	{
		c: TransformComponent
	},
	{
		c: TweenerComponent,
		d: {
			component: "TransformComponent",
			field: "localPosition",
			duration: 0.6,
			values: [{ x: 0, y: 0 }, { x: -0.4, y: 0.5 }],
			easing: EasingFunctions.easeOut,
			repeat: false
		}
	}
], children: [
	lootableWadOfCash,
]};

var safeCashNull2 = { components: [
	{
		c: TransformComponent
	},
	{
		c: TweenerComponent,
		d: {
			component: "TransformComponent",
			field: "localPosition",
			duration: 0.6,
			values: [{ x: 0, y: 0 }, { x: -0, y: 0.7 }],
			easing: EasingFunctions.easeOut,
			repeat: false
		}
	},
], children: [
	diamondBoxSafe,
]};

var safeCashNull3 = { components: [
	{
		c: TransformComponent
	},
	{
		c: TweenerComponent,
		d: {
			component: "TransformComponent",
			field: "localPosition",
			duration: 0.6,
			values: [{ x: 0, y: 0 }, { x: 0.4, y: 0.5 }],
			easing: EasingFunctions.easeOut,
			repeat: false
		}
	},
], children: [
	lootableWadOfCash,
]};

var lootedSafeJewels = { extend: lowBlock, components: [
	{
		c: ColliderComponent,
		d: {
			width: 0.7,
			height: 0.7
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "safeJewels",
			defaultAnimationName: "looted",
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false
		}
	},
], children: [
	safeJewelsDoor,
	safeCashNull1,
	safeCashNull2,
	safeCashNull3,
]};

var lootableSafeJewels = { extend: lowBlock, components: [
	{
		c: ColliderComponent,
		d: {
			width: 0.7,
			height: 0.7
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OVERHEAD,
			sheet: "tiles",
			name: "safeJewels",
			defaultAnimationName: "default",
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.steal],
		}
	},
	{
		c: LootableComponent,
		d: {
			indicatorDefinition: lootIndicatorBase,
			replaceWith: lootedSafeJewels,
			lootingTime: 2,
			spawnWhenLooted: "fxOpenSafe",
		}
	},
	{
		c: InventoryComponent,
	},
]};
//END JEWELS SAFE

//BREAKABLE JEWELS SAFE
var brokenSafeJewels = { extend: lowBlock, components: [
	{
		c: TransformComponent,
		d: {
		}
	},
	{
		c: ColliderComponent,
		d: {
			width: 0.7,
			height: 0.7
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "safeJewels",
			defaultAnimationName: "looted",
			tint: 0x9f9793,
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false
		}
	},
], children: [
	safeJewelsDoor,
]};

var breakableSafeJewels = { extend: lowBlock, components: [
	{
		c: ColliderComponent,
		d: {
			collisionGroup: CollisionCategoryDefinitions.CC_STATIC_OBSTACLE,
			collidesWith: [
				CollisionCategoryDefinitions.CC_CHARACTER_CORE,
				CollisionCategoryDefinitions.CC_CHARACTERS,
				CollisionCategoryDefinitions.CC_BULLETS,
				CollisionCategoryDefinitions.CC_WALLS,
				CollisionCategoryDefinitions.CC_DOORS,
				CollisionCategoryDefinitions.CC_STATIC_OBSTACLE,
				CollisionCategoryDefinitions.CC_DYNAMIC_OBSTACLE,
				CollisionCategoryDefinitions.CC_AI_PATH_GENERATION_RAY,
				CollisionCategoryDefinitions.CC_PLANNING_TARGET
			],
			width: 0.7,
			height: 0.7
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OVERHEAD,
			sheet: "tiles",
			name: "safeJewels",
			defaultAnimationName: "default",
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false,
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.attack, ActionDefinitions.shoot],
		}
	},
	{
		c: FieldOfViewMarkerComponent,
	},
	{
		c: InventoryComponent,
		d: {
			dropItemsWithinAngle: 20,
			dropItemsWithinRadius: 4,
			items: [],
		}
	},
	{
		c: HealthComponent,
		d: {
			currentHealth: 5,
			maxHealth: 5,
			minDamage: 0.5,
			spawnOnZeroHealth: {
				base: ["fxHitElectric"],
			},
			spawnAsBody: {
				base: ["brokenSafeJewels"],
			},
		}
	},
	{
		c: HealthBarComponent,
		d: {
			onlyDrawIfNotFull: true,
		}
	},
	{
		c: IndicatorComponent,
		d: {
			iconDefinition: indicatorIconBase,
			aboveTextDefinition: indicatorAboveBase,
			belowTextDefinition: indicatorBelowBase,
			overwriteAbove: "Safe",
		}
	},
]};

var drillableSafeJewels = { extend: breakableSafeJewels, components: [
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.attack, ActionDefinitions.shoot, ActionDefinitions.drill],
		}
	},
	{
		c: HealthComponent,
		d: {
			currentHealth: 20,
			maxHealth: 20,
			minDamage: 0.01,
			immuneDamageTypes: [DamageType.fist, DamageType.bullet],
			spawnOnDamage: {
				base: ["fxDrillDamage"],
			},
			spawnOnZeroHealth: {
				base: ["fxHitElectric"],
			},
			spawnAsBody: {
				base: ["brokenSafeJewels"],
			},
		}
	},
]};
//END BREAKABLE JEWELS SAFE

//DEFAULT SAFE
var safeDefaultDoor = { components: [
	{
		c: TransformComponent,
		d: {
			x: -50 / 128,
			y: 30 / 128,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "safeSmall",
			defaultAnimationName: "door",
		}
	},
	{
		c: TransformComponent,
		d: {
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "TransformComponent",
			field: "localRotation",
			duration: 0.7,
			values: [0 , 1.1 * -Math.PI],
			repeat: false
		}
	}
]};

var brokenSafeDefault = { extend: lowBlock, components: [
	{
		c: TransformComponent,
		d: {
		}
	},
	{
		c: ColliderComponent,
		d: {
			width: 0.7,
			height: 0.7
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "safeSmall",
			defaultAnimationName: "looted",
			tint: 0x9f9793,
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false
		}
	},
], children: [
	safeDefaultDoor,
]};

var breakableSafeDefault = { extend: breakableSafeJewels, components: [
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OVERHEAD,
			sheet: "tiles",
			name: "safeSmall",
			defaultAnimationName: "default",
		}
	},
	{
		c: InventoryComponent,
		d: {
			dropItemsWithinAngle: 40,
		}
	},
	{
		c: HealthComponent,
		d: {
			currentHealth: 5,
			maxHealth: 5,
			minDamage: 0.5,
			spawnOnZeroHealth: {
				base: ["fxHitElectric"],
			},
			spawnAsBody: {
				base: ["brokenSafeDefault"],
			},
		}
	},
]};

var drillableSafeDefault = { extend: drillableSafeJewels, components: [
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.attack, ActionDefinitions.shoot, ActionDefinitions.drill],
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OVERHEAD,
			sheet: "tiles",
			name: "safeSmall",
			defaultAnimationName: "default",
		}
	},
	{
		c: HealthComponent,
		d: {
			currentHealth: 20,
			maxHealth: 20,
			minDamage: 0.01,
			immuneDamageTypes: [DamageType.fist, DamageType.bullet],
			spawnOnDamage: {
				base: ["fxDrillDamage"],
			},
			spawnOnZeroHealth: {
				base: ["fxHitElectric"],
			},
			spawnAsBody: {
				base: ["brokenSafeDefault"],
			},
		}
	},
]};

//START DIAMOND CRATE

var diamondBox = { extend: userPickableItemBase, components: [
	{
		c: LootableComponent,
		d: {
			lootingTime: 0,
			spawnWhenLooted: "chaching",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "diamonds",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 1000,
			stackable: true,
			inventorySpriteName: "ui-base-icon-dollar",
			// Swap all lootables to pile of cash when put to inventory
			inventoryEntityDefinition: "lootablePileOfCash",
			removeAfterLevel: true,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "woodenCrateDiamonds",
		}
	},
]};

var diamondBoxNull1 = { components: [
	{
		c: TransformComponent,
		d: {
			x: -20 / 128,
			y: 32 / 128,
		}
	},
], children: [
	diamondBox,
]};

var diamondBoxNull2 = { components: [
	{
		c: TransformComponent,
		d: {
			x: 28 / 128,
			y: 0,
		}
	},
], children: [
	diamondBox,
]};

var diamondBoxNull3 = { components: [
	{
		c: TransformComponent,
		d: {
			x: -20 / 128,
			y: -32 / 128,
		}
	},
], children: [
	diamondBox,
]};

var lootableDiamondCrate = { extend: lowBlock, components: [
	{
		c: ColliderComponent,
		d: {
			width: 0.9,
			height: 0.9,
		}
	},
	{
		c: TransformComponent,
		d: {
			zIndex: -1,
		}
	},
	{
		c: FieldOfViewMarkerComponent,
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false,
			density: 15,

		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_FLOOR_OBJECTS,
			sheet: "tiles",
			name: "woodenCrate",
			defaultAnimationName: "default",
		}
	},
], children: [
	diamondBoxNull1,
	diamondBoxNull2,
	diamondBoxNull3,
]};

var stupidNullForDiamondCrate = { components: [
		{
		c: TransformComponent,
		d: {
		}
	},
], children: [
	fxWoodenCrateNoNode,
	lootableDiamondCrate,
]};

var woodenCrateCoverJanes = { components: [
	{
		c: HealthComponent,
		d: {
			currentHealth: 3,
			maxHealth: 3,
			spawnAsBody: {
				base: ["stupidNullForDiamondCrate"],
			},
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.attack, ActionDefinitions.shoot, ActionDefinitions.drill],
		}
	},
	{
		c: ColliderComponent,
		d: {
			radius: 0.24 * 1,
			collisionGroup: CollisionCategoryDefinitions.CC_STATIC_OBSTACLE,
			collidesWith: [CollisionCategoryDefinitions.CC_CHARACTERS,
				CollisionCategoryDefinitions.CC_CHARACTER_CORE,
				CollisionCategoryDefinitions.CC_WALLS,
				CollisionCategoryDefinitions.CC_DOORS,
				CollisionCategoryDefinitions.CC_BULLETS,
				CollisionCategoryDefinitions.CC_STATIC_OBSTACLE,
				CollisionCategoryDefinitions.CC_DYNAMIC_OBSTACLE,
				CollisionCategoryDefinitions.CC_LIGHT_DYNAMIC_OBSTACLE,
				CollisionCategoryDefinitions.CC_AI_PATH_GENERATION_RAY,
				CollisionCategoryDefinitions.CC_PLANNING_TARGET
			],
			senses: [CollisionCategoryDefinitions.CC_AVOIDANCE, CollisionCategoryDefinitions.CC_MOUSE, CollisionCategoryDefinitions.CC_HOTSPOTS, CollisionCategoryDefinitions.CC_PLANNING_TARGET, CollisionCategoryDefinitions.CC_DOORS]
		}
	},
	{
		c: FieldOfViewMarkerComponent,
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false,
			density: 15,

		}
	},
	{
		c: HealthBarComponent,
		d: {
			onlyDrawIfNotFull: true,
		}
	},
]};

//END DIAMOND CRATE

//JEWELLERY DISPLAYS
var lootableNecklaceA = { extend: lootableWadOfCash, components: [
	{
		c: TransformComponent,
		d: {
			zIndex: 1,
		}
	},
	{
		c: LootableComponent,
		d: {
			lootingTime: 0,
			spawnWhenLooted: "chaching",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Cheap Necklace",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 1000,
			stackable: true
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemLootEarringsA",
		}
	},
]};

var nonLootableNecklaceA = { components: [
	{
		c: TransformComponent,
		d: {
			zIndex: 1,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemLootEarringsA",
			defaultAnimationName: "default",
		}
	},
]};

var nonLootableNecklaceB = { components: [
	{
		c: TransformComponent,
		d: {
			zIndex: 1,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemLootNecklaceA",
			defaultAnimationName: "default",

		}
	},
]};

var nonLootableNecklaceC = { components: [
	{
		c: TransformComponent,
		d: {
			zIndex: 1,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemLootNecklaceB",
			defaultAnimationName: "default",

		}
	},
]};

var brokenJewelsDisplayBase = { extend: lowBlock, components: [
	{
		c: ColliderComponent,
		d: {
			width: 0.9,
			height: 0.7,
		}
	},
	{
		c: TransformComponent,
		d: {
			zIndex: -1,
		}
	},
	{
		c: FieldOfViewMarkerComponent,
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false,
			density: 15,

		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_FLOOR_OBJECTS,
			sheet: "tiles",
			name: "jewelsDisplayA",
			defaultAnimationName: "broken",
		}
	},
]};

var brokenJewelsDisplayA = { extend: brokenJewelsDisplayBase, components: [
], children: [
	lootableJewelsA,
]};

var brokenJewelsDisplayB = { extend: brokenJewelsDisplayBase, components: [
], children: [
	lootableJewelsB,
]};

var brokenJewelsDisplayC = { extend: brokenJewelsDisplayBase, components: [
], children: [
	lootableJewelsC,
]};

var nullLootableJewelsDisplayA = { components: [
	{
		c: TransformComponent,
	},
], children: [
	fxGlassFlatA,
	brokenJewelsDisplayA,
]};

var nullLootableJewelsDisplayB = { components: [
	{
		c: TransformComponent,
	},
], children: [
	fxGlassFlatA,
	brokenJewelsDisplayB,
]};

var nullLootableJewelsDisplayC = { components: [
	{
		c: TransformComponent,
	},
], children: [
	fxGlassFlatA,
	brokenJewelsDisplayC,
]};

var lootableJewelsDisplayGlass = { components: [
	{
		c: TransformComponent,
		d: {
			zIndex: 5,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "jewelsDisplayA",
			defaultAnimationName: "glass",
		}
	},
]};

var lootableJewelsDisplayBase = { extend: lowBlock, components: [
	{
		c: TransformComponent,
		d: {
			zIndex: -1,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_FLOOR_OBJECTS,
			sheet: "tiles",
			name: "jewelsDisplayA",
			defaultAnimationName: "default",
		}
	},
	{
		c: HealthComponent,
		d: {
			currentHealth: 1,
			maxHealth: 1,
			minDamage: 0,
			spawnOnZeroHealth: {
				base: ["fxHitWindowADirectional"],
			},
			spawnAsBody: {
				base: ["nullLootableJewelsDisplayA"],
			},
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.attack, ActionDefinitions.shoot, ActionDefinitions.drill],
		}
	},
	{
		c: ColliderComponent,
		d: {
			radius: 0.24 * 1,
			collidesWith: [
				CollisionCategoryDefinitions.CC_BULLETS,
				CollisionCategoryDefinitions.CC_CHARACTER_CORE,
				CollisionCategoryDefinitions.CC_WALLS,
				CollisionCategoryDefinitions.CC_DOORS,
				CollisionCategoryDefinitions.CC_STATIC_OBSTACLE,
				CollisionCategoryDefinitions.CC_DYNAMIC_OBSTACLE,
				CollisionCategoryDefinitions.CC_AI_PATH_GENERATION_RAY,
				CollisionCategoryDefinitions.CC_PLANNING_TARGET
			]
		}
	},
	{
		c: FieldOfViewMarkerComponent,
	},
	{
		c: RigidBodyComponent,
		d: {
			density: 15,
			isDynamic: false,
		}
	},
	{
		c: HealthBarComponent,
		d: {
			onlyDrawIfNotFull: true,
		}
	},
]};

var lootableJewelsDisplayA = { extend: lootableJewelsDisplayBase, components: [
	{
		c: HealthComponent,
		d: {
			spawnAsBody: {
				base: ["nullLootableJewelsDisplayA"],
			},
		}
	},
], children: [
	nonLootableNecklaceA,
	lootableJewelsDisplayGlass,
]};

var lootableJewelsDisplayB = { extend: lootableJewelsDisplayBase, components: [
	{
		c: HealthComponent,
		d: {
			spawnAsBody: {
				base: ["nullLootableJewelsDisplayB"],
			},
		}
	},
], children: [
	nonLootableNecklaceB,
	lootableJewelsDisplayGlass,
]};

var lootableJewelsDisplayC = { extend: lootableJewelsDisplayBase, components: [
	{
		c: HealthComponent,
		d: {
			spawnAsBody: {
				base: ["nullLootableJewelsDisplayC"],
			},
		}
	},
], children: [
	nonLootableNecklaceC,
	lootableJewelsDisplayGlass,
]};

//JEWELLERY DISPLAYS END

var lootedHorseShoes = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "horseShoes",
			loop: false,
		}
	},
	{
		c: TransformComponent
	},
]};

var lootedHorseArmor = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "horseArmor",
			loop: false,
		}
	},
	{
		c: TransformComponent
		},
]};

var lootedHorsePaintingSmall = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "horsePaintingSmall",
			loop: false,
		}
	},
	{
		c: TransformComponent
		},
]};

var lootedHorseJewels = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "horseJewels",
			loop: false,
		}
	},
	{
		c: TransformComponent
		},
]};

var lootedGoldHorse = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "goldHorse",
			loop: false,
		}
	},
	{
		c: TransformComponent
		},
]};

var lootedFridgePeige = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "fridgePeige",
			defaultAnimationName: "looted",
			loop: false,
		}
	},
	{
		c: TransformComponent
	},
]};

var lootedBustDisplayBeardy = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "bustDisplayBeardy",
			defaultAnimationName: "looted",
			loop: false,
		}
	},
	{
		c: TransformComponent
	},
]};

var lootedPotteryDisplaySmall = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "potteryDisplaySmall",
			defaultAnimationName: "looted",
			loop: false,
		}
	},
	{
		c: TransformComponent
	},
]};

var lootedJewelryDisplaySmall = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "jewelryDisplaySmall",
			defaultAnimationName: "looted",
			loop: false,
		}
	},
	{
		c: TransformComponent
	},
]};

var lootedBookDisplaySmall = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "bookDisplaySmall",
			defaultAnimationName: "looted",
			loop: false,
		}
	},
	{
		c: TransformComponent
	},
]};

var lootedBookDisplayLargeLeft = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "bookDisplayLargeLeft",
			defaultAnimationName: "looted",
			loop: false,
		}
	},
	{
		c: TransformComponent
	},
]};

var lootedBookDisplayLargeRight = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "tiles",
			name: "bookDisplayLargeRight",
			defaultAnimationName: "looted",
			loop: false,
		}
	},
	{
		c: TransformComponent
	},
]};

var lootableCocaineSmall = { extend: userPickableItemBase, components: [
	{
		c: TransformComponent
	},
	{
		c: LootableComponent,
		d: {
			spawnWhenLooted: "getCash",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Cocaine",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 500,
			stackable: true,
			inventorySpriteName: "ui-base-icon-narcotics",
			removeAfterLevel: true
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemUsableCocaine",
			defaultAnimationName: "small",
		}
	},
]};

var lootableCocainePure = { extend: userPickableItemBase, components: [
	{
		c: TransformComponent
	},
	{
		c: LootableComponent,
		d: {
			spawnWhenLooted: "getCash",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Pure cocaine",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 1666,
			stackable: true,
			inventorySpriteName: "ui-base-icon-narcotics",
			removeAfterLevel: true
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemUsableCocaine",
			defaultAnimationName: "small",
		}
	},
]};

var lootableDisguiseGuard = { extend: userPickableItemBase, components: [
	{
		c: TransformComponent
	},
	{
		c: LootableComponent,
		d: {
			spawnWhenLooted: "getCash",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Guard disguise",
			type: "Guard disguise",
			lootable: true,
			equippable: false,
			amount: 1,
			stackable: false,
			inventorySpriteName: "ui-base-icon-disguise-guard",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemPickableDisguiseGuard",
		}
	},
]};

var briefcaseOpen = { components: [
	{
		c: ColliderComponent,
		d: {
			collisionGroup: CollisionCategoryDefinitions.CC_STATIC_OBSTACLE,
			collidesWith: [
				CollisionCategoryDefinitions.CC_CHARACTERS,
				CollisionCategoryDefinitions.CC_WALLS,
				CollisionCategoryDefinitions.CC_DOORS,
				CollisionCategoryDefinitions.CC_STATIC_OBSTACLE,
				CollisionCategoryDefinitions.CC_DYNAMIC_OBSTACLE,
			],
			senses: [CollisionCategoryDefinitions.CC_PLANNING_TARGET],
			width: 1,
			height: 0.65,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemUsableBriefcase",
			defaultAnimationName: "open",
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false,
		}
	},
]};

var briefcaseShine = { components: [
	{
		c: TransformComponent,
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemUsableBriefcase",
			defaultAnimationName: "flash",
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "SpriteComponent",
			field: "alpha",
			duration: 1,
			values: [0, 0.5, 0],
			repeat: true
		}
	},
]};

var briefcase = { components: [
	{
		c: ColliderComponent,
		d: {
			collisionGroup: CollisionCategoryDefinitions.CC_STATIC_OBSTACLE,
			collidesWith: [
				CollisionCategoryDefinitions.CC_CHARACTERS,
				CollisionCategoryDefinitions.CC_WALLS,
				CollisionCategoryDefinitions.CC_DOORS,
				CollisionCategoryDefinitions.CC_STATIC_OBSTACLE,
				CollisionCategoryDefinitions.CC_DYNAMIC_OBSTACLE,
				CollisionCategoryDefinitions.CC_BULLETS],
			senses: [CollisionCategoryDefinitions.CC_PLANNING_TARGET],
			width: 1,
			height: 0.65
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemUsableBriefcase",
			defaultAnimationName: "closed",
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false,
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.attack, ActionDefinitions.shoot, ActionDefinitions.drill],
		}
	},
	{
		c: FieldOfViewMarkerComponent,
	},
	{
		c: InventoryComponent,
		d: {
			dropItemsWithinAngle: 30,
			dropItemsWithinRadius: 3,
			items: [],
		}
	},
	{
		c: HealthComponent,
		d: {
			currentHealth: 2,
			maxHealth: 2,
			spawnOnZeroHealth: {
				base: ["fxHitElectric"],
			},
			spawnAsBody: {
				base: ["briefcaseOpen"],
			},
		}
	},
	{
		c: HealthBarComponent,
		d: {
			onlyDrawIfNotFull: true,
		}
	},
	{
		c: IndicatorComponent,
		d: {
			iconDefinition: indicatorIconBase,
			aboveTextDefinition: indicatorAboveBase,
			belowTextDefinition: indicatorBelowBase,
			overwriteAbove: "Briefcase",
		}
	},
], children: [
	briefcaseShine
]};

// MONEYBOX START. Can be used for different containers
var moneyBoxRedOpen = { components: [
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemUsableMoneyBoxRed",
			defaultAnimationName: "open",
		}
	},
]};

var moneyBoxGrayOpen = { extend: moneyBoxRedOpen, components: [
	{
		c: SpriteComponent,
		d: {
			name: "itemUsableMoneyBoxGray",
		}
	},
]};

var moneyBoxBlackOpen = { extend: moneyBoxRedOpen, components: [
	{
		c: SpriteComponent,
		d: {
			name: "itemUsableMoneyBoxBlack",
		}
	},
]};

var gunCakeOpen = { extend: moneyBoxRedOpen, components: [
	{
		c: SpriteComponent,
		d: {
			name: "itemUsableGunCakeDestroyed",
			layer: LayerDefinitions.LAYER_FLOOR_OBJECTS,
		}
	},
]};

var moneyBoxRedShine = { components: [
	{
		c: TransformComponent,
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemUsableMoneyBoxRed",
			defaultAnimationName: "flash",
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "SpriteComponent",
			field: "alpha",
			duration: 1,
			values: [0, 0, 1, 0],
			repeat: true,
			useUnadjustedFrameTime: true,
		}
	},
]};

var moneyBoxGrayShine = { extend: moneyBoxRedShine, components: [
	{
		c: SpriteComponent,
		d: {
			name: "itemUsableMoneyBoxGray",
			defaultAnimationName: "flash",
		}
	},
]};

var moneyBoxBlackShine = { extend: moneyBoxRedShine, components: [
	{
		c: SpriteComponent,
		d: {
			name: "itemUsableMoneyBoxBlack",
			defaultAnimationName: "flash",
		}
	},
]};

var gunCakeShine = { extend: moneyBoxRedShine, components: [
	{
		c: SpriteComponent,
		d: {
			name: "itemUsableGunCake",
			defaultAnimationName: "flash",
		}
	},
]};

var moneyBoxBase = { components: [
	{
		c: ColliderComponent,
		d: {
			collisionGroup: CollisionCategoryDefinitions.CC_STATIC_OBSTACLE,
			collidesWith: [
				CollisionCategoryDefinitions.CC_WALLS,
				CollisionCategoryDefinitions.CC_DOORS,
				CollisionCategoryDefinitions.CC_STATIC_OBSTACLE,
				CollisionCategoryDefinitions.CC_BULLETS],
			senses: [CollisionCategoryDefinitions.CC_PLANNING_TARGET],
			width: 0.5,
			height: 0.5
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemUsableMoneyBoxRed",
			defaultAnimationName: "closed",
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false,
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.attack, ActionDefinitions.shoot, ActionDefinitions.drill],
		}
	},
	{
		c: FieldOfViewMarkerComponent,
	},
	{
		c: InventoryComponent,
		d: {
			dropItemsWithinAngle: 20,
			dropItemsWithinRadius: 3,
			items: [],
		}
	},
	{
		c: HealthComponent,
		d: {
			currentHealth: 2,
			maxHealth: 2,
			spawnOnZeroHealth: {
				base: ["fxHitElectric"],
			},
			spawnAsBody: {
				base: ["moneyBoxRedOpen"],
			},
		}
	},
	{
		c: HealthBarComponent,
		d: {
			onlyDrawIfNotFull: true,
		}
	},
	{
		c: IndicatorComponent,
		d: {
			iconDefinition: indicatorIconBase,
			aboveTextDefinition: indicatorAboveBase,
			belowTextDefinition: indicatorBelowBase,
			overwriteAbove: "Cash box",
		}
	},
]};

var moneyBoxRed = { extend: moneyBoxBase, components: [
	{
		c: TransformComponent
	},
], children: [
	moneyBoxRedShine
]};

var moneyBoxGray = { extend: moneyBoxBase, components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			name: "itemUsableMoneyBoxGray",
		}
	},
	{
		c: HealthComponent,
		d: {
			spawnAsBody: {
				base: ["moneyBoxGrayOpen"],
			},
		}
	},
], children: [
	moneyBoxGrayShine
]};

var moneyBoxBlack = { extend: moneyBoxBase, components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			name: "itemUsableMoneyBoxBlack",
		}
	},
	{
		c: HealthComponent,
		d: {
			currentHealth: 3,
			maxHealth: 3,
			spawnOnZeroHealth: {
				base: ["fxHitElectric"],
			},
			spawnAsBody: {
				base: ["moneyBoxBlackOpen"],
			},
		}
	},
], children: [
	moneyBoxBlackShine
]};

var gunCake = { extend: moneyBoxBase, components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			name: "itemUsableGunCake",
			layer: LayerDefinitions.LAYER_FLOOR_OBJECTS,
		}
	},
	{
		c: HealthComponent,
		d: {
			currentHealth: 0.7,
			maxHealth: 0.7,
			spawnOnZeroHealth: {
				base: ["fxBump"],
			},
			spawnAsBody: {
				base: ["gunCakeOpen"],
			},
		}
	},
	{
		c: InventoryComponent,
		d: {
			dropItemsWithinAngle: 360,
			dropItemsWithinRadius: 3,
		}
	},
	{
		c: IndicatorComponent,
		d: {
			overwriteAbove: "$cake",
		}
	},
], children: [
	gunCakeShine
]};

//MONEYBOX END

var carriedDuffelBagBase = { components: [
	{
		c: TransformComponent,
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_FLOOR_OBJECTS,
			sheet: "inventory",
			name: "itemCarriedDuffelBag",
			defaultAnimationName: "bottom",
		}
	},
], children: [
	{ components: [
		{
			c: TransformComponent,
			d: {
			}
		},
		{
			c: SpriteComponent,
			d: {
				layer: LayerDefinitions.LAYER_OBJECTS,
				sheet: "inventory",
				name: "itemCarriedDuffelBag",
				defaultAnimationName: "top",
			}
		},
	]}
]};

var duffelBagBase = { components: [
	{
		c: TransformComponent,
	},
	{
		c: FieldOfViewMarkerComponent,
	},
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "cash",
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.pickup],
		}
	},
	{
		c: LootableComponent,
		d: {
			indicatorDefinition: lootIndicatorBase,
			pickable: true,
			lootingTime: 0.3,
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "moneyBag",
			type: "loot",
			lootable: true,
			equippable: true,
			equipCharacterMaps: ["bag"],
			equipByDefault: true,
			equipSlot: EquipmentSlot.leftHand,
			mustBeEquipped: true,
			inventorySpriteName: "ui-base-icon-duffel-bag",
			stackable: false,
			removeAfterLevel: true,
			respawnable: true,
		}
	},
	{
		c: InventoryComponent,
		d: {
			items: [
				smallChange,
			]
		}
	},
	{
		c: ColliderComponent,
		d: {
			collisionGroup: CollisionCategoryDefinitions.CC_OBJECTS,
			collidesWith: [CollisionCategoryDefinitions.CC_DYNAMIC_OBSTACLE, CollisionCategoryDefinitions.CC_WALLS, CollisionCategoryDefinitions.CC_STATIC_OBSTACLE, CollisionCategoryDefinitions.CC_DOORS],
			senses: [CollisionCategoryDefinitions.CC_PLANNING_TARGET],
			width: 1*0.7,
			height: 1*1.25
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: true,
			density: 0.001,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemPickableDuffelBag",
			defaultAnimationName: "default",
		}
	},
	{
		c: IndicatorComponent,
		d: {
			iconDefinition: indicatorIconBase,
			aboveTextDefinition: indicatorAboveBase,
			belowTextDefinition: indicatorBelowBase,
		}
	},
]};

var duffelBagCoke = { extend: duffelBagBase, components: [
	{
		c: ItemComponent,
		d: {
			name: "cokeBag",
		}
	},
]};

var duffelBagCoins = { extend: duffelBagBase, components: [
	{
		c: ItemComponent,
		d: {
			name: "coinBag",
		}
	},
]};

var packableBase = { components: [
	{
		c: ColliderComponent,
		d: {
			collisionGroup: CollisionCategoryDefinitions.CC_LIGHT_DYNAMIC_OBSTACLE,
			collidesWith: [CollisionCategoryDefinitions.CC_WALLS, CollisionCategoryDefinitions.CC_DOORS, CollisionCategoryDefinitions.CC_STATIC_OBSTACLE, CollisionCategoryDefinitions.CC_DYNAMIC_OBSTACLE],
			senses: [CollisionCategoryDefinitions.CC_PLANNING_TARGET],
			width: 1 * 0.5,
			height: 1 * 0.5,
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: true,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemUsableCashPileA",
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.pack],
		}
	},
	{
		c: PackableComponent,
		d: {
			indicatorDefinition: lootIndicatorBase,
			replaceWith: duffelBagBase,
			duration: 1,
		}
	},
	{
		c: ItemComponent,
		d: {
			type: "pack",
			lootable: false,
			equippable: false,
			stackable: false,
			removeAfterLevel: true,
		}
	},
	{
		c: IndicatorComponent,
		d: {
			iconDefinition: indicatorIconBase,
			aboveTextDefinition: indicatorAboveBase,
			belowTextDefinition: indicatorBelowBase,
		}
	},
]};

var lootableTonOfCash = { extend: packableBase, components: [
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemUsableCashPileA",
		}
	},
	{
		c: PackableComponent,
		d:{
			spawnWhenPacked: "getCash",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Ton of Cash",
			type: "loot",
			inventorySpriteName: "ui-base-icon-dollar",
			amount: 5000,
		}
	},
]};

var lootableTonOfCoke = { extend: packableBase, components: [
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemUsableCocaineStack",
		}
	},
	{
		c: PackableComponent,
		d:{
			spawnWhenPacked: "getCash",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Ton of Cocaine",
			type: "loot",
			inventorySpriteName: "ui-base-icon-narcotics",
			amount: 2000,
			removeAfterLevel: true,
		}
	},
	{
		c: PackableComponent,
		d: {
			indicatorDefinition: lootIndicatorBase,
			replaceWith: duffelBagCoke,
			duration: 1,
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: true,
			density: 0.001,

		}
	},
]};

var lootableTonOfCokeImpound = { extend: lootableTonOfCoke, components: [
	{
		c: ObjectiveComponent,
		d: {
			name: "impoundObjective2",
		}
	}
]};

var lootableTonOfCoins = { extend: packableBase, components: [
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemUsableCoinsPileA",
		}
	},
	{
		c: PackableComponent,
		d:{
			spawnWhenPacked: "getCash",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Ton of Coins",
			type: "loot",
			inventorySpriteName: "ui-base-icon-dollar",
			amount: 3500,
		}
	},
	{
		c: PackableComponent,
		d: {
			indicatorDefinition: lootIndicatorBase,
			replaceWith: duffelBagCoins,
			duration: 1,
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: true,
			density: 0.001,
		}
	},
]};

var lootableMaskOfZombolo = { extend: userPickableItemBase, components: [
	{
		c: TransformComponent
	},
	{
		c: LootableComponent,
		d: {
			spawnWhenLooted: "getCash",
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Mask of Zombolo",
			type: "loot",
			lootable: true,
			equippable: false,
			amount: 5000,
			stackable: true,
			inventorySpriteName: "ui-base-icon-dollar",
			removeAfterLevel: true,
			respawnable: true,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "inventory",
			name: "itemPickableMaskZombolo",
		}
	},
]};