#include "irrlichttypes.h"
#include "itemgroup.h"
#include "json-forwards.h"
#include "common/c_types.h"
#include <SColor.h>
#include <string>
#include <iostream>
#include <map>
#include <unordered_map>
#include <optional>
Go to the source code of this file.
Classes | |
struct | ToolGroupCap |
struct | ToolCapabilities |
struct | WearBarParams |
struct | DigParams |
struct | HitParams |
struct | PunchDamageResult |
Typedefs | |
typedef std::unordered_map< std::string, struct ToolGroupCap > | ToolGCMap |
typedef std::unordered_map< std::string, s16 > | DamageGroup |
Functions | |
DigParams | getDigParams (const ItemGroupList &groups, const ToolCapabilities *tp, const u16 initial_wear=0) |
HitParams | getHitParams (const ItemGroupList &armor_groups, const ToolCapabilities *tp, float time_from_last_punch, u16 initial_wear=0) |
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, u16 initial_wear=0) |
u32 | calculateResultWear (const u32 uses, const u16 initial_wear) |
f32 | getToolRange (const ItemStack &wielded_item, const ItemStack &hand_item, const IItemDefManager *itemdef_manager) |
typedef std::unordered_map<std::string, s16> DamageGroup |
typedef std::unordered_map<std::string, struct ToolGroupCap> ToolGCMap |
u32 calculateResultWear | ( | const u32 | uses, |
const u16 | initial_wear ) |
References U16_MAX.
Referenced by getDigParams(), getHitParams(), LuaItemStack::l_add_wear_by_uses(), and ModApiUtil::l_get_tool_wear_after_use().
DigParams getDigParams | ( | const ItemGroupList & | groups, |
const ToolCapabilities * | tp, | ||
const u16 | initial_wear = 0 ) |
References calculateResultWear(), 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().
HitParams getHitParams | ( | const ItemGroupList & | armor_groups, |
const ToolCapabilities * | tp ) |
HitParams getHitParams | ( | const ItemGroupList & | armor_groups, |
const ToolCapabilities * | tp, | ||
float | time_from_last_punch, | ||
u16 | initial_wear = 0 ) |
References calculateResultWear(), 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().
PunchDamageResult getPunchDamage | ( | const ItemGroupList & | armor_groups, |
const ToolCapabilities * | toolcap, | ||
const ItemStack * | punchitem, | ||
float | time_from_last_punch, | ||
u16 | initial_wear = 0 ) |
References PunchDamageResult::damage, PunchDamageResult::did_punch, getHitParams(), HitParams::hp, itemgroup_get(), ItemStack::name, HitParams::wear, ItemStack::wear, and PunchDamageResult::wear.
Referenced by GenericCAO::directReportPunch(), and LuaEntitySAO::punch().
f32 getToolRange | ( | const ItemStack & | wielded_item, |
const ItemStack & | hand_item, | ||
const IItemDefManager * | itemdef_manager ) |
References ItemStack::getDefinition(), SimpleMetadata::getString(), ItemStack::metadata, ItemDefinition::range, and stof.
Referenced by Server::checkInteractDistance(), and Game::processPlayerInteraction().