Exemplo n.º 1
0
        public bodypart(ClassTypes ty, PartTypes pt, string name = " ",double str = 0, double def = 0, double intel = 0, double agil = 0, double end = 0)
        {
            Name = name;
            Abilities = new List<ability>();

            Class = ty;
            Part = pt;
            ClassPart = (ClassPartTypes)Enum.Parse(typeof(ClassPartTypes),Class.ToString() + Part.ToString());
            if (str + agil + def + intel + end != 0)
            {
                ability tempAbility = new ability("Base", new List<effect>()
                    {
                    new effect(Stats.statsType.STRENGTH, str, -1, false, true, " ", this.ClassPart),
                    new effect(Stats.statsType.AGILITY, agil, -1, false, true, " ", this.ClassPart),
                    new effect(Stats.statsType.INTELLIGENCE, intel, -1, false, true, " ", this.ClassPart),
                    new effect(Stats.statsType.ENDURANCE, end, -1, false, true, " ", this.ClassPart),
                    new effect(Stats.statsType.DEFENCE, def, -1, false, true, " ",this.ClassPart)
                    }, true, true, new mastery(), new Stats());
                this.AddAbility(tempAbility);
            }
        }
    public void ChangePart(string partName)
    {
//		Debug.Log ("Part changed to " + partName);
        pathName = "Part Database/" + partType.ToString() + "s/" + partName;

        partTitle.text = partName;
        if (partDisplay != null)
        {
            Destroy(partDisplay);
        }

        if (partType == PartTypes.Hull)
        {
            hData = Resources.Load <HullData> (pathName);
            if (hData == null)
            {
                Debug.LogError("No data found for " + partName);
            }

            //get all variables and add to statPanel
            partDisplay = Instantiate(hData.partVisuals);
            partDisplay.transform.SetParent(displayParent, false);

            partStats.text = "Integrity = " + hData.maxIntegrity +
                             "\nEnergy = " + hData.maxEnergy +
                             "\nMass = " + hData.mass +
                             "\nPairs = " + hData.maxPairs;
        }
        else if (partType == PartTypes.Weapon)
        {
            wData = Resources.Load <WeaponData> (pathName);
            if (wData == null)
            {
                Debug.LogError("No data found for " + partName);
            }

            //get all variables and add to statPanel
            partDisplay = Instantiate(wData.partVisuals);
            partDisplay.transform.SetParent(displayParent, false);

            partStats.text = "Integrity = " + wData.integrityMultiplier * 100 +
                             "%\nDamage = " + wData.damage +
                             "\nRate of Fire = " + wData.RoF +
                             "\nRange = " + wData.range;
            if (wData.force > 0)
            {
                partStats.text += "\nForce = " + wData.force;
            }
            if (wData.projectileSpeed > 0)
            {
                partStats.text += "\nProjectile Speed = " + wData.projectileSpeed;
            }
        }
        else if (partType == PartTypes.Movement)
        {
            mData = Resources.Load <MovementData> (pathName);
            if (mData == null)
            {
                Debug.LogError("No data found for " + partName);
            }

            //get all variables and add to statPanel
            partDisplay = Instantiate(mData.partVisuals);
            partDisplay.transform.SetParent(displayParent, false);

            string capacityText;
            if (mData.capacity > 0)
            {
                capacityText = mData.capacity.ToString();
            }
            else
            {
                capacityText = "Infinte";
            }
            partStats.text = "Integrity = " + mData.integrityMultiplier * 100 +
                             "%\nCapacity = " + capacityText +
                             "\nPower = " + mData.power +
                             "\nJump = " + mData.jumpPower +
                             "\nMax Speed = " + mData.maxSpeed.z;
        }
        else if (partType == PartTypes.Gadget)
        {
            gData = Resources.Load <GadgetData> (pathName);
            if (gData == null)
            {
                Debug.LogError("No data found for " + partName);
            }

            //get all variables and add to statPanel
            partStats.text = "TEST";
        }
    }
Exemplo n.º 3
0
 public void ChangePartType()
 {
     cam.ChangeCameraView(camPosNum);
     botSaver.ChangeActivePartType(partType.ToString());
 }