Ejemplo n.º 1
0
        public static void AssertValidAbilityUseAction(GameInstance game, UctAction action)
        {
            var mobInstance    = game.State.MobInstances[action.MobId];
            var targetInstance = game.State.MobInstances[action.TargetId];
            var abilityInfo    = game.MobManager.Abilities[action.AbilityId];

            AssertAndRecord(game, action, game.State.Cooldowns[action.AbilityId] == 0,
                            "game.State.Cooldowns[action.AbilityId] == 0");

            AssertAndRecord(game, action, mobInstance.Ap >= abilityInfo.Cost, "mobInstance.Ap >= abilityInfo.Cost");
            AssertAndRecord(game, action, mobInstance.Hp > 0, $"Using an ability with {mobInstance.Hp}HP");
            AssertAndRecord(game, action, targetInstance.Hp > 0,
                            $"Using an ability on a target with {mobInstance.Hp}HP");

            var isVisible = game.Map.IsVisible(mobInstance.Coord, targetInstance.Coord);

            AssertAndRecord(game, action, isVisible, "Target is not visible");

            int distance = mobInstance.Coord.Distance(targetInstance.Coord);

            AssertAndRecord(game, action, abilityInfo.Range >= distance,
                            "abilityInfo.Range >= mobInstance.Coord.Distance(targetInstance.Coord)");
        }
Ejemplo n.º 2
0
 public static bool IsAbilityUsable(GameInstance game, CachedMob mob, CachedMob target, int abilityId)
 {
     return(IsTargetable(game, mob, target) && IsAbilityUsableApRangeCheck(game, mob, target, abilityId));
 }
Ejemplo n.º 3
0
 public TurnManager(GameInstance game)
 {
     Game = game;
 }
Ejemplo n.º 4
0
 public void SetCurrentMobIndex(GameInstance game, int?index)
 {
     CurrentMobIndex = index;
     UpdateCurrentTeam(game);
 }
Ejemplo n.º 5
0
 public GameEventHub(GameInstance gameInstance)
 {
     _gameInstance = gameInstance;
 }
Ejemplo n.º 6
0
 public static GameInstance F(GameInstance state, UctAction action)
 {
     return(FNoCopy(state.CopyStateOnly(), action));
 }