Allow player to be pushed off moving blocks
This commit is contained in:
@@ -41,6 +41,21 @@ def test_dir_aligned():
|
||||
assert ev({"dir": "above"}, 400, 60) is True
|
||||
|
||||
|
||||
def test_dir_inclusive():
|
||||
# trap column spans x 100..132 (centre 116). A player standing *inside* the
|
||||
# column (centre 116) is neither strictly left nor strictly right of it.
|
||||
assert ev({"dir": "left"}, 106, 105) is False # centre 116, inside -> not left
|
||||
assert ev({"dir": "right"}, 106, 105) is False # inside -> not right
|
||||
# inclusive counts the trap's own tile as being on that side
|
||||
assert ev({"dir": "left", "inclusive": True}, 106, 105) is True
|
||||
assert ev({"dir": "right", "inclusive": True}, 106, 105) is True
|
||||
# and vertically, too (column spans y 100..132)
|
||||
assert ev({"dir": "above"}, 108, 106) is False
|
||||
assert ev({"dir": "above", "inclusive": True}, 108, 106) is True
|
||||
assert ev({"dir": "below"}, 108, 106) is False
|
||||
assert ev({"dir": "below", "inclusive": True}, 108, 106) is True
|
||||
|
||||
|
||||
def test_all_and_any():
|
||||
c = {"all": [{"within": 3}, {"dir": "above", "aligned": True}]}
|
||||
assert ev(c, 108, 80) is True
|
||||
|
||||
Reference in New Issue
Block a user