X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=newdungeon.py;fp=newdungeon.py;h=27dd9f181afa1cbe74fdca5afb3ea427fab03287;hb=aace0b1359f15195820bf6d22a897f7c332c5eab;hp=b4c85b28d4f59561fbd4d9935bbb63f189fc06fa;hpb=fb35c34171b0e5b46c217b19bea5d808fb61853b;p=open-adventure.git diff --git a/newdungeon.py b/newdungeon.py index b4c85b2..27dd9f1 100755 --- a/newdungeon.py +++ b/newdungeon.py @@ -142,6 +142,20 @@ typedef struct {{ const bool stop; }} travelop_t; +/* Abstract out the encoding of words in the travel array. Gives us + * some hope of getting to a less cryptic representation than we + * inherited from FORTRAN, someday. To understand these, read the + * encoding description for travel. + */ +#define T_DESTINATION(entry) MOD((entry).opcode / 1000, 1000) +#define T_NODWARVES(entry) ((entry).opcode / 1000000 == 100) +#define T_MOTION(entry) MOD((entry).opcode, 1000) +#define T_TERMINATE(entry) (T_MOTION(entry) == 1) +#define T_STOP(entry) ((entry).stop) +#define T_HIGH(entry) ((entry).opcode / 1000) +#define T_LOW(entry) ((entry).opcode % 1000) +#define L_SPEAK(loc) ((loc) - 500) + extern const location_t locations[]; extern const object_t objects[]; extern const char* arbitrary_messages[];