summaryrefslogtreecommitdiff
path: root/src/map/magic-expr-eval.h
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2008-10-11 03:49:10 +0000
committerJared Adams <jaxad0127@gmail.com>2008-10-11 03:49:10 +0000
commit4714f80db868134997efdfff750b5d43650b5171 (patch)
treed73a0fd6b542b352b858fd6ef83a6c36ffa26c46 /src/map/magic-expr-eval.h
parent7d8c845f895fe213b5e463a0638ebdf94f507c0b (diff)
downloadtmwa-4714f80db868134997efdfff750b5d43650b5171.tar.gz
tmwa-4714f80db868134997efdfff750b5d43650b5171.tar.bz2
tmwa-4714f80db868134997efdfff750b5d43650b5171.tar.xz
tmwa-4714f80db868134997efdfff750b5d43650b5171.zip
Commit magic patch v13
Diffstat (limited to 'src/map/magic-expr-eval.h')
-rw-r--r--src/map/magic-expr-eval.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/map/magic-expr-eval.h b/src/map/magic-expr-eval.h
new file mode 100644
index 0000000..b859919
--- /dev/null
+++ b/src/map/magic-expr-eval.h
@@ -0,0 +1,43 @@
+#ifndef MAGIC_EXPR_EVAL
+#define MAGIC_EXPR_EVAL
+
+/* Helper definitions for dealing with functions and operations */
+
+static int heading_x[8] = { 0, -1, -1, -1, 0, 1, 1, 1 };
+static int heading_y[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };
+
+int
+magic_signature_check(char *opname, char *funname, char *signature, int args_nr, val_t *args, int line, int column);
+
+void
+magic_area_rect(int *m, int *x, int *y, int *width, int *height, area_t *area);
+
+
+#define ARGINT(x) args[x].v.v_int
+#define ARGDIR(x) args[x].v.v_int
+#define ARGSTR(x) args[x].v.v_string
+#define ARGENTITY(x) args[x].v.v_entity
+#define ARGLOCATION(x) args[x].v.v_location
+#define ARGAREA(x) args[x].v.v_area
+#define ARGSPELL(x) args[x].v.v_spell
+#define ARGINVOCATION(x) args[x].v.v_invocation
+
+#define RESULTINT result->v.v_int
+#define RESULTDIR result->v.v_int
+#define RESULTSTR result->v.v_string
+#define RESULTENTITY result->v.v_entity
+#define RESULTLOCATION result->v.v_location
+#define RESULTAREA result->v.v_area
+#define RESULTSPELL result->v.v_spell
+#define RESULTINVOCATION result->v.v_invocation
+
+#define TY(x) args[x].ty
+#define ETY(x) ARGENTITY(x)->type
+
+#define ARGPC(x) ((struct map_session_data *)ARGENTITY(x))
+#define ARGNPC(x) ((struct map_session_data *)ARGENTITY(x))
+#define ARGMOB(x) ((struct map_session_data *)ARGENTITY(x))
+
+#define ARG_MAY_BE_AREA(x) (TY(x) == TY_AREA || TY(x) == TY_LOCATION)
+
+#endif /* !defined(MAGIC_EXPR_EVAL) */