lots of changeru
This commit is contained in:
@@ -430,6 +430,25 @@ func take_fire_damage(amount: float, _attacker_position: Vector2) -> void:
|
||||
else:
|
||||
_break_into_pieces()
|
||||
|
||||
func take_damage(amount: float, _from_position: Vector2) -> void:
|
||||
"""Generic damage from bomb, frost spike, etc. Any destroyable object."""
|
||||
if not is_destroyable or is_broken:
|
||||
return
|
||||
health -= amount
|
||||
if health > 0:
|
||||
return
|
||||
var game_world = get_tree().get_first_node_in_group("game_world")
|
||||
if multiplayer.has_multiplayer_peer():
|
||||
if multiplayer.is_server():
|
||||
if game_world and game_world.has_method("_rpc_to_ready_peers"):
|
||||
game_world._rpc_to_ready_peers("_sync_object_break", [name])
|
||||
_break_into_pieces()
|
||||
else:
|
||||
if game_world and game_world.has_method("_sync_object_break"):
|
||||
game_world._sync_object_break.rpc_id(1, name)
|
||||
else:
|
||||
_break_into_pieces()
|
||||
|
||||
func on_grabbed(by_player):
|
||||
# Special handling for chests - open instead of grab
|
||||
if object_type == "Chest" and not is_chest_opened:
|
||||
|
||||
Reference in New Issue
Block a user