From cbb71c088acb966b150747c4b4843ed1896ca2da Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 17 Jun 2012 19:45:43 +0000 Subject: [PATCH] Lunatic translator: ai/move/action. This exposes some problems in the default/in-the-wild CONs. As usual, we'll have to retrofit sensible semantics :rolleyes:. git-svn-id: https://svn.eduke32.com/eduke32@2765 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/lunatic/lunacon.lua | 222 +++++++++++++++------ 1 file changed, 160 insertions(+), 62 deletions(-) diff --git a/polymer/eduke32/source/lunatic/lunacon.lua b/polymer/eduke32/source/lunatic/lunacon.lua index a8a512d8a..cb106d413 100644 --- a/polymer/eduke32/source/lunatic/lunacon.lua +++ b/polymer/eduke32/source/lunatic/lunacon.lua @@ -91,29 +91,33 @@ local function parse_number(numstr) end -local LABEL_DEFINE = 1 ---local LABEL_STATE = 2 ---local LABEL_ACTOR = 4 -local LABEL_ACTION = 8 -local LABEL_AI = 16 -local LABEL_MOVE = 32 +local LABEL = { MOVE=2, AI=3, ACTION=5, [2]="move", [3]="ai", [5]="action" } +local MOVE_NO_ = {0,0} +local ACTION_NO_ = {0,0,0,0,0} +local LABEL_NO = { [2]=MOVE_NO_, [3]={ACTION_NO_,MOVE_NO_,0}, [5]=ACTION_NO_ } + +-- will contain: +-- * scalar numbers: `define'd values +-- * tables of length 2, 3, 5: move, ai, action definitions (respectively) +-- - move: { hvel , vvel } +-- - ai: { action