예제 #1
0
 public List <GameObject> GetTilesInRange(RangeForm form, Vector2 mid, int minReach, int maxReach, Direction dir)
 {
     if (form == RangeForm.Square)
     {
         return(GetTilesInSquareRange(mid, minReach, maxReach));
     }
     else if (form == RangeForm.Straight)
     {
         return(GetTilesInStraightRange(mid, minReach, maxReach, dir));
     }
     else if (form == RangeForm.Cross)
     {
         return(GetTilesInCrossRange(mid, minReach, maxReach));
     }
     else if (form == RangeForm.DiagonalCross)
     {
         return(GetTilesInDiagonalCrossRange(mid, minReach, maxReach));
     }
     else if (form == RangeForm.Sector)
     {
         return(GetTilesInSectorRange(mid, minReach, maxReach, dir));
     }
     else if (form == RangeForm.Global)
     {
         return(GetTilesInGlobalRange());
     }
     else
     {
         return(GetTilesInSquareRange(mid, minReach, maxReach));            // temp return value.
     }
 }
예제 #2
0
파일: Skill.cs 프로젝트: yulcat/Epic_monad
	public Skill(string name, int level, int[] requireAPArray, int[] cooldownArray, 
                 Dictionary<string, float[]> powerFactor,
				 SkillType skillType,
				 RangeForm firstRangeForm, int firstMinReach, int firstMaxReach, int firstWidth,
				 RangeForm secondRangeForm, int secondMinReach, int secondMaxReach, int secondWidth,
				 SkillApplyType skillApplyType, float[] penetrationArray, 
				 string effectName, EffectVisualType effectVisualType, EffectMoveType effectMoveType)
	{
		this.name = name;
		this.level = level;
		this.requireAPArray = requireAPArray;
		this.cooldownArray = cooldownArray;
		this.powerFactor = powerFactor;
		this.skillType = skillType;
		this.firstRangeForm = firstRangeForm;
		this.firstMinReach = firstMinReach;
		this.firstMaxReach = firstMaxReach;
		this.firstWidth = firstWidth;
		this.secondRangeForm = secondRangeForm;
		this.secondMinReach = secondMinReach;
		this.secondMaxReach = secondMaxReach;
		this.secondWidth = secondWidth;
		this.skillApplyType = skillApplyType;
		this.penetrationArray = penetrationArray;
		this.effectName = effectName;
		this.effectVisualType = effectVisualType;
		this.effectMoveType = effectMoveType;
	}
예제 #3
0
        public ScreenLocRange(IScreenLoc From, IScreenLoc To, RangeForm rangeForm = RangeForm.Rectangular)
        {
            // make sure from preceeds to.
            if (To.CompareTo(From) < 0)
            {
                this.From = To;
                this.To   = From;
            }
            else
            {
                this.From = From;
                this.To   = To;
            }

            this.RangeForm = rangeForm;
        }
예제 #4
0
    public SkillInfo(string data)
    {
        CommaStringParser commaParser = new CommaStringParser(data);

        this.owner        = commaParser.Consume();
        this.requireLevel = commaParser.ConsumeInt();

        string name  = commaParser.Consume();
        int    level = 0;      // default level : 0

        this.column = commaParser.ConsumeInt();
        string originRequireAPString = commaParser.Consume();

        string[] requireAPStringArray = originRequireAPString.Split(' ');
        int[]    requireAPArray       = new int[5];

        for (int i = 0; i < 5; i++)
        {
            int parsed = 0;
            try
            {
                parsed = Int32.Parse(requireAPStringArray[i]);
            }
            catch
            {
                Debug.LogWarning("Parse error in requireAPs : " + originRequireAPString);
                parsed = -1;
            }
            requireAPArray[i] = parsed;
        }
        string originCooldownString = commaParser.Consume();

        string[] cooldownStringArray = originCooldownString.Split(' ');
        int[]    cooldownArray       = new int[5];
        for (int i = 0; i < 5; i++)
        {
            int parsed = 0;
            try
            {
                parsed = Int32.Parse(cooldownStringArray[i]);
            }
            catch
            {
                Debug.LogWarning("Parse error in requireAPs : " + originCooldownString);
                parsed = -1;
            }
            cooldownArray[i] = parsed;
        }

        // parsing coefficients for damage calculation
        string originStatTypeString = commaParser.Consume();

        string[] statTypeArray           = originStatTypeString.Split('/');
        string   originPowerFactorString = commaParser.Consume();

        string[]  powerFactorStringArray = originPowerFactorString.Split('/');
        float[][] powerFactorArrayArray  = new float[powerFactorStringArray.Length][];

        for (int i = 0; i < powerFactorStringArray.Length; i++)
        {
            powerFactorArrayArray[i] = new float[5];
            string[] powerFactorString = powerFactorStringArray[i].Split(' ');
            for (int j = 0; j < 5; j++)
            {
                float parsed = 0.0f;
                try
                {
                    parsed = Convert.ToSingle(powerFactorString[j]);
                }
                catch
                {
                    Debug.LogWarning("Parse error in powerFactors : " + originRequireAPString);
                    parsed = -1;
                }
                powerFactorArrayArray[i][j] = parsed;
            }
        }

        Dictionary <string, float[]> powerFactor = new Dictionary <string, float[]>();

        for (int i = 0; i < statTypeArray.Length; i++)
        {
            powerFactor.Add(statTypeArray[i], powerFactorArrayArray[i]);
        }

        SkillType skillType = commaParser.ConsumeEnum <SkillType>();

        RangeForm firstRangeForm = commaParser.ConsumeEnum <RangeForm>();
        int       firstMinReach  = commaParser.ConsumeInt();
        int       firstMaxReach  = commaParser.ConsumeInt();
        int       firstWidth     = commaParser.ConsumeInt();

        RangeForm secondRangeForm = commaParser.ConsumeEnum <RangeForm>();
        int       secondMinReach  = commaParser.ConsumeInt();
        int       secondMaxReach  = commaParser.ConsumeInt();
        int       secondWidth     = commaParser.ConsumeInt();

        SkillApplyType skillApplyType          = commaParser.ConsumeEnum <SkillApplyType>();
        string         originPenetrationString = commaParser.Consume();

        string[] penetrationStringArray = originPenetrationString.Split(' ');
        float[]  penetrationArray       = new float[5];
        for (int i = 0; i < 5; i++)
        {
            int parsed = 0;
            try
            {
                parsed = Int32.Parse(penetrationStringArray[i]);
            }
            catch
            {
                Debug.LogWarning("Parse error in penetrations : " + originPenetrationString);
                parsed = -1;
            }
            penetrationArray[i] = parsed;
        }

        string           effectName       = commaParser.Consume();
        EffectVisualType effectVisualType = commaParser.ConsumeEnum <EffectVisualType>();
        EffectMoveType   effectMoveType   = commaParser.ConsumeEnum <EffectMoveType>();

        this.skill = new Skill(name, level, requireAPArray, cooldownArray,
                               powerFactor,
                               skillType,
                               firstRangeForm, firstMinReach, firstMaxReach, firstWidth,
                               secondRangeForm, secondMinReach, secondMaxReach, secondWidth,
                               skillApplyType, penetrationArray,
                               effectName, effectVisualType, effectMoveType);
    }
예제 #5
0
        private void ovenrangetemp_btn_Click(object sender, EventArgs e)
        {
            RangeForm rangeform = new RangeForm();

            rangeform.ShowDialog();
        }
예제 #6
0
 public ScreenLocRange(IScreenLoc RowCol, RangeForm RangeForm = RangeForm.Rectangular)
 {
     this.From      = RowCol;
     this.To        = RowCol;
     this.RangeForm = RangeForm;
 }