//获取对应射程的float值 的 平方 public static float GetRangeSquaredByType(WeapRanType wrt) { float range = 0; switch (wrt) { case WeapRanType.ULongRange: range = 3240000; break; case WeapRanType.LongRange: range = 1440000; break; case WeapRanType.MediumRange: range = 518400; break; case WeapRanType.ShortRange: range = 250000; break; case WeapRanType.UShortRange: range = 108900; break; } return(range); }
//获取对应射程的float值 public static float GetRangeByType(WeapRanType wrt) { float range = 0; switch (wrt) { case WeapRanType.ULongRange: range = 1800; break; case WeapRanType.LongRange: range = 1200; break; case WeapRanType.MediumRange: range = 720; break; case WeapRanType.ShortRange: range = 500; break; case WeapRanType.UShortRange: range = 330; break; } return(range); }
//选择与敌人的距离 void ChooseDisFormEnemy() { WeapRanType mostfarW = this.Weapon.GetMostFarRange(); //武器用完了^…… if (mostfarW == WeapRanType.None) { IsHaveWeapon = false; return; } float maxWRange = BWeapon.GetRangeByType(mostfarW); //随机抖动值 float rnd = Maths.Rnd.Next(70, 150); if (maxWRange < lockRadius) { keepDisFromEnemy = maxWRange - rnd; } else { keepDisFromEnemy = lockRadius - rnd; } if (keepDisFromEnemy < 40) { keepDisFromEnemy = 40; } }
public BWeapon(int amount, WeapType wt,WeapRanType wrt, ContactType ctype) : base() { //this.master = (BWarship)node; this.ctype = ctype; this.Amount =amount; this.WeaponRangeType = wrt; this.WeaponType = wt; }
public BWeapon(int amount, WeapType wt, WeapRanType wrt, ContactType ctype) : base() { //this.master = (BWarship)node; this.ctype = ctype; this.Amount = amount; this.WeaponRangeType = wrt; this.WeaponType = wt; }
public BDefenseCannon(int amount, WeapType wt,WeapRanType wrt, ContactType ctype, float shootcd) : base(amount,wt,wrt ,ctype) { //数据设置 width =5; height = 5; speed = 8f; Att = 2f; shootCd =new Countdown(shootcd); }
public BDefenseCannon(int amount, WeapType wt, WeapRanType wrt, ContactType ctype, float shootcd) : base(amount, wt, wrt, ctype) { //数据设置 width = 5; height = 5; speed = 8f; Att = 2f; shootCd = new Countdown(shootcd); }
public BGeneralBomb(int amount, WeapType wt, WeapRanType wrt, ContactType ctype, float shootcd) : base(amount, wt, wrt, ctype) { //数据设置 width = 12; height = 12; speed = 4.6f; startBomb = 0.1f; Att = 0.5f; shootCd = new Countdown(shootcd); }
public BGeneralBomb(int amount, WeapType wt,WeapRanType wrt,ContactType ctype, float shootcd) : base(amount,wt,wrt,ctype) { //数据设置 width =12; height = 12; speed =4.6f; startBomb = 0.1f; Att = 0.5f; shootCd = new Countdown(shootcd); }
public BBullet(Node node,Vector2 pos,Vector2 Dir,float Speed, float w, float h,WeapRanType wrt, ContactType ctype,float att, string path) : base(node,0,0,pos,w,h,ctype,null,null) { this.Att =att; this. Speed = Speed; this.Dir = Dir; body =new SpriteX(path,pos); body.ChangeFather(this); body.CenterSprite(TRS.Local.Center); body.Color = new Vector4(12/255f,255/255f,98/255f,255f/255f); maxShootDis = BWeapon.GetRangeByType(wrt); }
public BBullet(Node node, Vector2 pos, Vector2 Dir, float Speed, float w, float h, WeapRanType wrt, ContactType ctype, float att, string path) : base(node, 0, 0, pos, w, h, ctype, null, null) { this.Att = att; this.Speed = Speed; this.Dir = Dir; body = new SpriteX(path, pos); body.ChangeFather(this); body.CenterSprite(TRS.Local.Center); body.Color = new Vector4(12 / 255f, 255 / 255f, 98 / 255f, 255f / 255f); maxShootDis = BWeapon.GetRangeByType(wrt); }
public BDoubleMissile(int amount, WeapType wt, WeapRanType wrt, ContactType ctype, float shootcd) : base(amount, wt, wrt, ctype) { //数据设置 width = 8; height = 8; speed = 3.8f; Att = 5f; rots = 0.08f; rotsInc = 0.0003f; speed = 6f; shootCd = new Countdown(shootcd); //一次的发射数量 OnceAmount = 2; }
public BDoubleMissile(int amount, WeapType wt,WeapRanType wrt,ContactType ctype, float shootcd) : base(amount,wt,wrt,ctype) { //数据设置 width =8; height = 8; speed = 3.8f; Att = 5f; rots=0.08f; rotsInc = 0.0003f; speed =6f; shootCd = new Countdown(shootcd); //一次的发射数量 OnceAmount = 2; }
public BBomb(Node node, Vector2 pos, Vector2 Dir, float Speed, float w, float h, WeapRanType wrt, float startBomb, float NoContactTime, ContactType ctype, float att, string path) : base(node, 0, 0, pos, w, h, ctype, null, null) { this.Att = att; this.NoContactTime = NoContactTime; this.Speed = Speed; this.Dir = Dir; body = new SpriteX(path, pos); body.ChangeFather(this); body.CenterSprite(TRS.Local.Center); // body.Scale = new Vector2(12f, 12f); body.Color = new Vector4(220 / 255f, 82 / 255f, 98 / 255f, 255f / 255f); //base.drawBoundBox = new DrawBoundBox(this); }
public BBomb(Node node, Vector2 pos, Vector2 Dir, float Speed, float w, float h, WeapRanType wrt,float startBomb, float NoContactTime,ContactType ctype, float att, string path) : base(node,0,0,pos,w,h,ctype,null,null) { this.Att =att; this.NoContactTime = NoContactTime; this. Speed = Speed; this.Dir = Dir; body =new SpriteX(path,pos); body.ChangeFather(this); body.CenterSprite (TRS.Local.Center); // body.Scale = new Vector2 (12f, 12f); body.Color = new Vector4(220/255f,82/255f,98/255f,255f/255f); //base.drawBoundBox = new DrawBoundBox(this); }
public BMissile(Node node,Vector2 pos,BWarship target,float Speed,float rots,float rotsInc, float w, float h, WeapRanType wrt, ContactType ctype,float att, string path) : base(node,0,0,pos,w,h,ctype,null,null) { this.Att =att; this. Speed = Speed; this.target = target; body = new SpriteX(path,pos); body.ChangeFather(this); body.CenterSprite(TRS.Local.Center); body.Scale = new Vector2(0.4f,0.4f); tracker =new BTracker(body,ref this.Speed,rots,rotsInc); tracker.SetTarger(target.GetPosition()); body.Color = BWarship.ColorID; maxShootDis = BWeapon.GetRangeByType(wrt); }
public BMissile(Node node, Vector2 pos, BWarship target, float Speed, float rots, float rotsInc, float w, float h, WeapRanType wrt, ContactType ctype, float att, string path) : base(node, 0, 0, pos, w, h, ctype, null, null) { this.Att = att; this.Speed = Speed; this.target = target; body = new SpriteX(path, pos); body.ChangeFather(this); body.CenterSprite(TRS.Local.Center); body.Scale = new Vector2(0.4f, 0.4f); tracker = new BTracker(body, ref this.Speed, rots, rotsInc); tracker.SetTarger(target.GetPosition()); body.Color = BWarship.ColorID; maxShootDis = BWeapon.GetRangeByType(wrt); }
//获取对应射程的float值 public static float GetRangeByType(WeapRanType wrt) { float range = 0; switch (wrt) { case WeapRanType.ULongRange : range = 1800; break; case WeapRanType.LongRange : range = 1200; break; case WeapRanType.MediumRange : range = 720; break; case WeapRanType.ShortRange : range = 500; break; case WeapRanType.UShortRange : range = 330; break; } return range; }
//获取对应射程的float值 的 平方 public static float GetRangeSquaredByType(WeapRanType wrt) { float range = 0; switch (wrt) { case WeapRanType.ULongRange : range = 3240000; break; case WeapRanType.LongRange : range = 1440000; break; case WeapRanType.MediumRange : range = 518400; break; case WeapRanType.ShortRange : range = 250000; break; case WeapRanType.UShortRange : range = 108900; break; } return range; }