P3 alpha: wolf moon every 7th night, the alpha breaks wooden doors, iron-banded door, broken-door repair, alpha pelt and cloak (protocol 7)
This commit is contained in:
@@ -305,6 +305,22 @@ func toggle_door(player: Node3D, door: Node3D) -> bool:
|
||||
door.set_open(not door.open)
|
||||
return true
|
||||
|
||||
## E on a door an alpha broke: mend it (two wood), shut.
|
||||
func repair_door(player: Node3D, door: Node3D) -> bool:
|
||||
if not is_instance_valid(door) or not door.get("broken") or not _in_reach(player, door, 1.0):
|
||||
return false
|
||||
if _online():
|
||||
return _ask("door_repair", [WorldNet.nid(door)])
|
||||
for id in door.REPAIR_COST:
|
||||
if player.inventory.count(id) < int(door.REPAIR_COST[id]):
|
||||
tell(player, "Need %d %s to mend the door" % [int(door.REPAIR_COST[id]), ItemDB.item_name(id).to_lower()])
|
||||
return false
|
||||
for id in door.REPAIR_COST:
|
||||
player.inventory.remove(id, int(door.REPAIR_COST[id]))
|
||||
door.set_broken(false)
|
||||
tell(player, "Door mended")
|
||||
return true
|
||||
|
||||
## E on a bed: claim it as your spawn point, or (if it's already yours) sleep.
|
||||
func use_bed(player: Node3D, bed: Node3D) -> bool:
|
||||
if not is_instance_valid(bed) or not _in_reach(player, bed, 1.0):
|
||||
|
||||
Reference in New Issue
Block a user