Skip to content

Commit db8c459

Browse files
Update 0.6.2
Small bug fixes: - Armor can no longer heal the player when a strong damage is dealt. - The structure damage percent is now calculated correctly. - There is no longer a 1% chance for entity loot to not be dropped. Fixed some typos in the code
1 parent 1e25f5f commit db8c459

8 files changed

Lines changed: 16 additions & 16 deletions

File tree

Scripts/Classes/Entities/Enemy.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ extends Entity
33

44
## The base class for the Enemies
55

6-
## The damage the enemy dials on contact with the player
6+
## The damage the enemy deals on contact with the player
77
@export var contact_damage : int
88
## The distance the enemy starts targeting the player from
99
@export var activate_distance : float = 1000

Scripts/Classes/Entities/PassiveEntity.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func _ready() -> void:
2121

2222

2323
func _physics_process(_delta) -> void:
24-
if neads_to_retarget():
24+
if needs_to_retarget():
2525
retarget()
2626
else:
2727
velocity = global_position.direction_to(target) * speed
@@ -33,7 +33,7 @@ func _physics_process(_delta) -> void:
3333

3434

3535
## Checks whether or not the entity needs to retarget
36-
func neads_to_retarget() -> bool:
36+
func needs_to_retarget() -> bool:
3737
if global_position.distance_to(target) <= min_distance_before_retarget:
3838
return true
3939

Scripts/Classes/Entity.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const DROPPED_ITEM_SCENE = preload("res://Scenes/Objects/dropped_item.tscn")
2222

2323
func _process(_delta: float) -> void:
2424
var player : Player = Global.get_player()
25-
if player.global_position.distance_to(global_position) > despawn_distance:
25+
if player.global_position.distance_to(global_position) > despawn_distance and can_despawn:
2626
queue_free()
2727

2828

@@ -40,7 +40,7 @@ func damage(dmg : int) -> void:
4040
func kill() -> void:
4141
for loot in loot_table:
4242
var rand = randi_range(1, 100)
43-
if rand < loot.chance:
43+
if rand <= loot.chance:
4444
var dropped_item = DROPPED_ITEM_SCENE.instantiate()
4545
dropped_item.global_position = global_position
4646
dropped_item.item = loot.item.duplicate()

Scripts/Classes/Structure.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func damage(dmg : int) -> void:
2020
# Textures
2121
if broken_textures.is_empty() == false and hp > 0:
2222
@warning_ignore("integer_division")
23-
var damage_percent = float(max_hp - hp) / hp
23+
var damage_percent = float(max_hp - hp) / max_hp
2424
var texture_index = int(damage_percent * (broken_textures.size() - 1))
2525
$Sprite2D.texture = broken_textures[min(broken_textures.size() - 1, texture_index)]
2626

@@ -32,7 +32,7 @@ func damage(dmg : int) -> void:
3232
destroy()
3333

3434

35-
## Destroies the structure
35+
## Destroys the structure
3636
func destroy() -> void:
3737
for loot in drops:
3838
var rand = randi_range(1, 100)

Scripts/Other/entity_spawning.gd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
extends Node
22

3-
## The script responcible for the spawning of entities
3+
## The script responsible for the spawning of entities
44

55
const SPAWN_CHECK_SCENE = preload("res://Scenes/Systems/spawn_check.tscn")
66

@@ -10,7 +10,7 @@ const PASSIVE_ENTITY_CAP = 20
1010
const ENEMY_CAP = 20
1111

1212
## The passive entities to spawn
13-
@export var passiveEntityes : Array[SpawnChance]
13+
@export var passiveEntities : Array[SpawnChance]
1414
## The enemies to spawn
1515
@export var enemies : Array[SpawnChance]
1616
## The minimum amount of distance the entity needs to be from the player in order the spawn
@@ -44,7 +44,7 @@ func spawn() -> void:
4444
if day_night_cycle.is_night and get_tree().get_nodes_in_group("Enemies").size() < ENEMY_CAP:
4545
entities = enemies
4646
elif day_night_cycle.is_night == false and get_tree().get_nodes_in_group("PassiveEntities").size() < PASSIVE_ENTITY_CAP:
47-
entities = passiveEntityes
47+
entities = passiveEntities
4848

4949
for entity_spawn in entities:
5050
if entity_spawn != null:

Scripts/Other/hunger_and_thirst.gd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extends Node
1010
## The amount of hunger the player gains each second
1111
@export var hunger_per_second : float = 0.05
1212
## The amount the hunger_per_second variable is multiplied by when the player is running
13-
@export var hunger_per_second_running_multipliar : float = 2
13+
@export var hunger_per_second_running_multiplier : float = 2
1414
## The amount of damage the player gains each second when the hunger is at its max amount
1515
@export var hunger_damage_per_second : int = 1
1616
## The minimum amount of hunger that prevents the player's health from regenerating
@@ -24,7 +24,7 @@ extends Node
2424
## The amount of hunger the player gains each second
2525
@export var thirst_per_second : float = 0.1
2626
## The amount thirst_per_second variable is multiplied by when the player is running
27-
@export var thirst_per_second_running_multipliar : float = 1.5
27+
@export var thirst_per_second_running_multiplier : float = 1.5
2828
## The amount of damage the player gains each second when the thirst is at its max amount
2929
@export var thirst_damage_per_second : int = 1
3030
## The minimum amount of thirst that prevents the player's health from regenerating
@@ -41,8 +41,8 @@ func _ready() -> void:
4141

4242
func _process(delta: float) -> void:
4343
if player.is_running and player.velocity != Vector2.ZERO:
44-
add_thirst(delta * thirst_per_second * thirst_per_second_running_multipliar)
45-
add_hunger(delta * hunger_per_second * hunger_per_second_running_multipliar)
44+
add_thirst(delta * thirst_per_second * thirst_per_second_running_multiplier)
45+
add_hunger(delta * hunger_per_second * hunger_per_second_running_multiplier)
4646
add_thirst(delta * thirst_per_second)
4747
add_hunger(delta * hunger_per_second)
4848

Scripts/Other/player.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func _input(event: InputEvent) -> void:
137137
func damage(dmg : int, is_hunger_or_thirst = false) -> void:
138138
if inventory.armor != null and !is_hunger_or_thirst:
139139
if inventory.armor.durability > 0:
140-
hp -= dmg - inventory.armor.defence
140+
hp -= max(0, dmg - inventory.armor.defence)
141141
inventory.armor.take_durability()
142142
inventory.visualize_inventory()
143143
else:

project.godot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ config_version=5
1111
[application]
1212

1313
config/name="Stranded Shores"
14-
config/version="0.6.1"
14+
config/version="0.6.2"
1515
run/main_scene="uid://c17te1o2qtwsm"
1616
config/features=PackedStringArray("4.6", "Forward Plus")
1717
boot_splash/show_image=false

0 commit comments

Comments
 (0)