Exemplo n.º 1
0
        public SpellFireball(Character caster, Character target, TargetTeam targetTeam)
            : base(caster, target, targetTeam)
        {
            iconTexture = Archive.textureDictionary["iconFireball"];

            projectiles = new List <Projectile>();
            particles   = new List <ParticleEngine>();
            texture     = Archive.textureDictionary["fireball"];
            manaCost    = 30;
        }
Exemplo n.º 2
0
        public SpellThrowGoblin(Character caster, Character target, TargetTeam targetTeam)
            : base(caster, target, targetTeam)
        {
            iconTexture = Archive.textureDictionary["iconGoblin"];

            projectiles = new List <Projectile>();
            particles   = new List <ParticleEngine>();
            texture     = Archive.textureDictionary["goblinCombat"];
            manaCost    = 0;
        }
Exemplo n.º 3
0
        public static IEnumerable <Obj_AI_Hero> CanTarget(float range, TargetTeam team)
        {
            switch (team)
            {
            case TargetTeam.Enemy:
                return(Champions.Where(hero => hero.IsEnemy && !hero.IsDead && !hero.IsZombie && hero.IsVisible && !hero.IsInvulnerable && Player.Distance(hero) <= range));

            case TargetTeam.Ally:
                return(Champions.Where(hero => hero.IsAlly && !hero.IsDead && !hero.IsZombie && hero.IsVisible && !hero.IsInvulnerable && Player.Distance(hero) <= range));

            case TargetTeam.Neutral:
                return(Champions.Where(hero => !hero.IsAlly && !hero.IsEnemy && !hero.IsZombie && !hero.IsDead && hero.IsVisible && !hero.IsInvulnerable && Player.Distance(hero) <= range));

            default:
                return(Champions.Where(hero => !hero.IsDead && hero.IsVisible && !hero.IsZombie && !hero.IsInvulnerable && Player.Distance(hero) <= range));
            }
        }
Exemplo n.º 4
0
    public override void OnInspectorGUI()
    {
        // Update the serializedProperty - always do this in the beginning of OnInspectorGUI.
        serializedObject.Update();

        GUILayout.BeginHorizontal();

        GUILayout.Label("Action Type: ");
        ActionType action = (ActionType)EditorGUILayout.EnumPopup("", (ActionType)actionType.enumValueIndex);

        actionType.enumValueIndex = (int)action;

        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();

        GUILayout.Label("Target Layers: ");
        LayerMask tempMask = EditorGUILayout.MaskField(InternalEditorUtility.LayerMaskToConcatenatedLayersMask(interactableLayers.intValue), InternalEditorUtility.layers);

        interactableLayers.intValue = InternalEditorUtility.ConcatenatedLayersMaskToLayerMask(tempMask);

        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();

        GUILayout.Label("Within Range Colour: ");

        GUILayout.FlexibleSpace();

        WithinRangeHighlightColour.colorValue = EditorGUILayout.ColorField(WithinRangeHighlightColour.colorValue);

        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();

        GUILayout.Label("Valid Colour: ");

        GUILayout.FlexibleSpace();

        ValidHighlightColour.colorValue = EditorGUILayout.ColorField(ValidHighlightColour.colorValue);

        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();

        GUILayout.Label("Invalid Colour: ");

        GUILayout.FlexibleSpace();

        InvalidHighlightColour.colorValue = EditorGUILayout.ColorField(InvalidHighlightColour.colorValue);

        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();

        GUILayout.Label("Distance Check: ");

        GUILayout.FlexibleSpace();

        useDistanceCheck.boolValue = EditorGUILayout.Toggle(useDistanceCheck.boolValue);

        GUILayout.EndHorizontal();

        if (useDistanceCheck.boolValue == true)
        {
            GUILayout.BeginHorizontal();

            GUILayout.Label("Distance Formulae: ");

            DistanceType distanceLength = (DistanceType)EditorGUILayout.EnumPopup("", (DistanceType)distanceCheckLength.enumValueIndex);
            distanceCheckLength.enumValueIndex = (int)distanceLength;

            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();

            GUILayout.Label("Use Unit's : ");

            DistanceCheck distanceType = (DistanceCheck)EditorGUILayout.EnumPopup("", (DistanceCheck)distanceCheckType.enumValueIndex);
            distanceCheckType.enumValueIndex = (int)distanceType;

            GUILayout.EndHorizontal();

            if (distanceType == DistanceCheck.custom)
            {
                GUILayout.BeginHorizontal();

                GUILayout.Label("Maximum Distance: ");

                GUILayout.FlexibleSpace();

                maxDistance.intValue = EditorGUILayout.IntField(maxDistance.intValue);

                GUILayout.EndHorizontal();
            }
        }

        GUILayout.BeginHorizontal();

        GUILayout.Label("Team Check: ");

        GUILayout.FlexibleSpace();

        useTeamCheck.boolValue = EditorGUILayout.Toggle(useTeamCheck.boolValue);

        GUILayout.EndHorizontal();

        if (useTeamCheck.boolValue == true)
        {
            GUILayout.BeginHorizontal();

            GUILayout.Label("Target Team: ");

            GUILayout.FlexibleSpace();

            TargetTeam team = (TargetTeam)EditorGUILayout.EnumPopup((TargetTeam)targetTeam.enumValueIndex);
            targetTeam.enumValueIndex = (int)team;

            GUILayout.EndHorizontal();
        }

        if (tempMask.value == 32)
        {
            GUILayout.BeginHorizontal();

            GUILayout.Label("Tile Occupation Check: ");

            GUILayout.FlexibleSpace();

            useTileOccupation.boolValue = EditorGUILayout.Toggle(useTileOccupation.boolValue);

            GUILayout.EndHorizontal();

            if (useTileOccupation.boolValue == true)
            {
                GUILayout.BeginHorizontal();

                GUILayout.Label("Tile state: ");

                GUILayout.FlexibleSpace();

                TileOccupation occupation = (TileOccupation)EditorGUILayout.EnumPopup((TileOccupation)targetOccupation.enumValueIndex);
                targetOccupation.enumValueIndex = (int)occupation;

                GUILayout.EndHorizontal();
            }
        }

        serializedObject.ApplyModifiedProperties();
    }
Exemplo n.º 5
0
 public TargetInfo(TargetTeam team, TargetType type, int randomTargets = 0)
 {
     this.targetTeam    = team;
     this.targetType    = type;
     this.randomTargets = Mathf.Max(randomTargets, 0);
 }
Exemplo n.º 6
0
    private void SetUIRedTeam()
    {
        //Red Team UI
        //Characters
        foreach (Transform child in RedTeamCharactersMenu)
        {
            child.gameObject.SetActive(false);
        }
        for (int i = 0; i < BSM.RedTeamInBattle.Count; i++)
        {
            GameObject characterPannelInfo = RedTeamCharactersMenu.GetChild(i).gameObject;
            characterPannelInfo.AddComponent <CharacterUISettings>();
            characterPannelInfo.GetComponent <CharacterUISettings>().Owner = BSM.RedTeamInBattle[i];
            characterPannelInfo.SetActive(true);
        }
        //Targets Enemy
        RedTeamTarges = new Dictionary <TargetSelectButton, Button>();
        foreach (Transform child in RedTeamEnemyTargetsMenu)
        {
            child.gameObject.SetActive(false);
        }
        for (int i = 0; i < BSM.BlueTeamInBattle.Count; i++)
        {
            GameObject button = RedTeamEnemyTargetsMenu.GetChild(i).gameObject;
            button.SetActive(true);
            Text text = button.GetComponentInChildren <Text>();
            text.text = BSM.BlueTeamInBattle[i].CharacterName;
            TargetSelectButton targerButton = button.GetComponent <TargetSelectButton>();
            targerButton.SetUIManager(this);
            targerButton.SetTarget(BSM.BlueTeamInBattle[i]);
            RedTeamTarges.Add(targerButton, button.GetComponent <Button>());
        }
        //Targets Allies
        foreach (Transform child in RedTeamAllyTargetsMenu)
        {
            child.gameObject.SetActive(false);
        }
        for (int i = 0; i < BSM.RedTeamInBattle.Count; i++)
        {
            GameObject button = RedTeamAllyTargetsMenu.GetChild(i).gameObject;
            button.SetActive(true);
            Text text = button.GetComponentInChildren <Text>();
            text.text = BSM.RedTeamInBattle[i].CharacterName;
            TargetSelectButton targerButton = button.GetComponent <TargetSelectButton>();
            targerButton.SetUIManager(this);
            targerButton.SetTarget(BSM.RedTeamInBattle[i]);
            RedTeamTarges.Add(targerButton, button.GetComponent <Button>());
        }

        //Targets Team
        //blueTeam
        GameObject blueTeamButton = RedTeamAoETargetsMenu.GetChild(0).gameObject;
        TargetTeam targetBlue     = blueTeamButton.GetComponent <TargetTeam>();

        targetBlue.SetUIManager(this);
        targetBlue.SetTargets(BSM, "BlueTeam");
        //redTeam
        GameObject redTeamButton = RedTeamAoETargetsMenu.GetChild(1).gameObject;
        TargetTeam targetRed     = blueTeamButton.GetComponent <TargetTeam>();

        targetRed.SetUIManager(this);
        targetRed.SetTargets(BSM, "RedTeam");

        RedTeamCharactersMenu.gameObject.SetActive(true);
    }
Exemplo n.º 7
0
 public SpellStab(Character caster, Character target, TargetTeam targetTeam) : base(caster, target, targetTeam)
 {
     animations  = new List <Animation>();
     iconTexture = Archive.textureDictionary["iconScythe"];
     hit         = false;
 }
Exemplo n.º 8
0
 public TargetSpell(Character caster, Character target, TargetTeam targetTeam) : base(caster)
 {
     this.target     = target;
     this.targetTeam = targetTeam;
 }