public void change_2_SUPPLY_PROCESS(SupplyType supplyType) { if (_status != 0 && _status != ScreenStatus.RIGHT_PAIN_WORK) { return; } _status = ScreenStatus.SUPPLY_PROCESS; _otherListParent.LockControl(); _commonDeckSwitchManager.keyControlEnable = false; if (supplyType == SupplyType.All) { ShipModel model; if (isNotOther() && _currentDeck.GetShipCount() == getSelectedShipList().Count) { int mstId = _currentDeck.GetFlagShip().MstId; model = _currentDeck.GetFlagShip(); } else { List <ShipModel> selectedShipList = getSelectedShipList(); int index = UnityEngine.Random.Range(0, selectedShipList.Count); int mstId2 = selectedShipList[index].MstId; model = selectedShipList[index]; } ShipUtils.PlayShipVoice(model, 27); } SetShipSelectFocus(focused: false); _rightPane.LostFocus(); _rightPane.SetEnabled(enabled: false); _rightPane.DoWindowOpenAnimation(supplyType); Supply(supplyType); }
public static Sprite getSupplySprite(SupplyType type) { switch (type) { case SupplyType.MEDKIT_SMALL: return(supplies[0]); case SupplyType.MEDKIT_MEDIUM: return(supplies[1]); case SupplyType.MEDKIT_LARGE: return(supplies[2]); case SupplyType.MEDKIT_ULTRA: return(supplies[3]); case SupplyType.GRENADE_FLASH: return(supplies[4]); case SupplyType.GRENADE_PARALIZE: return(supplies[5]); case SupplyType.INJECTION_SPEED: return(supplies[6]); case SupplyType.INJECTION_ARMOR: return(supplies[7]); case SupplyType.INJECTION_REGENERATION: return(supplies[8]); default: Debug.Log("Unknown supply type: " + type); return(null); } }
public static string name(this SupplyType type) { switch (type) { case SupplyType.MEDKIT_SMALL: return("Маленькая аптечка"); case SupplyType.MEDKIT_MEDIUM: return("Средняя аптечка"); case SupplyType.MEDKIT_LARGE: return("Большая аптечка"); case SupplyType.MEDKIT_ULTRA: return("Огромная аптечка"); case SupplyType.GRENADE_FLASH: return("Светошумовая граната"); case SupplyType.GRENADE_PARALIZE: return("Парализующая граната"); case SupplyType.INJECTION_SPEED: return("Инъекция скорости"); case SupplyType.INJECTION_ARMOR: return("Инъекция защиты"); case SupplyType.INJECTION_REGENERATION: return("Инъекция регенерации"); default: Debug.Log("Unknown supply type: " + type); return(""); } }
public bool canUseSupply(SupplyType supplyType) { if (machineState != StateMachine.PLAYER_TURN || playerActions == 0) { return(false); } if (supplyType == SupplyType.INJECTION_SPEED || supplyType == SupplyType.INJECTION_ARMOR || supplyType == SupplyType.INJECTION_REGENERATION) { StatusEffectType type = supplyType.toStatusEffectType(); foreach (StatusEffect eff in fightScreen.playerStatusEffects) { if (eff.statusType == type && eff.isFired) { Messenger.showMessage("Персонаж уже находится под действием эффекта '" + eff.statusType.name() + "'"); return(false); } } } else if (supplyType == SupplyType.GRENADE_FLASH || supplyType == SupplyType.GRENADE_PARALIZE) { StatusEffectType type = supplyType.toStatusEffectType(); foreach (StatusEffect eff in fightScreen.enemyStatusEffects) { if (eff.statusType == type && eff.isFired) { Messenger.showMessage("Противник уже находится под действием эффекта '" + eff.statusType.name() + "'"); return(false); } } } return(true); }
private void ReloadSupply(SupplyType supplyType) { float amountToDisplay = suppliesAndTheirAmounts[supplyType].GetAmountToDisplay(); string quantityToDisplay = GameManager.Instance.QuantityTypes[suppliesAndTheirAmounts[supplyType].GetQuantityToDisplay()]; parentOfSupplyUIs.GetChild(GameManager.Instance.FindSupplyAttributeBySupplyType(supplyType).numberInUI).Find("Text (TMP)").GetComponent <TMP_Text>().text = amountToDisplay.ToString() + quantityToDisplay; }
public static void SupplyGear(Mobile m, CustomGameEventSupplier eventSupplier) { //Supply the right type of gear SupplyType supplyType = eventSupplier.SupplyType; if (supplyType == SupplyType.MaxGear) { SupplyMaxGear(m, eventSupplier.ClothHue, eventSupplier.GearHue, eventSupplier.TeamName, eventSupplier.NewbieAllItems, eventSupplier.StayEquipped, eventSupplier.ConsumeItems); } else if (supplyType == SupplyType.RegularGear) { SupplyRegGear(m, eventSupplier.ClothHue, eventSupplier.GearHue, eventSupplier.TeamName, eventSupplier.NewbieAllItems, eventSupplier.StayEquipped, eventSupplier.ConsumeItems); } else if (supplyType == SupplyType.Custom) { if (!eventSupplier.CanUseCustomGear) { m.PublicOverheadMessage(MessageType.Regular, 906, true, "Custom setup error."); } //Copy all the items in our bags and make them to event items for (int i = 0; i < eventSupplier.ItemContaiers.Length; i++) { if (eventSupplier.ItemContaiers[i].Items.Count > 0) { SupplyCustomItems(eventSupplier.ItemContaiers[i].Items, m, eventSupplier.ItemContaiers[i].AcceptsType, eventSupplier.NewbieAllItems, eventSupplier.ClothHue, eventSupplier.GearHue, eventSupplier.TeamName, eventSupplier.StayEquipped, eventSupplier.ConsumeItems); } } } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 0: { m_StayEquipped = reader.ReadBool(); m_NewbieAllItems = reader.ReadBool(); m_ClothHue = reader.ReadInt(); m_GearHue = reader.ReadInt(); m_SupplyType = (SupplyType)reader.ReadInt(); m_TeamName = reader.ReadString(); ConsumeItems = reader.ReadBool(); //The amount of resource bags to read at load int bagCount = reader.ReadInt(); m_ItemContaiers = new EventItemContainer[bagCount]; //Save the resource bags for (int i = 0; i < bagCount; i++) { m_ItemContaiers[i] = (EventItemContainer)reader.ReadItem(); } break; } } }
public static SupplyData createSupplyData() { SupplyType type = SupplyType.MEDKIT_SMALL; switch (UnityEngine.Random.Range(0, Enum.GetNames(typeof(SupplyType)).Length)) { case 0: type = SupplyType.GRENADE_PARALIZE; break; case 1: type = SupplyType.GRENADE_FLASH; break; case 2: type = SupplyType.MEDKIT_SMALL; break; case 3: type = SupplyType.MEDKIT_MEDIUM; break; case 4: type = SupplyType.MEDKIT_LARGE; break; case 5: type = SupplyType.MEDKIT_ULTRA; break; case 6: type = SupplyType.INJECTION_SPEED; break; case 7: type = SupplyType.INJECTION_ARMOR; break; case 8: type = SupplyType.INJECTION_REGENERATION; break; default: Debug.Log("Unmapped value for supply"); break; } return(createSupplyData(type)); }
public static int sortWeight(this SupplyType type) { switch (type) { case SupplyType.MEDKIT_ULTRA: return(9000000); case SupplyType.MEDKIT_LARGE: return(8000000); case SupplyType.MEDKIT_MEDIUM: return(7000000); case SupplyType.MEDKIT_SMALL: return(6000000); case SupplyType.INJECTION_SPEED: return(5000000); case SupplyType.INJECTION_REGENERATION: return(4000000); case SupplyType.INJECTION_ARMOR: return(3000000); case SupplyType.GRENADE_PARALIZE: return(2000000); case SupplyType.GRENADE_FLASH: return(1000000); default: Debug.Log("Unknown supply type: " + type); return(0); } }
public bool IsValidSupply(SupplyType type) { switch (type) { case SupplyType.Fuel: if (FuelForSupply <= 0) { return(false); } if (FuelForSupply > base.Material.Fuel) { return(false); } return(true); case SupplyType.Ammo: if (AmmoForSupply <= 0) { return(false); } if (AmmoForSupply > base.Material.Ammo) { return(false); } return(true); default: return(IsValidSupply(SupplyType.Fuel) || IsValidSupply(SupplyType.Ammo)); } }
private bool GetUnlockShardUIInfoForCurrentItem(out int currentShardAmount, out int increasedShardAmount, out int shardsNeededForLevel, out bool showLevel, out ShardVO unlockShardToDisplay) { currentShardAmount = 0; increasedShardAmount = 0; shardsNeededForLevel = 0; unlockShardToDisplay = null; showLevel = false; CrateSupplyVO crateSupply = this.currentCrateItem.CrateSupply; SupplyType type = crateSupply.Type; if (type != SupplyType.ShardSpecialAttack && type != SupplyType.ShardTroop) { return(false); } ShardVO unlockShard = this.currentCrateItem.UnlockShard; if (unlockShard == null) { return(false); } unlockShardToDisplay = unlockShard; CurrentPlayer currentPlayer = Service.CurrentPlayer; DeployableShardUnlockController deployableShardUnlockController = Service.DeployableShardUnlockController; string uid = unlockShard.Uid; string targetGroupId = unlockShard.TargetGroupId; string targetType = unlockShard.TargetType; int num = 0; if (targetType == "hero" || targetType == "troop") { if (this.troopUpgradeOrignal.ContainsKey(targetGroupId)) { num = this.troopUpgradeOrignal[targetGroupId]; } } else if (targetType == "specialAttack" && this.specialAttackUpgradeOrignal.ContainsKey(targetGroupId)) { num = this.specialAttackUpgradeOrignal[targetGroupId]; } int hqLevel = currentPlayer.Map.FindHighestHqLevel(); int num2 = (!this.shardsOriginal.ContainsKey(uid)) ? 0 : this.shardsOriginal[uid]; int rewardAmount = Service.InventoryCrateRewardController.GetRewardAmount(crateSupply, hqLevel); currentShardAmount = num2; increasedShardAmount = num2 + rewardAmount; showLevel = (num > 0); if (type == SupplyType.ShardSpecialAttack) { shardsNeededForLevel = deployableShardUnlockController.GetNumShardsForDeployableToReachLevelInGroup <SpecialAttackTypeVO>(num, num + 1, targetGroupId); } else if (type == SupplyType.ShardTroop) { shardsNeededForLevel = deployableShardUnlockController.GetNumShardsForDeployableToReachLevelInGroup <TroopTypeVO>(num, num + 1, targetGroupId); } return(true); }
public SuppliedProduct(SupplyProduct command) { Id = command.Id; ProductId = command.ProductId; SupplierId = command.SupplierId; ShopId = command.ShopId; Amount = command.Amount; ProcurementCost = command.ProcurementCost; Type = command.Type; }
public SupplyData(ItemQuality quality, float level, SupplyType type, int value, int duration) : base(quality, level) { this.type = type; this.value = value; this.duration = duration; name = type.name(); description = type.description(); volume = type.volume(); sortWeight = type.sortWeight(); itemType = ItemType.SUPPLY; }
public bool IsValidSupply(SupplyType type) { if (type == SupplyType.Fuel) { return(this.FuelForSupply > 0 && this.FuelForSupply <= base.Material.Fuel); } if (type == SupplyType.Ammo) { return(this.AmmoForSupply > 0 && this.AmmoForSupply <= base.Material.Ammo); } return(this.IsValidSupply(SupplyType.Fuel) || this.IsValidSupply(SupplyType.Ammo)); }
public void Add(SupplyTypeModel model) { using (var uow = new UnitOfWork(new DataContext())) { var obj = new SupplyType(); obj.Description = model.Description; obj.SupplyClassID = model.SupplyClassID; obj.UnitPrice = model.UnitPrice; uow.SupplyTypes.Add(obj); uow.Complete(); } }
static Supply CreateSupplyObject(SupplyType type, ShoppingResult result) { return(new Supply { SupplyId = result.ProductId, Type = type, Name = result.Title, Vendor = result.Source, Price = result.ExtractedPrice, Link = result.Link, Thumbnail = result.Thumbnail }); }
public void DoWindowOpenAnimation(SupplyType supplyType) { Hashtable hashtable = new Hashtable(); hashtable.Add("time", 0.3f); hashtable.Add("y", 199f); hashtable.Add("easeType", iTween.EaseType.easeInOutSine); hashtable.Add("isLocal", true); hashtable.Add("oncomplete", "OnCompleteOfWindowOpenAnimation"); hashtable.Add("oncompletetarget", base.get_gameObject()); hashtable.Add("oncompleteparams", supplyType); this._window.get_transform().MoveTo(hashtable); }
private bool IsCurrentItemRewardAShard() { if (this.currentCrateItem == null || this.currentCrateItem.CrateSupply == null) { string text = (this.crateVO != null) ? this.crateVO.Uid : "unknown"; Service.Logger.ErrorFormat("Reward data for crate {0} not found or has been cleaned up while using it", new object[] { text }); return(false); } CrateSupplyVO crateSupply = this.currentCrateItem.CrateSupply; SupplyType type = crateSupply.Type; return(type == SupplyType.Shard || type == SupplyType.ShardSpecialAttack || type == SupplyType.ShardTroop); }
private void Supply(SupplyType supplyType) { if (SupplyManager.Supply(supplyType, out bool use_baux)) { if (use_baux) { animateBauxite(_bauxiteMsgSuccess); } } else if (use_baux) { animateBauxite(_bauxiteMsgIncomplete); } SingletonMonoBehaviour <UIPortFrame> .Instance.UpdateHeaderInfo(SupplyManager); Instance.UpdateSupplyManager(); }
public static SupplyData createSupplyData(SupplyType type, ItemQuality quality) { float level = randLevel(); int value = 0; int duration = 0; switch (type) { case SupplyType.MEDKIT_SMALL: case SupplyType.MEDKIT_MEDIUM: case SupplyType.MEDKIT_LARGE: case SupplyType.MEDKIT_ULTRA: value = Mathf.RoundToInt(type.value() * level * qualityMultiplier(quality)); break; case SupplyType.GRENADE_FLASH: duration = quality == ItemQuality.UNIQUE? 12: quality == ItemQuality.RARE? 10: quality == ItemQuality.SUPERIOR? 8: quality == ItemQuality.GOOD? 6: 4; break; case SupplyType.GRENADE_PARALIZE: duration = quality == ItemQuality.UNIQUE? 7: quality == ItemQuality.RARE? 6: quality == ItemQuality.SUPERIOR? 5: quality == ItemQuality.GOOD? 4: 3; break; case SupplyType.INJECTION_ARMOR: value = Mathf.RoundToInt(type.value() * level * qualityMultiplier(quality)) * 2; duration = quality == ItemQuality.UNIQUE? 20: quality == ItemQuality.RARE? 14: quality == ItemQuality.SUPERIOR? 10: quality == ItemQuality.GOOD? 7: 5; break; case SupplyType.INJECTION_REGENERATION: value = Mathf.RoundToInt(type.value() * level * qualityMultiplier(quality)); duration = quality == ItemQuality.UNIQUE? 7: quality == ItemQuality.RARE? 6: quality == ItemQuality.SUPERIOR? 5: quality == ItemQuality.GOOD? 4: 3; break; case SupplyType.INJECTION_SPEED: value = quality == ItemQuality.UNIQUE? 5: quality == ItemQuality.RARE? 4: quality == ItemQuality.SUPERIOR? 3: quality == ItemQuality.GOOD? 2: 1; duration = 5; break; } SupplyData data = new SupplyData(quality, level, type, value, duration); data.initCommons(calculateCost(data), 0); return(data); }
private void OnCompleteOfWindowOpenAnimation(SupplyType supplyType) { switch (supplyType) { case SupplyType.All: this._ammoSupplyIconManager.ProcessConsumingAnimation(); this._fuelSupplyIconManager.ProcessConsumingAnimation(); break; case SupplyType.Fuel: this._fuelSupplyIconManager.ProcessConsumingAnimation(); this._ammoSupplyIconManager.ProcessCancelAnimation(); break; case SupplyType.Ammo: this._fuelSupplyIconManager.ProcessCancelAnimation(); this._ammoSupplyIconManager.ProcessConsumingAnimation(); break; } }
public bool Supply(SupplyType type, out bool use_baux) { int baux = base.Material.Baux; bool result; if (type == SupplyType.Fuel) { result = this._Supply(Api_req_Hokyu.enumHokyuType.Fuel); } else if (type == SupplyType.Ammo) { result = this._Supply(Api_req_Hokyu.enumHokyuType.Bull); } else { result = this._Supply(Api_req_Hokyu.enumHokyuType.All); } use_baux = (baux - base.Material.Baux > 0); return(result); }
public Card Take(SupplyType supplyType, Card card) { switch (supplyType) { case SupplyType.Victory: return(Take(VictorySupply, card)); case SupplyType.Treasure: return(Take(TreasureSupply, card)); case SupplyType.Kingdom: return(Take(KingdomSupply, card)); case SupplyType.Ruins: return(Take(RuinsPile, card)); default: throw new InvalidOperationException("There is no supply type mapping for this card."); } }
public static int value(this SupplyType type) { switch (type) { case SupplyType.MEDKIT_SMALL: return(50); case SupplyType.MEDKIT_MEDIUM: return(100); case SupplyType.MEDKIT_LARGE: return(200); case SupplyType.MEDKIT_ULTRA: return(500); case SupplyType.INJECTION_SPEED: return(1); case SupplyType.INJECTION_ARMOR: return(10); case SupplyType.INJECTION_REGENERATION: return(30); default: return(0); } }
public static FightEffectType toFightEffectType(this SupplyType type) { switch (type) { case SupplyType.GRENADE_FLASH: return(FightEffectType.BLIND); case SupplyType.GRENADE_PARALIZE: return(FightEffectType.PARALIZED); case SupplyType.INJECTION_ARMOR: return(FightEffectType.ARMORED); case SupplyType.INJECTION_REGENERATION: return(FightEffectType.REGENERATION); case SupplyType.INJECTION_SPEED: return(FightEffectType.SPEED); case SupplyType.MEDKIT_SMALL: case SupplyType.MEDKIT_MEDIUM: case SupplyType.MEDKIT_LARGE: case SupplyType.MEDKIT_ULTRA: return(FightEffectType.HEAL); default: Debug.Log("Unknown supply type: " + type); return(FightEffectType.DAMAGE); } }
public bool Supply(SupplyType type, out bool use_baux) { int baux = base.Material.Baux; bool result; switch (type) { case SupplyType.Fuel: result = _Supply(Api_req_Hokyu.enumHokyuType.Fuel); break; case SupplyType.Ammo: result = _Supply(Api_req_Hokyu.enumHokyuType.Bull); break; default: result = _Supply(Api_req_Hokyu.enumHokyuType.All); break; } use_baux = (baux - base.Material.Baux > 0); return(result); }
public static string GetShortName(this SupplyType supplyType) { switch (supplyType) { case SupplyType.Medicinal: return("Medicl"); case SupplyType.Mechanical: return("Mchncl"); case SupplyType.Electrical: return("Elctcl"); case SupplyType.Structural: return("Strtrl"); case SupplyType.Food: return("Food"); case SupplyType.Fuel: return("Fuel"); } return("ERR"); }
public string GetCrateSupplyRewardName(CrateSupplyVO supplyData) { string text = string.Empty; if (supplyData == null) { return(text); } Lang lang = Service.Get <Lang>(); IDataController dataController = Service.Get <IDataController>(); string rewardUid = supplyData.RewardUid; SupplyType type = supplyData.Type; switch (type) { case SupplyType.Currency: text = lang.Get(supplyData.RewardUid.ToUpper(), new object[0]); break; case SupplyType.Shard: { EquipmentVO currentEquipmentDataByID = ArmoryUtils.GetCurrentEquipmentDataByID(rewardUid); if (currentEquipmentDataByID != null) { text = lang.Get(currentEquipmentDataByID.EquipmentName, new object[0]); } break; } case SupplyType.Troop: case SupplyType.Hero: { TroopTypeVO optional = dataController.GetOptional <TroopTypeVO>(rewardUid); if (optional != null) { text = LangUtils.GetTroopDisplayName(optional); } break; } case SupplyType.SpecialAttack: { SpecialAttackTypeVO optional2 = dataController.GetOptional <SpecialAttackTypeVO>(rewardUid); if (optional2 != null) { text = LangUtils.GetStarshipDisplayName(optional2); } break; } case SupplyType.ShardTroop: { ShardVO optional3 = dataController.GetOptional <ShardVO>(rewardUid); if (optional3 != null) { text = LangUtils.GetTroopDisplayNameFromTroopID(optional3.TargetGroupId); } break; } case SupplyType.ShardSpecialAttack: { ShardVO optional4 = dataController.GetOptional <ShardVO>(rewardUid); if (optional4 != null) { text = LangUtils.GetStarshipDisplayNameFromAttackID(optional4.TargetGroupId); } break; } } if (string.IsNullOrEmpty(text)) { Service.Get <StaRTSLogger>().ErrorFormat("CrateSupplyVO Uid:{0}, Cannot find reward for RewardUid:{1}, Type:{2}", new object[] { supplyData.Uid, rewardUid, type }); } return(text); }
public static int cost(this SupplyType type) { return(10); }
public Data(Instant update, SupplyType type, ushort nameIndex, Flow flowRate) : this((uint)update.ToUnixTimeSeconds(), (byte)type, nameIndex, (uint)(flowRate.CubicMetersPerHour * 24.0)) { }