player.try_get_death_damage_mod

a.k.a. player.get_death_damage_mod

When called on a player on the exact frame that that player died, this function returns a number representing a modifier for their cause of death. This number complements the "damage reporting types" that can be listed in a Post-Game Carnage Report. The potential values are listed and named in the damage reporting modifier enum.

When called on any other frame, even while the player is dead, this function does not return a value:

This function returns number. Calling this function without storing its return value in a variable is an error.

Example

--
-- Award points for killing any other player (including allies) with a splatter.
--
for each player do
   if current_player.killer_type_is(guardians | suicide | kill | betrayal | quit) then
      --
      -- The player is dead.
      --
      global.number[0] = current_player.get_death_damage_mod()
      if global.number[0] == enums.damage_reporting_mod.splatter then
         global.player[0] = current_player.get_killer()
         global.player[0].score += 1
      end
   end
end

See also