[CF-Devel] trigger marker

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Sun Oct 26 17:35:32 CST 2003


I managed to work through the nutty maze that is connected objects and
add a new object called a trigger_maker - which is basically a trigger
that only gets moved when triggered.  This will be really nice for doing
things like passes, traps and alarms and such where the player needs a
marker but not in every case. It is especially nice cause trigers are
timed to expire. If this is acceptable then I will add it and update the
java editor and stuff.  I really want to use this soon for granting
limited time access to the inns and to the cauldron houses (bakery,
tannery...). Basically I just followed the creator code...so please look
it over in case I missed something important.

-------------- next part --------------
? .tm_project.cache
? changes.txt
? crossfire.prj
? crossfire.pws
Index: common/button.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/common/button.c,v
retrieving revision 1.22
diff -u -r1.22 button.c
--- common/button.c	7 Oct 2003 07:02:01 -0000	1.22
+++ common/button.c	26 Oct 2003 22:14:06 -0000
@@ -138,6 +138,10 @@
 	    case CREATOR:
 		(*move_creator_func)(tmp);
 		break;
+		
+		case TRIGGER_MARKER:
+		(*move_trigger_marker_func)(tmp);
+		break;
 
 	    case DUPLICATOR:
 		(*move_duplicator_func)(tmp);
Index: common/glue.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/common/glue.c,v
retrieving revision 1.11
diff -u -r1.11 glue.c
--- common/glue.c	26 Oct 2003 06:56:56 -0000	1.11
+++ common/glue.c	26 Oct 2003 22:14:06 -0000
@@ -50,6 +50,7 @@
 type_func_ob move_firewall_func;
 type_func_ob_int  trap_adjust_func;
 type_func_ob    move_creator_func;
+type_func_ob    move_trigger_marker_func;
 type_func_ob	move_duplicator_func;
 type_func_ob_ob esrv_send_item_func;
 type_func_player_int esrv_del_item_func;
@@ -91,6 +92,7 @@
   move_firewall_func = dummy_function_ob;
   trap_adjust_func = dummy_function_ob_int;
   move_creator_func = dummy_function_ob;
+ move_trigger_marker_func=dummy_function_ob;
   move_duplicator_func = dummy_function_ob;
   esrv_send_item_func = dummy_function_ob2;
   esrv_del_item_func = dummy_function_player_int;
@@ -206,6 +208,10 @@
 
 void set_move_creator(type_func_ob addr) {
   move_creator_func = addr;
+}
+
+void set_move_trigger_marker(type_func_ob addr) {
+  move_trigger_marker_func = addr;
 }
 
 void set_move_duplicator(type_func_ob addr) {
Index: doc/Developers/python
===================================================================
RCS file: /cvsroot/crossfire/crossfire/doc/Developers/python,v
retrieving revision 1.6
diff -u -r1.6 python
--- doc/Developers/python	13 Sep 2003 05:01:31 -0000	1.6
+++ doc/Developers/python	26 Oct 2003 22:14:06 -0000
@@ -331,7 +331,7 @@
   Tests if "who" can be picked up.
   Return value: test result as an integer - 0 if and only if false.
 
-InsertObjectInside()
+InsertObjectInside(
 IsInvisible(object who)
   Tests if the given object is invisible.
   Return value: test result as an integer - 0 if and only if false.
Index: include/define.h
===================================================================
RCS file: /cvsroot/crossfire/crossfire/include/define.h,v
retrieving revision 1.68
diff -u -r1.68 define.h
--- include/define.h	13 Sep 2003 05:01:33 -0000	1.68
+++ include/define.h	26 Oct 2003 22:14:07 -0000
@@ -170,7 +170,8 @@
 					/* which notices the presense of */
 					/* another object and is triggered */
 					/* like buttons.  */
-/*#define SPEEDBALL	            52*/
+#define TRIGGER_MARKER            52 /* inserts an invisible, weightless */
+					/* force into a player with a specified string WHEN TRIGGERED. */
 #define DEAD_OBJECT	            53
 #define DRINK		            54
 #define MARKER			    55	/* inserts an invisible, weightless */
@@ -899,4 +900,3 @@
   */
 /*#define FAST_STRNCAT(buf__,buf2__,size__) {memcpy (buf__,buf2__,size__);buf__+=size__;\
  if (size__!=strlen(buf2__)) printf ("Error, bad length for %s\n",buf2__);}*/
-
Index: include/funcpoint.h
===================================================================
RCS file: /cvsroot/crossfire/crossfire/include/funcpoint.h,v
retrieving revision 1.10
diff -u -r1.10 funcpoint.h
--- include/funcpoint.h	26 Oct 2003 06:56:57 -0000	1.10
+++ include/funcpoint.h	26 Oct 2003 22:14:07 -0000
@@ -72,6 +72,7 @@
 extern void	(*move_teleporter_func)		(object *);
 extern void	(*move_firewall_func)		(object *);
 extern void	(*move_creator_func)		(object *);
+extern void  (*move_trigger_marker_func)	(object *);
 extern void	(*move_duplicator_func)		(object *);
 extern void     (*trap_adjust_func)		(object *, int);
 extern void	(*esrv_send_item_func)		(object *, object *);
Index: include/libproto.h
===================================================================
RCS file: /cvsroot/crossfire/crossfire/include/libproto.h,v
retrieving revision 1.49
diff -u -r1.49 libproto.h
--- include/libproto.h	26 Oct 2003 06:56:57 -0000	1.49
+++ include/libproto.h	26 Oct 2003 22:14:07 -0000
@@ -76,6 +76,7 @@
 extern void set_move_firewall(type_func_ob addr);
 extern void set_trap_adjust(type_func_ob_int addr);
 extern void set_move_creator(type_func_ob addr);
+extern void set_move_trigger_marker(type_func_ob addr);
 extern void set_move_duplicator(type_func_ob addr);
 extern void set_esrv_send_item(type_func_ob_ob addr);
 extern void set_esrv_update_item(type_func_int_ob_ob addr);
Index: server/init.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/server/init.c,v
retrieving revision 1.52
diff -u -r1.52 init.c
--- server/init.c	26 Oct 2003 06:56:57 -0000	1.52
+++ server/init.c	26 Oct 2003 22:14:08 -0000
@@ -932,6 +932,7 @@
   set_move_teleporter(move_teleporter);
   set_move_firewall(move_firewall);
   set_move_creator(move_creator);
+  set_move_trigger_marker(move_marker);
   set_move_duplicator(move_duplicator);
   set_trap_adjust(trap_adjust);
   set_esrv_send_item(esrv_send_item);
-------------- next part --------------
Object trigger_marker
name triggered marker
face creator.111
food 32700
slaying put your code here
speed 0.5
invisible 1
no_pick 1
type 52
end
-------------- next part --------------
_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list