14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/game_2d/transparency.rb', line 14
def transparent?(one, two)
return false if wall?(one) || wall?(two)
return true if ghost?(one) || ghost?(two)
return false if titanium?(one) || titanium?(two)
return true if transparent_to_most?(one) || transparent_to_most?(two)
return teleporter_ok?(two) if teleporter?(one)
return teleporter_ok?(one) if teleporter?(two)
return related_by_owner?(one, two) if owned?(one)
return related_by_owner?(two, one) if owned?(two)
return player?(two) if base?(one)
return player?(one) if base?(two)
fail("Huh? one=#{one}, two=#{two}") unless
normal?(one) && normal?(two)
false
end
|