- type: entity
  parent: [BaseItem, BaseTraitorContraband] # starcup: shared contraband level with nt gear
  id: ChameleonProjectorNoBattery
  name: chameleon projector
  description: Holoparasite technology used to create a hard-light replica of any object around you. Disguise is destroyed when picked up or deactivated.
  components:
  - type: Sprite
    sprite: /Textures/Objects/Devices/chameleon_projector.rsi
    layers:
    - state: icon
    - state: powered
      map: [ "enum.PowerDeviceVisualLayers.Powered" ]
    - state: decharging
      map: [ "enum.PowerDeviceVisualLayers.Charging" ]
      visible: false
  - type: ChameleonProjector
    whitelist:
      components:
      - Anchorable
      - Item
      tags:
      - Bot # for funny bot moments
    blacklist:
      components: # TODO: This blacklist should be cut down by a lot once Chameleon Projector code is less buggy. See #40510
      - ChameleonDisguise # no becoming kleiner
      - Door # no faking doors
      - MindContainer # no
      - Pda # PDAs currently make you invisible /!\
      - SubFloorHide # no hiding under the floor
      tags:
      - Catwalk # Catwalks make you invisible
      - Wall # Walls make you invisible
      - Window # Windows make you invisible
    disguiseProto: ChameleonDisguise
  - type: StaticPrice
    price: 5000

- type: entity
  parent: ChameleonProjectorNoBattery
  id: ChameleonProjector
  name: chameleon projector
  description: Holoparasite technology used to create a hard-light replica of any object around you. Disguise is destroyed when picked up or deactivated.
  suffix: Battery
  components:
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.BatteryVisuals.State:
        enum.PowerDeviceVisualLayers.Powered:
          Full: { visible: true }
          Neither: { visible: true }
          Empty: { visible: false }
      enum.BatteryVisuals.Charging:
        enum.PowerDeviceVisualLayers.Charging:
          Charging: { visible: false }
          Decharging: { visible: true }
          Constant: { visible: false }
  - type: BatteryVisuals
  - type: ContainerContainer
    containers:
      cell_slot: !type:ContainerSlot
  - type: ItemSlots
    slots:
      cell_slot:
        name: power-cell-slot-component-slot-name-default
        startingItem: PowerCellMedium
  - type: PowerCellSlot
    cellSlotId: cell_slot
  - type: PowerCellDraw
    drawRate: 4 # About 3 minutes with a medium cell.
  - type: ToggleCellDraw
  - type: ItemToggle
    onActivate: false
    onUse: false

- type: entity
  categories: [ HideSpawnMenu ]
  id: ChameleonDisguise
  name: Urist McKleiner
  components:
  # this and the name/desc get replaced, this is just placeholder incase something goes wrong
  - type: Sprite
    sprite: /Textures/Mobs/Species/Human/parts.rsi
    state: full
  - type: Transform
    noRot: true # players rotation and anchor is used instead
  - type: InteractionOutline
  - type: Clickable
  - type: Damageable
  - type: ChameleonDisguise

# actions
- type: entity
  parent: BaseAction
  id: ActionDisguiseNoRot
  name: Toggle Rotation
  description: Use this to prevent your disguise from rotating, making it easier to hide in some scenarios.
  components:
  - type: Action
    icon: Interface/VerbIcons/refresh.svg.192dpi.png
    itemIconStyle: BigAction
  - type: InstantAction
    event: !type:DisguiseToggleNoRotEvent

- type: entity
  parent: BaseAction
  id: ActionDisguiseAnchor
  name: Toggle Anchored
  description: For many objects you will want to be anchored to not be completely obvious.
  components:
  - type: Action
    icon:
      sprite: Objects/Tools/wrench.rsi
      state: icon
    itemIconStyle: BigAction
  - type: InstantAction
    event: !type:DisguiseToggleAnchoredEvent
