mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 11:10:47 +00:00
LunaCON: make mail, money, paper be affected by tile remapping, fix one printf.
git-svn-id: https://svn.eduke32.com/eduke32@3881 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
6f6fbf0f04
commit
878ba20af9
3 changed files with 25 additions and 16 deletions
|
@ -166,6 +166,9 @@ local check_sprite_idx = bcheck.sprite_idx
|
||||||
local check_player_idx = bcheck.player_idx
|
local check_player_idx = bcheck.player_idx
|
||||||
local check_sound_idx = bcheck.sound_idx
|
local check_sound_idx = bcheck.sound_idx
|
||||||
|
|
||||||
|
-- Will contain [<label>]=number mappings after CON translation.
|
||||||
|
local D = { true }
|
||||||
|
|
||||||
|
|
||||||
local function krandand(mask)
|
local function krandand(mask)
|
||||||
return bit.band(ffiC.krand(), mask)
|
return bit.band(ffiC.krand(), mask)
|
||||||
|
@ -293,14 +296,17 @@ end
|
||||||
|
|
||||||
-- A_SpawnMultiple clone
|
-- A_SpawnMultiple clone
|
||||||
-- ow: parent sprite number
|
-- ow: parent sprite number
|
||||||
function _spawnmany(ow, tilenum, n)
|
function _spawnmany(ow, label, n)
|
||||||
local spr = sprite[ow]
|
local tilenum = D[label]
|
||||||
|
if (tilenum ~= nil) then
|
||||||
|
local spr = sprite[ow]
|
||||||
|
|
||||||
for i=n,1, -1 do
|
for i=n,1, -1 do
|
||||||
local j = insertsprite{ tilenum, spr^(ffiC.krand()%(47*256)), spr.sectnum, ow, 5,
|
local j = insertsprite{ tilenum, spr^(ffiC.krand()%(47*256)), spr.sectnum, ow, 5,
|
||||||
shade=-32, xrepeat=8, yrepeat=8, ang=krandand(2047) }
|
shade=-32, xrepeat=8, yrepeat=8, ang=krandand(2047) }
|
||||||
_spawnexisting(j)
|
_spawnexisting(j)
|
||||||
sprite[j].cstat = krandand(8+4)
|
sprite[j].cstat = krandand(8+4)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -858,9 +864,6 @@ end
|
||||||
|
|
||||||
---=== DEFINED LABELS ===---
|
---=== DEFINED LABELS ===---
|
||||||
|
|
||||||
-- Will contain [<label>]=number mappings after CON translation.
|
|
||||||
local D = { true }
|
|
||||||
|
|
||||||
-- Check if <picnum> equals to the number defined by <label> from CON.
|
-- Check if <picnum> equals to the number defined by <label> from CON.
|
||||||
-- If there is no such label, return nil.
|
-- If there is no such label, return nil.
|
||||||
local function ispic(picnum, label)
|
local function ispic(picnum, label)
|
||||||
|
|
|
@ -68,8 +68,9 @@ local function match_until(matchsp, untilsp) -- (!untilsp matchsp)* in PEG
|
||||||
return (matchsp - Pat(untilsp))^0
|
return (matchsp - Pat(untilsp))^0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local format = string.format
|
||||||
--[[
|
--[[
|
||||||
local function format(fmt, ...)
|
format = function(fmt, ...)
|
||||||
local ok, res = pcall(string.format, fmt, ...)
|
local ok, res = pcall(string.format, fmt, ...)
|
||||||
if (not ok) then
|
if (not ok) then
|
||||||
error(string.format("FAILED format(%q, ...) | message: %s", fmt, res))
|
error(string.format("FAILED format(%q, ...) | message: %s", fmt, res))
|
||||||
|
@ -77,7 +78,6 @@ local function format(fmt, ...)
|
||||||
return res
|
return res
|
||||||
end
|
end
|
||||||
--]]
|
--]]
|
||||||
local format = string.format
|
|
||||||
|
|
||||||
local function printf(fmt, ...)
|
local function printf(fmt, ...)
|
||||||
print(format(fmt, ...))
|
print(format(fmt, ...))
|
||||||
|
@ -826,7 +826,7 @@ local function do_include_file(dirname, filename, isroot)
|
||||||
assert(type(filename)=="string")
|
assert(type(filename)=="string")
|
||||||
|
|
||||||
if (g_have_file[filename] ~= nil) then
|
if (g_have_file[filename] ~= nil) then
|
||||||
printf("[%d] Fatal error: infinite loop including \"%s\"", filename)
|
printf("[%d] Fatal error: infinite loop including \"%s\"", g_recurslevel, filename)
|
||||||
g_numerrors = inf
|
g_numerrors = inf
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -2200,11 +2200,11 @@ local Cinner = {
|
||||||
lotsofglass = cmd(D)
|
lotsofglass = cmd(D)
|
||||||
/ "_con._A_SpawnGlass(_aci,%1)",
|
/ "_con._A_SpawnGlass(_aci,%1)",
|
||||||
mail = cmd(D)
|
mail = cmd(D)
|
||||||
/ "_con._spawnmany(_aci,4410,%1)", -- TODO: dyntile
|
/ "_con._spawnmany(_aci,'MAIL',%1)",
|
||||||
money = cmd(D)
|
money = cmd(D)
|
||||||
/ "_con._spawnmany(_aci,1233,%1)", -- TODO: dyntile
|
/ "_con._spawnmany(_aci,'MONEY',%1)",
|
||||||
paper = cmd(D)
|
paper = cmd(D)
|
||||||
/ "_con._spawnmany(_aci,4460,%1)", -- TODO: dyntile
|
/ "_con._spawnmany(_aci,'PAPER',%1)",
|
||||||
sleeptime = cmd(D)
|
sleeptime = cmd(D)
|
||||||
/ ACS".timetosleep=%1",
|
/ ACS".timetosleep=%1",
|
||||||
|
|
||||||
|
|
|
@ -28,3 +28,9 @@ useractor 1 CYCLOIDHEAD 10
|
||||||
ifpdistl 1024 tip
|
ifpdistl 1024 tip
|
||||||
state killme
|
state killme
|
||||||
enda
|
enda
|
||||||
|
|
||||||
|
onevent EVENT_JUMP
|
||||||
|
mail 2
|
||||||
|
money 5
|
||||||
|
paper 3
|
||||||
|
endevent
|
||||||
|
|
Loading…
Reference in a new issue