Ejemplo n.º 1
0
 public override void UpdateStatus(Prop ch)
 {
     ch.transform.position += Time.deltaTime * velocity * direction;
 }
Ejemplo n.º 2
0
 public override void Apply(Prop ch, Character caster = null)
 {
 }
Ejemplo n.º 3
0
        void OnTriggerEnter(Collider col)
        {
            HitResponse.ReflectionType deflect = HitResponse.ReflectionType.None;
            bool finished = true;

            Prop ch = col.gameObject.GetComponent <Prop>();

            if (ch != caster)
            {
                if (ch)
                {
                    // check to see if we deflect it first
                    deflect = ch.GetReflection(parentPower.type);

                    bool apply    = (deflect == HitResponse.ReflectionType.None);
                    bool bounce   = !apply;
                    bool chaining = false;

                    if (chains < (parentPower as PowerProjectile).maxChains)
                    {
                        chains++;
                        bounce   = true;
                        chaining = true;
                        deflect  = HitResponse.ReflectionType.Redirect;
                    }

                    if (apply)
                    {
                        // apply the power normally

                        // bullshit correction because the coordinates are coming out weird here
                        Vector3 pos = ch.transform.position;
                        pos.y = 0;
                        ch.transform.position = pos;

                        // if we miss (based on accuracy), set the flag here so we dont destroy the projectile
                        if (!parentPower.Apply(ch, charge, caster as Character, doStatus))
                        {
                            finished = false;
                        }
                    }

                    if (bounce)
                    {
                        finished = false;
                        // reverse direction for now
                        int       team = -1;
                        Character cha  = (chaining ? caster : ch) as Character;
                        if (cha)
                        {
                            team = cha.team;
                        }
                        float speed = velocity.magnitude;
                        velocity = speed * HitResponse.Reflect(ch, caster.transform.position, deflect, team);

                        startPos = transform.position;
                        if (!chaining)
                        {
                            caster = ch as Character;
                        }
                    }
                }
                if (finished)
                {
                    ObjectFactory.Recycle(gameObject);
                }
            }
        }
Ejemplo n.º 4
0
 public override void Apply(Prop ch, Character caster = null)
 {
     ch.hitResponses.Add(this);
 }
Ejemplo n.º 5
0
 public void PlayEffect(Prop p)
 {
     responseFX.Begin(p.GetBodyPart(responseBodyPart), tint);
 }
Ejemplo n.º 6
0
 void Update()
 {
     Prop.UpdateProps();
 }
Ejemplo n.º 7
0
        // death things
        IEnumerator DeathFade(Prop p, float time)
        {
            yield return(new WaitForSeconds(time));

            p.gameObject.SetActive(false);
        }