**Request Understanding:**
The user wants to add two significant combat abilities to the player:
1. **Cloning**: The ability to create duplicate copies of the player character that autonomously attack the boss and enemy minions.
2. **Shielding**: A protective barrier capability that renders the player impervious to damage and negative effects for a duration.
**Impact Assessment:**
- **DOM/HTML**: Need to add buttons for these new actions (Clone, Shield) and update the Player's HTML structure to include a visual shield element.
- **CSS**: New styles for the shield visual effect, the clone appearance (to differentiate slightly or reuse player styles), and an updated button layout to accommodate the extra controls.
- **JavaScript**:
- Logic to spawn "Clone" entities that use the player's visual assets but behave like friendly AI troops.
- Logic to activate the shield state and prevent damage in `damagePlayer`.
- AI updates so clones target enemies effectively.
- Cooldown management for these powerful new skills.
**Implementation Strategy:**
1. **Visuals**: Extract the player's inner HTML construction into a reusable constant so Clones and the Player look identical. Add a `.shield-bubble` div to this structure.
2. **Controls**: Expand the `action-cluster` in the UI. Reposition existing buttons to form an ergonomic arc and add `btn-clone` and `btn-shield`.
3. **Shield Logic**: Add `shieldActive` boolean to player state. When active, the `.shield-bubble` scales up via CSS class. In `damagePlayer`, if `shieldActive` is true, ignore damage and show a "BLOCKED" floating text.
4. **Clone Logic**: Create a `spawnClone()` function. It spawns an entity of type `troop` with `subType: 'clone'`.
5. **AI Logic**: Update `updateAI()` to handle `subType: 'clone'`. These entities will seek the Boss or nearest Minion and perform melee attacks using a simplified version of the player's attack animation.
Mythic Squad: God Wars