diff --git a/party.lua b/party.lua --- a/party.lua +++ b/party.lua @@ -80,10 +80,16 @@ char_phaetlarr = obj { life = party_follow; act = function(s) if (stead.nameof(where(s)) == s.home) then - walkin(phaetlarr_home_dlg); - else - walkin(phaetlarr_dlg); + phaetlarr_dlg.home = true; + else + phaetlarr_dlg.home = false; + if where(s).underwater then + phaetlarr_dlg.underwater = true; + else + phaetlarr_dlg.underwater = false; + end; end; + walkin(phaetlarr_dlg); end; seen_level = 2; }; @@ -451,39 +457,51 @@ phaetlarr_phone_dlg = dlg { }; }; -phaetlarr_home_dlg = dlg { +phaetlarr_dlg = dlg { + var { + home = false; + underwater = false; + }; nam = "Фаэтларр"; entered = function(s) psub("generic"); - if rel_phaetlarr >= 0 then - if char_phaetlarr.on_black < 2 then - pon("on_black", "talk"); - end; - if char_phaetlarr.on_drake < 2 then - pon("on_drake", "talk"); + + poff("talk", "on_black", "on_drake", "on_venaedanotrr", "on_nleyyslanotrr", "on_join"); + if s.home then + if rel_phaetlarr >= 0 then + if char_phaetlarr.on_black < 2 then + pon("on_black", "talk"); + end; + if char_phaetlarr.on_drake < 2 then + pon("on_drake", "talk"); + end; + if char_phaetlarr.on_venaedanotrr < 2 then + pon("on_venaedanotrr", "talk"); + end; + if char_phaetlarr.on_nleyyslanotrr < 2 then + pon("on_nleyyslanotrr", "talk"); + end; + if char_phaetlarr.on_join < 2 then + pon("on_join", "talk"); + end; end; - if char_phaetlarr.on_venaedanotrr < 2 then - pon("on_venaedanotrr", "talk"); - end; - if char_phaetlarr.on_nleyyslanotrr < 2 then - pon("on_nleyyslanotrr", "talk"); - end; - if char_phaetlarr.on_join < 2 then - pon("on_join", "talk"); + + if (char_phaetlarr.follow) then + pon('stay'); + poff('join'); + else + pon('join'); + poff('stay'); end; else - poff("talk"); + poff('stay', 'join'); end; - if (char_phaetlarr.follow) then - pon('stay'); - poff('join'); - else - pon('join'); - poff('stay'); - end; - - return [[Фаэтларр ждет ваших указаний. ]]; + if s.home then + return [[Фаэтларр смотрит на вас. ]]; + else + return [[Фаэтларр ждет ваших указаний. ]]; + end; end; phr = { {tag="talk_more"};