示例#1
0
        public override void Execute(GameLiving living)
        {
            if (living == null)
            {
                return;
            }
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED))
            {
                return;
            }

            if (living.TempProperties.getProperty("Charging", false) ||
                living.EffectList.CountOfType(typeof(SpeedOfSoundEffect), typeof(ArmsLengthEffect), typeof(ChargeEffect)) > 0)
            {
                if (living is GamePlayer)
                {
                    ((GamePlayer)living).Out.SendMessage("You already an effect of that type!", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow);
                }
                return;
            }

            ChargeEffect charge = living.EffectList.GetOfType <ChargeEffect>();

            if (charge != null)
            {
                charge.Cancel(false);
            }
            if (living is GamePlayer)
            {
                ((GamePlayer)living).Out.SendUpdateMaxSpeed();
            }

            new ChargeEffect().Start(living);
            DisableSkill(living);
        }
示例#2
0
    public override void AttackQuit()
    {
        if (_needAimHelp)
        {
            CharacterEffectManager.Instance.StopEffect(FC_CHARACTER_EFFECT.HERO_AIMING, _owner.ACOwner._avatarController, -1);
        }
        //_owner.ShowCharge(-1f);
        if (_chargeSound != "")
        {
            SoundManager.Instance.StopSoundEffect(_chargeSound);
        }

        if (_chargeEffect != null)
        {
            for (int i = 0; i < _chargeEffect.Length; i++)
            {
                //stop effect
                ChargeEffect chargeEffectLastLevel = _chargeEffect[i];

                foreach (FC_CHARACTER_EFFECT effInfo in chargeEffectLastLevel._chargeEffect)
                {
                    CharacterEffectManager.Instance.StopEffect(effInfo,
                                                               _owner.ACOwner._avatarController, -1.0f);
                }
            }
        }
        base.AttackQuit();
    }
示例#3
0
 public ActionCharge(EnemyHuman human, float chargeTime, ActionBase chargeAction, Weapon weapon, bool slowDown, float slowDownAmount) : base(human)
 {
     ChargeTime     = chargeTime;
     ChargeAction   = chargeAction;
     Weapon         = weapon;
     SlowDown       = slowDown;
     SlowDownAmount = slowDownAmount;
     chargingFX     = new ChargeEffect(human.World, human.Position, 0, chargeTime, human);
 }
示例#4
0
        public MotherShip(Canvas parent, int pointValue, double difficulty, int hitsToDestroy, Brush stroke, Brush fill, Color glow, int thickness, Point center, double speed, PlayerShip player) : base(center, pointValue, difficulty, new List <Ordnance>(), new List <Effect>())
        {
            Enemy           = player;
            Parent          = parent;
            HitsToDestroy   = hitsToDestroy;
            IsDestroyed     = false;
            CanFireBullet   = true;
            Speed           = speed;
            LaserCooldown   = 900;
            Geometry        = new Draw(stroke, fill, thickness).Lines;
            Geometry.Points = new Plot(this, center).Points;
            Geometry.Effect = new FX(glow).Glow;

            OffsetX = -.1 * Speed;
            OffsetY = 0;

            Effect e = new ChargeEffect(new Point(Center.X, Center.Y + 60), Brushes.Purple, Brushes.White, SaucerColor, 900, OffsetX, OffsetY);

            Effects.Add(e);
            AddToDisplay(e);
        }
示例#5
0
    public override void AttackUpdate()
    {
        base.AttackUpdate();

        if (_currentState == AttackBase.ATTACK_STATE.STEP_1)
        {
            _timeCountCharge += Time.deltaTime;
            if (_timeCountCharge >= _timeChargeStep && _currentChargeLvl < _chargeLvl)
            {
                _timeCountCharge -= _timeChargeStep;
                if (_currentChargeLvl > 0)
                {
                    //stop last level effect
                    ChargeEffect chargeEffectLastLevel = _chargeEffect[_currentChargeLvl - 1];

                    Assertion.Check(chargeEffectLastLevel != null);
                    foreach (FC_CHARACTER_EFFECT effInfo in chargeEffectLastLevel._chargeEffect)
                    {
                        CharacterEffectManager.Instance.StopEffect(effInfo,
                                                                   _owner.ACOwner._avatarController, 0.1f);
                    }
                }
                _currentChargeLvl++;

                //play this level effect
                if (_chargeEffect != null && _chargeEffect.Length != 0)
                {
                    ChargeEffect chargeEffectThisLevel = _chargeEffect[_currentChargeLvl - 1];
                    Assertion.Check(chargeEffectThisLevel != null);
                    foreach (FC_CHARACTER_EFFECT effInfo in chargeEffectThisLevel._chargeEffect)
                    {
                        CharacterEffectManager.Instance.PlayEffect(effInfo,
                                                                   _owner.ACOwner._avatarController, -1);
                    }
                }

                if (_currentChargeLvl == _chargeLvl)
                {
                    if (_chargeFullSound != "")
                    {
                        SoundManager.Instance.PlaySoundEffect(_chargeFullSound);
                    }
                    if (_mmEffectMap != null)
                    {
                        _mmEffectMap.PlayEffect(FC_EFFECT_EVENT_POS.AT_CHARGE_FULL, _owner.ACOwner, null);
                    }
                }
            }
            _timeToShowCharge -= Time.deltaTime;
            if (_timeToShowCharge <= 0)
            {
                if (_currentChargeLvl < _chargeLvl)
                {
                    _owner.ShowCharge(Mathf.Min(1f, (_timeCountCharge + _currentChargeLvl * _timeChargeStep) / _timeCount));
                    _timeToShowCharge = 0.1f;
                }
                else
                {
                    //_owner.ShowCharge(1f);
                }
            }
            if (_needNotHoldAttackKey)
            {
                if (_currentChargeLvl >= _chargeLvl)
                {
                    if (_owner.ACOwner.IsPlayerSelf)
                    {
                        //release charge auto
                        _attackCanSwitch   = true;
                        _shouldGotoNextHit = true;
                        AttackEnd();
                    }
                    else if (_owner.ACOwner.IsClientPlayer && GameManager.Instance.IsPVPMode)
                    {
                        _attackCanSwitch   = true;
                        _shouldGotoNextHit = false;
                        AttackEnd();
                    }
                }
            }
            else
            {
                if (_owner.ACOwner.IsPlayerSelf)
                {
                    //need key event to release charge
                    if (!_owner.KeyAgent.keyIsPress(_currentBindKey))
                    {
                        CommandManager.Instance.SendCommandToOthers(FCCommand.CMD.ACTION_CANCEL, _owner.ACOwner.ObjectID,
                                                                    _owner.ACOwner.ThisTransform.localPosition,
                                                                    null,
                                                                    FC_PARAM_TYPE.NONE,
                                                                    null,
                                                                    FC_PARAM_TYPE.NONE,
                                                                    null,
                                                                    FC_PARAM_TYPE.NONE);
                        _shouldGotoNextHit = false;
                        AttackEnd();
                    }
                    else
                    {
                        if (_currentChargeLvl > 0)
                        {
                            _attackCanSwitch   = true;
                            _shouldGotoNextHit = true;
                            AttackEnd();
                        }
                    }
                }
            }
        }
    }