示例#1
0
 // Use this for initialization
 void Start()
 {
     walkBehaviour = GetComponent <Walk>();
     animator      = GetComponent <Animator>();
     duckBehaviour = GetComponent <Crouch>();
     slamBehaviour = GetComponent <Slam>();
 }
示例#2
0
文件: Brawler.cs 项目: JonECG/Brogue
 public Brawler()
 {
     heroTexture = Engine.Engine.GetTexture("Hero/Brawler");
     Hero.loadSprite();
     heroRole            = Classes.Brawler;
     baseHealth          = 300;
     healthPerLevel      = 40;
     requiredBranchLevel = 30;
     resetLevel();
     resetHealth();
     Enemies.Enemy.UpdateTargets(this);
     Enemies.BossEnemy.UpdateBossTargets(this);
     abilities[0] = new Cleave();
     abilities[1] = new WhirlwindSlash();
     abilities[2] = new Slam();
     abilities[3] = new DoubleSlash();
     Engine.Engine.Log(health.ToString());
 }
示例#3
0
 public Berserker()
 {
     heroTexture = Engine.Engine.GetTexture("Hero/Berserker");
     Hero.loadSprite();
     heroRole            = Classes.Berserker;
     baseHealth          = 500;
     healthPerLevel      = 40;
     requiredBranchLevel = int.MaxValue;
     resetLevel();
     resetHealth();
     abilities[0] = new Cleave();
     abilities[1] = new WhirlwindSlash();
     abilities[2] = new Slam();
     abilities[3] = new DoubleSlash();
     abilities[4] = new Rage();
     abilities[5] = new Execute();
     Enemies.Enemy.UpdateTargets(this);
     Enemies.BossEnemy.UpdateBossTargets(this);
 }
示例#4
0
    public override void Awake()
    {
        base.Awake();
        Abilities = new List <Ability>();
        Ability ability = new Slam();

        ability.attackStart.AddListener(SlamAnimate);
        Abilities.Add(ability);
        Abilities.Add(new BoneSkin());
        ability = new SummonTentacle();
        ability.attackStart.AddListener(AttackAnimate);
        Abilities.Add(ability);
        Items = new Dictionary <Item, int>();
        Items.Add(new Potion(), 2);
        MaxHealth     = 60;
        CurrentHealth = 60;
        Attack        = 5;
        Defense       = 3;
        Speed         = 6;
        animator      = GetComponent <Animator>();
    }
示例#5
0
        public void InitWeapons()
        {
            ClearAbilities();
            if (MeleeWeaponModel != null && !MeleeWeaponModel.IsRemoved)
            {
                MeleeWeaponModel.Remove();
            }
            if (RangedWeaponModel != null && !RangedWeaponModel.IsRemoved)
            {
                RangedWeaponModel.Remove();
            }
            switch (MeleeWeapon)
            {
            case MeleeWeapons.Sword:
                AddAbility(new SwordThrust());
                MeleeWeaponModel = new Props.Sword1
                {
                    OrientationRelation = OrientationRelation.Absolute
                };
                meleeWeapon = "sword";
                break;

            case MeleeWeapons.MayaHammer:
                AddAbility(new HammerThrust());
                MeleeWeaponModel = new Props.MayaHammer1
                {
                    OrientationRelation = OrientationRelation.Absolute
                };
                meleeWeapon = "hammer";
                break;

            case MeleeWeapons.Spear:
                AddAbility(new SpearThrust());
                MeleeWeaponModel = new Props.Spear1
                {
                    OrientationRelation = OrientationRelation.Absolute
                };
                meleeWeapon = "spear";
                break;
            }
            AddChild(MeleeWeaponModel);
            var slam = new Slam();

            slam.Start += new System.Action(slam_Start);
            slam.End   += new System.Action(slam_End);
            AddAbility(slam);
            switch (RangedWeapon)
            {
            case RangedWeapons.Rifle:
                AddAbility(new Blast());
                RangedWeaponModel = new Props.Rifle1
                {
                    OrientationRelation = OrientationRelation.Absolute
                };
                break;

            case RangedWeapons.HandCannon:
                AddAbility(new CannonballShot());
                RangedWeaponModel = new Props.HandCannon1
                {
                    OrientationRelation = OrientationRelation.Absolute
                };
                break;

            case RangedWeapons.Fire:
                AddAbility(new BurningBlast());
                RangedWeaponModel = new Props.Rifle1
                {
                    OrientationRelation = OrientationRelation.Absolute
                };
                break;

            case RangedWeapons.GatlingGun:
                AddAbility(new GatlingGun());
                RangedWeaponModel = new Props.GatlingGun1
                {
                    OrientationRelation = OrientationRelation.Absolute
                };
                break;

            case RangedWeapons.Blaster:
                AddAbility(new Blaster());
                RangedWeaponModel = new Props.HandMortar1
                {
                    OrientationRelation = OrientationRelation.Absolute
                };
                break;
            }
            AddChild(RangedWeaponModel);
            //AddAbility(new Revolver());
            AddAbility(new GhostBullet());
        }
示例#6
0
    void Start()
    {
        Time.timeScale = timescale;
        controller = gameObject.GetComponent<BaseController>();
        animator = GetComponentInChildren<Animator>();

        comboAction = GetComponent<Combo>();
        dashAction = GetComponent<Dash>();
        blockAction = GetComponent<Block>();
        airFloatAction = GetComponent<AirFloat>();
        slamAction = GetComponent<Slam>();
        tornadoAction = GetComponent<Tornado>();

        if (GetComponent<AirAttack>() != null)
        {
            airSpecialAction = GetComponent<AirAttack>();
        }
        else if (GetComponent<AirSpecial>())
        {
            airSpecialAction = GetComponent<AirSpecial>();
        }

        controller.OnLand += HandleLanding;

        PlayerInput.SwipeLeft += SwipeLeft;
        PlayerInput.SwipeRight += SwipeRight;
    }
示例#7
0
    private BearVisualManager visualManager; // The BearVisualManager atatched to the player character.

    void Start()
    {
        slam          = GetComponentInParent <Slam>();
        visualManager = GetComponentInParent <BearVisualManager>();
    }
示例#8
0
        //======================================================
        #region Event Methods
        private void SpecialForm_Load(object sender, EventArgs e)
        {
            //Until I find a better way, this list is typed manually.

            //Rules attached to this ability should be added first, for editing.
            if (ability.SpecialRules != null)
            {
                foreach (SpecialRule rule in ability.SpecialRules)
                {
                    clbSpecials.Items.Add(rule, true);
                }
            }

            //Add the rest of the rules, but don't add ones already added from the ability.
            SpecialRule nRule = new Acid();

            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new ArmorBuster();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Blast();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Blind();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new ChangeSpeed();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new ChangeStrength();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new ChangeMarksmanship();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new ChangeTech();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new CounterAttack();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Deafen();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new DrainTime();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Encase();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Explosion();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Fear();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new GreaterAcid();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new GreaterCounterAttack();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new GreaterIndirect();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new GreaterNoDeflect();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new GreaterNoDodge();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Heal();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new IdentifyFriendFoe();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Indirect();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Leap();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new NoArmorReduction();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new NoDeflect();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new NoDodge();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Paralyze();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new PoisonMalignant();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new PoisonResilient();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Pull();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Range();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new CharacterCreator.Classes.SpecialRules.Radius();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new RerollMisses();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new RerollHits();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Reach();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Roll();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Slam();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Stream();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Stun();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new SuperbAcid();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new SuperbCounterAttack();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new SuperbIndirect();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new SuperbNoDeflect();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new SuperbNoDodge();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new TechAttack();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new TechBlast();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new TechBlind();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new TechDeafen();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new TechExplosion();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new TechEncase();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new TechMelee();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new TechParalyze();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new TechRange();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Teleport();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Throw();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
            nRule = new Trip();
            if (!ability.SpecialRules.Contains(nRule))
            {
                clbSpecials.Items.Add(nRule);
            }
        }