public override void Start() { base.Start(); lr = GetComponent <LineRenderer>(); _entityData.health = 1000f; _iceCrow = _IceCrowGO.GetComponent <IceCrow>(); _waterCrow = _WaterCrowGO.GetComponent <WaterCrow>(); _punishmentClock = Time.time; _chainOfDestinyClock = Time.time; _iceCrow = Instantiate(_iceCrow, new Vector3(0f, 1f, 0f), Quaternion.identity); _waterCrow = Instantiate(_waterCrow, new Vector3(0f, 1f, 0f), Quaternion.identity); _iceCrow.setWaterCrow(_waterCrow); _waterCrow.setIceCrow(_iceCrow); //_waterCrow.setVulnerability(false); //_iceCrow.setVulnerability(false); _iceCrow.setHalja(this); _waterCrow.setHalja(this); _moveState = new Halja_MoveState(this, _stateMachine, "run", _entityData, this); _idleState = new Halja_IdleState(this, _stateMachine, "idle", _idleData, this); _scareState = new Halja_ScaredState(this, _stateMachine, "scared", _entityData, this); _deathState = new Halja_DeathState(this, _stateMachine, "death", this); _playerDetectState = new Halja_PlayerDetectState(this, _stateMachine, "playerDetect", _entityData, this); _punishment = new Halja_Punishment(this, _stateMachine, "punishment", this); _whipLashes = new Halja_WhipLashes(this, _stateMachine, "whiplashes", this); _spawnCrow = new Halja_SpawnCrow(this, _stateMachine, "spawnCrow", this); //crowSpawn(false); _stateMachine.InitializeState(_idleState); //todo spawn state }
public Water_ChainOfDestiny(Entity entity, FiniteStateMachine stateMachine, string animationName, D_Entity data, WaterCrow crow, Vector3 playerposition) : base(entity, stateMachine, animationName) { _crow = crow; _entityData = data; _playerPosition = playerposition; _lineDrawSpeed = 2f; _dist = _crow.getChainOfDestinyMaxDistance(); }
public override void Enter() { base.Enter(); _begin = Time.time; _spitPosition = _iceCrow.getThrowChainPosition().position; /*WaterCrow w = _waterCrow; * Transform _waterSpit = _waterCrow.getThrowChainPosition();*/ _counter = 0f; _lineRenderer.enabled = true; _lineRenderer.SetPosition(0, _spitPosition); _lineRenderer.startWidth = 0.3f; _lineRenderer.endWidth = 0.3f; try{ _waterCrow = _iceCrow.GetWaterCrow(); if (_waterCrow == null) { _stateMachine.ChangeState(_iceCrow._MoveState); } _dist = Vector3.Distance(_spitPosition, _waterCrow.getThrowChainPosition().position); _distToHalja = Vector3.Distance(_spitPosition, _iceCrow.GetHalja().getThrowChainPosition().position); if (!_iceCrow.IsIneluttable()) { _secondLr = _iceCrow.getThrowChainPosition().GetComponent <LineRenderer>(); _secondLr.enabled = true; _secondLr.SetPosition(0, _spitPosition); _secondLr.startWidth = 0.3f; _secondLr.endWidth = 0.3f; } }catch (NullReferenceException e) { _stateMachine.ChangeState(_iceCrow._MoveState); }catch (MissingReferenceException m) { _stateMachine.ChangeState(_iceCrow._MoveState); } }
public void crowSpawn() { if (iceCrowDead && waterCrowDead) { _iceClone = Instantiate(_IceCrowGO, new Vector3(0f, 1f, 0f), Quaternion.identity); _waterClone = Instantiate(_WaterCrowGO); _iceCrow = _iceClone.GetComponent <IceCrow>(); _waterCrow = _waterClone.GetComponent <WaterCrow>(); _iceCrow.setHalja(this); _waterCrow.setHalja(this); _waterCrow.setIceCrow(_iceCrow); _iceCrow.setWaterCrow(_waterCrow); _iceCrow.setVulnerability(true); _waterCrow.setVulnerability(false); } else if (iceCrowDead) { _iceClone = Instantiate(_IceCrowGO, new Vector3(0f, 1f, 0f), Quaternion.identity); _iceCrow = _iceClone.GetComponent <IceCrow>(); _waterCrow.setIceCrow(_iceCrow); _iceCrow.setWaterCrow(_waterCrow); _iceCrow.setHalja(this); _iceCrow.setVulnerability(false); } else if (waterCrowDead) { _waterClone = Instantiate(_WaterCrowGO); _waterCrow = _waterClone.GetComponent <WaterCrow>(); _iceCrow.setWaterCrow(_waterCrow); _waterCrow.setIceCrow(_iceCrow); _waterCrow.setHalja(this); _waterCrow.setVulnerability(false); } waterCrowDead = false; iceCrowDead = false; }
public Water_idleState(Entity entity, FiniteStateMachine stateMachine, string animationName, D_IdleState idleData, WaterCrow crow) : base(entity, stateMachine, animationName, idleData) { _crow = crow; }
public void setWaterCrow(WaterCrow waterCrow) { _waterCrow = waterCrow; }
public WaterPunishment(Entity entity, FiniteStateMachine stateMachine, string animationName, WaterCrow crow) : base(entity, stateMachine, animationName) { _crow = crow; }
public void setWaterCrow(WaterCrow crow) { _waterCrow = crow; }
public Water_MoveState(Entity entity, FiniteStateMachine stateMachine, string animationName, D_Entity entityData, WaterCrow crow) : base(entity, stateMachine, animationName, entityData) { _crow = crow; }
public Water_PlayerDetectState(Entity entity, FiniteStateMachine stateMachine, string animationName, D_Entity entityData, WaterCrow crow) : base(entity, stateMachine, animationName, entityData) { _crow = crow; usableMoveSet = new List <State>(); }