本文整理汇总了C#中System.Vector2.CheckDangerousPos方法的典型用法代码示例。如果您正苦于以下问题:C# Vector2.CheckDangerousPos方法的具体用法?C# Vector2.CheckDangerousPos怎么用?C# Vector2.CheckDangerousPos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Vector2
的用法示例。
在下文中一共展示了Vector2.CheckDangerousPos方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitPositionInfo
public static PositionInfo InitPositionInfo(Vector2 pos, float extraDelayBuffer, float extraEvadeDistance, Vector2 lastMovePos, Spell lowestEvadeTimeSpell) //clean this shit up
{
if (!ObjectCache.myHeroCache.isMoving &&
ObjectCache.myHeroCache.serverPos2D.Distance(pos) <= 75)
{
pos = ObjectCache.myHeroCache.serverPos2D;
}
var extraDist = ObjectCache.menuCache.cache["ExtraCPADistance"].GetValue<Slider>().Value;
var posInfo = CanHeroWalkToPos(pos, ObjectCache.myHeroCache.moveSpeed, extraDelayBuffer + ObjectCache.gamePing, extraDist);
posInfo.isDangerousPos = pos.CheckDangerousPos(6);
posInfo.hasExtraDistance = extraEvadeDistance > 0 ? pos.CheckDangerousPos(extraEvadeDistance) : false;// ? 1 : 0;
posInfo.closestDistance = posInfo.distanceToMouse; //GetMovementBlockPositionValue(pos, lastMovePos);
posInfo.intersectionTime = GetMinCPADistance(pos);
//GetIntersectDistance(lowestEvadeTimeSpell, ObjectCache.myHeroCache.serverPos2D, pos);
//GetClosestDistanceApproach(lowestEvadeTimeSpell, pos, ObjectCache.myHeroCache.moveSpeed, ObjectCache.gamePing, ObjectCache.myHeroCache.serverPos2D, 0);
posInfo.distanceToMouse = pos.GetPositionValue();
posInfo.posDistToChamps = pos.GetDistanceToChampions();
posInfo.speed = ObjectCache.myHeroCache.moveSpeed;
if (ObjectCache.menuCache.cache["RejectMinDistance"].GetValue<Slider>().Value > 0
&& ObjectCache.menuCache.cache["RejectMinDistance"].GetValue<Slider>().Value >
posInfo.closestDistance) //reject closestdistance
{
posInfo.rejectPosition = true;
}
if (ObjectCache.menuCache.cache["MinComfortZone"].GetValue<Slider>().Value >
posInfo.posDistToChamps)
{
posInfo.hasComfortZone = false;
}
return posInfo;
}
示例2: InitPositionInfo
public static PositionInfo InitPositionInfo(Vector2 pos, float extraDelayBuffer, float extraEvadeDistance, Vector2 lastMovePos, Spell lowestEvadeTimeSpell) //clean this shit up
{
if (!GameData.HeroInfo.IsMoving &&
GameData.HeroInfo.ServerPos2D.Distance(pos) <= 75)
{
pos = GameData.HeroInfo.ServerPos2D;
}
var extraDist = ConfigValue.ExtraCpaDistance.GetInt();
var posInfo = CanHeroWalkToPos(pos, GameData.HeroInfo.MoveSpeed, extraDelayBuffer + Game.Ping, extraDist);
posInfo.IsDangerousPos = pos.CheckDangerousPos(6);
posInfo.HasExtraDistance = extraEvadeDistance > 0 ? pos.CheckDangerousPos(extraEvadeDistance) : false;// ? 1 : 0;
posInfo.ClosestDistance = posInfo.DistanceToMouse; //GetMovementBlockPositionValue(pos, lastMovePos);
posInfo.IntersectionTime = GetMinCpaDistance(pos);
//GetIntersectDistance(lowestEvadeTimeSpell, GameData.HeroInfo.serverPos2D, pos);
//GetClosestDistanceApproach(lowestEvadeTimeSpell, pos, GameData.HeroInfo.moveSpeed, Game.Ping, GameData.HeroInfo.serverPos2D, 0);
posInfo.DistanceToMouse = pos.GetPositionValue();
posInfo.PosDistToChamps = pos.GetDistanceToChampions();
posInfo.Speed = GameData.HeroInfo.MoveSpeed;
if (ConfigValue.RejectMinDistance.GetInt() > 0
&& ConfigValue.RejectMinDistance.GetInt() >
posInfo.ClosestDistance) //reject closestdistance
{
posInfo.RejectPosition = true;
}
if (ConfigValue.MinimumComfortZone.GetInt() >
posInfo.PosDistToChamps)
{
posInfo.HasComfortZone = false;
}
return posInfo;
}
示例3: GetBestPositionMovementBlock
public static PositionInfo GetBestPositionMovementBlock(Vector2 movePos)
{
int posChecked = 0;
int maxPosToCheck = 50;
int posRadius = 50;
int radiusIndex = 0;
var extraEvadeDistance = ObjectCache.menuCache.cache["ExtraAvoidDistance"].Cast<Slider>().CurrentValue;
Vector2 heroPoint = ObjectCache.myHeroCache.serverPos2D;
Vector2 lastMovePos = movePos;//Game.CursorPos.To2D(); //movePos
List<PositionInfo> posTable = new List<PositionInfo>();
var extraDist = ObjectCache.menuCache.cache["ExtraCPADistance"].Cast<Slider>().CurrentValue;
var extraDelayBuffer = ObjectCache.menuCache.cache["ExtraPingBuffer"].Cast<Slider>().CurrentValue;
while (posChecked < maxPosToCheck)
{
radiusIndex++;
int curRadius = radiusIndex * (2 * posRadius);
int curCircleChecks = (int)Math.Ceiling((2 * Math.PI * (double)curRadius) / (2 * (double)posRadius));
for (int i = 1; i < curCircleChecks; i++)
{
posChecked++;
var cRadians = (2 * Math.PI / (curCircleChecks - 1)) * i; //check decimals
var pos = new Vector2((float)Math.Floor(heroPoint.X + curRadius * Math.Cos(cRadians)), (float)Math.Floor(heroPoint.Y + curRadius * Math.Sin(cRadians)));
//if (pos.Distance(myHero.Position.To2D()) < 100)
// dist = 0;
var posInfo = CanHeroWalkToPos(pos, ObjectCache.myHeroCache.moveSpeed, extraDelayBuffer + ObjectCache.gamePing, extraDist);
posInfo.isDangerousPos = pos.CheckDangerousPos(6) || CheckMovePath(pos);
posInfo.distanceToMouse = pos.GetPositionValue();
posInfo.hasExtraDistance = extraEvadeDistance > 0 ? pos.HasExtraAvoidDistance(extraEvadeDistance) : false;
posTable.Add(posInfo);
}
}
var sortedPosTable =
posTable.OrderBy(p => p.isDangerousPos)
.ThenBy(p => p.posDangerLevel)
.ThenBy(p => p.hasExtraDistance)
.ThenBy(p => p.distanceToMouse);
//.ThenBy(p => p.intersectionTime);
foreach (var posInfo in sortedPosTable)
{
if (CheckPathCollision(myHero, posInfo.position) == false)
return posInfo;
}
return null;
}
示例4: GetBestPositionDash
public static PositionInfo GetBestPositionDash(EvadeSpellData spell)
{
int posChecked = 0;
int maxPosToCheck = 100;
int posRadius = 50;
int radiusIndex = 0;
var extraDelayBuffer = ObjectCache.menuCache.cache["ExtraPingBuffer"].Cast<Slider>().CurrentValue;
var extraEvadeDistance = 100;// Evade.menu.SubMenu("MiscSettings").SubMenu("ExtraBuffers").Item("ExtraEvadeDistance").GetValue<Slider>().Value;
var extraDist = ObjectCache.menuCache.cache["ExtraCPADistance"].Cast<Slider>().CurrentValue;
Vector2 heroPoint = ObjectCache.myHeroCache.serverPos2DPing;
Vector2 lastMovePos = Game.CursorPos.To2D();
List<PositionInfo> posTable = new List<PositionInfo>();
List<int> spellList = SpellDetector.GetSpellList();
int minDistance = 50; //Math.Min(spell.range, minDistance)
int maxDistance = int.MaxValue;
if (spell.fixedRange)
{
minDistance = maxDistance = (int)spell.range;
}
while (posChecked < maxPosToCheck)
{
radiusIndex++;
int curRadius = radiusIndex * (2 * posRadius) + (minDistance - 2 * posRadius);
int curCircleChecks = (int)Math.Ceiling((2 * Math.PI * (double)curRadius) / (2 * (double)posRadius));
for (int i = 1; i < curCircleChecks; i++)
{
posChecked++;
var cRadians = (2 * Math.PI / (curCircleChecks - 1)) * i; //check decimals
var pos = new Vector2((float)Math.Floor(heroPoint.X + curRadius * Math.Cos(cRadians)), (float)Math.Floor(heroPoint.Y + curRadius * Math.Sin(cRadians)));
var posInfo = CanHeroWalkToPos(pos, spell.speed, extraDelayBuffer + ObjectCache.gamePing, extraDist);
posInfo.isDangerousPos = pos.CheckDangerousPos(6);
posInfo.hasExtraDistance = extraEvadeDistance > 0 ? pos.CheckDangerousPos(extraEvadeDistance) : false;// ? 1 : 0;
posInfo.distanceToMouse = pos.GetPositionValue();
posInfo.spellList = spellList;
posInfo.posDistToChamps = pos.GetDistanceToChampions();
posTable.Add(posInfo);
}
if (curRadius >= maxDistance)
break;
}
var sortedPosTable =
posTable.OrderBy(p => p.isDangerousPos)
.ThenBy(p => p.posDangerLevel)
.ThenBy(p => p.posDangerCount)
.ThenBy(p => p.hasExtraDistance)
.ThenBy(p => p.distanceToMouse);
foreach (var posInfo in sortedPosTable)
{
if (CheckPathCollision(myHero, posInfo.position) == false)
{
if (PositionInfoStillValid(posInfo, spell.speed))
{
return posInfo;
}
}
}
return null;
}
示例5: GetBestPositionBlink
public static PositionInfo GetBestPositionBlink()
{
int posChecked = 0;
int maxPosToCheck = 100;
int posRadius = 50;
int radiusIndex = 0;
var extraEvadeDistance = 100;//Evade.menu.SubMenu("MiscSettings").SubMenu("ExtraBuffers").Item("ExtraAvoidDistance").GetValue<Slider>().Value;
Vector2 heroPoint = ObjectCache.myHeroCache.serverPos2DPing;
Vector2 lastMovePos = Game.CursorPos.To2D();
int minComfortZone = ObjectCache.menuCache.cache["MinComfortZone"].Cast<Slider>().CurrentValue;
List<PositionInfo> posTable = new List<PositionInfo>();
while (posChecked < maxPosToCheck)
{
radiusIndex++;
int curRadius = radiusIndex * (2 * posRadius);
int curCircleChecks = (int)Math.Ceiling((2 * Math.PI * (double)curRadius) / (2 * (double)posRadius));
for (int i = 1; i < curCircleChecks; i++)
{
posChecked++;
var cRadians = (2 * Math.PI / (curCircleChecks - 1)) * i; //check decimals
var pos = new Vector2((float)Math.Floor(heroPoint.X + curRadius * Math.Cos(cRadians)), (float)Math.Floor(heroPoint.Y + curRadius * Math.Sin(cRadians)));
bool isDangerousPos = pos.CheckDangerousPos(6);
var dist = pos.GetPositionValue();
var posInfo = new PositionInfo(pos, isDangerousPos, dist);
posInfo.hasExtraDistance = extraEvadeDistance > 0 ? pos.CheckDangerousPos(extraEvadeDistance) : false;
posInfo.posDistToChamps = pos.GetDistanceToChampions();
if (minComfortZone < posInfo.posDistToChamps)
{
posTable.Add(posInfo);
}
}
}
var sortedPosTable =
posTable.OrderBy(p => p.isDangerousPos)
.ThenBy(p => p.hasExtraDistance)
.ThenBy(p => p.distanceToMouse);
foreach (var posInfo in sortedPosTable)
{
if (CheckPointCollision(myHero, posInfo.position) == false)
return posInfo;
}
return null;
}
示例6: InitPositionInfo
public static PositionInfo InitPositionInfo(Vector2 pos, float extraDelayBuffer, float extraEvadeDistance, Vector2 lastMovePos, Spell lowestEvadeTimeSpell)
{
if (!ObjectCache.myHeroCache.isMoving && ObjectCache.myHeroCache.serverPos2D.LSDistance(pos) <= 75)
pos = ObjectCache.myHeroCache.serverPos2D;
var extraDist = ObjectCache.menuCache.cache["ExtraCPADistance"].Cast<Slider>().CurrentValue;
PositionInfo posInfo;
posInfo = CanHeroWalkToPos(pos, ObjectCache.myHeroCache.moveSpeed,extraDelayBuffer + ObjectCache.gamePing, extraDist);
posInfo.isDangerousPos = pos.CheckDangerousPos(6);
posInfo.hasExtraDistance = extraEvadeDistance > 0 && pos.CheckDangerousPos(extraEvadeDistance);
posInfo.closestDistance = posInfo.distanceToMouse;
posInfo.distanceToMouse = pos.GetPositionValue();
posInfo.posDistToChamps = pos.GetDistanceToChampions();
posInfo.speed = ObjectCache.myHeroCache.moveSpeed;
if (ObjectCache.menuCache.cache["RejectMinDistance"].Cast<Slider>().CurrentValue > 0 &&
ObjectCache.menuCache.cache["RejectMinDistance"].Cast<Slider>().CurrentValue > posInfo.closestDistance) //reject closestdistance
posInfo.rejectPosition = true;
if (ObjectCache.menuCache.cache["MinComfortZone"].Cast<Slider>().CurrentValue > posInfo.posDistToChamps)
posInfo.hasComfortZone = false;
return posInfo;
}
示例7: GetBestPositionBlink
public static PositionInfo GetBestPositionBlink()
{
int posChecked = 0;
int maxPosToCheck = 100;
int posRadius = 50;
int radiusIndex = 0;
var extraEvadeDistance = ConfigValue.ExtraSpellRadius.GetInt();
Vector2 heroPoint = GameData.HeroInfo.ServerPos2DPing;
Vector2 lastMovePos = Game.CursorPos.To2D();
int minComfortZone = ConfigValue.MinimumComfortZone.GetInt();
List<PositionInfo> posTable = new List<PositionInfo>();
while (posChecked < maxPosToCheck)
{
radiusIndex++;
int curRadius = radiusIndex * (2 * posRadius);
int curCircleChecks = (int)Math.Ceiling((2 * Math.PI * (double)curRadius) / (2 * (double)posRadius));
for (int i = 1; i < curCircleChecks; i++)
{
posChecked++;
var cRadians = (2 * Math.PI / (curCircleChecks - 1)) * i; //check decimals
var pos = new Vector2((float)Math.Floor(heroPoint.X + curRadius * Math.Cos(cRadians)), (float)Math.Floor(heroPoint.Y + curRadius * Math.Sin(cRadians)));
bool isDangerousPos = pos.CheckDangerousPos(6);
var dist = pos.GetPositionValue();
var posInfo = new PositionInfo(pos, isDangerousPos, dist);
posInfo.HasExtraDistance = extraEvadeDistance > 0 ? pos.CheckDangerousPos(extraEvadeDistance) : false;
posInfo.PosDistToChamps = pos.GetDistanceToChampions();
if (minComfortZone < posInfo.PosDistToChamps)
{
posTable.Add(posInfo);
}
}
}
var sortedPosTable =
posTable.OrderBy(p => p.IsDangerousPos)
.ThenBy(p => p.HasExtraDistance)
.ThenBy(p => p.DistanceToMouse);
foreach (var posInfo in sortedPosTable)
{
if (CheckPointCollision(MyHero, posInfo.Position) == false)
return posInfo;
}
return null;
}
示例8: GetBestPositionMovementBlock
public static PositionInfo GetBestPositionMovementBlock(Vector2 movePos)
{
int posChecked = 0;
int maxPosToCheck = 50;
int posRadius = 50;
int radiusIndex = 0;
var extraEvadeDistance = ConfigValue.ExtraSpellRadius.GetInt();
Vector2 heroPoint = GameData.HeroInfo.ServerPos2D;
Vector2 lastMovePos = movePos;//Game.CursorPos.To2D(); //movePos
List<PositionInfo> posTable = new List<PositionInfo>();
var extraDist = ConfigValue.ExtraCpaDistance.GetInt();
var extraDelayBuffer = Config.Properties.GetInt(ConfigValue.ExtraPingBuffer);
while (posChecked < maxPosToCheck)
{
radiusIndex++;
int curRadius = radiusIndex * (2 * posRadius);
int curCircleChecks = (int)Math.Ceiling((2 * Math.PI * (double)curRadius) / (2 * (double)posRadius));
for (int i = 1; i < curCircleChecks; i++)
{
posChecked++;
var cRadians = (2 * Math.PI / (curCircleChecks - 1)) * i; //check decimals
var pos = new Vector2((float)Math.Floor(heroPoint.X + curRadius * Math.Cos(cRadians)), (float)Math.Floor(heroPoint.Y + curRadius * Math.Sin(cRadians)));
//if (pos.Distance(myHero.Position.To2D()) < 100)
// dist = 0;
var posInfo = CanHeroWalkToPos(pos, GameData.HeroInfo.MoveSpeed, extraDelayBuffer + Game.Ping, extraDist);
posInfo.IsDangerousPos = pos.CheckDangerousPos(6) || CheckMovePath(pos);
posInfo.DistanceToMouse = pos.GetPositionValue();
posInfo.HasExtraDistance = extraEvadeDistance > 0 ? pos.HasExtraAvoidDistance(extraEvadeDistance) : false;
posTable.Add(posInfo);
}
}
var sortedPosTable =
posTable.OrderBy(p => p.IsDangerousPos)
.ThenBy(p => p.PosDangerLevel)
.ThenBy(p => p.HasExtraDistance)
.ThenBy(p => p.DistanceToMouse);
//.ThenBy(p => p.intersectionTime);
foreach (var posInfo in sortedPosTable)
{
if (CheckPathCollision(MyHero, posInfo.Position) == true)
return posInfo;
}
return null;
}