34 lines
848 B
GDScript
34 lines
848 B
GDScript
extends Item
|
|
class_name Detector
|
|
|
|
func get_item_name() -> String:
|
|
return tr("DETECTOR")
|
|
|
|
func get_item_type() -> ItemType:
|
|
return Item.ItemType.TOOL_ITEM
|
|
|
|
func get_description() -> String:
|
|
return tr("DETECTOR_DESC_TEXT")
|
|
|
|
func get_icon() -> Texture2D:
|
|
return preload("res://common/icons/broadcast.svg")
|
|
|
|
func get_energy_used() -> int:
|
|
return 0
|
|
|
|
func get_usage_zone_radius() -> int:
|
|
return 0
|
|
|
|
func can_use(_player : Player, _zone: Player.ActionZone) -> bool:
|
|
return true
|
|
|
|
func use_text() -> String:
|
|
return tr("DETECT_USE_TEXT")
|
|
|
|
func use(player : Player, zone: Player.ActionZone):
|
|
var detector_signal := DetectorSignal.new(player.region, zone.get_global_position())
|
|
detector_signal.global_position = zone.get_global_position()
|
|
|
|
player.region.add_child(detector_signal)
|
|
AudioManager.play_sfx("Signal")
|