Esempio n. 1
0
    private GameObject target = null;                                                                                                                   //target object
    //-----------------------------------------------------------------------------------------------------------------------------

    new void Start()
    {
        if (active)
        {
            return;
        }
        cSlice = this.gameObject.AddComponent <CombatSlice>();                                                                  //instantiate a new combat Slice
        base.Start();                                                                                                           //fire up the entity
        //turret is idle until init is called.
        active = true;
        init(ownerID);
    }
Esempio n. 2
0
    public void init(Camp camp, Overlord ol)
    {
        this.camp     = camp;
        this.overlord = ol;

        stats        = new EntityStats();
        stats.attack = 10000;
        cSlice       = this.gameObject.AddComponent <CombatSlice>();
        //cSlice = new CombatSlice();
        cSlice.init(stats, this, null, null);
        active = true;
    }
Esempio n. 3
0
    new public void Start()
    {
        playerCamera.enabled = false;
        anim            = this.transform.GetComponent <Animator>();
        controllerState = Vector2.zero;

        stats = new EntityStats();
        stats.statsInit();
        cSlice = this.gameObject.AddComponent <CombatSlice>();
        cSlice.rangedAttackLength = 1.0f;
        respawnPoint          = transform.position;
        oldControllerStateR.x = 0;
        oldControllerStateR.y = 1;
        audio = this.GetComponentInParent <PlayerAudio>();
    }
Esempio n. 4
0
    void OnCollisionStay(Collision col)
    {
        //player attacks override enemy attacks
        if (col.gameObject.tag == "Enemy" && cSlice.getState() != CombatSlice.combatState.ATTACK)
        {
            FollowTest lame = col.gameObject.GetComponent <FollowTest>();
            Debug.Log(lame.ToString());
            CombatSlice cs = lame.getSlice();

            //...but not if the enemy attacked first
            if (cs.getState() == CombatSlice.combatState.ATTACK)
            {
                EntityStats es  = col.gameObject.GetComponent <FollowTest>().stats;
                float       esa = es.attack * 4;
                cSlice.damage(esa, es);
            }
        }
    }
Esempio n. 5
0
 new public void Start()
 {
     cSlice = this.gameObject.AddComponent <CombatSlice>();
     audio  = this.GetComponentInParent <TurretAudio>();
     base.Start();
 }