feat: add deal damage after teleport system

This commit is contained in:
Bragin Stepan
2026-02-26 00:27:42 +05:00
parent e4532ae3c2
commit 99c88c071f
7 changed files with 380 additions and 20 deletions

View File

@@ -130,15 +130,6 @@ namespace _Project.Develop.Runtime.Entities
return entity;
}
public Entity CreateMage(Vector3 position)
{
Entity entity = CreateEmpty();
_monoEntitiesFactory.Create(entity, position, PathToResources.Entity.Mage);
return entity;
}
public Entity CreateGhost(Vector3 position)
{
Entity entity = CreateEmpty();
@@ -153,8 +144,8 @@ namespace _Project.Develop.Runtime.Entities
.AddRotateDirection()
.AddMoveSpeed(new ReactiveVariable<float>(10))
.AddRotationSpeed(new ReactiveVariable<float>(800))
.AddMaxHealth(new ReactiveVariable<float>(150))
.AddCurrentHealth(new ReactiveVariable<float>(150))
.AddMaxHealth(new ReactiveVariable<float>(50))
.AddCurrentHealth(new ReactiveVariable<float>(50))
.AddBodyContactDamage(new ReactiveVariable<float>(50))
.AddTakeDamageRequest()
.AddTakeDamageEvent()
@@ -231,6 +222,10 @@ namespace _Project.Develop.Runtime.Entities
.AddFindTeleportPointRequest()
.AddEndTeleportEvent()
.AddTeleportDamage(new ReactiveVariable<float>(50))
.AddTeleportDamageRadius(new ReactiveVariable<float>(6))
.AddTeleportDamageMask(Layers.CharactersMask)
.AddTeleportEnergyCost(new ReactiveVariable<int>(20))
.AddTeleportSearchRadius(new ReactiveVariable<float>(6))
@@ -294,6 +289,7 @@ namespace _Project.Develop.Runtime.Entities
.AddSystem(new FindRandomPointForTeleportSystem())
.AddSystem(new EndTeleportSystem())
.AddSystem(new InstantTeleportSystem())
.AddSystem(new DealDamageAfterTeleportSystem(_collidersRegistryService))
.AddSystem(new BodyContactsDetectingSystem())
.AddSystem(new BodyContactsEntitiesFilterSystem(_collidersRegistryService))

View File

@@ -327,6 +327,73 @@ namespace _Project.Develop.Runtime.Entities
return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Teleport.TeleportEnergyCost() {Value = value});
}
public _Project.Develop.Runtime.Logic.Gameplay.Features.Teleport.TeleportDamage TeleportDamageC => GetComponent<_Project.Develop.Runtime.Logic.Gameplay.Features.Teleport.TeleportDamage>();
public _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable<System.Single> TeleportDamage => TeleportDamageC.Value;
public bool TryGetTeleportDamage(out _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable<System.Single> value)
{
bool result = TryGetComponent(out _Project.Develop.Runtime.Logic.Gameplay.Features.Teleport.TeleportDamage component);
if(result)
value = component.Value;
else
value = default(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable<System.Single>);
return result;
}
public _Project.Develop.Runtime.Entities.Entity AddTeleportDamage()
{
return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Teleport.TeleportDamage() { Value = new _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable<System.Single>() });
}
public _Project.Develop.Runtime.Entities.Entity AddTeleportDamage(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable<System.Single> value)
{
return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Teleport.TeleportDamage() {Value = value});
}
public _Project.Develop.Runtime.Logic.Gameplay.Features.Teleport.TeleportDamageRadius TeleportDamageRadiusC => GetComponent<_Project.Develop.Runtime.Logic.Gameplay.Features.Teleport.TeleportDamageRadius>();
public _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable<System.Single> TeleportDamageRadius => TeleportDamageRadiusC.Value;
public bool TryGetTeleportDamageRadius(out _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable<System.Single> value)
{
bool result = TryGetComponent(out _Project.Develop.Runtime.Logic.Gameplay.Features.Teleport.TeleportDamageRadius component);
if(result)
value = component.Value;
else
value = default(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable<System.Single>);
return result;
}
public _Project.Develop.Runtime.Entities.Entity AddTeleportDamageRadius()
{
return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Teleport.TeleportDamageRadius() { Value = new _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable<System.Single>() });
}
public _Project.Develop.Runtime.Entities.Entity AddTeleportDamageRadius(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable<System.Single> value)
{
return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Teleport.TeleportDamageRadius() {Value = value});
}
public _Project.Develop.Runtime.Logic.Gameplay.Features.Teleport.TeleportDamageMask TeleportDamageMaskC => GetComponent<_Project.Develop.Runtime.Logic.Gameplay.Features.Teleport.TeleportDamageMask>();
public UnityEngine.LayerMask TeleportDamageMask => TeleportDamageMaskC.Value;
public bool TryGetTeleportDamageMask(out UnityEngine.LayerMask value)
{
bool result = TryGetComponent(out _Project.Develop.Runtime.Logic.Gameplay.Features.Teleport.TeleportDamageMask component);
if(result)
value = component.Value;
else
value = default(UnityEngine.LayerMask);
return result;
}
public _Project.Develop.Runtime.Entities.Entity AddTeleportDamageMask(UnityEngine.LayerMask value)
{
return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Teleport.TeleportDamageMask() {Value = value});
}
public _Project.Develop.Runtime.Logic.Gameplay.Features.Sensors.CapsuleColliderComponent CapsuleColliderC => GetComponent<_Project.Develop.Runtime.Logic.Gameplay.Features.Sensors.CapsuleColliderComponent>();
public UnityEngine.CapsuleCollider CapsuleCollider => CapsuleColliderC.Value;