/// <summary> /// ReceiveDamage. Gets damage and senderEntityCombat from EntityCombat script and works with it further. /// </summary> /// <param name="damage">amount of damage</param> /// <param name="senderEntityCombat">EntityCombat of an entity who sent the damage</param> public void ReceiveDamage(int damage, EntityCombat senderEntityCombat) { Debug.Log("Health before - " + _chars.Health); _chars.ChangeHealth(-damage); UpdateHealthInUI(); Debug.Log("Heatlh after - " + _chars.Health); }
/// <summary> /// SendDamageToEnemy. Gets Enemy's combatController and works with it further, sending damage from own EntityCombat /// </summary> /// <param name="combatController">Enemy's Entity Combat that gets hit</param> public void SendDamageToEnemy(EntityCombat combatController) { Debug.Log("Hit happened"); // TODO: make a delay for sending damage from player combatController.ReceiveDamage((int)WeaponDamages.STICK, _combatController); DisableActiveHitManager("SendDamageToEnemy()"); }
/// <summary> /// ReceiveHitSignal. Gets a signal from WeaponHitManager about a hit from player /// </summary> /// <param name="combatController">EntityCombat that got hit</param> public void ReceiveHitSignal(EntityCombat combatController) { if (_playersCombat) { _playerBrain.SendDamageToEnemy(combatController); } }
public override void Interact() { base.Interact(); EntityCombat playerCombat = playerInstance.player.GetComponent <EntityCombat>(); if (playerCombat != null) { playerCombat.Attack(stats); } }
/// <summary> /// ReceiveDamage. ReceivesDamage from an entity /// </summary> /// <param name="damage">amount of damage</param> /// <param name="senderEntityCombat">EntityCombat of an entity who sent the damage</param> public void ReceiveDamage(int damage, EntityCombat senderEntityCombat) { // TODO: Send damage to Brain if (_playersCombat) { _playerBrain.ReceiveDamage(damage, senderEntityCombat); } else { _enemyBrain.ReceiveDamage(damage, senderEntityCombat); } }
public virtual void EntityDestroyed(EntityCombat combat) { if (effects.ContainsKey("fury")) { delayedActionSet = 0.5f; delayedSetAction = 2; } if (effects.ContainsKey("bloodlust")) { delayedHealthMod += 30; } }
private bool _longHitReady; // tells whether LongHitStart has ended and animation should proceed private void Awake() { _chars = this.gameObject.GetComponent <EntityCharacteristics>(); _eventHandler = this.gameObject.GetComponent <EntityEventHandler>(); _movementController = this.gameObject.GetComponent <PlayerMovement>(); _animationController = this.gameObject.GetComponent <PlayerAnimation>(); _combatController = this.gameObject.GetComponent <EntityCombat>(); _UI = this.gameObject.GetComponent <PlayerUI>(); _isAllowedToMove = true; _longHitLastFrame = false; _longHitReady = false; FindAllWeaponManagers(); _activeWeaponIndex = 0; DisableActiveHitManager("Awake"); }
private void Awake() { movement = GetComponent <EnemyMovement>(); stats = GetComponent <EnemyStats>(); combat = GetComponent <EntityCombat>(); }
public EntityController(EntityMovement movement, EntityCombat combat) { _movement = movement; _combat = combat; }
/// <summary> /// SendDamage. Sends damage to an entity /// </summary> /// <param name="damage">amount of damage</param> /// <param name="otherEntityCombat">EntityCombat of an entity who is going to receive the damage</param> public void SendDamage(int damage, EntityCombat otherEntityCombat) { otherEntityCombat.ReceiveDamage(damage, this); }
/// <summary> /// ReceiveDamage. Gets damage and senderEntityCombat from EntityCombat script and works with it further. /// </summary> /// <param name="damage">amount of damage</param> /// <param name="senderEntityCombat">EntityCombat of an entity who sent the damage</param> public void ReceiveDamage(int damage, EntityCombat senderEntityCombat) { _chars.ChangeHealth(-damage); }
public virtual void EntityDestroyed(EntityCombat combat) { //Do nothing }
public virtual void DamageDealt(EntityCombat combat, float amt) { //Do nothing }