Lights to place indoors (tallow candle, torch stand); docs brought up to date; the journey plan; sticky teleports in net tests; protocol 15
This commit is contained in:
@@ -174,6 +174,19 @@ func _body() -> void:
|
||||
break
|
||||
check(player.survival.diet.meat > d0.meat and player.survival.diet.plants > d0.plants, "it counts as meat and greens")
|
||||
|
||||
print("lights indoors")
|
||||
inv.add("bear_fat", 1)
|
||||
inv.add("fiber", 1)
|
||||
check(A.craft(player, "tallow_candle") and inv.count("tallow_candle") == 4, "4 tallow candles from a lump of bear fat and some fibre, by hand")
|
||||
for id in ["tallow_candle", "torch_stand"]:
|
||||
var lamp := _place(id, here + Vector3(-2, 0, 3))
|
||||
var lights := lamp.find_children("*", "OmniLight3D", false, false)
|
||||
check(lamp.is_in_group("lamp") and lights.size() == 1 and (lights[0] as OmniLight3D).omni_range >= 6.0,
|
||||
"a %s, placed, gives a light (%.0f m)" % [DB.get_item(id).name.to_lower(), (lights[0] as OmniLight3D).omni_range if not lights.is_empty() else 0.0])
|
||||
player.global_position = lamp.global_position + Vector3(1.0, 0, 0)
|
||||
check(A.dismantle(player, lamp) and inv.count(id) >= 1, "and X takes it back up")
|
||||
player.global_position = here
|
||||
|
||||
print("bait")
|
||||
var B: Script = load("res://scripts/fishing/bobber.gd")
|
||||
var bob: Node3D = B.new()
|
||||
|
||||
@@ -233,11 +233,15 @@ func _toast_has(s: String) -> bool:
|
||||
return true
|
||||
return false
|
||||
|
||||
## Teleports Alice and makes sure it sticks (test_net_life.gd's _tp says why).
|
||||
func _tp(at: Vector3) -> void:
|
||||
PN.ask("debug_tp", [at + Vector3(0, 0.05, 0)])
|
||||
await _until(func(): return player.global_position.distance_to(at) < 1.0, 2.0)
|
||||
player.set_physics_process(false)
|
||||
await _sleep(0.3)
|
||||
for _try in range(3):
|
||||
PN.ask("debug_tp", [at + Vector3(0, 0.05, 0)])
|
||||
await _until(func(): return player.global_position.distance_to(at) < 1.0, 2.0)
|
||||
player.set_physics_process(false)
|
||||
await _sleep(0.5)
|
||||
if player.global_position.distance_to(at) < 1.0:
|
||||
return
|
||||
|
||||
func _give(id: String, n: int) -> int:
|
||||
var before: int = player.inventory.count(id)
|
||||
|
||||
@@ -327,11 +327,18 @@ func _wolves() -> void:
|
||||
|
||||
# --- helpers --------------------------------------------------------------------
|
||||
|
||||
## Teleports Alice (the server moves her) and makes sure it sticks: a last
|
||||
## position update her game sent from before the move can reach the server
|
||||
## after it, look like a jump, and get her moved back ("too fast"). So check
|
||||
## she's still there a moment later, and go again if not.
|
||||
func _tp(at: Vector3) -> void:
|
||||
PN.ask("debug_tp", [at + Vector3(0, 0.05, 0)])
|
||||
await _until(func(): return player.global_position.distance_to(at) < 1.0, 2.0)
|
||||
player.set_physics_process(false)
|
||||
await _sleep(0.3)
|
||||
for _try in range(3):
|
||||
PN.ask("debug_tp", [at + Vector3(0, 0.05, 0)])
|
||||
await _until(func(): return player.global_position.distance_to(at) < 1.0, 2.0)
|
||||
player.set_physics_process(false)
|
||||
await _sleep(0.5)
|
||||
if player.global_position.distance_to(at) < 1.0:
|
||||
return
|
||||
|
||||
func _give(id: String, n: int) -> int:
|
||||
var before: int = player.inventory.count(id)
|
||||
|
||||
@@ -321,11 +321,15 @@ func _bob_slot(id: String) -> int:
|
||||
return i
|
||||
return -1
|
||||
|
||||
## Teleports Alice and makes sure it sticks (test_net_life.gd's _tp says why).
|
||||
func _tp(at: Vector3) -> void:
|
||||
PN.ask("debug_tp", [at + Vector3(0, 0.05, 0)])
|
||||
await _until(func(): return player.global_position.distance_to(at) < 1.0, 2.0)
|
||||
player.set_physics_process(false)
|
||||
await _sleep(0.3)
|
||||
for _try in range(3):
|
||||
PN.ask("debug_tp", [at + Vector3(0, 0.05, 0)])
|
||||
await _until(func(): return player.global_position.distance_to(at) < 1.0, 2.0)
|
||||
player.set_physics_process(false)
|
||||
await _sleep(0.5)
|
||||
if player.global_position.distance_to(at) < 1.0:
|
||||
return
|
||||
|
||||
func _give(id: String, n: int) -> int:
|
||||
var before: int = player.inventory.count(id)
|
||||
|
||||
Reference in New Issue
Block a user