You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

BirthPoint.cs 986 B

12345678910111213141516171819202122232425262728
  1. using Preparation.Interface;
  2. using Preparation.Utility;
  3. namespace GameClass.GameObj
  4. {
  5. /// <summary>
  6. /// 出生点
  7. /// </summary>
  8. public class BirthPoint : ObjOfCharacter
  9. {
  10. public BirthPoint(XY initPos) :
  11. base(initPos, GameData.numOfPosGridPerCell / 2, PlaceType.Land, GameObjType.BirthPoint)
  12. {
  13. this.CanMove = false;
  14. }
  15. // 修改建议:需要避免非自己的玩家进入出生点,否则会重叠
  16. public override bool IsRigid => true;
  17. protected override bool IgnoreCollideExecutor(IGameObj targetObj)
  18. {
  19. if (targetObj.Type != GameObjType.Character)
  20. return true; // 非玩家不碰撞
  21. else if (targetObj.Type == GameObjType.Character && targetObj.ID == this.Parent.ID)
  22. return true; // 出生点所属的玩家不碰撞
  23. return false;
  24. }
  25. public override ShapeType Shape => ShapeType.Square;
  26. }
  27. }