10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/game_2d/transparency.rb', line 10
def transparent?(one, two)
return false if wall?(one) || wall?(two)
return true if destination?(one) || destination?(two)
return teleporter_ok?(one, two) if teleporter?(one)
return teleporter_ok?(two, one) if teleporter?(two)
return related_by_owner?(one, two) if owned?(one)
return related_by_owner?(two, one) if owned?(two)
fail("Huh? one=#{one}, two=#{two}") unless
one.is_a?(Player) && two.is_a?(Player)
false
end
|