Пример #1
0
    // Use this for initialization
    void Start()
    {
        NetworkAnimator netAnimator = GetComponent <NetworkAnimator>();

        for (int i = 0; i < netAnimator.animator.parameterCount; i++)
        {
            netAnimator.SetParameterAutoSend(i, true);
        }

        ramArea = transform.GetChild(2).gameObject;

        if (!this.isLocalPlayer)
        {
            return;
        }

        // Set custom attributes for class:
        PlayerEffects pe = GetComponent <PlayerEffects>();

        pe.CmdSetAttributes(1.5f, 1.0f, 1.0f, 0.8f);

        // Add abilities to class:
        PlayerAbilityManager abilityManager = GetComponent <PlayerAbilityManager>();
        SpeedBomb            sp             = gameObject.AddComponent <SpeedBomb>();
        Stomp stomp = gameObject.AddComponent <Stomp>();

        stomp.init();
        sp.init(30, 4);
        abilityManager.abilities.Add(sp);
        abilityManager.abilities.Add(stomp);

        GameObject.Find("AbilityPanel").GetComponent <AbilityPanel>().setupPanel(abilityManager);

        this._playerController = GetComponent <PlayerController>();
    }
Пример #2
0
 void Start()
 {
     rb        = GetComponent <Rigidbody> ();
     SFXPlayer = GetComponent <SoundPlayer> ();
     slide     = GetComponent <Slide> ();
     stomp     = GetComponent <Stomp> ();
 }
Пример #3
0
        public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
        {
            Stomp stomp = oPlayer.abilities.stomp;

            if (target.life > 0 && stomp.InUse)
            {
                stomp.EndStomp();
            }
        }
        public override ISpell GenerateAttack()
        {
            ISpell spell = new Stomp(base.Unit.AttackPoints);

            base.TakeEnergy(spell);
            base.Unit.AttackPoints += 5;

            return(spell);
        }
        public override ISpell GenerateAttack()
        {
            var spell = new Stomp(this.Unit.AttackPoints);

            this.Unit.AttackPoints += 5;
            this.ValidateEnergyPoints(this.Unit, spell);
            this.Unit.EnergyPoints -= spell.EnergyCost;

            return(spell);
        }
        public override ISpell GenerateAttack()
        {
            /////Each time he casts Stomp, the Ice Giant's attack points are increased by 5.
            /////Stomp damage: Equal to the Ice Giant's attack points.
            var spell = new Stomp(this.Unit.AttackPoints);

            this.ValidateEnergyPoints(this.Unit, spell);
            this.Unit.AttackPoints += 5;
            this.Unit.EnergyPoints -= spell.EnergyCost;
            return(spell);
        }
Пример #7
0
        public ISpell GenerateAttack()
        {
            var stomp = new Stomp(this.Unit.AttackPoints);

            Validator.HasEnoughEnergy(this.Unit, stomp);

            Unit.EnergyPoints -= stomp.EnergyCost;

            this.Unit.AttackPoints += BonusAttackPerAttack;

            return(stomp);
        }
 public override ISpell GenerateAttack()
 {
     int energyCost = new Stomp(0).EnergyCost;
     if (this.Unit.EnergyPoints > energyCost)
     {
         this.Unit.EnergyPoints -= energyCost;
         var currentAttack = new Stomp(this.Unit.AttackPoints);
         this.Unit.AttackPoints += DefaultAttackIncreasePoints;
         return currentAttack;
     }
     throw new NotEnoughEnergyException(string.Format(GlobalMessages.NotEnoughEnergy, this.Unit.Name, "Stomp"));
 }
Пример #9
0
        public override ISpell GenerateAttack()
        {
            ISpell spell  = null;
            int    damage = (this.Unit.AttackPoints);

            spell = new Stomp(damage);
            if (this.Unit.EnergyPoints >= spell.EnergyCost)
            {
                this.Unit.EnergyPoints -= spell.EnergyCost;
                this.Unit.AttackPoints += 5;
                return(spell);
            }
            throw new NotEnoughEnergyException(string.Format(Messages.NotEnoughEnergyException, this.Unit.Name, spell.GetType().Name));
        }
Пример #10
0
        public override ISpell GenerateAttack()
        {
            var attack = new Stomp(this.Unit.AttackPoints);

            if (this.Unit.EnergyPoints < attack.EnergyCost)
            {
                throw new NotEnoughEnergyException(string.Format(
                                                       GlobalMessages.NotEnoughEnergy,
                                                       this.Unit.Name, attack.GetType().Name));
            }

            this.Unit.EnergyPoints -= attack.EnergyCost;
            this.Unit.AttackPoints += AfterAttackBonus;

            return(attack);
        }
        public override ISpell GenerateAttack()
        {
            var attack = new Stomp();

            if (this.Unit.EnergyPoints >= attack.EnergyCost)
            {
                attack.Damage = this.Unit.AttackPoints;

                this.Unit.EnergyPoints -= attack.EnergyCost;
                this.Unit.AttackPoints += 5;

                return(attack);
            }

            throw new NotEnoughEnergyException(string.Format(GlobalMessages.NotEnoughEnergy, this.Unit.Name, attack));
        }
        public override ISpell GenerateAttack()
        {
            var attack = new Stomp(this.Unit.AttackPoints);

            if (this.Unit.EnergyPoints < attack.EnergyCost)
            {
                throw new NotEnoughEnergyException(string.Format(
                    GlobalMessages.NotEnoughEnergy,
                    this.Unit.Name, attack.GetType().Name));
            }

            this.Unit.EnergyPoints -= attack.EnergyCost;
            this.Unit.AttackPoints += AfterAttackBonus;

            return attack;
        }
        public override ISpell GenerateAttack()
        {
            ISpell currentSpell = new Stomp(this.Unit.AttackPoints);
            if (this.Unit.EnergyPoints < currentSpell.EnergyCost)
            {
                throw new NotEnoughEnergyException(
                    string.Format(
                        GlobalMessages.NotEnoughEnergy,
                        this.Unit.Name,
                        currentSpell.GetType().Name));
            }

            this.Unit.EnergyPoints -= currentSpell.EnergyCost;
            this.Unit.AttackPoints += AdditionalAttackPoints;

            return currentSpell;
        }
        public override ISpell GenerateAttack()
        {
            Spell spell = new Stomp();

            if (this.Unit.EnergyPoints < spell.EnergyCost)
            {
                throw new NotEnoughEnergyException(string.Format(
                                                       GlobalMessages.NotEnoughEnergy,
                                                       this.Unit.Name, spell.GetType().Name));
            }

            this.Unit.EnergyPoints -= spell.EnergyCost;

            spell.Damage            = this.Unit.AttackPoints;
            this.Unit.AttackPoints += 5;
            return(spell);
        }
Пример #15
0
        public override ISpell GenerateAttack()
        {
            int damage = this.Unit.AttackPoints;

            ISpell spell = new Stomp(damage);

            if (this.Unit.EnergyPoints < spell.EnergyCost)
            {
                throw new NotEnoughEnergyException(this.Unit.Name + " does not have enough energy to cast Stomp");
            }
            else
            {
                this.Unit.EnergyPoints -= spell.EnergyCost;
                this.Unit.AttackPoints += 5;
            }

            return(spell);
        }
        public override ISpell GenerateAttack()
        {
            ISpell currentSpell = new Stomp(this.Unit.AttackPoints);

            if (this.Unit.EnergyPoints < currentSpell.EnergyCost)
            {
                throw new NotEnoughEnergyException(
                          string.Format(
                              GlobalMessages.NotEnoughEnergy,
                              this.Unit.Name,
                              currentSpell.GetType().Name));
            }

            this.Unit.EnergyPoints -= currentSpell.EnergyCost;
            this.Unit.AttackPoints += AdditionalAttackPoints;

            return(currentSpell);
        }
Пример #17
0
        public override ISpell GenerateAttack()
        {
            var stomp = new Stomp(this.Unit.AttackPoints);

            this.Unit.AttackPoints += IceGiantAttackPointsIncreaseOnAttack;

            if (this.Unit.EnergyPoints < stomp.EnergyCost)
            {
                throw new NotEnoughEnergyException(string.Format(
                        GlobalMessages.NotEnoughEnergy,
                        this.Unit.Name,
                        stomp.GetType().Name
                    ));
            }

            this.Unit.EnergyPoints -= stomp.EnergyCost;

            return stomp;
        }
Пример #18
0
    void Behave()
    {
        //Sequence for going in an open door
        DebugTask         openDebug     = new DebugTask("Going through open door sequence");
        ConditionalIsTrue doorOpenCheck = new ConditionalIsTrue(door.isOpen);
        ArriveToTarget    goInRoom      = new ArriveToTarget(arrive, roomNavTarget);

        Task[] openDoorSystem = new Task[3];
        openDoorSystem[0] = openDebug;
        openDoorSystem[1] = doorOpenCheck;
        openDoorSystem[2] = goInRoom;
        Sequence doorOpenSequence = new Sequence(openDoorSystem);

        //Sequence for going in closed door
        DebugTask         closedDebug    = new DebugTask("Going through closed door sequence");
        ArriveToTarget    goToDoor       = new ArriveToTarget(arrive, doorNavTarget);
        ConditionalIsTrue tryOpeningDoor = new ConditionalIsTrue(door.TryOpening());
        OpenDoor          openTheDoorUp  = new OpenDoor(door);
        //As is, these arrives don't have timing so it will seem like just going into the room
        ArriveToTarget advanceIntoRoom = new ArriveToTarget(arrive, roomNavTarget);

        Task[] closedDoorSystem = new Task[5];
        closedDoorSystem[0] = closedDebug;
        closedDoorSystem[1] = goToDoor;
        closedDoorSystem[2] = tryOpeningDoor;
        closedDoorSystem[3] = openTheDoorUp;
        closedDoorSystem[4] = advanceIntoRoom;
        Sequence closedDoorSequence = new Sequence(closedDoorSystem);

        //Sequence for going in locked door
        //Can just reuse goToDoor!
        DebugTask          lockedDebug         = new DebugTask("Going through locked door sequence");
        ConditionalIsFalse tryOpeningDoorFalse = new ConditionalIsFalse(door.TryOpening());
        Grow     grow    = new Grow(2f, this.gameObject);
        BustDoor burstIn = new BustDoor(door);
        Stomp    stomp   = new Stomp(gameObject);

        //Can reuse advanceIntoRoom as well!
        Task[] lockedDoorSystem = new Task[7];
        lockedDoorSystem[0] = lockedDebug;
        lockedDoorSystem[1] = goToDoor;
        lockedDoorSystem[2] = tryOpeningDoorFalse;
        lockedDoorSystem[3] = grow;
        lockedDoorSystem[4] = burstIn;
        lockedDoorSystem[5] = stomp;
        lockedDoorSystem[6] = advanceIntoRoom;
        Sequence lockedDoorSequence = new Sequence(lockedDoorSystem);

        //Make a selector to try to go in closed door before locked
        Task[] closedDoorOptions = new Task[2];
        closedDoorOptions[0] = closedDoorSequence;
        closedDoorOptions[1] = lockedDoorSequence;
        Selector closedProtocols = new Selector(closedDoorOptions);

        //Make a selector to try to go in the open door before closed ones
        Task[] overallDoorProtocols = new Task[2];
        overallDoorProtocols[0] = doorOpenSequence;
        overallDoorProtocols[1] = closedProtocols;
        Selector overallDoorOptions = new Selector(overallDoorProtocols);

        overallDoorOptions.run();
    }