private void Cleanup()
 {
     currentData      = null;
     currentBehaviour = new HotbarActionBehaviour();;
     currentDirection = Vector3.zero;
     builder          = null;
 }
        public void StartAction(Entity parent, BindableActions selectedAction)
        {
            //skills should only be cast from here
            if (!CharacterActions[selectedAction].CanCast(parent.unitData.ValueContainer))
            {
                return;
            }
            builder     = CharacterActions[selectedAction].builder;
            currentData = builder.ReturnActionData();

            currentBehaviour = builder.ReturnHotbarBehaviour(parent.unitData.ValueContainer);

            currentDirection = new Vector3(parent.facingDirection.x, parent.facingDirection.y, 0); //set direction
        }
Example #3
0
    public Stats scaleStat = Stats.PhysicalDamage; //attribute? stat enum?)


    //set cooldown
    //set resourcecosts


    //add in use, travel and hit FX
    //add in components (with values calculated from passed in users stats


    //conceptually, these are good methods, but the implementation of retrieving stats is sloppy and verbose, needs to be smoother
    public override HotbarActionBehaviour ReturnHotbarBehaviour(CharacterValueContainer container)
    {
        HotbarActionBehaviour behaviour = new HotbarActionBehaviour();

        behaviour.baseChargeTime = ModifedValue(_hotBarBehaviour.baseChargeTime, Stats.ChargeReduction.ToString(), container).TotalValue;

        behaviour.actionLock = ModifedValue(_hotBarBehaviour.actionLock, Stats.ActionLockScale.ToString(), container).TotalValue;

        behaviour.actionCooldown  = ModifedValue(_hotBarBehaviour.actionCooldown, Stats.CurrentCooldownReduction.ToString(), container).TotalValue;
        behaviour.canCharge       = _hotBarBehaviour.canCharge;
        behaviour.chargeMoveSpeed = ModifedValue(_hotBarBehaviour.chargeMoveSpeed, Stats.ChargeMoveSpeedIncrease.ToString(), container).TotalValue;

        behaviour.ResourceCosts = _hotBarBehaviour.ResourceCosts;
        foreach (var item in behaviour.ResourceCosts)
        {
            item.Amount = ModifedValue(item.Amount, Stats.CostReduction.ToString(), container).TotalValue;
        }
        return(behaviour);
    }