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.

EmergencyExit.cs 848 B

12345678910111213141516171819202122232425262728
  1. using Preparation.Interface;
  2. using Preparation.Utility;
  3. namespace GameClass.GameObj
  4. {
  5. /// <summary>
  6. /// 紧急出口
  7. /// </summary>
  8. public class EmergencyExit : GameObj
  9. {
  10. public EmergencyExit(XY initPos) :
  11. base(initPos, GameData.numOfPosGridPerCell / 2, PlaceType.Land, GameObjType.EmergencyExit)
  12. {
  13. this.CanMove = false;
  14. }
  15. public override bool IsRigid => true;
  16. public override ShapeType Shape => ShapeType.Square;
  17. protected override bool IgnoreCollideExecutor(IGameObj targetObj)
  18. {
  19. if (targetObj.Type != GameObjType.Character)
  20. return true; // 非玩家不碰撞
  21. else if (!((Character)targetObj).IsGhost())
  22. return true; // 不是鬼不碰撞
  23. return false;
  24. }
  25. }
  26. }