2010-02-11 08:25:12 +00:00
|
|
|
/*-- Ice --*/
|
|
|
|
|
2010-08-03 23:22:56 +00:00
|
|
|
protected func Hit()
|
|
|
|
{
|
2015-12-13 21:14:55 +00:00
|
|
|
Sound("Hits::IceHit?");
|
2010-08-03 23:22:56 +00:00
|
|
|
}
|
|
|
|
|
2010-02-21 19:15:45 +00:00
|
|
|
protected func Construction()
|
2010-02-11 08:25:12 +00:00
|
|
|
{
|
2010-02-21 19:15:45 +00:00
|
|
|
var graphic = Random(5);
|
2013-10-28 10:39:41 +00:00
|
|
|
if (graphic)
|
|
|
|
SetGraphics(Format("%d", graphic));
|
2012-05-05 10:09:44 +00:00
|
|
|
AddTimer("Check", 30);
|
2010-02-11 08:25:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
protected func Check()
|
|
|
|
{
|
2013-10-28 10:39:41 +00:00
|
|
|
if (GetTemperature() <= 0 && GetMaterial() == Material("Water") && GetCon() < 100)
|
|
|
|
Freeze();
|
|
|
|
// Don't do anything af
|
|
|
|
if (GetTemperature() > 0)
|
|
|
|
Melt();
|
2010-02-11 08:25:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private func Melt()
|
|
|
|
{
|
2013-10-28 10:39:41 +00:00
|
|
|
CastPXS("Water", 2, 0);
|
2010-02-20 06:17:58 +00:00
|
|
|
DoCon(-1);
|
2010-02-11 08:25:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private func Freeze()
|
|
|
|
{
|
2013-10-28 10:39:41 +00:00
|
|
|
ExtractMaterialAmount(0, 0, Material("Water"), 2);
|
2010-02-20 06:17:58 +00:00
|
|
|
DoCon(1);
|
2010-02-11 08:25:12 +00:00
|
|
|
}
|
|
|
|
|
2014-04-28 22:25:06 +00:00
|
|
|
func IsLiquid() { return "Water"; }
|
|
|
|
func GetLiquidAmount() { return GetCon()*2; }
|
|
|
|
|
2010-09-09 21:29:11 +00:00
|
|
|
local Collectible = 1;
|
|
|
|
local Name = "$Name$";
|
2010-09-11 17:30:45 +00:00
|
|
|
local Description = "$Description$";
|
2013-11-29 14:05:37 +00:00
|
|
|
local Plane = 450;
|