IEnumerator StartShieldSequence() { creatingShield = true; Attacking = true; nextAttack = _CharInfo.CurrentAttackTypeInfo.Where(r => r.AttackAnim == AttackAnimType.Buff).First(); SetAnimation("S_Buff_IdleToAtk", false, 0.3f); while (Attacking) { yield return(null); } }
public override IEnumerator AttackSequence(ScriptableObjectAttackBase atk = null) { Attacking = true; if (atk != null) { nextAttack = atk; } else { GetAttack(); baseForme.nextAttack = nextAttack; } //CreateTileAttack(); string animToFire = "bippidi boppidi"; switch (nextAttack.AttackAnim) { case AttackAnimType.Weak_Atk: animToFire = "Atk1_IdleToAtk"; break; case AttackAnimType.Strong_Atk: animToFire = "Atk2_IdleToAtk"; break; case AttackAnimType.Boss_Atk3: animToFire = "Atk3_IdleToAtk"; break; default: Debug.LogError("This attack animation type does not exist in the geisha, only use ATK or RAPIDATK"); break; } currentAttackPhase = AttackPhasesType.Start; SetAnimation(animToFire, false, 0f); while (Attacking) { yield return(null); } yield break; }
//Set ste special attack public void SpecialAttack(ScriptableObjectAttackBase atkType) { nextAttack = atkType; CameraManagerScript.Instance.CameraShake(CameraShakeType.Powerfulattack); if (chargingAudio != null) { AudioManagerMk2.Instance.PlaySound(AudioSourceType.Game, BattleManagerScript.Instance.AudioProfile.SpecialAttackChargingRelease, AudioBus.LowPriority, transform); chargingAudio.ResetSource(); chargingAudio = null; } SetAnimation(nextAttack.PrefixAnim + "_AtkToIdle"); ParticleManagerScript.Instance.FireParticlesInPosition(nextAttack.Particles.CastActivationPS, CharInfo.CharacterID, AttackParticlePhaseTypes.CastActivation, transform.position, UMS.Side, nextAttack.AttackInput); }
public IEnumerator OnBattleFieldAttackCo(CharacterInfoScript cInfo, ScriptableObjectAttackBase atk, Vector2Int basePos) { foreach (BulletBehaviourInfoClassOnBattleFieldClass item in atk.TilesAtk.BulletTrajectories) { float timer = 0; foreach (BattleFieldAttackTileClass target in item.BulletEffectTiles) { if (isPosOnField(target.Pos)) { GameObject go; go = Instantiate(TargetIndicator, GetBattleTile(target.Pos).transform.position, Quaternion.identity); go.GetComponent <BattleTileTargetScript>().StartTarget(item.Delay, target.Pos, cInfo.DamageStats.BaseDamage, cInfo.Elemental); } } while (timer <= item.Delay) { yield return(BattleManagerScript.Instance.PauseUntil()); timer += Time.fixedDeltaTime; } } }
public IEnumerator StartChargingAttack(AttackInputType nextAtkType) { if (CharInfo.StaminaStats.Stamina - CharInfo.PowerfulAttac.Stamina_Cost_Atk >= 0 && CanAttack && !isSpecialLoading) { ScriptableObjectAttackBase nxtAtk = CharInfo.CurrentAttackTypeInfo.Where(r => r.AttackInput == nextAtkType).First(); GameObject ps = null; isSpecialLoading = true; chargingAttackTimer = 0; currentAttackPhase = AttackPhasesType.Start; SetAnimation(nxtAtk.PrefixAnim + "_IdleToAtk", false, 0); while (isSpecialLoading && !VFXTestMode) { yield return(BattleManagerScript.Instance.PauseUntil()); chargingAttackTimer += Time.fixedDeltaTime; if (SpineAnim.CurrentAnim == CharacterAnimationStateType.Idle.ToString()) { SetAnimation(nxtAtk.PrefixAnim + "_IdleToAtk"); } if (!isChargingParticlesOn || ps == null) { isChargingParticlesOn = true; //Check ps = ParticleManagerScript.Instance.FireParticlesInPosition(nxtAtk.Particles.CastLoopPS, CharInfo.CharacterID, AttackParticlePhaseTypes.Charging, transform.position, UMS.Side, nxtAtk.AttackInput); ps.transform.parent = transform; } else { SetParticlesLayer(ps); } if (!IsOnField) { if (ps != null) { ps.transform.parent = null; ps.SetActive(false); } yield break; } } if (chargingAttackTimer > 1f && CharInfo.Health > 0f) { currentAttackPhase = AttackPhasesType.Loading; StopPowerfulAtk = SpecialAttackStatus.Start; if (IsOnField || VFXTestMode) { while (isMoving) { yield return(new WaitForEndOfFrame()); if (StopPowerfulAtk == SpecialAttackStatus.Stop) { StopPowerfulAtk = SpecialAttackStatus.None; ps.transform.parent = null; ps.SetActive(false); yield break; } } SpecialAttack(nxtAtk); } } else { SetAnimation(CharacterAnimationStateType.Idle, true, 0.1f); } ps.transform.parent = null; ps.SetActive(false); } }
public override IEnumerator AttackSequence(ScriptableObjectAttackBase atk = null) { yield return(base.AttackSequence()); }
public override void OnInspectorGUI() { GUIStyle style = new GUIStyle(); base.OnInspectorGUI(); //test = false; origin = (ScriptableObjectAttackBase)target; if (origin.Particles.Left.Cast == null) { origin.Particles.Left.Cast = PlaceHolder; } if (origin.Particles.Left.Bullet == null) { origin.Particles.Left.Bullet = PlaceHolder; } if (origin.Particles.Left.Hit == null) { origin.Particles.Left.Hit = PlaceHolder; } if (origin.Particles.Right.Cast == null) { origin.Particles.Right.Cast = PlaceHolder; } if (origin.Particles.Right.Bullet == null) { origin.Particles.Right.Bullet = PlaceHolder; } if (origin.Particles.Right.Hit == null) { origin.Particles.Right.Hit = PlaceHolder; } if (origin.Particles.CastActivationPS == null) { origin.Particles.CastActivationPS = ChargingActivationPs; } if (origin.Particles.CastLoopPS == null) { origin.Particles.CastLoopPS = ChargingLoopPs; } if (origin.CurrentAttackType == AttackType.Particles) { if (origin.TrajectoriesNumber > 0) { origin.ParticlesAtk.BulletTrajectories = RefreshList(origin.TrajectoriesNumber, origin.ParticlesAtk.BulletTrajectories); for (int i = 0; i < origin.TrajectoriesNumber; i++) { DrawParticlesAtk(origin.ParticlesAtk.BulletTrajectories[i]); } } } else if (origin.CurrentAttackType == AttackType.Tile) { origin.TilesAtk.AtkType = (BattleFieldAttackType)EditorGUILayout.EnumPopup("BattleFieldAttackType", origin.TilesAtk.AtkType); if (origin.TrajectoriesNumber > 0) { origin.TilesAtk.PercToCheck = EditorGUILayout.FloatField("PercToCheck", origin.TilesAtk.PercToCheck); origin.TilesAtk.StatToCheck = (WaveStatsType)EditorGUILayout.EnumPopup("StatToCheck", origin.TilesAtk.StatToCheck); origin.TilesAtk.ValueChecker = (ValueCheckerType)EditorGUILayout.EnumPopup("ValueChecker", origin.TilesAtk.ValueChecker); origin.TilesAtk.Chances = EditorGUILayout.IntField("Chances", origin.TilesAtk.Chances); origin.TilesAtk.BulletTrajectories = RefreshList(origin.TrajectoriesNumber, origin.TilesAtk.BulletTrajectories); for (int i = 0; i < origin.TrajectoriesNumber; i++) { EditorGUILayout.Space(); origin.TilesAtk.BulletTrajectories[i].Delay = EditorGUILayout.FloatField("Delay", origin.TilesAtk.BulletTrajectories[i].Delay); switch (origin.TilesAtk.AtkType) { case BattleFieldAttackType.OnAreaAttack: DrawBattleTileAtk(origin.TilesAtk.BulletTrajectories[i], new Vector2Int(0, 6), new Vector2Int(0, 12)); break; case BattleFieldAttackType.OnTarget: DrawBattleTileAtk(origin.TilesAtk.BulletTrajectories[i], new Vector2Int(-3, 4), new Vector2Int(-3, 4)); break; case BattleFieldAttackType.OnItSelf: DrawBattleTileAtk(origin.TilesAtk.BulletTrajectories[i], new Vector2Int(-3, 4), new Vector2Int(-3, 4)); break; default: break; } } firstOpen = false; } } EditorUtility.SetDirty(origin); }
//Basic attack sequence public override IEnumerator AttackSequence(ScriptableObjectAttackBase atk = null) { /*shotsLeftInAttack = 0; * if (currentAttackPhase != AttackPhasesType.End) yield break;*/ //yield return null; Attacking = true; CharacterAnimationStateType animToFire = CharacterAnimationStateType.Atk1_IdleToAtk; bool isLooped = false; if (atk != null) { nextAttack = atk; } else { GetAttack(); } if (nextAttack != null) { switch (nextAttack.AttackAnim) { /* case AttackAnimPrefixType.Atk: * sequencedAttacker = false; * chargeParticles = ParticleManagerScript.Instance.FireParticlesInPosition(CharInfo.ParticleID, AttackParticlePhaseTypes.Charging, transform.position, UMS.Side); * animToFire = CharacterAnimationStateType.Idle; * isLooped = true; * currentAttackPhase = AttackPhasesType.Cast_Powerful; * CreateTileAttack(); * break;*/ case AttackAnimType.Weak_Atk: animToFire = CharacterAnimationStateType.Atk1_IdleToAtk; isLooped = false; break; case AttackAnimType.Strong_Atk: animToFire = CharacterAnimationStateType.Atk2_IdleToAtk; isLooped = false; break; case AttackAnimType.Buff: break; case AttackAnimType.Debuff: break; } /* switch (CurrentAI) * { * case AIType.GeneralAI: * res = GeneralTestAI(); * break; * case AIType.AggressiveAI: * res = AggressiveTestAI(); * break; * }*/ //shotsLeftInAttack = GetHowManyAttackAreOnBattleField(((ScriptableObjectAttackTypeOnBattlefield)nextAttack).BulletTrajectories); currentAttackPhase = AttackPhasesType.Start; SetAnimation(animToFire, isLooped, 0f); while (Attacking) { yield return(null); } } }