Ejemplo n.º 1
0
    public static void Kill(Fighter f)
    {
        if (f.Unit.alignment == Unit.Alignment.Player && PhaseManager.instance.currentPhase != PhaseManager.Phase.Player)
        {
            Players.Remove(f);
        }
        if (f.Unit.alignment == Unit.Alignment.Allied && PhaseManager.instance.currentPhase != PhaseManager.Phase.Allied)
        {
            Allies.Remove(f);
        }
        if (f.Unit.alignment == Unit.Alignment.Enemy && PhaseManager.instance.currentPhase != PhaseManager.Phase.Enemy)
        {
            Enemies.Remove(f);
        }
        if (f.Unit.alignment == Unit.Alignment.Neutral && PhaseManager.instance.currentPhase != PhaseManager.Phase.Neutral)
        {
            Neutrals.Remove(f);
        }

        Map.UnitTile(f).unitInTile = null;
        if (f != null)
        {
            if (GameSettings.DoBattleAnimation)
            {
                PhaseManager.instance.StartCoroutine(_Kill(f));
            }
            else
            {
                Object.Destroy(f.gameObject);
            }
        }
    }
Ejemplo n.º 2
0
        public void RemoveAlly(Guild g)
        {
            if (Allies.Contains(g))
            {
                Allies.Remove(g);

                g.RemoveAlly(this);
            }
        }
Ejemplo n.º 3
0
        public void RemoveAlly(PoliticalGroup other)
        {
            if (!Allies.Contains(other))
            {
                return;
            }

            Allies.Remove(other);
            AlliesRev.Remove(other);

            other.RemoveAlly(this);
        }
Ejemplo n.º 4
0
        public Entity RemoveAll(Position pos)
        {
            ImmutableDictionary <Position, int> tmpo = Obstacles, tmpe = Enemies, tmpa = Allies;

            if (Obstacles.ContainsKey(pos))
            {
                tmpo = Obstacles.Remove(pos);
            }
            if (Enemies.ContainsKey(pos))
            {
                tmpe = Enemies.Remove(pos);
            }
            if (Allies.ContainsKey(pos))
            {
                tmpa = Allies.Remove(pos);
            }
            return(UpdateWith(allies: tmpa, obstacles: tmpo, enemies: tmpe));
        }
Ejemplo n.º 5
0
 public Entity RemoveAlly(Position pos)
 {
     return(Allies.ContainsKey(pos) ? UpdateWith(allies: Allies.Remove(pos)) : this);
 }