コード例 #1
0
        public IWeaponLogic CreateWeaponLogic(NewWeaponConfigItem newCfg,
                                              WeaponLogicConfig config,
                                              IWeaponSoundLogic soundLogic,
                                              IWeaponEffectLogic effectLogic,
                                              IBulletFireInfoProviderDispatcher bulletFireInfoProvider)
        {
            IWeaponLogic rc = null;

            if (config is DefaultWeaponLogicConfig)
            {
                rc = new DefaultWeaponLogic(newCfg,
                                            config as DefaultWeaponLogicConfig,
                                            this,
                                            soundLogic,
                                            effectLogic,
                                            _attachmentManager,
                                            bulletFireInfoProvider);
            }
            else if (config is DoubleWeaponLogicConfig)
            {
                rc = new DoubleWeaponLogic(newCfg,
                                           config as DoubleWeaponLogicConfig,
                                           this, soundLogic,
                                           effectLogic,
                                           _attachmentManager,
                                           bulletFireInfoProvider);
            }

            return(rc);
        }
コード例 #2
0
    /* Handle weapon secondary inputs. */
    private void CreateWeaponInputHandler(WeaponItem item, IWeaponLogic logic, BaseWeaponDecorator decorator, bool isLocal)
    {
        switch ((WeaponSecondaryAction)View.WeaponSecondaryAction)
        {
        /* Sniper sights, e.g. Scope on the Sniper Rifle. Aims down a scope texture.
         * Alternatively, it may simply zoom in the screen without adding a scope, and maintaing a crosshair.
         * This is exclusive to snipers with crosshairs. */
        case WeaponSecondaryAction.SniperRifle:
            ZoomInfo zoomInfo = new ZoomInfo((float)this.View.DefaultZoomMultiplier, (float)this.View.MinZoomMultiplier, (float)this.View.MaxZoomMultiplier);
            this.InputHandler = new SniperRifleInputHandler(logic, isLocal, zoomInfo, this.View);
            break;

        /* Iron sights, e.g. ADS on Machine Gun. Basically aims down the physical gun model. */
        case WeaponSecondaryAction.IronSight:
            ZoomInfo zoomInfo2 = new ZoomInfo((float)this.View.DefaultZoomMultiplier, (float)this.View.MinZoomMultiplier, (float)this.View.MaxZoomMultiplier);
            this.InputHandler = new IronsightInputHandler(logic, isLocal, zoomInfo2, this.View);
            break;

        /* Detonation trigger, e.g. The Final World. */
        case WeaponSecondaryAction.ExplosionTrigger:
            Debug.LogError("The ting go skrrt");
            this.InputHandler = new DefaultWeaponInputHandler(logic, isLocal, this.View, new GrenadeExplosionHander());
            break;

        /* Windup time on the weapon, e.g. Battlesnake/Sabertooth. */
        case WeaponSecondaryAction.Minigun:
            this.InputHandler = new MinigunInputHandler(logic, isLocal, decorator as MinigunWeaponDecorator, this.View);
            break;

        /* No secondary action, only Left Click. Think of cannons, most launchers, most splatterguns. */
        default:
            this.InputHandler = new DefaultWeaponInputHandler(logic, isLocal, this.View, null);
            break;
        }
    }
コード例 #3
0
        public void ApplyAttachment(IWeaponLogic logic)
        {
            var defaultLogic = logic as DefaultWeaponLogic;

            if (null != defaultLogic)
            {
                ApplyAttachment(defaultLogic);
            }
        }
コード例 #4
0
 // Token: 0x06001F11 RID: 7953 RVA: 0x00095EA0 File Offset: 0x000940A0
 public SniperRifleInputHandler(IWeaponLogic logic, bool isLocal, ZoomInfo zoomInfo, UberStrikeItemWeaponView view) : base(logic, isLocal)
 {
     this._zoomInfo = zoomInfo;
     if (view.HasAutomaticFire)
     {
         base.FireHandler = new FullAutoFireHandler(logic.Decorator, WeaponConfigurationHelper.GetRateOfFire(view));
     }
     else
     {
         base.FireHandler = new SemiAutoFireHandler(logic.Decorator, WeaponConfigurationHelper.GetRateOfFire(view));
     }
 }
コード例 #5
0
 // Token: 0x06001EF8 RID: 7928 RVA: 0x00095E44 File Offset: 0x00094044
 public DefaultWeaponInputHandler(IWeaponLogic logic, bool isLocal, UberStrikeItemWeaponView view, IWeaponFireHandler secondaryFireHandler = null) : base(logic, isLocal)
 {
     if (view.HasAutomaticFire)
     {
         base.FireHandler = new FullAutoFireHandler(logic.Decorator, WeaponConfigurationHelper.GetRateOfFire(view));
     }
     else
     {
         base.FireHandler = new SemiAutoFireHandler(logic.Decorator, WeaponConfigurationHelper.GetRateOfFire(view));
     }
     this._secondaryFireHandler = secondaryFireHandler;
 }
コード例 #6
0
        public IWeaponLogic CreateWeaponLogic(NewWeaponConfigItem newCfg,
                                              WeaponConfig config,
                                              IWeaponSoundLogic soundLogic,
                                              IWeaponEffectLogic effectLogic)
        {
            IWeaponLogic rc = null;
            var          weaponLogicConfig = config.WeaponLogic;

            if (weaponLogicConfig is DefaultWeaponLogicConfig)
            {
                rc = new DefaultWeaponLogic();
            }
            else if (weaponLogicConfig is DoubleWeaponLogicConfig)
            {
                rc = new DoubleWeaponLogic(null, null);
            }
            return(rc);
        }
コード例 #7
0
 // Token: 0x06001F09 RID: 7945 RVA: 0x000147D9 File Offset: 0x000129D9
 public MinigunInputHandler(IWeaponLogic logic, bool isLocal, MinigunWeaponDecorator weapon, UberStrikeItemWeaponView view) : base(logic, isLocal)
 {
     this._weapon     = weapon;
     base.FireHandler = new FullAutoFireHandler(weapon, WeaponConfigurationHelper.GetRateOfFire(view));
 }
コード例 #8
0
 // Token: 0x06001F19 RID: 7961 RVA: 0x0001487D File Offset: 0x00012A7D
 protected WeaponInputHandler(IWeaponLogic logic, bool isLocal)
 {
     this._isLocal     = isLocal;
     this._weaponLogic = logic;
 }