]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/trigger/jumppads.qh
target_push: implement Q3 wind tunnel and angles+speed modes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / trigger / jumppads.qh
index 268134e806757aa4f459295ad818bb4a8db013bc..54366ddf4b290df1c97b99ddf607b474ad2c4a6e 100644 (file)
@@ -3,6 +3,17 @@
 
 const int PUSH_ONCE = BIT(0); // legacy, deactivate with relay instead
 const int PUSH_SILENT = BIT(1); // not used?
+const int PUSH_STATIC = BIT(12); // xonotic-only, Q3 already behaves like this by default
+
+#define PUSH_VELOCITY_PLAYERDIR_XY        BIT(0)
+#define PUSH_VELOCITY_ADD_XY              BIT(1)
+#define PUSH_VELOCITY_PLAYERDIR_Z         BIT(2)
+#define PUSH_VELOCITY_ADD_Z               BIT(3)
+#define PUSH_VELOCITY_BIDIRECTIONAL_XY    BIT(4)
+#define PUSH_VELOCITY_BIDIRECTIONAL_Z     BIT(5)
+#define PUSH_VELOCITY_CLAMP_NEGATIVE_ADDS BIT(6)
+
+#define Q3_TARGET_PUSH_JUMPPAD            BIT(0) // target_push defaults to "wind tunnel" mode in Q3
 
 IntrusiveList g_jumppads;
 STATIC_INIT(g_jumppads) { g_jumppads = IL_NEW(); }
@@ -11,6 +22,8 @@ STATIC_INIT(g_jumppads) { g_jumppads = IL_NEW(); }
 .bool istypefrag;
 .float height;
 
+.entity last_pushed;
+
 const int NUM_JUMPPADSUSED = 3;
 .float jumppadcount;
 .entity jumppadsused[NUM_JUMPPADSUSED];
@@ -43,7 +56,7 @@ bool trigger_push_test(entity this, entity item);
 void trigger_push_findtarget(entity this);
 
 /*
- * ENTITY PARAMETERS:
+ * ENTITY PARAMETERS trigger_push:
  *
  *   target:  target of jump
  *   height:  the absolute value is the height of the highest point of the jump
@@ -54,8 +67,17 @@ void trigger_push_findtarget(entity this);
  *            values to target a point on the ceiling.
  *   movedir: if target is not set, this * speed * 10 is the velocity to be reached.
  */
+
+/*
+ * ENTITY PARAMETERS trigger_push_velocity:
+ *
+ *   target:  this points to the target_position to which the player will jump.
+ *   speed:   XY speed for player-directional velocity pads - either sets or adds to the player's horizontal velocity.
+ *   count:   Z speed for player-directional velocity pads - either sets or adds to the player's vertical velocity.
+ */
 #ifdef SVQC
 spawnfunc(trigger_push);
+spawnfunc(trigger_push_velocity);
 
 spawnfunc(target_push);
 spawnfunc(info_notnull);