This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
wiki:data:pages:dev:skills [2007/04/30 09:07] 127.0.0.1 external edit |
wiki:data:pages:dev:skills [2020/09/30 14:26] (current) ryo [Harvesting limits] fix heading |
||
---|---|---|---|
Line 229: | Line 229: | ||
==== SK_HARVESTING ==== | ==== SK_HARVESTING ==== | ||
- | This skill lets a player "grab" items from a spot. Example is fishing, where the player "grabs" fish from the sea/a river. | + | This skill lets a player "grab" items from a spot. Example is [[skills:fishing|fishing]], where the player "grabs" fish from the sea/a river. |
Main function is ''server/c_misc.c:do_harvest()''. | Main function is ''server/c_misc.c:do_harvest()''. | ||
Line 257: | Line 257: | ||
If harvested item is a monster, it'll be inserted in the map instead of player's inventory (suggestion by Lalo) | If harvested item is a monster, it'll be inserted in the map instead of player's inventory (suggestion by Lalo) | ||
+ | |||
+ | === Harvesting limits === | ||
+ | As from r21463, limits are introduced. | ||
+ | |||
+ | When harvesting an item from a tile, the harvested item's ''nrof'' (''count'') is decremented by 1. If it reaches 0, the item is removed from the tile's inventory. | ||
+ | |||
+ | Thus the tile's inventory will ultimately be empty of harvestable items. | ||
+ | |||
+ | As a special case, if the harvested item's ''nrof'' is 0, then its count is not decremented. This allows map makers to have unlimited harvested items. | ||
+ | |||
+ | When the last harvestable item of a tile is removed, if the tile has a ''harvest_exhaust_replacement'' field, then: | ||
+ | * if the field is ''-'' then the tile itself is removed | ||
+ | * else the field is then name of an archetype to replace the tile with |