public void Initialize(List <SpellBehaviour> modifiers, StatsBehaviour stats, Transform transform, IDamagable avoidTarget) { _transform.position = transform.position; _transform.rotation = transform.rotation; _transform.rotation *= Quaternion.Euler(0f, Random.Range(-_recoil, _recoil), 0f); _damage = stats.GetStatValue(StatType.ProjectileDamage); _speed = stats.GetStatValue(StatType.ProjectileSpeed); _range = stats.GetStatValue(StatType.AttackRange); _size = stats.GetStatValue(StatType.ProjectileSize); _recoil = stats.GetStatValue(StatType.AttackRecoil); _targetToAvoid = avoidTarget; _timeToRemove = _range / _speed; _modifiers = modifiers; }
private void Start() { _stats = GetComponent <StatsBehaviour>(); _damageHighlight = GetComponent <DamageHighlight>(); MaxHealth = _stats.GetStatValue(StatType.Health); CurrentHealth = MaxHealth; }
private void Awake() { _attackHandler = GetComponent <AttackHandler>(); _stats = GetComponent <StatsBehaviour>(); Item.OnPickUp += AddItem; }
private void Awake() { _rigidbody = GetComponent <Rigidbody>(); _statsBehaviour = GetComponent <StatsBehaviour>(); _player = FindObjectOfType <Player>().transform; _agent = GetComponent <NavMeshAgent>(); _stateMachine = GetComponent <EnemyStateMachine>(); InitializeStateMachine(); }
public override void BeginEffect(Transform target) { _stats = target.GetComponent <StatsBehaviour>(); if (_stats) { _stats.AddStatMod(this); } }
private void Awake() { _mainCamera = Camera.main; _input = GetComponent <InputHandler>(); _characterController = GetComponent <CharacterController>(); _statsBehaviour = GetComponent <StatsBehaviour>(); IsControlDisabled = false; PlayerHealthBehaviour.OnPlayerDeath += DisableController; }
private void Awake() { _stats = GetComponent <StatsBehaviour>(); _attackInvoker = GetComponent <IAttackHandler>(); _avoidTarget = GetComponent <IDamagable>(); _attackInvoker.OnAttackTrigger += HandleAttack; _attackInvoker.OnAttackCancel += AttackCancel; PlayerHealthBehaviour.OnPlayerDeath += () => _nextAttackTime = float.PositiveInfinity; if (!_projectilePool) { _projectilePool = GameObject.FindGameObjectWithTag("EnemyProjectilesPool").GetComponent <ProjectilePool>(); } foreach (Turret turret in GetComponentsInChildren <Turret>()) { _turrets.Add(turret); } }
void Awake() { _stats = FindObjectOfType <StatsBehaviour>(); _data.Type = ItemType.Passive; }
public ChaseState(EnemyController monster) : base(monster.gameObject) { _enemyController = monster; _statBehaviour = _enemyController.GetComponent <StatsBehaviour>(); }
public CombatState(EnemyController enemy) : base(enemy.gameObject) { _enemyController = enemy; _statBehaviour = _enemyController.GetComponent <StatsBehaviour>(); }