public void NewCalculateFunc(BattleObject Attaker_status, int Attack_Other, Buff_HPSP sendBuff1, Buff_Others sendBuff2)
    {
        _status = Attaker_status;

        BulletATK = Attack_Other;

        if (sendBuff1 != null)
        {
            _sendBuff1 = sendBuff1;
        }
        if (sendBuff2 != null)
        {
            //Debug.Log("ggg");
            _sendBuff2 = sendBuff2;
        }

        CalculateAttackPower();        //ダメージ計算
    }
 //自分に対してバフを付けたいときに使用
 protected void ADDBuff_Me(GameObject BuffPrefabs)
 {
     //GameObject tekitou = Instantiate(BuffPrefabs);//危なさそうなので直接参照はやめる
     if (BuffPrefabs.GetComponent <Buff_HPSP>())
     {
         Buff_HPSP buff1 = BuffPrefabs.GetComponent <Buff_HPSP>();
         if (AwakeBuff_HP.Contains(buff1) == false)
         {
             AwakeBuff_HP.Add(buff1);
         }
     }
     else if (BuffPrefabs.GetComponent <Buff_Others>())
     {
         Buff_Others buff2 = BuffPrefabs.GetComponent <Buff_Others>();
         if (AwakeBuff_N.Contains(buff2) == false)
         {
             AwakeBuff_N.Add(buff2);
         }
     }
 }
Exemple #3
0
    //バフ同士の計算
    public static Buff_Others operator +(Buff_Others a, Buff_Others b)
    {
        Buff_Others result = new Buff_Others();

        result.HP = a.HP + b.HP;
        result.MAXHP = a.MAXHP + b.MAXHP;//これいる?
        result.ATK = a.ATK + b.ATK;
        result.DEF = a.DEF + b.DEF;
        result.MAXBULLET = a.MAXBULLET + b.MAXBULLET;
        result.INTERVAL = a.INTERVAL + b.INTERVAL;
        result.RELOAD = a.RELOAD + b.RELOAD;
        result.SPEED = a.SPEED + b.SPEED;
        result.JUMP = a.JUMP + b.JUMP;
        result.SPECIAL = a.SPECIAL + b.SPECIAL;
        result.MAXSPECIAL = a.MAXSPECIAL + b.MAXSPECIAL;
        result.SPECIALINTERVAL = a.SPECIALINTERVAL + b.SPECIALINTERVAL;
        result.DISTANCE = a.DISTANCE + b.DISTANCE;

        return result;
    }
    // Use this for initialization
    protected virtual void Start()
    {
        _parameter += _parameter + GetComponent <Display_Parameter>();
        //_battleSystem.Pararray[_id[1], _id[0]] += _battleSystem.Pararray[_id[1], _id[0]] + GetComponent<Display_Parameter>();

        if (GetComponent <Buff_HPSP>())
        {
            SendHP = GetComponent <Buff_HPSP>();
        }
        if (GetComponent <Buff_Others>())
        {
            SendO = GetComponent <Buff_Others>();
        }

        StartCoroutine("ApplyReceiveBuff");                //バフ処理

        if (Bullet && Bullet.GetComponent <Bullet_Sord>()) //近接攻撃があれば
        {
            SordB = Instantiate(Bullet, transform);
            SordB.SetActive(false);
        }
        else if (SPBullet && SPBullet.GetComponent <Bullet_Sord>())
        {
            SordB2 = Instantiate(SPBullet, transform);
            SordB2.SetActive(false);
        }

        //事前生産
        if (Bullet)
        {
            BulletArray[0] = new GameObject[MakeNum[0]];
            //弾
            for (int j = 0; j < BulletArray[0].Length; j++)            //とりま10
            {
                BulletArray[0][j] = Instantiate(Bullet, _battleSystem.transform) as GameObject;
                BulletClass b_bullet = BulletArray[0][j].GetComponent <BulletClass>();
                b_bullet.ATTACKER = this;
                b_bullet.POWER    = _parameter.DISTANCE;
                b_bullet.SYS      = _battleSystem;
                if (SendHP)
                {
                    b_bullet.BUFF1 = SendHP;
                }
                if (SendO)
                {
                    b_bullet.BUFF2 = SendO;
                }
                //ミサイルはしばらく封印
                //if (BulletArray[0][j].GetComponent<Bullet_Missile>() && TargetObj != null)
                //{
                //	BulletArray[0][j].GetComponent<Bullet_Missile>().Missile_TARGET = TargetObj;
                //}
                BulletArray[0][j].SetActive(false);
            }
        }
        if (SPBullet)
        {
            BulletArray[1] = new GameObject[MakeNum[1]];
            //弾
            for (int j = 0; j < BulletArray[1].Length; j++)            //とりま10
            {
                BulletArray[1][j] = Instantiate(SPBullet, _battleSystem.transform) as GameObject;
                BulletClass b_bullet = BulletArray[1][j].GetComponent <BulletClass>();
                b_bullet.ATTACKER = this;
                b_bullet.POWER    = _parameter.DISTANCE;
                b_bullet.SYS      = _battleSystem;
                if (SendHP)
                {
                    b_bullet.BUFF1 = SendHP;
                }
                if (SendO)
                {
                    b_bullet.BUFF2 = SendO;
                }
                //if (BulletArray[1][j].GetComponent<Bullet_Missile>() && TargetObj != null)
                //{
                //	BulletArray[1][j].GetComponent<Bullet_Missile>().Missile_TARGET = TargetObj;
                //}
                BulletArray[1][j].SetActive(false);
            }
        }
    }
Exemple #5
0
    //// Update is called once per frame
    //void Update () {


    //}

    void OnDamegedObject(BattleObject Attacker, BattleObject Diffender, int BulletAtk, Buff_HPSP buff1, Buff_Others buff2)
    {
        //Debug.Log("痛い!");
        //DamageCalculate dam = new DamageCalculate(Attacker, BulletAtk, buff1, buff2);
        dam.NewCalculateFunc(Attacker, BulletAtk, buff1, buff2);
        Diffender.ReceiveAttack(dam);

        // 通知受け取り解除
        //Eventbus.Instance.Unsubscribe((Eventbus.OnDamegedObj)OnDamegedObject);
    }
 // 通知実行
 public void NotifyDamegedObj(BattleObject Attacker, BattleObject Diffender, int BulletAtk, Buff_HPSP buff1, Buff_Others buff2)
 {
     if (_OnDamegedObj != null)
     {
         _OnDamegedObj(Attacker, Diffender, BulletAtk, buff1, buff2);
     }
 }