kill tracing for incinerated dynamite (box) and iron bomb

stable-6.1
Maikel de Vries 2015-05-17 14:01:26 +02:00
parent f86495da89
commit 95fe966cd1
4 changed files with 27 additions and 13 deletions

View File

@ -98,7 +98,12 @@ private func GetWall(int angle)
protected func Hit() { Sound("GeneralHit?"); } protected func Hit() { Sound("GeneralHit?"); }
protected func Incineration() { Extinguish(); Fuse(); } protected func Incineration(int caused_by)
{
Extinguish();
Fuse();
SetController(caused_by);
}
protected func RejectEntrance() protected func RejectEntrance()
{ {

View File

@ -97,16 +97,18 @@ public func DoExplode()
Explode(Sqrt(18**2*count)); Explode(Sqrt(18**2*count));
} }
protected func Incineration() protected func Incineration(int caused_by)
{ {
AddEffect("Fuse", this, 100, 1, this); AddEffect("Fuse", this, 100, 1, this);
Sound("Fuse"); Sound("Fuse");
SetController(caused_by);
return; 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) public func FxFuseTimer(object target, effect, int timer)

View File

@ -7,7 +7,7 @@
local armed; // If true, explodes on contact 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 already activated, nothing (so, throw)
if(GetEffect("FuseBurn", this)) if(GetEffect("FuseBurn", this))
@ -63,13 +63,18 @@ func DoExplode()
Explode(30); Explode(30);
} }
protected func Hit(x, y) protected func Hit(int x, int y)
{ {
if (armed) return DoExplode(); if (armed) return DoExplode();
StonyObjectHit(x,y); StonyObjectHit(x,y);
} }
protected func Incineration() { Extinguish(); Fuse(); } protected func Incineration(int caused_by)
{
Extinguish();
Fuse();
SetController(caused_by);
}
protected func RejectEntrance() protected func RejectEntrance()
{ {

View File

@ -137,6 +137,7 @@ global func Explode(int level, bool silent)
var container = Contained(); var container = Contained();
var exploding_id = GetID(); var exploding_id = GetID();
var layer = GetObjectLayer(); var layer = GetObjectLayer();
Log("%d", cause_plr);
// Explosion parameters saved: Remove object now, since it should not be involved in the explosion. // Explosion parameters saved: Remove object now, since it should not be involved in the explosion.
RemoveObject(); RemoveObject();
@ -346,21 +347,22 @@ global func BlastObjects(int x, int y, int level, object container, int cause_pl
return true; return true;
} }
global func BlastObject(int Level, CausedBy) global func BlastObject(int level, int caused_by)
{ {
var self = this; var self = this;
if (CausedBy == nil) if (caused_by == nil)
CausedBy = GetController(); caused_by = GetController();
DoDamage(Level, FX_Call_DmgBlast, CausedBy); DoDamage(level, FX_Call_DmgBlast, caused_by);
if (!self) return; if (!self) return;
if (GetAlive()) if (GetAlive())
DoEnergy(-Level/3, false, FX_Call_EngBlast, CausedBy); DoEnergy(-level/3, false, FX_Call_EngBlast, caused_by);
if (!self) return; if (!self) return;
if (this.BlastIncinerate && GetDamage() >= this.BlastIncinerate) if (this.BlastIncinerate && GetDamage() >= this.BlastIncinerate)
Incinerate(Level, CausedBy); Incinerate(level, caused_by);
return;
} }
global func BlastObjectsShockwaveCheck(int x, int y) global func BlastObjectsShockwaveCheck(int x, int y)