示例#1
0
        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
        }
示例#2
0
        public void UseSpecial(SpecialData.SpecialType type)
        {
            if (!GameStageManager.Instance.IsGameStarted)
            {
                return;
            }

            Special special = _specials.GetOrDefault(type);

            special?.Use();
        }
示例#3
0
        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;
        }
示例#4
0
        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));
        }
示例#5
0
        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);
        }
示例#6
0
        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);
        }
示例#7
0
 public override void Initialize(Fighter fighter, SpecialData.SpecialType specialType, int damage)
 {
     throw new NotSupportedException();
 }
示例#8
0
        public int GetSpecialRemaining(SpecialData.SpecialType type)
        {
            Special special = _specials.GetOrDefault(type);

            return(special?.RemainingUses ?? 0);
        }