private void Update() { if (isPlayer) { playerCheck = gameObject.GetComponent <CharacterStats>(); enemyCheck = null; isDead = !playerCheck.isAlive; } else { enemyCheck = gameObject.GetComponent <EnemieBaseStats>(); playerCheck = null; isDead = !enemyCheck.isAlive; } }
public void Hit(GameObject target) { EnemieBaseStats ownerStats = owner.GetComponent <EnemieBaseStats>(); CharacterStats targetStats = target.GetComponent <CharacterStats>(); if (ownerStats.actionsTaken >= ownerStats.MaxactionsTakable) { damageRoll = Random.Range(1, diceLimit); //owner.Animation play attack for (int i = 0; i < targetStats.attributes.Length; i++) { switch (targetStats.attributes[i].type) { case Atributes.AC: Debug.Log("enemy attacks against characters " + targetStats.attributes[i].type + "that has a total of " + targetStats.attributes[i].value.ModifiedValue); if (usedRoll > targetStats.attributes[i].value.ModifiedValue) { targetStats.ReceiveDamage(damageRoll + ownerStats.strBounes); //change to a switch system for eisier customization; StatusImplimentation(target); } else if (usedRoll <= targetStats.attributes[i].value.ModifiedValue) { ownerStats.MissedAttack(); } break; default: break; } } ownerStats.actionsTaken--; } }
public EnemyCombatants(EnemieBaseStats EStats) { this.eStats = EStats; this.eTransform = EStats.transform; this.anim = eTransform.GetComponent <Animator>(); }