Health base
This commit is contained in:
1 parent
3ca9444333
commit
258900d1d6
58 files changed
+10240
-406458
No files matched your search
@@ -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
|
||||
/// Создать форму и выбрать что-то, что касается игровой отрасли и для одногруппников запустить опрос с вероятностью.
|
||||
///
|
||||
}
|
||||
Reference in new issue
Block a user