removed obsolete interfaces for health and damage
This commit is contained in:
@@ -3,20 +3,15 @@
|
||||
[ext_resource type="Script" uid="uid://bbbrf5ckydfna" path="res://scenes/player_controller/scripts/PlayerController.cs" id="1_poq2x"]
|
||||
[ext_resource type="PackedScene" uid="uid://cf3rrgr1imvv4" path="res://scenes/path/path.tscn" id="2_6lejt"]
|
||||
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="2_u8yay"]
|
||||
[ext_resource type="Script" uid="uid://jitubgv6judn" path="res://scenes/components/damage/RDamage.cs" id="2_x835q"]
|
||||
[ext_resource type="Script" uid="uid://b44cse62qru7j" path="res://scenes/components/knockback/RKnockback.cs" id="3_cb2lu"]
|
||||
[ext_resource type="Resource" uid="uid://bl5crtu1gkrtr" path="res://inputs/base_mode/base_mode.tres" id="3_cresl"]
|
||||
[ext_resource type="PackedScene" uid="uid://c4ikbhojckpnc" path="res://scenes/components/health/CHealth.tscn" id="3_q7bng"]
|
||||
[ext_resource type="Resource" uid="uid://bjyd801wvverk" path="res://scenes/player_controller/resources/player_health.tres" id="4_m8gvy"]
|
||||
[ext_resource type="Resource" uid="uid://cpdaw41ah5gic" path="res://inputs/base_mode/rotate_y.tres" id="4_rxwoh"]
|
||||
[ext_resource type="Resource" uid="uid://dgjsi1my7nlnk" path="res://forge/resources/ability_datas/player_hit.tres" id="4_u8yay"]
|
||||
[ext_resource type="Resource" uid="uid://dh437cuxgjv6b" path="res://forge/resources/effect_datas/mana_regeneration.tres" id="5_2rkt1"]
|
||||
[ext_resource type="Resource" uid="uid://ccrb5xsnphc8" path="res://inputs/base_mode/rotate_floorplane.tres" id="5_4u7i3"]
|
||||
[ext_resource type="PackedScene" uid="uid://hpsg4fqwrx1u" path="res://scenes/components/damage/CDamageable.tscn" id="5_jb43f"]
|
||||
[ext_resource type="Resource" uid="uid://f3vs6l4m623s" path="res://inputs/base_mode/move_left.tres" id="5_q14ux"]
|
||||
[ext_resource type="Resource" uid="uid://b0ikxp5j8fn3n" path="res://forge/resources/ability_datas/on_hit_invinciblity.tres" id="5_u8yay"]
|
||||
[ext_resource type="PackedScene" uid="uid://duju3atqgltkg" path="res://scenes/explosion/explosion.tscn" id="5_ue7xq"]
|
||||
[ext_resource type="Resource" uid="uid://dyru7mxo121w6" path="res://scenes/player_controller/resources/player_normal_damage_mod.tres" id="6_cmijs"]
|
||||
[ext_resource type="Resource" uid="uid://t612lts1wi1s" path="res://inputs/base_mode/move_right.tres" id="6_q7bng"]
|
||||
[ext_resource type="Resource" uid="uid://cffil4tic3ysg" path="res://forge/resources/effect_datas/inhibit_mana_regen_temporarily.tres" id="6_u8yay"]
|
||||
[ext_resource type="Script" uid="uid://cwbvxlfvmocc1" path="res://scenes/player_controller/scripts/StairsSystem.cs" id="7_bmt5a"]
|
||||
@@ -75,11 +70,6 @@ script = ExtResource("11_u8yay")
|
||||
Tag = "immunity.damage"
|
||||
metadata/_custom_type_script = "uid://dpakv7agvir6y"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_cb2lu"]
|
||||
script = ExtResource("2_x835q")
|
||||
DamageDealt = 10.0
|
||||
metadata/_custom_type_script = "uid://jitubgv6judn"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_abfq8"]
|
||||
script = ExtResource("3_cb2lu")
|
||||
Modifier = 5.0
|
||||
@@ -165,7 +155,6 @@ EmpoweredActionEffects = [ExtResource("6_u8yay")]
|
||||
AimAssistStrength = 0.3
|
||||
AimAssistReductionWhenCloseToTarget = 0.1
|
||||
AimAssistReductionStartDistance = 8.0
|
||||
RDamage = SubResource("Resource_cb2lu")
|
||||
RKnockback = SubResource("Resource_abfq8")
|
||||
TargetingDistance = 5.0
|
||||
Explosion = ExtResource("5_ue7xq")
|
||||
@@ -242,12 +231,6 @@ InitialAttributeValues = Dictionary[String, ExtResource("11_2rkt1")]({
|
||||
})
|
||||
metadata/_custom_type_script = "uid://cxihb42t2mfqi"
|
||||
|
||||
[node name="CHealth" parent="." unique_id=1244478698 instance=ExtResource("3_q7bng")]
|
||||
RHealth = ExtResource("4_m8gvy")
|
||||
|
||||
[node name="CDamageable" parent="." unique_id=1375668972 instance=ExtResource("5_jb43f")]
|
||||
DamageModifiers = Array[Object]([ExtResource("6_cmijs")])
|
||||
|
||||
[node name="CKnockback" parent="." unique_id=80423377 instance=ExtResource("7_x835q")]
|
||||
RKnockback = ExtResource("8_m8gvy")
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Movementtests.systems;
|
||||
|
||||
|
||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_sword.png"), Meta(typeof(IAutoNode))]
|
||||
public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
||||
public partial class WeaponSystem : RigidBody3D, IForgeEntity
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
@@ -66,9 +66,9 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
||||
|
||||
#region Forge
|
||||
|
||||
private Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponStartedFlyingAbilities = new ();
|
||||
private Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponStoppedFlyingAbilities = new ();
|
||||
private Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponFlyingTickAbilities = new ();
|
||||
private readonly Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponStartedFlyingAbilities = new();
|
||||
private readonly Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponStoppedFlyingAbilities = new();
|
||||
private readonly Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponFlyingTickAbilities = new();
|
||||
|
||||
public Tag WeaponFlyingTickEventTag;
|
||||
public Tag WeaponStartedFlyingEventTag;
|
||||
@@ -92,8 +92,6 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
||||
#region Inspector
|
||||
[Export] public ForgeAbilityData? FlyingTickAbility { get; set; }
|
||||
|
||||
[Export]
|
||||
public RDamage RDamage { get; set; }
|
||||
[Export(PropertyHint.Range, "0,2,0.01,or_greater")]
|
||||
public float ThrowForce { get; set; } = 1f;
|
||||
[Export(PropertyHint.Range, "0,0.2,0.01,or_greater")]
|
||||
@@ -140,9 +138,9 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
||||
|
||||
#region Publics
|
||||
|
||||
public StateChartState InHandState = null!;
|
||||
public StateChartState FlyingState = null!;
|
||||
public StateChartState PlantedState = null!;
|
||||
public StateChartState InHandState = null!;
|
||||
public StateChartState FlyingState = null!;
|
||||
public StateChartState PlantedState = null!;
|
||||
|
||||
public Vector3 PlantLocation { get; set; }
|
||||
public Vector3 PlantNormal { get; set; }
|
||||
@@ -420,10 +418,10 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
||||
if (enemy is IForgeEntity victim) _plantedEntity = victim;
|
||||
else _plantedEntity = null;
|
||||
|
||||
if (enemy is IDamageable damageable)
|
||||
{
|
||||
damageable.TakeDamage(new DamageRecord(GlobalPosition, RDamage));
|
||||
}
|
||||
// if (enemy is IDamageable damageable)
|
||||
// {
|
||||
// damageable.TakeDamage(new DamageRecord(GlobalPosition, RDamage));
|
||||
// }
|
||||
}
|
||||
|
||||
public void RethrowWeapon()
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
[ext_resource type="Script" uid="uid://iii3wfto4t5b" path="res://scenes/player_controller/components/weapon/WeaponSystem.cs" id="1_csqwk"]
|
||||
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="2_l1xlx"]
|
||||
[ext_resource type="Script" uid="uid://jitubgv6judn" path="res://scenes/components/damage/RDamage.cs" id="2_m0v1h"]
|
||||
[ext_resource type="Script" uid="uid://cxihb42t2mfqi" path="res://addons/forge/nodes/ForgeAttributeSet.cs" id="3_3xjpi"]
|
||||
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="3_5owyf"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://cho5fixitrbds" path="res://assets/meshes/swords/resources/sword23.tres" id="3_svc06"]
|
||||
@@ -13,16 +12,6 @@
|
||||
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="5_m0v1h"]
|
||||
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="6_jpdh0"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_06gln"]
|
||||
script = ExtResource("2_l1xlx")
|
||||
ContainerTags = Array[String](["weapon"])
|
||||
metadata/_custom_type_script = "uid://cw525n4mjqgw0"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_jpdh0"]
|
||||
script = ExtResource("2_m0v1h")
|
||||
DamageDealt = 2.0
|
||||
metadata/_custom_type_script = "uid://jitubgv6judn"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_7bruw"]
|
||||
script = ExtResource("2_l1xlx")
|
||||
ContainerTags = Array[String](["weapon"])
|
||||
@@ -69,9 +58,7 @@ continuous_cd = true
|
||||
contact_monitor = true
|
||||
max_contacts_reported = 1
|
||||
script = ExtResource("1_csqwk")
|
||||
BaseTags = SubResource("Resource_06gln")
|
||||
FlyingTickAbility = ExtResource("4_7bruw")
|
||||
RDamage = SubResource("Resource_jpdh0")
|
||||
|
||||
[node name="ForgeEntityNode" type="Node3D" parent="." unique_id=1798885192]
|
||||
script = ExtResource("5_7bruw")
|
||||
|
||||
@@ -76,10 +76,6 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
||||
[Signal]
|
||||
public delegate void PlayerDiedEventHandler();
|
||||
|
||||
public event Action<IDamageable, DamageRecord> DamageTaken = null!;
|
||||
public event Action<IHealthable, HealthChangedRecord> HealthChanged = null!;
|
||||
public event Action<IHealthable> HealthDepleted = null!;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Nodes
|
||||
@@ -150,7 +146,7 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
||||
[Export(PropertyHint.Range, "0,10f,0.1,or_greater")]
|
||||
public float AimAssistReductionStartDistance { get; set; } = 10f;
|
||||
|
||||
[ExportGroup("Damage")] [Export] public RDamage RDamage { get; set; } = null!;
|
||||
[ExportGroup("Damage")]
|
||||
[Export] public RKnockback? RKnockback { get; set; }
|
||||
|
||||
[ExportGroup("Targeting")]
|
||||
@@ -498,18 +494,6 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
||||
WeaponHitbox.Monitoring = false;
|
||||
WeaponHitbox.BodyEntered += RegisterHitEnnemy;
|
||||
|
||||
// if (RHealth != null)
|
||||
// {
|
||||
// CHealth.RHealth = RHealth;
|
||||
// CHealth.CurrentHealth = RHealth.StartingHealth;
|
||||
// }
|
||||
// if (RKnockback != null) CKnockback!.RKnockback = RKnockback;
|
||||
//
|
||||
// CDamageable.DamageTaken += (damageable, record) => ReduceHealth(damageable, record);
|
||||
// CDamageable.DamageTaken += (_, record) => RegisterKnockback(new KnockbackRecord(record));
|
||||
// CHealth.HealthChanged += PlayerUi.OnHealthChanged;
|
||||
// CHealth.HealthDepleted += (_) => Kill();
|
||||
|
||||
#region StateManagement
|
||||
|
||||
_playerState = StateChart.Of(GetNode("StateChart"));
|
||||
@@ -857,13 +841,9 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
||||
|
||||
public void SetPlayerHealthOverride(float newHealthValue)
|
||||
{
|
||||
// RHealth.StartingHealth = newHealthValue;
|
||||
// CHealth!.CurrentHealth = newHealthValue;
|
||||
// PlayerUi.Initialize(CHealth.CurrentHealth, Attributes["PlayerAttributeSet.Mana"].BaseValue);
|
||||
}
|
||||
public void SetPlayerDamageOverride(float newDamageValue)
|
||||
{
|
||||
RDamage.DamageDealt = newDamageValue;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -1734,7 +1714,7 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
||||
|
||||
var transform = _customMantle ? _customMantleStartTransform : MantleSystem.GlobalTransform;
|
||||
var curve = _customMantle ? _customMantleCurve : MantleSystem.MantleCurve;
|
||||
GetTree().GetRoot().AddChild(_mantlePath);
|
||||
GetTree().GetCurrentScene().AddChild(_mantlePath);
|
||||
_mantlePath.Setup(transform, curve);
|
||||
_mantleStartPosition = GlobalPosition;
|
||||
|
||||
@@ -2017,7 +1997,7 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
||||
|
||||
// Basic distance traveled explosion manipulation
|
||||
explosion.Radius = distanceTraveled;
|
||||
explosion.RDamage.DamageDealt = distanceTraveled;
|
||||
explosion.Damage = distanceTraveled;
|
||||
|
||||
GetTree().GetCurrentScene().AddChild(explosion);
|
||||
explosion.GlobalPosition = GlobalPosition;
|
||||
@@ -2436,28 +2416,6 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
||||
// enemyTargetState = wouldKill ? PlayerUi.TargetState.TargetWouldKill : PlayerUi.TargetState.TargetWouldNotKill;
|
||||
PlayerUi.SetEnemyTargetProperties(new PlayerUi.TargetProperties(PlayerUi.TargetState.TargetWouldNotKill, positionOnScreen));
|
||||
}
|
||||
|
||||
public DamageRecord TakeDamage(DamageRecord damageRecord)
|
||||
{
|
||||
if (IsInvincible)
|
||||
return damageRecord with { Damage = new RDamage(0, damageRecord.Damage.DamageType) };
|
||||
|
||||
// var finalDamage = CDamageable!.TakeDamage(damageRecord);
|
||||
// DamageTaken?.Invoke(this, finalDamage);
|
||||
|
||||
HeadSystem.OnGetHit();
|
||||
_audioStream.SwitchToClipByName("damage_taken");
|
||||
TriggerHitstop();
|
||||
OnHitInvincibility();
|
||||
|
||||
return damageRecord;
|
||||
}
|
||||
|
||||
public DamageRecord ComputeDamage(DamageRecord damageRecord)
|
||||
{
|
||||
// return CDamageable!.ComputeDamage(damageRecord);
|
||||
return damageRecord;
|
||||
}
|
||||
|
||||
public void OnHitInvincibility()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user