本文整理汇总了C#中Hero.CanMove方法的典型用法代码示例。如果您正苦于以下问题:C# Hero.CanMove方法的具体用法?C# Hero.CanMove怎么用?C# Hero.CanMove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hero
的用法示例。
在下文中一共展示了Hero.CanMove方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CastIceWall
private static void CastIceWall(Hero me, Hero target, bool b, Ability icewall)
{
if (!b)
{
if (!me.CanMove() || !Utils.SleepCheck("icewallmove")) return;
var angle = me.FindAngleBetween(target.Position, true);
var point =
new Vector3(
(float)(target.Position.X -
200 *
Math.Cos(angle)),
(float)(target.Position.Y -
200 *
Math.Sin(angle)), 0);
me.Move(point);
Utils.Sleep(300, "icewallmove");
}
else
{
icewall.UseAbility();
_stage++;
Utils.Sleep(250, "StageCheck");
}
}
示例2: Universe
//.........这里部分代码省略.........
//black king bar
if ((bkb != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(bkb.Name)) && bkb.CanBeCasted() && Utils.SleepCheck("bkb"))
{
bkb.UseAbility();
Utils.Sleep(150 + Game.Ping, "bkb");
}
//blink
if ((blink != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(blink.Name)) && blink.CanBeCasted() && target.Position.Distance2D(me.Position) > 300 && Utils.SleepCheck("blink"))
{
blink.UseAbility(me.Distance2D(mousepos) < 1200 ? mousepos : new Vector3(me.NetworkPosition.X + 1150 * (float)Math.Cos(me.NetworkPosition.ToVector2().FindAngleBetween(mousepos.ToVector2(), true)), me.NetworkPosition.Y + 1150 * (float)Math.Sin(me.NetworkPosition.ToVector2().FindAngleBetween(mousepos.ToVector2(), true)), 100), false);
Utils.Sleep(150 + Game.Ping, "blink");
}
//orchid
if ((orchid != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(orchid.Name)) && orchid.CanBeCasted() && (target.Position.Distance2D(me.Position) < 300) && Utils.SleepCheck("orchid"))
{
orchid.UseAbility(target);
Utils.Sleep(150 + Game.Ping, "orchid");
}
//dust
if ((dust != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(dust.Name)) && dust.CanBeCasted() && Utils.SleepCheck("dust"))
{
dust.UseAbility();
Utils.Sleep(150 + Game.Ping, "dust");
}
//necronomicon
if ((necronomicon != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(necronomicon.Name)) && necronomicon.CanBeCasted() && (target.Health > (target.MaximumHealth*0.20)) && (target.Position.Distance2D(me.Position) < 400) && Utils.SleepCheck("necronomicon"))
{
necronomicon.UseAbility();
Utils.Sleep(150 + Game.Ping, "necronomicon");
}
if ((necronomicon2 != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(necronomicon2.Name)) && necronomicon2.CanBeCasted() && (target.Health > (target.MaximumHealth*0.20)) && (target.Position.Distance2D(me.Position) < 400) && Utils.SleepCheck("necronomicon2"))
{
necronomicon2.UseAbility();
Utils.Sleep(150 + Game.Ping, "necronomicon2");
}
if ((necronomicon3 != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(necronomicon3.Name)) && necronomicon3.CanBeCasted() && (target.Health > (target.MaximumHealth*0.20)) && (target.Position.Distance2D(me.Position) < 400) && Utils.SleepCheck("necronomicon3"))
{
necronomicon3.UseAbility();
Utils.Sleep(150 + Game.Ping, "necronomicon3");
}
//thunder clap
if ((thunderclap != null && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(thunderclap.Name)) && thunderclap.CanBeCasted() && (target.Position.Distance2D(me.Position) < 300) && Utils.SleepCheck("thunderclap"))
{
thunderclap.UseAbility();
Utils.Sleep(150 + Game.Ping, "thunderclap");
}
//urn of shadow
if ((urn != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(urn.Name)) && urn.CanBeCasted() && Utils.SleepCheck("urn"))
{
urn.UseAbility(target);
Utils.Sleep(150 + Game.Ping, "urn");
}
//medal
if ((medal != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(medal.Name)) && medal.CanBeCasted() && (target.Position.Distance2D(me.Position) < 300) && Utils.SleepCheck("medal"))
{
medal.UseAbility(target);
Utils.Sleep(150 + Game.Ping, "medal");
}
//shiva
if ((shiva != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(shiva.Name)) && shiva.CanBeCasted() && (target.Position.Distance2D(me.Position) <= 800) && Utils.SleepCheck("shiva"))
{
shiva.UseAbility();
Utils.Sleep(150 + Game.Ping, "shiva");
}
//manta
if ((manta != null && Menu.Item("Items: ").GetValue<AbilityToggler>().IsEnabled(manta.Name)) && manta.CanBeCasted() && (target.Position.Distance2D(me.Position) <= 450) && Utils.SleepCheck("manta"))
{
manta.UseAbility();
Utils.Sleep(150 + Game.Ping, "manta");
}
//ULTIMATE: PrimalSplit
if ((primalsplit != null && Menu.Item("Skills: ").GetValue<AbilityToggler>().IsEnabled(primalsplit.Name)) && primalsplit.CanBeCasted() && (target.Position.Distance2D(me.Position) < 500) && (target.Health > (target.MaximumHealth*0.35)) && !thunderclap.CanBeCasted() && !orchid.CanBeCasted() && !dust.CanBeCasted() && !necronomicon.CanBeCasted() && !necronomicon2.CanBeCasted() && !necronomicon3.CanBeCasted() && !urn.CanBeCasted() && !medal.CanBeCasted() && !shiva.CanBeCasted() && !manta.CanBeCasted() && activated && Utils.SleepCheck("primalsplit"))
{
primalsplit.UseAbility();
Utils.Sleep(1000 + Game.Ping, "primalsplit");
var primalstorm = ObjectMgr.GetEntities<Unit>().FirstOrDefault(unit => unit.ClassID == ClassID.CDOTA_Unit_Brewmaster_PrimalStorm && unit.IsAlive);
}
//Moving+Attaking
if (me.CanMove() && (target.Position.Distance2D(me.Position) > 200))
{
me.Move(mousepos, false);
}
if (me.CanMove() && (target.Position.Distance2D(me.Position) < 200))
{
me.Attack(target);
}
}
else
{
if (me.CanMove())
{
me.Move(mousepos, false);
}
}
}
}
}
示例3: ComboInAction
//.........这里部分代码省略.........
Utils.Sleep(250, "StageCheck");
}
else if (eulmodif == null)
{
UseSpell(_spellForCast, target);
_stage++;
Utils.Sleep(250, "StageCheck");
}
}
else if (!Equals(_spellForCast, ss) && !Equals(_spellForCast, chaosmeteor))
{
UseSpell(_spellForCast, target);
_stage++;
Utils.Sleep(250, "StageCheck");
}
var timing = (Equals(_spellForCast, ss))
? 1.7
: (Equals(_spellForCast, chaosmeteor)) ? 1.3 : 0;
timing += Game.Ping / 1000 - 0.005;
//PrintInfo(timing.ToString(CultureInfo.InvariantCulture));
if (eulmodif != null && eulmodif.RemainingTime < timing)
{
UseSpell(_spellForCast, target);
_stage++;
Utils.Sleep(250, "StageCheck");
}
}
else if (Equals(_spellForCast, icewall))
{
var dist = me.Distance2D(target) <= 300;
if (!dist)
{
if (me.CanMove() && Utils.SleepCheck("icewallmove"))
{
var point =
new Vector3(
(float) (target.Position.X -
200*
Math.Cos(me.FindAngleBetween(target.Position, true))),
(float) (target.Position.Y -
200*
Math.Sin(me.FindAngleBetween(target.Position, true))), 0);
me.Move(point);
Utils.Sleep(300, "icewallmove");
}
}
else
{
_spellForCast.UseAbility();
_stage++;
Utils.Sleep(250, "StageCheck");
}
}
else
{
var tornadoMod = target.Modifiers.FirstOrDefault(x => x.Name == "modifier_invoker_tornado");
if (Equals(_spellForCast, deafblast))
{
if (tornadoMod != null &&
tornadoMod.RemainingTime <= me.Distance2D(target) / 1100 - .1 - Game.Ping / 1000)
{
UseSpell(_spellForCast, target);
_stage++;
Utils.Sleep(250, "StageCheck");
示例4: RazeRange
private static Vector3 RazeRange(Hero ent)
{
if (ent.IsMoving && ent.CanMove())
{
var turn = TurnRate(ent.Position) / 1000;
return new Vector3((float)(ent.Position.X + ent.MovementSpeed * (0.67 + turn) * Math.Cos(ent.RotationRad)), (float)(ent.Position.Y + ent.MovementSpeed * (0.67 + turn) * Math.Sin(ent.RotationRad)), ent.Position.Z);
}
else
{
return ent.Position;
}
}
示例5: Game_OnUpdate
//.........这里部分代码省略.........
}
if (ethereal != null && ethereal.CanBeCasted() && !target.IsMagicImmune() && !target.IsIllusion && !linkedsph &&
Utils.SleepCheck("ethereal") && menuValue.IsEnabled(ethereal.Name))
{
ethereal.UseAbility(target);
Utils.Sleep(50+Game.Ping, "ethereal");
}
if (halberd != null && halberd.CanBeCasted() && !target.IsMagicImmune() && !target.IsIllusion &&
!linkedsph &&
Utils.SleepCheck("halberd") && Menu.Item("active").GetValue<KeyBind>().Active && menuValue.IsEnabled(halberd.Name))
{
halberd.UseAbility(target);
Utils.Sleep(50 + Game.Ping, "halberd");
}
if (dagon != null && dagon.CanBeCasted() && !target.IsMagicImmune() && !target.IsIllusion && !linkedsph && (ethereal == null || ethereal.Cooldown < ethereal.CooldownLength-2 || ghostform) &&
Utils.SleepCheck("dagon") && menuValue.IsEnabled("item_dagon_5"))
{
dagon.UseAbility(target);
Utils.Sleep(50+Game.Ping, "dagon");
}
if (shiva != null && shiva.CanBeCasted() && !target.IsMagicImmune() && !target.IsIllusion && me.Distance2D(target) < 850 &&
Utils.SleepCheck("shiva") && Menu.Item("active").GetValue<KeyBind>().Active && menuValue.IsEnabled(shiva.Name))
{
shiva.UseAbility();
Utils.Sleep(50+Game.Ping, "shiva");
}
if (me.Spellbook.SpellQ != null && me.Spellbook.SpellQ.CanBeCasted() &&
me.Mana > me.Spellbook.Spell1.ManaCost && !target.IsMagicImmune() && !target.IsIllusion && me.CanCast() &&
Utils.SleepCheck("Q") && (!me.Spellbook.Spell2.CanBeCasted() || linkedsph) && (ethereal == null || ethereal.Cooldown < ethereal.CooldownLength-1.5 || ghostform))
{
me.Spellbook.SpellQ.UseAbility(target);
Utils.Sleep(200 + Game.Ping, "Q");
}
if (me.Spellbook.Spell2 != null && (me.Distance2D(target) < Wrange) &&
me.Spellbook.Spell2.CanBeCasted() && me.Mana > me.Spellbook.Spell2.ManaCost && !linkedsph && me.CanCast() &&
!target.IsMagicImmune() && !target.IsIllusion && Utils.SleepCheck("W") && (ethereal == null || ethereal.Cooldown < ethereal.CooldownLength - 1.5 || ghostform || target.IsChanneling()))
{
me.Spellbook.Spell2.UseAbility(target);
Utils.Sleep(400 + Game.Ping, "W");
}
if (me.Spellbook.Spell2 != null &&
(me.Distance2D(target) < realWrange) &&
(me.Distance2D(target) > Wrange) && me.Spellbook.Spell2.CanBeCasted() && me.CanCast() &&
me.Mana > me.Spellbook.Spell2.ManaCost && !target.IsMagicImmune() && !target.IsIllusion && !linkedsph &&
Utils.SleepCheck("W") && (ethereal == null || ethereal.Cooldown < ethereal.CooldownLength-1.5 || ghostform || target.IsChanneling()))
{
me.Spellbook.Spell2.CastSkillShot(target);
Utils.Sleep(400 + Game.Ping, "W");
}
if (
(!(me.Spellbook.Spell2.CanBeCasted() && me.Spellbook.Spell1.CanBeCasted()) || target.IsMagicImmune() || !me.CanCast()) && !ghostform &&
me.CanAttack() && me.Distance2D(target) < 350+me.HullRadius+target.HullRadius &&
target != null)
{
Orbwalking.Orbwalk(target);
}
else if (me.CanMove() && !me.IsChanneling() && Utils.SleepCheck("movesleep") && (me.Distance2D(target) >= 350 + me.HullRadius + target.HullRadius || ghostform || !me.CanAttack()))
{
me.Move(Game.MousePosition);
Utils.Sleep(50 + Game.Ping, "movesleep");
}
if (Menu.Item("refresherToggle").GetValue<bool>() && !target.IsMagicImmune() && refresher != null &&
refresher.CanBeCasted() && me.Spellbook.Spell4.CanBeCasted() && (ethereal == null || ethereal.Cooldown < ethereal.CooldownLength-2 || ghostform) &&
Utils.SleepCheck("ultiRefresher") && Menu.Item("active").GetValue<KeyBind>().Active)
{
me.Spellbook.Spell4.UseAbility();
Utils.Sleep(100 + Game.Ping, "ultiRefresher");
}
if (Menu.Item("refresherToggle").GetValue<bool>() && refresher != null && refresher.CanBeCasted() && me.Mana > refresherComboManacost &&
Utils.SleepCheck("refresher") && !target.IsMagicImmune() && target != null &&
!me.Spellbook.Spell4.CanBeCasted() && !me.Spellbook.Spell2.CanBeCasted() &&
(orchid == null || orchid.Cooldown > 0) &&
(sheepstick == null || sheepstick.Cooldown > 0) &&
(veil == null || veil.Cooldown > 0) &&
(shiva == null || shiva.Cooldown > 0) &&
(halberd == null || halberd.Cooldown > 0) &&
(dagon == null || dagon.Cooldown > 0) &&
(ethereal == null || ethereal.Cooldown > 0) &&
Menu.Item("active").GetValue<KeyBind>().Active)
{
refresher.UseAbility();
Utils.Sleep(300 + Game.Ping, "refresher");
}
}
else if (!me.IsChanneling() && Utils.SleepCheck("movesleep"))
{
me.Move(Game.MousePosition);
Utils.Sleep(50 + Game.Ping, "movesleep");
}
}
}