Exemplo n.º 1
0
    bool Checkpickup(GameObject col)
    {
        bool output = false;

        WeaponAttachPoint wap = col.GetComponent <WeaponAttachPoint>();

        if (wap != null && heldobj && col.transform.childCount < 1 && ((wap.equipment == true && heldobj.GetComponent <WeaponBaseClass>().equipment == true) || (wap.special == true && heldobj.GetComponent <WeaponBaseClass>().special == true)))
        {
            bool            check = true;
            WeaponBaseClass bas   = heldobj.GetComponent <WeaponBaseClass>();
            if (heldobj.GetComponent <_Ship>())
            {
                check = GameObject.Find("Fleet Builder Parent").GetComponent <FleetBuilderController>().enough(bas.cost);
                if (check)
                {
                    col.transform.parent.GetComponent <AttachPointsController>().AttachShip(heldobj);
                    tempheld   = heldobj;
                    heldobj    = null;
                    respawnnow = true;
                }
            }
            else
            {
                heldobj.transform.parent        = col.gameObject.transform;
                heldobj.transform.localPosition = new Vector3(0, 0, 0);
                heldobj.transform.rotation      = new Quaternion(0, 0, 0, 0);
                tempheld   = heldobj;
                heldobj    = null;
                respawnnow = true;
            }
        }
        return(output);
    }
    public void GatherWeaponAttackStats(WeaponBaseClass weaponRef)
    {
        _cachedWeapon = weaponRef;

        _weaponCalculatedBaseDamage   = weaponRef.calculatedBaseDamage;   //
        _weaponSuccessShotProbability = weaponRef.successShotProbability; //
        _weaponCriticalChance         = weaponRef.weaponCriticalChance;   //
        _weaponCriticalDamage         = weaponRef.weaponCriticalDamage;   //
    }
Exemplo n.º 3
0
    public void powerUpPickUp(WeaponBaseClass wi)
    {
        // should be called on collision with a power up
        // changes weapon associated with player

        // ...

        // if the pickup is able to timeout, then we should reset bullet somehow
        // but im not concerned with that rn
    }
Exemplo n.º 4
0
 void checkpickuptrigger(GameObject col)
 {
     if (col.gameObject.tag == "Pickup" && triggerdown && transform.childCount < (childcountstart + 1) && heldobj == null && grabbedobject == null)
     {
         if (col.transform.parent.GetComponent <WeaponAttachPoint>())
         {
             col.GetComponent <WeaponBaseClass>().reset(0);
         }
         else
         {
             WeaponBaseClass bas = col.GetComponent <WeaponBaseClass>();
             bas.scaletosize();
             Debug.Log(transform.childCount < (childcountstart + 1));
             col.transform.parent        = transform;
             col.transform.localPosition = new Vector3(0, 0, 0);
             bas.disabletext();
             heldobj = col.gameObject;
         }
     }
 }