예제 #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;
    }
예제 #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);
        }
    }
예제 #3
0
    public virtual bool BoltStrike(DC_Bolt bolt)
    {
        var ret = TakeDamage(bolt.damage);

        avatar.BoltStrike(this, bolt);

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

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