Health base
This commit is contained in:
1 parent
3ca9444333
commit
258900d1d6
58 files changed
+10240
-406458
No files matched your search
@@ -3,6 +3,7 @@ using Code.Game.Entities;
|
||||
using Code.Infrastructure.Particles;
|
||||
using Code.Infrastructure.Utils;
|
||||
using Code.OfficeGame.BattleMode.Actions.Deciders;
|
||||
using Code.OfficeGame.BattleMode.HitBoxes;
|
||||
using Code.OfficeGame.BattleMode.Timeline;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -67,6 +68,7 @@ namespace Code.OfficeGame.BattleMode.Actions.Attacks
|
||||
&& actionData.CurrentFrame <= _attackData.HitboxEndFrame)
|
||||
{
|
||||
entity.EntityHitBoxes.CheckHitsForCurrentFrame(OnEnemyHit, _attackData.AttackingBodyPart);
|
||||
entity.EntityHitBoxes.CheckHitsForCurrentFrame(OnEnemyHit, HitBoxPartType.RAnkle);
|
||||
}
|
||||
|
||||
if (actionData.CurrentFrame >= actionData.TotalFrames)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d6ae7dfc67a4afea418fe8649f58a8b
|
||||
timeCreated: 1794578779
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Code.OfficeGame.BattleMode.HitBoxes;
|
||||
using R3;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.OfficeGame.BattleMode.Health
|
||||
{
|
||||
public class EntityHealth : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private int maxHealth;
|
||||
[SerializeField] private int currentHealth;
|
||||
|
||||
public ReactiveProperty<int> _maxHealth;
|
||||
public ReactiveProperty<int> _currentHealth;
|
||||
|
||||
public ReadOnlyReactiveProperty<int> MaxHealth => _maxHealth;
|
||||
public ReadOnlyReactiveProperty<int> CurrentHealth => _currentHealth;
|
||||
|
||||
public Dictionary<HitBoxPartType, int> hitBoxPartModifier = new();
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_maxHealth = new ReactiveProperty<int>(maxHealth);
|
||||
_currentHealth = new ReactiveProperty<int>(currentHealth);
|
||||
}
|
||||
|
||||
public virtual void GetDamage(int damage, HitBoxPartType hitBoxPart)
|
||||
{
|
||||
if (damage < 0)
|
||||
{
|
||||
GetHeal(-damage);
|
||||
return;
|
||||
}
|
||||
_currentHealth.Value -= damage * hitBoxPartModifier[hitBoxPart];
|
||||
}
|
||||
|
||||
public virtual void GetHeal(int heal)
|
||||
{
|
||||
if (heal < 0) return;
|
||||
|
||||
_currentHealth.Value += heal;
|
||||
}
|
||||
}
|
||||
|
||||
/// Социальные метрики
|
||||
/// 1 субъективная оценка NPS Net Promotion Score (вероятность, что человек порекомендует игру другим людям)
|
||||
/// 2 как распространяется (каким способом) k-factor заразность игры k = i * c * 100%
|
||||
/// i - ср кол-во приглашений отправленных одним пользователем (кол-во приглашений/ колво отправителей)
|
||||
/// c - средняя конверсия из приглашения в установку (колво установок/уол-во приглашений)
|
||||
/// k = орг-установок за период N / актив уп в период N - 1
|
||||
/// Создать форму и выбрать что-то, что касается игровой отрасли и для одногруппников запустить опрос с вероятностью.
|
||||
///
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 92f98a212bd547ef8a5b83e66fb879dd
|
||||
timeCreated: 1794578840
|
||||
Reference in new issue
Block a user