예제 #1
0
 public Knife(Point initialPosition, IActor creator, IEnvironmentContainer environmentContainer)
     : base(null, initialPosition, environmentContainer)
 {
     Stats = new DefaultStats(Common.Settings.ActorSettings.DefaultSize, 1, 9, Common.Settings.ActorSettings.DaggerStepLength);
     _collisionResolver = new ProjectileCollisionResolver(creator, this);
     _animation         = new KnifeAnimation();
 }
예제 #2
0
    void ToAttack()
    {
        if (distance > lookRadius)
        {
            ToIdle();
        }
        //Am shooting now
        firing = true;

        agent.SetDestination(sprite.position);
        Animator anim = GetComponent <Animator>();

        anim.SetTrigger("ToAttack");

        x++;



        //    Debug.Log("Attack sent!");
        RaycastHit hit;

        //If statement if we hit something
        if (Physics.Raycast(sprite.transform.position, sprite.transform.forward, out hit, 200))
        {
            //   Debug.Log("All before");
            Transform meme = hit.transform;
            if (meme.gameObject.tag == "Player")
            {
                if (x % 50 == 0)
                {
                    //     Debug.Log("BEFORE");
                    KnifeAnimation.takeDamage(damage * Random.Range(0.5f, 1.5f));
                    //    Debug.Log("Attack");
                    x = 0;
                }
            }
        }

        else if (y == 2 || y == 1)
        {
            RaycastHit hits;
            //If statement if we hit something
            if (Physics.Raycast(sprite.transform.position, sprite.transform.forward, out hits, 200))
            {
                //    Debug.Log("All before");
                Transform meme = hits.transform;
                if (meme.gameObject.tag == "Player")
                {
                    if (x % 30 == 0)
                    {
                        //   Debug.Log("BEFORE");
                        KnifeAnimation.takeDamage(damage * Random.Range(0.5f, 1.5f));
                        //   Debug.Log("Attack");
                        x = 0;
                    }
                }
            }
        }
    }
예제 #3
0
    void OnTriggerEnter(Collider other)
    {
        //  Debug.Log("Collision");
        if (other.gameObject.tag == "Player")
        {
            if (KnifeAnimation.ammoMinigun < 1000 || KnifeAnimation.ammoMP < 500 || KnifeAnimation.ammoPistol < 100)
            {
                Debug.Log("Ammo Taken");

                KnifeAnimation.ammoMinigun += 1000;
                KnifeAnimation.ammoMP      += 500;
                KnifeAnimation.ammoPistol  += 100;
                KnifeAnimation.Ammo();


                this.gameObject.SetActive(false);
            }
        }
    }
예제 #4
0
 public Knife()
 {
     Cooldown  = WeaponSettings.KnifeCoolDown;
     Animation = new KnifeAnimation();
 }
예제 #5
0
 public BlazingHands()
 {
     Cooldown  = WeaponSettings.KnifeCoolDown;
     Animation = new KnifeAnimation();
 }