… | |
… | |
331 | } |
331 | } |
332 | } |
332 | } |
333 | |
333 | |
334 | delete $self->{npc}{$self->{ob}->name}{dialog_state} unless %$state; |
334 | delete $self->{npc}{$self->{ob}->name}{dialog_state} unless %$state; |
335 | delete $self->{ob}{dialog_flag} unless %$flag; |
335 | delete $self->{ob}{dialog_flag} unless %$flag; |
336 | |
|
|
337 | # combine lines into paragraphs |
|
|
338 | $reply =~ s/(?<=\S)\n(?=\w)/ /g; |
|
|
339 | $reply =~ s/\n\n/\n/g; |
|
|
340 | |
336 | |
341 | # ignores flags and npc from replies |
337 | # ignores flags and npc from replies |
342 | $reply = join "\n", (map $_->[1], @replies), $reply; |
338 | $reply = join "\n", (map $_->[1], @replies), $reply; |
343 | |
339 | |
344 | # now mark up all matching keywords |
340 | # now mark up all matching keywords |
… | |
… | |
349 | last; |
345 | last; |
350 | } |
346 | } |
351 | } |
347 | } |
352 | } |
348 | } |
353 | |
349 | |
|
|
350 | $self->{npc}->use_trigger if $self->{npc}->type == cf::MAGIC_EAR; |
|
|
351 | |
354 | return wantarray ? ($reply, @kw) : $reply; |
352 | return wantarray ? ($reply, @kw) : $reply; |
355 | } |
353 | } |
356 | } |
354 | } |
357 | } |
355 | } |
358 | |
356 | |