Feature pour l'alpha 1.3
* Ajout d'un mode infini (pour nos hard core gamers) * Ajout d'un message de découverte d'un nouvel outil * Séparation de la pelle en deux outils : la pioche et la fourche * Amélioration de la lisibilité des capsules d'énergies * Changement léger des texture du sol et de la pierre * Correction d'un bug lors du clic frénétique sur le porte de sortie du vaisseau * Ajout d'un icône de recharge * Fix de la mutation Ancien qui ne s'améliorait pas au niveau 4 + début de dev des artefacts avec un distributeur
This commit is contained in:
@@ -4,44 +4,45 @@ class_name Fork
|
||||
const USE_INTERVAL = 0.15
|
||||
|
||||
func get_item_name() -> String:
|
||||
return tr("FORK")
|
||||
return tr("FORK")
|
||||
|
||||
func get_description() -> String:
|
||||
return tr("FORK_DESC_TEXT")
|
||||
return tr("FORK_DESC_TEXT")
|
||||
|
||||
func get_icon() -> Texture2D:
|
||||
return preload("res://common/icons/fork.svg")
|
||||
return preload("res://common/icons/fork.svg")
|
||||
|
||||
func get_item_type() -> ItemType:
|
||||
return Item.ItemType.TOOL_ITEM
|
||||
return Item.ItemType.TOOL_ITEM
|
||||
|
||||
func get_energy_used() -> int:
|
||||
return 1
|
||||
return 1
|
||||
|
||||
func get_usage_zone_radius() -> int:
|
||||
return 50
|
||||
return 10
|
||||
|
||||
func get_usage_object_affected(i : InspectableEntity) -> bool:
|
||||
return i is Plant
|
||||
return i is Plant
|
||||
|
||||
func use_text() -> String:
|
||||
return tr("HARVEST")
|
||||
return tr("HARVEST")
|
||||
|
||||
func can_use(_player : Player, zone : Player.ActionZone) -> bool:
|
||||
var areas = zone.get_affected_areas()
|
||||
for area in areas :
|
||||
if area is Plant:
|
||||
return true
|
||||
return false
|
||||
var areas = zone.get_affected_areas()
|
||||
for area in areas :
|
||||
if area is Plant:
|
||||
return true
|
||||
return false
|
||||
|
||||
func use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
for area in zone.get_affected_areas():
|
||||
if area and area is Plant:
|
||||
harvest(area, player)
|
||||
await player.get_tree().create_timer(USE_INTERVAL).timeout
|
||||
|
||||
return true
|
||||
var has_plant = false
|
||||
for area in zone.get_affected_areas():
|
||||
if area and area is Plant:
|
||||
harvest(area, player)
|
||||
await player.get_tree().create_timer(USE_INTERVAL).timeout
|
||||
has_plant = true
|
||||
return has_plant
|
||||
|
||||
func harvest(p : Plant, _player: Player):
|
||||
AudioManager.play_sfx("Harvest")
|
||||
p.harvest()
|
||||
AudioManager.play_sfx("Harvest")
|
||||
p.harvest()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
extends Item
|
||||
class_name Pickaxe
|
||||
|
||||
const USE_INTERVAL = 0.15
|
||||
const DIG_PARTICLES := preload("res://entities/player/inventory/scripts/items/utils/dig_particles.tscn")
|
||||
|
||||
func get_item_name() -> String:
|
||||
return tr("PICKAXE")
|
||||
@@ -29,13 +29,17 @@ func can_use(_player : Player, zone : Player.ActionZone) -> bool:
|
||||
return true
|
||||
return false
|
||||
|
||||
func use(_player : Player, zone : Player.ActionZone) -> bool:
|
||||
func use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
|
||||
var bodies = zone.area.get_overlapping_bodies()
|
||||
var rock_layer_id = bodies.find_custom(func (b) : return b is RockLayer)
|
||||
if rock_layer_id != -1:
|
||||
var rock_layer : RockLayer = bodies[rock_layer_id]
|
||||
var rock_layers = bodies.filter(func (b) : return b is RockLayer)
|
||||
if len(rock_layers):
|
||||
player.region.dig_rocks(zone.get_tiles())
|
||||
|
||||
return rock_layer.dig_rocks(zone.get_tiles())
|
||||
var particles := (DIG_PARTICLES.instantiate() as DigParticleEmmitter)
|
||||
player.region.add_child(particles)
|
||||
particles.global_position = zone.get_global_position()
|
||||
particles.emit()
|
||||
AudioManager.play_sfx("Mining")
|
||||
|
||||
return false
|
||||
return true
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@tool
|
||||
extends Fork
|
||||
class_name Shovel
|
||||
|
||||
|
||||
Reference in New Issue
Block a user