2471 lua_tointeger(L, 2) - SpritesData[sprAmGirder].Height div 2, |
2471 lua_tointeger(L, 2) - SpritesData[sprAmGirder].Height div 2, |
2472 sprAmGirder, lua_tointeger(L, 3), true, false); |
2472 sprAmGirder, lua_tointeger(L, 3), true, false); |
2473 |
2473 |
2474 lua_pushboolean(L, placed); |
2474 lua_pushboolean(L, placed); |
2475 lc_placegirder:= 1 |
2475 lc_placegirder:= 1 |
|
2476 end; |
|
2477 |
|
2478 function lc_placerubber(L : Plua_State) : LongInt; Cdecl; |
|
2479 var placed: boolean; |
|
2480 begin |
|
2481 placed:= false; |
|
2482 if CheckLuaParamCount(L, 3, 'PlaceRubber', 'x, y, frameIdx') then |
|
2483 placed:= TryPlaceOnLand( |
|
2484 lua_tointeger(L, 1) - SpritesData[sprAmRubber].Width div 2, |
|
2485 lua_tointeger(L, 2) - SpritesData[sprAmRubber].Height div 2, |
|
2486 sprAmRubber, lua_tointeger(L, 3), true, lfBouncy); |
|
2487 |
|
2488 lua_pushboolean(L, placed); |
|
2489 lc_placerubber:= 1 |
2476 end; |
2490 end; |
2477 |
2491 |
2478 function lc_getcurammotype(L : Plua_State): LongInt; Cdecl; |
2492 function lc_getcurammotype(L : Plua_State): LongInt; Cdecl; |
2479 begin |
2493 begin |
2480 if (CurrentHedgehog <> nil) and (CheckLuaParamCount(L, 0, 'GetCurAmmoType', '')) then |
2494 if (CurrentHedgehog <> nil) and (CheckLuaParamCount(L, 0, 'GetCurAmmoType', '')) then |
3468 lua_register(luaState, _P'GetHogHat', @lc_gethoghat); |
3482 lua_register(luaState, _P'GetHogHat', @lc_gethoghat); |
3469 lua_register(luaState, _P'SetHogHat', @lc_sethoghat); |
3483 lua_register(luaState, _P'SetHogHat', @lc_sethoghat); |
3470 lua_register(luaState, _P'EraseSprite', @lc_erasesprite); |
3484 lua_register(luaState, _P'EraseSprite', @lc_erasesprite); |
3471 lua_register(luaState, _P'PlaceSprite', @lc_placesprite); |
3485 lua_register(luaState, _P'PlaceSprite', @lc_placesprite); |
3472 lua_register(luaState, _P'PlaceGirder', @lc_placegirder); |
3486 lua_register(luaState, _P'PlaceGirder', @lc_placegirder); |
|
3487 lua_register(luaState, _P'PlaceRubber', @lc_placerubber); |
3473 lua_register(luaState, _P'GetCurAmmoType', @lc_getcurammotype); |
3488 lua_register(luaState, _P'GetCurAmmoType', @lc_getcurammotype); |
3474 lua_register(luaState, _P'TestRectForObstacle', @lc_testrectforobstacle); |
3489 lua_register(luaState, _P'TestRectForObstacle', @lc_testrectforobstacle); |
3475 lua_register(luaState, _P'GetGravity', @lc_getgravity); |
3490 lua_register(luaState, _P'GetGravity', @lc_getgravity); |
3476 lua_register(luaState, _P'SetGravity', @lc_setgravity); |
3491 lua_register(luaState, _P'SetGravity', @lc_setgravity); |
3477 lua_register(luaState, _P'SetWaterLine', @lc_setwaterline); |
3492 lua_register(luaState, _P'SetWaterLine', @lc_setwaterline); |