public virtual void AI(Hero HERO) { bool candamage = !GameGlobal.triggerinvinsible; //phủ định của trigger if (!iscollision) { pos += Global.RadialMovement(HERO.pos, pos, speed); } if (Global.GetDistance(HERO.pos, pos) < hitdist) { Global.soundcontrol.PLaySound("MobHit"); if (candamage) { HERO.GetHit(bossdmg); } else { HERO.GetHit(0); } HERO.pos += Global.RadialMovement(pos, HERO.pos, -HERO.speed); HERO.cursor.pos += Global.RadialMovement(pos, HERO.pos, -HERO.speed); iscollision = true; } if (Global.GetDistance(HERO.pos, pos) > hitdist * 1.05) { iscollision = false; } }
public void SprayAndPray(Hero HERO) //Chuột chít chíu chíu { if (Global.GetDistance(HERO.pos, pos) < 700) { speed = 2; GameGlobal.GunnerPassProjectiles(this, new GunnerProjectiles(pos, new Vector2(35, 35), false, pos, HERO.pos)); } }
public void Update(Hero HERO) { HeroHit(HERO); if (Global.GetDistance(pos, HERO.pos) == 0) { Global.soundcontrol.PLaySound("TriggerBuff"); RandomBuff(); istaken = true; } }
public static Vector2 RadialMovement(Vector2 focus, Vector2 pos, float speed) { float dist = Global.GetDistance(pos, focus); if (dist < speed) { return(focus - pos); } else { return((focus - pos) * speed / dist); } }
public bool HitHero(Hero HERO, List <Boss> BOSS) { if (Global.GetDistance(pos, HERO.pos) < hitbox) { ishit = true; if (Global.GetDistance(BOSS[0].pos, HERO.pos) <= BOSS[0].hitdist) { HERO.isstunned = false; ishit = false; return(true); } } return(false); }
public bool HitHero(Hero HERO) { if (Global.GetDistance(pos, HERO.pos) < HERO.hitdist) { bool candamage = !GameGlobal.triggerinvinsible; //phủ định của trigger if (candamage) { HERO.GetHit(damage); } else { HERO.GetHit(0); } return(true); } return(false); }
public void HeroHit(Hero HERO) { if (Global.GetDistance(pos, HERO.pos) < HERO.gravityradius) { if (0 < GameGlobal.gametimepassed && GameGlobal.gametimepassed <= 2000) { pos += Global.RadialMovement(HERO.pos, pos, 10f); } if (2000 < GameGlobal.gametimepassed && GameGlobal.gametimepassed <= 7500) { pos += Global.RadialMovement(HERO.pos, pos, 15f); } if (7500 < GameGlobal.gametimepassed) { pos += Global.RadialMovement(HERO.pos, pos, 20f); } } }
public bool HitSomething(List <Unit> UNITS, List <Boss> BOSS) { for (int i = 0; i < UNITS.Count; i++) { if (Global.GetDistance(pos, UNITS[i].pos) < UNITS[i].hitdist) { return(true); } } if (BOSS.Count > 0) { if (Global.GetDistance(pos, BOSS[0].pos) < BOSS[0].hitdist) { return(true); } } return(false); }
public virtual bool HitBoss(List <Boss> BOSS, bool ISCRIT) { if (BOSS.Count > 0) { if (Global.GetDistance(pos, BOSS[0].pos) < BOSS[0].hitdist) { if (!ISCRIT) { BOSS[0].GetHit(damage); } else { BOSS[0].GetHit(damage * 2); } return(true); } } return(false); }
public virtual bool HitMobs(List <Unit> UNITS, bool ISCRIT) { for (int i = 0; i < UNITS.Count; i++) { if (Global.GetDistance(pos, UNITS[i].pos) < UNITS[i].hitdist) { if (!ISCRIT) { UNITS[i].GetHit(damage); } else { UNITS[i].GetHit(damage * 2); } return(true); } } return(false); }
public virtual void AI(Hero HERO) { bool candamage = !GameGlobal.triggerinvinsible; //phủ định của trigger pos += Global.RadialMovement(HERO.pos, pos, speed); rot = Global.RotateTowards(pos, HERO.pos); if (Global.GetDistance(HERO.pos, pos) < HERO.hitdist) { Global.soundcontrol.PLaySound("MobHit"); iscollision = true; if (candamage) { HERO.GetHit(mobdmg); } else { HERO.GetHit(0); } } }
public void BlitzHookEffect(object BLITZHAND, object HERO, object BOSS) { BlitzHands blitzHands = (BlitzHands)BLITZHAND; Hero hero = (Hero)HERO; Blitz boss = (Blitz)BOSS; if (blitzHands.ishit && !blitzHands.done) { if (Global.GetDistance(hero.pos, boss.pos) >= boss.hitdist) { hero.pos += Global.RadialMovement(hero.pos, boss.pos, -15); hero.cursor.pos += Global.RadialMovement(hero.pos, boss.pos, -15); hero.isstunned = true; } if (Global.GetDistance(boss.pos, hero.pos) < boss.hitdist) { hero.isstunned = false; blitzHands.ishit = false; } } }
public void LightBolt(Hero HERO) { //thêm sound ở đây if (Global.GetDistance(HERO.pos, pos) < 300 && Global.GetDistance(HERO.pos, pos) > 150) { Global.soundcontrol.PLaySound("LightBoltSound"); } if (Global.GetDistance(HERO.pos, pos) < 300) { myModel = Global.content.Load <Texture2D>("RedElector"); speed = 14.025f; //14.025f if (3000 < GameGlobal.gametimepassed) { speed = 15.2625f; //15.2625f } if (7500 < GameGlobal.gametimepassed) { speed = 16.5f; //16.5f } } }
public virtual float GetDistanceFromClick() { return(Global.GetDistance(newMousePos, firstMousePos)); }