// Token: 0x060009B5 RID: 2485 RVA: 0x0003D888 File Offset: 0x0003BA88 public void SetItem(IUnityItem item, Rect bounds, PopupViewSide side, int daysLeft = -1, BuyingDurationType duration = BuyingDurationType.None) { if (Event.current.type != EventType.Repaint || item == null || Singleton <ItemManager> .Instance.IsDefaultGearItem(item.View.PrefabName) || (item.View.LevelLock > PlayerDataManager.PlayerLevel && !Singleton <InventoryManager> .Instance.Contains(item.View.ID))) { return; } bool flag = this._alpha < Time.time + 0.1f; this._alpha = Mathf.Lerp(this._alpha, Time.time + 1.1f, Time.deltaTime * 12f); if (this._item != item || this._cacheRect != bounds || !this.IsEnabled) { this._cacheRect = bounds; bounds = GUITools.ToGlobal(bounds); this.IsEnabled = true; this._item = item; this._level = ((item.View == null) ? 0 : item.View.LevelLock); this._description = ((item.View == null) ? string.Empty : item.View.Description); this._daysLeft = daysLeft; this._criticalHit = 0; this._duration = duration; switch (side) { case PopupViewSide.Left: { float tipPosition = bounds.y - 10f + bounds.height * 0.5f; Rect rect = new Rect(bounds.x - this.Size.x - 9f, bounds.y - this.Size.y * 0.5f, this.Size.x, this.Size.y); Rect rect2 = new Rect(rect.xMax - 1f, tipPosition, 12f, 21f); if (rect.y <= (float)GlobalUIRibbon.Instance.Height()) { rect.y += (float)GlobalUIRibbon.Instance.Height() - rect.y; } if (rect.yMax >= (float)Screen.height) { rect.y -= rect.yMax - (float)Screen.height; } if (rect2.y < this._finalRect.y || rect2.yMax > this._finalRect.yMax || this._finalRect.x != rect.x) { this._finalRect = rect; if (flag) { this._rect = rect; } } this.OnDrawTip = delegate() { GUI.DrawTexture(new Rect(this._rect.xMax - 1f, tipPosition, 12f, 21f), ConsumableHudTextures.TooltipRight); }; break; } case PopupViewSide.Top: { float tipPosition = bounds.x - 10f + bounds.width * 0.5f; Rect rect3 = new Rect(bounds.x + (bounds.width - this.Size.x) * 0.5f, bounds.y - this.Size.y - 9f, this.Size.x, this.Size.y); Rect rect4 = new Rect(tipPosition, rect3.yMax - 1f, 21f, 12f); if (rect3.xMin <= 10f) { rect3.x = 10f; } if (rect3.xMax >= (float)(Screen.width - 10)) { rect3.x -= rect3.xMax - (float)Screen.width + 10f; } if (rect4.x < this._finalRect.x || rect4.xMax > this._finalRect.xMax || this._finalRect.y != rect3.y) { this._finalRect = rect3; if (flag) { this._rect = rect3; } } this.OnDrawTip = delegate() { GUI.DrawTexture(new Rect(tipPosition, this._rect.yMax - 1f, 21f, 12f), ConsumableHudTextures.TooltipDown); }; break; } } switch (item.View.ItemClass) { case UberstrikeItemClass.WeaponMelee: { this.OnDrawItemDetails = new Action(this.DrawMeleeWeapon); UberStrikeItemWeaponView uberStrikeItemWeaponView = item.View as UberStrikeItemWeaponView; if (uberStrikeItemWeaponView != null) { this._damage.Value = WeaponConfigurationHelper.GetDamage(uberStrikeItemWeaponView); this._damage.Max = WeaponConfigurationHelper.MaxDamage; this._fireRate.Value = WeaponConfigurationHelper.GetRateOfFire(uberStrikeItemWeaponView); this._fireRate.Max = WeaponConfigurationHelper.MaxRateOfFire; } return; } case UberstrikeItemClass.WeaponMachinegun: case UberstrikeItemClass.WeaponShotgun: case UberstrikeItemClass.WeaponSniperRifle: { this.OnDrawItemDetails = new Action(this.DrawInstantHitWeapon); UberStrikeItemWeaponView uberStrikeItemWeaponView2 = item.View as UberStrikeItemWeaponView; if (uberStrikeItemWeaponView2 != null) { this._ammo.Value = WeaponConfigurationHelper.GetAmmo(uberStrikeItemWeaponView2); this._ammo.Max = WeaponConfigurationHelper.MaxAmmo; this._damage.Value = WeaponConfigurationHelper.GetDamage(uberStrikeItemWeaponView2); this._damage.Max = WeaponConfigurationHelper.MaxDamage; this._fireRate.Value = WeaponConfigurationHelper.GetRateOfFire(uberStrikeItemWeaponView2); this._fireRate.Max = WeaponConfigurationHelper.MaxRateOfFire; this._accuracy.Value = WeaponConfigurationHelper.MaxAccuracySpread - WeaponConfigurationHelper.GetAccuracySpread(uberStrikeItemWeaponView2); this._accuracy.Max = WeaponConfigurationHelper.MaxAccuracySpread; //_armorPierced.Value = WeaponConfigurationHelper.GetArmorPierced(uberStrikeItemWeaponView2); //_armorPierced.Max = WeaponConfigurationHelper.MaxArmorPierced; if (item.View.ItemProperties.ContainsKey(ItemPropertyType.CritDamageBonus)) { this._criticalHit = item.View.ItemProperties[ItemPropertyType.CritDamageBonus]; } else { this._criticalHit = 0; } } return; } case UberstrikeItemClass.WeaponCannon: case UberstrikeItemClass.WeaponSplattergun: case UberstrikeItemClass.WeaponLauncher: { this.OnDrawItemDetails = new Action(this.DrawProjectileWeapon); UberStrikeItemWeaponView uberStrikeItemWeaponView3 = item.View as UberStrikeItemWeaponView; if (uberStrikeItemWeaponView3 != null) { this._ammo.Value = WeaponConfigurationHelper.GetAmmo(uberStrikeItemWeaponView3); this._ammo.Max = WeaponConfigurationHelper.MaxAmmo; this._damage.Value = WeaponConfigurationHelper.GetDamage(uberStrikeItemWeaponView3); this._damage.Max = WeaponConfigurationHelper.MaxDamage; this._fireRate.Value = WeaponConfigurationHelper.GetRateOfFire(uberStrikeItemWeaponView3); this._fireRate.Max = WeaponConfigurationHelper.MaxRateOfFire; this._velocity.Value = WeaponConfigurationHelper.GetProjectileSpeed(uberStrikeItemWeaponView3); this._velocity.Max = WeaponConfigurationHelper.MaxProjectileSpeed; this._damageRadius.Value = WeaponConfigurationHelper.GetSplashRadius(uberStrikeItemWeaponView3); this._damageRadius.Max = WeaponConfigurationHelper.MaxSplashRadius; } return; } case UberstrikeItemClass.GearBoots: case UberstrikeItemClass.GearHead: case UberstrikeItemClass.GearFace: case UberstrikeItemClass.GearUpperBody: case UberstrikeItemClass.GearLowerBody: case UberstrikeItemClass.GearGloves: case UberstrikeItemClass.GearHolo: this.OnDrawItemDetails = new Action(this.DrawGear); this._armorCarried.Value = (float)((UberStrikeItemGearView)item.View).ArmorPoints; this._armorCarried.Max = 200f; return; case UberstrikeItemClass.QuickUseGeneral: case UberstrikeItemClass.QuickUseGrenade: case UberstrikeItemClass.QuickUseMine: this.OnDrawItemDetails = new Action(this.DrawQuickItem); return; } this.OnDrawItemDetails = null; } }
// Token: 0x06001F9A RID: 8090 RVA: 0x000979E8 File Offset: 0x00095BE8 private void AddGameLogicToWeapon(WeaponSlot weapon) { float movement = WeaponConfigurationHelper.GetRecoilMovement(weapon.View); float kickback = WeaponConfigurationHelper.GetRecoilKickback(weapon.View); global::LoadoutSlotType slot = weapon.Slot; if (weapon.Logic is ProjectileWeapon) { ProjectileWeapon w = weapon.Logic as ProjectileWeapon; w.OnProjectileShoot += delegate(ProjectileInfo p) { ProjectileDetonator projectileDetonator = new ProjectileDetonator(WeaponConfigurationHelper.GetSplashRadius(weapon.View), (float)weapon.View.DamagePerProjectile, weapon.View.DamageKnockback, p.Direction, weapon.SlotId, p.Id, weapon.View.ID, weapon.View.ItemClass, w.Config.DamageEffectFlag, w.Config.DamageEffectValue); if (p.Projectile != null) { p.Projectile.Detonator = projectileDetonator; if (weapon.View.ItemClass != UberstrikeItemClass.WeaponSplattergun) { GameState.Current.Actions.EmitProjectile(p.Position, p.Direction, slot, p.Id, false); } } else { projectileDetonator.Explode(p.Position); if (weapon.View.ItemClass != UberstrikeItemClass.WeaponSplattergun) { GameState.Current.Actions.EmitProjectile(p.Position, p.Direction, slot, p.Id, true); } } if (weapon.View.ItemClass != UberstrikeItemClass.WeaponSplattergun) { if (w.HasProjectileLimit) { Singleton <ProjectileManager> .Instance.AddLimitedProjectile(p.Projectile, p.Id, w.MaxConcurrentProjectiles); } else { Singleton <ProjectileManager> .Instance.AddProjectile(p.Projectile, p.Id); } } LevelCamera.DoFeedback(LevelCamera.FeedbackType.ShootWeapon, Vector3.back, 0f, movement / 8f, 0.1f, 0.3f, kickback / 3f, Vector3.left); }; } else if (weapon.Logic is MeleeWeapon) { float delay = weapon.Logic.HitDelay; weapon.Logic.OnTargetHit += delegate(CmunePairList <BaseGameProp, ShotPoint> h) { if (!weapon.View.HasAutomaticFire) { GameState.Current.Actions.SingleBulletFire(); } if (h != null) { UnityRuntime.StartRoutine(this.StartApplyDamage(weapon, delay, h)); } LevelCamera.DoFeedback(LevelCamera.FeedbackType.ShootWeapon, Vector3.back, 0f, movement / 8f, 0.1f, 0.3f, kickback / 3f, Vector3.left); }; } else { weapon.Logic.OnTargetHit += delegate(CmunePairList <BaseGameProp, ShotPoint> h) { if (!weapon.View.HasAutomaticFire) { GameState.Current.Actions.SingleBulletFire(); } if (h != null) { this.ApplyDamage(weapon, h); } LevelCamera.DoFeedback(LevelCamera.FeedbackType.ShootWeapon, Vector3.back, 0f, movement / 8f, 0.1f, 0.3f, kickback / 3f, Vector3.left); }; } }