public override void UpdateStatus(Prop ch) { ch.transform.position += Time.deltaTime * velocity * direction; }
public override void Apply(Prop ch, Character caster = null) { }
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); } } }
public override void Apply(Prop ch, Character caster = null) { ch.hitResponses.Add(this); }
public void PlayEffect(Prop p) { responseFX.Begin(p.GetBodyPart(responseBodyPart), tint); }
void Update() { Prop.UpdateProps(); }
// death things IEnumerator DeathFade(Prop p, float time) { yield return(new WaitForSeconds(time)); p.gameObject.SetActive(false); }