Ejemplo n.º 1
0
        private void EffectForm_Shown(object sender, EventArgs e)
        {
            if (ConditionBtn.Checked)
            {
                ConditionBox.Focus();
                ConditionBox.SelectAll();
            }

            if (DamageBtn.Checked)
            {
                DamageBox.Focus();
                DamageBox.Select(0, 1);
            }

            if (DefenceBtn.Checked)
            {
                DefenceModBox.Focus();
                DefenceModBox.Select(0, 1);
            }

            // Damage mods - do nothing

            if (RegenBtn.Checked)
            {
                RegenValueBox.Focus();
                RegenValueBox.Select(0, 1);
            }

            if (AuraBtn.Checked)
            {
                AuraRadiusBox.Focus();
                AuraRadiusBox.Select(0, 1);
            }
        }
Ejemplo n.º 2
0
        public override void Attack()
        {
            var box = new DamageBox(new BoundingSphere(new Vector3(actor.Collision.Position.X, characterManager.GetPlayer().Collision.Position.Y, actor.Collision.Position.Z) + (actor.GetKeepAttackAngle() * (actor.Collision.Radius * 2)), 4), 1, actor.Tag, actor.GetAttack(), actor.GetKeepAttackAngle());

            characterManager.AddHitBox(box);
            actor.Sound("attack1");
            particleManager.AddParticle(new Slash(actor, box.collision.Center, "slash"));
        }
	void Start () {
		unitinfo = transform.parent.GetComponent<DamageBox>();
		if (unitinfo != null)
		{
			Team = unitinfo.Team;
		} else {
			Team = -1;
		}
	}
Ejemplo n.º 4
0
    void GiveSpellDamage(int attackNumber)
    {
        this.attackNumber[curSpellTitle] = attackNumber;
        attackNumber--;
        GameObject  _inst;
        int         _targetLayer = 12;
        PlayerSpell _spell       = curSpell.spell;
        Vector2     _boxPosition = Vector2.zero;

        switch (curSpell.spell.useType)
        {
        case SpellUseTypes.Single:
            Invoke("NextAnimation", _spell.timeBtwAttack[attackNumber]);     // Start next attack after delay
            break;

        case SpellUseTypes.Charging:
            chargingDamageMultiplier = chargingDamageMultiplier > 0f ? chargingDamageMultiplier : 1f;
            Invoke("NextAnimation", _spell.timeBtwAttack[attackNumber]);     // Start next attack after delay
            break;

        case SpellUseTypes.Multiuse:
            StartCoroutine(TimeToNextUseSpell(curSpellTitle, curSpell.spell.timeToUse));
            Invoke("SetSpellToWaitingState", _spell.timeBtwAttack[attackNumber]);
            break;
        }

        switch (_spell.type)
        {
        case SpellTypes.Melee:
            _boxPosition = attack.weapon.position;
            _inst        = Instantiate(attack.damageBox, transform);
            DamageBox _damageBox = _inst.GetComponent <DamageBox>();
            _damageBox.GetParameters(_spell.damage[attackNumber], _spell.damageType[attackNumber], _spell.element, _boxPosition, _spell.damageRange[attackNumber], _spell.timeBtwAttack[attackNumber], _spell.audioImpact, _targetLayer, attributes, true);
            break;

        case SpellTypes.MeleeAOE:
            _boxPosition = myTransform.position;
            _inst        = Instantiate(_spell.spellPrefab, _boxPosition, _spell.spellPrefab.transform.rotation, myTransform);
            _inst.GetComponent <SpellDamageAOE>().SetParameters(_spell, curSpellTitle, attackNumber);
            break;

        case SpellTypes.Range:
            _boxPosition = attack.weapon.position;
            curSpell.GiveSpellDamage(this, _boxPosition);
            break;

        case SpellTypes.RangeAOE:
            _boxPosition = new Vector2(attack.weapon.position.x + _spell.castDistance[attackNumber], attack.weapon.position.y);
            break;
        }
    }
Ejemplo n.º 5
0
        public override void Attack()
        {
            var box = new DamageBox(
                new BoundingSphere(new Vector3(actor.Collision.Position.X, characterManager.GetPlayer().Collision.Position.Y, actor.Collision.Position.Z) + (actor.GetKeepAttackAngle() * ((actor.Collision.Radius / 2) + startRange))
                                   , actor.Collision.Radius)
                , 1
                , actor.Tag
                , actor.GetAttack()
                , actor.GetKeepAttackAngle()
                , buffType
                );

            characterManager.AddHitBox(box);
            actor.Sound(seName);
            particleManager.AddParticle(new Slash(actor, box.collision.Center, textureName));
        }
Ejemplo n.º 6
0
    void GiveDamage()
    {
        if (!movement.isAttacking)
        {
            return;
        }

        attackState         = AttackState.Damage;
        movement.canFlip    = false;
        curDelayResetCombo  = Time.time + delayResetCombo;
        curForceDurtaion    = Time.time + forceDuration;
        attributes.Stamina -= staminaCosts;

        if (weaponAttackType != WeaponAttackType.Melee)
        {
            shellObj = Instantiate(shellPrefab, transform.position, Quaternion.Euler(0f, 0f, rotZ));
            shell    = shellObj.GetComponent <Shell>();
            shell.SetParameters(damage, weaponDamageType, weaponElement, shellSpeed, shellFlyTime, weaponImpactClip);
        }
        else
        {
            if (attackType == AttackTypes.TopDown)
            {
                rigidBody.AddForce(Vector2.up * -attackForceDistance, ForceMode2D.Impulse);
            }
            else
            {
                rigidBody.AddForce(Vector2.right * movement.direction * attackForceDistance, ForceMode2D.Impulse);
            }

            GameObject _inst       = Instantiate(damageBox, transform);
            DamageBox  _damageBox  = _inst.GetComponent <DamageBox>();
            int        targetLayer = 12;
            _damageBox.GetParameters(damage, weaponDamageType, weaponElement, weapon.position, new Vector2(attackRangeX, attackRangeY), attackDuration - Time.time, weaponImpactClip, targetLayer, attributes);
        }

        AudioManager.PlayAttackAudio(weaponAudioClip);
    }
Ejemplo n.º 7
0
 private void Damage_Click(object sender, RoutedEventArgs e)
 {
     DamageBox box = new DamageBox(armour, prowarmour, crewloss, moraleloss);
     bool? ran = box.ShowDialog();
     if (ran.HasValue && ran.Value)
     {
         Starship.CurrentIntegrity -= box.HullLost;
         Starship.CurrentMorale -= box.MoraleLost;
         Starship.CurrentCrew -= box.CrewLost;
         UpdateHullIntegrity();
         UpdateMorale();
         UpdateCrewPopulation();
     }
 }
	// Use this for initialization
	void Start () {
		unitinfo = gameObject.GetComponent<DamageBox>();
		movement = gameObject.GetComponent<Movement>();
	}