Applies any buoyancy effects to the given @entity. The concept of buoyancy is that if something floats in water then it should rise up if underwater, if something does not float but is on or in the water then it should sink to the bottom. This function is incomplete, and currently things just sink to the bottom. This will also cause something to sink through air to the ground. Downward sinking is determined by any open downward exits. Mostly, just use this on items for now :)
Example (used when loading moonstones):
@room = %roomGetRandom() @moonstone = %load( item, @moonstoneId, @room )
if( @room->terrainType == "air" \ || \ @room->terrainType == "swimWater" \ || \ @room->terrainType == "noSwimWater" \ || \ @room->terrainType == "underwater" ) { %applyBuoyancy( @moonstone ) } endif
@room = %getRoomPointer( @moonstone )
if( @room->terrainType == "air" \ || \ @room->terrainType == "swimWater" \ || \ @room->terrainType == "noSwimWater" \ || \ @room->terrainType == "underwater" ) { %purge( @moonstone ) } endif |