ElixirDoom.Items (elixir_doom v0.1.0)

Copy Markdown View Source

Picking things up: what each pickup gives, the message it shows, the sound it makes, and whether it is taken at all — a full medikit is left lying when health is full.

ElixirDoom.Items.touch(world, item_id, player_mobj_id)

Summary

Functions

Give player id clips clips of ammunition kind (0 for half a clip): {world, taken?}.

Player thing toucher_id touches item item_id.

Whether player may fire weapon now.

Functions

add_ammo(world, id, kind, clips)

@spec add_ammo(ElixirDoom.World.t(), term(), atom(), non_neg_integer()) ::
  {ElixirDoom.World.t(), boolean()}

Give player id clips clips of ammunition kind (0 for half a clip): {world, taken?}.

touch(world, item_id, toucher_id)

@spec touch(ElixirDoom.World.t(), term(), term()) :: ElixirDoom.World.t()

Player thing toucher_id touches item item_id.

usable?(player, weapon)

@spec usable?(map(), atom()) :: boolean()

Whether player may fire weapon now.