public void UpdateShipStatus(ShipStatus ship) { ship.NowHp = NowHp; ship.Slot = _status.Slot; ship.SlotEx = _status.SlotEx; if (_status.SpecialAttack == ShipStatus.Attack.Fire) { ship.SpecialAttack = ShipStatus.Attack.Fired; } }
public void Check(ShipStatus ship) { var spec = ship.Spec; if (spec.NumEquips != -1 || ship.Id <= MaxId) { return; } spec.NumEquips = ship.Slot.Count(item => !item.Empty); }
public ChargeStatus(ShipStatus status) { if (status.Spec.FuelMax == 0) { FuelRatio = 2.0; BullRatio = 2.0; return; } FuelRatio = (double)status.Fuel / status.Spec.FuelMax; BullRatio = (double)status.Bull / status.Spec.BullMax; }
private static void ConsumeSlotItem(ShipStatus ship, int id) { if (ship.SlotEx.Spec.Id == id) { ship.SlotEx = new ItemStatus(); return; } for (var i = 0; i < ship.Slot.Count; i++) { if (ship.Slot[i].Spec.Id == id) { ship.FreeSlot(i); break; } } }
public void SetItemHolder() { if (AllBase == null) { return; } var name = new[] { "第一", "第二", "第三" }; foreach (var baseInfo in AllBase.Select((data, i) => new { data, i })) { var areaName = baseInfo.data.AreaName; foreach (var airCorps in baseInfo.data.AirCorps.Select((data, i) => new { data, i })) { var ship = new ShipStatus { Id = 10000 + baseInfo.i * 1000 + airCorps.i, Spec = new ShipSpec { Name = areaName + " " + name[airCorps.i] + "航空隊" } }; foreach (var plane in airCorps.data.Planes) { if (plane.State != 1) { continue; } _itemInfo.GetStatus(plane.Slot.Id).Holder = ship; } } } if (_relocatingPlanes == null) { return; } var relocating = new ShipStatus { Id = 1500, Spec = new ShipSpec { Name = "配置転換中" } }; foreach (var id in _relocatingPlanes) { _itemInfo.GetStatus(id).Holder = relocating; } }
private void FlagshipRecovery(string request, ShipStatus flagship) { var type = int.Parse(HttpUtility.ParseQueryString(request)["api_recovery_type"] ?? "0"); switch (type) { case 0: return; case 1: flagship.NowHp = flagship.MaxHp / 2; ConsumeSlotItem(flagship, 42); // ダメコン break; case 2: flagship.NowHp = flagship.MaxHp; ConsumeSlotItem(flagship, 43); // 女神 break; } if (type != 0) { _shipInfo.SetBadlyDamagedShips(); } }
public ShipStatusPair(ShipStatus assumed, ShipStatus actual) { Assumed = assumed; Actual = actual; }
private TimeSpan RepairTime(ShipStatus ship, int damage) => TimeSpan.FromMinutes(Math.Ceiling(ship.RepairTime.TotalMinutes / (ship.MaxHp - ship.NowHp) * damage));