game: add player stats and modifiers
This commit is contained in:
@@ -34,12 +34,13 @@ func _physics_process(delta: float) -> void:
|
||||
deal_damage()
|
||||
|
||||
|
||||
func take_damage(value: float):
|
||||
func take_damage(value: float, is_crit: bool = false):
|
||||
if god_mode:
|
||||
return
|
||||
health -= value
|
||||
var dm = preload("res://scenes/damage_numbers.tscn").instantiate()
|
||||
dm.damage_taken = value
|
||||
dm.critical_damage = is_crit
|
||||
add_child(dm)
|
||||
if health <= 0:
|
||||
die()
|
||||
|
@@ -45,23 +45,6 @@ tracks/2/keys = {
|
||||
"values": [Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_8e3ao"]
|
||||
resource_name = "jump"
|
||||
length = 0.7
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.3),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(0, -7)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_fcftc"]
|
||||
resource_name = "die"
|
||||
length = 2.0
|
||||
@@ -90,6 +73,23 @@ tracks/1/keys = {
|
||||
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_8e3ao"]
|
||||
resource_name = "jump"
|
||||
length = 0.7
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.3),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(0, -7)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_38ino"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_38ino"),
|
||||
|
Reference in New Issue
Block a user