Tractor beam
This commit is contained in:
49
entities/player/inventory/scripts/items/tractor_beam.gd
Normal file
49
entities/player/inventory/scripts/items/tractor_beam.gd
Normal file
@@ -0,0 +1,49 @@
|
||||
extends Item
|
||||
class_name TractorBeam
|
||||
|
||||
const USE_INTERVAL = 0.15
|
||||
|
||||
func get_item_name() -> String:
|
||||
return tr("TRACTOR_BEAM")
|
||||
|
||||
func get_description() -> String:
|
||||
return tr("TRACTOR_BEAM_DESC_TEXT")
|
||||
|
||||
func get_icon() -> Texture2D:
|
||||
# return preload("res://common/icons/tractor_beam.svg")
|
||||
return preload("res://common/icons/alert-triangle.svg")
|
||||
|
||||
func get_item_type() -> ItemType:
|
||||
return Item.ItemType.TOOL_ITEM
|
||||
|
||||
func get_energy_used() -> int:
|
||||
return 0
|
||||
|
||||
func get_usage_zone_radius() -> int:
|
||||
return 1
|
||||
|
||||
func is_usage_need_proximity() -> bool:
|
||||
return false
|
||||
|
||||
func get_action_is_hold() -> bool:
|
||||
return true
|
||||
|
||||
func use_text() -> String:
|
||||
return tr("MOVE")
|
||||
|
||||
func can_use(_player: Player, _zone: Player.ActionZone) -> bool:
|
||||
return Pointer.inspected != null
|
||||
|
||||
func use(_player: Player, _zone: Player.ActionZone) -> bool:
|
||||
if Pointer.dragging_inspected:
|
||||
Pointer.stop_dragging()
|
||||
if !Pointer.dragging_inspected:
|
||||
return true
|
||||
else:
|
||||
return false
|
||||
else:
|
||||
Pointer.start_dragging()
|
||||
if Pointer.dragging_inspected:
|
||||
return true
|
||||
else:
|
||||
return false
|
||||
@@ -0,0 +1 @@
|
||||
uid://drs03fydfofxx
|
||||
Reference in New Issue
Block a user