Exemple #1
0
    [Server] public void Fire()
    {
        RpcCreateClientBolt();

        GameObject boltO = Instantiate(boltPrefab, firePoint.position, firePoint.rotation);
        DC_Bolt    bolt  = boltO.GetComponent <DC_Bolt>();

        bolt.preDamageTime = preDamageTime;

        bolt.damage = damage;
        bolt.range  = range;
        bolt.speed  = speed;

        bolt.instant    = bulletStyleBolt;
        bolt.healthShot = boltHeals;

        bolt.playerO = avatar.playerO;
        bolt.avatarO = avatar.gameObject;

        NetworkServer.Spawn(boltO);
        bolt.Fire();

        lastFireTime = 0f;
        fired        = true;
    }
Exemple #2
0
    [Server] public void BoltStrike(DC_Avatar_Part bodyP, DC_Bolt bolt)
    {
        BodyParts part = bodyP.GetBodyPart();

        switch (part)
        {
        case BodyParts.Chest:
            break;

        case BodyParts.Muzzle:
            break;

        case BodyParts.RightPaw:
            break;

        case BodyParts.LeftPaw:
            break;


        case BodyParts.ChestChord:
            BustAvatar();
            break;

        case BodyParts.MuzzleChord:
            BustAvatar();
            break;
        }

        Debug.Log("Body Part Hit!: " + bodyP.gameObject.name + " : " + bodyP.health);

        if (part != BodyParts.ChestChord && part != BodyParts.MuzzleChord)
        {
            RpcSetPartHealth(part, bodyP.health);
        }
    }
Exemple #3
0
    public virtual bool BoltStrike(DC_Bolt bolt)
    {
        var ret = TakeDamage(bolt.damage);

        avatar.BoltStrike(this, bolt);

        return(ret);
    }
Exemple #4
0
    public override bool BoltStrike(DC_Bolt bolt)
    {
        if (!chest.broken)
        {
            return(false);
        }

        avatar.BoltStrike(this, bolt);
        return(false);
    }