Skip to content

Add carry bomb feature: pick up, hold (timer frozen), drop or throw#15

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-bomb-holding-feature
Draft

Add carry bomb feature: pick up, hold (timer frozen), drop or throw#15
Copilot wants to merge 2 commits intomainfrom
copilot/add-bomb-holding-feature

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 14, 2026

Summary

Implements the Carry Bomb feature from the original Atomic Bomberman.

When the player collects the blue glove powerup (CanGrabBombs), they can now:

  1. Pick up a bomb — stand on the bomb and double-press the first action key. The bomb is lifted, its timer is frozen, and it follows the player.
  2. Drop the bomb — single-press the first action key while carrying. The bomb is placed at the player's feet and the timer resumes.
  3. Throw the bomb — double-press the first action key while carrying. The bomb flies in the current facing direction (same arc as before).

Changes

units/uatomic_common.pas

  • Add bmHeld to TBombMoveDir enum
  • Add HeldBombIndex: Integer to server-side TPlayer record
  • Add IsHeld: Boolean to client-side TBombInfo record
  • Bump ProtocollVersion 13 → 14 (stream format changed) and Version 0.13001 → 0.13002

units/uatomic_field.pas

  • FielWalkable / GetBombIndex: exclude bmHeld bombs (carried bomb is transparent to movement/kick)
  • HandleActionPlayer: early-exit block handles drop (aaFirst) and throw (aaFirstDouble) when player is carrying; pick-up code in aaFirstDouble + CanGrabBombs now sets bmHeld + HeldBombIndex instead of immediately throwing; punch and remote-trigger code exclude bmHeld bombs
  • HandleBombs: new bmHeld case undoes the per-frame lifetime increment (same pattern as bmFly) and updates bomb position to follow the carrier (skipped while player is flying); flame-triggered detonation check excludes bmHeld; bomb-removal loop keeps HeldBombIndex consistent for all players
  • KillPlayer: releases held bomb (sets to bmNone) before marking player as dying
  • AppendGamingData: serialises IsHeld flag per bomb
  • GetAiInfo: exposes Held field in TAiBombInfo

server/uatomic_server.pas

  • Initialises HeldBombIndex := -1 in the per-round player setup loop

client/ugame.pas

  • Reads IsHeld from the game stream
  • RenderBombs: skips held bombs
  • New RenderHeldBombs: draws held bombs above the player's head at atomic_Layer + epsilon (rendered after all players)

server/uai_types.pas + ai_c/ai_types.h

  • Added Held: cBool / bool Held field to the AI bomb info structs

MANUAL.md

  • Updated first-action and double-press descriptions to reflect the new carry mechanic

Copilot AI and others added 2 commits April 14, 2026 15:21
@ChrisWiGit
Copy link
Copy Markdown
Collaborator

@PascalCorpsman für Samstag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants