var carriedDeadBody = { components: [
	/*{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "bodies",
			defaultAnimationName: "carried",
		}
	},*/
]};

var carriedDeadGoonA = { extend: carriedDeadBody, components: [
	{
		c: SpriteComponent,
		d: {
	//		sheet: "goons",
			name: "goonA",
		}
	},
]};

var carriedDeadGoonB = { extend: carriedDeadBody, components: [
	{
		c: SpriteComponent,
		d: {
	//		sheet: "goonB",
			name: "goonB",
		}
	},
]};

var carriedDeadGoonC = { extend: carriedDeadBody, components: [
	{
		c: SpriteComponent,
		d: {
	//		sheet: "goonC",
			name: "goonC",
		}
	},
]};

var carriedDeadGoonD = { extend: carriedDeadBody, components: [
	{
		c: SpriteComponent,
		d: {
	//		sheet: "goonD",
			name: "goonD",
		}
	},
]};

var carriedDeadGoonGuard = { extend: carriedDeadBody, components: [
	{
		c: SpriteComponent,
		d: {
	//		sheet: "characters",
			name: "guardA",
		}
	},
]};

var carriedDeadGuardA = { extend: carriedDeadBody, components: [
	{
		c: SpriteComponent,
		d: {
	//		sheet: "characters",
			name: "guardA",
		}
	},
]};

var carriedDeadCustomerA = { extend: carriedDeadBody, components: [
	{
		c: SpriteComponent,
		d: {
	//		sheet: "civilianC",
			name: "civilianC",
		}
	},
]};

var carriedDeadClerkA = { extend: carriedDeadBody, components: [
	{
		c: SpriteComponent,
		d: {
	//		sheet: "characters",
			name: "clerkA",
		}
	},
]};

var carriedDeadClerkB = { extend: carriedDeadBody, components: [
	{
		c: SpriteComponent,
		d: {
	//		sheet: "clerkB",
			name: "clerkB",
		}
	},
]};

var carriedDeadBankManagerA = { extend: carriedDeadBody, components: [
	{
		c: SpriteComponent,
		d: {
	//		sheet: "bankManagerA",
			name: "bankManagerA",
		}
	},
]};

var deadBody = { components: [
	{
		c: BodyComponent,
		d: {
			spawnOnKnockout: reactionSleepSpawner,
		}
	},
	{
		c: TeamComponent,
		d: {
			name: "civilians"
		}
	},
	{
		c: SuspicionIncreaserComponent,
		d:{
			increaseAmount: 1,
		}
	},
	{
		c: FieldOfViewMarkerComponent,
	},
	{
		c: FogOfWarTargetComponent,
		d: {
			componentParamsWhenVisible: {
				TweenerComponent: {
					values: [0.0, 1.0]
				}
			},
			componentParamsWhenInvisible: {
				TweenerComponent: {
					values:  [1.0, 0.0]
				}
			},
			componentParamsWhenInvisibleButNotHidden: {
				TweenerComponent: {
					values: [1.0, 0.25]
				}
			}
		}
	},
	{ // this is for fading in and out based on fog of war
		c: TweenerComponent,
		d: {
			duration: 0.5,
			component: "SpriteComponent",
			field: "alpha",
			firstValueFromTarget: true
		}
	},
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "dying",
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.pickup],
		}
	},
	{
		c: LootableComponent,
		d: {
			indicatorDefinition: lootIndicatorBase,
			pickable: true,
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Body",
			type: "body",
			suspiciousness: 10.0,
			equippedDefinition: "carriedDeadBody",
			equippable: true,
			equipByDefault: true,
			equipSlot: EquipmentSlot.leftHand,
			mustBeEquipped: true,
			inventorySpriteName: "ui-base-icon-body",
			removeAfterLevel: true,
		}
	},

	{
		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 removed for testing
			radius: 0.12,
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: true
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_FLOOR,
			sheet:"bodies",
			name: "goonA",
			defaultAnimationName: "dead",
		}
	},
]};

var deadGoon = { components: [
	{
		c: BodyComponent,
		d: {
			spawnOnKnockout: reactionSleepSpawner,
		}
	},
	{
		c: TeamComponent,
		d: {
			name: "goons"
		}
	},
	{
		c: SuspicionIncreaserComponent,
		d:{
			increaseAmount: 1,
		}
	},
	{
		c: FieldOfViewMarkerComponent,
	},
	{
		c: FogOfWarTargetComponent,
		d: {
			componentParamsWhenVisible: {
				TweenerComponent: {
					values: [0.0, 1.0]
				}
			},
			componentParamsWhenInvisible: {
				TweenerComponent: {
					values:  [1.0, 0.0]
				}
			},
			componentParamsWhenInvisibleButNotHidden: {
				TweenerComponent: {
					values: [1.0, 0.25]
				}
			}
		}
	},
	{ // this is for fading in and out based on fog of war
		c: TweenerComponent,
		d: {
			duration: 0.5,
			component: "SpriteComponent",
			field: "alpha",
			firstValueFromTarget: true
		}
	},
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "dying",
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.pickup],
		}
	},
	{
		c: LootableComponent,
		d: {
			indicatorDefinition: lootIndicatorBase,
			pickable: true,
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Body",
			type: "body",
			suspiciousness: 10.0,
			equippedDefinition: "carriedDeadGoonA",
			equippable: true,
			equipByDefault: true,
			equipSlot: EquipmentSlot.leftHand,
			mustBeEquipped: true,
			inventorySpriteName: "ui-base-icon-body",
		}
	},

	{
		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
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_FLOOR,
			sheet:"bodies",
			name: "goonA",
			defaultAnimationName: "dead",
		}
	},
]};

var deadGoonB = { extend: deadGoon, components: [
	{
		c: SpriteComponent,
		d: {
	//		sheet:"goonB",
			name: "goonB",
		}
	},
	{
		c: ItemComponent,
		d: {
			equippedDefinition: "carriedDeadGoonB",
		}
	},
]};

var deadGoonC = { extend: deadGoon, components: [
	{
		c: SpriteComponent,
		d: {
	//		sheet:"goonC",
			name: "goonC",
		}
	},
	{
		c: ItemComponent,
		d: {
			equippedDefinition: "carriedDeadGoonC",
		}
	},
]};


var deadGoonD = { extend: deadGoon, components: [
	{
		c: SpriteComponent,
		d: {
	//		sheet:"goonD",
			name: "goonD",
		}
	},
	{
		c: ItemComponent,
		d: {
			equippedDefinition: "carriedDeadGoonD",
		}
	},
]};

var deadGoonGuard = { extend: deadGoon, components: [
	{
		c: SpriteComponent,
		d: {
		//	sheet:"characters",
			name: "guardA",
		}
	},
	{
		c: ItemComponent,
		d: {
			equippedDefinition: "carriedDeadGoonGuard",
		}
	},
]};

var deadGuardA = { extend: deadBody, components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "civilianDying",
		}
	},
	{
		c: SpriteComponent,
		d: {
		//	sheet: "characters",
			name: "guardA",
		}
	},
	{
		c: ItemComponent,
		d: {
			equippedDefinition: "carriedDeadGuardA",
		}
	},
]};

var deadGuardSissy = { extend: deadBody, components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "civilianDying",
		}
	},
	{
		c: SpriteComponent,
		d: {
		//	sheet: "characters",
			name: "guardSissy",
		}
	},
	{
		c: ItemComponent,
		d: {
			equippedDefinition: "carriedDeadGuardA",
		}
	},
]};

var deadCopA = { extend: deadBody, components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "civilianDying",
		}
	},
	{
		c: SpriteComponent,
		d: {
	//		sheet: "characters",
			name: "copA",
		}
	},
	{
		c: ItemComponent,
		d: {
			equippedDefinition: "carriedDeadGuardA",
		}
	},
]};


var deadCustomerA = { extend: deadBody, components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "civilianDying",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_FLOOR,
		}
	},
	{
		c: ItemComponent,
		d: {
			equippedDefinition: "carriedDeadCustomerA",
		}
	},
]};

var deadMouseA = { components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "civilianDying",
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_FLOOR,
			sheet: "bodies",
			name: "MouseA",
			defaultAnimationName: "dead",
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [],
		}
	},
/*		{
		c: ItemComponent,
		d: {
			equippedDefinition: "carriedDeadCustomerA",
		}
	},
*/
]};


var deadClerkA = { extend: deadBody, components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "civilianDying",
		}
	},
	{
		c: SpriteComponent,
		d: {
	//		sheet: "characters",
			name: "clerkA",
		}
	},
	{
		c: ItemComponent,
		d: {
			equippedDefinition: "carriedDeadClerkA",
		}
	},
]};

var deadClerkB = { extend: deadBody, components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "civilianDying",
		}
	},
	{
		c: SpriteComponent,
		d: {
	//		sheet: "clerkB",
			name: "clerkB",
		}
	},
	{
		c: ItemComponent,
		d: {
			equippedDefinition: "carriedDeadClerkB",
		}
	},
]};

var deadBankManagerA = { extend: deadBody, components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "civilianDying",
		}
	},
	{
		c: SpriteComponent,
		d: {
	//		sheet: "bankManagerA",
			name: "bankManagerA",
		}
	},
	{
		c: ItemComponent,
		d: {
			equippedDefinition: "carriedDeadBankManagerA",
		}
	},
]};

var characterCore = { components: [
	{
		c: TransformComponent,
	},
	{
		c: ColliderComponent,
		d: {
			radius: 0.12,
			collisionGroup: CollisionCategoryDefinitions.CC_CHARACTER_CORE,
			collidesWith: [
				//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
			],
			senses: [
				//CollisionCategoryDefinitions.CC_AVOIDANCE,
				//CollisionCategoryDefinitions.CC_MOUSE,
				//CollisionCategoryDefinitions.CC_HOTSPOTS,
				//CollisionCategoryDefinitions.CC_PLANNING_TARGET,
				//CollisionCategoryDefinitions.CC_DOORS
			]
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			density: 1,
			elasticity: 0.0,
			// No friction whatsoever,
			// this helps in cases where characters ruff against walls etc.
			// and would that would make them spinning
			dynamicFriction: 0.0,
			staticFriction: 0.0,
			rollingFriction: 0.000,
		}
	},
]};

var characterBase = { components: [
	{
		c: TeamComponent,
		d: {
			name: "civilians"
		}
	},
	{
		c: SpeakerComponent,
	},
	{
		c: PathFollowerComponent,
		d: {
			/**
			 * When we're this close to the target, target has been reached
			 */
			 closeEnoughDistance: 0.2,
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			// Half density because characterCore half and has density 1,
			// together they have the same weight as before
			density: 0.5,
			elasticity: 0.0,
			// No friction whatsoever,
			// this helps in cases where characters ruff against walls etc.
			// and would that would make them spinning
			dynamicFriction: 0.0, // APPLIES ONLY AGAINST OTHER PHYSIC OBJECTS, NOT GROUND
			staticFriction: 0.0, // APPLIES ONLY AGAINST OTHER PHYSIC OBJECTS, NOT GROUND
			rollingFriction: 0.000, // APPLIES ONLY AGAINST OTHER PHYSIC OBJECTS, NOT GROUND
		}
	},
	{
		c: SteeringComponent,
		d: {
			currentMode: "walk",
			modes: {
				walk: {
					maxSpeed: 10.0,
					maxAngularSpeed: 160.0,
					stepInterval: 0.45,
				},
				run: {
					maxSpeed: 12.0,
					maxAngularSpeed: 160.0,
					stepInterval: 0.375,
				}
			}
		}
	},
	{
		c: ColliderComponent,
		d: {
			radius: 0.24,
			collisionGroup: CollisionCategoryDefinitions.CC_CHARACTERS,
			collidesWith: [
				//CollisionCategoryDefinitions.CC_CHARACTERS,
				//CollisionCategoryDefinitions.CC_WALLS,
				CollisionCategoryDefinitions.CC_DOORS,
				CollisionCategoryDefinitions.CC_BULLETS,
				//CollisionCategoryDefinitions.CC_STATIC_OBSTACLE,
				CollisionCategoryDefinitions.CC_DYNAMIC_OBSTACLE,
				CollisionCategoryDefinitions.CC_LIGHT_DYNAMIC_OBSTACLE,
			],
			senses: [
				CollisionCategoryDefinitions.CC_AVOIDANCE,
				CollisionCategoryDefinitions.CC_MOUSE,
				CollisionCategoryDefinitions.CC_HOTSPOTS,
				CollisionCategoryDefinitions.CC_PLANNING_TARGET,
				CollisionCategoryDefinitions.CC_DOORS,
				// Need to sense pickables, which are light dynamic obstacles
				CollisionCategoryDefinitions.CC_LIGHT_DYNAMIC_OBSTACLE,
			]
		}
	},
	{
		c: HotspotGoerComponent,
	},
	{
		c: EntranceGoerComponent,
	},
	{
		c: TransformComponent
	},
	{
		c: SpriterComponent,
		d: {
			spriterEntityName: "Character",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
		//	defaultCharMaps: ["goonNude"]
		}
	},
	{
		c: AnimationPriorityComponent,
	},
	{
		c: AudioAIListenerComponent,
		d: {
			threshold: 0.5
		}
	},
	{
		c: AudioSourceComponent,
	},
	{
		c: FieldOfViewComponent,
		d: {
			fov: 90,
			radius: 5,
			nearRadius: 0.5,
			visionGroup: CollisionCategoryDefinitions.CC_VISION,
			obstructors: [CollisionCategoryDefinitions.CC_WALLS | CollisionCategoryDefinitions.CC_DOORS],
		}
	},
	{
		c: HealthComponent,
		d: {
			maxHealth: 2,
			currentHealth: 2,
			spawnDamageOnCausersPosition: true,
			spawnOnDamage: {
				base: [
					"bulletHitPersonD",
				],
				fist: [
					"bulletHitPersonSmallB",
					"bulletHitPersonSmallC"
				],
				blunt: [
					"bulletHitPersonSmallB",
					"bulletHitPersonSmallC"
				]
			},
			spawnOnZeroHealth: {
				base: ["fxBloodmapA"],
				fist: [],
				blunt: [],
			},
			spawnAsBody: {
				base: ["deadGoon"],
			},
		}
	},
	{
		c: HealthBarComponent,
		d: {
			onlyDrawIfNotFull: true,
		}
	},
	{
		c: SpecialActionComponent,
		d: {
			actions: {
				use: {
					anims: ["use"],
				},
				poop: {
					anims: ["toilet"],
					minDuration: 2,
					maxDuration: 7,
					showProgress: true
				},
				call: {
					anims: ["use"],
					minDuration: 2,
					maxDuration: 3,
					showProgress: true
				},
				openDoor: {
					anims: ["use"],
				},
				closeDoor: {
					anims: ["use"],
				},
				pack:{
					anims: ["use"],
					showProgress: true,
					suspiciousness: 1.0,
					minDuration: 1,
					maxDuration: 1,
				},
				steal: {
					anims: ["use"],
					showProgress: true,
					suspiciousness: 1.0,
				},
				frozen: {
					anims: ["handsUp"],
					minDuration: 20,
					maxDuration: 60
				},
				idle: {
					anims: ["idle"],
					minDuration: 1,
					maxDuration: 3
				},
				lookAtSuspicious: {
					anims: ["idle"],
					minDuration: 2,
					maxDuration: 3
				},
				fiddleWithLock: {
					anims: ["use"],
					showProgress: true,
					suspiciousness: 2.0,
				},
				disguise: {
					anims: ["use"],
					showProgress: true,
					suspiciousness: 5.0,
					minDuration: 2,
					maxDuration: 2,
				},
				loot: {
					anims: ["use"],
					showProgress: true,
					suspiciousness: 1.0,
				},
			}
		}
	},
	{
		c: FieldOfViewMarkerComponent,
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.attack, ActionDefinitions.shoot, ActionDefinitions.drill],
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Character",
			type: "character",
			lootable: false,
			// TODO: only for goons?
			suspiciousness: 10.0,
			// TODO: eject per dude?
			//equippedDefinition: "carriedDeadBody",
			equippable: false,
			equipByDefault: false,
			mustBeEquipped: false
		}
	},
], children: [
	characterCore,
]};

var npcBase = { extend: characterBase, components: [
	{
		c: CharacterInfoComponent,
		d: {
			definition: characterInfo,
			name: "Default"
		}
	},
	{
		c: SteeringComponent,
		d: {
			currentMode: "walk",
			modes: {
				walk: {
					maxSpeed: 10.0,
					maxAngularSpeed: 160.0,
					stepInterval: 0.45,
				},
				run: {
					maxSpeed: 12.0,
					maxAngularSpeed: 160.0,
					stepInterval: 0.375,
				}
			},
			behaviors: {
				WallAndObstacleAvoidanceBehavior: {
					priority: 1.0,
					weight: 1.0,
					colliderRadius: 0.2,
					forwardFeelerSpeedScaleFactor: 15,
					sideFeelerDistanceFactor: 0.83,
					sideFeelerMinAngle: Math.PI / 64,
					sideFeelerMaxAngle: Math.PI / 8,
					sideFeelerMaxAngleCollisionCount: 20,
					collisionGroup: CollisionCategoryDefinitions.CC_CHARACTERS,
					collidesWith: [CollisionCategoryDefinitions.CC_WALLS, CollisionCategoryDefinitions.CC_STATIC_OBSTACLE/*, CollisionCategoryDefinitions.CC_DOORS*/]
				},/*
				CollisionAvoidanceBehavior: {
					priority: 2.0,
					weight: 1.0,
					colliderRadius: 0.24,
					detectionRadiusFactor: 5,
					collisionGroup: CollisionCategoryDefinitions.CC_AVOIDANCE,
					collidesWith: [
						CollisionCategoryDefinitions.CC_CHARACTERS,
						CollisionCategoryDefinitions.CC_DYNAMIC_OBSTACLE,
					]
				},*/
				WanderBehaviors: {
					priority: 3.0,
					weight: 1.0,
					wanderR: 0.24 * 1,
					wanderD: 1.41421 * 1,
					change: 0.3
				},
				SeekBehavior: {
					priority: 4.0,
					weight: 1.0,
				},
				ArriveBehavior: {
					priority: 5.0,
					weight: 1.0,
					decelerationFactor: 0.9
				},
				PathFollowingBehavior: {
					priority: 6.0,
					weight: 1.0,
					// These are still currently overridden by the PathFollowerComponent
					closeEnoughRadius: 0.10 * 1,
					slowDownRadius: 0.25 * 1,
				},
				AlignBehavior: {
					priority: 7.0,
					weight: 1.0,
				},
				FaceBehavior: {
					priority: 8.0,
					weight: 1.0,
				}
			}
		}
	},
	{
		c: FieldOfViewComponent,
		d: {
			// NPC vision is affected by light and shadows
			brightnessAffectsVision: true,
		}
	},
	{
		c: HealthComponent,
		d: {
			fatalDamageTypes: [
				"bullet",
				"fire",
				"explosion",
				"acid",
				"drill",
			]
		}
	},
	{
		c: IntimidatedComponent, d: {
			willpower: 0.15,
			intimidationThreshold: 0,
			intimidatedIndicatorDefinition: intimidatedIndicator,
			userCommandParameters: {
				ownActionDefinitions: [ActionDefinitions.move],
				possibleActionTooltipDefinition: actionTooltip,
				actionIndicatorDefinition: actionIndicator,
				textNotificationDefinition: goonTextNotification,
				idleStateName: "waitingForOrders",
				selectionIndicatorTag: "selectionIndicator",
				snapDistance: 0.3, // in meters
				reach: 0.75, // in meters
				characterMenuParameters: {
					menuDefinition: characterMenu,
					iconDefinition: characterMenuIconBase,
					holdToOpenTime: 0.0
				}
			},
			selectableParameters: {
				indicatorDefinition: selectionIndicator
			},
			aiPlanVisualizationParameters: {
				defaultStyle: {
					opacity: 0.10,
					thickness: 0.035,
					color: 0xadd6ff,
				},
				styles: {
					UserCommandAINode: { // need to use the full path because of stupid
						opacity: 0.05,
						thickness: 0.02,
						color: 0xadd6ff,
					}
				}
			}
		}
	},
	{
		c: EyewitnessComponent, d: {
			growthRate: 0.5,
			shrinkRate: 0.001,
			witnessIndicatorDefinition: witnessIndicator,
			smallWitnessIconDefinition: smallWitnessIcon,
		}
	},
	{ // this is for fading in and out based on fog of war
		c: TweenerComponent,
		d: {
			duration: 0.5,
			component: "SpriterComponent",
			field: "alpha",
			firstValueFromTarget: true
		}
	},
	{
		c: FogOfWarTargetComponent,
		d: {
			dontHideIfHasComponent: "UserCommandComponent",
			visualMarkerDefinition: fogOfWarLowVisualThreatTarget,
			auralMarkerDefinition: fogOfWarLowAuralThreatTarget,
			// TODO: maybe this should be in FOVSystem / FOVComponent
			// We cannot disable AudioSourceComponent as then no walk sounds play
			// and therefore no auralMarkerDefinitions are spawned
			enableComponentsWhenVisible: [/*"AudioSourceComponent",*/ "HealthBarComponent"],
			componentParamsWhenVisible: {
				TweenerComponent: {
					values: [0.0, 1.0]
				}
			},
			componentParamsWhenInvisible: {
				TweenerComponent: {
					values:  [1.0, 0.0]
				}
			},
			componentParamsWhenInvisibleButNotHidden: {
				TweenerComponent: {
					values: [1.0, 0.25]
				}
			}
		}
	},
]};

var mouseA = { extend: characterBase, components: [
	{
		c: SpriterComponent,
		d: {
			spriterEntityName: "MouseA",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_FLOOR_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["mouseA"]
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "mouse",
		}
	},
	{
		c: SpecialActionComponent,
		d: {
			actions: {
				use: {
					anims: ["use"],
				},
				idle: {
					anims: ["idle", "smoke"],
					order: "random",
					minDuration: 1,
					maxDuration: 3
				},
				mouse: { // plays the idle animation for 1 to 2 seconds, after which specialAction is done
					anims: ["idle", "smoke"],
					minDuration: 1,
					maxDuration: 2
				},
			}
		}
	},
	{
		c: SteeringComponent,
		d: {
			currentMode: "walk",
			modes: {
				walk: {
					maxSpeed: 25.0,
				},
				run: {
					maxSpeed: 26.0,
				}
			},
		}
	},
	{
		c: ColliderComponent,
		d: {
			radius: 0.15 * 1,
		}
	},
	{
		c: HealthComponent,
		d: {
			maxHealth: 1,
			currentHealth: 1,
			spawnAsBody: {
				base: ["deadMouseA"],
			},
		}
	},
	{ // this is for fading in and out based on fog of war
		c: TweenerComponent,
		d: {
			duration: 0.5,
			component: "SpriterComponent",
			field: "alpha",
			firstValueFromTarget: true
		}
	},
	{
		c: FogOfWarTargetComponent,
		d: {
			dontHideIfHasComponent: "UserCommandComponent",
			visualMarkerDefinition: fogOfWarLowVisualThreatTarget,
			auralMarkerDefinition: fogOfWarLowAuralThreatTarget,
			// TODO: maybe this should be in FOVSystem / FOVComponent
			// We cannot disable AudioSourceComponent as then no walk sounds play
			// and therefore no auralMarkerDefinitions are spawned
			enableComponentsWhenVisible: [/*"AudioSourceComponent",*/ "HealthBarComponent"],
			componentParamsWhenVisible: {
				TweenerComponent: {
					values: [0.0, 1.0]
				}
			},
			componentParamsWhenInvisible: {
				TweenerComponent: {
					values:  [1.0, 0.0]
				}
			},
			componentParamsWhenInvisibleButNotHidden: {
				TweenerComponent: {
					values: [1.0, 0.25]
				}
			}
		}
	},
]};

var customer = { extend: npcBase, components: [
	{
		c: EyewitnessComponent, d: {
			growthRate: 0.2,
			shrinkRate: 0.001, // forgotten in two seconds
		}
	},
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "civilianC",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["civilianA"]
		}
	},
	{
		c: LOSVisualizationComponent,
		d: {
			enabled: false,
			// colors selected and enabled from ai
			colorNotSeeing: -1,
			// colors selected and enabled from ai
			colorSeeing: 0xFFFF00,
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "customer",
		}
	},
	{
		c: SpecialActionComponent,
		d: {
			actions: {
				use: {
					anims: ["use"],
				},
				poop: {
					anims: ["sit"],
					minDuration: 2,
					maxDuration: 15,
					showProgress: true
				},
				call: {
					anims: ["use"],
					minDuration: 2,
					maxDuration: 3,
					showProgress: true
				},
				lookAround: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 2
				},
				idle: {
					anims: ["idle", "smoke"],
					order: "random",
					minDuration: 3,
					maxDuration: 10
				},
				idleInQueue: { // plays one of the specific animations at random, after which specialAction is done
					anims: ["idle", "smoke"],
					order: "random"
				},
				oogle: { // plays the idle animation for 5 to 10 seconds, after which specialAction is done
					anims: ["idle", "smoke"],
					minDuration: 3,
					maxDuration: 10
				},
				atCashier: {
					anims: ["use", "idle", "atCashier"],
					minDuration: 5,
					maxDuration: 20,
				},
				fiddleWithLock: {
					anims: ["use"],
					showProgress: true,
				}
			}
		}
	},
	{
		c: SteeringComponent,
		d: {
			currentMode: "walk",
			modes: {
				walk: {
					maxSpeed: 7.0,
				},
				run: {
					maxSpeed: 12.0,
				}
			},
		}
	},
	{
		c: HealthComponent,
		d: {
			maxHealth: 4,
			currentHealth: 4,
			spawnAsBody: {
				base: ["deadCustomerA"],
			},
		}
	},
	{
		c: InventoryComponent,
		d: {
			items: [
				"fistItem",
				"dollarBill",
			]
		}
	},
]};

var tutorialBum = { extend: npcBase, components: [
	{
		c: IntimidatedComponent, d: {
			willpower: 0.09,
			intimidationThreshold: 0.0,
		}
	},
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "civilianA",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["civilianA"]
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "tutorialBum",
		}
	},
	{
		c: SpecialActionComponent,
		d: {
			actions: {
				use: {
					anims: ["use"],
				},
				poop: {
					anims: ["toilet"],
					minDuration: 2,
					maxDuration: 15,
					showProgress: true
				},
				lookAround: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 2
				},
				idle: {
					anims: ["idle", "smoke"],
					order: "random",
					minDuration: 3,
					maxDuration: 10
				},
				oogle: { // plays the idle animation for 5 to 10 seconds, after which specialAction is done
					anims: ["idle", "smoke"],
					minDuration: 3,
					maxDuration: 10
				},
				fiddleWithLock: {
					anims: ["use"],
					showProgress: true,
					suspiciousness: 2.0,
				}
			}
		}
	},
	{
		c: SteeringComponent,
		d: {
			currentMode: "walk",
			modes: {
				walk: {
					maxSpeed: 7.0,
				},
				run: {
					maxSpeed: 11.0,
				}
			},
		}
	},
	{
		c: HealthComponent,
		d: {
			maxHealth: 4,
			currentHealth: 4,
			spawnAsBody: {
				base: ["deadCustomerA"],
			},
		}
	},
	{
		c: InventoryComponent,
		d: {
			items: [
				"fistItem",
				"dollarBill",
			]
		}
	},
]};

var tutorialBumB = { extend: tutorialBum, components: [
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "civilianB",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["civilianA"]
		}
	},
]};

var horseMaskMan = { extend: npcBase, components: [
	{
		c: EyewitnessComponent,
		d: {
			// No eyewitnessing for this dude
			enabled: false,
		}
	},
	{
		c: IntimidatedComponent,
		d: {
			// No intimidation for this dude
			enabled: false,
		}
	},
	{
		c: LOSVisualizationComponent,
		d: {
			// No los for this dude
			enabled: false,
		}
	},
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "civilianC",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["civilianA", "Horsehead"]
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "horse",
		}
	},
	{
		c: SpecialActionComponent,
		d: {
			actions: {
				use: {
					anims: ["use"],
				},
				poop: {
					anims: ["toilet"],
					minDuration: 2,
					maxDuration: 15,
					showProgress: true
				},
				call: {
					anims: ["use"],
					minDuration: 2,
					maxDuration: 3,
					showProgress: true
				},
				lookAround: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 2
				},
				idle: {
					anims: ["idle", "smoke"],
					order: "random",
					minDuration: 3,
					maxDuration: 10
				},
				idleInQueue: { // plays one of the specific animations at random, after which specialAction is done
					anims: ["idle", "smoke"],
					order: "random"
				},
				oogle: { // plays the idle animation for 5 to 10 seconds, after which specialAction is done
					anims: ["idle", "smoke"],
					minDuration: 3,
					maxDuration: 10
				},
				atCashier: {
					anims: ["use", "idle", "atCashier"],
					minDuration: 5,
					maxDuration: 20,
				},
				fiddleWithLock: {
					anims: ["use"],
					showProgress: true,
				}
			}
		}
	},
	{
		c: SteeringComponent,
		d: {
			currentMode: "walk",
			modes: {
				walk: {
					maxSpeed: 7.0,
				},
				run: {
					maxSpeed: 13.0,
				}
			},
		}
	},
	{
		c: HealthComponent,
		d: {
			maxHealth: 4,
			currentHealth: 4,
			spawnAsBody: {
				base: ["deadCustomerA"],
			},
		}
	},
	{
		c: InventoryComponent,
		d: {
			items: [
				"fistItem",
				"horseMaskItem",
				"lootableCocaineSmall"
			]
		}
	},/*
], children: [
	horseMask,*/
]};

var clerk = { extend: npcBase, components: [
	{
		c: IntimidatedComponent, d: {
			willpower: 0.315,
		}
	},
	{
		c: EyewitnessComponent, d: {
			growthRate: 0.2,
			shrinkRate: 0.001, // forgotten in ten seconds
		}
	},
	{
		c: FieldOfViewComponent,
		d: {
			fov: 100,
			radius: 7,
			nearRadius: 0.5,
			visionGroup: CollisionCategoryDefinitions.CC_VISION,
			obstructors: [CollisionCategoryDefinitions.CC_WALLS | CollisionCategoryDefinitions.CC_DOORS],
		}
	},
	{
		c: TeamComponent,
		d: {
			name: "clerks"
		}
	},
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "clerkA",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["clerkA"]
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "clerk",
		}
	},
	{
		c: SpecialActionComponent,
		d: {
			actions: {
				use: {
					anims: ["use"],
				},
				lookAround: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 2
				},
				poop: {
					anims: ["toilet"],
					minDuration: 4,
					maxDuration: 5,
					showProgress: true
				},
				getGoods: {
					anims: ["use"],
					minDuration: 4,
					maxDuration: 5,
					showProgress: false
				},
				call: {
					anims: ["use"],
					minDuration: 2,
					maxDuration: 3,
					showProgress: true
				},
				atCashier: {
					anims: ["use", "idle"],
					minDuration: 3,
					maxDuration: 3,
				},
				lookAroundWhileInvestigating: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 1.5
				},
				setAlarm: {
					anims: ["use"],
					showProgress: true
				},
				fiddleWithLock: {
					anims: ["use"],
					showProgress: true,
				}
			}
		}
	},
	{
		c: HealthComponent,
		d: {
			maxHealth: 6,
			currentHealth: 6,
			spawnAsBody: {
				base: ["deadClerkA"],
			},

		}
	},
	{
		c: InventoryComponent,
		d: {
			items: [
				"fistItem",
				"redKey",
				"infShotgunAmmo",
			]
		}
	},
]};

var clerkA = { extend: clerk, components: [
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "clerkA",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["clerkA"],
			animationSuffix: "narrow"
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "clerkA",
		}
	},
	{
		c: InventoryComponent,
		d: {
			items: [
				"fistItem",
			]
		}
	},
]};

var clerkB = { extend: clerk, components: [
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "clerkB",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["clerkB"]
		}
	},
	{
		c: HealthComponent,
		d: {
			spawnAsBody: {
				base: ["deadClerkB"],
			},
		}
	},
]};

var bankManager = { extend: clerk, components: [
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "bankManagerA",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["bankManagerA"]
		}
	},
	{
		c: HealthComponent,
		d: {
			spawnAsBody: {
				base: ["deadBankManagerA"],
			},
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "clerk",
			flagStates: {
				preferGunToCallingCops: true
			}
		}
	},
]};

// Use this as a base for any guard, cop etc.
var standingGuard = { extend: npcBase, components: [
	{
		c: TeamComponent,
		d: {
			name: "guards"
		}
	},
	{
		c: IntimidatedComponent, d: {
			willpower: 0.35,
		}
	},
	{
		c: EyewitnessComponent, d: {
			growthRate: 0.2,
			shrinkRate: 0.001, // forgotten in ten seconds
		}
	},
	{
		c: LOSVisualizationComponent,
		d: {
			colorNotSeeing: 0x8888ff,
			colorSeeing: 0xff8888,
		}
	},
	{
		c: SteeringComponent,
		d: {
			currentMode: "walk",
			modes: {
				walk: {
					maxSpeed: 5.0,
					maxAngularSpeed: 160.0,
					stepInterval: 0.45,
				},
				run: {
					maxSpeed: 12,
					maxAngularSpeed: 160.0,
					stepInterval: 0.375,
				}
			}
		}
	},
	/*
	{
		c: LOSVisualizationComponent,
		d: {
			colorNotSeeing: 0x8888ff,
			colorSeeing: 0xff8888,
		}
	},
	*/
	{
		c: AudioAIListenerComponent,
		d: {
			threshold: 0.5
		}
	},
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "guardA",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["guardA"]
		}
	},
	{
		c: FieldOfViewComponent,
		d: {
			fov: 60,
			radius: 4,
			visionGroup: CollisionCategoryDefinitions.CC_VISION,
			obstructors: [CollisionCategoryDefinitions.CC_WALLS | CollisionCategoryDefinitions.CC_DOORS],
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "standingGuard",
		}
	},
	{
		c: InventoryComponent,
		d: {
			items: [
				"stickItem",
				"smallChange",
			]
		}
	},
	{
		c: HealthComponent,
		d: {
			maxHealth: 5,
			currentHealth: 5,
			spawnAsBody: {
				base: ["deadGuardA"],
			},
		}
	},
	{
		c: SpecialActionComponent,
		d: {
			actions: {
				use: {
					anims: ["use"],
				},
				lookAround: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 2
				},
				poop: {
					anims: ["toilet"],
					minDuration: 4,
					maxDuration: 5,
					showProgress: true
				},
				call: {
					anims: ["use"],
					minDuration: 2,
					maxDuration: 3,
					showProgress: true
				},
				lookAroundWhilePatrolling: {
					anims: ["lookAround"],
					minDuration: 2.0,
					maxDuration: 3.0
				},
				lookAroundWhileInvestigating: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 1.5
				},
				setAlarm: {
					anims: ["use"],
					showProgress: true
				},
				fiddleWithLock: {
					anims: ["use"],
					showProgress: true,
				}
			}
		}
	},
]};

// Use this as a base for any patrolling guard
var patrollingGuard = { extend: standingGuard, components: [
	/* Same as normal guard
	{
		c: IntimidatedComponent, d: {
			willpower: 0.3,
		}
	},
	*/
	{
		c: FieldOfViewComponent,
		d: {
			fov: 100,
			radius: 7,
			nearRadius: 0.5,
			visionGroup: CollisionCategoryDefinitions.CC_VISION,
			obstructors: [CollisionCategoryDefinitions.CC_WALLS | CollisionCategoryDefinitions.CC_DOORS],
		}
	},
	/*
	{
		c: HealthComponent,
		d: {
			maxHealth: 6,
			currentHealth: 6,
		}
	},
	*/
	{
		c: AIComponent,
		d: {
			brain: "patrollingGuard"
		}
	},
]};


var patrollingGuardA = { extend: patrollingGuard, components: [
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "guardA",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["guardA"]
		}
	},
	{
		c: HealthComponent,
		d: {
			spawnAsBody: {
				base: ["deadGuardA"],
			},
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "patrollingGuard"
		}
	},
]};

var patrollingGuardB = { extend: patrollingGuardA, components: [
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "guardB",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["guardB"]
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "patrollingGuard"
		}
	},
]};

var patrollingGuardC = { extend: patrollingGuardA, components: [
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "guardB",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["guardC"]
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "patrollingGuard"
		}
	},
]};

var patrollingGuardSissy = { extend: patrollingGuardA, components: [
	{
		c: IntimidatedComponent, d: {
			willpower: 0.09,
			intimidationThreshold: 0.0,
		}
	},
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "guardB",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["guardSissy"]
		}
	},
	{
		c: InventoryComponent,
		d: {
			items: [
				"fistItem",
			//	"smallChange",
			//	"grayKeyPolice",
			]
		}
	},
	{
		c: HealthComponent,
		d: {
			maxHealth: 1.5,
			currentHealth: 1.5,
			spawnAsBody: {
				base: ["deadGuardSissy"],
			},
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "patrollingGuard"
		}
	},
]};

var pingPongGuardA = { extend: patrollingGuard, components: [
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "guardA",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["guardA"]
		}
	},
	{
		c: HealthComponent,
		d: {
			spawnAsBody: {
				base: ["deadGuardA"],
			},
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "pingPongGuard"
		}
	},
]};

var pingPongGuardB = { extend: pingPongGuardA, components: [
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "guardB",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["guardB"]
		}
	},
]};

var standingGuardB = { extend: standingGuard, components: [
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "guardB",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["guardB"]
		}
	},
]};

var tutorialGuardingBum = { extend: patrollingGuardA, components: [
	{
		c: IntimidatedComponent, d: {
			willpower: 0.09,
			intimidationThreshold: 0.0,
		}
	},
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "civilianA",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["civilianA"]
		}
	},
	{
		c: SteeringComponent,
		d: {
			currentMode: "walk",
			modes: {
				walk: {
					maxSpeed: 7.0,
				},
				run: {
					maxSpeed: 11.0,
				}
			},
		}
	},
	{
		c: FieldOfViewComponent,
		d: {
			fov: 100,
			radius: 3,
			visionGroup: CollisionCategoryDefinitions.CC_VISION,
			obstructors: [CollisionCategoryDefinitions.CC_WALLS | CollisionCategoryDefinitions.CC_DOORS],
		}
	},
	{
		c: HealthComponent,
		d: {
			maxHealth: 1.5,
			currentHealth: 1.5,
			spawnAsBody: {
				base: ["deadCustomerA"],
			},
		}
	},
	{
		c: InventoryComponent,
		d: {
			items: [
				"fistItem",
				"dollarBill",
			]
		}
	},
]};

var tutorialGuardingBumB = { extend: tutorialGuardingBum, components: [
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "civilianB",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["civilianA"]
		}
	},
]};

// Use this as a base for any cop
var standingCop = { extend: standingGuard, components: [
	{
		c: TeamComponent,
		d: {
			name: "cops"
		}
	},
	{
		c: SteeringComponent,
		d: {
			currentMode: "walk",
			modes: {
				walk: {
					maxSpeed: 7.5,
					maxAngularSpeed: 160.0,
					stepInterval: 0.45,
				},
				run: {
					maxSpeed: 12.0,
					maxAngularSpeed: 160.0,
					stepInterval: 0.375,
				}
			}
		}
	},
	{
		c: AudioAIListenerComponent,
		d: {
			threshold: 0.5
		}
	},
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "copA",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["copA"]
		}
	},
	{
		c: FieldOfViewComponent,
		d: {
			fov: 80,
			radius: 16,
			nearRadius: 2,
			visionGroup: CollisionCategoryDefinitions.CC_VISION,
			obstructors: [CollisionCategoryDefinitions.CC_WALLS | CollisionCategoryDefinitions.CC_DOORS],
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "standingCop",
		}
	},
	{
		c: InventoryComponent,
		d: {
			items: [
				"standardIssueHandgunItem",
				"dollarBill",
				"infPistolAmmo",
				"grayKeyPolice",
				"orangeKeyPolice",
				"redKeyPolice"
			]
		}
	},
	{
		c: HealthComponent,
		d: {
			maxHealth: 10,
			currentHealth: 10,
			spawnAsBody: {
				base: ["deadCopA"],
			},
		}
	},
	{
		c: SpecialActionComponent,
		d: {
			actions: {
				use: {
					anims: ["use"],
				},
				poop: {
					anims: ["toilet"],
					minDuration: 2,
					maxDuration: 15,
					showProgress: true
				},
				call: {
					anims: ["use"],
					minDuration: 2,
					maxDuration: 3,
					showProgress: true
				},
				lookAround: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 1.5
				},
			}
		}
	},
//], children: [
//	LightEntityDefinitions.copFlashlightCone,
]};


// use this as a base for any seeking cop
var seekAndDestroyCop = { extend: standingCop, components: [
	{
		c: AIComponent,
		d: {
			brain: "seekAndDestroyCop",
		}
	}
]};

var seekAndDestroyJailCop = { extend: seekAndDestroyCop, components: [
	{
		c: AIComponent,
		d: {
			brain: "seekAndDestroyJailCop",
		}
	}
]};

var deadCopZ = { extend: deadBody, components: [
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "civilianDying",
		}
	},
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "copZ",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_FLOOR_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["copA"]
		}
	},
	{
		c: LootableComponent,
		d: {
			indicatorDefinition: lootIndicatorBase,
			pickable: false,
		}
	},
	{
		c: ItemComponent,
		d: {
			equippedDefinition: "carriedDeadGuardA",
		}
	},
]};

var zombieCopBody = { components: [
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_FLOOR,
			sheet: "bodies",
			name: "copZ",
			defaultAnimationName: "dead",
		}
	},
	{
		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
		}
	},
]};

var zombieCop = { extend: standingCop, components: [
	{
		c: PathFollowerComponent,
		d: {
			/**
			 * When we're this close to the target, target has been reached
			 * Zombies are so slow, that this needs to be smaller than on normal
			 * dudes - normal dudes might  slide to position :(
			 */
			 closeEnoughDistance: 0.05,
		}
	},
	{
		c: InventoryComponent,
		d: {
			items: [
				"womitGunItem",
				"dollarBill",
				"infPistolAmmo",
			]
		}
	},
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "copZ",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["copA"]
		}
	},
	{
		c: SteeringComponent,
		d: {
			currentMode: "walk",
			modes: {
				walk: {
					maxSpeed: 2.0,
					maxAngularSpeed: 120.0,
					stepInterval: 0.45,
				},
				run: {
					maxSpeed: 3.5,
					maxAngularSpeed: 120.0,
					stepInterval: 0.375,
				}
			}
		}
	},
	{
		c: HealthComponent,
		d: {
			maxHealth: 30,
			currentHealth: 25,
			spawnAsBody: {
				base: ["zombieCopBody"],
			},
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "zombieCop",
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			density: 10,
		}
	},
	{
		c: SpawnerComponent,
		d: {
			entityDefinitions: ["zombieIdleSFX"],
			spawnOnFirstFrame: false,
			//maxInWorld: 5,
			total: -1,
			//timeLeft: 0.01,
			minInterval: 2,
			maxInterval: 5,
		//	spawnOrder: RANDOM,
		}
	},
	{
		c: SpecialActionComponent,
		d: {
			actions: {
				idle: {
					anims: ["idle"],
					minDuration: 3.0,
					maxDuration: 4.5
				},
				lookAround: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 1.5
				},
			}
		}
	},
]};

var zombieFodderBody = { components: [
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_FLOOR,
			sheet: "bodies",
			name: "civilianZ",
			defaultAnimationName: "dead",
		}
	},
	{
		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
		}
	},
]};

var zombieFodder = { extend: npcBase, components: [
	{
		c: EyewitnessComponent,
		d: {
			// No eyewitnessing for this dude
			enabled: false,
		}
	},
	{
		c: IntimidatedComponent,
		d: {
			// No intimidation for this dude
			enabled: false,
		}
	},
	{
		c: LOSVisualizationComponent,
		d: {
			// No los for this dude
			enabled: false,
		}
	},
	{
		c: PathFollowerComponent,
		d: {
			/**
			 * When we're this close to the target, target has been reached
			 * Zombies are so slow, that this needs to be smaller than on normal
			 * dudes - normal dudes might  slide to position :(
			 */
			 closeEnoughDistance: 0.05,
		}
	},
	{
		c: InventoryComponent,
		d: {
			items: [
				"womitShortItem",
			//	"dollarBill",
				"infPistolAmmo",
			]
		}
	},
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "civilianZ",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["civilianA"]
		}
	},
	{
		c: SteeringComponent,
		d: {
			currentMode: "walk",
			modes: {
				walk: {
					maxSpeed: 3.0,
					maxAngularSpeed: 120.0,
					stepInterval: 0.45,
				},
				run: {
					maxSpeed: 3.0,
					maxAngularSpeed: 120.0,
					stepInterval: 0.375,
				}
			}
		}
	},
	{
		c: HealthComponent,
		d: {
			maxHealth: 4,
			currentHealth: 4,
			spawnAsBody: {
				base: ["zombieFodderBody"],
			},
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "zombie",
		}
	},
	{
		c: SpawnerComponent,
		d: {
			entityDefinitions: ["zombieIdleSFX"],
			spawnOnFirstFrame: false,
			//maxInWorld: 5,
			total: -1,
			//timeLeft: 0.01,
			minInterval: 7,
			maxInterval: 10,
		//	spawnOrder: RANDOM,
		}
	},
	{
		c: SpecialActionComponent,
		d: {
			actions: {
				idle: {
					anims: ["idle"],
					minDuration: 3.0,
					maxDuration: 4.5
				},
				lookAround: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 1.5
				},
			}
		}
	},
]};

var slowRandomCustomerSpawner = { extend: slowRandomSpawner, components: [
	{
		c: SpawnerComponent,
		d: {
			entityDefinitions: ["customer"],
			maxInWorld: 2
		}
	}
]};

var circuitZombieSpawner = { components: [
	{
		c: SpawnerComponent,
		d: {
			entityDefinitions: ["zombieCop"],
			spawnOnFirstFrame: false,
			minInterval: 0,
			maxInterval: 5,
			total: 1,
		}
	}
	{
		c: CircuitComponent,
		d: {
			toggleComponents: ["SpawnerComponent"],
			isPowerSource: true,
		}
	},
]};

var carriedFlyGuyA = { extend: carriedDeadBody, components: [
	{
		c: SpriteComponent,
		d: {
	//		sheet: "flyGuyA",
			name: "flyGuyA",
		}
	},
]};

var deadFlyGuyA = { components: [
	{
		c: SuspicionIncreaserComponent,
		d:{
			increaseAmount: 1,
		}
	},
	{
		c: FieldOfViewMarkerComponent,
	},
	{
		c: AudioSourceComponent,
		d: {
			autoPlay: "civilianDying",
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.pickup],
		}
	},
	{
		c: LootableComponent,
		d: {
			indicatorDefinition: lootIndicatorBase,
			pickable: true,
		}
	},
	{
		c: ItemComponent,
		d: {
			name: "Body",
			type: "body",
			suspiciousness: 10.0,
			equippedDefinition: "carriedFlyGuyA",
			equippable: true,
			equipByDefault: true,
			equipSlot: EquipmentSlot.leftHand,
			mustBeEquipped: true,
			inventorySpriteName: "ui-base-icon-body",
		}
	},
	{
		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
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_FLOOR,
			sheet:"bodies",
			name: "flyGuyA",
			defaultAnimationName: "dead",
		}
	},
]};

var characterShadow = { components: [
	{
		c: TransformComponent,
	},
/*	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_FLOOR_OBJECTS,
			sheet: "flyGuyA",
			name: "flyGuyA",
			defaultAnimationName: "shadow",
		//	tint: 0xff448a,
		}
	},
*/
]};

var flyGuyBase = { extend: npcBase, components: [
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "flyGuyA",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["flyGuyA"]
		}
	},
	{
		c: TeamComponent,
		d: {
			name: "flyGuys"
		}
	},
	{
		c: IntimidatedComponent, d: {
			willpower: 1,
		}
	},
	{
		c: EyewitnessComponent, d: {
			growthRate: 2,
			shrinkRate: 0.001, // forgotten in ten seconds
		}
	},
	{
		c: LOSVisualizationComponent,
		d: {
			colorNotSeeing: 0x8888ff,
			colorSeeing: 0xff8888,
		}
	},
	{
		c: SteeringComponent,
		d: {
			currentMode: "walk",
			modes: {
				walk: {
					maxSpeed: 10,
					maxAngularSpeed: 160.0,
					stepInterval: 0.45,
				},
				run: {
					maxSpeed: 12.5,
					maxAngularSpeed: 160.0,
					stepInterval: 0.375,
				}
			}
		}
	},
	/*
	{
		c: LOSVisualizationComponent,
		d: {
			colorNotSeeing: 0x8888ff,
			colorSeeing: 0xff8888,
		}
	},
	*/
	{
		c: AudioAIListenerComponent,
		d: {
			threshold: 0.5
		}
	},
	/*
	{
		c: SpriteComponent,
		d: {
			sheet: "flyGuyA",
			name: "flyGuyA",
		//	tint: 0xff448a,
		}
	},
	*/
	{
		c: FieldOfViewComponent,
		d: {
			fov: 140,
			radius: 6,
			visionGroup: CollisionCategoryDefinitions.CC_VISION,
			obstructors: [CollisionCategoryDefinitions.CC_WALLS | CollisionCategoryDefinitions.CC_DOORS],
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "patrollingFlyGuy",
		}
	},
	{
		c: InventoryComponent,
		d: {
			items: [
				"stickItem",
				"smallChange",
			]
		}
	},
	{
		c: HealthComponent,
		d: {
			maxHealth: 6,
			currentHealth: 6,
			spawnAsBody: {
				base: ["deadFlyGuyA"],
			},
		}
	},
	{
		c: SpecialActionComponent,
		d: {
			actions: {
				use: {
					anims: ["use"],
				},
				lookAround: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 2
				},
				poop: {
					anims: ["toilet"],
					minDuration: 4,
					maxDuration: 5,
					showProgress: true
				},
				call: {
					anims: ["use"],
					minDuration: 2,
					maxDuration: 3,
					showProgress: true
				},
				lookAroundWhilePatrolling: {
					anims: ["lookAround"],
					minDuration: 2.0,
					maxDuration: 3.0
				},
				lookAroundWhileInvestigating: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 1.5
				},
				setAlarm: {
					anims: ["use"],
					showProgress: true
				},
				fiddleWithLock: {
					anims: ["use"],
					showProgress: true,
				}
			}
		}
	},
], children: [
	characterShadow,
]};

var standingArmedFlyGuy = { extend: flyGuyBase, components: [
	{
		c: InventoryComponent,
		d: {
			items: [
			//	"stickItem",
				"smallChange",
				"oldPistolItem",
				"infPistolAmmo",
				"handgunAmmoPickup2",
			]
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "standingFlyGuy",
		}
	},
]};

var patrollingArmedFlyGuy = { extend: flyGuyBase, components: [
	{
		c: InventoryComponent,
		d: {
			items: [
			//	"stickItem",
				"smallChange",
				"oldPistolItem",
				"infPistolAmmo",
				"handgunAmmoPickup2",
			]
		}
	},
]};

var unarmedArmedFlyGuy = { extend: flyGuyBase, components: [
	{
		c: HealthComponent,
		d: {
			spawnAsBody: {
				base: ["deadFlyGuyA"],
			},
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "unarmedFlyGuy",
			flagStates: {
				preferGunToCallingCops: true
			}
		}
	},
	{
		c: FieldOfViewComponent,
		d: {
			fov: 140,
			radius: 6,
			visionGroup: CollisionCategoryDefinitions.CC_VISION,
			obstructors: [CollisionCategoryDefinitions.CC_WALLS | CollisionCategoryDefinitions.CC_DOORS],
		}
	},
	{
		c: LOSVisualizationComponent,
		d: {
			colorNotSeeing: 0x8888ff,
			colorSeeing: 0xff8888,
		}
	},
	{
		c: SpecialActionComponent,
		d: {
			actions: {
				use: {
					anims: ["use"],
				},
				lookAround: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 2
				},
				poop: {
					anims: ["toilet"],
					minDuration: 4,
					maxDuration: 5,
					showProgress: true
				},
				call: {
					anims: ["use"],
					minDuration: 2,
					maxDuration: 3,
					showProgress: true
				},
				lookAroundWhilePatrolling: {
					anims: ["lookAround"],
					minDuration: 2.0,
					maxDuration: 3.0
				},
				lookAroundWhileInvestigating: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 1.5
				},
				setAlarm: {
					anims: ["use"],
					showProgress: true
				},
				fiddleWithLock: {
					anims: ["use"],
					showProgress: true,
				}
			}
		}
	},
//], children: [
//	characterShadow,
]};

var aggressiveCivilian = { extend: npcBase, components: [
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "civilianC",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["civilianA"]
		}
	},
	{
		c: HealthComponent,
		d: {
			maxHealth: 4,
			currentHealth: 4,
			spawnAsBody: {
				base: ["deadGuardA"],
			},
		}
	},
	{
		c: TeamComponent,
		d: {
			name: "guards"
		}
	},
	{
		c: IntimidatedComponent, d: {
			willpower: 0.2,
		}
	},
	{
		c: EyewitnessComponent, d: {
			growthRate: 0.2,
			shrinkRate: 0.001, // forgotten in ten seconds
		}
	},
	{
		c: SteeringComponent,
		d: {
			currentMode: "walk",
			modes: {
				walk: {
					maxSpeed: 5.0,
					maxAngularSpeed: 160.0,
					stepInterval: 0.45,
				},
				run: {
					maxSpeed: 12,
					maxAngularSpeed: 160.0,
					stepInterval: 0.375,
				}
			}
		}
	},
	/*
	{
		c: LOSVisualizationComponent,
		d: {
			colorNotSeeing: 0x8888ff,
			colorSeeing: 0xff8888,
		}
	},
	*/
	{
		c: AudioAIListenerComponent,
		d: {
			threshold: 0.5
		}
	},
	{
		c: FieldOfViewComponent,
		d: {
			fov: 60,
			radius: 4,
			visionGroup: CollisionCategoryDefinitions.CC_VISION,
			obstructors: [CollisionCategoryDefinitions.CC_WALLS | CollisionCategoryDefinitions.CC_DOORS],
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "standingGuard",
		}
	},
	{
		c: InventoryComponent,
		d: {
			items: [
				"stickItem",
				"smallChange",
			]
		}
	},
	{
		c: SpecialActionComponent,
		d: {
			actions: {
				use: {
					anims: ["use"],
				},
				lookAround: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 2
				},
				poop: {
					anims: ["toilet"],
					minDuration: 4,
					maxDuration: 5,
					showProgress: true
				},
				call: {
					anims: ["use"],
					minDuration: 2,
					maxDuration: 3,
					showProgress: true
				},
				lookAroundWhilePatrolling: {
					anims: ["lookAround"],
					minDuration: 2.0,
					maxDuration: 3.0
				},
				lookAroundWhileInvestigating: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 1.5
				},
				setAlarm: {
					anims: ["use"],
					showProgress: true
				},
				fiddleWithLock: {
					anims: ["use"],
					showProgress: true,
				}
			}
		}
	},
]};

//SECRET SERVICE
var secretServiceBase = { extend: npcBase, components: [
	{
		c: SpriterComponent,
		d: {
			//spriterEntityName: "flyGuyA",
			// y-sorting might break some characters.
			// this hierarchy needs to be manually sorted
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "spriterCharacters",
			defaultCharMaps: ["secretServiceA"]
		}
	},
	{
		c: TeamComponent,
		d: {
			name: "guards"
		}
	},
	{
		c: IntimidatedComponent, d: {
			willpower: 1,
		}
	},
	{
		c: EyewitnessComponent, d: {
			growthRate: 2,
			shrinkRate: 0.001, // forgotten in ten seconds
		}
	},
	{
		c: LOSVisualizationComponent,
		d: {
			colorNotSeeing: 0x8888ff,
			colorSeeing: 0xff8888,
		}
	},
	{
		c: SteeringComponent,
		d: {
			currentMode: "walk",
			modes: {
				walk: {
					maxSpeed: 10,
					maxAngularSpeed: 160.0,
					stepInterval: 0.45,
				},
				run: {
					maxSpeed: 13,
					maxAngularSpeed: 160.0,
					stepInterval: 0.375,
				}
			}
		}
	},
	/*
	{
		c: LOSVisualizationComponent,
		d: {
			colorNotSeeing: 0x8888ff,
			colorSeeing: 0xff8888,
		}
	},
	*/
	{
		c: AudioAIListenerComponent,
		d: {
			threshold: 0.5
		}
	},
	/*
	{
		c: SpriteComponent,
		d: {
			sheet: "flyGuyA",
			name: "flyGuyA",
		//	tint: 0xff448a,
		}
	},
	*/
	{
		c: FieldOfViewComponent,
		d: {
			fov: 140,
			radius: 6,
			visionGroup: CollisionCategoryDefinitions.CC_VISION,
			obstructors: [CollisionCategoryDefinitions.CC_WALLS | CollisionCategoryDefinitions.CC_DOORS],
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "patrollingFlyGuy",
		}
	},
	{
		c: InventoryComponent,
		d: {
			items: [
				"stickItem",
				"smallChange",
			]
		}
	},
	{
		c: HealthComponent,
		d: {
			maxHealth: 6,
			currentHealth: 6,
			spawnAsBody: {
				base: ["deadGuardA"],
			},
		}
	},
	{
		c: SpecialActionComponent,
		d: {
			actions: {
				use: {
					anims: ["use"],
				},
				lookAround: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 2
				},
				poop: {
					anims: ["toilet"],
					minDuration: 4,
					maxDuration: 5,
					showProgress: true
				},
				call: {
					anims: ["use"],
					minDuration: 2,
					maxDuration: 3,
					showProgress: true
				},
				lookAroundWhilePatrolling: {
					anims: ["lookAround"],
					minDuration: 2.0,
					maxDuration: 3.0
				},
				lookAroundWhileInvestigating: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 1.5
				},
				setAlarm: {
					anims: ["use"],
					showProgress: true
				},
				fiddleWithLock: {
					anims: ["use"],
					showProgress: true,
				}
			}
		}
	},
], children: [
	characterShadow,
]};

var standingArmedSecretService = { extend: secretServiceBase, components: [
	{
		c: InventoryComponent,
		d: {
			items: [
			//	"stickItem",
				"smallChange",
				"oldPistolItem",
				"infPistolAmmo",
				"handgunAmmoPickup2",
			]
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "standingFlyGuy",
		}
	},
]};

var patrollingArmedSecretService = { extend: secretServiceBase, components: [
	{
		c: InventoryComponent,
		d: {
			items: [
			//	"stickItem",
				"smallChange",
				"oldPistolItem",
				"infPistolAmmo",
				"handgunAmmoPickup2",
			]
		}
	},
]};

var unarmedArmedSecretService = { extend: secretServiceBase, components: [
	{
		c: HealthComponent,
		d: {
			spawnAsBody: {
				base: ["deadGuardA"],
			},
		}
	},
	{
		c: AIComponent,
		d: {
			brain: "unarmedFlyGuy",
			flagStates: {
				preferGunToCallingCops: true
			}
		}
	},
	{
		c: FieldOfViewComponent,
		d: {
			fov: 140,
			radius: 6,
			visionGroup: CollisionCategoryDefinitions.CC_VISION,
			obstructors: [CollisionCategoryDefinitions.CC_WALLS | CollisionCategoryDefinitions.CC_DOORS],
		}
	},
	{
		c: LOSVisualizationComponent,
		d: {
			colorNotSeeing: 0x8888ff,
			colorSeeing: 0xff8888,
		}
	},
	{
		c: SpecialActionComponent,
		d: {
			actions: {
				use: {
					anims: ["use"],
				},
				lookAround: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 2
				},
				poop: {
					anims: ["toilet"],
					minDuration: 4,
					maxDuration: 5,
					showProgress: true
				},
				call: {
					anims: ["use"],
					minDuration: 2,
					maxDuration: 3,
					showProgress: true
				},
				lookAroundWhilePatrolling: {
					anims: ["lookAround"],
					minDuration: 2.0,
					maxDuration: 3.0
				},
				lookAroundWhileInvestigating: {
					anims: ["lookAround"],
					minDuration: 0.5,
					maxDuration: 1.5
				},
				setAlarm: {
					anims: ["use"],
					showProgress: true
				},
				fiddleWithLock: {
					anims: ["use"],
					showProgress: true,
				}
			}
		}
	},
//], children: [
//	characterShadow,
]};
