public override void Initialize(Fighter fighter, SpecialData.SpecialType specialType, int damage) { base.Initialize(fighter, specialType, damage); fighter.Stats.AddChaff(this); // TODO: chaff should fly up and then fall down }
public void UseSpecial(SpecialData.SpecialType type) { if (!GameStageManager.Instance.IsGameStarted) { return; } Special special = _specials.GetOrDefault(type); special?.Use(); }
public virtual void Initialize(Fighter fighter, SpecialData.SpecialType specialType, int damage) { Fighter = fighter; gameObject.layer = Fighter.gameObject.layer; SpecialType = specialType; Damage = damage; Transform spawn = Fighter.GetSpecialAmmoSpawnTransform(); transform.position = spawn.position; transform.rotation = spawn.rotation; }
public void SpawnImpact(SpecialData.SpecialType specialType, Vector3 position) { PooledObject pooledObject = ObjectPoolManager.Instance.GetPooledObject(SpecialData.GetImpactPool(specialType), AmmoContainer.transform); Impact impact = pooledObject?.GetComponent <Impact>(); if (null == impact) { return; } impact.transform.position = position; StartCoroutine(ImpactCoroutine(pooledObject)); }
private void UseSpecial(int deviceId, SpecialData.SpecialType specialType) { Player player = PlayerManager.Instance.GetPlayer(deviceId); if (null == player) { Debug.LogError($"No such player {deviceId}!"); return; } Fighter fighter = FighterManager.Instance.GetFighter(player.Team.Id); if (null == fighter) { Debug.LogError($"No fighter for team {player.Team.Id}!"); return; } fighter.Stats.UseSpecial(specialType); }
public void Initialize(Fighter fighter, Fighter target, SpecialData.SpecialType specialType, int damage) { base.Initialize(fighter, specialType, damage); _fighterTarget = target; Chaff chaff = _fighterTarget.Stats.GetChaff(); if (null != chaff) { TargetChaff(chaff); } else { TargetFighter(target); } transform.LookAt2D(Target); _rigidBody.velocity = Fighter.Forward * _velocity; AudioManager.Instance.PlayAudioOneShot(_launchAudioId); }
public override void Initialize(Fighter fighter, SpecialData.SpecialType specialType, int damage) { throw new NotSupportedException(); }
public int GetSpecialRemaining(SpecialData.SpecialType type) { Special special = _specials.GetOrDefault(type); return(special?.RemainingUses ?? 0); }