Skip to content

Commit

Permalink
Added TR3 savegame crystal functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lwmte committed May 5, 2015
1 parent c80ed18 commit fcf4083
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions scripts/entity/entity_functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,20 @@ function pickup_init(id, item_id) -- Pick-ups
end;
end

function crystal_TR3_init(id) -- "Savegame" crystal (TR3 version)

setEntityTypeFlag(id, ENTITY_TYPE_DECORATION);
setEntityActivity(id, 1);

entity_funcs[id].onLoop = function(object_id)
if(getEntityDistance(player, object_id) < 512.0) then
playSound(SOUND_MEDIPACK);
changeCharacterParam(player, PARAM_HEALTH, 200);
disableEntity(object_id);
end;
end
end

function fallblock_init(id) -- Falling block (TR1-3)

local f1, f2, f3 = getEntityFlags(id); -- f1 - state flags, f2 - type flags, f3 - callback flags
Expand Down
2 changes: 1 addition & 1 deletion scripts/entity/entity_properties.lua
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ tr3_entity_tbl[176] = {coll = 0x00}; -- Small medipack (pick-up)
tr3_entity_tbl[177] = {coll = 0x00}; -- Large medipack (pick-up)
tr3_entity_tbl[178] = {coll = 0x00}; -- Flares (pick-up)
tr3_entity_tbl[179] = {coll = 0x00}; -- Flare (pick-up)
tr3_entity_tbl[180] = {coll = 0x00}; -- Savegame crystal (pick-up)
tr3_entity_tbl[180] = {coll = 0x00, func = "crystal_TR3"}; -- Savegame crystal (pick-up)

-- MENU ITEMS --

Expand Down

0 comments on commit fcf4083

Please sign in to comment.