示例#1
0
        data FragmentShader(VertexOut vertex, Field <data> Select, Field <data> Data, Field <unit> Units, Field <corpse> Corpses, Field <TeamTuple> AntiMagic,
                            [UnitDistribution.Vals] float distribution, [Team.Vals] float AntiMagicTeam)
        {
            data select = Select[Here];
            data here   = Data[Here];

            TeamTuple antimagic = AntiMagic[Here];

            if (antimagic.TeamOne > _0 && AntiMagicTeam != Team.One)
            {
                return(data.Nothing);
            }
            if (antimagic.TeamTwo > _0 && AntiMagicTeam != Team.Two)
            {
                return(data.Nothing);
            }
            if (antimagic.TeamThree > _0 && AntiMagicTeam != Team.Three)
            {
                return(data.Nothing);
            }
            if (antimagic.TeamFour > _0 && AntiMagicTeam != Team.Four)
            {
                return(data.Nothing);
            }

            if (Something(select) && !Something(here))
            {
                if (UnitDistribution.Contains(distribution, vertex.TexCoords * Select.Size, Corpses))
                {
                    return(select);
                }
            }

            return(data.Nothing);
        }
示例#2
0
        color FragmentShader(VertexOut vertex, Field <TeamTuple> AntiMagic, [Team.Vals] float casting_team)
        {
            color output = color.TransparentBlack;

            TeamTuple here = AntiMagic[Here];

            float max_val = max(here.TeamOne, here.TeamTwo, here.TeamThree, here.TeamFour);

            return(max_val > _0 ? Active : color.TransparentBlack);
        }
示例#3
0
文件: Magic.cs 项目: JordanFisher/WAL
        magic FragmentShader(VertexOut vertex, Field <data> Select, Field <magic> Magic, Field <TeamTuple> AntiMagic)
        {
            magic here   = Magic[Here];
            data  select = Select[Here];

            if (Something(select))
            {
                TeamTuple antimagic  = AntiMagic[Here];
                bool      block_kill = antimagic.TeamOne > _0 || antimagic.TeamTwo > _0 || antimagic.TeamThree > _0 || antimagic.TeamFour > _0;

                if (!block_kill)
                {
                    here.kill = _true;
                }
            }

            return(here);
        }
示例#4
0
        TeamTuple FragmentShader(VertexOut vertex, Field <TeamTuple> Path, Field <data> Data, Field <unit> Units)
        {
            data data_here = Data[Here];
            unit unit_here = Units[Here];

            TeamTuple
                right = Path[RightOne],
                up    = Path[UpOne],
                left  = Path[LeftOne],
                down  = Path[DownOne];

            TeamTuple dist_to_enemy_of = min(right, up, left, down) + vec(_1, _1, _1, _1);

            if (Something(data_here))
            {
                if (BlockingTileHere(unit_here) || unit_here.player == Player.None)
                {
                    dist_to_enemy_of += 100 * TeamTuple(_1, _1, _1, _1);
                }
                else
                {
                    dist_to_enemy_of += 3 * TeamTuple(_1, _1, _1, _1);

                    if (unit_here.team != Team.One)
                    {
                        dist_to_enemy_of.TeamOne = _0;
                    }
                    if (unit_here.team != Team.Two)
                    {
                        dist_to_enemy_of.TeamTwo = _0;
                    }
                    if (unit_here.team != Team.Three)
                    {
                        dist_to_enemy_of.TeamThree = _0;
                    }
                    if (unit_here.team != Team.Four)
                    {
                        dist_to_enemy_of.TeamFour = _0;
                    }
                }
            }

            return(dist_to_enemy_of);
        }
示例#5
0
文件: Magic.cs 项目: JordanFisher/WAL
        TeamTuple FragmentShader(VertexOut vertex, Field <TeamTuple> AntiMagic, Field <data> Data, Field <unit> Units)
        {
            data data_here = Data[Here];
            unit unit_here = Units[Here];

            TeamTuple
                right = AntiMagic[RightOne],
                up    = AntiMagic[UpOne],
                left  = AntiMagic[LeftOne],
                down  = AntiMagic[DownOne];

            TeamTuple antimagic = max(right, up, left, down) - vec(_1, _1, _1, _1);

            if (unit_here.type == UnitType.DragonLord)
            {
                SetTeamVal(ref antimagic, unit_here.team, AntiMagicRange);
            }

            return(antimagic);
        }
示例#6
0
        public static void SetTeamVal(ref TeamTuple tuple, int team, float value)
        {
            if (team == 1)
            {
                tuple.TeamOne = value;
            }
            if (team == 2)
            {
                tuple.TeamTwo = value;
            }
            if (team == 3)
            {
                tuple.TeamThree = value;
            }
            if (team == 4)
            {
                tuple.TeamFour = value;
            }

            throw new BadTeamNumberException(team);
        }
示例#7
0
        public static void SetTeamVal(ref TeamTuple tuple, float team, float value)
        {
            if (team == Team.One)
            {
                tuple.TeamOne = value;
            }
            if (team == Team.Two)
            {
                tuple.TeamTwo = value;
            }
            if (team == Team.Three)
            {
                tuple.TeamThree = value;
            }
            if (team == Team.Four)
            {
                tuple.TeamFour = value;
            }

            throw new BadTeamNumberException(team);
        }
示例#8
0
        public static float GetTeamVal(TeamTuple tuple, int team)
        {
            if (team == 1)
            {
                return(tuple.TeamOne);
            }
            if (team == 2)
            {
                return(tuple.TeamTwo);
            }
            if (team == 3)
            {
                return(tuple.TeamThree);
            }
            if (team == 4)
            {
                return(tuple.TeamFour);
            }

            //throw new BadTeamNumberException(team);
            return(0);
        }
示例#9
0
        public static float GetTeamVal(TeamTuple tuple, float team)
        {
            if (team == Team.One)
            {
                return(tuple.TeamOne);
            }
            if (team == Team.Two)
            {
                return(tuple.TeamTwo);
            }
            if (team == Team.Three)
            {
                return(tuple.TeamThree);
            }
            if (team == Team.Four)
            {
                return(tuple.TeamFour);
            }

            throw new BadTeamNumberException(team);
            return(0);
        }