Terraria Wiki
Terraria Wiki
KKeine Bearbeitungszusammenfassung
 
Westgrass (Diskussion | Beiträge)
K (en interwiki link)
 
Zeile 1: Zeile 1:
  +
{{aq|0}}{{wiki merge|origin=Ebenholzhammer}}
------------------------ Source code dbs ------------------------
 
  +
{{ Infobox_Werkzeug
---Combined DE localization files data
 
  +
| Bild = Datei: Ebonwood_Hammer.png
local dbs_de = mw.loadData('Module:GameText/db-de')
 
  +
| Name = Ebenholzhammer
---Combined EN localization files data
 
  +
| engl. Name = Ebonwood Hammer
local dbs_en = mw.loadData('Module:GameText/db-en')
 
  +
| Typ = Hammer
-----------------------------------------------------------------
 
  +
| Schaden = 8
  +
| Kraft = 40%
  +
| Rückstoß = stark
  +
| Geschwindigkeit = Durchschnittlich
  +
| Verkaufspreis Kupfer = 10
 
}}
  +
Der '''Ebenholzhammer''' ist ein einfach herzustellendes Item aus [[Ebenholz]]. Wobei sich die Beschaffung anfangs vielleicht als etwas schwierig gestalten könnte.
   
  +
Im Gegensatz zum normalen [[Holzhammer]] ist der Ebenholzhammer schon um einiges besser.
-------------------------- Custom dbs ---------------------------
 
  +
==Herstellung==
---Manual additions, holds three children tables
 
  +
{{Crafting-Rezept
local custom_parent_database = mw.loadData('Module:Tr/db/custom')
 
  +
|Tool = Werkbank
---Manual additions EN → DE, to be complemented DE → EN
 
  +
|Item1 = Ebenholz
local custom_db_de = custom_parent_database.manual_de
 
  +
|Anzahl1 = 8
---Manual additions EN → DE
 
  +
|Resultat = Ebonwood_Hammer
local custom_db_de_oneway = custom_parent_database.manual_de_oneway
 
  +
|name = Ebenholzhammer}}
---Manual additions DE → EN
 
  +
[[Kategorie:Hammer]]
local custom_db_en_oneway = custom_parent_database.manual_en_oneway
 
  +
[[Kategorie:Holz]]
local custom_database_de = {}
 
  +
[[Kategorie:Infektion]]
local custom_database_en = {}
 
  +
[[en:Ebonwood Hammer]]
-----------------------------------------------------------------
 
 
local trim = mw.text.trim
 
local getGameText = require("Module:GameText").getText
 
 
---Holds the arguments from the #invoke call.
 
local args_table
 
 
 
---Return a trimmed version of the value of the template parameter with the specified `key`.
 
---Return `nil` if the parameter is empty or unset.
 
---@param key string|number
 
---@return string|nil
 
local function getArg(key)
 
local value = trim(args_table[key] or '')
 
return (value ~= '') and value or nil
 
end
 
 
---Return a processed version of the input `text`: Resolve `{$ }` and `{? }` gameText placeholders and escape quotes and linebreaks.
 
---@param text string
 
---@param lang string The language to use for the `{{gameText}}` replacements
 
---@return string
 
local function process(text, lang)
 
text = string.gsub(text, "({%$(.-)})", function(_, ref) return getGameText(ref, lang) end) -- resolve all "{$ }" gameText placeholders
 
text = string.gsub(text, "{%?.-}", "") -- remove all "{? }" placeholders, e.g. "{?Homeless}" or "{?!BloodMoon}"
 
if mw.ustring.find(text, "\"") then
 
text = mw.ustring.gsub(text, "\"", "\\\"") -- replace all ( " ) with ( \" )
 
end
 
if mw.ustring.find(text, "\n") then
 
text = mw.ustring.gsub(text, "\n", "\\n") -- replace all newlines with ( \n )
 
end
 
return text
 
end
 
 
---Fill the two custom databases with the information from the three tables.
 
---Combine the two-way table with the respective language's one-way table.
 
local function createCustomDbs()
 
 
-- EN
 
-- generate custom en db from custom de db
 
for k, v in pairs(custom_db_de) do
 
custom_database_en[v] = k
 
end
 
-- insert the oneway db
 
for k, v in pairs(custom_db_en_oneway) do
 
custom_database_en[k] = v
 
end
 
 
-- DE
 
-- copy custom de db so that we can insert entries
 
for k, v in pairs(custom_db_de) do
 
custom_database_de[k] = v
 
end
 
-- insert the oneway db
 
for k, v in pairs(custom_db_de_oneway) do
 
custom_database_de[k] = v
 
end
 
end
 
-----------------------------------------------------------------
 
 
-- main return object
 
return {
 
go = function(frame)
 
args_table = frame.args -- cache
 
 
local bot = getArg('bot')
 
local lang = getArg(1)
 
 
-- invalid or empty lang?
 
if not lang or (lang ~= 'de' and lang ~= 'en') then
 
return frame:expandTemplate{ title = 'error', args = { 'Missing or invalid language specification (use "de" or "en")!' } }
 
end
 
 
local nl
 
if bot then
 
nl = '\n'
 
else
 
nl = mw.text.tag{ name = "br", content = false }
 
end
 
 
createCustomDbs()
 
 
local oppositeDb
 
 
---Array that stores the output lines of the non-manual data
 
local outputlines_sourcecode = {}
 
---Set that records the keys that have been added to the output lines
 
local keys_in_outputlines = {}
 
 
---Array that stores the output lines of the manual data
 
local outputlines_custom = {}
 
 
---Number of entries in `outputlines_custom`
 
local maxn_c
 
---Number of entries in both `outputlines` arrays
 
local maxn_total
 
 
local resultStr = ''
 
 
if lang == 'de' then
 
-- DE source code db
 
-- iterate over the objects (named "Announcement", "ArmorSetBonus", etc.)
 
for dbkey, db in pairs(dbs_de) do
 
oppositeDb = dbs_en[dbkey]
 
-- iterate over the elements in the object
 
for k, v in pairs(db) do
 
-- create a new key and value to add into the database
 
local newkey_en = process(oppositeDb[k], "en")
 
if newkey_en and newkey_en ~= '' and keys_in_outputlines[newkey_en] == nil then -- only if this key doesn't already exist in the table
 
local newvalue_de = process(v, "de") or "(unknown)"
 
table.insert(outputlines_sourcecode, "[\"" .. newkey_en .. "\"] = \"" .. newvalue_de .. "\"," .. nl)
 
keys_in_outputlines[newkey_en] = true -- register key
 
end
 
end
 
end
 
table.sort(outputlines_sourcecode)
 
 
-- DE custom db
 
for k, v in pairs(custom_database_de) do
 
table.insert(outputlines_custom, "[\"" .. process(k, "en") .. "\"] = \"" .. process(v, "de") .. "\"," .. nl)
 
end
 
table.sort(outputlines_custom)
 
 
-- count entries
 
maxn_c = table.maxn(outputlines_custom) -- count DE custom db entries
 
maxn_total = table.maxn(outputlines_sourcecode) + maxn_c -- count DE total db entries
 
 
elseif lang == 'en' then
 
-- EN source code db
 
for dbkey, db in pairs(dbs_en) do
 
oppositeDb = dbs_de[dbkey]
 
resultStr = resultStr .. 'dbkey:' .. dbkey .. '<br/>'
 
--[[
 
for k, v in pairs(db) do
 
local newkey_de = process(oppositeDb[k], "de")
 
if newkey_de and newkey_de ~= '' and keys_in_outputlines[newkey_de] == nil then -- only if this key doesn't already exist in the table
 
local newvalue_en = process(v, "en") or "(unknown)"
 
table.insert(outputlines_sourcecode, "[\"" .. newkey_de .. "\"] = \"" .. newvalue_en .. "\"," .. nl)
 
keys_in_outputlines[newkey_de] = true -- register key
 
end
 
end
 
]]
 
end
 
table.sort(outputlines_sourcecode)
 
 
-- EN custom db
 
for k, v in pairs(custom_database_en) do
 
table.insert(outputlines_custom, "[\"" .. process(k, "de") .. "\"] = \"" .. process(v, "en") .. "\"," .. nl)
 
end
 
table.sort(outputlines_custom)
 
 
-- count entries
 
maxn_c = table.maxn(outputlines_custom) -- count EN custom db entries
 
maxn_total = table.maxn(outputlines_sourcecode) + maxn_c -- count EN total db entries
 
end
 
 
return resultStr
 
--[[
 
 
---Final output string
 
local resultStr = {}
 
 
local lang_direction
 
if lang == 'de' then
 
lang_direction = "EN → DE"
 
elseif lang == 'en' then
 
lang_direction = "DE → EN"
 
end
 
 
-- assemble main table body
 
table.insert(resultStr, nl .. "return {" .. nl)
 
table.insert(resultStr, "-- entries from the source code, " .. lang_direction .. nl)
 
table.insert(resultStr, table.concat(outputlines_sourcecode))
 
table.insert(resultStr, "-- custom additions, " .. lang_direction .. nl)
 
table.insert(resultStr, table.concat(outputlines_custom))
 
table.insert(resultStr, "}")
 
 
-- add header
 
table.insert(resultStr, 1, "-- " .. lang_direction .. " translation database" .. nl)
 
table.insert(resultStr, 2, "-- Generated at " .. os.date() .. " (UTC)" .. nl)
 
table.insert(resultStr, 3, "-- Generated by Template:Tr/luadata-" .. lang .. nl)
 
table.insert(resultStr, 4, "-- Number of entries: " .. maxn_total .. " (" .. maxn_c .. " of which custom)" .. nl)
 
 
-- print
 
return table.concat(resultStr) .. nl
 
]]
 
end
 
}
 

Version vom 16. Dezember 2021, 02:33 Uhr

Zusammenführung der Wikis von Gamepedia und Fandom
Zusammenführung der Wikis von Gamepedia und Fandom
Diese Seite enthält womöglich Darstellungs- oder Formatierungsfehler!
Sie wurde im Zuge der Wiki-Zusammenführung von der Seite Ebenholzhammer importiert und noch nicht angepasst. Mitunter sind Bilder, Links oder Vorlagen eingebunden, die in diesem Wiki nicht verfügbar sind.
EbenholzhammerEbonwood Hammer
  • Ebenholzhammer (Inventargrafik)
Autoschwingen
Stack digit 1
Eigenschaften
  • Pickaxe mask 0 %
  • Hammer mask 40 %
  • Axe mask 0 %
Typ
Schaden7 (Nahkampf)
Rückstoß5,5 (Mittel)
KT-Chance4 %
Ben.geschw.30 (Durchschnittlich)
Werkz.geschw.20
SeltenheitSeltenheitsstufe: 0
Verkaufen10
Erforschen1 erforderlich

Der Ebenholzhammer ist ein einfach herzustellendes Item aus Ebenholz. Wobei sich die Beschaffung anfangs vielleicht als etwas schwierig gestalten könnte.

Im Gegensatz zum normalen Holzhammer ist der Ebenholzhammer schon um einiges besser.

Herstellung

ResultatZutatenHerstellungsobjekt
EbenholzhammerEbenholzhammerWerkbankWerkbank