Exemple #1
0
    void TriggerCategory(AttackCategory Category)
    {
        Sprite newSprite = null;

        switch (Category)
        {
        case AttackCategory.Physical:
            newSprite = Physical;
            break;

        case AttackCategory.Special:
            newSprite = Special;
            break;

        case AttackCategory.Status:
            newSprite = Status;
            break;

        default:
            Logger.Error(GetType(), "Choosen Move does not have a valid Category!");
            break;
        }

        UI.Category.GetComponent <Image>().sprite = newSprite;

        UI.Category.SetActive(true);
    }
Exemple #2
0
 public List <BoardPiece> GetAttackablePieces(BoardPiece attacker, AttackCategory category)
 {
     return(GetCircle
            (
                GetSpace(attacker).Position,
                attacker.PeekAttack(category).Range,
                s => state[s] != null && state[s].Team != attacker.Team
            )
            .Select(s => state[s]).ToList());
 }
Exemple #3
0
 public Attack PeekAttack(AttackCategory category)
 {
     if (category == AttackCategory.Antagonistic)
     {
         return(NextAntagonism);
     }
     else
     {
         return(NextSupport);
     }
 }
Exemple #4
0
    public Attack PopAttack(AttackCategory category)
    {
        bool isAnt = category == AttackCategory.Antagonistic;
        var  temp  = isAnt ? NextAntagonism : NextSupport;

        if (isAnt)
        {
            currentAnt++;
        }
        else
        {
            currentSup++;
        }

        return(temp);
    }
Exemple #5
0
    // returns true if hit, false if miss
    public bool DoAttack(AttackCategory category, BoardPiece target, BoardPiece shooter)
    {
        shooter.HasAttacked = true;
        var attack = shooter.PopAttack(category);

        // int damage = attack.Damage;

        var coverHit = GetCover(target, shooter).TryHit();

        if (coverHit == null)
        {
            target.Health -= attack.Damage;
            return(true);
        }
        else
        {
            coverHit.Health -= attack.Damage;
            return(false);
        }
    }
Exemple #6
0
 public void DoAttack(AttackCategory category, BoardPieceVis target, BoardPieceVis shooter)
 {
     Board.DoAttack(category, target.Properties, shooter.Properties);
 }
Exemple #7
0
 public List <BoardPieceVis> GetAttackablePieceVis(BoardPieceVis attacker, AttackCategory category)
 {
     return(Board.GetAttackablePieces(attacker.Properties, category).Select(p => GetPieceVis(p)).ToList());
 }
            public AttackCategory DetermineAttackCategory(string newsDescription)
            {
                newsDescription = newsDescription.ToLower();

                if (newsDescription.Contains("xss") ||
                    newsDescription.Contains("cross site scripting") ||
                    newsDescription.Contains("cross-site scripting"))
                {
                    _attackCategory = AttackCategory.Xss;
                }

                else if (newsDescription.Contains("csrf") ||
                         newsDescription.Contains("cross site request forgery"))
                {
                    _attackCategory = AttackCategory.CSRF;
                }

                else if (newsDescription.Contains("sql"))
                {
                    _attackCategory = AttackCategory.Sqli;
                }

                else if (newsDescription.Contains("buffer") || newsDescription.Contains("overflow") ||
                         newsDescription.Contains("format string"))
                {
                    _attackCategory = AttackCategory.BufferOverflow;
                }

                else if (newsDescription.Contains("command execution"))
                {
                    _attackCategory = AttackCategory.CommandExecution;
                }

                else if (newsDescription.Contains("command injection"))
                {
                    _attackCategory = AttackCategory.CommandInjection;
                }

                else if (newsDescription.Contains("arbitrary code") ||
                         newsDescription.Contains("code execution") ||
                         newsDescription.Contains("execute arbitrary code"))
                {
                    _attackCategory = AttackCategory.CodeExecution;
                }

                else if (newsDescription.Contains("dos") || newsDescription.Contains("denial of service"))
                {
                    _attackCategory = AttackCategory.DenialOfService;
                }

                else if (newsDescription.Contains("directory traversal") ||
                         newsDescription.Contains("path traversal"))
                {
                    _attackCategory = AttackCategory.DirectoryTraversal;
                }

                else if (newsDescription.Contains("lfi") ||
                         newsDescription.Contains("file inclusion"))
                {
                    _attackCategory = AttackCategory.LocalFileInclusion;
                }

                else if (newsDescription.Contains("rfi") ||
                         newsDescription.Contains("file inclusion"))
                {
                    _attackCategory = AttackCategory.RemoteFileInclusion;
                }

                else if (newsDescription.Contains("leak") ||
                         newsDescription.Contains("disclosure") ||
                         newsDescription.Contains("expose") ||
                         newsDescription.Contains("sensitive information"))
                {
                    _attackCategory = AttackCategory.InformationExposure;
                }

                else if (newsDescription.Contains("privilege escalation") ||
                         newsDescription.Contains("privilege") ||
                         newsDescription.Contains("escalation"))
                {
                    _attackCategory = AttackCategory.PrivilegeEscalation;
                }

                else if (newsDescription.Contains("use-after-free"))
                {
                    _attackCategory = AttackCategory.UseAfterFree;
                }

                if (_attackCategory == AttackCategory.Advisory)
                {
                    _attackCategory = AttackCategory.Others;
                }

                return(_attackCategory);
            }