From ae56faf0ade01a0758aa4fe36e2125f235c75a12 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 9 Aug 2015 09:58:41 +0000 Subject: [PATCH] Lunatic: in test/helixspawner.lua, make COLOR a global variable. DONT_BUILD. To demonstrate and test that it can be modified from outside, and that these changes are kept with savegame restores. git-svn-id: https://svn.eduke32.com/eduke32@5322 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/lunatic/test/helixspawner.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/polymer/eduke32/source/lunatic/test/helixspawner.lua b/polymer/eduke32/source/lunatic/test/helixspawner.lua index 63f4d6b7a..c0cfa88f7 100644 --- a/polymer/eduke32/source/lunatic/test/helixspawner.lua +++ b/polymer/eduke32/source/lunatic/test/helixspawner.lua @@ -28,6 +28,9 @@ local nukeswStart = con.actorvar(false) -- "volatile" actors. local starPal = con.actorvar(0) +-- Color per decasecond, can be changed from outside. +COLOR = { 1, 2, 6, 7, 8 } + require("end_gamevars") @@ -38,9 +41,6 @@ local angvec = xmath.angvec local D = require("CON.DEFS") local GTICSPERSEC = gv.GTICSPERSEC --- color per decasecond -local COLOR = { 1, 2, 6, 7, 8 } - gameactor { D.TRANSPORTERSTAR+4, @@ -59,14 +59,14 @@ gameactor if (act:has_action(0)) then act:set_action(1) -- TODO: actor constructors, i.e. 'init' callbacks - local decasec = math.floor((gv.gametic - nukeswStart[spr.owner])/(GTICSPERSEC*10)) + local decasec = math.floor((gv.gametic - nukeswStart[spr.owner])/(GTICSPERSEC*10)) % 12 local pal = COLOR[decasec+1] if (pal ~= nil) then starPal[aci] = pal end - -- At one point, we stop coloring the spawned stars. This tests + -- Every 2nd minute, we stop coloring the spawned stars. This tests -- per-actor variable resetting to the default value. spr.pal = starPal[aci] end