<commit_before>--- This script contains a set of helper methods to work with money in the game.
--  This functions should be used for any interaction with money.
--
--  Author: <NAME> (Nitram)

require("base.common")

module("base.money", package.seeall)

--- The Item ID of the item used as gold coins.
GoldCoinsID = 61;

--- The Item ID of the item used as silver coins.
SilverCoinsID = 3077;

--- The Item ID of the item used as copper coins.
CopperCoinsID = 3076;

--- This method calculates the values of the 3 valid existing coin types (gold,
--  silver, copper) into a single value that represents the total money value
--  of the coins. It basically recalculates silver and gold coins to copper
--  coins in value and adds it to the copper coins and returns this value.
--
--  @param gCoins - number - the amount of gold coins
--  @param sCoins - number - the amount of silver coins
--  @param cCoins - number - the amount of copper coins
--  @return number - the total amount of the money in copper coins
function CoinsToMoney(gCoins, sCoins, cCoins)
    return (cCoins * 100 + sCoins) * 100 + gCoins;
end;
<commit_msg>Found a critical bug: Money was miscalculated for NPCs etc. Function CoinsToMoney mixed up gold and copper coins!<commit_after>--- This script contains a set of helper methods to work with money in the game.
--  This functions should be used for any interaction with money.
--
--  Author: <NAME> (Nitram)

require("base.common")

module("base.money", package.seeall)

--- The Item ID of the item used as gold coins.
GoldCoinsID = 61;

--- The Item ID of the item used as silver coins.
SilverCoinsID = 3077;

--- The Item ID of the item used as copper coins.
CopperCoinsID = 3076;

--- This method calculates the values of the 3 valid existing coin types (gold,
--  silver, copper) into a single value that represents the total money value
--  of the coins. It basically recalculates silver and gold coins to copper
--  coins in value and adds it to the copper coins and returns this value.
--
--  @param gCoins - number - the amount of gold coins
--  @param sCoins - number - the amount of silver coins
--  @param cCoins - number - the amount of copper coins
--  @return number - the total amount of the money in copper coins
function CoinsToMoney(gCoins, sCoins, cCoins)
    return (gCoins * 100 + sCoins) * 100 + cCoins;
end;

{'fraction_non_alphanumeric': 0.08361629881154499, 'fraction_numerical': 0.014431239388794566, 'mean_word_length': 3.2622061482820977, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5472301', 'n_tokens_mistral': 720, 'n_tokens_neox': 678, 'n_words': 347}