Exemple #1
0
    private void AdjustBalance()
    {
        PlayerAtackInputSimulator playerAttackInputSimulator = new PlayerAtackInputSimulator(this);

        NodeBehaviour.PlayerAttacks = playerAttackInputSimulator;
        PlayerMovementSimulator playerMovementSimulator = new PlayerMovementSimulator(this);

        NodeBehaviour.PlayerMovement = playerMovementSimulator;
        _playerInputSimulator        = new PlayerInputSimulator(this);
        MechanicBalancer.StartAnalyze();
        for (int i = 0; i < _simIterations; i++)
        {
            playerAttackInputSimulator.Update(_simTimeStep);
            playerMovementSimulator.Update(_simTimeStep);
            _playerInputSimulator.Update(_simTimeStep);

            UpdateNodegraphState(simulate: true);
            RestoreNodeGraphState();
            foreach (var node in _uiNodes)
            {
                MechanicBalancer.RegisterUIObservation(node);
            }
        }
        MechanicBalancer.EndAnalyze(ref _mechanicGraph, _averageDamage);
    }
Exemple #2
0
    public bool ProccessAttackNode(float spd, float dmg, int type, Node node, int status)
    {
        if (_hitLastFrame != null)
        {
            _hitLastFrame = null;
            _playerWeaponMechanicTester.CollisionCallback(node);
        }

        if (_animatingTimer > 0f)
        {
            return(false);
        }

        _animatingTimer = _animationTimes[type] / spd;
        //Debug.Log($"attack : type.{type} dmg.{dmg} ");
        MechanicBalancer.RegisterAttackObservation(node, dmg);

        if (_hitChance[type] > UnityEngine.Random.Range(0f, 1f))
        {
            _hitLastFrame = node;
        }

        return(true);
    }