Code: Select all
script, critterloop, begin
variable (ref, next ref)
ref := Next NPC Reference()
while (ref) do(
next ref := Next NPC Reference(ref)
if(get NPC Pool(ref) == pool:global) then (
critterbrain (ref)
)
ref := next ref
)
end
# Check whether critters can see the hero
script, critterbrain, ref, begin
variable (npcSl, FV, RV)
npcSl := get NPC Slice(ref)
switch (get NPC ID(ref)) do (
case (critter:shadowdude) do (
FV := 6
RV := 3
if (check line of sight (NPC X(ref), NPC Y(ref), hero X(me), hero Y(me), NPC Direction(ref), FV, RV)) then (
change NPC ID (ref, critter:shadowdudeangry, pool:global)
)
)
)
end