public void GetItemStat(GetItemStatEvent e, ModuleItemNode module, [JoinAll] SingleNode <SelectedPresetComponent> selectedPreset, [JoinByUser] MountedHullNode mountedHull, [JoinByUser] MountedWeaponNode mountedWeapon, [JoinByUser] ICollection <MountedModuleItemNode> mountedModules, [JoinByModule] Optional <ModuleItemNode> mountedToSelectedSlotModule, [JoinAll] ICollection <SlotNode> slots, [JoinAll] ModuleUpgradeConfigNode moduleUpgradeConfig, [JoinAll] ScreenNode screen)
        {
            List <ModuleItemNode> tankModules               = new List <ModuleItemNode>();
            List <ModuleItemNode> weaponModules             = new List <ModuleItemNode>();
            List <ModuleItemNode> tankModulesWithSelected   = new List <ModuleItemNode>();
            List <ModuleItemNode> weaponModulesWithSelected = new List <ModuleItemNode>();

            this.FilterModules(mountedModules, module, !mountedToSelectedSlotModule.IsPresent() ? null : mountedToSelectedSlotModule.Get(), tankModules, weaponModules, tankModulesWithSelected, weaponModulesWithSelected);
            int          slotsCount = this.GetSlotsCount(slots, TankPartModuleType.TANK);
            int          slotCount  = this.GetSlotsCount(slots, TankPartModuleType.WEAPON);
            UpgradeCoefs coefs2     = new UpgradeCoefs {
                tankCoeffWithSelected   = TankUpgradeUtils.CalculateUpgradeCoeff(this.GetTierAndLevelsDictionary(tankModulesWithSelected), slotsCount, moduleUpgradeConfig.moduleUpgradablePowerConfig),
                weaponCoeffWithSelected = TankUpgradeUtils.CalculateUpgradeCoeff(this.GetTierAndLevelsDictionary(weaponModulesWithSelected), slotCount, moduleUpgradeConfig.moduleUpgradablePowerConfig)
            };
            UpgradeCoefs coefs = coefs2;

            coefs2 = new UpgradeCoefs {
                tankCoeffWithSelected   = TankUpgradeUtils.CalculateUpgradeCoeff(this.GetTierAndLevelsDictionaryForNextLevelModule(tankModulesWithSelected, module), slotsCount, moduleUpgradeConfig.moduleUpgradablePowerConfig),
                weaponCoeffWithSelected = TankUpgradeUtils.CalculateUpgradeCoeff(this.GetTierAndLevelsDictionaryForNextLevelModule(weaponModulesWithSelected, module), slotCount, moduleUpgradeConfig.moduleUpgradablePowerConfig)
            };
            UpgradeCoefs   coefs3   = coefs2;
            float          coef     = (module.moduleTankPart.TankPart != TankPartModuleType.TANK) ? coefs.weaponCoeffWithSelected : coefs.tankCoeffWithSelected;
            float          num4     = (module.moduleTankPart.TankPart != TankPartModuleType.TANK) ? coefs3.weaponCoeffWithSelected : coefs3.tankCoeffWithSelected;
            long           marketId = (module.moduleTankPart.TankPart != TankPartModuleType.TANK) ? mountedWeapon.marketItemGroup.Key : mountedHull.marketItemGroup.Key;
            VisualProperty property = GarageItemsRegistry.GetItem <TankPartItem>(marketId).Properties[0];
            ModuleUpgradeCharacteristic characteristic = new ModuleUpgradeCharacteristic {
                Min        = property.GetValue(0f) - (property.GetValue(0f) / 10f),
                Max        = property.GetValue(1f),
                Current    = property.GetValue(coef),
                Next       = property.GetValue(num4),
                CurrentStr = property.GetFormatedValue(coef),
                NextStr    = property.GetFormatedValue(num4),
                Unit       = property.Unit,
                Name       = (module.moduleTankPart.TankPart != TankPartModuleType.TANK) ? screen.newModulesScreenUi.TurretDamage : screen.newModulesScreenUi.HullHealth
            };

            e.moduleUpgradeCharacteristic = characteristic;
        }
示例#2
0
 public void InitHull(NodeAddedEvent e, SingleNode <MainScreenComponent> ui, SelfUserNode self, [JoinByUser, Context] MountedHullNode hull, [JoinByMarketItem, Context] GarageMarketItemNode marketItem)
 {
     ui.component.MountedHull = GarageItemsRegistry.GetItem <TankPartItem>(hull.marketItemGroup.Key);
 }
示例#3
0
 public void InitHull(NodeAddedEvent e, SingleNode <SelectedHullUIComponent> hullUI, SelfUserNode self, [Context] PresetNode preset, [JoinByUser, Context] MountedHullNode hull, [JoinByMarketItem, Context] ParentGarageMarketItemNode marketItem, [JoinByParentGroup, Context, Combine] MountedSkin mountedSkin)
 {
     if (preset.userGroup.Key == mountedSkin.userGroup.Key)
     {
         this.SetItem(hull, hullUI.component, mountedSkin);
     }
 }
示例#4
0
        public void CheckModeRestrictions(PlayAgainEvent e, SingleNode <ChosenMatchMackingModeComponent> chosenMode, [JoinAll] ICollection <MatchMakingModeNode> modes, [JoinAll] UserNode user, [JoinByUser] MountedHullNode hull, [JoinAll] ButtonNode button)
        {
            int    level      = hull.upgradeLevelItem.Level;
            Entity modeEntity = chosenMode.component.ModeEntity;

            if (modeEntity != null)
            {
                MatchMakingModeRestrictionsComponent component = modeEntity.GetComponent <MatchMakingModeRestrictionsComponent>();
                int rank = user.userRank.Rank;
                e.MatchMackingMode = modeEntity;
                e.ModeIsAvailable  = (rank <= component.MaximalShowRank) && (rank >= component.MinimalShowRank);
                MainScreenComponent.Instance.ShowHome();
                if (!e.ModeIsAvailable)
                {
                    MainScreenComponent.Instance.ShowOrHideScreen(MainScreenComponent.MainScreens.PlayScreen, true);
                }
                else
                {
                    button.esm.Esm.ChangeState <PlayButtonStates.SearchingState>();
                    MainScreenComponent.Instance.ShowMatchSearching(modeEntity.GetComponent <DescriptionItemComponent>().Name);
                }
            }
        }