summaryrefslogtreecommitdiff
path: root/scripts/Entities/Actions
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-09-18 12:06:59 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-09-18 12:06:59 -0300
commit5146895cf537dd69867da612abed5b4abaf805cd (patch)
tree70212352a07922b58db99ba2564f76ca072af200 /scripts/Entities/Actions
parenteacdd15612c70ff86f3446982c46a09272249936 (diff)
ME ELIMINE AAAAAAAAAAAAAAAAAAAAAAAAAAAA
Diffstat (limited to 'scripts/Entities/Actions')
-rw-r--r--scripts/Entities/Actions/Action.cs32
-rw-r--r--scripts/Entities/Actions/DropAction.cs2
-rw-r--r--scripts/Entities/Actions/ItemAction.cs23
-rw-r--r--scripts/Entities/Actions/MeleeAction.cs2
-rw-r--r--scripts/Entities/Actions/MovementAction.cs2
-rw-r--r--scripts/Entities/Actions/PickUpAction.cs15
-rw-r--r--scripts/Entities/Actions/SpellAction.cs4
-rw-r--r--scripts/Entities/Actions/WaitAction.cs2
8 files changed, 19 insertions, 63 deletions
diff --git a/scripts/Entities/Actions/Action.cs b/scripts/Entities/Actions/Action.cs
index b2d6a4b..0bbcc24 100644
--- a/scripts/Entities/Actions/Action.cs
+++ b/scripts/Entities/Actions/Action.cs
@@ -10,47 +10,29 @@ namespace TheLegendOfGustav.Entities.Actions;
/// </summary>
public abstract partial class Action : RefCounted
{
- private Actor actor;
-
- private int cost;
+ /// <summary>
+ /// O custo da ação.
+ /// </summary>
+ protected int cost;
public Action(Actor actor)
{
Actor = actor;
// Custo base, subclasses podem sobreescrever isto se quiserem.
- Cost = 10;
+ cost = 10;
}
/// <summary>
/// O ator que realiza a ação.
/// </summary>
- public Actor Actor
- {
- get => actor;
- private set
- {
- actor = value;
- }
- }
-
- /// <summary>
- /// O custo da ação.
- /// </summary>
- protected int Cost
- {
- get => cost;
- set
- {
- cost = value;
- }
- }
+ public Actor Actor { get; private set; }
/// <summary>
/// É conveniente ter acesso ao mapa dentro de uma ação.
/// </summary>
protected MapData MapData
{
- get => actor.MapData;
+ get => Actor.MapData;
}
/// <summary>
diff --git a/scripts/Entities/Actions/DropAction.cs b/scripts/Entities/Actions/DropAction.cs
index 00ddd7e..51d4ce6 100644
--- a/scripts/Entities/Actions/DropAction.cs
+++ b/scripts/Entities/Actions/DropAction.cs
@@ -11,7 +11,7 @@ public partial class DropAction : ItemAction
public override bool Perform()
{
- Player.Inventory.Drop(Item);
+ Player.Inventory.Drop(item);
return true;
}
} \ No newline at end of file
diff --git a/scripts/Entities/Actions/ItemAction.cs b/scripts/Entities/Actions/ItemAction.cs
index 14c5d93..a2ca1a2 100644
--- a/scripts/Entities/Actions/ItemAction.cs
+++ b/scripts/Entities/Actions/ItemAction.cs
@@ -5,32 +5,15 @@ namespace TheLegendOfGustav.Entities.Actions;
public partial class ItemAction : Action
{
- private ConsumableItem item;
- private Player player;
+ protected ConsumableItem item;
public ItemAction(Player player, ConsumableItem item) : base(player)
{
- Item = item;
+ this.item = item;
Player = player;
}
- public Player Player
- {
- get => player;
- private set
- {
- player = value;
- }
- }
-
- protected ConsumableItem Item
- {
- get => item;
- set
- {
- item = value;
- }
- }
+ public Player Player { get; private set; }
public override bool Perform()
{
diff --git a/scripts/Entities/Actions/MeleeAction.cs b/scripts/Entities/Actions/MeleeAction.cs
index fcd8368..5e53ec7 100644
--- a/scripts/Entities/Actions/MeleeAction.cs
+++ b/scripts/Entities/Actions/MeleeAction.cs
@@ -49,7 +49,7 @@ public partial class MeleeAction : DirectionalAction
}
MessageLogData.Instance.AddMessage(attackDesc);
- Actor.Energy -= Cost;
+ Actor.Energy -= cost;
return true;
}
}
diff --git a/scripts/Entities/Actions/MovementAction.cs b/scripts/Entities/Actions/MovementAction.cs
index 0ac842c..f78d95d 100644
--- a/scripts/Entities/Actions/MovementAction.cs
+++ b/scripts/Entities/Actions/MovementAction.cs
@@ -23,7 +23,7 @@ public partial class MovementAction : DirectionalAction
if (GetTarget() != null) return true;
Actor.Walk(Offset);
- Actor.Energy -= Cost;
+ Actor.Energy -= cost;
return true;
}
diff --git a/scripts/Entities/Actions/PickUpAction.cs b/scripts/Entities/Actions/PickUpAction.cs
index 0dbd672..eaed01c 100644
--- a/scripts/Entities/Actions/PickUpAction.cs
+++ b/scripts/Entities/Actions/PickUpAction.cs
@@ -12,18 +12,9 @@ public partial class PickupAction : DirectionalAction
public PickupAction(Player player, Vector2I offset) : base(player, offset)
{
- Player = player;
+ this.player = player;
// Pegar itens requer um tempo menor.
- Cost = 2;
- }
-
- protected Player Player
- {
- get => player;
- private set
- {
- player = value;
- }
+ cost = 2;
}
public override bool Perform()
@@ -45,7 +36,7 @@ public partial class PickupAction : DirectionalAction
MapData.RemoveEntity(item);
player.Inventory.Add(item);
- player.Energy -= Cost;
+ player.Energy -= cost;
return true;
}
} \ No newline at end of file
diff --git a/scripts/Entities/Actions/SpellAction.cs b/scripts/Entities/Actions/SpellAction.cs
index d9e9952..28d6caa 100644
--- a/scripts/Entities/Actions/SpellAction.cs
+++ b/scripts/Entities/Actions/SpellAction.cs
@@ -16,7 +16,7 @@ public partial class SpellAction : DirectionalAction
{
this.spell = spell;
- Cost = 5;
+ cost = 5;
}
public override bool Perform()
@@ -53,7 +53,7 @@ public partial class SpellAction : DirectionalAction
effect.Apply(Actor, target);
}
- Actor.Energy -= Cost;
+ Actor.Energy -= cost;
return true;
}
}
diff --git a/scripts/Entities/Actions/WaitAction.cs b/scripts/Entities/Actions/WaitAction.cs
index 011703b..993e4f4 100644
--- a/scripts/Entities/Actions/WaitAction.cs
+++ b/scripts/Entities/Actions/WaitAction.cs
@@ -98,7 +98,7 @@ public partial class WaitAction : Action
//@@@@@@@@@@@@*====+==++=*@. @ @@* .@* @ .*#. @ @* #: -@ @@% @ -+ =*%@@= @@: @ @ +. #+ *@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@======++====+*%@@@@%%%@@@@%*+#@@@@@%#%@@#=+**=. =**+=***==*#*: :%@@@@@@@@@**=+#*==*###*=. -=**+::@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@+==+==++=====++=====++=+++++++++===+++++#% +@@@* :#%= =@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
- Actor.Energy -= Cost;
+ Actor.Energy -= cost;
return true;
}
} \ No newline at end of file