En:Andreas itemfreeze
Aus EnigmaWiki
Available languages: Deutsch, English, Русский
The library itemfreeze makes a new stone available that has a whole new set of characteristics. For the sake of simplicity the stone receives the name "st-itemfreeze". It is to be considered however, that here it does not concern strictly a stone, like one found in the Stones reference page, and it can not be set with set_stone(...).
An st-itemfreeze with frozen hammer.
Characteristics of st-itemfreeze
The stone behaves in principle like a movable glass stone (st-glass_move), but has the following additional characteristics:
- If the stone is pushed over an item, it freezes the item, and the item now moves together with the stone. This in principle functions with all items. Exceptions are:
- it-blackbomb: Explodes, when the stone runs over it
- it-explosion{1..3}
- it-debris
- it-burnable
- it-burnable_ignited
- The stone can be destroyed by an explosion. Thus that item becomes released and the surrounding floor tiles transform into fl-ice. Explosions can be caused as follows:
- The stone is pushed over a bomb (it-blackbomb or it-whitebomb), or a bomb explodes directly beside the stone.
- A dynamite stick (it-dynamite) is ignited beside the stone.
- The stone is shifted with it-puller-{n,e,s,w}
- A frozen item that explodes with contact with a laser beam, is illuminated by a laser. The item is thereby destroyed.
- If the stone is pushed into a burning fire, it melts there and leaves fl-water
- If the stone is pushed, it removes all it-burnable that it runs over.
- If the stone is pushed over water or swamp, the water under the stone freezes. So a line of ice can be drawn over the water or swamp
- If it is pushed onto another item, then the item in the stone is released and this other item is frozen instead.
- Dynamite sticks (it-dynamite) stops to burn on, if it is frozen, and burns further if it is to be set free again. When frozen in the stone they do not react to laser irradiation.
Setting a st-itemfreeze
First the library must be loaded into the level, as explained on the page En:Libraries:
<el:dependency el:path="lib/andreas_itemfreeze" el:id="lib/andreas_itemfreeze" el:release="1" el:preload="true"/>
A st-itemfreeze can not be set, as previously mentioned, with the instruction set_stone( ... ), since it is not a "genuine" stone. Instead the following method is used:
set_itemfreeze(x,y)
where x and y are the coordinates.
Further, every level that wants to use one (or more) such itemfreezers, has to include one (and only one) timerstone (st-timer). There is no problem with using more timerstones for other tasks, but you need one single timerstone dedicated to all itemfreezers in the current level. Instead of set the timer manually with set_stone(...), you should use the following function call:
itemfreeze_init(x,y,0.01)
where x and y are the coordinates of the st-timer.
Other stone setting methods
First of all for levels that are written with En:Ant, the method set_itemfreeze(...) is unsuitable. Ant fans avail themselves therefore of the following code:
stones["..."] = cell{parent={{parent_itemfreeze, "it-foo"}}}
where "it-foo" is the item which can be frozen. If no item is to be frozen, simply an empty string "" is presented.
In all other respects the st-timer can be set by hand:
set_stone("st-timer",x,y,{interval="0.01", action="callback", target="itemfreeze_timercallback"})
(x and y are again the coordinates)
This can be then from use, if the stone should be invisible:
set_stone("st-timer",x,y,{interval="0.01", action="callback", target="itemfreeze_timercallback", invisible=TRUE})
The timer stone is then still present, but no longer visible.


