public bool CheckObjectTypes( BaseCommand command, Extensions ext, out bool items, out bool mobiles )
		{
			items = mobiles = false;

			ObjectConditional cond = ObjectConditional.Empty;

            foreach (BaseExtension check in ext)
            {
                if (check is WhereExtension)
                {
                    cond = (check as WhereExtension).Conditional;

                    break;
                }
            }

			bool condIsItem = cond.IsItem;
			bool condIsMobile = cond.IsMobile;

			switch ( command.ObjectTypes )
			{
				case ObjectTypes.All:
				case ObjectTypes.Both:
				{
					if ( condIsItem )
						items = true;

					if ( condIsMobile )
						mobiles = true;

					break;
				}
				case ObjectTypes.Items:
				{
					if ( condIsItem )
					{
						items = true;
					}
					else if ( condIsMobile )
					{
						command.LogFailure( "You may not use a mobile type condition for this command." );
						return false;
					}

					break;
				}
				case ObjectTypes.Mobiles:
				{
					if ( condIsMobile )
					{
						mobiles = true;
					}
					else if ( condIsItem )
					{
						command.LogFailure( "You may not use an item type condition for this command." );
						return false;
					}

					break;
				}
			}

			return true;
		}
 public void ExtensionsConstructorTest()
 {
     Extensions target = new Extensions();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
示例#3
0
        /// <summary>
        /// Quick and Easy Spellcasts params for Lux
        /// </summary>
        /// <param name="target"></param> Which unit should we cast spells on
        /// <param name="range"></param> Range check for targets
        /// <param name="spellslot"></param> Which spellslot 
        /// <param name="collision"></param> Collision Check for Q usage
        /// <param name="count"></param>  Only use said ability if it can hit X amount of enemies
        /// <param name="objectcheck"></param> Objectcheck for E usage
        public static void SpellCast(Obj_AI_Hero target, float range, Extensions.Spells spellslot, Spell spell, bool collision, byte count, bool objectcheck, HitChance Hitchance)
        {
            var CastPosition = Prediction.GetPrediction(target, 0.25f);
            //Sprediction SpellCast
            if (spell.IsReady() && target.IsValidTarget(range) && CastPosition.Hitchance >= Hitchance)
            {
                Extensions.CastSpell.Cast(spellslot, target);
            }

            if (collision)
            {
                Q1.SetSkillshot(0.25f, 200f, 1200f, false, SkillshotType.SkillshotLine);
            }
            //Collision check using Common.Prediction
            //var qcollision = Q1.GetCollision(player.Position.To2D(), new List<Vector2> { Q1.GetPrediction(target).CastPosition.To2D() });
            //var minioncol = qcollision.Where(x => (x is Obj_AI_Hero) && x.IsEnemy).Count();

            //Sprediction - Collision Cast
            if (spell.IsReady() && target.IsValidTarget(range) && collision && CastPosition.Hitchance >= Hitchance)
            {
                Extensions.CastSpell.Cast(spellslot, target);
            }

            //Insert E cast information
            if (Lux_E == null && spell.IsReady() && objectcheck && target.IsValidTarget(E1.Range) && CastPosition.Hitchance >= Hitchance)
            {
                Extensions.CastSpell.Cast(spellslot, target);
            }
        }
示例#4
0
 public SpreadsheetModel(Extensions extensions)
 {
     _extensions = extensions;
 }