public void EndPosion(OnStatusEndEventData e)
    {
        StatusCollection Collection =
            e.Target.GetComponentInChildren <StatusCollection>();

        if (Collection != null)
        {
            Collection.RemoveStatus(Status);
        }
        ColorShifter shifter =
            e.Target.GetComponentInChildren <ColorShifter>();

        if (shifter != null)
        {
            shifter.ShiftToColor(
                new Color(0f, 1f, 0f, 1f),
                new Color(1f, 1f, 1f, 1f),
                1f
                );
            StartCoroutine(DestroyAfter(1f));
        }
        else
        {
            Destroy(gameObject);
        }
    }
 public void Charge(OnPointTargetCastEventData e)
 {
     //such that the skill cannot be cast again if already in motion
     if (!IsCharging)
     {
         Caster       = e.Caster;
         ColorShifter = Caster.GetComponentInChildren <ColorShifter>();
         if (ColorShifter == null)
         {
             Debug.LogWarning("No `ColorShifter` shifter component found when attempting to use charge skill");
         }
         MovableBody = Caster.GetComponentInChildren <MovableBody>();
         if (MovableBody == null)
         {
             throw new MissingComponentException(
                       "No `MovableBody` component found on caster when attempting to use charge skill"
                       );
         }
         Target = e.Target;
         Origin = e.Caster.transform.position;
         StartCharging(
             e.Stats.GetValue("ChargeDuration") + 0.33f,
             e.Stats.GetValue("ChargeBonusSpeed") + 2f,
             e.Stats.GetValue("ChargeBonusAcceleration") + 10f
             );
     }
 }
Esempio n. 3
0
    public void EndConfusion(OnStatusEndEventData e)
    {
        MovableBody movableBody =
            e.Target.GetComponentInChildren <MovableBody>();

        if (movableBody != null)
        {
            RemoveLastRandomMovement(movableBody);
        }
        StatusCollection Collection =
            e.Target.GetComponentInChildren <StatusCollection>();

        if (Collection != null)
        {
            Collection.RemoveStatus(Status);
        }
        ColorShifter shifter =
            e.Target.GetComponentInChildren <ColorShifter>();

        if (shifter != null)
        {
            shifter.ShiftToColor(
                new Color(1f, 1f, 0f, 1f),
                new Color(1f, 1f, 1f, 1f),
                1f
                );
            StartCoroutine(DestroyAfter(1f));
        }
        else
        {
            Destroy(gameObject);
        }
    }
Esempio n. 4
0
 // Use this for initialization
 public override void Awake()
 {
     base.Awake();
     controller   = GameObject.Find("GameController").GetComponent <GameController>();
     lines        = new List <NodeLine>();
     colorShifter = gameObject.GetComponent <ColorShifter>();
     highlighter  = gameObject.GetComponentInChildren <highlight>();
 }
Esempio n. 5
0
    public override void Awake()
    {
        base.Awake();
        //InteractiveItem = gameObject.GetComponentInChildren<VRInteractiveItem>();

        controller   = GameObject.Find("GameController").GetComponent <GameController>();
        colorShifter = gameObject.GetComponent <ColorShifter>();
        highlighter  = gameObject.GetComponentInChildren <highlight>();
    }
    public void StartPosion(OnStatusStartEventData e)
    {
        ColorShifter shifter =
            e.Target.GetComponentInChildren <ColorShifter>();

        if (shifter != null)
        {
            shifter.ShiftToColor(
                new Color(1f, 1f, 1f, 1f),
                new Color(0f, 1f, 0f, 1f),
                1f
                );
        }
        StartCoroutine(RetickAfter(0f, new OnStatusTickEventData(e.Target, e.Source, e.Duration)));
    }
Esempio n. 7
0
    public void StartConfusion(OnStatusStartEventData e)
    {
        LastAddedMovement          = Vector3.zero;
        LastAddedMovementMagnitude = 0f;
        ColorShifter shifter =
            e.Target.GetComponentInChildren <ColorShifter>();

        if (shifter != null)
        {
            shifter.ShiftToColor(
                new Color(1f, 1f, 1f, 1f),
                new Color(1f, 1f, 0f, 1f),
                1f
                );
        }
        StartCoroutine(RetickAfter(0f, new OnStatusTickEventData(e.Target, e.Source, e.Duration)));
    }