Spielerando

Credit "defeat ten enemies with fire" when the enemy burns down after a weapon swap

The player sets an enemy alight, switches to the pistol, and the enemy dies of the flames a moment later. Which weapon gets the defeat? Counting the weapon in hand is wrong, and so is counting only the first one used. Here is a fair way to decide.

Why this works

Damage keeps working after the player has changed tools, so the weapon in hand at the end says little. Stamping every bit of harm with where it came from, and finding which one emptied the last of the health, credits what truly did the work.

When not to use it

Skip it when any kill by any means should count toward the goal, or in a game with only one weapon. Then count defeats plainly; the extra bookkeeping would only add ways to be wrong.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • A diagram of every state
  • 23 lines of example code with 5 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Credit "defeat ten enemies with fire" when the enemy burns down after a weapon swap" (read_entry weapon-specific-kill-credit-for-burning-enemies) in my game. Build it step by step, and show me how you checked that it works.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP