Esempio n. 1
0
 public void Attack(Attacks attack, bool isStrict = false)
 {
     /*if (attack == Attacks.Dash)
         StartCoroutine(PerformDash(isStrict));
     else*/
         StartCoroutine(PerformAoe(attack, isStrict));
 }
Esempio n. 2
0
	// Use this for initialization
	void Start () {
		audioScript = GameObject.Find("Mic").GetComponent<AudioManager>();
		attackManager = new Attacks(GetComponent<SpriteRenderer>().sprite, transform, playerProjectile, bulletSpeed);

		rapidFireTimer = 0;
		playerHealth = startingHealth;
		powerLevel = INIT_POWER_LEVEL;
	}
Esempio n. 3
0
 public void GoogleSampleThreeTribes()
 {
     Attacks attacks = new Attacks();
     Assert.AreEqual(6, attacks.Count(new Tribe[] {
         new Tribe(1, 2, 0, 5, 10, 2, 8, 0),
         new Tribe(0, 3, 0, 1, 7, 1, 2, 2),
         new Tribe(3, 3, 0, 5, 1, 1, 4, 0)
     }));
 }
Esempio n. 4
0
 void OnEnable()
 {
     playerAttack           = gameObject.GetComponent <Attacks>();
     playerstat             = gameObject.GetComponent <PlayerStat>();
     inventoryManager       = gameObject.GetComponent <InventoryManager>();
     IncreaseDamage         = false;
     IncreaseAttackSpeed    = false;
     IncreaseFortunePouch_1 = false;
     IncreaseFortunePouch_2 = false;
 }
Esempio n. 5
0
        private void ExecuteCreateCommand(string[] rest)
        {
            Behaviors behavior = Behaviors.Aggressive;

            behavior = (Behaviors)(Enum.Parse(typeof(Behaviors), rest[3]));
            Attacks attack = Attacks.PutridFart;

            attack = (Attacks)(Enum.Parse(typeof(Attacks), rest[4]));
            this.data.Add(rest[0], new Blob(rest[0], int.Parse(rest[1]), int.Parse(rest[2]), behavior, attack));
        }
 public override TimedMethod[] Use()
 {
     Attacks.SetAudio("Sword", 10);
     return(new TimedMethod[] { new TimedMethod(60, "Log", new object[] {
             Party.GetPlayer().GetName() + " attacked with the sword. It broke immediately"
         }),
                                new TimedMethod(0, "Audio", new object[] { "Big Swing" }), new TimedMethod(0, "StagnantAttack", new object[] {
             true, Party.GetPlayer().GetStrength() + 7, Party.GetPlayer().GetStrength() + 11, Party.GetPlayer().GetAccuracy(), true, true, false
         }) });
 }
Esempio n. 7
0
 public TimedMethod[] Poison()
 {
     TimedMethod[] poisonPart = new TimedMethod[] { new TimedMethod(60, "Log", new object[] { "miss" }), new TimedMethod("Null") };
     if (Attacks.EvasionCycle(this, Party.GetPlayer()))
     {
         poisonPart = Party.GetPlayer().status.Poison(2);
     }
     return(new TimedMethod[] { new TimedMethod(0, "Audio", new object[] { "Fumes" }),
                                new TimedMethod(60, "Log", new object[] { "The Megalomaniac sprayed poison fumes" }), poisonPart[0], poisonPart[1] });
 }
 public override TimedMethod[] Use()
 {
     Attacks.SetAudio("Blunt Hit", 15);
     return(new TimedMethod[] { new TimedMethod(60, "Log", new object[] {
             Party.GetPlayer().GetName() + " swung the textbook, sending pages everywhere"
         }),
                                new TimedMethod(0, "Audio", new object[] { "Big Swing" }), new TimedMethod(0, "StagnantAttack", new object[] {
             true, Party.GetPlayer().GetStrength() + 5, Party.GetPlayer().GetStrength() + 9, Party.GetPlayer().GetAccuracy() / 2, true, true, false
         }) });
 }
Esempio n. 9
0
    /// <summary>
    /// Gets the data for the game from a json file
    /// </summary>
    void getFileData()
    {
        StreamReader file = new StreamReader("Assets/kNNData/Attacks/" + pathIn + ".json");

        attacks = JsonUtility.FromJson <Attacks>(file.ReadToEnd());
        file.Close();

        file    = new StreamReader("Assets/kNNData/Defends/" + pathIn + ".json");
        defends = JsonUtility.FromJson <Defends>(file.ReadToEnd());
        file.Close();
    }
 public TimedMethod[] Grade()
 {
     if (Attacks.EvasionCycle(this, Party.GetPlayer()))
     {
         Party.UseSP(3);
         return(new TimedMethod[] { new TimedMethod(0, "Audio", new object[] { "Poison" }),
                                    new TimedMethod(60, "Log", new object[] { ToString() + " returned grades. -3 SP" }) });
     }
     return(new TimedMethod[] { new TimedMethod(0, "Audio", new object[] { "Poison" }),
                                new TimedMethod(60, "Log", new object[] { ToString() + " returned grades, but " + Party.GetPlayer().ToString() + " didn't care" }) });
 }
Esempio n. 11
0
    public static IAttack GetByEnum(Attacks attacks)
    {
        switch (attacks)
        {
        case Attacks.Peow:
            return(new Peow());

        default:
            return(null);    // No Attack was found
        }
    }
    public override TimedMethod[] Use()
    {
        Attacks.SetAudio("Blunt Hit", 6);
        int dmg = Party.GetPlayer().GetStrength();

        return(new TimedMethod[] { new TimedMethod(0, "Audio", new object[] { "Automatic" }),
                                   new TimedMethod(0, "StagnantAttack", new object[] { true, dmg, dmg, Party.GetPlayer().GetAccuracy(), true, false, false }),
                                   new TimedMethod(0, "StagnantAttack", new object[] { true, dmg, dmg, Party.GetPlayer().GetAccuracy(), true, false, false }),
                                   new TimedMethod(0, "StagnantAttack", new object[] { true, dmg, dmg, Party.GetPlayer().GetAccuracy(), true, false, false }),
                                   new TimedMethod(0, "StagnantAttack", new object[] { true, dmg, dmg, Party.GetPlayer().GetAccuracy(), true, true, false }) });
    }
Esempio n. 13
0
        private void CounterAttack(string id, IEnumerable <Combatant> targets, bool resetTurnTimer)
        {
            if (!Attacks.ContainsKey(id))
            {
                throw new GameDataException("Enemy '{0}' used undefined attack '{1}'", Name, id);
            }

            Attacks[id].Use(this, targets, new AbilityModifiers {
                CounterAttack = true, ResetTurnTimer = false
            });
        }
Esempio n. 14
0
 public override TimedMethod[] UseSupport(int i)
 {
     TimedMethod[] apathyPart = new TimedMethod[] { new TimedMethod(60, "Log", new object[] { "miss" }), new TimedMethod("Null") };
     if (Attacks.EvasionCycle(Party.members[i], Party.GetEnemy()))
     {
         apathyPart = Party.GetEnemy().status.CauseApathy(3);
     }
     return(new TimedMethod[] { new TimedMethod(0, "Audio", new object[] { "Filibuster" }), new TimedMethod(60, "Log", new object[] {
             Party.members[i].ToString() + " recited so much Pi it could lower self-esteem"
         }), apathyPart[0], apathyPart[1] });
 }
Esempio n. 15
0
        public Pikachu() : base("Pikachu", 60)
        {
            Weakness   weakness   = new Weakness(EnergyType.energyTypeName.Fire, 1.5);
            Resistance resistance = new Resistance(EnergyType.energyTypeName.Fighting, 20);

            Energytype = EnergyType.energyTypeName.Lighting;
            Attacks.Add(WindowsFormsApp1.Attack.attackName.ElectricRing);
            Attacks.Add(WindowsFormsApp1.Attack.attackName.PikaPunch);
            Weakness   = weakness;
            Resistance = resistance;
        }
Esempio n. 16
0
 public void Attack(Attacks attack)
 {
     if (Random.Range(0, 100) <= accuracy / attack.accuracy * 2)
     {
         //Attack hits
     }
     else
     {
         //AttackMisses
     }
 }
Esempio n. 17
0
        public Charmeleon() : base("Charmeleon", 60)
        {
            Weakness   weakness   = new Weakness(EnergyType.energyTypeName.Water, 2);
            Resistance resistance = new Resistance(EnergyType.energyTypeName.Lighting, 10);

            Energytype = EnergyType.energyTypeName.Fire;
            Attacks.Add(WindowsFormsApp1.Attack.attackName.HeadButt);
            Attacks.Add(WindowsFormsApp1.Attack.attackName.Flare);
            Weakness   = weakness;
            Resistance = resistance;
        }
Esempio n. 18
0
 public AttackModification(
     Change change,
     float amount,
     Attacks attackType,
     AttackAttribute attribute,
     IList <Flag>?modificationFlags = null) : base($"{nameof(Modification)}.{nameof(AttackModification)}", change, amount)
 {
     AttackType        = attackType;
     Attribute         = attribute;
     ModificationFlags = modificationFlags ?? new List <Flag>();
 }
Esempio n. 19
0
        public override void Unload(bool force)
        {
            base.Unload(force);

            if (force)
            {
                GrantedBuffStorage.Unload(GrantedBuffs);
                BuffImmunityStorage.Unload(BuffImmunities);
                AttackGuids = Attacks.ToGlobalIDList();
            }
        }
Esempio n. 20
0
 public virtual TimedMethod[] Forte()
 {
     Attacks.SetAudio("Blind", 15);
     if (Attacks.EvasionCheck(Party.GetPlayer(), GetAccuracy()))
     {
         Status.NullifyAttack(Party.GetPlayer());
     }
     return(new TimedMethod[] { new TimedMethod(60, "Log", new object[] { ToString() + " caused a forte" }),
                                new TimedMethod(0, "AudioAfter", new object[] { "Trumpet", 0 }),
                                new TimedMethod(0, "StagnantAttack", new object[] { false, 3, 3, GetAccuracy(), true, true, false }) });
 }
Esempio n. 21
0
    private void AttackCycle(GameObject obj)
    {
        Entity entity = obj.GetComponent <Entity> ();

        if (entity != null && entity.GetAffiliation() != this.faction)
        {
            attackTimer = attackDelaySeconds;
            Debug.Log("in here in ship");
            Attacks.ShootStart(projectile, this.transform.GetChild(0).gameObject, entity.gameObject, damage);
        }
    }
 public override TimedMethod[] Use()
 {
     if (Attacks.EvasionCheck(Party.GetEnemy(), Party.GetPlayer().GetAccuracy()))
     {
         Party.AddItem(this);
     }
     Attacks.SetAudio("Blunt Hit", 20);
     return(new TimedMethod[] { new TimedMethod(0, "Audio", new object[] { "Big Swing" }), new TimedMethod(0, "StagnantAttack", new object[] {
             true, Party.GetPlayer().GetStrength() + 4, Party.GetPlayer().GetStrength() + 4, Party.GetPlayer().GetAccuracy(), true, true, false
         }) });
 }
Esempio n. 23
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         DestroyImmediate(gameObject);
     }
 }
    public TimedMethod[] Shield()
    {
        int amount = new System.Random().Next(4, 9);

        GainGuard(amount);
        Attacks.SetAudio("Metal Hit", 20);
        return(new TimedMethod[] { new TimedMethod(60, "Log", new object[] { ToString() + " shield bashed" }),
                                   new TimedMethod(0, "Audio", new object[] { "Big Swing" }),
                                   new TimedMethod(0, "StagnantAttack", new object[] { false, 1, 3, GetAccuracy(), true, true, false }),
                                   new TimedMethod(0, "CharLogSprite", new object[] { amount.ToString(), Party.enemySlot - 1, "guard", false }) });
    }
Esempio n. 25
0
 public override TimedMethod[] Use()
 {
     if (Attacks.EvasionCycle(Party.GetPlayer().GetAccuracy() * 2, Party.GetEnemy()))
     {
         TimedMethod[] sleepPart = Party.GetEnemy().status.Sleep();
         return(new TimedMethod[] { new TimedMethod(0, "Audio", new object[] { "Hypnotize" }), sleepPart[0], sleepPart[1] });
     }
     else
     {
         return(new TimedMethod[] { new TimedMethod(0, "Audio", new object[] { "Hypnotize" }), new TimedMethod(60, "Log", new object[] { "miss" }) });
     }
 }
Esempio n. 26
0
 public void StartBarrageAttack(Attacks attackType)
 {
     if (attackType == Attacks.Light01 || attackType == Attacks.Light02)
     {
         isBarragingL = true;
     }
     else if (attackType == Attacks.Heavy01 || attackType == Attacks.Heavy02 || attackType == Attacks.Heavy03)
     {
         isBarragingH = true;
     }
     effectManager.SpawnEffect(EffectManager.Effects.mashIt, this.transform);
 }
Esempio n. 27
0
 // Start is called before the first frame update
 void Start()
 {
     cmp_ctrl      = GetComponent <PlayerController>();
     cmp_playerMod = GetComponent <PlayerModelo>();
     cmp_atk       = GetComponent <Attacks>();
     heart1        = GameObject.Find("Heart1");
     heart2        = GameObject.Find("Heart2");
     heart3        = GameObject.Find("Heart3");
     swordImage    = GameObject.Find("SwordImage");
     spearImage    = GameObject.Find("SpearImage");
     shieldImage   = GameObject.Find("Shield1");
 }
Esempio n. 28
0
        protected override void updateAttack()
        {
            if (This.gameTime.TotalGameTime >= attackStartTime + new TimeSpan(0, 0, 0, 1, 750) && isAttackAnimDone)
            {
                float         range   = 450.0f;
                List <Sprite> targets = (This.Game.CurrentLevel as FrostbyteLevel).allies;
                Sprite        target  = GetClosestTarget(targets, range);
                if (target != null)
                {
                    attackStartTime = This.gameTime.TotalGameTime;

                    int attackRange = 3;

                    //Create Fire Tier 1 Particle Emmiter
                    Effect          particleEffect      = This.Game.CurrentLevel.GetEffect("ParticleSystem");
                    Texture2D       fire                = This.Game.CurrentLevel.GetTexture("fireParticle");
                    ParticleEmitter particleEmitterFire = new ParticleEmitter(3000, particleEffect, fire);
                    particleEmitterFire.blendState = BlendState.AlphaBlend;
                    (particleEmitterFire.collisionObjects.First() as Collision_BoundingCircle).Radius = attackRange;
                    (particleEmitterFire.collisionObjects.First() as Collision_BoundingCircle).createDrawPoints();
                    particleEmitters.Add(particleEmitterFire);


                    mAttacks.Add(Attacks.T1Projectile(target,
                                                      this,
                                                      8,
                                                      3,
                                                      new TimeSpan(0, 0, 0, 0, 750),
                                                      attackRange,
                                                      6f,
                                                      false,
                                                      delegate(OurSprite attacker, Vector2 direction, float projectileSpeed, ParticleEmitter particleEmitter)
                    {
                        Random rand     = new Random();
                        Vector2 tangent = new Vector2(-direction.Y, direction.X);
                        for (int i = -5; i < 6; i++)
                        {
                            float velocitySpeed = rand.Next(30, 55);
                            float accelSpeed    = rand.Next(-30, -10);
                            particleEmitter.createParticles(direction * velocitySpeed,
                                                            direction * accelSpeed,
                                                            particleEmitter.GroundPos,
                                                            rand.Next(5, 20),
                                                            rand.Next(50, 300));
                        }
                    },
                                                      particleEmitterFire,
                                                      new Vector2(0, -38),
                                                      Element.Fire
                                                      ).GetEnumerator());
                }
            }
        }
 public TimedMethod[] Veto()
 {
     if (Attacks.EvasionCycle(this, Party.GetPlayer()))
     {
         Status.NullifyAttack(Party.GetPlayer()); Status.NullifyDefense(Party.GetPlayer());
         return(new TimedMethod[] { new TimedMethod(0, "Audio", new object[] { "Nullify" }),
                                    new TimedMethod(60, "Log", new object[] { "The Politician used the veto. Stats were countered" }),
                                    new TimedMethod(0, "CharLogSprite", new object[] { "atk reset", Party.playerSlot - 1, "nullAttack", false }),
                                    new TimedMethod(0, "CharLogSprite", new object[] { "def reset", Party.playerSlot - 1, "nullDefense", false }) });
     }
     return(new TimedMethod[] { new TimedMethod(60, "Log", new object[] { "The Politician used the veto. It failed" }) });
 }
Esempio n. 30
0
    public TimedMethod[] Meal(string food)
    {
        string message = "";

        TimedMethod[] statusPart = new TimedMethod[] { new TimedMethod(60, "Log", new object[] { "Miss" }), new TimedMethod("Null") };
        TimedMethod   audioPart  = new TimedMethod("Null");

        switch (food)
        {
        case "eat": message     = ToString() + " ate some food";
            Heal(8); statusPart = new TimedMethod[] { new TimedMethod(0, "CharLogSprite", new object[] { "8", Party.enemySlot - 1, "healing", false }),
                                                      new TimedMethod("Null") };
            audioPart = new TimedMethod(0, "Audio", new object[] { "Eat" });
            break;

        case "poison": message = ToString() + " chucked raw chicken";
            if (Attacks.EvasionCycle(this, Party.GetPlayer()))
            {
                statusPart = Party.GetPlayer().status.Poison(1);
            }
            audioPart = new TimedMethod(0, "Audio", new object[] { "Missile" });
            break;

        case "attack": message = ToString() + " chucked bread";
            if (Attacks.EvasionCycle(this, Party.GetPlayer()))
            {
                Party.GetPlayer().GainCharge(-6);
                statusPart[0] = new TimedMethod(0, "CharLogSprite", new object[] { "-6", Party.playerSlot - 1, "charge", true });
                statusPart[1] = new TimedMethod(0, "Audio", new object[] { "Nullify" });
            }
            audioPart = new TimedMethod(0, "Audio", new object[] { "Missile" });
            break;

        case "defense": message = ToString() + " chucked jello";
            if (Attacks.EvasionCycle(this, Party.GetPlayer()))
            {
                Party.GetPlayer().GainGuard(-6);
                statusPart[0] = new TimedMethod(0, "CharLogSprite", new object[] { "-6", Party.playerSlot - 1, "guard", true });
                statusPart[1] = new TimedMethod(0, "Audio", new object[] { "Slime" });
            }
            audioPart = new TimedMethod(0, "Audio", new object[] { "Missile" });
            break;

        case "stun": message = ToString() + " chucked pepper";
            if (Attacks.EvasionCycle(this, Party.GetPlayer()))
            {
                statusPart = Party.GetPlayer().status.Stun(3);
            }
            audioPart = new TimedMethod(0, "Audio", new object[] { "Powder" });
            break;
        }
        return(new TimedMethod[] { audioPart, new TimedMethod(60, "Log", new object[] { message }), statusPart[0], statusPart[1] });
    }
Esempio n. 31
0
 public override TimedMethod[] Use()
 {
     if (Attacks.EvasionCycle(Party.GetPlayer(), Party.GetEnemy()))
     {
         Party.GetEnemy().SetDefense(Party.GetEnemy().GetDefense() - 2);
         return(new TimedMethod[] { new TimedMethod(0, "Audio", new object[] { "Oil" }),
                                    new TimedMethod(60, "Log", new object[] { Party.GetEnemy().ToString() + " was covered in oil" }),
                                    new TimedMethod(0, "CharLogSprite", new object[] { "-2", Party.enemySlot - 1, "defense", false }) });
     }
     return(new TimedMethod[] { new TimedMethod(0, "Audio", new object[] { "Oil" }),
                                new TimedMethod(60, "Log", new object[] { Party.GetEnemy().ToString() + " was not covered in oil" }) });
 }
Esempio n. 32
0
 void Start()
 {
     refresh      = false;
     playerAttack = GameObject.Find("Player").gameObject.GetComponent <Attacks>();
     playerStat   = GameObject.Find("Player").gameObject.GetComponent <PlayerStat>();
     //-----------------Setting fire skill attribute------------------------
     fire_skill_cooldown  = playerAttack.fire_skill_cooldown;
     FireSkill.fillAmount = 0;
     //-----------------Setting moon skill attribute------------------------
     moon_skill_cooldown  = playerAttack.moon_skill_cooldown;
     MoonSkill.fillAmount = 0;
 }
 public override TimedMethod[] Use()
 {
     if (Attacks.EvasionCycle(Party.GetPlayer(), Party.GetEnemy()))
     {
         string message = Party.GetEnemy() + " lost attack";
         Status.NullifyAttack(Party.GetEnemy());
         return(new TimedMethod[] { new TimedMethod(0, "Audio", new object[] { "Trumpet" }),
                                    new TimedMethod(60, "Log", new object[] { Party.GetEnemy() + " lost attack" }),
                                    new TimedMethod(0, "CharLogSprite", new object[] { "atk reset", Party.enemySlot - 1, "nullAttack", false }) });
     }
     return(new TimedMethod[] { new TimedMethod(0, "Audio", new object[] { "Trumpet" }), new TimedMethod(60, "Log", new object[] { "miss" }) });
 }
Esempio n. 34
0
	public void ActivateSkill (Attacks currAtt) {
	
		att = currAtt;

		att.attSpeed = player.speed;


		if ((att.attID >= 5) && (att.attID <= 9)) {
			Enrage ();
		} else if ((att.attID >= 15) && (att.attID <= 19)) {
			Restore ();
		} else if ((att.attID >= 25) && (att.attID <= 29)) {
			Cupid ();
		}

	}
Esempio n. 35
0
        public static void Main(string[] args)
        {
            string inputname = args[0];
            string outputname = args[1];

            string[] lines = File.ReadAllLines(inputname);

            int ncases = int.Parse(lines[0]);
            int nline = 0;
            IList<string> results = new List<string>();
            Attacks attacks = new Attacks();

            for (int k = 0; k < ncases; k++)
            {
                Console.WriteLine(string.Format("Solving Case #{0}", k + 1));
                nline++;
                int ntribes = int.Parse(lines[nline]);
                IList<Tribe> tribes = new List<Tribe>();

                for (int j = 0; j < ntribes; j++)
                {
                    nline++;
                    string[] words = lines[nline].Split(' ');
                    int day = int.Parse(words[0]);
                    int nattacks = int.Parse(words[1]);
                    int west = int.Parse(words[2]);
                    int east = int.Parse(words[3]);
                    int strength = int.Parse(words[4]);
                    int ddays = int.Parse(words[5]);
                    int ddistance = int.Parse(words[6]);
                    int dstrength = int.Parse(words[7]);
                    Tribe tribe = new Tribe(day, nattacks, west, east, strength, ddays, ddistance, dstrength);
                    tribes.Add(tribe);
                }

                int count = attacks.Count(tribes);

                results.Add(string.Format("Case #{0}: {1}", k + 1, count));
            }

            File.WriteAllLines(outputname, results.ToArray());
        }
Esempio n. 36
0
 public AttackRegistry()
 {
     this.hackerAttacks = new Attacks("Hacker");
     this.shillAttacks = new Attacks("Shill");
     this.soldierAttacks = new Attacks("Soldier");
 }
Esempio n. 37
0
    void Roll()
    {
        if (!AllowRoll)
            return;

        if (Input.GetKeyDown(KeyCode.Space) && inputVector != Vector3.zero)
        {
            if (weaponMain != null)
                weaponMain.GetComponent<WeaponMelee>().weaponTrail.SetActive(false);

            prevAttack = Attacks.Right;
            stance = Stances.Roll;

            overrideRotation = inputVector.normalized;
            overrideMovement = overrideRotation * moveSpeedRoll;

            nextMoveTime = Time.time + (1f / 30f) * 20;
            nextRollTime = Time.time + (1f / 30f) * 20;
            nextAttackTime = Time.time + (1f / 30f) * 20;
            nextParryTime = Time.time + (1f / 30f) * 20;

            CmdAnimRoll();

            StopAllCoroutines();
            StartCoroutine(RollRoutine());
        }
    }
Esempio n. 38
0
    void AttackStarter(Attacks attack)
    {
        bool clockwise = false;
        switch (attack)
        {
            case Attacks.Left:
                clockwise = false;
                break;
            case Attacks.Right:
                clockwise = true;
                break;
        }

        StartCoroutine(AttackRoutine(attack, 25, 10, 10, 17));
        StartCoroutine(DamageRoutine(4, 1.4f, 1.8f, 160, 3, clockwise));
    }
Esempio n. 39
0
    private IEnumerator PerformAoe(Attacks attack, bool isStrict)
    {
        var aoe = NonStrictAoe[(int)attack];
        if(aoe == null)
            yield break;
        //aoe.gameObject.SetActive(true);
        var heading = _characterController.Heading;
        AoePivot.rotation = Quaternion.Euler(0, 0, Mathf.Atan2(heading.y, heading.x) / Mathf.PI * 180 + 90);

        yield return new WaitForSeconds(TimelineController.OffBeatBy());
        aoe.gameObject.SetActive(true);
        _characterController.WeaponAnimation = CharacterController.AnimType.Smash + (int)attack;

        var damage = 50;
        switch (attack)
        {
            case Attacks.Smash:
                damage = 50*13; //Team damage; expect to hit about 13
                yield return new WaitForSeconds(TimelineController.OffBeatBy());
                yield return new WaitForSeconds(OneBeat * 2f);
                FMODUnity.RuntimeManager.PlayOneShot(bossOverheadSound, Camera.main.transform.position);
                yield return new WaitForSeconds(OneBeat * 1f);
                aoe.DealDamage(damage);

                ScreenShakeManager.ScreenShake(3);
                yield return new WaitForSeconds(0.2f);
                break;
            case Attacks.Whirlwind:
                int tickAmount = 15;
                FMODUnity.RuntimeManager.PlayOneShot(bossWhirlwindSound, Camera.main.transform.position);
                for (int i = 0; i < tickAmount; i++)
                {
                    yield return new WaitForSeconds((i == 0 ? TimelineController.OffBeatBy() : 0) + OneBeat/4);
                    ScreenShakeManager.ScreenShakeContinuous(.7f);
                    aoe.DealDamage(damage / tickAmount);
                }
                break;
            case Attacks.Dash:
                heading.Normalize();
                float goUntil = Time.time + TimelineController.OffBeatBy() + OneBeat;
                FMODUnity.RuntimeManager.PlayOneShot(bossDashSound, Camera.main.transform.position);
                while (Time.time < goUntil)
                {
                    _characterController.SetDesiredSpeed(heading, true);
                    ScreenShakeManager.ScreenShakeContinuous(.7f);
                    yield return null;
                }
                break;
            case Attacks.Throw:
                FMODUnity.RuntimeManager.PlayOneShot(bossDashSound, Camera.main.transform.position);
                yield return new WaitForSeconds(TimelineController.OffBeatBy() + OneBeat );

                var go = (GameObject)Instantiate(swordPrefab, transform.position, Quaternion.identity);
                var swordThrow = go.GetComponent<SwordThrow>();

                Debug.Log("Start throw");
                yield return new WaitForSeconds(OneBeat * 2.5f);

                swordThrow.ComeBack(OneBeat/2);
                Debug.Log("End throw");
                yield return new WaitForSeconds(OneBeat / 2);

                break;
            default:
                yield return new WaitForSeconds(TimelineController.OffBeatBy() + OneBeat);
                aoe.DealDamage(damage);
                break;
        }

        if (_characterController.WeaponAnimation == CharacterController.AnimType.Smash + (int)attack)
            _characterController.WeaponAnimation = CharacterController.AnimType.Idle;
        aoe.gameObject.SetActive(false);
    }
Esempio n. 40
0
	public void RemoveSkill (Attacks currAtt) {

		att = currAtt;

		att.attSpeed = player.speed;

		if (wasActive) {
			if ((att.attID >= 5) && (att.attID <= 9)) {
				Calm ();
			} else if ((att.attID >= 25) && (att.attID <= 29)) {
				Alone ();
			}
		}

		wasActive = false;
	}
Esempio n. 41
0
	public void ChangeSpecAtt (int points) {

		if (itemData.item[15].openIt == true) {
			if (skPoints == 2) {
				currSpecSkill = attData.attacks [6];
				specSkill.sprite = currSpecSkill.attIcon;
			} else if (skPoints == 4) {
				currSpecSkill = attData.attacks [7];
				specSkill.sprite = currSpecSkill.attIcon;
			} else if (skPoints == 6) {
				currSpecSkill = attData.attacks [8];
				specSkill.sprite = currSpecSkill.attIcon;
			} else if (skPoints == 8) {
				currSpecSkill = attData.attacks [9];
				specSkill.sprite = currSpecSkill.attIcon;
			}
		} else if (itemData.item[16].openIt == true) {
			if (skPoints == 2) {
				currSpecSkill = attData.attacks [16];
				specSkill.sprite = currSpecSkill.attIcon;
			} else if (skPoints == 4) {
				currSpecSkill = attData.attacks [17];
				specSkill.sprite = currSpecSkill.attIcon;
			} else if (skPoints == 6) {
				currSpecSkill = attData.attacks [18];
				specSkill.sprite = currSpecSkill.attIcon;
			} else if (skPoints == 8) {
				currSpecSkill = attData.attacks [19];
				specSkill.sprite = currSpecSkill.attIcon;
			}
		} else if (itemData.item[17].openIt == true) {
			if (skPoints == 2) {
				currSpecSkill = attData.attacks [26];
				specSkill.sprite = currSpecSkill.attIcon;
			} else if (skPoints == 4) {
				currSpecSkill = attData.attacks [27];
				specSkill.sprite = currSpecSkill.attIcon;
			} else if (skPoints == 6) {
				currSpecSkill = attData.attacks [28];
				specSkill.sprite = currSpecSkill.attIcon;
			} else if (skPoints == 8) {
				currSpecSkill = attData.attacks [29];
				specSkill.sprite = currSpecSkill.attIcon;
			}
		}
	}
Esempio n. 42
0
 public void GoogleSampleTwoTribes()
 {
     Attacks attacks = new Attacks();
     Assert.AreEqual(5, attacks.Count(new Tribe[] { new Tribe(0, 3, 0, 2, 10, 2, 3, -2), new Tribe(10, 3, 2, 3, 8, 7, 2, 0) }));
 }
Esempio n. 43
0
	public void ChangeRegAtt (int points) {

		if (itemData.item[12].openIt == true) {
			if (attPoints == 2) {
				currRegSkill = attData.attacks [1];
				regSkill.sprite = currRegSkill.attIcon;
			} else if (attPoints == 4) {
				currRegSkill = attData.attacks [2];
				regSkill.sprite = currRegSkill.attIcon;
			} else if (attPoints == 6) {
				currRegSkill = attData.attacks [3];
				regSkill.sprite = currRegSkill.attIcon;
			} else if (attPoints == 8) {
				currRegSkill = attData.attacks [4];
				regSkill.sprite = currRegSkill.attIcon;
			}
		} else if (itemData.item[13].openIt == true) {
			if (attPoints == 2) {
				currRegSkill = attData.attacks [11];
				regSkill.sprite = currRegSkill.attIcon;
			} else if (attPoints == 4) {
				currRegSkill = attData.attacks [12];
				regSkill.sprite = currRegSkill.attIcon;
			} else if (attPoints == 6) {
				currRegSkill = attData.attacks [13];
				regSkill.sprite = currRegSkill.attIcon;
			} else if (attPoints == 8) {
				currRegSkill = attData.attacks [14];
				regSkill.sprite = currRegSkill.attIcon;
			}
		} else if (itemData.item[14].openIt == true) {
			if (attPoints == 2) {
				currRegSkill = attData.attacks [21];
				regSkill.sprite = currRegSkill.attIcon;
			} else if (attPoints == 4) {
				currRegSkill = attData.attacks [22];
				regSkill.sprite = currRegSkill.attIcon;
			} else if (attPoints == 6) {
				currRegSkill = attData.attacks [23];
				regSkill.sprite = currRegSkill.attIcon;
			} else if (attPoints == 8) {
				currRegSkill = attData.attacks [24];
				regSkill.sprite = currRegSkill.attIcon;
			}
		}
	}
Esempio n. 44
0
 public void OneTribe()
 {
     Attacks attacks = new Attacks();
     Assert.AreEqual(10, attacks.Count(new Tribe[] { new Tribe(10, 10, 0, 2, 6, 4, 3, 1) }));
 }
 public void Add(Attacks a, Rectangle pos)
 {
 }
Esempio n. 46
0
    IEnumerator AttackRoutine(Attacks attack, int animMoveFrame, int animRollFrame, int animAttackFrame, int animParryFrame)
    {
        prevAttack = attack;
        stance = Stances.Stand;

        nextMoveTime = Time.time + (1f / 30f) * animMoveFrame;
        nextRollTime = Time.time + (1f / 30f) * animRollFrame;
        nextAttackTime = Time.time + (1f / 30f) * animAttackFrame;
        nextParryTime = Time.time + (1f / 30f) * animParryFrame;

        CmdAnimAttack((int)attack);
        yield return new WaitForSeconds((1f / 30f) * animMoveFrame);

        prevAttack = Attacks.Right;
        overrideRotation = Vector3.zero;
    }
Esempio n. 47
0
	void Skills (Item item) {

		for (int i = 11; i < 17; i++) {
			itemData.item [i + 1].openIt = false;
			itemData.item [i + 1].Stock = 0;
		}

		item.openIt = true;
		Attacks newAtt = attData.GetAttByName (item.Name);
		Attacks oldAtt = new Attacks ();
//		Item oldItem = new Item ();

		if (newAtt.attType == Attacks.AttackType.Regular) {
			oldAtt = displays.currRegSkill;

			if ((oldAtt.attID >= 0) && (oldAtt.attID <= 4)) {
				//oldItem = itemData.GetItemByName(attData.attacks [0].attName);
			} else if ((oldAtt.attID >= 10) && (oldAtt.attID <= 14)) {
				//oldItem = itemData.GetItemByName(attData.attacks [10].attName);
			} else if ((oldAtt.attID >= 20) && (oldAtt.attID <= 24)) {
				//oldItem = itemData.GetItemByName(attData.attacks [20].attName);
			}
			displays.currRegSkill = newAtt;
			displays.regSkill.sprite = displays.currRegSkill.attIcon;
			displays.ChangeRegAtt (displays.attPoints);
		} else {

			oldAtt = displays.currSpecSkill;
			spec.RemoveSkill (oldAtt);

			if ((oldAtt.attID >= 5) && (oldAtt.attID <= 9)) {
				//oldItem = itemData.GetItemByName(attData.attacks [5].attName);
			} else if ((oldAtt.attID >= 15) && (oldAtt.attID <= 19)) {
				//oldItem = itemData.GetItemByName(attData.attacks [15].attName);
			} else if ((oldAtt.attID >= 25) && (oldAtt.attID <= 29)) {
				//oldItem = itemData.GetItemByName(attData.attacks [25].attName);
			}
			displays.currSpecSkill = newAtt;
			displays.specSkill.sprite = displays.currSpecSkill.attIcon;
			displays.ChangeSpecAtt (displays.skPoints);
		}

		//DropItem(oldItem);
	}
Esempio n. 48
0
        public MadnessofDeathwing()
        {
            // If not listed here use values from defaults
            #region Info
            Name = "Madness of Deathwing";
            Instance = "Dragon Soul";
            Content = new BossHandler.TierLevels[] { BossHandler.TierLevels.T13_LFR, BossHandler.TierLevels.T13_10, BossHandler.TierLevels.T13_25, BossHandler.TierLevels.T13_10H, BossHandler.TierLevels.T13_25H, };
            #endregion
            #region Basics
            Health = new float[] { 133927104f, 38221940f, 133927104f, 105990728f, 367274176f };
            MobType = (int)MOB_TYPES.DRAGONKIN;
            BerserkTimer = new int[] { 10 * 60, 10 * 60, 10 * 60, 10 * 60, 10 * 60 };
            SpeedKillTimer = new int[] { 5 * 60, 5 * 60, 5 * 60, 5 * 60, 5 * 60 };
            InBackPerc_Melee = new double[] { 0.95f, 0.95f, 0.95f, 0.95f, 0.95f };
            InBackPerc_Ranged = new double[] { 0.00f, 0.00f, 0.00f, 0.00f, 0.00f };
            Max_Players = new int[] { 25, 10, 25, 10, 25 };
            Min_Tanks = new int[] { 2, 2, 2, 2, 2 };
            Min_Healers = new int[] { 6, 3, 5, 3, 5 };
            #endregion
            #region Offensive
            #region Attacks
            for (int i = 0; i < 5; i++)
            {
                Phase Stage1 = new Phase() { Name = "Stage One: The Final Assault" };
                Phase Stage2 = new Phase() { Name = "Stage Two: The Last Stand" };

                Attack melee = new Attacks(GenAStandardMelee(this[i].Content));
                melee.DamagePerHit *= 1.25f;
                Stage1.Attack.add(melee);
                Stage2.Attack.add(melee);

                #region Stage One: The Final Assault
                /* Deathwing assaults his enemies as long as he is attached to the platforms by his twisted limbs.

                   Assault Aspect - Deathwing begins to search for his next enemy to assault. Deathwing will assault the platform with the largest number of players present on it that one of his limbs is still grasping onto.
                   Cataclysm - Deathwing attempts to finish the job he started by bringing forth a second Cataclysm, inflicting 1500001 Fire damage to all enemies.
                   Elementium Meteor - Deathwing creates an Elementium Meteor, sending it to the target platform.
                        Elementium Meteor - If the Elementium Meteor reaches it's destination it will inflict 400000 Fire damage to all enemies the damage decreases the further from the target location.
                   Hemorrhage - Deathwing's tentacle begins to Hemorrhage, causing several Regenerative Blood to spawn at a nearby location.
                        Regenerative Blood - The Regenerative Blood of Deathwing forms. Regenerative Blood's gain ten energy every 1 sec. Regenerative Blood's attacks additionally cause Degenerative Bite.
                            Regnerative - The Regenerative Blood will heal to full health when reaching max energy.
                            Degenerative Bite - Attacks cause Degenerative Bite which inflicts 1500 Shadow damage every 1 sec for 10 sec. Stacks.
                   Limb Tentacle - Deathwing is grasping onto each platform with one of his Limbs, holding him up.
                        Burning Blood - The Burning Blood gushes from the Tentacle, inflicting Fire damage every 2 sec. The damage is increased the lower health the Limb Tentacle is.
                        Blistering Tentacle - Every 20% health the Limb Tentacle sprouts several Blistering Tentacles.
                            Blistering Heat - The Blistering Heat inflicts 4000 Fire damage every 2 sec. Blistering Heat increases damage by 0 every stack. Stacks.
                        Agonizing Pain - The pain from severing Deathwing's limb interrupts his concentration, stunning him and inflicting 20% of his health in damage.
                   Tail Tentacle - Deathwing's Tail Tentacle appears shortly after assaulting a platform.
                        Crush - The crushing weight of the Tail Tentacle inflicts 75000 Physical damage to enemies in a cone in front of the Tail Tentacle.
                        Impale - The Tail Tentacle impales it's target, inflicting 400000 Physical damage split among enemies within 6 yards of the Impale target.
                */
                #endregion

                #region Stage Two: The Last Stand
                /* At 20% health Deathwing falls forward onto the platform.

                   Elementium Fragment - Pieces of Deathwing's armor begin to chip off, forming an Elementium Fragment at nearby locations.
                        Shrapnel - The Fragment fires a piece of Shrapnel at the target, inflicting 200000 Physical damage, piercing through armor.
                   Elementium Terror - Pieces of Deathwing's armor begin to chip off, forming an Elementium Terror at nearby locations.
                        Tetanus - The Elementium Terror's attacks cause Tetnus, inflicting 150000 Physical damage and an additional 30000 Physical damage every 1 sec. Stacks.
                   Corrupted Blood - The Corrupted Blood gushes from Deathwing, inflicting Fire damage every 2 sec. The damage is increased the lower health Deathwing is.
                */
                #region Aspects
                /* The great aspects assist in the fight against Deathwing. Each aspect will channel Expose Weakness on their respective Limb Tentacle when Deathwing begins to cast Cataclysm, increasing the damage done to the Tentacle by 200%. Additionally each aspect will begin to channel Concentration after it's respective tentacle is destroyed, preventing them from assisting the players with their presence and their special powers. When Phase two begins all of the aspects will resume assisting the champions.

                   Alexstrasza
                        Alexstrasza's Presence - The Presence of the great aspect Alexstrasza increases max health by 30%.
                        Cauterize - Alexstrasza begins to Cauterize the Blistering Tentacles, inflicting lethal damage over 10 sec.
                   Nozdormu
                        Nozdormu's Presence - The Presence of the aspect Nozdormu increases Haste by 30%.
                        Time Zone - Nozdormu forms a Time Zone at the target location, causing the Elementium Meteor to lapse in time, decreasing its travel speed dramatically when entering the Time Zone. Additionally any enemy creatures within the Time Zone have their attack speed decreased by 50%.
                   Ysera
                        Ysera's Presence - The Presence of the great aspect Ysera increases healing done by 30%.
                        Dreaming - The Presence of the great aspect Ysera allows players to enter the Dream, decreasing damage taken by 50%.
                   Kalecgos
                        Kalecgos' Presence - The Presence of the great aspect Kalecgos increases damage dealt by 30%.
                        Spell-Weaving - The Presence of the great aspect Kalecgos causes attacks and abilities to cause Spellweaving. Spellweaving inflicts 100000 Arcane damage to enemies within 8 yards, excluding the target.
                   Thrall
                        Carrying Winds - The Carrying Winds will take players to the adjacent platform. The Carrying Winds increase your move speed by 60%. Stacks.
                 */
                #endregion
                #endregion

                #region Add Phases
                int phaseStartTime = 0;
                float phase1length = this[i].BerserkTimer * 0.8f;
                ApplyAPhasesValues( Stage1, i, 1, phaseStartTime, phase1length, this[i].BerserkTimer);
                AddAPhase(Stage1, i);
                ApplyAPhasesValues( Stage2, i, 1, phaseStartTime, this[i].BerserkTimer - phase1length, this[i].BerserkTimer);
                AddAPhase(Stage2, i);
                #endregion

            }
            #endregion
            #endregion
            #region Defensive
            Resist_Physical = new double[] { 0, 0.00f, 0.00f, 0, 0 };
            Resist_Frost = new double[] { 0, 0.00f, 0.00f, 0, 0 };
            Resist_Fire = new double[] { 0, 0.00f, 0.00f, 0, 0 };
            Resist_Nature = new double[] { 0, 0.00f, 0.00f, 0, 0 };
            Resist_Arcane = new double[] { 0, 0.00f, 0.00f, 0, 0 };
            Resist_Shadow = new double[] { 0, 0.00f, 0.00f, 0, 0 };
            Resist_Holy = new double[] { 0, 0.00f, 0.00f, 0, 0 };
            #endregion
            #region Impedances
            for (int i = 0; i < 2; i++)
            {
                //Moves;
                //Stuns;
                //Fears;
                //Roots;
                //Disarms;
            }
            TimeBossIsInvuln = new float[] { 0, 0.00f, 0.00f, 0, 0 };
            #endregion
            /* TODO:
             * all
             */
        }
Esempio n. 49
0
 public void NoTribes()
 {
     Attacks attacks = new Attacks();
     Assert.AreEqual(0, attacks.Count(new Tribe[] { }));
 }
Esempio n. 50
0
	// Use this for initialization
	void Start () {
	
		database = GameObject.FindGameObjectWithTag ("Database");
		player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();
		foeBoss = GameObject.FindGameObjectWithTag ("Boss").GetComponent<Boss> ();

		attData = database.GetComponent<AttackDatabase> ();
		itemData = database.GetComponent<ItemData> ();

		sack.SetActive (sackactivity);

		for (int i = 0; i < 5; i++) {
			Image newIcon = Instantiate (permIcon);
			newIcon.transform.SetParent (sack.transform);
			newIcon.transform.localPosition = new Vector3 (-40, 50 - (i * 25), 0);
			newIcon.sprite = transparent;
			icons.Add (newIcon);
		}

		SackUpdate ();

		attackButton = attackStatusArea.transform.GetChild(2).gameObject;
		heartButton = heartStatusArea.transform.GetChild(2).gameObject;
		skillButton = skillStatusArea.transform.GetChild(2).gameObject;
		speedButton = speedStatusArea.transform.GetChild(2).gameObject;

		currRegSkill = attData.attacks [0];
		regSkill.sprite = currRegSkill.attIcon;

		currSpecSkill = attData.attacks [5];
		specSkill.sprite = currSpecSkill.attIcon;

		itemData.item [12].openIt = true;
		itemData.item [15].openIt = true;

		/*
		viewportPoint = Camera.main.WorldToViewportPoint(playerPos.transform.position);
		healthBarPos = new Vector2 (
			((viewportPoint.x * canvasRect.sizeDelta.x) - (canvasRect.sizeDelta.x * 0.5f)),
			((viewportPoint.y * canvasRect.sizeDelta.y) - (canvasRect.sizeDelta.y * 0.5f)));
		playerHealth.anchoredPosition = healthBarPos;
*/
		pause = false;
		pauseButton.SetActive (true);
		pauseUI.SetActive (false);
	}