Example #1
0
        public static List <GenericShip> GetShipsInBullseyeArc(GenericShip ship, Team.Type team = Team.Type.Any)
        {
            List <GenericShip> shipsInBullseyeArc = new List <GenericShip>();

            foreach (var kv in Roster.AllShips)
            {
                GenericShip otherShip = kv.Value;

                if (team == Team.Type.Friendly && ship.Owner.Id != otherShip.Owner.Id)
                {
                    continue;
                }

                if (team == Team.Type.Enemy && ship.Owner.Id == otherShip.Owner.Id)
                {
                    continue;
                }

                ShotInfo shotInfo = new ShotInfo(ship, otherShip, ship.PrimaryWeapon);
                if (!shotInfo.InArcByType(ArcTypes.Bullseye))
                {
                    continue;
                }

                shipsInBullseyeArc.Add(otherShip);
            }

            return(shipsInBullseyeArc);
        }
Example #2
0
 public override void Initialize(RelicState relicState, RelicData relicData, RelicEffectData relicEffectData)
 {
     base.Initialize(relicState, relicData, relicEffectData);
     targetTeam    = relicEffectData.GetParamSourceTeam();
     statusEffects = relicEffectData.GetParamStatusEffects();
     trigger       = relicEffectData.GetParamTrigger();
 }
Example #3
0
        public static List <GenericShip> GetShipsInBullseyeArc(GenericShip ship, Team.Type team = Team.Type.Any)
        {
            List <GenericShip> shipsInBullseyeArc = new List <GenericShip>();

            foreach (var kv in Roster.AllShips)
            {
                GenericShip otherShip = kv.Value;

                if (team == Team.Type.Friendly && ship.Owner.Id != otherShip.Owner.Id)
                {
                    continue;
                }

                if (team == Team.Type.Enemy && ship.Owner.Id == otherShip.Owner.Id)
                {
                    continue;
                }

                if (!ship.SectorsInfo.IsShipInSector(otherShip, ArcType.Bullseye))
                {
                    continue;
                }

                shipsInBullseyeArc.Add(otherShip);
            }

            return(shipsInBullseyeArc);
        }
Example #4
0
 public CardEffectDataBuilder()
 {
     this.TargetTeamType                = Team.Type.Heroes;
     this.ShouldTest                    = true;
     this.ParamMultiplier               = 1f;
     this.ParamStatusEffects            = new StatusEffectStackData[0];
     this.ParamTimingDelays             = Vector3.zero;
     this.AdditionalTooltips            = new AdditionalTooltipData[0];
     this.TargetModeStatusEffectsFilter = new string[0];
 }
 public override void Initialize(RelicState relicState, RelicData relicData, RelicEffectData relicEffectData)
 {
     base.Initialize(relicState, relicData, relicEffectData);
     stringBuilder    = new StringBuilder(20);
     team             = relicEffectData.GetParamSourceTeam();
     statusIds        = (from status in relicEffectData.GetParamStatusEffects() select status.statusId).ToList();
     additionalStacks = (from status in relicEffectData.GetParamStatusEffects() select status.count).ToList();
     timesPerTurn     = currentCount = relicEffectData.GetParamInt();
     statusStacks     = relicEffectData.GetParamStatusEffects();
 }
        public List <CharacterState> GetRoomTargets(Team.Type team)
        {
            ProviderManager.TryGetProvider <RoomManager>(out RoomManager roomManager);

            List <CharacterState> targets = new List <CharacterState>();

            roomManager.GetRoom(this.floor).AddCharactersToList(targets, team);

            return(targets);
        }
Example #7
0
        public override void Start()
        {
            Name = "Combat SubPhase";

            selectionMode = Team.Type.Friendly;

            if (DebugManager.DebugPhases)
            {
                Debug.Log("Combat - Started");
            }
        }
        static void Postfix(RoomState __instance, Team.Type team, int pivotIndex)
        {
            List <CharacterState> toProcessCharacters = new List <CharacterState>();

            __instance.AddCharactersToList(toProcessCharacters, Team.Type.Monsters);

            foreach (CharacterState toProcessCharacter in toProcessCharacters)
            {
                foreach (IRoomStateModifier roomStateModifier in toProcessCharacter.GetRoomStateModifiers())
                {
                    IRoomStateSpawnPointsModifier roomStateShiftPointOccupantsModifier;
                    if ((roomStateShiftPointOccupantsModifier = roomStateModifier as IRoomStateSpawnPointsModifier) != null)
                    {
                        roomStateShiftPointOccupantsModifier.ShiftSpawnPoints(toProcessCharacter, __instance, team, pivotIndex);
                    }
                }
            }
        }
        public void ShiftSpawnPoints(CharacterState character, RoomState room, Team.Type team, int pivotIndex)
        {
            // We disallow changes to stats during combat phases
            ProviderManager.TryGetProvider(out CombatManager combatManager);
            if (combatManager == null || combatManager.GetCombatPhase() == CombatManager.Phase.Combat)
            {
                return;
            }

            // We recalculate the space used on the target floor to update the upgrade's data
            int spaceUsed = 0;
            List <CharacterState> charList = new List <CharacterState>();

            ProviderManager.CombatManager.GetMonsterManager().AddCharactersInRoomToList(charList, room.GetRoomIndex());
            foreach (var unit in charList)
            {
                if (unit.IsAlive)
                {
                    spaceUsed += unit.GetSize();
                }
            }

            // Make sure we only push any changes if there's a change to push to prevent random sound effects
            int upgradeAttack = spaceUsed * _baseAttack;

            if (upgradeAttack - _buffAttack != 0)
            {
                // Affect the stats of the target directly
                if (_buffAttack > 0)
                {
                    character.DebuffDamage(_buffAttack);
                }

                character.BuffDamage(upgradeAttack);
                if (!character.PreviewMode)
                {
                    ApplyUpgradeVisuals(character, upgradeAttack - _buffAttack, 0);
                    _buffAttack = upgradeAttack;
                }
            }
        }
Example #10
0
 private void ChangeSelectionMode(Team.Type type)
 {
     UI.ShowSkipButton();
     selectionMode = type;
 }
Example #11
0
 private void LockSelectionMode()
 {
     UI.HideSkipButton();
     selectionMode = Team.Type.Any;
 }
Example #12
0
        public static List <GenericShip> GetShipsAtRange(GenericShip ship, Vector2 fromto, Team.Type team = Team.Type.Any)
        {
            List <GenericShip> ships = new List <GenericShip>();

            foreach (var kv in Roster.AllShips)
            {
                GenericShip othership = kv.Value;

                if (team == Team.Type.Friendly && ship.Owner.Id != othership.Owner.Id)
                {
                    continue;
                }

                if (team == Team.Type.Enemy && ship.Owner.Id == othership.Owner.Id)
                {
                    continue;
                }

                int range = GetRangeOfShips(ship, othership);
                if (range >= fromto.x && range <= fromto.y)
                {
                    ships.Add(othership);
                }
            }

            return(ships);
        }
Example #13
0
 public TeamCondition(Team.Type teamType)
 {
     TeamType = teamType;
 }
Example #14
0
 public void RelicAddedNotification(List <RelicState> relics, RelicState newRelic, Team.Type team)
 {
     UpdateRelics();
 }
Example #15
0
 public void SetTeam(Team.Type teamType)
 {
     this.teamType = teamType;
 }
Example #16
0
    /// <summary>
    /// Returns the teamtype for this Team.
    /// </summary>
    /// <returns>The teamtype for this team.</returns>
    //public Faction getTeamType() {
    //    return teamFaction;
    //}

    public void setTeamType(Type input)
    {
        teamType = input;
    }