#37 ajout d'item outils ainsi que de visualisation de leur zone d'effet (avec la classe ActionArea
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
@tool
|
||||
extends Item
|
||||
class_name SeedItem
|
||||
class_name Seed
|
||||
|
||||
@export var plant_type: PlantType :
|
||||
set(v):
|
||||
12
common/inventory/scripts/items/shovel.gd
Normal file
12
common/inventory/scripts/items/shovel.gd
Normal file
@@ -0,0 +1,12 @@
|
||||
extends ToolItem
|
||||
class_name Shovel
|
||||
|
||||
func can_use(player : Player) -> bool:
|
||||
var areas = player.action_area.get_overlapping_areas()
|
||||
for area in areas :
|
||||
if area is Plant:
|
||||
return true
|
||||
return false
|
||||
|
||||
func use(_player : Player) -> bool:
|
||||
return false
|
||||
1
common/inventory/scripts/items/shovel.gd.uid
Normal file
1
common/inventory/scripts/items/shovel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dya38x1h1uiyg
|
||||
Reference in New Issue
Block a user