コード例 #1
0
ファイル: Spell.cs プロジェクト: berkersonmez/DungeonBoss
 void Start()
 {
     entityC = GetComponent <C_Entity>();
     entityM = GetComponent <M_Entity>();
     levelAttributes();
     initialize();
 }
コード例 #2
0
    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);
    }
コード例 #3
0
ファイル: C_Mage.cs プロジェクト: berkersonmez/DungeonBoss
    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;
    }
コード例 #4
0
    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);
    }
コード例 #5
0
ファイル: M_Entity.cs プロジェクト: berkersonmez/DungeonBoss
    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);
        }
    }
コード例 #6
0
ファイル: M_Entity.cs プロジェクト: berkersonmez/DungeonBoss
    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);
        }
    }
コード例 #7
0
 virtual public void initialize(Vector3 dir, M_Entity sender)
 {
     Invoke("destroySelf", lifetime);
     entity    = sender;
     direction = dir;
 }