cdrandin

Untitled

Mar 8th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.74 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using DarkTonic.MasterAudio;
  4.  
  5. public class HeroicStrike : Ability
  6. {
  7.     public string onHitSFX = "";
  8.     public GameObject slashEffect = null;
  9.     public GameObject bloodEffect = null;
  10.  
  11.     protected override void Awake ()
  12.     {
  13.         base.Awake();
  14.     }
  15.  
  16.     protected override void Start ()
  17.     {
  18.         base.Start();
  19.     }
  20.    
  21.     // Update is called once per frame
  22.     protected override void Update ()
  23.     {
  24.         base.Update();
  25.     }
  26.  
  27.     protected override void OnMouseDown()
  28.     {
  29.         base.OnMouseDown();
  30.     }
  31.  
  32.     protected override void OnMouseUp()
  33.     {
  34.         base.OnMouseUp();
  35.     }
  36.  
  37.     protected override void OnTriggerEnter(Collider other)
  38.     {
  39.         base.OnTriggerEnter(other);
  40.     }
  41.  
  42.     protected override void OnTriggerExit(Collider other)
  43.     {
  44.         base.OnTriggerExit(other);
  45.     }
  46.  
  47.     #region INITIALIZING State Callbacks
  48.     protected override void INITIALIZING_Enter()
  49.     {
  50.         base.INITIALIZING_Enter();
  51.     }
  52.    
  53.     protected override void INITIALIZING_Update()
  54.     {
  55.         base.INITIALIZING_Update();
  56.     }
  57.    
  58.     protected override void INITIALIZING_Exit()
  59.     {
  60.         base.INITIALIZING_Exit();
  61.     }
  62.     #endregion
  63.  
  64.     #region SELECTINGTARGET State Callbacks
  65.     protected override void SELECTINGTARGET_Enter()
  66.     {
  67.         base.SELECTINGTARGET_Enter();
  68.     }
  69.  
  70.     protected override void SELECTINGTARGET_Update()
  71.     {
  72.         base.SELECTINGTARGET_Update();
  73.     }
  74.  
  75.     protected override void SELECTINGTARGET_Exit()
  76.     {
  77.         base.SELECTINGTARGET_Exit();
  78.     }
  79.     #endregion
  80.  
  81.     #region TARGETABLE State Callbacks
  82.     protected override void TARGETABLE_Enter()
  83.     {
  84.         base.TARGETABLE_Enter();
  85.     }
  86.    
  87.     protected override void TARGETABLE_Update()
  88.     {
  89.         base.TARGETABLE_Update();
  90.     }
  91.    
  92.     protected override void TARGETABLE_Exit()
  93.     {
  94.         base.TARGETABLE_Exit();
  95.     }
  96.     #endregion
  97.    
  98.     #region TARGETABLE State Callbacks
  99.     protected override void UNTARGETABLE_Enter()
  100.     {
  101.         base.UNTARGETABLE_Enter();
  102.     }
  103.    
  104.     protected override void UNTARGETABLE_Update()
  105.     {
  106.         base.UNTARGETABLE_Update();
  107.     }
  108.    
  109.     protected override void UNTARGETABLE_Exit()
  110.     {
  111.         base.UNTARGETABLE_Exit();
  112.     }
  113.     #endregion
  114.  
  115.     #region NONE State Callbacks
  116.     protected override void NONE_Enter()
  117.     {
  118.         base.NONE_Enter ();
  119.     }
  120.    
  121.     protected override void NONE_Update()
  122.     {
  123.         base.NONE_Update();
  124.     }
  125.    
  126.     protected override void NONE_Exit()
  127.     {
  128.         base.NONE_Exit();
  129.     }
  130.     #endregion
  131.    
  132.     #region CASTING State Callbacks
  133.     protected override void CASTING_Enter()
  134.     {
  135.         base.CASTING_Enter();
  136.     }
  137.    
  138.     protected override void CASTING_Update()
  139.     {
  140.         base.CASTING_Update();
  141.     }
  142.    
  143.     protected override void CASTING_Exit()
  144.     {
  145.         MasterAudio.PlaySound(this.onHitSFX);
  146.  
  147.         if(this.slashEffect != null)
  148.         {
  149.             GameObject go = (GameObject) Instantiate(this.slashEffect, validTargets[0].transform.position + Vector3.up, owner.transform.rotation);
  150.             go.transform.Rotate(Vector3.up * 180.0f);
  151.         }
  152.  
  153.         if(this.bloodEffect != null)
  154.         {
  155.             Instantiate(bloodEffect, ValidTargets[0].transform.position + Vector3.up, Quaternion.identity);
  156.             Instantiate(bloodEffect, ValidTargets[0].transform.position + Vector3.up, Quaternion.identity);
  157.         }
  158.  
  159.         CameraController.ShakeCamera(new Vector3(2.0F, 0.0f, 0.0f), 3);
  160.  
  161. //      // Set buffable to active when animation hits
  162.         GameObject internalCharacter = ValidTargets[0];
  163.         internalCharacter.GetComponent<Character>().onDamagedByOnceHandler += (Character character) =>
  164.         {
  165.             this.ApplyAllBuffables(internalCharacter);
  166.         };
  167.  
  168.         internalCharacter.GetComponent<Character>().ApplyDamageBy(this.owner, this.finalDamage);
  169.  
  170.         base.CASTING_Exit();
  171.     }
  172.     #endregion
  173.  
  174.     #region COOLDOWN State Callbacks
  175.     protected override void COOLDOWN_Enter()
  176.     {
  177.         base.COOLDOWN_Enter();
  178.     }
  179.    
  180.     protected override void COOLDOWN_Update()
  181.     {
  182.         base.COOLDOWN_Update();
  183.     }
  184.    
  185.     protected override void COOLDOWN_Exit()
  186.     {
  187.         base.COOLDOWN_Exit();
  188.     }
  189.     #endregion
  190. }
Advertisement
Add Comment
Please, Sign In to add comment