--This file describes the various "get_" functions.

-------------------------------------------------
--       Rendering, Geometry, and Motion
-------------------------------------------------

function p.get_radius() return 0.1 end
function p.get_collides() return true end
function p.get_solid_wrt_player() return false end

-------------------------------------------------
--              Damage AND Health
-------------------------------------------------

function p.get_getting_hit_type() return "" end
function p.get_hitting_type() return "" end

function p.get_health() return 10 end

-------------------------------------------------
--                   Shooting
-------------------------------------------------

function p.get_shoots() return false end

-------------------------------------------------
--                   Sound
-------------------------------------------------

-------------------------------------------------
--              Identity String
-------------------------------------------------

-- If not defined, then false.
function p.get_identifies() return false end

-------------------------------------------------
--            Type Init Function
-------------------------------------------------

function p.type_init(id)
    ia_ment_set_builtin_var_f(id, "__ttl", 60.0)
    ia_ment_set_builtin_var_f(id, "__radius", 0.1)
    ia_ment_set_builtin_var_s(id, "__mesh", "sphere_pink")
end

-------------------------------------------------
--         Movement Hitting Callbacks
-------------------------------------------------

--This functions returns true to signify that
--the projectile should stop moving.
function p.on_block_hit(
    inst_id,
    level, bp, lp,
    normal_side, normal)
--
    local adj_bp = std.get_adj_bp(bp, normal_side)

    --Will not place a block if it intersects the player.
    if not game_can_build_block.can_build_block(level, adj_bp) then return true end

    --Adding the block.
    ga_block_change_perm(level, adj_bp, "block_s")
    -- ga_block_change_rl(level, adj_bp, "block_s", 10) --Adding for 10 seconds.

    return true
end
