void Start() { entityC = GetComponent <C_Entity>(); entityM = GetComponent <M_Entity>(); levelAttributes(); initialize(); }
virtual protected void mainAttackAnim(M_Entity other) { Vector3 posDiff = other.transform.position - transform.position; float angle = Mathf.Atan2(posDiff.z, -posDiff.x) * Mathf.Rad2Deg; Quaternion animRot = Quaternion.Euler(new Vector3(0, 180 + angle, 0)); posDiff.y = transform.position.y; posDiff = transform.position + (posDiff.normalized * .4f); Instantiate(mainAttackEffect, other.transform.position, animRot); }
override protected void mainAttackAnim(M_Entity other) { Vector3 posDiff = other.transform.position - transform.position; posDiff.y = 0; GameObject attackEffect = Instantiate(mainAttackEffect, transform.position, transform.rotation) as GameObject; attackEffect.GetComponent <E_Mageball>().initialize(posDiff.normalized, character); attackEffect.GetComponent <E_Mageball>().targetTag = other.tag; }
override public void initialize(Vector3 dir, M_Entity sender) { Invoke("destroySelf", lifetime); entity = sender; direction = dir; sm = GameObject.Find("_SpriteManager").GetComponent <LinkedSpriteManager>(); sprite = sm.AddSprite(this.gameObject, 1f, 1f, sm.PixelCoordToUVCoord(0, 12 * 96), sm.PixelSpaceToUVSpace(96, 96), Vector3.zero, false); sprite.SetDrawLayer(100); dieAnim = new UVAnimation(); dieAnim.BuildUVAnim(sm.PixelCoordToUVCoord(0, 12 * 96), sm.PixelSpaceToUVSpace(96, 96), 4, 1, 4, 16f); dieAnim.loopCycles = 0; sprite.AddAnimation(dieAnim); }
public void spellDamage(M_Entity other, int spellDamage) { int dmg = calculateDamage(other.defence, spellDamage); other.receiveDamage(dmg); if (other.gameObject.tag == "Mob") { other.HUD.Add("$sp" + (-dmg), Color.red, .1f); } else if (other.gameObject.tag == "Char") { other.HUD.Add("$sp" + (-dmg), Color.yellow, .1f); } else if (other.gameObject.tag == "Boss") { other.HUD.Add("$sp" + (-dmg), Color.red, .1f); } }
public virtual void damage(M_Entity other) { int dmg = calculateDamage(other.defence, attackPower); other.receiveDamage(dmg); if (other.gameObject.tag == "Mob") { other.HUD.Add(-dmg, Color.red, .1f); } else if (other.gameObject.tag == "Char") { other.HUD.Add(-dmg, Color.yellow, .1f); } else if (other.gameObject.tag == "Boss") { other.HUD.Add(-dmg, Color.red, .1f); } }
virtual public void initialize(Vector3 dir, M_Entity sender) { Invoke("destroySelf", lifetime); entity = sender; direction = dir; }