summaryrefslogtreecommitdiffstats
path: root/TemplePushing.c4s
diff options
context:
space:
mode:
Diffstat (limited to 'TemplePushing.c4s')
-rw-r--r--TemplePushing.c4s/System.c4g/Arrow.c17
-rw-r--r--TemplePushing.c4s/System.c4g/Arrowpack.c4
-rw-r--r--TemplePushing.c4s/System.c4g/BigRock.c8
-rw-r--r--TemplePushing.c4s/System.c4g/Clonk.c3
-rw-r--r--TemplePushing.c4s/System.c4g/ShootInventory.c12
5 files changed, 40 insertions, 4 deletions
diff --git a/TemplePushing.c4s/System.c4g/Arrow.c b/TemplePushing.c4s/System.c4g/Arrow.c
new file mode 100644
index 0000000..f4e2202
--- /dev/null
+++ b/TemplePushing.c4s/System.c4g/Arrow.c
@@ -0,0 +1,17 @@
+/*-- Don't hit shooter directly after shooting --*/
+#strict 2
+#appendto ARRW
+#appendto FARW
+
+local shooter;
+
+func Launch(object shooterClonk)
+{
+ if (shooterClonk) shooter = shooterClonk;
+ return _inherited(shooterClonk, ...);
+}
+
+func QueryOwnCatchBlow(object target)
+{
+ return target == shooter;
+}
diff --git a/TemplePushing.c4s/System.c4g/Arrowpack.c b/TemplePushing.c4s/System.c4g/Arrowpack.c
index da2c5ec..0bdf5a1 100644
--- a/TemplePushing.c4s/System.c4g/Arrowpack.c
+++ b/TemplePushing.c4s/System.c4g/Arrowpack.c
@@ -33,7 +33,7 @@ protected func Activate(object clonk)
// Do not launch fire arrows too close to the clonk to prevent incineration when launched while climbing
var arrowPosX = IIf(arrow->GetID() == FARW, -10 + 20 * clonk->GetDir(), -3 + 6 * clonk->GetDir());
arrow->Exit(0, arrowPosX, 5, -90 + 180 * clonk->GetDir(), -8 + 16 * clonk->GetDir(), -2);
- arrow->~Launch();
+ arrow->~Launch(clonk);
// Start cooldown
coolingDown = true;
@@ -43,4 +43,4 @@ protected func Activate(object clonk)
Sound("Arrow");
return 1;
-} \ No newline at end of file
+}
diff --git a/TemplePushing.c4s/System.c4g/BigRock.c b/TemplePushing.c4s/System.c4g/BigRock.c
new file mode 100644
index 0000000..30d3555
--- /dev/null
+++ b/TemplePushing.c4s/System.c4g/BigRock.c
@@ -0,0 +1,8 @@
+/*-- Big rocks from rock strike don't hit friends --*/
+#appendto BIRK
+#strict 2
+
+func QueryOwnCatchBlow(object target)
+{
+ return !Hostile(GetOwner(), target->GetOwner());
+}
diff --git a/TemplePushing.c4s/System.c4g/Clonk.c b/TemplePushing.c4s/System.c4g/Clonk.c
index 546f74c..09c4b20 100644
--- a/TemplePushing.c4s/System.c4g/Clonk.c
+++ b/TemplePushing.c4s/System.c4g/Clonk.c
@@ -84,7 +84,8 @@ protected func Death(int killedBy)
public func QueryCatchBlow(object arrow)
{
- return arrow->GetOwner() == GetOwner();
+ if (arrow->~QueryOwnCatchBlow(this)) return 1;
+ return _inherited(arrow, ...);
}
private func FxCheckStuck2Timer(object pTarget, int iEffectNumber, int iEffectTime)
diff --git a/TemplePushing.c4s/System.c4g/ShootInventory.c b/TemplePushing.c4s/System.c4g/ShootInventory.c
index b0260b5..dd4ce1f 100644
--- a/TemplePushing.c4s/System.c4g/ShootInventory.c
+++ b/TemplePushing.c4s/System.c4g/ShootInventory.c
@@ -13,6 +13,8 @@
#appendto TSWB
#appendto METO
+local shotFrame, shooter;
+
protected func Activate(object clonk)
{
[$Shoot$|Image=GNPW]
@@ -86,6 +88,14 @@ protected func Activate(object clonk)
SetYDir(-15);
SetXDir(-80 + 160 * clonk->GetDir());
}
+
+ shotFrame = FrameCounter();
+ shooter = clonk;
return 1;
-} \ No newline at end of file
+}
+
+func QueryOwnCatchBlow(object target)
+{
+ return target == shooter && FrameCounter() - shotFrame < 3;
+}