mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
Lunatic: sync with preceding change, complete two commands.
git-svn-id: https://svn.eduke32.com/eduke32@3430 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
92f5158a70
commit
34c9bc8489
4 changed files with 35 additions and 25 deletions
|
@ -512,9 +512,9 @@ local ICONS = {
|
||||||
[ffiC.GET_BOOTS] = 7,
|
[ffiC.GET_BOOTS] = 7,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- XXX
|
function _addinventory(ps, inv, amount, i)
|
||||||
function _addinventory(ps, inv, amount, pal)
|
|
||||||
if (inv == ffiC.GET_ACCESS) then
|
if (inv == ffiC.GET_ACCESS) then
|
||||||
|
local pal = sprite[i].pal
|
||||||
if (PALBITS[pal]) then
|
if (PALBITS[pal]) then
|
||||||
ps.got_access = bit.bor(ps.got_access, PALBITS[pal])
|
ps.got_access = bit.bor(ps.got_access, PALBITS[pal])
|
||||||
end
|
end
|
||||||
|
@ -532,16 +532,14 @@ function _addinventory(ps, inv, amount, pal)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- For GET_ACCESS: returns logical: whether player has card given by PAL
|
function _checkpinventory(ps, inv, amount, i)
|
||||||
-- Else: returns inventory amount
|
if (inv==ffiC.GET_SHIELD) then
|
||||||
function _getinventory(ps, inv, i)
|
return ps:get_inv_amount(inv) ~= ps.max_shield_amount
|
||||||
if (inv == ffiC.GET_ACCESS) then
|
elseif (inv==ffiC.GET_ACCESS) then
|
||||||
if (PALBITS[sprite[i].pal]) then
|
local palbit = PALBITS[sprite[i].pal]
|
||||||
return (bit.band(ps.got_access, PALBITS[sprite[i].pal])~=0)
|
return palbit and (bit.band(ps.got_access, palbit)~=0)
|
||||||
end
|
|
||||||
return false
|
|
||||||
else
|
else
|
||||||
return ps:get_inv_amount(inv)
|
return ps:get_inv_amount(inv) ~= amount
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -861,8 +861,6 @@ local player_mt = {
|
||||||
addammo = con._addammo,
|
addammo = con._addammo,
|
||||||
addweapon = con._addweapon,
|
addweapon = con._addweapon,
|
||||||
|
|
||||||
addinventory = con._addinventory,
|
|
||||||
|
|
||||||
stomp = con._pstomp,
|
stomp = con._pstomp,
|
||||||
|
|
||||||
-- XXX: is the correct spelling "whack"?
|
-- XXX: is the correct spelling "whack"?
|
||||||
|
|
|
@ -1119,6 +1119,8 @@ local handle =
|
||||||
end
|
end
|
||||||
return format("%s(_aci,_pli,_dist)", g_funcname[statename])
|
return format("%s(_aci,_pli,_dist)", g_funcname[statename])
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
addweapon = format("if (%s) then _con.longjmp() end", PLS":addweapon(%1,%2)"),
|
||||||
}
|
}
|
||||||
|
|
||||||
-- NOTE about prefixes: most is handled by all_alt_pattern(), however commands
|
-- NOTE about prefixes: most is handled by all_alt_pattern(), however commands
|
||||||
|
@ -1233,7 +1235,8 @@ local Cinner = {
|
||||||
|
|
||||||
hitradius = cmd(D,D,D,D,D)
|
hitradius = cmd(D,D,D,D,D)
|
||||||
/ "_con._A_RadiusDamage(_aci,%1,%2,%3,%4,%5)",
|
/ "_con._A_RadiusDamage(_aci,%1,%2,%3,%4,%5)",
|
||||||
hitradiusvar = cmd(R,R,R,R,R),
|
hitradiusvar = cmd(R,R,R,R,R)
|
||||||
|
/ "_con._A_RadiusDamage(_aci,%1,%2,%3,%4,%5)",
|
||||||
|
|
||||||
-- some commands taking read vars
|
-- some commands taking read vars
|
||||||
eshootvar = cmd(R),
|
eshootvar = cmd(R),
|
||||||
|
@ -1271,11 +1274,11 @@ local Cinner = {
|
||||||
addammo = cmd(D,D) -- NLCF
|
addammo = cmd(D,D) -- NLCF
|
||||||
/ format("if (%s) then _con.longjmp() end", PLS":addammo(%1,%2)"),
|
/ format("if (%s) then _con.longjmp() end", PLS":addammo(%1,%2)"),
|
||||||
addweapon = cmd(D,D) -- NLCF
|
addweapon = cmd(D,D) -- NLCF
|
||||||
/ format("if (%s) then _con.longjmp() end", PLS":addweapon(%1,%2)"),
|
/ handle.addweapon,
|
||||||
debris = cmd(D,D)
|
debris = cmd(D,D)
|
||||||
/ "_con._debris(_aci, %1, %2)",
|
/ "_con._debris(_aci, %1, %2)",
|
||||||
addinventory = cmd(D,D)
|
addinventory = cmd(D,D)
|
||||||
/ PLS":addinventory(%1,%2)",
|
/ format("_con._addinventory(%s,%%1,%%2,_aci)", PLS""),
|
||||||
guts = cmd(D,D)
|
guts = cmd(D,D)
|
||||||
/ "_con._A_DoGuts(_aci,%1,%2)",
|
/ "_con._A_DoGuts(_aci,%1,%2)",
|
||||||
|
|
||||||
|
@ -1392,7 +1395,8 @@ local Cinner = {
|
||||||
activatebysector = cmd(R,R),
|
activatebysector = cmd(R,R),
|
||||||
addlogvar = cmd(R),
|
addlogvar = cmd(R),
|
||||||
addlog = cmd() * #sp1,
|
addlog = cmd() * #sp1,
|
||||||
addweaponvar = cmd(R,R), -- NLCF
|
addweaponvar = cmd(R,R) -- NLCF
|
||||||
|
/ handle.addweapon,
|
||||||
cansee = cmd(R,R,R,R,R,R,R,R,W),
|
cansee = cmd(R,R,R,R,R,R,R,R,W),
|
||||||
canseespr = cmd(R,R,W),
|
canseespr = cmd(R,R,W),
|
||||||
changespritesect = cmd(R,R),
|
changespritesect = cmd(R,R),
|
||||||
|
@ -1433,12 +1437,12 @@ local Cinner = {
|
||||||
myospal = cmd(R,R,R,R,R,R),
|
myospal = cmd(R,R,R,R,R,R),
|
||||||
myospalx = cmd(R,R,R,R,R,R),
|
myospalx = cmd(R,R,R,R,R,R),
|
||||||
|
|
||||||
headspritesect = cmd(R,R),
|
headspritesect = cmd(W,R),
|
||||||
headspritestat = cmd(R,R),
|
headspritestat = cmd(W,R),
|
||||||
nextspritesect = cmd(R,R),
|
nextspritesect = cmd(W,R),
|
||||||
nextspritestat = cmd(R,R),
|
nextspritestat = cmd(W,R),
|
||||||
prevspritesect = cmd(R,R),
|
prevspritesect = cmd(W,R),
|
||||||
prevspritestat = cmd(R,R),
|
prevspritestat = cmd(W,R),
|
||||||
|
|
||||||
readarrayfromfile = cmd(I,D),
|
readarrayfromfile = cmd(I,D),
|
||||||
writearraytofile = cmd(I,D),
|
writearraytofile = cmd(I,D),
|
||||||
|
@ -1461,7 +1465,8 @@ local Cinner = {
|
||||||
|
|
||||||
showview = cmd(R,R,R,R,R,R,R,R,R,R), -- 10R
|
showview = cmd(R,R,R,R,R,R,R,R,R,R), -- 10R
|
||||||
showviewunbiased = cmd(R,R,R,R,R,R,R,R,R,R), -- 10R
|
showviewunbiased = cmd(R,R,R,R,R,R,R,R,R,R), -- 10R
|
||||||
smaxammo = cmd(R,R),
|
smaxammo = cmd(R,R)
|
||||||
|
/ PLS":set_max_ammo_amount(%1,%2)",
|
||||||
gmaxammo = cmd(R,W),
|
gmaxammo = cmd(R,W),
|
||||||
spriteflags = cmd(R), -- also see outer
|
spriteflags = cmd(R), -- also see outer
|
||||||
ssp = cmd(R,R),
|
ssp = cmd(R,R),
|
||||||
|
@ -1537,7 +1542,7 @@ local Cif = {
|
||||||
/ "_con._soundplaying(_aci,%1)",
|
/ "_con._soundplaying(_aci,%1)",
|
||||||
-- vvv TODO: this is not correct for GET_ACCESS or GET_SHIELD.
|
-- vvv TODO: this is not correct for GET_ACCESS or GET_SHIELD.
|
||||||
ifpinventory = cmd(D,D)
|
ifpinventory = cmd(D,D)
|
||||||
/ format("_con._getinventory(%s,%%1,_aci)~=%%2", PLS""),
|
/ format("_con._checkpinventory(%s,%%1,%%2,_aci)", PLS""),
|
||||||
|
|
||||||
ifvarl = cmd(R,D)
|
ifvarl = cmd(R,D)
|
||||||
/ "%1<%2",
|
/ "%1<%2",
|
||||||
|
|
9
polymer/eduke32/source/lunatic/test/weaponvars.con
Normal file
9
polymer/eduke32/source/lunatic/test/weaponvars.con
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
gamevar snd 351 0 // thunder sound
|
||||||
|
gamevar shoots 2605 2 // RPG
|
||||||
|
|
||||||
|
gamevar WEAPON1_SHOOTS 2605 0
|
||||||
|
|
||||||
|
onevent EVENT_GAME
|
||||||
|
setvarvar WEAPON1_FIRESOUND snd
|
||||||
|
// setvarvar WEAPON1_SHOOTS shoots
|
||||||
|
endevent
|
Loading…
Reference in a new issue