// Token: 0x06002031 RID: 8241 RVA: 0x00099E58 File Offset: 0x00098058 public ProjectileWeapon(WeaponItem item, ProjectileWeaponDecorator decorator, IWeaponController controller, UberStrikeItemWeaponView view) : base(item, controller) { this._view = view; this._decorator = decorator; this.MaxConcurrentProjectiles = item.Configuration.MaxConcurrentProjectiles; this.MinProjectileDistance = item.Configuration.MinProjectileDistance; this.ExplosionType = item.Configuration.ParticleEffect; }
// Token: 0x0600206B RID: 8299 RVA: 0x0009ADC8 File Offset: 0x00098FC8 private ProjectileWeaponDecorator CreateProjectileWeaponDecorator(int itemId, int missileTimeToDetonate) { IUnityItem itemInShop = Singleton <ItemManager> .Instance.GetItemInShop(itemId); GameObject gameObject = itemInShop.Create(Vector3.zero, Quaternion.identity); ProjectileWeaponDecorator component = gameObject.GetComponent <ProjectileWeaponDecorator>(); if (component) { component.SetMissileTimeOut((float)missileTimeToDetonate / 1000f); } return(component); }
// Token: 0x0600206A RID: 8298 RVA: 0x0009ABFC File Offset: 0x00098DFC private void CreateWeaponLogic(UberStrikeItemWeaponView view, IWeaponController controller) { switch (view.ItemClass) { case UberstrikeItemClass.WeaponMelee: this.Decorator = this.InstantiateWeaponDecorator(view.ID); this.Item = this.Decorator.GetComponent <WeaponItem>(); this.Logic = new MeleeWeapon(this.Item, this.Decorator as MeleeWeaponDecorator, controller); return; case UberstrikeItemClass.WeaponMachinegun: this.Decorator = this.InstantiateWeaponDecorator(view.ID); this.Item = this.Decorator.GetComponent <WeaponItem>(); if (view.ProjectilesPerShot > 1) { this.Logic = new InstantMultiHitWeapon(this.Item, this.Decorator, view.ProjectilesPerShot, controller, view); } else { this.Logic = new InstantHitWeapon(this.Item, this.Decorator, controller, view); } return; case UberstrikeItemClass.WeaponShotgun: this.Decorator = this.InstantiateWeaponDecorator(view.ID); this.Item = this.Decorator.GetComponent <WeaponItem>(); this.Logic = new InstantMultiHitWeapon(this.Item, this.Decorator, view.ProjectilesPerShot, controller, view); return; case UberstrikeItemClass.WeaponSniperRifle: this.Decorator = this.InstantiateWeaponDecorator(view.ID); this.Item = this.Decorator.GetComponent <WeaponItem>(); this.Logic = new InstantHitWeapon(this.Item, this.Decorator, controller, view); return; case UberstrikeItemClass.WeaponCannon: case UberstrikeItemClass.WeaponSplattergun: case UberstrikeItemClass.WeaponLauncher: { ProjectileWeaponDecorator projectileWeaponDecorator = this.CreateProjectileWeaponDecorator(view.ID, view.MissileTimeToDetonate); this.Item = projectileWeaponDecorator.GetComponent <WeaponItem>(); this.Logic = new ProjectileWeapon(this.Item, projectileWeaponDecorator, controller, view); this.Decorator = projectileWeaponDecorator; return; } } throw new Exception("Failed to create weapon logic!"); }