forked from Mirrors/openclonk
objects on fire inflame inflammable materials
parent
548215d448
commit
695680cb6c
|
@ -2,12 +2,11 @@
|
|||
Engine callback handling for landscape inflammation
|
||||
*/
|
||||
|
||||
/**
|
||||
Callback from engine when landsape is incinerated at an incindiary material
|
||||
*/
|
||||
// Callback from engine when landsape is incinerated at an incindiary material.
|
||||
global func InflameLandscape(int x, int y, int cause_player)
|
||||
{
|
||||
// Not too many flames
|
||||
if (!FindObject(Find_InRect(x-4, y-1, 8, 20), Find_ID(Flame)))
|
||||
return CreateObjectAbove(Flame, x, y, cause_player);
|
||||
// Not too many flames.
|
||||
if (!FindObject(Find_InRect(x - 5, y - 4, 10, 24), Find_ID(Flame)))
|
||||
CreateObjectAbove(Flame, x, y, cause_player);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -352,8 +352,10 @@ global func FxFireTimer(object target, proplist effect, int time)
|
|||
// target is in liquid?
|
||||
if (time % (20 + effect.FreqReduction) == 0)
|
||||
{
|
||||
// Extinguish when in water-like materials.
|
||||
var mat;
|
||||
if (mat = GetMaterial())
|
||||
{
|
||||
if (GetMaterialVal("Extinguisher", "Material", mat))
|
||||
{
|
||||
var steam =
|
||||
|
@ -368,6 +370,10 @@ global func FxFireTimer(object target, proplist effect, int time)
|
|||
CreateParticle("Dust", 0, -5, 0, 0, 180, steam, 2);
|
||||
return FX_Execute_Kill;
|
||||
}
|
||||
}
|
||||
|
||||
// Incinerate landscape if possible.
|
||||
target->IncinerateLandscape(0, 0, effect.caused_by);
|
||||
|
||||
// check spreading of fire
|
||||
if (effect.strength > 10)
|
||||
|
|
Loading…
Reference in New Issue