mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 17:32:13 +00:00
Add some test CON files to source/lunatic/test.
The code is mostly by other people, who are credited in the CON files. git-svn-id: https://svn.eduke32.com/eduke32@3627 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
53f6d749df
commit
85d6526264
2 changed files with 144 additions and 0 deletions
84
polymer/eduke32/source/lunatic/test/animatesprites.con
Normal file
84
polymer/eduke32/source/lunatic/test/animatesprites.con
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
gamevar tmp 0 0
|
||||||
|
/*
|
||||||
|
actor LIZTROOP
|
||||||
|
getactor[THISACTOR].mdflags tmp
|
||||||
|
orvar tmp 16
|
||||||
|
setactor[THISACTOR].mdflags tmp
|
||||||
|
enda
|
||||||
|
*/
|
||||||
|
|
||||||
|
gamevar ceilz 0 0
|
||||||
|
gamevar ceilhit 0 0
|
||||||
|
gamevar florz 0 0
|
||||||
|
gamevar florhit 0 0
|
||||||
|
gamevar pi 0 0
|
||||||
|
|
||||||
|
define Q 500
|
||||||
|
|
||||||
|
gamevar pdist 0 2
|
||||||
|
|
||||||
|
onevent EVENT_GAME
|
||||||
|
ifactor LIZTROOP
|
||||||
|
findplayer pdist
|
||||||
|
endevent
|
||||||
|
|
||||||
|
onevent EVENT_ANIMATESPRITES
|
||||||
|
ifactor LIZTROOP
|
||||||
|
{
|
||||||
|
setvarvar tmp totalclock
|
||||||
|
andvar tmp 255
|
||||||
|
settspr[THISACTOR].tsprshade tmp
|
||||||
|
}
|
||||||
|
endevent
|
||||||
|
|
||||||
|
gamevar lizi 0 0
|
||||||
|
|
||||||
|
onevent EVENT_DISPLAYREST
|
||||||
|
findnearactor LIZTROOP 4096 lizi
|
||||||
|
ifvarn lizi -1
|
||||||
|
{
|
||||||
|
redefinequote Q nearest LIZTROOP is %d units away (Manhattan dist.)
|
||||||
|
qsprintf Q Q /**/ actorvar[lizi].pdist
|
||||||
|
gametextz STARTALPHANUM 10 100 Q 2 0 16 /*bounds:*/ 0 0 xdim ydim 32768
|
||||||
|
}
|
||||||
|
|
||||||
|
getplayer[THISACTOR].i pi
|
||||||
|
getzrange sprite[pi].x sprite[pi].y sprite[pi].z player[THISACTOR].cursectnum
|
||||||
|
/*out:*/ ceilz ceilhit florz florhit
|
||||||
|
/*in:*/ 128 CLIPMASK0
|
||||||
|
|
||||||
|
redefinequote Q hit %d at %d, %d at %d
|
||||||
|
qsprintf Q Q /**/ ceilhit ceilz florhit florz
|
||||||
|
minitext 100 8 Q 0 0
|
||||||
|
gametext STARTALPHANUM 320 16 Q 0 0 16 /*bounds:*/ 0 0 xdim ydim
|
||||||
|
gametextz STARTALPHANUM 320 24 Q 0 0 16 /*bounds:*/ 0 0 xdim ydim 32768
|
||||||
|
endevent
|
||||||
|
|
||||||
|
|
||||||
|
// Following code by Fox, from
|
||||||
|
// http://forums.duke4.net/topic/955-eduke32-scripting/page__view__findpost__p__153176
|
||||||
|
|
||||||
|
gamevar SIN 0 0
|
||||||
|
gamevar COS 0 0
|
||||||
|
gamevar HORIZ 0 0
|
||||||
|
gamevar HITSECT 0 0
|
||||||
|
gamevar HITWALL 0 0
|
||||||
|
gamevar HITSPRITE 0 0
|
||||||
|
gamevar HITX 0 0
|
||||||
|
gamevar HITY 0 0
|
||||||
|
gamevar HITZ 0 0
|
||||||
|
|
||||||
|
onevent EVENT_DISPLAYREST
|
||||||
|
sin SIN player[THISACTOR].ang
|
||||||
|
cos COS player[THISACTOR].ang
|
||||||
|
setvar HORIZ 100
|
||||||
|
subvarvar HORIZ player[THISACTOR].horiz
|
||||||
|
subvarvar HORIZ player[THISACTOR].horizoff
|
||||||
|
mulvar HORIZ 32
|
||||||
|
hitscan player[THISACTOR].posx player[THISACTOR].posy player[THISACTOR].posz player[THISACTOR].cursectnum
|
||||||
|
COS SIN HORIZ HITSECT HITWALL HITSPRITE HITX HITY HITZ CLIPMASK1
|
||||||
|
|
||||||
|
redefinequote Q hitscan: hit sector %d, wall %d, sprite %d
|
||||||
|
qsprintf Q Q /**/ HITSECT HITWALL HITSPRITE
|
||||||
|
minitext 100 80 Q 0 0
|
||||||
|
endevent
|
60
polymer/eduke32/source/lunatic/test/gettimedate.con
Normal file
60
polymer/eduke32/source/lunatic/test/gettimedate.con
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
// From http://wiki.eduke32.com/wiki/How_to_make_a_clock (author: The Commander)
|
||||||
|
// with modifications
|
||||||
|
|
||||||
|
gamevar sec 0 0
|
||||||
|
gamevar min 0 0
|
||||||
|
gamevar hour 0 0
|
||||||
|
gamevar mday 0 0
|
||||||
|
gamevar mon 0 0
|
||||||
|
gamevar year 0 0
|
||||||
|
gamevar wday 0 0
|
||||||
|
gamevar yday 0 0
|
||||||
|
|
||||||
|
onevent EVENT_DISPLAYREST
|
||||||
|
gettimedate sec min hour mday mon year wday yday
|
||||||
|
|
||||||
|
ifvarl hour 20 ifvarg hour 9
|
||||||
|
digitalnumberz 2992 285 16 hour 0 0 0 0 0 xdim ydim 65536
|
||||||
|
|
||||||
|
ifvarg hour 19
|
||||||
|
digitalnumberz 2992 282 16 hour 0 0 0 0 0 xdim ydim 65536
|
||||||
|
|
||||||
|
ifvarl hour 10
|
||||||
|
{
|
||||||
|
digitalnumberz 2992 288 16 hour 0 0 0 0 0 xdim ydim 65536
|
||||||
|
rotatesprite 269 16 65536 0 2992 0 0 0 0 0 xdim ydim
|
||||||
|
}
|
||||||
|
|
||||||
|
ifvarg min 9
|
||||||
|
digitalnumberz 2992 308 16 min 0 0 0 0 0 xdim ydim 65536
|
||||||
|
|
||||||
|
ifvarl min 10
|
||||||
|
{
|
||||||
|
digitalnumberz 2992 315 16 min 0 0 0 0 0 xdim ydim 65536
|
||||||
|
rotatesprite 296 16 65536 0 2992 0 0 0 0 0 xdim ydim
|
||||||
|
}
|
||||||
|
|
||||||
|
gametextz STARTALPHANUM 20 20 1 0 0 0 0 0 xdim ydim 32768
|
||||||
|
endevent
|
||||||
|
|
||||||
|
|
||||||
|
// Following code by Hendricks266, from
|
||||||
|
// http://forums.duke4.net/topic/1093-what-are-you-working-on-for-duke-right-now/page__view__findpost__p__152626
|
||||||
|
|
||||||
|
gamevar zoom 0 0
|
||||||
|
|
||||||
|
definequote 10000 abcdefghijklm
|
||||||
|
definequote 10001 nopqrstuvwxyz
|
||||||
|
|
||||||
|
onevent EVENT_DISPLAYREST
|
||||||
|
setvarvar zoom totalclock
|
||||||
|
modvar zoom 240
|
||||||
|
mulvar zoom 8192
|
||||||
|
divvar zoom 15
|
||||||
|
|
||||||
|
digitalnumberz DIGITALNUM 160 5 1234567890 0 0 16 windowx1 windowy1 windowx2 windowy2 zoom
|
||||||
|
|
||||||
|
gametextz STARTALPHANUM 320 30 10000 0 0 16 windowx1 windowy1 windowx2 windowy2 zoom
|
||||||
|
|
||||||
|
rotatesprite 160 70 zoom 0 SPINNINGNUKEICON 0 0 0 windowx1 windowy1 windowx2 windowy2
|
||||||
|
endevent
|
Loading…
Reference in a new issue