/// <summary> /// triggers the AE Effect /// </summary> protected void DoAoEDamage() { if (ActivePrefab != null) { if (_net.IsServer) { Network.Destroy(ActivePrefab.gameObject); } else if (!_net.IsClient) { Destroy(ActivePrefab.gameObject); } } Projectile proj = ProjectilePool.GetProjectile(transform.position, Quaternion.Euler(Vector3.zero)); if (AoEPrefab != null) { proj.ActivePrefab = AoEPrefab; proj.PrefabSize = AoEPrefabSize; proj.PrefabRotation = AoEPrefabRotation; } proj.transform.localScale = AoESize; ((BoxCollider)collider).size = AoESize; proj.Knockback = AoEKnockbackVert; proj.AoEKnockbackHor = AoEKnockbackHor; proj.TimeToLive = AoETime; proj.Range = 1; proj.Speed = 0; proj.Player = Player; proj.DoPiercing = true; proj.Damage = AoEDamageValue; proj.Apply(); }
/// <summary> /// Called on every Frame /// Starts wind when break is finished /// stops wind when duration is over /// </summary> public void Update() { if (_net.IsClient) { return; } if (_remainingBreak > 0) { _remainingBreak -= Time.deltaTime; } if (_remainingBreak <= 0.7f && !_windAnimationEnabled) { CalculateDuration(); } if (_remainingBreak <= 0 && !_windEnabled) { _windEnabled = true; Projectile p = ProjectilePool.GetProjectile(transform.position, transform.rotation); p.DoPiercing = true; p.Damage = 0; p.Speed = 0; p.Range = 1; p.TimeToLive = _remainingDuration; p.transform.localScale = new Vector3(transform.parent.localScale.x - 1, 50, 100); p.transform.Translate(Vector3.down * 25); p.collider.transform.localScale = p.transform.localScale; p.Knockback = p.transform.forward * 50; p.Knockback.y += 50; p.Apply(); } if (_remainingBreak - 6 <= 0 && !_bubblesFired) { _bubblesFired = true; if (_net.IsServer) { networkView.RPC("InstantiateBubbles", RPCMode.All); } else { InstantiateBubbles(); } } if (_remainingDuration > 0) { _remainingDuration -= Time.deltaTime; } if (_remainingDuration <= 0 && _windEnabled) { CalculateBreak(); } }
/// <summary> /// triggers the Fork Effect /// </summary> protected void DoForkDamage() { if (ActivePrefab != null) { if (_net.IsServer) { Network.Destroy(ActivePrefab.gameObject); } else if (!_net.IsClient) { Destroy(ActivePrefab.gameObject); } } // fire 10 projectiles around the main projectile for (int i = 0; i < 20; i++) { Projectile proj = ProjectilePool.GetProjectile(transform.position, Quaternion.Euler(Vector3.up * 360 / 20 * i)); if (ForkPrefab != null) { proj.ActivePrefab = ForkPrefab; proj.PrefabSize = new Vector3(1, 1, 1); } proj.ForkTriggerEnemy = ForkTriggerEnemy; proj.transform.localScale = transform.localScale; proj.SetKnockback(); proj.ForkTriggerEnemy = _forkTriggerEnemy; proj.Knockback = proj.transform.forward.normalized * 10; proj.Knockback.y = 10; proj.Range = ForkArcRadius; proj.Speed = 17; proj.Player = Player; proj.Damage = Damage / 2; proj.ForkDamage = false; proj.Apply(); } }
protected override void PerformAttack() { /*if (_net.IsClient) * { * networkView.RPC("PerformAttack", RPCMode.Server); * } * else * {*/ Projectile proj = ProjectilePool.GetProjectile(transform.position, transform.rotation); proj.StartPosition = transform.position; proj.Range = MeeleRange; proj.renderer.enabled = false; proj.Speed = 10; proj.Player = this; proj.Damage = AttackDamage + BasicDamage; proj.Knockback = Vector3.zero; proj.ForkDamage = false; proj.ForkArcRadius = 0; proj.Apply(); // } StartCoroutine(AttackDelay("Attacking")); }