示例#1
0
        public void Update()
        {
            if (Exp.GetPercent() == 1)
            {
                _dnaClass++;
                Exp.Set(_dnaClass * 100, 0);

                HP.Set(HP.Value + _dnaClass * 50, HP.Value + _dnaClass * 50);
            }
        }
示例#2
0
        internal void Repair(bool rpInstantRepair)
        {
            if (!rpInstantRepair)
            {
                State |= ShipState.Repairing;
            }
            else
            {
                State &= ~ShipState.Repairing;

                HP.Set(HP.Maximum, HP.Maximum);

                if (Condition < 40)
                {
                    Condition = 40;
                }
            }
        }
示例#3
0
        protected override void OnRawDataUpdated()
        {
            if (RawData.DefeatedCount.HasValue)
            {
                var rMaximum = MasterInfo.RequiredDefeatCount.Value;
                var rCurrent = rMaximum - RawData.DefeatedCount.Value;

                HP.Set(rMaximum, rCurrent);
                HP.Before = HP.Current;
            }
            else if (RawData.Event != null)
            {
                HP.Set(RawData.Event.HPMaximum, RawData.Event.HPCurrent);
                HP.Before  = HP.Current;
                Difficulty = RawData.Event.SelectedDifficulty;
            }

            OnPropertyChanged(nameof(IsCleared));
            OnPropertyChanged(nameof(IsIncompleted));
            OnPropertyChanged(nameof(HasGauge));
        }
示例#4
0
        protected override void OnRawDataUpdated()
        {
            ShipInfo rInfo;

            if (!KanColleGame.Current.MasterInfo.Ships.TryGetValue(RawData.ShipID, out rInfo))
            {
                Info = ShipInfo.Dummy;
            }
            else
            {
                if (Info?.ID != RawData.ShipID)
                {
                    r_EquipmentIDs = null;
                    r_Slots        = null;
                }

                Info = rInfo;
                OnPropertyChanged(nameof(Info));
            }

            HP.Set(RawData.HPMaximum, RawData.HPCurrent);
            Fuel.Set(Info.MaxFuelConsumption, RawData.Fuel);
            Bullet.Set(Info.MaxBulletConsumption, RawData.Bullet);

            Speed = RawData.Speed;
            Range = RawData.Range;

            Condition = RawData.Condition;

            if (KanColleGame.Current.Sortie != null && r_Port.EvacuatedShipIDs.Contains(ID))
            {
                State |= ShipState.Evacuated;
            }
            else
            {
                State &= ~ShipState.Evacuated;
            }

            if (r_Port.RepairDocks.Values.Any(r => r.Ship == this))
            {
                State |= ShipState.Repairing;
            }
            else
            {
                State &= ~ShipState.Repairing;

                UpdateAnchorageRepairStatus(OwnerFleet?.AnchorageRepair?.IsBeingAnchorageRepair(this));
            }

            if (RawData.ModernizedStatus?.Length >= 5)
            {
                Status.Update(Info, RawData);
            }

            if (RawData.Equipment != null)
            {
                UpdateSlots();
            }

            CombatAbility.Update();

            IsLocked = RawData.IsLocked;

            OnPropertyChanged(nameof(Level));
            OnPropertyChanged(nameof(ExperienceToNextLevel));
            OnPropertyChanged(nameof(Status));
        }