public virtual void AccelerateStartup(StatusEffectHandler statusEffectHandler, int turnsToGive) { if (statusType1 == StatusType.Accelerate || statusType2 == StatusType.Accelerate) { statusEffectHandler.ExtraTurnIncrementer(turnsToGive); statusEffectHandler.ExtraTurnGiverReset(); } }
//--------------------------------------------------------------------------------------------- // 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>(); }
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(); } }
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>()); }
//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>(); }
// 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; } }
//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>(); }
private void Awake() { OnStatusEffectFinished += RemoveStatusEffect; }
public void ApplyEffect(Transform other) { StatusEffectHandler statusEffectHandler = other.GetComponent <StatusEffectHandler>(); statusEffectHandler?.ApplyEffect(statusEffect); }
public void RpcApplyStatusEffectClient(StatusEffectHandler.EffectType type) { if (!isServer) transform.GetComponent<PlayerNetwork>().GetStatusEffectHandler().AddStatusEffect(type); }
private void Awake() { //currentHP = maxHP.GetValue(); hp.SetValue(); statEff = GetComponent <StatusEffectHandler>(); }