예제 #1
0
        public override void Setup(Beast beast, GameObject holder)
        {
            base.Setup(beast, holder);
            SpriteRenderer r = Leaves.First().GetComponent <SpriteRenderer>();

            Leaves.First().transform.localPosition = startPos;             //100 pixels per unit
        }
예제 #2
0
        //Add

        /// <summary>
        /// Moves the given beast to the front of the team.
        /// </summary>
        /// <param name="beast"></param>
        public void MoveToFront(Beast beast)
        {
            UnityEngine.Debug.LogFormat("Moving {0} to front of team", beast.data.dataName);
            if (Members.Contains(beast))
            {
                Members.Remove(beast);
                Members.Insert(0, beast);
            }
        }
예제 #3
0
 /// <summary>
 /// Add an existing beast to team
 /// </summary>
 /// <param name="beast"></param>
 /// <returns></returns>
 public Team Add(Beast beast)
 {
     if (!Contains(beast))
     {
         Members.Add(beast);
     }
     else
     {
         UnityEngine.Debug.Log("Tried to add duplicate beast to team");
     }
     return(this);
 }
예제 #4
0
        public string Stat;         //Generic.Constants.Stat value to use

        public MoveType(MoveData data, Beast user)
        {
            //All info has already been validated in Generic.CustomXmlReader
            this.data     = data;
            User          = user;
            Name          = data.Name;
            Essence       = data.Essence;
            Focus         = data.Focus;
            Stat          = data.Stat;
            stateInternal = MoveState.Selected;
            waitInternal  = Wait.None;
        }
예제 #5
0
 public virtual void Setup(Beast beast, GameObject holder)
 {
     Textures = new List <FileInfo>();
     foreach (XmlNode li in beast.data.ModelProps["textures"])
     {
         if (File.Exists(li.InnerText))
         {
             Textures.Add(new FileInfo(li.InnerText));
         }
     }
     Pivot = this.gameObject;
     Pivot.transform.SetParent(holder.transform);
     Leaves = new List <GameObject>();
     Beast  = beast;
 }
예제 #6
0
        public override void Setup(Beast beast, GameObject holder)
        {
            base.Setup(beast, holder);

            GameObject lightObject = new GameObject("Glow");

            lightObject.transform.localPosition = Leaves.First().transform.localPosition;
            lightObject.transform.SetParent(Leaves.First().transform);
            int[] colors = Array.ConvertAll(beast.data.ModelProps["color"].InnerText.Split(','), int.Parse);

            Color color     = new Color(colors[0] / 255f, colors[1] / 255f, colors[2] / 255f);
            float intensity = float.Parse(beast.data.ModelProps["intensity"].InnerText);
            Light light     = lightObject.AddComponent <Light>();

            light.color     = color;
            light.intensity = intensity;
            //Debug.Log(lightObject.transform.localPosition);
        }
예제 #7
0
        //Untested
        public bool Switch(Beast beastOut, Beast beastIn)
        {
            //UnityEngine.Debug.LogFormat("Switching out {0} for {1}", beastOut.data.dataName, beastIn.data.dataName);
            if (!beastIn.Equals(beastOut) && Contains(beastOut) && Contains(beastIn))
            {
                int moveTo   = Members.IndexOf(beastOut);
                int moveFrom = Members.IndexOf(beastIn);

                Members.Remove(beastOut);
                Members.Remove(beastIn);
                Members.Insert(moveTo, beastIn);
                Members.Insert(moveFrom, beastOut);
                return(true);
            }
            else
            {
                UnityEngine.Debug.LogFormat("Failed to switch {0} with {1}", beastOut, beastIn);
                return(false);
            }
        }
예제 #8
0
        public override void Setup(Beast beast, GameObject holder)
        {
            base.Setup(beast, holder);

            GameObject leaf = GameObject.CreatePrimitive(PrimitiveType.Quad);

            leaf.transform.SetParent(Pivot.transform);
            leaf.name = this.GetType().Name;
            MeshRenderer r = leaf.GetComponent <MeshRenderer>();

            byte[]    bytes   = System.IO.File.ReadAllBytes(Textures.First().FullName);
            Texture2D texture = new Texture2D(1, 1);

            texture.LoadImage(bytes);

            r.material             = Resources.Load <Material>("BeastLeaf");
            r.material.mainTexture = texture;

            leaf.transform.localScale    = new Vector3((texture.width * 0.5f) * 0.01f, (texture.width * 0.5f) * 0.01f);
            leaf.transform.localPosition = new Vector3(0f, (texture.height * 0.25f) * 0.01f);             //100 pixels per unit
            Leaves.Add(leaf);
        }
예제 #9
0
        public float BaseDamage;         //Before stat adjustments

        public MoveType_BasicDamage(MoveData data, Beast user) : base(data, user)
        {
            BaseDamage = float.Parse(CustomXmlReader.GetContent(data.MoveProps, "BaseDamage"));
        }
예제 #10
0
 public MoveType_EssenceDamage(MoveData data, Beast user) : base(data, user)
 {
     BaseDamage    = float.Parse(Generic.CustomXmlReader.GetContent(data.MoveProps, "BaseDamage"));
     DamageEssence = Generic.CustomXmlReader.GetValidContent(data.MoveProps, "DamageEssence", "Essence");
 }
예제 #11
0
 public bool Contains(Beast beast) => Members.Contains(beast);
예제 #12
0
 public override void Setup(Beast beast, GameObject holder)
 {
     base.Setup(beast, holder);
 }