From 95fe966cd1bab33228370b3926b3a55e84c70ee1 Mon Sep 17 00:00:00 2001 From: Maikel de Vries Date: Sun, 17 May 2015 14:01:26 +0200 Subject: [PATCH] kill tracing for incinerated dynamite (box) and iron bomb --- .../Items.ocd/Tools.ocd/Dynamite.ocd/Script.c | 7 ++++++- .../Items.ocd/Tools.ocd/DynamiteBox.ocd/Script.c | 8 +++++--- .../Items.ocd/Weapons.ocd/IronBomb.ocd/Script.c | 11 ++++++++--- planet/System.ocg/Explode.c | 14 ++++++++------ 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/Dynamite.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Tools.ocd/Dynamite.ocd/Script.c index 00a57bb53..31bfb324a 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/Dynamite.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/Dynamite.ocd/Script.c @@ -98,7 +98,12 @@ private func GetWall(int angle) protected func Hit() { Sound("GeneralHit?"); } -protected func Incineration() { Extinguish(); Fuse(); } +protected func Incineration(int caused_by) +{ + Extinguish(); + Fuse(); + SetController(caused_by); +} protected func RejectEntrance() { diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/DynamiteBox.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Tools.ocd/DynamiteBox.ocd/Script.c index 59ef8950a..f76065448 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/DynamiteBox.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/DynamiteBox.ocd/Script.c @@ -97,16 +97,18 @@ public func DoExplode() Explode(Sqrt(18**2*count)); } -protected func Incineration() +protected func Incineration(int caused_by) { AddEffect("Fuse", this, 100, 1, this); Sound("Fuse"); + SetController(caused_by); return; } -protected func Damage() +protected func Damage(int change, int type, int by_player) { - Incinerate(); + Incinerate(nil, by_player); + return; } public func FxFuseTimer(object target, effect, int timer) diff --git a/planet/Objects.ocd/Items.ocd/Weapons.ocd/IronBomb.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Weapons.ocd/IronBomb.ocd/Script.c index 7d493e9cd..c26378498 100644 --- a/planet/Objects.ocd/Items.ocd/Weapons.ocd/IronBomb.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Weapons.ocd/IronBomb.ocd/Script.c @@ -7,7 +7,7 @@ local armed; // If true, explodes on contact -public func ControlUse(object clonk, int x, int y, bool box) +public func ControlUse(object clonk, int x, int y) { // if already activated, nothing (so, throw) if(GetEffect("FuseBurn", this)) @@ -63,13 +63,18 @@ func DoExplode() Explode(30); } -protected func Hit(x, y) +protected func Hit(int x, int y) { if (armed) return DoExplode(); StonyObjectHit(x,y); } -protected func Incineration() { Extinguish(); Fuse(); } +protected func Incineration(int caused_by) +{ + Extinguish(); + Fuse(); + SetController(caused_by); +} protected func RejectEntrance() { diff --git a/planet/System.ocg/Explode.c b/planet/System.ocg/Explode.c index 48b96245a..6b101e16b 100644 --- a/planet/System.ocg/Explode.c +++ b/planet/System.ocg/Explode.c @@ -137,6 +137,7 @@ global func Explode(int level, bool silent) var container = Contained(); var exploding_id = GetID(); var layer = GetObjectLayer(); + Log("%d", cause_plr); // Explosion parameters saved: Remove object now, since it should not be involved in the explosion. RemoveObject(); @@ -346,21 +347,22 @@ global func BlastObjects(int x, int y, int level, object container, int cause_pl return true; } -global func BlastObject(int Level, CausedBy) +global func BlastObject(int level, int caused_by) { var self = this; - if (CausedBy == nil) - CausedBy = GetController(); + if (caused_by == nil) + caused_by = GetController(); - DoDamage(Level, FX_Call_DmgBlast, CausedBy); + DoDamage(level, FX_Call_DmgBlast, caused_by); if (!self) return; if (GetAlive()) - DoEnergy(-Level/3, false, FX_Call_EngBlast, CausedBy); + DoEnergy(-level/3, false, FX_Call_EngBlast, caused_by); if (!self) return; if (this.BlastIncinerate && GetDamage() >= this.BlastIncinerate) - Incinerate(Level, CausedBy); + Incinerate(level, caused_by); + return; } global func BlastObjectsShockwaveCheck(int x, int y)