diff options
| -rw-r--r-- | assets/definitions/actor/EntityInspector.tres | 2 | ||||
| -rw-r--r-- | assets/definitions/actor/Player.tres | 2 | ||||
| -rw-r--r-- | assets/definitions/actor/Shadow.tres | 2 | ||||
| -rw-r--r-- | assets/definitions/actor/Skeleton.tres | 2 | ||||
| -rw-r--r-- | assets/definitions/actor/morcegao.tres | 2 | ||||
| -rw-r--r-- | scenes/Inspector.tscn | 2 | ||||
| -rw-r--r-- | scripts/entities/actors/AI/BaseAI.cs (renamed from scripts/actors/AI/BaseAI.cs) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/AI/BaseAI.cs.uid (renamed from scripts/actors/AI/BaseAI.cs.uid) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/AI/HostileEnemyAI.cs (renamed from scripts/actors/AI/HostileEnemyAI.cs) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/AI/HostileEnemyAI.cs.uid (renamed from scripts/actors/AI/HostileEnemyAI.cs.uid) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/Actor.cs (renamed from scripts/actors/Actor.cs) | 15 | ||||
| -rw-r--r-- | scripts/entities/actors/Actor.cs.uid (renamed from scripts/actors/Actor.cs.uid) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/ActorDefinition.cs (renamed from scripts/actors/ActorDefinition.cs) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/ActorDefinition.cs.uid (renamed from scripts/actors/ActorDefinition.cs.uid) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/Enemy.cs (renamed from scripts/actors/Enemy.cs) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/Enemy.cs.uid (renamed from scripts/actors/Enemy.cs.uid) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/EnemyDefinition.cs (renamed from scripts/actors/EnemyDefinition.cs) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/EnemyDefinition.cs.uid (renamed from scripts/actors/EnemyDefinition.cs.uid) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/Inspector.cs (renamed from scripts/actors/Inspector.cs) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/Inspector.cs.uid (renamed from scripts/actors/Inspector.cs.uid) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/Player.cs (renamed from scripts/actors/Player.cs) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/Player.cs.uid (renamed from scripts/actors/Player.cs.uid) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/actions/Action.cs (renamed from scripts/actors/actions/Action.cs) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/actions/Action.cs.uid (renamed from scripts/actors/actions/Action.cs.uid) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/actions/BumpAction.cs (renamed from scripts/actors/actions/BumpAction.cs) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/actions/BumpAction.cs.uid (renamed from scripts/actors/actions/BumpAction.cs.uid) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/actions/DirectionalAction.cs (renamed from scripts/actors/actions/DirectionalAction.cs) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/actions/DirectionalAction.cs.uid (renamed from scripts/actors/actions/DirectionalAction.cs.uid) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/actions/MeleeAction.cs (renamed from scripts/actors/actions/MeleeAction.cs) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/actions/MeleeAction.cs.uid (renamed from scripts/actors/actions/MeleeAction.cs.uid) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/actions/MovementAction.cs (renamed from scripts/actors/actions/MovementAction.cs) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/actions/MovementAction.cs.uid (renamed from scripts/actors/actions/MovementAction.cs.uid) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/actions/WaitAction.cs (renamed from scripts/actors/actions/WaitAction.cs) | 0 | ||||
| -rw-r--r-- | scripts/entities/actors/actions/WaitAction.cs.uid (renamed from scripts/actors/actions/WaitAction.cs.uid) | 0 |
34 files changed, 21 insertions, 6 deletions
diff --git a/assets/definitions/actor/EntityInspector.tres b/assets/definitions/actor/EntityInspector.tres index 645597b..d085b79 100644 --- a/assets/definitions/actor/EntityInspector.tres +++ b/assets/definitions/actor/EntityInspector.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="ActorDefinition" load_steps=2 format=3 uid="uid://bq3mbgtvjgrg3"] -[ext_resource type="Script" uid="uid://crxw1e37xlrrt" path="res://scripts/actors/ActorDefinition.cs" id="1_na4h7"] +[ext_resource type="Script" uid="uid://crxw1e37xlrrt" path="res://scripts/entities/actors/ActorDefinition.cs" id="1_na4h7"] [resource] script = ExtResource("1_na4h7") diff --git a/assets/definitions/actor/Player.tres b/assets/definitions/actor/Player.tres index d166733..0b3ec76 100644 --- a/assets/definitions/actor/Player.tres +++ b/assets/definitions/actor/Player.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="ActorDefinition" load_steps=4 format=3 uid="uid://cn6xnpwxjudbp"] -[ext_resource type="Script" uid="uid://crxw1e37xlrrt" path="res://scripts/actors/ActorDefinition.cs" id="1_2k33r"] +[ext_resource type="Script" uid="uid://crxw1e37xlrrt" path="res://scripts/entities/actors/ActorDefinition.cs" id="1_2k33r"] [ext_resource type="Texture2D" uid="uid://w0808ug4al66" path="res://assets/sprites/actors/generic_grave.png" id="1_m72ac"] [ext_resource type="Texture2D" uid="uid://dwky8qc2y602k" path="res://assets/sprites/actors/player.png" id="2_2xyvf"] diff --git a/assets/definitions/actor/Shadow.tres b/assets/definitions/actor/Shadow.tres index c6ea9e9..a82a5f7 100644 --- a/assets/definitions/actor/Shadow.tres +++ b/assets/definitions/actor/Shadow.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="EnemyDefinition" load_steps=4 format=3 uid="uid://dqd714474t4ic"] [ext_resource type="Texture2D" uid="uid://w0808ug4al66" path="res://assets/sprites/actors/generic_grave.png" id="1_3bs08"] -[ext_resource type="Script" uid="uid://dkfdm2m2scyks" path="res://scripts/actors/EnemyDefinition.cs" id="1_4jpld"] +[ext_resource type="Script" uid="uid://dkfdm2m2scyks" path="res://scripts/entities/actors/EnemyDefinition.cs" id="1_4jpld"] [ext_resource type="Texture2D" uid="uid://br8cqtbd6xcej" path="res://assets/sprites/actors/shadow.png" id="3_kvxyn"] [resource] diff --git a/assets/definitions/actor/Skeleton.tres b/assets/definitions/actor/Skeleton.tres index 757af43..1ec7c6d 100644 --- a/assets/definitions/actor/Skeleton.tres +++ b/assets/definitions/actor/Skeleton.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="EnemyDefinition" load_steps=4 format=3 uid="uid://gt6xqa737dyt"] [ext_resource type="Texture2D" uid="uid://w0808ug4al66" path="res://assets/sprites/actors/generic_grave.png" id="1_7fof3"] -[ext_resource type="Script" uid="uid://dkfdm2m2scyks" path="res://scripts/actors/EnemyDefinition.cs" id="1_m5x88"] +[ext_resource type="Script" uid="uid://dkfdm2m2scyks" path="res://scripts/entities/actors/EnemyDefinition.cs" id="1_m5x88"] [ext_resource type="Texture2D" uid="uid://dh5sgjdwkps88" path="res://assets/sprites/actors/skeleton.png" id="2_hhidw"] [resource] diff --git a/assets/definitions/actor/morcegao.tres b/assets/definitions/actor/morcegao.tres index 2eeab4f..8d0cf80 100644 --- a/assets/definitions/actor/morcegao.tres +++ b/assets/definitions/actor/morcegao.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="EnemyDefinition" load_steps=4 format=3 uid="uid://cj0kq4sfft8gh"] [ext_resource type="Texture2D" uid="uid://w0808ug4al66" path="res://assets/sprites/actors/generic_grave.png" id="1_hdleo"] -[ext_resource type="Script" uid="uid://dkfdm2m2scyks" path="res://scripts/actors/EnemyDefinition.cs" id="1_m2lyk"] +[ext_resource type="Script" uid="uid://dkfdm2m2scyks" path="res://scripts/entities/actors/EnemyDefinition.cs" id="1_m2lyk"] [ext_resource type="Texture2D" uid="uid://cddn56s7w2lc2" path="res://assets/sprites/actors/morcegao.png" id="3_601km"] [resource] diff --git a/scenes/Inspector.tscn b/scenes/Inspector.tscn index 886b41c..ad2a062 100644 --- a/scenes/Inspector.tscn +++ b/scenes/Inspector.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://dyythuxaio6j4"] [ext_resource type="Texture2D" uid="uid://cjjxf4rbj8gku" path="res://assets/sprites/inspector.png" id="1_psyxb"] -[ext_resource type="Script" uid="uid://dxsrtu4b3pi08" path="res://scripts/actors/Inspector.cs" id="2_g62u7"] +[ext_resource type="Script" uid="uid://dxsrtu4b3pi08" path="res://scripts/entities/actors/Inspector.cs" id="2_g62u7"] [node name="Sprite2D" type="Sprite2D"] texture = ExtResource("1_psyxb") diff --git a/scripts/actors/AI/BaseAI.cs b/scripts/entities/actors/AI/BaseAI.cs index 733a61a..733a61a 100644 --- a/scripts/actors/AI/BaseAI.cs +++ b/scripts/entities/actors/AI/BaseAI.cs diff --git a/scripts/actors/AI/BaseAI.cs.uid b/scripts/entities/actors/AI/BaseAI.cs.uid index b23724c..b23724c 100644 --- a/scripts/actors/AI/BaseAI.cs.uid +++ b/scripts/entities/actors/AI/BaseAI.cs.uid diff --git a/scripts/actors/AI/HostileEnemyAI.cs b/scripts/entities/actors/AI/HostileEnemyAI.cs index 35d6d1a..35d6d1a 100644 --- a/scripts/actors/AI/HostileEnemyAI.cs +++ b/scripts/entities/actors/AI/HostileEnemyAI.cs diff --git a/scripts/actors/AI/HostileEnemyAI.cs.uid b/scripts/entities/actors/AI/HostileEnemyAI.cs.uid index 0fa2c32..0fa2c32 100644 --- a/scripts/actors/AI/HostileEnemyAI.cs.uid +++ b/scripts/entities/actors/AI/HostileEnemyAI.cs.uid diff --git a/scripts/actors/Actor.cs b/scripts/entities/actors/Actor.cs index 80e8c1d..c77122a 100644 --- a/scripts/actors/Actor.cs +++ b/scripts/entities/actors/Actor.cs @@ -179,6 +179,21 @@ public partial class Actor : Sprite2D } /// <summary> + /// Recupera uma quantidade de HP do ator. + /// </summary> + /// <param name="amount">HP para recuperar</param> + /// <returns>Quanto HP foi realmente recuperado.</returns> + public int Heal(int amount) { + int neoHp = Hp + amount; + + if (amount > MaxHp) neoHp = MaxHp; + + int recovered = neoHp - Hp; + Hp = neoHp; + return recovered; + } + + /// <summary> /// Aplica uma definição de NPC para o ator. /// Se o ator for um boneco de barro, este método é como um /// sopro de vida. diff --git a/scripts/actors/Actor.cs.uid b/scripts/entities/actors/Actor.cs.uid index cf29b40..cf29b40 100644 --- a/scripts/actors/Actor.cs.uid +++ b/scripts/entities/actors/Actor.cs.uid diff --git a/scripts/actors/ActorDefinition.cs b/scripts/entities/actors/ActorDefinition.cs index ab0160b..ab0160b 100644 --- a/scripts/actors/ActorDefinition.cs +++ b/scripts/entities/actors/ActorDefinition.cs diff --git a/scripts/actors/ActorDefinition.cs.uid b/scripts/entities/actors/ActorDefinition.cs.uid index ddcfe02..ddcfe02 100644 --- a/scripts/actors/ActorDefinition.cs.uid +++ b/scripts/entities/actors/ActorDefinition.cs.uid diff --git a/scripts/actors/Enemy.cs b/scripts/entities/actors/Enemy.cs index 19bcd2c..19bcd2c 100644 --- a/scripts/actors/Enemy.cs +++ b/scripts/entities/actors/Enemy.cs diff --git a/scripts/actors/Enemy.cs.uid b/scripts/entities/actors/Enemy.cs.uid index 93255b7..93255b7 100644 --- a/scripts/actors/Enemy.cs.uid +++ b/scripts/entities/actors/Enemy.cs.uid diff --git a/scripts/actors/EnemyDefinition.cs b/scripts/entities/actors/EnemyDefinition.cs index e372e3a..e372e3a 100644 --- a/scripts/actors/EnemyDefinition.cs +++ b/scripts/entities/actors/EnemyDefinition.cs diff --git a/scripts/actors/EnemyDefinition.cs.uid b/scripts/entities/actors/EnemyDefinition.cs.uid index 1ba03e1..1ba03e1 100644 --- a/scripts/actors/EnemyDefinition.cs.uid +++ b/scripts/entities/actors/EnemyDefinition.cs.uid diff --git a/scripts/actors/Inspector.cs b/scripts/entities/actors/Inspector.cs index e340543..e340543 100644 --- a/scripts/actors/Inspector.cs +++ b/scripts/entities/actors/Inspector.cs diff --git a/scripts/actors/Inspector.cs.uid b/scripts/entities/actors/Inspector.cs.uid index ca411e4..ca411e4 100644 --- a/scripts/actors/Inspector.cs.uid +++ b/scripts/entities/actors/Inspector.cs.uid diff --git a/scripts/actors/Player.cs b/scripts/entities/actors/Player.cs index 324e67a..324e67a 100644 --- a/scripts/actors/Player.cs +++ b/scripts/entities/actors/Player.cs diff --git a/scripts/actors/Player.cs.uid b/scripts/entities/actors/Player.cs.uid index 8229b7f..8229b7f 100644 --- a/scripts/actors/Player.cs.uid +++ b/scripts/entities/actors/Player.cs.uid diff --git a/scripts/actors/actions/Action.cs b/scripts/entities/actors/actions/Action.cs index f20e262..f20e262 100644 --- a/scripts/actors/actions/Action.cs +++ b/scripts/entities/actors/actions/Action.cs diff --git a/scripts/actors/actions/Action.cs.uid b/scripts/entities/actors/actions/Action.cs.uid index 9523b0a..9523b0a 100644 --- a/scripts/actors/actions/Action.cs.uid +++ b/scripts/entities/actors/actions/Action.cs.uid diff --git a/scripts/actors/actions/BumpAction.cs b/scripts/entities/actors/actions/BumpAction.cs index 805520c..805520c 100644 --- a/scripts/actors/actions/BumpAction.cs +++ b/scripts/entities/actors/actions/BumpAction.cs diff --git a/scripts/actors/actions/BumpAction.cs.uid b/scripts/entities/actors/actions/BumpAction.cs.uid index f5ce3f8..f5ce3f8 100644 --- a/scripts/actors/actions/BumpAction.cs.uid +++ b/scripts/entities/actors/actions/BumpAction.cs.uid diff --git a/scripts/actors/actions/DirectionalAction.cs b/scripts/entities/actors/actions/DirectionalAction.cs index ca2ca95..ca2ca95 100644 --- a/scripts/actors/actions/DirectionalAction.cs +++ b/scripts/entities/actors/actions/DirectionalAction.cs diff --git a/scripts/actors/actions/DirectionalAction.cs.uid b/scripts/entities/actors/actions/DirectionalAction.cs.uid index 901756a..901756a 100644 --- a/scripts/actors/actions/DirectionalAction.cs.uid +++ b/scripts/entities/actors/actions/DirectionalAction.cs.uid diff --git a/scripts/actors/actions/MeleeAction.cs b/scripts/entities/actors/actions/MeleeAction.cs index b20430a..b20430a 100644 --- a/scripts/actors/actions/MeleeAction.cs +++ b/scripts/entities/actors/actions/MeleeAction.cs diff --git a/scripts/actors/actions/MeleeAction.cs.uid b/scripts/entities/actors/actions/MeleeAction.cs.uid index bc97619..bc97619 100644 --- a/scripts/actors/actions/MeleeAction.cs.uid +++ b/scripts/entities/actors/actions/MeleeAction.cs.uid diff --git a/scripts/actors/actions/MovementAction.cs b/scripts/entities/actors/actions/MovementAction.cs index 3608357..3608357 100644 --- a/scripts/actors/actions/MovementAction.cs +++ b/scripts/entities/actors/actions/MovementAction.cs diff --git a/scripts/actors/actions/MovementAction.cs.uid b/scripts/entities/actors/actions/MovementAction.cs.uid index 07569ef..07569ef 100644 --- a/scripts/actors/actions/MovementAction.cs.uid +++ b/scripts/entities/actors/actions/MovementAction.cs.uid diff --git a/scripts/actors/actions/WaitAction.cs b/scripts/entities/actors/actions/WaitAction.cs index 2d3ccc2..2d3ccc2 100644 --- a/scripts/actors/actions/WaitAction.cs +++ b/scripts/entities/actors/actions/WaitAction.cs diff --git a/scripts/actors/actions/WaitAction.cs.uid b/scripts/entities/actors/actions/WaitAction.cs.uid index 120c8c1..120c8c1 100644 --- a/scripts/actors/actions/WaitAction.cs.uid +++ b/scripts/entities/actors/actions/WaitAction.cs.uid |
