Exemplo n.º 1
0
    private void ProccessAbility(InputAction.CallbackContext ctx)
    {
        if (lockControls)
        {
            return;
        }

        if (isDead)
        {
            return;
        }

        var value = ctx.ReadValue <float>();

        if (value < 0.9f)
        {
            return;
        }

        if (_activeAbility == ABILITY.NONE)
        {
            return;
        }

        ActivateAbility(_activeAbility);
        RecordUseAbility(_activeAbility);
        _activeAbility = ABILITY.NONE;
    }
Exemplo n.º 2
0
    public static string GetAbilityName(this ABILITY ability)
    {
        string name = string.Empty;

        switch (ability)
        {
        case ABILITY.NONE:
            break;

        case ABILITY.ROCKET:
            name = "Rocket";
            break;

        case ABILITY.MINE:
            name = "Land Mine";
            break;

        case ABILITY.SMOKE:
            name = "Smoke Screen";
            break;

        default:
            throw new ArgumentOutOfRangeException(nameof(ability), ability, null);
        }

        return(name);
    }
Exemplo n.º 3
0
 /// <summary>
 /// Check if Ability that must go with "Effect" Ability
 /// </summary>
 /// <param name="ability"></param>
 /// <returns></returns>
 public static bool IsEffectAbility(this ABILITY ability)
 {
     if (ability != ABILITY.Effect && ability != ABILITY.Tuner)
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 4
0
    private void ChooseRandomPickup()
    {
        var     max           = Enum.GetValues(typeof(ABILITY)).Length;
        ABILITY chosenAbility = (ABILITY)Random.Range(1, max);

        while (chosenAbility == lastAbility)
        {
            chosenAbility = (ABILITY)Random.Range(1, max);
        }

        lastAbility = chosenAbility;

        player.SetAbility(chosenAbility);
        _gameUI.SetPowerupText(chosenAbility.GetAbilityName());
    }
Exemplo n.º 5
0
    public CardModel(int cardID, bool isPlayer)
    {
        CardEntity cardEntity = Resources.Load <CardEntity>("CardEntityList/Card" + cardID);

        name    = cardEntity.name;
        hp      = cardEntity.hp;
        at      = cardEntity.at;
        cost    = cardEntity.cost;
        icon    = cardEntity.icon;
        ability = cardEntity.ability;
        spell   = cardEntity.spell;

        isAlive      = true;
        isPlayerCard = isPlayer;
    }
    //コンストラクタを明示的に指定
    public CardModel(int cardID, bool isPlayer)
    {
        CardEntity cardEntity = Resources.Load <CardEntity>("CardEntityList/Card" + cardID);

        this.name         = cardEntity.name;
        this.hp           = cardEntity.hp;
        this.at           = cardEntity.at;
        this.cost         = cardEntity.cost;
        this.icon         = cardEntity.icon;
        this.ability      = cardEntity.ability;
        this.spell        = cardEntity.spell;
        this.isAlive      = true;
        this.isPlayerCard = isPlayer;
        this.canAttack    = false;
    }
Exemplo n.º 7
0
    private void RecordUsePickup(ABILITY ability)
    {
        if (!recording)
        {
            return;
        }

        _inputEvents.Add(new InputEvent
        {
            item      = ability,
            position  = mainTransform.position,
            direction = mainTransform.forward.normalized,
            State     = _state,
            time      = Time.time
        });
    }
Exemplo n.º 8
0
    private void RecordUseAbility(ABILITY ability)
    {
        if (!_recording)
        {
            return;
        }

        _recordEvents.Add(new RecordEvent
        {
            Position  = followTransform.position,
            Direction = followTransform.forward.normalized,
            State     = CurrentState,
            Ability   = ability,
            Time      = Time.time
        });
    }
Exemplo n.º 9
0
        internal void SetAbility(ABILITY ability, bool isAdd, bool setLogic = true)
        {
            if (setLogic)
            {
                if (this.IsMonster() && this.IsFrame(FRAME.Normal) == false)
                {
                    //Another Logic
                    if (ability.IsEffectAbility())
                    {
                        this.Abilities.RemoveAll(o => o.IsEffectAbility());
                    }

                    if (Abilities.Contains(ABILITY.Effect))
                    {
                        Abilities.Remove(ABILITY.Effect);
                    }
                }
                else
                {
                    Frame     = DefaultFrame;
                    Attribute = ATTRIBUTE.UNKNOWN;
                    Property  = PROPERTY.NONE;
                    Level     = 4; //Default Level
                    ATK       = DEF = double.NaN;
                }
            }
            if (isAdd && Abilities.Contains(ability) == false) //Add
            {
                if (ability.IsEffectAbility() && Frame != FRAME.Effect)
                {
                    Abilities.Add(ABILITY.Effect);
                }
                Abilities.Add(ability);
            }
            else if (isAdd == false && Abilities.Contains(ability)) //Remove
            {
                Abilities.Remove(ability);
            }

            Abilities.Sort();
        }
Exemplo n.º 10
0
 void Set_Character(ABILITY ability)
 {
     Instantiate(players[(int)ability], new Vector3(0, 1.5f, 0), Quaternion.identity);
 }
Exemplo n.º 11
0
 public void SetAbility(ABILITY ability) => _activeAbility = ability;