コード例 #1
0
 public virtual void AccelerateStartup(StatusEffectHandler statusEffectHandler, int turnsToGive)
 {
     if (statusType1 == StatusType.Accelerate || statusType2 == StatusType.Accelerate)
     {
         statusEffectHandler.ExtraTurnIncrementer(turnsToGive);
         statusEffectHandler.ExtraTurnGiverReset();
     }
 }
コード例 #2
0
 //---------------------------------------------------------------------------------------------
 // Unity Overrides
 //---------------------------------------------------------------------------------------------
 private void Awake()
 {
     m_health              = m_maxHealth;
     m_anim                = GetComponent <Animator>();
     m_spriteRenderer      = gameObject.GetComponent <SpriteRenderer>();
     m_originalColor       = m_spriteRenderer.color;
     m_rigidBody           = GetComponent <Rigidbody2D>();
     m_statusEffectHandler = GetComponent <StatusEffectHandler>();
 }
コード例 #3
0
    public void NextPhase()
    {
        if (placeInLineup < lineup.Count)
        {
            CharacterStats      currentUnit = lineup[placeInLineup];
            StatusEffectHandler currentSEH  = currentUnit.GetComponent <StatusEffectHandler>();

            currentSEH.TurnEffects();
            bool canAct = true;
            if (currentSEH.currentStatusEffect)
            {
                canAct = !currentSEH.currentStatusEffect.QuickLostTurnCheck();
            }

            // Decide if you want to require a unit to be able to act before getting an extra turn
            // if yes then put this into the if statement below it, if not then leave it.
            if (currentSEH.ExtraTurnCheck())
            {
                currentUnitHasExtraTurn = true;
                Debug.Log("Extra Turn");
                currentSEH.ExtraTurnIncrementer(-1);
            }

            if (!currentUnit.isDead && !currentSEH.participatedInDuoMove && canAct)
            {
                currentUnit.ResetDMGRedux();
                GameObject currentUnitGO = currentUnit.gameObject;

                moveSelected = false;

                if (currentUnitGO.CompareTag("PlayerControlled"))
                {
                    Debug.Log("Player Go!");
                    PlayerTurn(currentUnit, currentSEH);
                }
                if (currentUnitGO.CompareTag("EnemyControlled"))
                {
                    Debug.Log("Enemy go...");
                    EnemyTurn(currentUnit);
                }
            }

            else
            {
                FinishTurn();
            }
        }
        else
        {
            ReshuffleLineup();
        }
    }
コード例 #4
0
    public void PlayerTurn(Unit currentUnit, StatusEffectHandler cUSH)
    {
        state = BattleState.PLAYERTURN;
        Debug.Log(currentUnit.name + "'s turn!");

        // Open Battle UI Menu and use initializer function for status effects that effect tab availability
        if (cUSH.currentStatusEffect)
        {
            cUSH.currentStatusEffect.GetBattleTabSealNum(out bool atk, out bool spe, out bool itm, out bool tac);
            battleUI.InitializeTabs(atk, spe, itm, tac);
        }
        battleUI.OpenBUI(currentUnit.GetComponent <UnitMoveList>());
    }
コード例 #5
0
 //minimap
 void Start()
 {
     statusEffectHandler = new StatusEffectHandler(gameObject);
     if (!isLocalPlayer)
     {
         GetComponent <KartBehaviour>().enabled = false;
         transform.FindChild("Main Camera").gameObject.SetActive(false);
         GetComponent <KartInput>().enabled = false;
     }
     else
     {
         localPlayer = gameObject;
     }
     networkManager = GameObject.Find("Lobby").GetComponent <MyNetworkLobbyManager>();
 }
コード例 #6
0
    // For useable items
    public override void Use(CharacterStats user, CharacterStats target)
    {
        Debug.Log("Using " + name);
        switch (item_type)
        {
        case ItemType.none:
            Debug.Log("This item has no effect...");
            break;

        case ItemType.attack:
            move.Use(user, target);
            UseIncrementer(-1);
            break;

        case ItemType.heal:
            Heal(user, target);
            UseIncrementer(-1);
            break;

        case ItemType.status:
            // Extend for both target and user
            if (userOrTarget)
            {
                StatusEffectHandler userSEH = user.gameObject.GetComponent <StatusEffectHandler>();
                userSEH.AssignStatus(statusApplied);
            }
            else
            {
                StatusEffectHandler targetSEH = target.gameObject.GetComponent <StatusEffectHandler>();
                targetSEH.AssignStatus(statusApplied);
            }
            UseIncrementer(-1);
            break;

        case ItemType.key:
            Debug.Log("No use?");
            break;

        case ItemType.weapon:
            Debug.Log("How did you get here? Thats wrong.");
            break;

        default:
            break;
        }
    }
コード例 #7
0
ファイル: PlayerNetwork.cs プロジェクト: zeropointx/KartClone
    //minimap
    void Start()
    {
        statusEffectHandler= new StatusEffectHandler(gameObject);
        if (!isLocalPlayer)
        {
            GetComponent<KartBehaviour>().enabled = false;
            transform.FindChild("Main Camera").gameObject.SetActive(false);
            GetComponent<KartInput>().enabled = false;
        }
        else
        {
            localPlayer = gameObject;
         
        }
        networkManager = GameObject.Find("Lobby").GetComponent<MyNetworkLobbyManager>();


    }
コード例 #8
0
 private void Awake()
 {
     OnStatusEffectFinished += RemoveStatusEffect;
 }
コード例 #9
0
        public void ApplyEffect(Transform other)
        {
            StatusEffectHandler statusEffectHandler = other.GetComponent <StatusEffectHandler>();

            statusEffectHandler?.ApplyEffect(statusEffect);
        }
コード例 #10
0
ファイル: PlayerNetwork.cs プロジェクト: zeropointx/KartClone
    public void RpcApplyStatusEffectClient(StatusEffectHandler.EffectType type)
    {
        if (!isServer)
            transform.GetComponent<PlayerNetwork>().GetStatusEffectHandler().AddStatusEffect(type);

    }
コード例 #11
0
 private void Awake()
 {
     //currentHP = maxHP.GetValue();
     hp.SetValue();
     statEff = GetComponent <StatusEffectHandler>();
 }