Ejemplo n.º 1
0
 public ScalpelSpaceship()
 {
     SpaceshipClassName        = "Scalpel";
     SpaceshipClassDescription = "STRONG ATTACK";
     Base_attack   = 12;
     Base_def      = 2;
     MaxHealth     = 800;
     CurrentHealth = MaxHealth;
     QSkill        = new BasicAttack();
     WSkill        = new SteeringMissile();
     ESkill        = new BlasterOrb();
     ASkill        = new OrionMove();
     SSkill        = new Teleporter();
     DSkill        = new CircleMove();
     ZSkill        = new MirrorShield();
     XSkill        = new Desant();
     CSkill        = new LaserBeam();
 }
Ejemplo n.º 2
0
    void ApplyHit(GameObject collider)
    {
        Killable targetKillable = collider.GetComponentInParent <Killable>();

        if (targetKillable != null && targetKillable.gameObject.layer != gameObject.layer && !mEnemiesHit.Contains(targetKillable))
        {
            // If the victim was the player & the player has a mirror shield, reflect!
            if (targetKillable.gameObject.layer == LayerMask.NameToLayer("Player"))
            {
                if (Game.instance.playerStats.IsItemEquipped <MirrorShield>())
                {
                    MirrorShield shield = Game.instance.playerStats.GetComponentInChildren <MirrorShield>();
                    shield.Reflect(this);
                    return;
                }
            }

            CharacterStatistics stats = targetKillable.GetComponent <CharacterStatistics>();
            int defense = stats == null ? 0 : stats.ModifiedStatValue(CharacterStatType.Defense, targetKillable.gameObject);
            int damage  = strength * 4 - defense * 2;
            mEnemiesHit.Add(targetKillable);

            targetKillable.TakeDamage(null, damage, DamageReason.Projectile);

            if (destroyOnEnemyHit)
            {
                Destroy(gameObject);

                PlayHitVFX();
            }
        }
        else
        {
            if (destroyOnEnvironmentHit)
            {
                Destroy(gameObject);

                PlayHitVFX();
            }
        }
    }