Index: class.doc ================================================================== --- class.doc +++ class.doc @@ -723,10 +723,11 @@ MOVING NEXTWARP PLAYERMOVING POSTINIT SUNK + WARPED XCREATE Input constants: 'BACK = 8 'TAB = 9 @@ -2606,10 +2607,16 @@ is created but is not the least dense object at that location. In this case, From is zero, and the return value is not used. For creation, Arg3 is the return value of the corresponding CREATE message; for movement, Arg3 is always zero. (This has nothing to do with sinking in water.) +WARPED + Sent to an object that has been moved by a warp. From is the warp + object, Self is the object that has just been moved, and Arg3 is the hit + value. If the return value is true, then whatever tried to move it + believes that the move failed. + XCREATE This message is received by an object which has been just created due to a COLLIDEBY message returning a class. From is the object at the target location that a collision with layers occurred (which is now destroyed). Arg1 is the class of the attempted creation or object trying to move @@ -2757,11 +2764,12 @@ bit28 * This bit is set by the game engine if a warp has occurred. See the below description of warping. You can also set this bit by yourself, and it persists across restarts. If this bit is set, the moving object's - direction is updated after the movement if it is successful. + direction is updated after the movement if it is successful; this will + also allow the NEXTWARP and WARPED messages to be sent. bit29 * Reserved for future. bit30 Index: exec.c ================================================================== --- exec.c +++ exec.c @@ -1636,11 +1636,18 @@ if(hit&0x10000000) { v=send_message(obj,objW,MSG_NEXTWARP,NVALUE(dir),NVALUE(0),NVALUE(hit)); if(v.t || v.u) goto warp; } o->inertia=0; return 0; - success: if(!(hit&0x4000)) o->oflags|=OF_MOVED; if(hit&0x10000000) o->dir=dir; return 1; + success: + if(!(hit&0x4000)) o->oflags|=OF_MOVED; + if(hit&0x10000000) { + o->dir=dir; + v=send_message(objW,obj,MSG_WARPED,NVALUE(0),NVALUE(0),NVALUE(hit)); + if(v_bool(v)) return 0; + } + return 1; } static int jump_to(Uint32 from,Uint32 n,Uint32 x,Uint32 y) { int xx,yy; if(n==VOIDLINK) return 0; Index: heromesh.h ================================================================== --- heromesh.h +++ heromesh.h @@ -44,11 +44,11 @@ #define ZVALUE(x) UVALUE(x,TY_STRING) #define OVALUE(x) ((x)==VOIDLINK?NVALUE(0):UVALUE(x,objects[x]->generation)) #define ValueTo64(v) (((sqlite3_int64)((v).u))|(((sqlite3_int64)((v).t))<<32)) #define ValueEq(x,y) ((x).t==(y).t && (x).u==(y).u) -#define N_MESSAGES 29 +#define N_MESSAGES 30 #define N_STANDARD_SOUNDS 49 extern const char*const standard_message_names[]; extern const char*const standard_sound_names[]; extern const char*const heromesh_key_names[256]; Index: instruc.h ================================================================== --- instruc.h +++ instruc.h @@ -775,10 +775,11 @@ {"VisualOnly",8618102}, {"Volume",9142353}, {"VolumeAt",8421602}, {"W",9437188}, {"WAHOO",8389399}, +{"WARPED",8389149}, {"WHACK",8389422}, {"Walkable",8487139}, {"Weight",9142355}, {"WinLevel",8487140}, {"XCREATE",8389148}, @@ -890,7 +891,7 @@ {"tuck",8421380}, {"uniq",8421618}, {"until",8683534}, {"while",8683535}, }; -#define N_OP_NAMES 373 +#define N_OP_NAMES 374 #endif Index: names.h ================================================================== --- names.h +++ names.h @@ -26,10 +26,11 @@ #define MSG_BLOCKED 24 #define MSG_CONNECT 25 #define MSG_NEXTWARP 26 #define MSG_CLICK 27 #define MSG_XCREATE 28 +#define MSG_WARPED 29 #ifdef HEROMESH_MAIN const char*const standard_message_names[]={ "INIT", "CREATE", "DESTROY", @@ -57,10 +58,11 @@ "BLOCKED", "CONNECT", "NEXTWARP", "CLICK", "XCREATE", + "WARPED", }; const char*const standard_sound_names[]={ "SPLASH", "POUR", "DOOR", Index: names.js ================================================================== --- names.js +++ names.js @@ -31,10 +31,11 @@ 24 = BLOCKED 25 = CONNECT 26 = NEXTWARP 27 = CLICK 28 = XCREATE + 29 = WARPED `.split("\n").map(x=>/^ *([0-9]+) = ([^ ]*) *$/.exec(x)).filter(x=>x); const standard_sound_names=[]; ` SPLASH POUR