P1 iron: nuggets, ore, clay, kiln, smelter, forge, iron tools and arrows, lantern, tool wear and repair
This commit is contained in:
@@ -179,6 +179,9 @@ func _trees() -> void:
|
||||
check(tree.depleted, "Alice fells it in %d hits (her world shows it when the server says so)" % hits)
|
||||
await _sleep(0.3)
|
||||
check(player.inventory.count("wood") > wood0, "and the server gives her the wood (%d)" % (player.inventory.count("wood") - wood0))
|
||||
var axe = player.inventory.get_slot(_slot_of("stone_axe"))
|
||||
check(axe != null and root.get_node("ItemDB").durability(axe) == 60 - hits,
|
||||
"her axe wore down on the server: %d of 60 uses left" % (root.get_node("ItemDB").durability(axe) if axe != null else -1))
|
||||
var rep := await _bob({"do": "report", "uids": [uid]})
|
||||
var bn: Variant = rep.nodes.get(uid)
|
||||
check(bn != null and bool(bn.depleted), "Bob sees it fall too")
|
||||
@@ -331,6 +334,22 @@ func _containers_and_fires() -> void:
|
||||
rep = await _bob({"do": "report"})
|
||||
seen = rep.pieces.get(str(WN.nid(_fire)), {})
|
||||
check(absf(float(seen.get("fuel", -100.0)) - _fire.fuel) < 5.0, "Bob's fire has the same fuel (%.0f s)" % float(seen.get("fuel", -1.0)))
|
||||
print("a smelter")
|
||||
var ssite: Vector3 = world.build.debug_find_site(fsite + Vector3(0, 0, -5), 1.5)
|
||||
await Bot.walk(player, ssite + Vector3(-2.0, 0, 0), world)
|
||||
var sm := await _place("smelter", ssite, 0.0)
|
||||
check(sm != null, "Alice builds a smelter")
|
||||
if sm != null:
|
||||
A.transfer(player, player.inventory, await _give("iron_ore", 1), sm.inventory, sm)
|
||||
await _sleep(0.3)
|
||||
A.transfer(player, player.inventory, await _give("charcoal", 1), sm.inventory, sm)
|
||||
await _until(func(): return sm.inventory.count("charcoal") == 1, 2.0)
|
||||
check(sm.working(), "puts in ore and charcoal: it's smelting")
|
||||
PN.ask("debug_process", [35.0])
|
||||
await _until(func(): return sm.inventory.count("iron_bar") == 1, 2.0)
|
||||
check(sm.inventory.count("iron_bar") == 1 and sm.inventory.count("iron_ore") == 0,
|
||||
"the server smelts it, and the bar shows up in Alice's view of it")
|
||||
await Bot.walk(player, fsite + Vector3(-2.0, 0, 0), world)
|
||||
await _until(func(): return "Warm" in player.survival.statuses, 2.0)
|
||||
check("Warm" in player.survival.statuses and player.survival.heat > 0.25,
|
||||
"standing by it, the server says she's Warm (heat %.2f)" % player.survival.heat)
|
||||
|
||||
Reference in New Issue
Block a user