MagicDuel

Heat on items

Announcement 1512 · · Stage 10
This is the base for a lot more future development.
Items will share the heat given by anyone to them, regardless from what script it was given, it all goes to one place and that is the item itself. Take care when there are multiple scripts on an item that use these new heat functions, they will all share the heat stored for that item. This is because items/clickables should be regarded for what they are and not as simple storage points for various scripts (as you use them now).

Current issues:
player list of those that gave heat remains forever (not reset). Possible solution is to reset it as soon as the heat on the item drops to zero. Consider implications of this solutions and other possible ways and discuss it on the forum.

Syntax and sample code

//takes heat from active heat on current user
//gives that heat to the item is is running on
@va = mdsi_takeheat(50);

//returns the total item heat, who gave and how much
@vb = mdsi_item_heat();
@vh = @vb['current'];
@vp = @vb['players'];

//returns current user active heat
@vc = mds_player_heat();

echo "this item took @va heat from your active heat<br>";
echo "item currently accumulated a total of @vh heat<br>";
echo "Your currently remain with @vc heat<br>";

echo "heat to this item was given by:<br>";

//go through all players that gave heat and display them
foreach(@vp as @vk => @vv){
echo @vk." gave ".@vv." heat<br>";
}


Someone pls document this. if you need any more details or clarification, ask. Extensive testing is needed for unusual situations (if any).