public void Damaged(MeeleAttack MA) { if (!NoMoreDamage) { Health -= MA.Damage; CountDamage++; if (CountDamage > 1 && !NoMoreDamage) { NoMoreDamage = true; Jump = true; CanJump = true; anim.SetTrigger("jump"); } else if (MA.Damage > 5 && !NoMoreDamage) { anim.SetTrigger("Damaged"); } print(MA.Damage); } if (Health <= 0) { Dead(); } }
public void Damaged(MeeleAttack MA) { Health -= MA.Damage; if (Health <= 0) { Dead(); } }
/// <summary> /// (Virtual Void) Character gets Damaged By a Meele Attack /// </summary> /// <param name="MA"></param> // Es el metodo donde recibira daño Donovan con un MeeleAttack public virtual void Damaged(MeeleAttack MA) { CurrentHealth -= MA.Damage; if (CurrentHealth <= 0) { Dead(); } }
private void MeeleAttack() { inMeeleAttack = true; currentAnimation = meleeAttackAnimation; currentAnimation.XIndex = 0; Ability ability = new MeeleAttack(this, Position, speed, direction); abilityBuffer.Add(ability); }
private void initReferences() { rb2d = GetComponent <Rigidbody2D>(); healthCom = new HealthComponent(this); state = new Searching(rb2d, speed); animator = GetComponentInChildren <Animator>(); animCom = new AnimationController(animator); meeleAttack = GetComponentInChildren <MeeleAttack>(); rangeAttack = GetComponentInChildren <RangeAttack>(); if (meeleAttack != null) { attackComponents.Add(meeleAttack); } if (rangeAttack != null) { attackComponents.Add(rangeAttack); } }
protected override void Aggro() { if (Vector3.Distance(car.transform.position, transform.position) > aggroDistance * 4) { currentState = EnemyState.Idle; stateTimer = 0; } else if (MeeleAttack.ObjectWithTagWithinRange(cCollider.radius * transform.lossyScale.x, transform.position + (car.transform.position - transform.position).normalized * cCollider.radius * 2 * transform.lossyScale.x, gameObject, "Player")) { if (stateTimer > 3f) { currentState = EnemyState.Attack; var targ = car.transform.position; targ.y = transform.position.y; Quaternion rotato = Quaternion.LookRotation(targ - transform.position); transform.rotation = rotato; } } else { PathTo(car.transform.position, acceleration); } }
public override void Initialize(GameObject obj) { enemy = obj.GetComponentInChildren <MeeleAttack>(); }
public void AttackLand() { MeeleAttack.MakeMeeleAttack(attackDamage, cCollider.radius * transform.lossyScale.x, transform.position + transform.forward * cCollider.radius * 2 * transform.lossyScale.x, health, attackForce * rb.mass, "Enemy"); }
public void Attack() { MeeleAttack.Action(punch1.position, punch1Radius, 9, 100, false); MeeleAttackBGObjects.Action(punch1.position, punch1Radius, 12, 50, false); }
void Update() { Attack = JsonLoader.attacks.MeeleAttacks[indexAttack]; }
void Awake() { JsonLoader.LoadData(); Attack = JsonLoader.attacks.MeeleAttacks[indexAttack]; }