Beispiel #1
0
    public Projectile(GameInstance parent, float initX, float initY, ObjectField objectField, ObjectProjectile objectProjectile)
        : base(parent.Rect.point.layer, initX, objectField, parent.ToLeft)
    {
        Move(new Vector2(0, initY));

        this.objectProjectile = objectProjectile;
        this.parent = parent;
    }
Beispiel #2
0
    public void ParryTarget(GameObject targetOBJ)
    {
        if (targetOBJ.tag == "Enemy")
        {
            SoundManager.GetInstance().photonView.RPC("PlaySFXNetworked", PhotonTargets.All, "RiposteSound", transform.position);

            //get the AI component form the AI
            AI targetAI = targetOBJ.GetComponent <AI>();

            //apply force to the AI accross the network
            //targetAI.ApplyForceOverNetwork(transform.forward * 3.0f, ForceMode.VelocityChange);

            //calculate the damage that the AI would take
            //((parry timer (amount of time in parry) * 50) + 50) * 0.01 gets a percentage between 0.5 and 1.5 then that value gets multiplied by the samurai's base damage to get the amount done to the enemy
            int damageDealt = (int)((((m_ParryTimer * 50) + 50) * 0.01) * MeleeDamage);
            TempDamageBoost   += damageDealt;
            m_ParryDamageBoost = damageDealt;

            //deal damage to the AI accross the network
            //targetAI.photonView.RPC("TakeDamage", PhotonTargets.All, PlayerNumber, damageDealt, null, 1);
        }
        else
        {
            //get the object projectile that is going to be fired back at the enemy
            ObjectProjectile targetProjectile = targetOBJ.GetComponent <ObjectProjectile>();

            targetProjectile.IsBeingReflected = true;

            //set the force of the object to be zero
            targetProjectile.photonView.RPC(
                "FireProjectile",
                PhotonTargets.All,
                targetProjectile.transform.position,
                transform.forward,
                PlayerNumber,
                m_WeaponLayerMask,
                targetProjectile.Damage,
                null);
        }

        EventParryFinished();
    }
Beispiel #3
0
    public ProjectileCustom(GameInstance parent, float initX, float initY, ObjectField objectField, ObjectProjectile objectProjectile, Action action)
        : base(parent, initX, initY, objectField, objectProjectile)
    {
        List<VectorEntity> pattern = VectorGenerator.Custom(objectProjectile.Speed, objectProjectile.SpeedY, objectProjectile.Gravity, parent.ToLeft);
        //pattern.Add(new LinearVelocity(parent.Velocity));
        SetMove(pattern);

        InitAction(action);
    }