修改AI难度设置
This commit is contained in:
parent
b5b414dccd
commit
1b06d45fd0
@ -30,8 +30,6 @@ namespace Logic
|
||||
private Main _main;
|
||||
//private MapData _mapData;
|
||||
private Dictionary<GameState, GameStateBase> _gameStateDict;
|
||||
private Dictionary<uint, AIDifficult> _AIDifficults;
|
||||
public Dictionary<uint, AIDifficult> AIDifficults => _AIDifficults;
|
||||
|
||||
//public MapData Map => _mapData;
|
||||
public Main Main => _main;
|
||||
@ -49,7 +47,6 @@ namespace Logic
|
||||
_gameStateDict.Add(GameState.Finished, new FinishState(this));
|
||||
_curState = GameState.Menu;
|
||||
_gameStateDict[_curState].Enter();
|
||||
_AIDifficults = new Dictionary<uint, AIDifficult>();
|
||||
}
|
||||
|
||||
public void Update()
|
||||
@ -67,16 +64,6 @@ namespace Logic
|
||||
_curState = newState;
|
||||
_gameStateDict[_curState].Enter();
|
||||
}
|
||||
|
||||
public void SetAllAIDifficult(AIDifficult level)
|
||||
{
|
||||
foreach (var player in _main.MapData.PlayerMap.PlayerDataList)
|
||||
{
|
||||
if (player.Id == _main.MapData.PlayerMap.SelfPlayerId) continue;
|
||||
_AIDifficults[player.Id] = level;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -244,9 +231,7 @@ namespace Logic
|
||||
_curPlayer = _aiPlayers[0];
|
||||
_aiPlayers.RemoveAt(0);
|
||||
// AI 难度加钱
|
||||
if (_gameLogic.AIDifficults.TryGetValue(_curPlayer.Id, out var level))
|
||||
_curPlayer.PlayerWealth += (int)_curPlayer.Turn / 10 * (int)level;
|
||||
else _curPlayer.PlayerWealth += (int)_curPlayer.Turn / 10;
|
||||
_curPlayer.PlayerWealth += (int)_curPlayer.Turn / 10 * (int)_gameLogic.Main.MapData.MapConfig.AIDiff;
|
||||
_gameLogic.Main.MapData.PlayerMap.OnTurnStart(_gameLogic.Main.MapData, _curPlayer);
|
||||
_gameLogic.Main.MapData.CityMap.OnTurnStart(_gameLogic.Main.MapData, _curPlayer);
|
||||
_gameLogic.Main.MapData.UnitMap.OnTurnStart(_gameLogic.Main.MapData, _curPlayer);
|
||||
|
||||
@ -128,7 +128,7 @@ public class ChooseUI
|
||||
"LUNATIC" => AIDifficult.LUNATIC,
|
||||
_ => AIDifficult.EASY
|
||||
};
|
||||
_mapData.MapConfig.AIDiff = diff;
|
||||
if (_mapData != null) _mapData.MapConfig.AIDiff = diff;
|
||||
|
||||
GameMode mode = modeS switch
|
||||
{
|
||||
@ -137,8 +137,8 @@ public class ChooseUI
|
||||
_ => GameMode.CREATIVE
|
||||
};
|
||||
|
||||
_mapData.MapConfig.AIDiff = diff;
|
||||
_mapData.MapConfig.GameMode = mode;
|
||||
if (_mapData != null) _mapData.MapConfig.AIDiff = diff;
|
||||
if (_mapData != null) _mapData.MapConfig.GameMode = mode;
|
||||
|
||||
|
||||
if (!int.TryParse(mapSizeS.Substring(10), out int mapSize))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user