Exemple #1
0
	public override void Rebuild (WeaponCallBack callBack, Item weaponItem)
	{
		this.WeaponItem = weaponItem;
		_collider = GetComponent<BoxCollider>();
		_collider.enabled = false;

	}
Exemple #2
0
    public override void Rebuild(WeaponCallBack callBack)
    {
        Receiver = GetComponent<GunReceiver>();
        Barrel = GetComponent<GunBarrel>();
        Stock = GetComponent<GunStock>();

        _isCooledDown = true;

        OnSuccessfulShot = callBack;
    }
Exemple #3
0
    public override void Rebuild(WeaponCallBack callBack, Item weaponItem)
    {
        this.WeaponItem   = weaponItem;
        _collider         = GetComponent <BoxCollider>();
        _collider.enabled = false;

        if (weaponItem != null)
        {
            this.WeaponItem = weaponItem;
            SharpDamage     = (float)weaponItem.GetAttributeByName("Sharp Damage").Value;
            BluntDamage     = (float)weaponItem.GetAttributeByName("Blunt Damage").Value;
            Bleeding        = (float)weaponItem.GetAttributeByName("_Bleeding").Value;
        }
    }
Exemple #4
0
	public virtual void Rebuild(WeaponCallBack callBack, Item weaponItem)
	{

	}
Exemple #5
0
 public virtual void Rebuild(WeaponCallBack callBack, Item weaponItem)
 {
 }
Exemple #6
0
    public override void Rebuild(WeaponCallBack callBack, Item weaponItem)
    {
        Receiver = GetComponent <GunReceiver>();
        Barrel   = GetComponent <GunBarrel>();
        Stock    = GetComponent <GunStock>();
        Magazine = GetComponent <GunMagazine>();

        this.WeaponItem = weaponItem;

        _isCooledDown = true;

        _onSuccessfulShot = callBack;

        _sparks       = MuzzleFlash.Find("Sparks").GetComponent <ParticleSystem>();
        _flame        = MuzzleFlash.GetComponent <ParticleSystem>();
        _bulletOrigin = MuzzleFlash.Find("BulletOrigin").gameObject;
        //_bulletTrail.ParentWeapon = this;
        _light       = MuzzleFlash.Find("Light").GetComponent <Light>();
        _foreGripPos = this.ForeGrip.localPosition;
        _isEquipped  = true;

        float _npcRecoilReduction = 1;

        if (Attacker.MyAI.ControlType == AIControlType.NPC)
        {
            _npcRecoilReduction = 0f;
            Barrel.Accuracy     = 1;
        }
        else
        {
            Barrel.Accuracy = (float)weaponItem.GetAttributeByName("Accuracy").Value;
        }


        Barrel.Impact         = (float)weaponItem.GetAttributeByName("Impact").Value;
        Barrel.MuzzleVelocity = (float)weaponItem.GetAttributeByName("_Muzzle Velocity").Value;
        Barrel.Range          = (float)weaponItem.GetAttributeByName("Range").Value;
        Barrel.Handling       = (float)weaponItem.GetAttributeByName("Handling").Value;

        Magazine.MaxCapacity = (int)weaponItem.GetAttributeByName("Magazine Size").Value;
        Receiver.Recoil      = (float)weaponItem.GetAttributeByName("Recoil").Value *_npcRecoilReduction;

        GunshotSoundName = weaponItem.GetAttributeByName("_GunshotSound").Value.ToString();

        _reloadToUnjam = (bool)weaponItem.GetAttributeByName("_ReloadToUnjam").Value;

        switch (Receiver.FireModes[0])
        {
        case GunFireModes.Semi:
            Receiver.SemiFireRate = (float)weaponItem.GetAttributeByName("Rate of Fire").Value;
            break;

        case GunFireModes.Full:
            Receiver.AutoFireRate = (float)weaponItem.GetAttributeByName("Rate of Fire").Value;
            break;

        case GunFireModes.Burst:
            Receiver.BurstFireRate = (float)weaponItem.GetAttributeByName("Rate of Fire").Value;
            break;

        case GunFireModes.Pump:
            Receiver.ManualFireRate = (float)weaponItem.GetAttributeByName("Rate of Fire").Value;
            break;
        }

        _pumpStarted = false;


        Refresh();
    }
Exemple #7
0
 public virtual void Rebuild(WeaponCallBack callBack)
 {
 }