Exemplo n.º 1
0
		public PhaseShelling( BattleData data, int phaseID, string suffix, bool isEscort )
			: base( data ) {

			this.phaseID = phaseID;
			this.suffix = suffix;
			this.isEscort = isEscort;
		}
        internal override void ProcessDay(BattleData rpBattle)
        {
            var rCount = rpBattle.DayBattle.EnemyStatus.Count(r => r.DamageStatus == ShipDamageStatus.Sink && TargetType.Contains(r.ShipInfo.Info.Type));

            Current += rCount;
            Quest.Progresses[r_ID].Current += rCount;
        }
Exemplo n.º 3
0
        public BattlePart(BattleData rpOwner, BattlePartType rpType)
        {
            Owner = rpOwner;
            Type = rpType;

            IsInitializing = true;
        }
        internal void Process(BattleData rpBattle)
        {
            if (rpBattle.QuestCounter.Contains(ID) || NeedWin && rpBattle.Rank < BattleRank.B)
                return;

            Current++;
            rpBattle.QuestCounter.Add(ID);
        }
        internal virtual void Process(BattleData rpBattle)
        {
            if (!rpBattle.IsBossBattle) return;

            if (MapIDs.Contains(rpBattle.MapID) && rpBattle.Rank >= LowestRank && !rpBattle.QuestCounter.Contains(ID))
            {
                Current++;
                rpBattle.QuestCounter.Add(ID);
            }
        }
Exemplo n.º 6
0
	// 添加一个事件UI项
	public void AddEvent(BattleData data)
	{
		GameObject itemEventObj = NGUITools.AddChild(scrEvents.gameObject, tplEvent.gameObject);
		 
		itemEventObj.SetActive(true);
		ItemEvent itemEvent = itemEventObj.GetComponent<ItemEvent>();
		itemEvent.Data = data;
		itemEvent.transform.parent = scrEvents.transform;

		scrEvents.ResetPosition();
		scrEvents.UpdatePosition();
		scrEvents.GetComponent<UIGrid>().Reposition();
	}
        internal override void ProcessNight(BattleData rpBattle)
        {
            var rProgress = Current;
            var rProgress2 = Quest.Progresses[r_ID].Current;

            var rCount = rpBattle.DayBattle.EnemyStatus.Count(r => r.DamageStatus == ShipDamageStatus.Sink && TargetType.Contains(r.ShipInfo.Info.Type));
            rProgress -= rCount;
            rProgress2 -= rCount;

            rCount = rpBattle.NightBattle.EnemyStatus.Count(r => r.DamageStatus == ShipDamageStatus.Sink && TargetType.Contains(r.ShipInfo.Info.Type));
            rProgress += rCount;
            rProgress2 += rCount;

            Current = rProgress;
            Quest.Progresses[r_ID].Current = rProgress2;
        }
Exemplo n.º 8
0
    public void CreateEnemy(int _enemyID, IRoom _room)
    {
        if (!mEnemySampleDict.ContainsKey(_enemyID))
        {
            Debug.Log("Can't find Enemy ID: " + _enemyID.ToString());
            //找不到時產生1號
            _enemyID = 1;
        }

        var SpawnPoint = _room.RandomEnemySpawnPt();
        if (SpawnPoint == null)
        {
            Debug.Log(string.Format("Room {0} is full of enemy", _room.index.ToString()));
            return;
        }

        var sample = this.mEnemySampleDict[_enemyID];

        var go = sample.InstantiateTo(this.mEnemyRoot);
        var enemy = go.GetComponent<IEnemy>();

        // spawn
        enemy.Swpan(SpawnPoint);
        enemy.currentRoom = 0;

        //load data from table
        string EnemyID = _enemyID.ToString();
        var data = new BattleData();
        data.MaxHP = (long)Data.Enemy[EnemyID].MaxHP * (_room.index + 1);
        data.NowHP = data.MaxHP;
        data.Attack = (long)Data.Enemy[EnemyID].Attack * (_room.index + 1);
        enemy.EnemyData = data;

        //Debug.Log("HP: " + data.MaxHP);
        //Debug.Log("Attack: " + data.Attack);
    }
		public PhaseBaseAirAttack( BattleData data )
			: base( data ) {

			AirAttackUnits = new List<PhaseBaseAirAttackUnit>();

			if ( !IsAvailable )
				return;

			
			int i = 0;
			foreach ( var unit in RawData.api_air_base_attack ) {
				AirAttackUnits.Add( new PhaseBaseAirAttackUnit( data, i ) );
				i++;
			}

		}
Exemplo n.º 10
0
	void Update () {
		// 编辑建筑位置 - 所有可移动位置闪烁
		if(SceneManager.Instance.CurSceneMode == ESceneMode.Player && SceneManager.Instance.SceneComp_Build.MovingBuilding)
		{
			foreach(SensorComp sensor in SensorCompDic.Values)
			{
				if(SceneManager.Instance.CurSceneComp.BuildingCompList.Find(b=>b.Data.SlotID == sensor.SlotId))
				{
					sensor.GetComponentInChildren<Renderer>().enabled = false;
				}
				else
				{
					sensor.GetComponentInChildren<Renderer>().enabled = true;
				}
			}
		}
		else
		{
			foreach(SensorComp sensor in SensorCompDic.Values)
			{
				sensor.GetComponentInChildren<Renderer>().enabled = false;
			}
		}

		// 每帧获取一次点击
		RaycastHit hitResult;
		Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
		int sensorMask = LayerMask.GetMask(new string[]{"sensor"});
		bool hit =  Input.GetMouseButtonDown(0) && Physics.Raycast(ray, out hitResult,1000, sensorMask);
		int hitSlot = -1;
		if(hit)
			hitSlot = hitResult.collider.transform.parent.GetComponent<SensorComp>().SlotId;

		// 编辑模式 - 选择一个建筑
		if(hit && !IsTouchBlocked && SceneManager.Instance.CurSceneMode == ESceneMode.Player && !SceneManager.Instance.CurSceneComp.SelectedBuilding)
		{
			// 记录选中的建筑
			SceneManager.Instance.CurSceneComp.SelectedBuilding = SceneManager.Instance.CurSceneComp.BuildingCompList.Find(b=>b.Data.SlotID==hitSlot);
			UIManager.Instance.WidgetBuildingControl.Show(hitResult.collider.transform);		// 显示建筑操作面板
		}

		// 参观模式 - 选择一个建筑
		if(hit && !IsTouchBlocked && SceneManager.Instance.CurSceneMode == ESceneMode.Visit && !SceneManager.Instance.CurSceneComp.SelectedBuilding)
		{
			SceneManager.Instance.CurSceneComp.SelectedBuilding = SceneManager.Instance.CurSceneComp.BuildingCompList.Find(b=>b.Data.SlotID==hitSlot);
			UIManager.Instance.WidgetBuildingInfo.Show();
		}

		// 编辑模式 - 指定建筑物的新位置
		if(hit && !IsTouchBlocked && SceneManager.Instance.CurSceneMode == ESceneMode.Player && SceneManager.Instance.CurSceneComp.SelectedBuilding)
		{
			BuildingData selectedBuildingData = SceneManager.Instance.SceneComp_Build.SelectedBuilding.Data;
			int selSlot = selectedBuildingData.SlotID;

			// 检查目标位置是否已经有建筑物了
			BuildingData occupyBuilding = PlayerManager.Instance.PlayerBuildingDataList.Find(b=>b.SlotID == hitSlot);
			if(occupyBuilding != null)
			{
				occupyBuilding.SlotID = selectedBuildingData.SlotID;
			}
			
			// 设定位置
			selectedBuildingData.SlotID = hitSlot;

			GameManager.Instance.AsyncBeginWait();
			selectedBuildingData.AVObject.SaveAsync().ContinueWith(t=>{
				GameManager.Instance.AsyncEndWait(()=>{
					// 刷新场景 
					// SceneManager.Instance.CurSceneComp.
					SceneManager.Instance.CurSceneComp.RepositionAllBuildings();
					
					// 更新UI
					UIManager.Instance.WidgetCancelMove.gameObject.SetActive(false);
					Debug.LogWarning(SceneManager.Instance.SceneComp_Build.SelectedBuilding.transform.position);
					UIManager.Instance.WidgetBuildingControl.Show(SceneManager.Instance.SceneComp_Build.SelectedBuilding.transform);
				});
			});
		}

		// 战斗模式 - 指定攻击位置
		if(hit && !IsTouchBlocked && UIManager.Instance.CurScreen == EScreen.Fight)
		{
			// 在点击位置创建一条闪电
			GameObject prefab = Resources.Load<GameObject>("Effects/lightningBoltBase");
			GameObject lightning = Instantiate(prefab) as GameObject;
			lightning.transform.parent = SceneManager.Instance.EffectRootComp.transform;
			lightning.transform.position = new Vector3(hitResult.point.x, 2.05f, hitResult.point.z);
			
			// 敌人Actor
			EnemyComp enemyComp = SceneManager.Instance.EnemyGroupComp.EnemyComp;
			
			// 命中敌人检测
			if(SceneManager.Instance.SceneComp_Battle.BattleState == EBattleState.BattleOn && enemyComp.CurSlot == hitSlot && enemyComp.State == EnemyComp.EEnemyState.Show)
			{
				// TODO 根据神力和对手防御计算伤害
				SceneManager.Instance.SceneComp_Battle.HitCount ++;
				UIManager.Instance.UIFightPanel.DesDefence(30);
				UIManager.Instance.UIFightPanel.DesEnergy(2);
				if(SceneManager.Instance.SceneComp_Battle.HitCount >= 4)
				{
					SceneManager.Instance.SceneComp_Battle.BattleState = EBattleState.NotInBattle;

					// 提交战斗结果
					GameManager.Instance.AsyncBeginWait();
					PlayerManager.Instance.NetSubmitBattleResult(
						PlayerManager.Instance.PlayerVillageData.UserID, 
						PlayerManager.Instance.OtherVillageData.UserID, true, (data)=>{
							GameManager.Instance.AsyncEndWait(()=>{
								BattleData battleData = new BattleData();
								battleData.AVObject = data;
								PlayerManager.Instance.BattleDataList.Add(battleData);
								UIManager.Instance.WidgetYesNo.Show("胜利了!是否返回", ()=>{
									SceneManager.Instance.SceneComp_Battle.EndFight();
								}, ()=>{
									SceneManager.Instance.SceneComp_Battle.EndFight();
								});
							});
						}
					);
				}
			}
		}
	}
Exemplo n.º 11
0
 public override UsageResults CalculateLeechSeedChanges(UsageResults usageResults, PokemonInstance user, PokemonInstance target, BattleData battleData)
 {
     if (target.battleProperties.volatileStatusConditions.leechSeed || target.HasType(Type.Grass))
     {
         usageResults.failed = true;
         return(usageResults);
     }
     else
     {
         usageResults.inflictLeechSeed = true;
         return(usageResults);
     }
 }
Exemplo n.º 12
0
        /// <param name="bd">戦闘情報。</param>
        /// <param name="attackerIndex">攻撃側のインデックス。</param>
        /// <param name="defenderIndex">防御側のインデックス。</param>
        /// <param name="damages">ダメージの配列。</param>
        /// <param name="criticalTypes">命中判定の配列。</param>
        /// <param name="attackType">攻撃種別。</param>
        /// <param name="defenderHP">防御側の攻撃を受ける直前のHP。</param>
        public BattleDetail(BattleData bd, BattleIndex attackerIndex, BattleIndex defenderIndex, double[] damages, int[] criticalTypes, int attackType, int[] equipmentIDs, int defenderHP)
        {
            Battle = bd;

            AttackerIndex  = attackerIndex;
            DefenderIndex  = defenderIndex;
            RawDamages     = damages;
            Damages        = damages.Select(dmg => (int)dmg).ToArray();
            GuardsFlagship = damages.Select(dmg => dmg != Math.Floor(dmg)).ToArray();
            CriticalTypes  = criticalTypes.Select(i => (CriticalType)i).ToArray();
            AttackType     = attackType;
            EquipmentIDs   = equipmentIDs;
            DefenderHP     = defenderHP;

            int[] slots = null;


            if (AttackerIndex < 0)
            {
                Attacker = null;
                slots    = null;
            }
            else
            {
                switch (AttackerIndex.Side)
                {
                case BattleSides.FriendMain:
                {
                    var atk = bd.Initial.FriendFleet.MembersInstance[AttackerIndex.Index];
                    Attacker = atk.MasterShip;
                    slots    = atk.AllSlotMaster.ToArray();
                }
                break;

                case BattleSides.FriendEscort:
                {
                    var atk = bd.Initial.FriendFleetEscort.MembersInstance[AttackerIndex.Index];
                    Attacker = atk.MasterShip;
                    slots    = atk.AllSlotMaster.ToArray();
                }
                break;

                case BattleSides.EnemyMain:
                    Attacker = bd.Initial.EnemyMembersInstance[AttackerIndex.Index];
                    slots    = bd.Initial.EnemySlots[AttackerIndex.Index];
                    break;

                case BattleSides.EnemyEscort:
                    Attacker = bd.Initial.EnemyMembersEscortInstance[AttackerIndex.Index];
                    slots    = bd.Initial.EnemySlotsEscort[AttackerIndex.Index];
                    break;
                }
            }


            if (bd.IsBaseAirRaid)
            {
                Defender = null;
            }
            else
            {
                switch (DefenderIndex.Side)
                {
                case BattleSides.FriendMain:
                    Defender = bd.Initial.FriendFleet.MembersInstance[DefenderIndex.Index].MasterShip;
                    break;

                case BattleSides.FriendEscort:
                    Defender = bd.Initial.FriendFleetEscort.MembersInstance[DefenderIndex.Index].MasterShip;
                    break;

                case BattleSides.EnemyMain:
                    Defender = bd.Initial.EnemyMembersInstance[DefenderIndex.Index];
                    break;

                case BattleSides.EnemyEscort:
                    Defender = bd.Initial.EnemyMembersEscortInstance[DefenderIndex.Index];
                    break;
                }
            }


            if (AttackType == 0 && Attacker != null)
            {
                AttackType = CaclulateAttackKind(slots, Attacker.ShipID, Defender.ShipID);
            }
        }
Exemplo n.º 13
0
    //添加所有战场
    private void addAllBattle()
    {
        /// 获取战场ID
        int battleId = _checkPoint.getBattleId();

        // _checkPoint.getBattleNumber()  战场个数 == 编队个数
        for (int i = 0; i < _checkPoint.getBattleNumber(); i++)
        {

            BattleData battle = new BattleData( battleId, i );

            if (!_battleList.Contains(battle))
            {
                _battleList.Add(battle);
            }
            else
            {
                _battleList[i] = battle;
            }
        }
    }
Exemplo n.º 14
0
        public override UsageResults CalculateEffect(PokemonInstance user, PokemonInstance target, BattleData battleData, bool allowMissing = true)
        {
            UsageResults usageResults = base.CalculateEffect(user, target, battleData, allowMissing);

            if (target.nonVolatileStatusCondition == PokemonInstance.NonVolatileStatusCondition.Paralysed)
            {
                usageResults.clearTargetNonVolatileStatusCondition = true;
            }

            return(usageResults);
        }
        public PhaseSupport(BattleData data, string title)
            : base(data, title)
        {
            var empty = Enumerable.Repeat(0, 6);

            switch (SupportFlag)
            {
            case 1:                             // 空撃
            {
                if ((int)RawData.api_support_info.api_support_airatack.api_stage_flag[2] != 0)
                {
                    var maindmg   = ((int[])RawData.api_support_info.api_support_airatack.api_stage3.api_edam).Skip(1);
                    var escortdmg = !RawData.api_support_info.api_support_airatack.api_stage3_combined() ? empty :
                                    ((int[])RawData.api_support_info.api_support_airatack.api_stage3_combined.api_edam).Skip(1);

                    var maincl   = ((int[])RawData.api_support_info.api_support_airatack.api_stage3.api_ecl).Skip(1);
                    var escortcl = !RawData.api_support_info.api_support_airatack.api_stage3_combined() ? empty :
                                   ((int[])RawData.api_support_info.api_support_airatack.api_stage3_combined.api_ecl).Skip(1);


                    Damages   = maindmg.Concat(escortdmg).ToArray();
                    Criticals = maincl.Concat(escortcl).ToArray();

                    // 航空戦なので crit フラグが違う
                    for (int i = 0; i < Criticals.Length; i++)
                    {
                        Criticals[i]++;
                    }
                }
                else
                {
                    goto default;
                }
            } break;

            case 2:                             // 砲撃
            case 3:                             // 雷撃
            {
                var dmg = ((int[])RawData.api_support_info.api_support_hourai.api_damage).Skip(1);
                var cl  = ((int[])RawData.api_support_info.api_support_hourai.api_cl_list).Skip(1);

                if (dmg.Count() == 12)
                {
                    Damages = dmg.ToArray();
                }
                else if (dmg.Count() == 6)
                {
                    Damages = dmg.Concat(empty).ToArray();
                }


                if (cl.Count() == 12)
                {
                    Criticals = cl.ToArray();
                }
                else if (cl.Count() == 6)
                {
                    Criticals = cl.Concat(empty).ToArray();
                }
            } break;

            default:
                Damages   = new int[12];
                Criticals = new int[12];
                break;
            }
        }
Exemplo n.º 16
0
		public PhaseBase( BattleData data ) {

			_battleData = data;

		}
Exemplo n.º 17
0
        private void UpdateEnemyFleetInstant(bool isPractice = false)
        {
            BattleManager bm = KCDatabase.Instance.Battle;
            BattleData    bd = bm.StartsFromDayBattle ? (BattleData)bm.BattleDay : (BattleData)bm.BattleNight;

            int[]   enemies    = bd.Initial.EnemyMembers;
            int[][] slots      = bd.Initial.EnemySlots;
            int[]   levels     = bd.Initial.EnemyLevels;
            int[][] parameters = bd.Initial.EnemyParameters;
            int[]   hps        = bd.Initial.MaxHPs;


            _enemyFleetCandidate      = null;
            _enemyFleetCandidateIndex = -1;



            if (!bm.IsPractice)
            {
                var efcurrent = EnemyFleetRecord.EnemyFleetElement.CreateFromCurrentState();
                var efrecord  = RecordManager.Instance.EnemyFleet[efcurrent.FleetID];
                if (efrecord != null)
                {
                    TextEnemyFleetName.Text = efrecord.FleetName;
                }
                TextEventDetail.Text = "敵艦隊ID: " + efcurrent.FleetID.ToString("x8");
                ToolTipInfo.SetToolTip(TextEventDetail, null);
            }

            TextFormation.Text = Constants.GetFormationShort((int)bd.Searching.FormationEnemy);
            //TextFormation.ImageIndex = (int)ResourceManager.IconContent.BattleFormationEnemyLineAhead + bd.Searching.FormationEnemy - 1;
            TextFormation.Visible = true;
            {
                int air = Calculator.GetAirSuperiority(enemies, slots);
                TextAirSuperiority.Text = isPractice ?
                                          air.ToString() + " ~ " + Calculator.GetAirSuperiorityAtMaxLevel(enemies, slots).ToString() :
                                          air.ToString();
                ToolTipInfo.SetToolTip(TextAirSuperiority, GetAirSuperiorityString(isPractice ? 0 : air));
                TextAirSuperiority.Visible = true;
            }

            TableEnemyMember.SuspendLayout();
            for (int i = 0; i < ControlMembers.Length; i++)
            {
                int shipID = enemies[i];
                ControlMembers[i].Update(shipID, shipID != -1 ? slots[i] : null);

                if (shipID != -1)
                {
                    ControlMembers[i].UpdateEquipmentToolTip(shipID, slots[i], levels[i], hps[i + 6], parameters[i][0], parameters[i][1], parameters[i][2], parameters[i][3]);
                }
            }
            TableEnemyMember.ResumeLayout();
            TableEnemyMember.Visible = true;

            PanelEnemyFleet.Visible = true;

            PanelEnemyCandidate.Visible = false;

            BasePanel.Visible = true;                                   //checkme
        }
Exemplo n.º 18
0
 public PhaseInitial(BattleData data)
     : base(data)
 {
 }
Exemplo n.º 19
0
 public void SetBattleData(BattleData battleData)
 {
     BattleData = battleData;
 }
    // Use this for initialization
    void Start()
    {
        BattleData data = Resources.Load <BattleData>("Data/BattleData");

        data.ResetData();
    }
Exemplo n.º 21
0
 public PVPBattleController(BattleData bd, BattleSystem bs)
 {
     battleData   = bd;
     battleSystem = bs;
 }
Exemplo n.º 22
0
		public PhaseSearching( BattleData data )
			: base( data ) { }
Exemplo n.º 23
0
 /// <summary>
 /// 2016/11/19 現在、連合艦隊夜戦において味方随伴艦隊が 最大HP = 現在HP となる不具合が存在するため、
 /// 昼戦データから最大HPを取得する
 /// </summary>
 public void TakeOverMaxHPs(BattleData bd)
 {
     Array.Copy(bd.Initial.MaxHPs, 12, MaxHPs, 12, 6);
 }
Exemplo n.º 24
0
 public BattleDayDetail(BattleData bd, BattleIndex attackerId, BattleIndex defenderId, double[] damages, int[] criticalTypes, int attackType, int[] equipmentIDs, int defenderHP)
     : base(bd, attackerId, defenderId, damages, criticalTypes, attackType, equipmentIDs, defenderHP)
 {
 }
Exemplo n.º 25
0
 public override byte GetUsagePower(BattleData battleData, PokemonInstance user, PokemonInstance target)
 => Convert.ToByte((user.health / user.GetBattleStats().health) * 150);
Exemplo n.º 26
0
 public override bool GetInflictsTorment(PokemonInstance user, PokemonInstance target, BattleData battleData)
 => true;
Exemplo n.º 27
0
		public PhaseTorpedo( BattleData data, int phaseID )
			: base( data ) {

				this.phaseID = phaseID;
		}
Exemplo n.º 28
0
        public static IEnumerator SelectMovingPointState(BattleData battleData)
        {
            while (battleData.currentState == CurrentState.SelectMovingPoint)
            {
                // List<GameObject> movableTiles = CheckMovableTiles(selectedUnitObject);
                Dictionary <Vector2, TileWithPath> movableTilesWithPath = PathFinder.CalculatePath(battleData.selectedUnitObject);
                List <GameObject> movableTiles = new List <GameObject>();
                foreach (KeyValuePair <Vector2, TileWithPath> movableTileWithPath in movableTilesWithPath)
                {
                    movableTiles.Add(movableTileWithPath.Value.tile);
                }

                battleData.tileManager.PaintTiles(movableTiles, TileColor.Blue);

                battleData.rightClicked  = false;
                battleData.cancelClicked = false;
                battleData.uiManager.EnableCancelButtonUI();

                battleData.isWaitingUserInput     = true;
                battleData.isSelectedTileByUser   = false;
                battleData.isPreSeletedTileByUser = false;
                while (!battleData.isSelectedTileByUser)
                {
                    //yield break 넣으면 코루틴 강제종료
                    if (battleData.rightClicked || battleData.cancelClicked)
                    {
                        battleData.rightClicked  = false;
                        battleData.cancelClicked = false;
                        battleData.uiManager.DisableCancelButtonUI();

                        battleData.tileManager.DepaintTiles(movableTiles, TileColor.Blue);

                        battleData.currentState       = CurrentState.FocusToUnit;
                        battleData.isWaitingUserInput = false;
                        yield break;
                    }

                    if (battleData.isPreSeletedTileByUser)
                    {
                        try
                        {
                            int requiredAP = movableTilesWithPath[battleData.preSelectedTilePosition].requireActivityPoint;
                            battleData.previewAPAction = new APAction(APAction.Action.Move, requiredAP);
                        }
                        catch (Exception e)
                        {
                            Debug.LogException(e);
                        }
                    }
                    else
                    {
                        battleData.previewAPAction = null;
                    }
                    battleData.uiManager.UpdateApBarUI(battleData, battleData.unitManager.GetAllUnits());

                    yield return(null);
                }
                battleData.isPreSeletedTileByUser = false;
                battleData.isSelectedTileByUser   = false;
                battleData.isWaitingUserInput     = false;


                // FIXME : 어딘가로 옮겨야 할 텐데...
                GameObject        destTile       = battleData.tileManager.GetTile(battleData.selectedTilePosition);
                List <GameObject> destPath       = movableTilesWithPath[battleData.selectedTilePosition].path;
                Vector2           currentTilePos = battleData.selectedUnitObject.GetComponent <Unit>().GetPosition();
                Vector2           distanceVector = battleData.selectedTilePosition - currentTilePos;
                int distance = (int)Mathf.Abs(distanceVector.x) + (int)Mathf.Abs(distanceVector.y);
                int totalUseActivityPoint = movableTilesWithPath[battleData.selectedTilePosition].requireActivityPoint;

                battleData.moveCount += distance;

                battleData.tileManager.DepaintTiles(movableTiles, TileColor.Blue);
                battleData.currentState = CurrentState.CheckDestination;
                battleData.uiManager.DisableCancelButtonUI();
                BattleManager battleManager = battleData.battleManager;
                yield return(battleManager.StartCoroutine(CheckDestination(battleData, destTile, destPath, totalUseActivityPoint, distance)));
            }
            yield return(null);
        }
Exemplo n.º 29
0
 public override bool GetInflictsPerishSong(PokemonInstance user, PokemonInstance target, BattleData battleData)
 => true;
Exemplo n.º 30
0
 public PhaseAirBattleBase(BattleData data, string title)
     : base(data, title)
 {
 }
Exemplo n.º 31
0
        // 砲撃戦とフォーマットが同じなので流用

        public PhaseOpeningASW(BattleData data, string title, bool isEscort, bool isEnemyEscort = false)
            : base(data, title, 0, "", isEscort, isEnemyEscort)
        {
        }
Exemplo n.º 32
0
 public override void DoSetTakingAimUpdate(ref UsageResults usageResults, PokemonInstance user, PokemonInstance target, BattleData battleData)
 {
     base.DoSetTakingAimUpdate(ref usageResults, user, target, battleData);
     usageResults.setTakingAim = true;
 }
Exemplo n.º 33
0
 public override bool RunFailureCheck(BattleData battleData, PokemonInstance user, PokemonInstance target)
 => base.RunFailureCheck(battleData, user, target) || user.battleProperties.GetDamageThisTurn() > 0;
Exemplo n.º 34
0
    /// <summary>
    /// 生成下一个战场的显示内容
    /// </summary>
    private void creatNextBattle(BattleData data)
    {
        int spriteCount = 0;
        bool isBreak = false;

        if (num == 1)
        {
            //生成自己的部队
            for (int i = 0; i < MyFormationData.formationList.Count; i++)
            {
                for (int j = 0; j < MyFormationData.formationList[i].SoldiersDict.Count; j++)
                {
                    if (MyFormationData.formationList[i].SoldiersDict[j] != null)
                    {
                        MyFormationData.formationList[i].SoldiersDict[j].Country = Defaults.Country.Me;
                        if (i == 0)
                        {
                            SpriteMgr.getInstance().addSoldier(MyFormationData.formationList[i].SoldiersDict[j], Defaults.SoldierType.Cavalryman, new Vector3(j % 3 + _mySoldierPoints[i].x, 0 + _mySoldierPoints[i].y, (int)(j / 3) + _mySoldierPoints[i].z));
                        }
                        else
                        {
                            SpriteMgr.getInstance().addSoldier(MyFormationData.formationList[i].SoldiersDict[j], Defaults.SoldierType.Armorman, new Vector3(j % 3 + _mySoldierPoints[i].x, 0 + _mySoldierPoints[i].y, (int)(j / 3) + _mySoldierPoints[i].z));
                        }

                        if (++spriteCount >= SPRITE_COUNT)
                        {
                            isBreak = true;
                            break;
                        }
                    }
                }

                if (isBreak)
                {
                    break;
                }
            }
        }

        spriteCount = 0;
        if (num == 0)
        {
            //自己部队停止动作
            for (int i = 0; i < SpriteMgr.getInstance().SelfSoldiers.Count; i++)
            {
                GeneralSoldier soldier = SpriteMgr.getInstance().SelfSoldiers[i] as GeneralSoldier;
                soldier.setState(soldier.IdleState);
                soldier.IsDebug = true;

                if (++spriteCount >= SPRITE_COUNT)
                {
                    break;
                }
            }
        }

        //生成敌人的部队
        spriteCount = 0;
        isBreak = false;
        for (int i = 0; i < campaignData.BattleList[campaignData.battleIndex].FormationList.Count; i++)
        {
            for (int j = 0; j < campaignData.BattleList[campaignData.battleIndex].FormationList[i].SoldiersDict.Count; j++)
            {
                //Debug.Log(i + " " + j + " " + campaignData.BattleList[campaignData.battleIndex].FormationList[i].soldiersDict[j]);
                if (campaignData.BattleList[campaignData.battleIndex].FormationList[i].SoldiersDict[j] != null)
                {
                    campaignData.BattleList[campaignData.battleIndex].FormationList[i].SoldiersDict[j].Country = Defaults.Country.Enemy;
                    if (j == 0)
                    {
                        SpriteMgr.getInstance().addSoldier(campaignData.BattleList[campaignData.battleIndex].FormationList[i].SoldiersDict[j], Defaults.SoldierType.Masterman, new Vector3(j % 3 + _enemySoldierPoints[i].x, 0 + _enemySoldierPoints[i].y, (int)(j / 3) + _enemySoldierPoints[i].z));
                    }
                    else
                    {
                        SpriteMgr.getInstance().addSoldier(campaignData.BattleList[campaignData.battleIndex].FormationList[i].SoldiersDict[j], Defaults.SoldierType.Axeman, new Vector3(j % 3 + _enemySoldierPoints[i].x, 0 + _enemySoldierPoints[i].y, (int)(j / 3) + _enemySoldierPoints[i].z));
                    }
                }

                if (++spriteCount >= SPRITE_COUNT)
                {
                    isBreak = true;
                    break;
                }
            }

            if (isBreak)
            {
                break;
            }
        }
    }
Exemplo n.º 35
0
 public abstract float GetCatchChanceModifier(PokemonInstance target, BattleData battleData);
			public PhaseBaseAirAttackUnit( BattleData data, int index )
				: base( data ) {
				AirBattleData = data.RawData.api_air_base_attack[index];
			}
Exemplo n.º 37
0
 public static bool CalculateIfShake(PokemonInstance pokemon,
                                     BattleData battleData,
                                     PokeBall pokeBall)
 => CalculateIfShake(CalculateShakeProbability(CalculateModifiedCatchRate(pokemon, pokeBall.GetCatchChanceModifier(pokemon, battleData))));
Exemplo n.º 38
0
        internal void Process(BattleData rpBattle)
        {
            if (State != QuestState.Progress) return;

            if (!rpBattle.QuestCounter.Contains(ID) && rpBattle.IsBossBattle)
            {
                BossBattle++;
                rpBattle.QuestCounter.Add(ID);
            }

            if (!rpBattle.QuestCounter.Contains(-ID) && rpBattle.Rank >= BattleRank.S)
            {
                SWin++;
                rpBattle.QuestCounter.Add(-ID);
            }
            if (!rpBattle.QuestCounter.Contains(-ID - 1) && rpBattle.IsBossBattle && rpBattle.Rank >= BattleRank.B)
            {
                BossBattleWin++;
                rpBattle.QuestCounter.Add(-ID - 1);
            }

            Update();

            RecordManager.Instance.Quest.UpdateProgress(this);
        }
Exemplo n.º 39
0
    /// <summary>
    /// 生成下一个战场的显示内容
    /// </summary>
    private void creatNextBattle(BattleData data)
    {
        int  spriteCount = 0;
        bool isBreak     = false;

        if (num == 1)
        {
            //生成自己的部队
            for (int i = 0; i < MyFormationData.formationList.Count; i++)
            {
                for (int j = 0; j < MyFormationData.formationList[i].SoldiersDict.Count; j++)
                {
                    if (MyFormationData.formationList[i].SoldiersDict[j] != null)
                    {
                        MyFormationData.formationList[i].SoldiersDict[j].Country = Defaults.Country.Me;
                        if (i == 0)
                        {
                            SpriteMgr.getInstance().addSoldier(MyFormationData.formationList[i].SoldiersDict[j], Defaults.SoldierType.Cavalryman, new Vector3(j % 3 + _mySoldierPoints[i].x, 0 + _mySoldierPoints[i].y, (int)(j / 3) + _mySoldierPoints[i].z));
                        }
                        else
                        {
                            SpriteMgr.getInstance().addSoldier(MyFormationData.formationList[i].SoldiersDict[j], Defaults.SoldierType.Armorman, new Vector3(j % 3 + _mySoldierPoints[i].x, 0 + _mySoldierPoints[i].y, (int)(j / 3) + _mySoldierPoints[i].z));
                        }

                        if (++spriteCount >= SPRITE_COUNT)
                        {
                            isBreak = true;
                            break;
                        }
                    }
                }

                if (isBreak)
                {
                    break;
                }
            }
        }

        spriteCount = 0;
        if (num == 0)
        {
            //自己部队停止动作
            for (int i = 0; i < SpriteMgr.getInstance().SelfSoldiers.Count; i++)
            {
                GeneralSoldier soldier = SpriteMgr.getInstance().SelfSoldiers[i] as GeneralSoldier;
                soldier.setState(soldier.IdleState);
                soldier.IsDebug = true;

                if (++spriteCount >= SPRITE_COUNT)
                {
                    break;
                }
            }
        }

        //生成敌人的部队
        spriteCount = 0;
        isBreak     = false;
        for (int i = 0; i < campaignData.BattleList[campaignData.battleIndex].FormationList.Count; i++)
        {
            for (int j = 0; j < campaignData.BattleList[campaignData.battleIndex].FormationList[i].SoldiersDict.Count; j++)
            {
                //Debug.Log(i + " " + j + " " + campaignData.BattleList[campaignData.battleIndex].FormationList[i].soldiersDict[j]);
                if (campaignData.BattleList[campaignData.battleIndex].FormationList[i].SoldiersDict[j] != null)
                {
                    campaignData.BattleList[campaignData.battleIndex].FormationList[i].SoldiersDict[j].Country = Defaults.Country.Enemy;
                    if (j == 0)
                    {
                        SpriteMgr.getInstance().addSoldier(campaignData.BattleList[campaignData.battleIndex].FormationList[i].SoldiersDict[j], Defaults.SoldierType.Masterman, new Vector3(j % 3 + _enemySoldierPoints[i].x, 0 + _enemySoldierPoints[i].y, (int)(j / 3) + _enemySoldierPoints[i].z));
                    }
                    else
                    {
                        SpriteMgr.getInstance().addSoldier(campaignData.BattleList[campaignData.battleIndex].FormationList[i].SoldiersDict[j], Defaults.SoldierType.Axeman, new Vector3(j % 3 + _enemySoldierPoints[i].x, 0 + _enemySoldierPoints[i].y, (int)(j / 3) + _enemySoldierPoints[i].z));
                    }
                }

                if (++spriteCount >= SPRITE_COUNT)
                {
                    isBreak = true;
                    break;
                }
            }

            if (isBreak)
            {
                break;
            }
        }
    }
Exemplo n.º 40
0
 public BattleNightDetail(BattleData bd, BattleIndex attackerId, BattleIndex defenderId, double[] damages, int[] criticalTypes, int attackType, int[] equipmentIDs, bool nightAirAttackFlag, int defenderHP)
     : base(bd, attackerId, defenderId, damages, criticalTypes, attackType, equipmentIDs, defenderHP)
 {
     NightAirAttackFlag = nightAirAttackFlag;
 }
Exemplo n.º 41
0
		// 砲撃戦とフォーマットが同じなので流用

		public PhaseOpeningASW( BattleData data, bool isEscort  )
			: base( data, 0, "", isEscort ) {

		}
 internal override void Process(BattleData rpBattle)
 {
     if (ShipRequirement.Check(ID))
         base.Process(rpBattle);
 }
Exemplo n.º 43
0
        public override UsageResults CalculateEffect(PokemonInstance user, PokemonInstance target, BattleData battleData, bool allowMissing = true)
        {
            UsageResults usageResults = base.CalculateEffect(user, target, battleData, allowMissing);

            if (usageResults.Succeeded)
            {
                usageResults.clearUserStageSpikes        = true;
                usageResults.clearUserStageToxicSpikes   = true;
                usageResults.clearUserStagePointedStones = true;
            }

            return(usageResults);
        }
Exemplo n.º 44
0
		public PhaseAirBattle( BattleData data, string suffix = "" )
			: base( data ) {

			this.suffix = suffix;
		}
Exemplo n.º 45
0
 protected PhaseBase(BattleData battle, string title)
 {
     Battle        = battle;
     BattleDetails = new List <BattleDetail>();
     Title         = title;
 }
Exemplo n.º 46
0
 public PhaseSupport( BattleData data )
     : base(data)
 {
 }
Exemplo n.º 47
0
        public static string GetBattleDetail(BattleData battle)
        {
            var  sbmaster      = new StringBuilder();
            bool isBaseAirRaid = battle.IsBaseAirRaid;


            foreach (var phase in battle.GetPhases())
            {
                var sb = new StringBuilder();

                switch (phase)
                {
                case PhaseBaseAirRaid p:

                    sb.AppendLine("味方基地航空隊 参加中隊:");
                    sb.Append(" ").AppendLine(string.Join(", ", p.Squadrons.Where(sq => sq.EquipmentInstance != null).Select(sq => sq.ToString()).DefaultIfEmpty("(なし)")));

                    GetBattleDetailPhaseAirBattle(sb, p);

                    break;

                case PhaseAirBattle p:

                    GetBattleDetailPhaseAirBattle(sb, p);

                    break;

                case PhaseBaseAirAttack p:

                    foreach (var a in p.AirAttackUnits)
                    {
                        sb.AppendFormat("〈第{0}波〉\r\n", a.AirAttackIndex + 1);

                        sb.AppendLine("味方基地航空隊 参加中隊:");
                        sb.Append(" ").AppendLine(string.Join(", ", a.Squadrons.Where(sq => sq.EquipmentInstance != null).Select(sq => sq.ToString())));

                        GetBattleDetailPhaseAirBattle(sb, a);
                        sb.Append(a.GetBattleDetail());
                    }

                    break;

                case PhaseJetAirBattle p:
                    GetBattleDetailPhaseAirBattle(sb, p);

                    break;

                case PhaseJetBaseAirAttack p:

                    foreach (var a in p.AirAttackUnits)
                    {
                        sb.AppendFormat("〈第{0}波〉\r\n", a.AirAttackIndex + 1);

                        sb.AppendLine("味方基地航空隊 参加中隊:");
                        sb.Append(" ").AppendLine(string.Join(", ", a.Squadrons.Where(sq => sq.EquipmentInstance != null).Select(sq => sq.ToString())));

                        GetBattleDetailPhaseAirBattle(sb, a);
                        sb.Append(a.GetBattleDetail());
                    }

                    break;

                case PhaseInitial p:


                    if (p.FriendFleetEscort != null)
                    {
                        sb.Append("〈味方主力艦隊〉");
                    }
                    else
                    {
                        sb.Append("〈味方艦隊〉");
                    }


                    void appendFleetInfo(FleetData fleet)
                    {
                        sb.Append(" 制空戦力 ");
                        sb.Append(GetRangeString(Calculator.GetAirSuperiority(fleet, false), Calculator.GetAirSuperiority(fleet, true)));

                        double truncate2(double value) => Math.Floor(value * 100) / 100;

                        sb.AppendFormat(" / 索敵能力 [1] {0}, [2] {1}, [3] {2}, [4] {3}",
                                        truncate2(Calculator.GetSearchingAbility_New33(fleet, 1)),
                                        truncate2(Calculator.GetSearchingAbility_New33(fleet, 2)),
                                        truncate2(Calculator.GetSearchingAbility_New33(fleet, 3)),
                                        truncate2(Calculator.GetSearchingAbility_New33(fleet, 4)));
                    }

                    if (isBaseAirRaid)
                    {
                        sb.AppendLine();
                        OutputFriendBase(sb, p.FriendInitialHPs, p.FriendMaxHPs);
                    }
                    else
                    {
                        appendFleetInfo(p.FriendFleet);
                        sb.AppendLine();
                        OutputFriendData(sb, p.FriendFleet, p.FriendInitialHPs, p.FriendMaxHPs);
                    }

                    if (p.FriendFleetEscort != null)
                    {
                        sb.AppendLine();
                        sb.Append("〈味方随伴艦隊〉");
                        appendFleetInfo(p.FriendFleetEscort);
                        sb.AppendLine();

                        OutputFriendData(sb, p.FriendFleetEscort, p.FriendInitialHPsEscort, p.FriendMaxHPsEscort);
                    }


                    sb.AppendLine();


                    void appendEnemyFleetInfo(int[] members)
                    {
                        int  air           = 0;
                        int  airbase       = 0;
                        bool indeterminate = false;

                        for (int i = 0; i < members.Length; i++)
                        {
                            var param = RecordManager.Instance.ShipParameter[members[i]];
                            if (param == null)
                            {
                                continue;
                            }

                            if (param.DefaultSlot == null || param.Aircraft == null)
                            {
                                indeterminate = true;
                                continue;
                            }

                            for (int s = 0; s < Math.Min(param.DefaultSlot.Length, param.Aircraft.Length); s++)
                            {
                                air += Calculator.GetAirSuperiority(param.DefaultSlot[s], param.Aircraft[s]);
                                if (KCDatabase.Instance.MasterEquipments[param.DefaultSlot[s]]?.IsAircraft ?? false)
                                {
                                    airbase += Calculator.GetAirSuperiority(param.DefaultSlot[s], param.Aircraft[s], 0, 0, 1);
                                }
                            }
                        }
                        sb.AppendFormat(" 制空戦力 {0} (対基地 {1})", air, airbase);
                        if (indeterminate)
                        {
                            sb.Append(" (未確定)");
                        }
                    }

                    if (p.EnemyMembersEscort != null)
                    {
                        sb.Append("〈敵主力艦隊〉");
                    }
                    else
                    {
                        sb.Append("〈敵艦隊〉");
                    }

                    appendEnemyFleetInfo(p.EnemyMembers);

                    if (p.IsBossDamaged)
                    {
                        sb.Append(" : 装甲破壊");
                    }
                    sb.AppendLine();

                    OutputEnemyData(sb, p.EnemyMembersInstance, p.EnemyLevels, p.EnemyInitialHPs, p.EnemyMaxHPs, p.EnemySlotsInstance, p.EnemyParameters);


                    if (p.EnemyMembersEscort != null)
                    {
                        sb.AppendLine();
                        sb.AppendLine("〈敵随伴艦隊〉");

                        appendEnemyFleetInfo(p.EnemyMembersEscort);
                        sb.AppendLine();

                        OutputEnemyData(sb, p.EnemyMembersEscortInstance, p.EnemyLevelsEscort, p.EnemyInitialHPsEscort, p.EnemyMaxHPsEscort, p.EnemySlotsEscortInstance, p.EnemyParametersEscort);
                    }

                    sb.AppendLine();

                    if (battle.GetPhases().Where(ph => ph is PhaseBaseAirAttack || ph is PhaseBaseAirRaid).Any(ph => ph != null && ph.IsAvailable))
                    {
                        sb.AppendLine("〈基地航空隊〉");
                        GetBattleDetailBaseAirCorps(sb, KCDatabase.Instance.Battle.Compass.MapAreaID);                                      // :(
                        sb.AppendLine();
                    }

                    if (p.RationIndexes.Length > 0)
                    {
                        sb.AppendLine("〈戦闘糧食補給〉");
                        foreach (var index in p.RationIndexes)
                        {
                            var ship = p.GetFriendShip(index);

                            if (ship != null)
                            {
                                sb.AppendFormat(" {0} #{1}\r\n", ship.NameWithLevel, index + 1);
                            }
                        }
                        sb.AppendLine();
                    }

                    break;

                case PhaseNightInitial p:

                {
                    var eq = KCDatabase.Instance.MasterEquipments[p.TouchAircraftFriend];
                    if (eq != null)
                    {
                        sb.Append("自軍夜間触接: ").AppendLine(eq.Name);
                    }
                    eq = KCDatabase.Instance.MasterEquipments[p.TouchAircraftEnemy];
                    if (eq != null)
                    {
                        sb.Append("敵軍夜間触接: ").AppendLine(eq.Name);
                    }
                }

                    {
                        int searchlightIndex = p.SearchlightIndexFriend;
                        if (searchlightIndex != -1)
                        {
                            sb.AppendFormat("自軍探照灯照射: {0} #{1}\r\n", p.FriendFleet.MembersInstance[searchlightIndex].Name, searchlightIndex + 1);
                        }
                        searchlightIndex = p.SearchlightIndexEnemy;
                        if (searchlightIndex != -1)
                        {
                            sb.AppendFormat("敵軍探照灯照射: {0} #{1}\r\n", p.EnemyMembersInstance[searchlightIndex].NameWithClass, searchlightIndex + 1);
                        }
                    }

                    if (p.FlareIndexFriend != -1)
                    {
                        sb.AppendFormat("自軍照明弾投射: {0} #{1}\r\n", p.FlareFriendInstance.NameWithLevel, p.FlareIndexFriend + 1);
                    }
                    if (p.FlareIndexEnemy != -1)
                    {
                        sb.AppendFormat("敵軍照明弾投射: {0} #{1}\r\n", p.FlareEnemyInstance.NameWithClass, p.FlareIndexEnemy + 1);
                    }

                    sb.AppendLine();
                    break;


                case PhaseSearching p:
                    sb.Append("自軍陣形: ").Append(Constants.GetFormation(p.FormationFriend));
                    sb.Append(" / 敵軍陣形: ").AppendLine(Constants.GetFormation(p.FormationEnemy));
                    sb.Append("交戦形態: ").AppendLine(Constants.GetEngagementForm(p.EngagementForm));
                    sb.Append("自軍索敵: ").Append(Constants.GetSearchingResult(p.SearchingFriend));
                    sb.Append(" / 敵軍索敵: ").AppendLine(Constants.GetSearchingResult(p.SearchingEnemy));

                    sb.AppendLine();

                    break;

                case PhaseSupport p:
                    if (p.IsAvailable)
                    {
                        sb.AppendLine("〈支援艦隊〉");
                        OutputSupportData(sb, p.SupportFleet);
                        sb.AppendLine();
                    }
                    break;

                case PhaseFriendlySupportInfo p:
                    if (p.IsAvailable)
                    {
                        OutputFriendlySupportData(sb, p);
                        sb.AppendLine();
                    }
                    break;

                case PhaseFriendlyShelling p:
                    if (p.IsAvailable)
                    {
                        {
                            int searchlightIndex = p.SearchlightIndexFriend;
                            if (searchlightIndex != -1)
                            {
                                sb.AppendFormat("自軍探照灯照射: {0} #{1}\r\n", p.SearchlightFriendInstance.NameWithClass, searchlightIndex + 1);
                            }
                            searchlightIndex = p.SearchlightIndexEnemy;
                            if (searchlightIndex != -1)
                            {
                                sb.AppendFormat("敵軍探照灯照射: {0} #{1}\r\n", p.SearchlightEnemyInstance.NameWithClass, searchlightIndex + 1);
                            }
                        }

                        {
                            int flareIndex = p.FlareIndexFriend;
                            if (flareIndex != -1)
                            {
                                sb.AppendFormat("自軍照明弾投射: {0} #{1}\r\n", p.FlareFriendInstance.NameWithClass, flareIndex + 1);
                            }
                            flareIndex = p.FlareIndexEnemy;
                            if (flareIndex != -1)
                            {
                                sb.AppendFormat("敵軍照明弾投射: {0} #{1}\r\n", p.FlareEnemyInstance.NameWithClass, flareIndex + 1);
                            }
                        }

                        sb.AppendLine();
                    }
                    break;

                case PhaseFriendlyAirBattle p:

                    GetBattleDetailPhaseAirBattle(sb, p);

                    break;
                }


                if (!(phase is PhaseBaseAirAttack || phase is PhaseJetBaseAirAttack))                       // 通常出力と重複するため
                {
                    sb.Append(phase.GetBattleDetail());
                }

                if (sb.Length > 0)
                {
                    sbmaster.AppendFormat("《{0}》\r\n", phase.Title).Append(sb);
                }
            }


            {
                sbmaster.AppendLine("《戦闘終了》");

                var friend       = battle.Initial.FriendFleet;
                var friendescort = battle.Initial.FriendFleetEscort;
                var enemy        = battle.Initial.EnemyMembersInstance;
                var enemyescort  = battle.Initial.EnemyMembersEscortInstance;

                if (friendescort != null)
                {
                    sbmaster.AppendLine("〈味方主力艦隊〉");
                }
                else
                {
                    sbmaster.AppendLine("〈味方艦隊〉");
                }

                if (isBaseAirRaid)
                {
                    for (int i = 0; i < 6; i++)
                    {
                        if (battle.Initial.FriendMaxHPs[i] <= 0)
                        {
                            continue;
                        }

                        OutputResultData(sbmaster, i, string.Format("第{0}基地", i + 1),
                                         battle.Initial.FriendInitialHPs[i], battle.ResultHPs[i], battle.Initial.FriendMaxHPs[i]);
                    }
                }
                else
                {
                    for (int i = 0; i < friend.Members.Count(); i++)
                    {
                        var ship = friend.MembersInstance[i];
                        if (ship == null)
                        {
                            continue;
                        }

                        OutputResultData(sbmaster, i, ship.Name,
                                         battle.Initial.FriendInitialHPs[i], battle.ResultHPs[i], battle.Initial.FriendMaxHPs[i]);
                    }
                }

                if (friendescort != null)
                {
                    sbmaster.AppendLine().AppendLine("〈味方随伴艦隊〉");

                    for (int i = 0; i < friendescort.Members.Count(); i++)
                    {
                        var ship = friendescort.MembersInstance[i];
                        if (ship == null)
                        {
                            continue;
                        }

                        OutputResultData(sbmaster, i + 6, ship.Name,
                                         battle.Initial.FriendInitialHPsEscort[i], battle.ResultHPs[i + 6], battle.Initial.FriendMaxHPsEscort[i]);
                    }
                }


                sbmaster.AppendLine();
                if (enemyescort != null)
                {
                    sbmaster.AppendLine("〈敵主力艦隊〉");
                }
                else
                {
                    sbmaster.AppendLine("〈敵艦隊〉");
                }

                for (int i = 0; i < enemy.Length; i++)
                {
                    var ship = enemy[i];
                    if (ship == null)
                    {
                        continue;
                    }

                    OutputResultData(sbmaster, i,
                                     ship.NameWithClass,
                                     battle.Initial.EnemyInitialHPs[i], battle.ResultHPs[i + 12], battle.Initial.EnemyMaxHPs[i]);
                }

                if (enemyescort != null)
                {
                    sbmaster.AppendLine().AppendLine("〈敵随伴艦隊〉");

                    for (int i = 0; i < enemyescort.Length; i++)
                    {
                        var ship = enemyescort[i];
                        if (ship == null)
                        {
                            continue;
                        }

                        OutputResultData(sbmaster, i + 6, ship.NameWithClass,
                                         battle.Initial.EnemyInitialHPsEscort[i], battle.ResultHPs[i + 18], battle.Initial.EnemyMaxHPsEscort[i]);
                    }
                }

                sbmaster.AppendLine();
            }

            return(sbmaster.ToString());
        }
Exemplo n.º 48
0
		public PhaseNightBattle( BattleData data, bool isEscort )
			: base( data ) {

			this.isEscort = isEscort;
		}
Exemplo n.º 49
0
 public BattleAirDetail(BattleData bd, int waveIndex, BattleIndex defenderId, double damage, int criticalType, int attackType, int defenderHP)
     : base(bd, BattleIndex.Invalid, defenderId, new double[] { damage }, new int[] { criticalType }, attackType, null, defenderHP)
 {
     WaveIndex = waveIndex;
 }
Exemplo n.º 50
0
        public override UsageResults CalculateStatChanges(UsageResults usageResults, PokemonInstance user, PokemonInstance target, BattleData battleData)
        {
            Stats <sbyte> userChanges = new Stats <sbyte>()
            {
                defense        = Convert.ToSByte(target.battleProperties.statModifiers.defense - user.battleProperties.statModifiers.defense),
                specialDefense = Convert.ToSByte(target.battleProperties.statModifiers.specialDefense - user.battleProperties.statModifiers.specialDefense),
            };

            Stats <sbyte> targetChanges = new Stats <sbyte>()
            {
                defense        = Convert.ToSByte(-userChanges.defense),
                specialDefense = Convert.ToSByte(-userChanges.specialDefense),
            };

            usageResults.userStatChanges   = userChanges;
            usageResults.targetStatChanges = targetChanges;

            return(usageResults);
        }
Exemplo n.º 51
0
 public virtual void LoadContent(IContentLoader contentLoader, IWindowQueuer windowQueuer, BattleData battleData)
 {
     foreach (var trainerSprite in TrainerSprites.Where(t => t is TTrainerSprite))
     {
         trainerSprite.StartMoveOut();
     }
     foreach (var trainerPokemonStatuse in TrainerPokemonStatuses.Where(t => t is TTrainerStatusSprite))
     {
         trainerPokemonStatuse.StartMoveOut();
     }
 }
Exemplo n.º 52
0
		public PhaseInitial( BattleData data )
			: base( data ) { }
Exemplo n.º 53
0
 void Awake()
 {
     data = GetComponent <BattleData>();
 }