public List <BattleVariant> GetBattleVariants(BattleType battleType = BattleType.Any) { System.Random rnd = new System.Random(); List <BattleVariant> selectedVariants = new List <BattleVariant>(); List <BattleVariant> rightTypeVariants = new List <BattleVariant>(); List <BattleVariant> allVariants = new List <BattleVariant>(battleVariants); if (battleType != BattleType.Any) { foreach (BattleVariant battleVariant in allVariants) { if (battleVariant.battleType == battleType) { rightTypeVariants.Add(battleVariant); } } } else { rightTypeVariants = allVariants; } int variantNum; while (selectedVariants.Count < 3) { variantNum = rnd.Next(rightTypeVariants.Count); selectedVariants.Add(rightTypeVariants[variantNum]); rightTypeVariants.RemoveAt(variantNum); } return(selectedVariants); }
public void SetStage(BattleType type) { _stageCategory = StageCategory.BATTLE; SetIcon(_battleIcon); switch (type) { case BattleType.EASY_BATTLE: _background.sprite = _easyNode; break; case BattleType.MEDIUM_BATTLE: _background.sprite = _mediumNode; break; case BattleType.HARD_BATTLE: _background.sprite = _hardNode; break; case BattleType.BOSS: _background.sprite = _hardNode; break; default: Debug.LogWarning("BattleType " + type + " unrecognized"); break; } }
// TODO : complete public Battle(BattleType type) { Type = type; Phase = BattlePhase.Init; RoundTimeSeconds = -1; RewardForIdolKill = 10; }
public void ProcessAgentOnBuild(IAgent agent, BattleType battleType) { if (_allowedBearerTypes.Contains(agent.Character)) { if (battleType == BattleType.FieldBattle) { ProcessAgent(agent); } else if (_settings.AllowSieges && battleType == BattleType.Siege) { if ((_settings.SiegeAttackersUseBanners && agent.IsAttacker) || (_settings.SiegeDefendersUseBanners && agent.IsDefender)) { ProcessAgent(agent); } } else if (_settings.AllowHideouts && battleType == BattleType.Hideout) { if ((_settings.HideoutAttackersUseBanners && agent.IsAttacker) || (_settings.HideoutBanditsUseBanners && agent.IsDefender)) { ProcessAgent(agent); } } } }
internal OnboardPokemon(Pokemon pokemon, int x) { this.pokemon = pokemon; conditions = new ConditionsDictionary(); Owner = pokemon.Owner; Type1 = pokemon.PokemonType.Type1; Type2 = pokemon.PokemonType.Type2; Gender = pokemon.Gender; Ability = pokemon.Ability; Base = new SixD(pokemon.Base); Iv = new SixD(pokemon.Iv); Ev = new SixD(pokemon.Ev); Static = new SixD(pokemon.Static); Lv5D = new SixD(); Moves = new Move[4] { pokemon.Moves[0], pokemon.Moves[1], pokemon.Moves[2], pokemon.Moves[3] }; Position = new Position(pokemon.TeamId,x); //幻影new完后覆盖属性 Outward = new PokemonOutward(this, pokemon.Hp); Outward.Name = pokemon.Name; Outward.Gender = Gender; Outward.ImageId = pokemon.PokemonType.Id; }
private void InitializeStage(ZoneProperties properties, int stageCol, StageNode stage, StageCategory category) { switch (category) { case StageCategory.BATTLE: BattleType battleType = (BattleType)Random.Range(0, System.Enum.GetValues(typeof(BattleType)).Length - 1); stage.SetStage(battleType); InitializeCombatStage(properties, stageCol, stage, battleType); break; case StageCategory.BOSS: stage.SetStage(BattleType.BOSS); InitializeCombatStage(properties, stageCol, stage, BattleType.BOSS); break; case StageCategory.EVENT: EventType eventType = (EventType)Random.Range(0, System.Enum.GetValues(typeof(EventType)).Length); stage.SetStage(eventType); break; default: Debug.LogWarning("No category found when initializing stage."); break; } }
public static void AI_1v1() { Network.Player_tank = UnityEngine.Random.Range(3, 5); Network.Ai_tank = UnityEngine.Random.Range(3, 5); Network.InitRound(); Network.gamemode = BattleType.AI_1v1; }
public int CreateVoterPass(BattleType BattleType, int BattleId, ProcessPaymentResult PaymentResponse, CustomerPaymentMethod PaymentMethod, decimal Amount) { //first we'll create an order, let's first get the associated product for voter pass var voterPassProduct = GetVoterPassProduct(BattleType); //place an order on user's behalf var order = new Order() { CreatedOnUtc = DateTime.UtcNow, CustomerId = _workContext.CurrentCustomer.Id, StoreId = _storeContext.CurrentStore.Id, BillingAddress = _workContext.CurrentCustomer.Addresses.First(), ShippingAddress = _workContext.CurrentCustomer.Addresses.First(), AuthorizationTransactionCode = PaymentResponse.AuthorizationTransactionCode, AuthorizationTransactionId = PaymentResponse.AuthorizationTransactionId, AuthorizationTransactionResult = PaymentResponse.AuthorizationTransactionResult, CustomerIp = _webHelper.GetCurrentIpAddress(), OrderStatus = OrderStatus.Complete, PaymentStatus = PaymentResponse.NewPaymentStatus, ShippingStatus = ShippingStatus.ShippingNotRequired, PaymentMethodSystemName = "MobSocial.Payments." + PaymentMethod.PaymentMethod.ToString(), OrderTotal = Amount, OrderSubtotalExclTax = Amount, OrderSubTotalDiscountInclTax = Amount, OrderGuid = Guid.NewGuid(), CustomerCurrencyCode = _workContext.WorkingCurrency.CurrencyCode, CurrencyRate = _workContext.WorkingCurrency.Rate }; var orderItem = new OrderItem() { OrderItemGuid = Guid.NewGuid(), ProductId = voterPassProduct.Id, UnitPriceExclTax = Amount, UnitPriceInclTax = Amount, PriceInclTax = Amount, PriceExclTax = Amount, Quantity = 1 }; order.OrderItems.Add(orderItem); //save the order now _orderService.InsertOrder(order); //now add this voter pass for future reference var voterPass = new VoterPass() { BattleId = BattleId, BattleType = BattleType, CustomerId = _workContext.CurrentCustomer.Id, DateCreated = DateTime.UtcNow, DateUpdated = DateTime.UtcNow, Status = PassStatus.NotUsed, VoterPassOrderId = order.Id }; //save this pass details this.Insert(voterPass); return(order.Id); }
public Battleground CreateBattle(List <EAccount> userList, BattleType battleType) { lock (BattlegroundPoolLock) { Battleground bg = new Model.Battleground(1, 1); BattlegroundPool.Add(bg); int sideOrder = 1; foreach (var m in userList) { OneSide oneSide = new OneSide() { AccountID = m.ID.ToString(), NickName = m.NickName, Face = m.Face, Step = BattleCommand.JoinBattle, Order = sideOrder++ }; bg.Battle.Sides.Add(oneSide); } bg.NoticeJoinBattle(); bg.Battle.BattleType = battleType; return(bg); } }
public void OnGameTypeChange(BattleType gameType) { MapSearchResults.Clear(); switch (gameType) { case BattleType.Field: IsCurrentMapSiege = false; _availableMaps = _battleMaps; break; case BattleType.Siege: IsCurrentMapSiege = true; _availableMaps = _siegeMaps; break; case BattleType.Village: IsCurrentMapSiege = false; _availableMaps = _villageMaps; break; } foreach (MapItemVM availableMap in _availableMaps) { MapSearchResults.Add(availableMap); } _searchText = new TextObject("{=7i1vmgQ9}Select a Map").ToString(); OnPropertyChanged(nameof(SearchText)); }
private static void HandlePingLobbyFeedback(byte[] data) { PingLobbyS2C feedback = ProtobufUtils.Deserialize <PingLobbyS2C>(data); if (feedback.result) { if (isDisconnect) { isDisconnect = false; MatchC2S message = new MatchC2S(); BattleType bType = DataManager.GetInstance().GetBattleType(); if (bType == BattleType.BattleP1vsP1) { message.matchType = MatchType.P1vsP1; } if (bType == BattleType.BattleP2vsP2) { message.matchType = MatchType.P2vsP2; } else { message.matchType = MatchType.Peace; } message.playerName = DataManager.GetInstance().GetPlayerNickName(); message.type = MatchClientMessageType.Applying; byte[] data1 = ProtobufUtils.Serialize(message); NetworkManager.SendRequest(MsgCode.MatchMessage, data1); } } }
private void StartBattle() { int selectedBattle = Random.Range(0, potentialBattles.Length); BattleType battle = potentialBattles[selectedBattle]; BattleManager.instance.battleExp = battle.rewardExp; BattleManager.instance.battleGold = battle.rewardGold; BattleManager.instance.battleRewards = battle.rewardItems; BattleManager.instance.battleRewardNumbers = battle.rewardItemNumbers; BattleManager.instance.BattleStart(battle.enemies, cannotFlee, isBoss); if (QuestManager.instance.GetQuestNumber(questToComplete) > 0) { BattleReward.instance.markQuestComplete = shouldCompleteQuest; BattleReward.instance.questToComplete = questToComplete; } else { BattleReward.instance.markQuestComplete = shouldCompleteQuest; } BattleReward.instance.shouldAddQuest = shouldAddQuest; BattleReward.instance.questToAdd = questToAdd; if (deactivateAfterStarting) { StartCoroutine(DelayedDeactivate()); } }
private static void AttackedUpItem(DefContext def, BattleType type, StatType stat) { if (def.AtkContext.Type == type) { ITs.ChangeLv5D(def.Defender, stat, 1); } }
public Battle(DateTime startDate, DateTime endDate, BattleType battleType, int budget) { StartDate = startDate; EndDate = endDate; BattleTypeEnum = battleType; Budget = budget; }
public MenuParamGameLocal(PlayerType playerType, BattleType battleType) { InitializeComponent(); if (playerType == PlayerType.Human) { player1 = new PlayerName(); } else { player1 = new PlayerAI(); } player1.Width = 200; player1.Height = 200; player1.SetValue(Grid.RowProperty, 1); player1.SetValue(Grid.ColumnProperty, 0); MainGrid.Children.Add(player1); if (battleType == BattleType.AgainstPlayer) { player2 = new PlayerName(); } else { player2 = new PlayerAI(); } player2.Width = 200; player2.Height = 200; player2.SetValue(Grid.RowProperty, 1); player2.SetValue(Grid.ColumnProperty, 1); MainGrid.Children.Add(player2); }
public bool JudgeHeroSaturation() { bool result = false; int num = 0; for (int i = 0; i < this.select_heros.Count; i++) { if (this.select_heros[i] != string.Empty && !string.IsNullOrEmpty(this.select_heros[i])) { num++; } } BattleType battleType = this.battle_type; if (battleType != BattleType.DLD) { if (num >= 3) { result = true; } } else if (num >= 5) { result = true; } return(result); }
public void Reset() { battlers.Clear(); dataList.Clear(); if (frames != null) { frames.Clear(); } simulateBattle = false; battleType = BattleType.NoBattle; side = MatchSide.NoSide; forceMark = ForceMark.NoneForce; id = 0; frame = 0; killUnitCount = 0; fatality = 0; mvpValue = 0; resources = 0; institeLv = 0; pveWaveNumber = 0; pveIsVictory = false; simulateBattle = false; battleDuration = 0; }
public void SetupHeader(BattleMode battleMode, BattleType matchMakingModeType, TeamBattleResult resultType, string mapName, int selfUserPlace) { this.title.color = this.titleColors[(int)resultType]; if (battleMode == BattleMode.DM) { this.title.text = string.Format((string)this.placeLocalizedField, selfUserPlace); } else if (resultType == TeamBattleResult.WIN) { this.title.text = this.winLocalizedField.Value; } else if (resultType == TeamBattleResult.DEFEAT) { this.title.text = this.defeatLocalizedField.Value; } else if (resultType == TeamBattleResult.DRAW) { this.title.text = this.drawLocalizedField.Value; } string str = string.Empty; if (matchMakingModeType == BattleType.ARCADE) { str = this.arcadeLocalizedField.Value; } else if (matchMakingModeType == BattleType.ENERGY) { str = this.energyLocalizedField.Value; } else if (matchMakingModeType == BattleType.RATING) { str = this.ratingLocalizedField.Value; } this.subTitle.text = $"{str}({battleMode}), {mapName}"; }
public override int GetHashCode() { int hash = 1; if (State != 0) { hash ^= State.GetHashCode(); } if (BattleType != 0) { hash ^= BattleType.GetHashCode(); } if (ServerMs != 0L) { hash ^= ServerMs.GetHashCode(); } hash ^= battleActions_.GetHashCode(); if (BattleStartTimestampMs != 0L) { hash ^= BattleStartTimestampMs.GetHashCode(); } if (BattleEndTimestampMs != 0L) { hash ^= BattleEndTimestampMs.GetHashCode(); } return(hash); }
private void Awake() { controler = new NewbieGuideController(this); aniTran = transform.Find("Ani"); markImage = aniTran.Find("MarkImage").GetComponent <Image>(); transparentImage = aniTran.Find("TransparentImage").GetComponent <Image>(); transparentImage.gameObject.SetActive(false); showImage = aniTran.Find("ShowImage").GetComponent <Image>(); circleImage = aniTran.Find("CircleImage").GetComponent <Button>(); circleImage.GetComponent <PassEventHadler>().OnButtonClick = OncirCleImageClick; circleImage.GetComponent <PassEventHadler>().OnBeginDragEvent = OnCircleBeginDrag; //circleImage.GetComponent<PassEventHadler>().OnButtonDrag = OnCircleImageDrag; passEventHadler = circleImage.GetComponent <PassEventHadler>(); arrowImage = aniTran.Find("ArrowImage").GetComponent <Image>(); targetImage = aniTran.Find("TargetImage").GetComponent <Image>(); handImage = aniTran.Find("HandImage").GetComponent <Image>(); //BigTextureRoot bigTextureRoot = aniTran.Find("BigTextureRoot"); bigTextureBg = bigTextureRoot.GetComponent <Button>(); bigTexture0 = bigTextureRoot.Find("Image0").GetComponent <Image>(); bigTexture1 = bigTextureRoot.Find("Image1").GetComponent <Image>(); titleImages[0] = bigTextureRoot.Find("TitleImages/Image1").GetComponent <Image>(); titleImages[1] = bigTextureRoot.Find("TitleImages/Image2").GetComponent <Image>(); titleImages[2] = bigTextureRoot.Find("TitleImages/Image3").GetComponent <Image>(); titleImages[3] = bigTextureRoot.Find("TitleImages/Image4").GetComponent <Image>(); titleImages[4] = bigTextureRoot.Find("TitleImages/Image5").GetComponent <Image>(); moveToPos = bigTextureRoot.Find("MoveToPos"); bigTextureBg.AddListener(OnClickBackground); bigTextureRoot.gameObject.SetActive(false); battleType = controler.GetBattleType(); }
//Default minimap icon element pool,If need more chache can modify numbers. private void InitMiniMapElement(BattleType type) { resourceLoad = GameResourceLoadManager.GetInstance(); if (type == BattleType.BattleP2vsP2) { FillSoldierElementIconPool(32); FillTowerElementIconPool(20); FillInstituteElementIconPool(4); FillEffectItemPool(8); FillRuneElementIconPool(2); } else if (type == BattleType.BattleP1vsP1 || type == BattleType.Tranining || type == BattleType.Tutorial) { FillSoldierElementIconPool(16); FillTowerElementIconPool(10); FillInstituteElementIconPool(2); FillEffectItemPool(4); FillRuneElementIconPool(2); } else if (type == BattleType.Survival) { FillSoldierElementIconPool(20); FillTowerElementIconPool(5); FillInstituteElementIconPool(1); FillEffectItemPool(4); FillRuneElementIconPool(2); } else { DebugUtils.LogError(DebugUtils.Type.MiniMap, string.Format("Can't find this BattleType : {0}", type)); } }
/// <summary> /// 通过指定的机器人,创建一个机器人队伍 /// </summary> public Team(Player p1, Player p2, Player p3) { lock (plock) { if (p1.IsRobort() && p2.IsRobort() && p3.IsRobort()) { Interlocked.Increment(ref numCreateTeam); nTeamIndex = numCreateTeam; Leader = p1; szName = "三个火枪手"; szPassword = null; nMaxMemberCount = 3; cdicMembers.TryAdd(0, p1); cdicMembers.TryAdd(1, p2); cdicMembers.TryAdd(2, p3); NTeamState = TeamState.Normal; nFlag = (int)TeamFlag.IsRobot; //InitSeat(); // 目前比赛只有对抗一种,之后加 [12/2/2011 test] nBattleType = BattleType.Opposition; cdicAllTeams.TryAdd(nTeamIndex, this); } nBattleType = BattleType.Opposition; } }
public void GetBattleType(GetBattleTypeEvent e, Node any, [JoinAll] ResultsNode results, [JoinAll] ICollection <SingleNode <TutorialSetupEndgameScreenHandler> > tutorialHandlers) { BattleResultForClient resultForClient = results.battleResults.ResultForClient; BattleResultsAwardsScreenComponent.BattleTypes none = BattleResultsAwardsScreenComponent.BattleTypes.None; if (resultForClient.Custom) { none = BattleResultsAwardsScreenComponent.BattleTypes.Custom; } else if (tutorialHandlers.Count > 0) { foreach (SingleNode <TutorialSetupEndgameScreenHandler> node in tutorialHandlers) { node.component.gameObject.SetActive(false); } none = BattleResultsAwardsScreenComponent.BattleTypes.Tutorial; } else { BattleType matchMakingModeType = resultForClient.MatchMakingModeType; if (matchMakingModeType == BattleType.ENERGY) { none = BattleResultsAwardsScreenComponent.BattleTypes.Quick; } else if (matchMakingModeType == BattleType.ARCADE) { none = BattleResultsAwardsScreenComponent.BattleTypes.Arcade; } else if (matchMakingModeType == BattleType.RATING) { none = !e.WithCashback ? BattleResultsAwardsScreenComponent.BattleTypes.Ranked : BattleResultsAwardsScreenComponent.BattleTypes.RankedWithCashback; } } e.BattleType = none; }
public static void AddWarBuffs(BattleType battleType, List <string> attackerBuffs, List <string> defenderBuffs) { BuffController buffController = Service.BuffController; buffController.ClearWarBuffs(); if (battleType != BattleType.PvpAttackSquadWar && battleType != BattleType.PveBuffBase) { return; } StaticDataController staticDataController = Service.StaticDataController; if (attackerBuffs != null) { int i = 0; int count = attackerBuffs.Count; while (i < count) { WarBuffVO warBuff = staticDataController.Get <WarBuffVO>(attackerBuffs[i]); buffController.AddAttackerWarBuff(warBuff); i++; } } if (battleType != BattleType.PveBuffBase && defenderBuffs != null) { int j = 0; int count2 = defenderBuffs.Count; while (j < count2) { WarBuffVO warBuff2 = staticDataController.Get <WarBuffVO>(defenderBuffs[j]); buffController.AddDefenderWarBuff(warBuff2); j++; } } }
public static IEnumerable<int> SelectMinions(BattleType type) { bool day = false, night = false, special = false; switch (type) { case BattleType.Day: day = true; break; case BattleType.Night: night = true; break; case BattleType.Special: special = true; break; } var ret = new List<int>(); for (var i = 0; i < BossTimer.minionSpawnCount; i++) { if (day) ret.AddCheck(AutoBoss.config.DayMinionList[R.Next(0, AutoBoss.config.DayMinionList.Count)]); if (night) ret.AddCheck(AutoBoss.config.NightMinionList[R.Next(0, AutoBoss.config.NightMinionList.Count)]); if (special) ret.AddCheck(AutoBoss.config.SpecialMinionList[R.Next(0, AutoBoss.config.SpecialMinionList.Count)]); } return ret; }
public BattleInfo(BattleType battleType, Party party1, Party party2) { _BattleType = battleType; _ParticipatingParties = new List<Party>(); _ParticipatingParties.Add(party1); _ParticipatingParties.Add(party2); }
public IHttpActionResult ProductPrizesFormPopup(int battleId, BattleType battleType) { //check if current user is already a sponsor, he should then be doing everything from sponsor dashboard only if (_sponsorService.GetSponsors(ApplicationContext.Current.CurrentUser.Id, battleId, battleType, null).Any()) { return(null); } var allPrizes = _videoBattlePrizeService.GetBattlePrizes(battleId); var totalWinningPositions = allPrizes.Count(x => !x.IsSponsored); var model = new List <VideoBattlePrizeModel>(); for (var index = 1; index <= totalWinningPositions; index++) { model.Add(new VideoBattlePrizeModel() { WinnerPosition = index, PrizeType = BattlePrizeType.Other, IsSponsored = true, PrizeOther = "", SponsorCustomerId = ApplicationContext.Current.CurrentUser.Id, VideoBattleId = battleId }); } return(Json(model)); }
/// <summary> /// Assign player and handle their orders /// <para/>Call either Init or Load afterward /// </summary> /// <param name="black"></param> /// <param name="white"></param> public GameHandler(OthelloPlayerServer black, OthelloPlayerServer white) { // Init Client 1 OthelloPlayer1 = black; // Init Client 2 OthelloPlayer2 = white; // Update handler OthelloPlayer1.SetOrderHandler(this); OthelloPlayer2.SetOrderHandler(this); if (OthelloPlayer1.PlayerType == PlayerType.Human & OthelloPlayer2.PlayerType == PlayerType.Human) { BattleType = BattleType.AgainstPlayer; } else { BattleType = BattleType.AgainstAI; } // TODO SEGAN (NiceToHave) : Ping clients to detect disconnect // Start to ping clients // pinger.Start(); }
private void InitPVEMode(BattleType type) { if (type == BattleType.Survival) { this.gameObject.AddComponent <LocalBattleMessageManager>(); endlessModeManager = new EndlessModeManager(); endlessModeManager.SetMapData(mapDataPVE); endlessModeManager.SetLogicWorld(logicWorld); endlessModeManager.InitEndlessMode(); } else if (type == BattleType.Tranining) { this.gameObject.AddComponent <LocalBattleMessageManager>(); trainingModeManager = new TrainingModeManager(); trainingModeManager.SetMapData(mapDataPVE); trainingModeManager.SetLogicWorld(logicWorld); trainingModeManager.InitTrainingMode(); } else if (type == BattleType.Tutorial) { //TODO: there need add tutorial manager, Dwayne. this.gameObject.AddComponent <LocalBattleMessageManager>(); tutorialModeManager = new TutorialModeManager(); tutorialModeManager.SetTutorialStage(dataManager.GetTutorialStage()); mapData1V1.SetTutorialPathPointPosition(); tutorialModeManager.SetMapData(mapData1V1); //Temp mapdata if have tutorial mapdata change this. tutorialModeManager.SetLogicworld(logicWorld); tutorialModeManager.SetMainCamera(this.mainCamera); tutorialModeManager.InitTutorialMode(); } else { DebugUtils.LogError(DebugUtils.Type.Data, "We just have two PVE Mode, Can not find this mode : " + type); } }
// Token: 0x06004A85 RID: 19077 RVA: 0x00174678 File Offset: 0x00172878 public void SetProcessingBattleInfo(BattleType type, int typeId) { this.ProcessingBattleInfo.Type = type; this.ProcessingBattleInfo.TypeId = typeId; this.ProcessingBattleInfo.Params.Clear(); base.SetDirty(true); }
private void GetEffects(ForceMark mark) { BattleType type = DataManager.GetInstance().GetBattleType(); if (type != BattleType.Survival && type != BattleType.Tranining) { if (mark == ForceMark.TopRedForce || mark == ForceMark.BottomRedForce) { buildEffect = transform.Find(string.Format("redbase_operation_1")).gameObject; finishEffect = transform.Find(string.Format("redbase_operation_2")).gameObject; deathEffect = transform.Find(string.Format("redbase_death")).gameObject; crystal = transform.Find("RedBase_crystal").gameObject; } else if (mark == ForceMark.TopBlueForce || mark == ForceMark.BottomBlueForce) { buildEffect = transform.Find(string.Format("bluebase_operation_1")).gameObject; finishEffect = transform.Find(string.Format("bluebase_operation_2")).gameObject; deathEffect = transform.Find(string.Format("bluebase_death")).gameObject; crystal = transform.Find("BlueBase_crystal").gameObject; } else { DebugUtils.LogError(DebugUtils.Type.Building, string.Format("Can't find this type side {0}", mark)); } } }
public static void SetMapEvents(PartyBase attacker, PartyBase defender, BattleType battleType) { try { var mapEvent = attacker.MapEvent; if (mapEvent != null) { mapEvent.FinalizeEvent(); MBObjectManager.Instance.UnregisterObject(mapEvent); var mapEvents = (List <MapEvent>) typeof(MapEventManager) .GetField("mapEvents", BindingFlags.Instance | BindingFlags.NonPublic) ?.GetValue(Campaign.Current.MapEventManager); if (mapEvents != null) { var index = mapEvents.FindIndex(m => m == mapEvent); if (index >= 0 && index < mapEvents.Count) { mapEvents.RemoveAt(index); } } } Campaign.Current.MapEventManager.StartBattleMapEvent(attacker, defender); } catch (Exception e) { DisplayMessage(e.ToString()); } }
/// <summary> /// 通过玩家的创建信息,创建一个队伍 /// </summary> public Team(PlayerCreateTeam stCreateTeam) { lock (plock) { Interlocked.Increment(ref numCreateTeam); nTeamIndex = numCreateTeam; Leader = Player.AllPlayerList[stCreateTeam.nPlayerID]; szName = stCreateTeam.szName; if (stCreateTeam.nPasswordLenth > 0) { szPassword = stCreateTeam.szPassword; } else { szPassword = null; } // 目前比赛只有对抗一种,之后加 [12/2/2011 test] nBattleType = (BattleType)stCreateTeam.nBattleType; nMaxMemberCount = stCreateTeam.nMemberCount; //入队操作由player.JoinTeam完成 NTeamState = TeamState.Normal; nFlag = 0; //InitSeat(); cdicAllTeams.TryAdd(nTeamIndex, this); } }
private void OpenFreindAlert(object freindId, object battleType, object friendName, object friendPortrait) { long id = ( long )freindId; BattleType type = ( BattleType )battleType; string name = friendName.ToString(); string portrait = friendPortrait.ToString(); if (friendInvationAlertUI == null) { //show FriendInvationAlert UI ,post MessageType: OpenFriendInvationAlert GameResourceLoadManager.GetInstance().LoadAssetAsync("FriendInvationAlertUI", delegate(GameObject data) { GameObject obj = Instantiate(data) as GameObject; friendInvationAlertUI = obj.AddComponent <FriendInvationAlertView>(); ChangeUIViewDepthBySetParent(friendInvationAlertUI.gameObject.transform, UIMenuDepth.Alert); obj.transform.localPosition = Vector3.zero; obj.transform.localScale = Vector3.one; RectTransform rectTrans = obj.GetComponent <RectTransform>(); rectTrans.sizeDelta = Vector2.zero; friendInvationAlertUI.OnEnterAlert(id, type, name, portrait); }); } else { friendInvationAlertUI.gameObject.SetActive(true); friendInvationAlertUI.OnEnterAlert(id, type, name, portrait); } }
public void SetBattleType(BattleType type) { currentBattleType = type; DataManager dataManager = DataManager.GetInstance(); dataManager.SetBattleType(type, false); }
public Map(string _id, string _name = "", string _originalFilename = "", string _hdFilename = "", MapIcon[] presets = null) { this.id = _id; this.name = _name; this.originalFilename = _originalFilename; this.hdFilename = _hdFilename; iconsSize = 50; this.presets = presets; _type = BattleType.Undefined; _variation = ""; }
public long CreateBattle(DateTime startDate, DateTime endDate, BattleType battleType, int budget) { using (var unitOfWorkScope = _unitOfWorkScopeFactory.Create()) { var battle = new Battle(startDate, endDate, battleType, budget); _repositoryOfBattle.Add(battle); unitOfWorkScope.SaveChanges(); return battle.Id; } }
public IHttpActionResult ProductPrizesFormPopup(int battleId, BattleType battleType) { //check if current user is already a sponsor, he should then be doing everything from sponsor dashboard only if (_sponsorService.GetSponsors(ApplicationContext.Current.CurrentUser.Id, battleId, battleType, null).Any()) { return null; } var allPrizes = _videoBattlePrizeService.GetBattlePrizes(battleId); var totalWinningPositions = allPrizes.Count(x => !x.IsSponsored); var model = new List<VideoBattlePrizeModel>(); for (var index = 1; index <= totalWinningPositions; index++) { model.Add(new VideoBattlePrizeModel() { WinnerPosition = index, PrizeType = BattlePrizeType.Other, IsSponsored = true, PrizeOther = "", SponsorCustomerId = ApplicationContext.Current.CurrentUser.Id, VideoBattleId = battleId }); } return Json(model); }
public void setBattleType(BattleType type, string variation) { map.Battletype = type; map.Variation = variation; }
public void setBattletype(BattleType type = BattleType.Undefined, string variant = "") { switch (type) { case BattleType.Undefined: menuBattletypeNormal.IsChecked = menuBattletypeEncounter.IsChecked = menuBattletypeAssault.IsChecked = false; menuBattletypeNone.IsChecked = true; break; case BattleType.Normal: menuBattletypeNone.IsChecked = menuBattletypeEncounter.IsChecked = menuBattletypeAssault.IsChecked = false; menuBattletypeNormal.IsChecked = true; break; case BattleType.Encounter: menuBattletypeNone.IsChecked = menuBattletypeNormal.IsChecked = menuBattletypeAssault.IsChecked = false; menuBattletypeEncounter.IsChecked = true; break; case BattleType.Assault: menuBattletypeNone.IsChecked = menuBattletypeNormal.IsChecked = menuBattletypeEncounter.IsChecked = false; menuBattletypeAssault.IsChecked = true; break; } switch (variant) { case "A": menuBattleVariantB.IsChecked = false; menuBattleVariantA.IsChecked = true; break; case "B": menuBattleVariantA.IsChecked = false; menuBattleVariantB.IsChecked = true; break; } refreshStaticMap(); }
public TimerObj(int c, BattleType t) { count = c; type = t; }
public BattleSource(BattleType battleType) { this.battleType = battleType; this.fighterProp = new List<FighterInfo>(); this.props = new PropertyRawSet(); }
public virtual void setMap(string id, BattleType type = BattleType.Undefined, string variation = "") { this.map = maps.getMap(id); this.map.Battletype = type; this.map.Variation = variation; }
public static void StartBossBattle(BattleType type) { var bossLists = new List<Dictionary<int, int>>(); switch (type) { case BattleType.Day: bossLists = AutoBoss.config.DayBosses.Values.ToList(); break; case BattleType.Night: bossLists = AutoBoss.config.NightBosses.Values.ToList(); break; case BattleType.Special: bossLists = AutoBoss.config.SpecialBosses.Values.ToList(); break; } var bosses = bossLists[R.Next(0, bossLists.Count)]; AutoBoss.bossList.Clear(); AutoBoss.bossCounts.Clear(); //bossPair.Key = npc type. bossPair.Value = amount of npc to spawn foreach (var bossPair in bosses) { var npc = TShock.Utils.GetNPCById(bossPair.Key); AutoBoss.bossCounts.Add(npc.name, bossPair.Value); for (var i = 0; i < bossPair.Value; i++) { foreach (var region in AutoBoss.ActiveArenas) { var arenaX = region.Area.X + (region.Area.Width/2); var arenaY = region.Area.Y + (region.Area.Height/2); int spawnTileX; int spawnTileY; TShock.Utils.GetRandomClearTileWithInRange(arenaX, arenaY, 50, 20, out spawnTileX, out spawnTileY); var npcid = NPC.NewNPC(spawnTileX*16, spawnTileY*16, bossPair.Key); // This is for special slimes Main.npc[npcid].SetDefaults(npc.name); AutoBoss.bossList.Add(npcid, bossPair.Key); } } } var broadcast = //format: {0}x {1} where {0} is number of npc to spawn times number of arenas and {1} is npc name AutoBoss.bossCounts.Select(kvp => string.Format("{0}x {1}", kvp.Value*AutoBoss.ActiveArenas.Count, kvp.Key)).ToList(); TShock.Utils.Broadcast("Bosses selected: " + string.Join(", ", broadcast), Color.Crimson); if (AutoBoss.config.MinionToggles[type]) { BossTimer.minionTime = R.Next(AutoBoss.config.MinionsSpawnTimer[0], AutoBoss.config.MinionsSpawnTimer[1] + 1); BossTimer.minionSpawnCount = R.Next(AutoBoss.config.MinionSpawnCount[0], AutoBoss.config.MinionSpawnCount[1] + 1); StartMinionSpawns(SelectMinions(type)); } }
public void setBattleType(BattleType type, string variation) { if (isLoaded()) { tactic.setBattleType(type, variation); mainwindow.setBattletype(type, variation); } }
public void InitHPBar(int max, BattleType type) { GameObject bar = Instantiate(Resources.Load(GlobalDataStructure.PATH_UIPREFAB_BATTLE + "HPBar")) as GameObject; bar.transform.SetParent(this.transform, false); HPBar = bar.GetComponent<Slider>(); HPBar.maxValue = max; HPBar.value = max; HPText = bar.GetComponentInChildren<Text>(); HPText.text = HPBar.value + "/" + HPBar.maxValue; Color hpColor = Color.green; if(type == BattleType.Physical) hpColor = Color.red; else if(type == BattleType.Magical) hpColor = Color.blue; HPBar.transform.FindChild("Fill Area").GetComponentInChildren<Image>().color = hpColor; }
public void InitEnemyHPBar(int max, BattleType type) { GameObject bar = Instantiate(Resources.Load(GlobalDataStructure.PATH_UIPREFAB_BATTLE + "EnemyHPBar")) as GameObject; bar.transform.SetParent(this.transform, false); bar.transform.localPosition = new Vector3(0, shadowImage.rectTransform.sizeDelta.y / 2, 0); ((RectTransform)bar.transform).sizeDelta = new Vector2 (shadowImage.rectTransform.sizeDelta.x / 2, 32); HPBar = bar.GetComponent<Slider>(); HPBar.maxValue = max; HPBar.value = max; HPText = bar.GetComponentInChildren<Text>(); HPText.gameObject.SetActive(false); HPText.text = HPBar.value + "/" + HPBar.maxValue; Color hpColor = Color.green; if(type == BattleType.Physical) hpColor = Color.red; else if(type == BattleType.Magical) hpColor = Color.blue; HPBar.transform.FindChild("Fill Area").GetComponentInChildren<Image>().color = hpColor; }
public void setBattleType(BattleType type, string variant) { object[] data = new object[2]; data[0] = type; data[1] = variant; NetPackage pack = new NetPackage(NetPackageTypes.SetBattletype, nick, data); adapter.send(pack); }
public MapIcon(StaticIcon icon, BattleType battle = BattleType.Normal, string variation = "") { this.icon = icon; this.battle = battle; this.variation = variation; }
/// <summary> /// get a Iv set eligible for the specified Hidden Power type /// </summary> public static byte[] GetHiddenPowerIvSet(BattleType type) { Contract.Requires(type != BattleType.Invalid && type != BattleType.Normal); return IvSet[(int)type - 1]; }
public void Battle(DateTime startDate, DateTime endDate, BattleType battleType, double budget) { _repositoryOfBattle.All().Where(b => b.StartDate == startDate && b.EndDate == endDate && b.BattleType == (sbyte)battleType && b.Budget == budget).Single(); }
void startBattle(BattleType type) { _BattleData._BattleType = type; _BattleData._InitialPlayer = _GameStateHolder._ActivePlayer; tearDownScene(); Audio.AudioInstance.PlaySFX(SoundEffect.Play_Game); StartCoroutine(SceneSwitcher.ChangeScene(_BattleScene)); }