// Each State have access to boss FSM (to change states), projectile, animator and enemy AI public BossState(BossFSM bossFSM, BossBullet projectile, Animator animator, NavMeshAgent pathFinder) { bossAnimator = animator; bossFSMObject = bossFSM; bossProjectile = projectile; bossPathFinder = pathFinder; }
// Use this for initialization void Start() { m_targetCharacter = GameObject.FindGameObjectWithTag("Player").transform; //rigdBody = GetComponent<Rigidbody>(); //fsm = GetComponent<BossFSM>(); m_isAttack = false; fsm = GetComponent <BossFSM>(); BossHealth = GameObject.Find("BossHealthBar").GetComponent <Slider>(); }
public Rage(BossFSM bossFSM, BossBullet projectile, Animator animator, NavMeshAgent pathFinder, Transform bossZero, Boss bossObject) : base(bossFSM, projectile, animator, pathFinder) { bossReference = bossObject; bossZeroPoint = bossZero; frontAttackPoint = bossZeroPoint.GetChild(0).transform; // Shooting delay delayAttackTime = 2f; // Angle to rotate angleToRotate = (360 / pointsCount) * Mathf.Deg2Rad; }
private void Start() { if (HPBar) { HPBar.fillAmount = HP * 1.0f / maxHP * 1.0f; } // Get player reference player = PlayerManager.instance.player.transform; // Set AI movement speed pathFinder = GetComponent <NavMeshAgent>(); pathFinder.speed = Speed; // Set weapon holder holderPoint = transform.Find("HolderPoint"); // Activate FSM stateMachine = GetComponent <BossFSM>(); // Add all possible states to stateMachine stateMachine.AddState(new Weakling(stateMachine, attackProjectiles[0], animator, pathFinder, attackPoints[0])); stateMachine.AddState(new Sorcerer(stateMachine, attackProjectiles[0], animator, pathFinder, attackPoints[1])); stateMachine.AddState(new Rage(stateMachine, attackProjectiles[0], animator, pathFinder, attackPoints[1], this)); stateMachine.AddState(new Berserk(stateMachine, attackProjectiles[0], animator, pathFinder, attackPoints[1])); stateMachine.AddState(new Nightmare(stateMachine, attackProjectiles[1], animator, pathFinder, player.transform)); stateMachine.AddState(new God(stateMachine, attackProjectiles[1], animator, pathFinder, this, energeticField)); // Switch to first state stateMachine.changeState(stateMachine.possibleStates[0]); // Wait for cutscene to play activated = false; // Get reference to animator animator = GetComponent <Animator>(); }
public Weakling(BossFSM bossFSM, BossBullet projectile, Animator animator, NavMeshAgent pathFinder, Transform holderPoint) : base(bossFSM, projectile, animator, pathFinder) { bossHolderPoint = holderPoint; }
public BossStateDeleteEntity(BossFSM _FSM) { m_BossFSM = _FSM; }
public BossStateSpawn(BossFSM _FSM) { m_BossFSM = _FSM; }
public BossStateDeleteMuzzle(BossFSM _FSM) { m_BossFSM = _FSM; }
public God(BossFSM bossFSM, BossBullet projectile, Animator animator, NavMeshAgent pathFinder, Boss bossReference, GameObject energeticField) : base(bossFSM, projectile, animator, pathFinder) { bossObject = bossReference; energeticFieldObject = energeticField; }
public BossStateCreateMuzzle(BossFSM _FSM) { m_BossFSM = _FSM; }
public BossStateAttack(BossFSM _FSM) { m_BossFSM = _FSM; }
public Sorcerer(BossFSM bossFSM, BossBullet projectile, Animator animator, NavMeshAgent pathFinder, Transform starAttackPointParent) : base(bossFSM, projectile, animator, pathFinder) { starAttackPoints = starAttackPointParent; }
public BossStateRetreat(BossFSM _FSM) { m_BossFSM = _FSM; }
public BossStateMove(BossFSM _FSM) { m_BossFSM = _FSM; }
public Nightmare(BossFSM bossFSM, BossBullet projectile, Animator animator, NavMeshAgent pathFinder, Transform nullPoint) : base(bossFSM, projectile, animator, pathFinder) { delayAttackTime = 4f; nullAttackPoint = nullPoint; }