Minetest  5.4.0
tool.cpp File Reference
#include "tool.h"
#include "itemdef.h"
#include "itemgroup.h"
#include "log.h"
#include "inventory.h"
#include "exceptions.h"
#include "util/serialize.h"
#include "util/numeric.h"
+ Include dependency graph for tool.cpp:

Functions

DigParams getDigParams (const ItemGroupList &groups, const ToolCapabilities *tp)
 
HitParams getHitParams (const ItemGroupList &armor_groups, const ToolCapabilities *tp, float time_from_last_punch)
 
HitParams getHitParams (const ItemGroupList &armor_groups, const ToolCapabilities *tp)
 
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)
 

Function Documentation

◆ getDigParams()

DigParams getDigParams ( const ItemGroupList groups,
const ToolCapabilities tp 
)

References ToolGroupCap::getTime(), ToolCapabilities::groupcaps, itemgroup_get(), ToolGroupCap::maxlevel, U16_MAX, and ToolGroupCap::uses.

Referenced by Server::handleCommand_Interact(), Game::handleDigging(), and ModApiUtil::l_get_dig_params().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHitParams() [1/2]

HitParams getHitParams ( const ItemGroupList armor_groups,
const ToolCapabilities tp 
)

References getHitParams().

+ Here is the call graph for this function:

◆ getHitParams() [2/2]

HitParams getHitParams ( const ItemGroupList armor_groups,
const ToolCapabilities tp,
float  time_from_last_punch 
)

References ToolCapabilities::damageGroups, ToolCapabilities::full_punch_interval, itemgroup_get(), ToolCapabilities::punch_attack_uses, rangelim, and U16_MAX.

Referenced by getHitParams(), getPunchDamage(), ModApiUtil::l_get_hit_params(), and PlayerSAO::punch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPunchDamage()

PunchDamageResult getPunchDamage ( const ItemGroupList armor_groups,
const ToolCapabilities toolcap,
const ItemStack punchitem,
float  time_from_last_punch 
)

References PunchDamageResult::damage, PunchDamageResult::did_punch, getHitParams(), HitParams::hp, itemgroup_get(), ItemStack::name, HitParams::wear, and PunchDamageResult::wear.

Referenced by GenericCAO::directReportPunch(), and LuaEntitySAO::punch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getToolRange()

f32 getToolRange ( const ItemDefinition def_selected,
const ItemDefinition def_hand 
)

References ItemDefinition::range.

Referenced by Server::checkInteractDistance(), and Game::processPlayerInteraction().

+ Here is the caller graph for this function: