aboutsummaryrefslogtreecommitdiff
path: root/src/nodemetadata.cpp
Commit message (Expand)AuthorAge
* Update Copyright YearsSfan52013-02-24
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
* Properly and efficiently use split utility headersPerttu Ahola2012-06-17
* Switch the license to be LGPLv2/later, with small parts still remaining as GP...Perttu Ahola2012-06-05
* Strip unneeded variables from NodeMetadatadarkrose2012-06-03
* WIP node metadata, node timersKahrl2012-06-03
* Move NodeMetadata prototype containers to content_nodemeta.cpp to fix them no...Perttu Ahola2011-12-01
* Mode node definition loading from Lua (still not finished), fix metadata crea...Perttu Ahola2011-11-29
* Add names to NodeMetadataPerttu Ahola2011-11-29
* Create framework for getting rid of global definitions of node/tool/item/what...Perttu Ahola2011-11-29
* Switch more stuff to use the logging thing and fix segfault on player leave f...Perttu Ahola2011-10-16
* Created and moved stuff to content_nodemeta.{h,cpp}Perttu Ahola2011-06-18
* Moved some mapnode content stuff from mapnode.{h,cpp} and digging property st...Perttu Ahola2011-06-17
* hopefully fixed old furnaces taking ridiculous amounts of cpu and halting the...Perttu Ahola2011-06-16
* Reduced server CPU usage on NodeMetadata step()s. Also furnace now cooks whil...Perttu Ahola2011-05-31
* Some progress on transitioning from MapBlockObject to ActiveObject.Perttu Ahola2011-04-08
* fixed the bug of disabled removal of empty chestsPerttu Ahola2011-04-06
* Furnace is now usable. Added more tools.Perttu Ahola2011-04-05
* A more robust format for node metadataPerttu Ahola2011-04-05
* initial workings of the furnacePerttu Ahola2011-04-05
* changed node metadata format to better accomodate future needs and problemsPerttu Ahola2011-04-05
* Chests work now!Perttu Ahola2011-04-04
* initial chest metadataPerttu Ahola2011-04-04
* forgot some filesPerttu Ahola2011-04-04
>= times.find(rating); if (i == times.end()) { *time = 0; return false; } *time = i->second; return true; } void toJson(Json::Value &object) const; void fromJson(const Json::Value &json); }; typedef std::unordered_map<std::string, struct ToolGroupCap> ToolGCMap; typedef std::unordered_map<std::string, s16> DamageGroup; struct ToolCapabilities { float full_punch_interval; int max_drop_level; ToolGCMap groupcaps; DamageGroup damageGroups; int punch_attack_uses; ToolCapabilities( float full_punch_interval_ = 1.4f, int max_drop_level_ = 1, const ToolGCMap &groupcaps_ = ToolGCMap(), const DamageGroup &damageGroups_ = DamageGroup(), int punch_attack_uses_ = 0 ): full_punch_interval(full_punch_interval_), max_drop_level(max_drop_level_), groupcaps(groupcaps_), damageGroups(damageGroups_), punch_attack_uses(punch_attack_uses_) {} void serialize(std::ostream &os, u16 version) const; void deSerialize(std::istream &is); void serializeJson(std::ostream &os) const; void deserializeJson(std::istream &is); }; struct DigParams { bool diggable; // Digging time in seconds float time; // Caused wear u16 wear; std::string main_group; DigParams(bool a_diggable = false, float a_time = 0.0f, u16 a_wear = 0, const std::string &a_main_group = ""): diggable(a_diggable), time(a_time), wear(a_wear), main_group(a_main_group) {} }; DigParams getDigParams(const ItemGroupList &groups, const ToolCapabilities *tp); struct HitParams { s16 hp; u16 wear; HitParams(s16 hp_ = 0, u16 wear_ = 0): hp(hp_), wear(wear_) {} }; HitParams getHitParams(const ItemGroupList &armor_groups, const ToolCapabilities *tp, float time_from_last_punch); HitParams getHitParams(const ItemGroupList &armor_groups, const ToolCapabilities *tp); struct PunchDamageResult { bool did_punch = false; int damage = 0; int wear = 0; PunchDamageResult() = default; }; struct ItemStack; PunchDamageResult getPunchDamage( const ItemGroupList &armor_groups, const ToolCapabilities *toolcap, const ItemStack *punchitem, float time_from_last_punch ); f32 getToolRange(const ItemDefinition &def_selected, const ItemDefinition &def_hand);