… | |
… | |
53 | my ($who, $args) = @_; |
53 | my ($who, $args) = @_; |
54 | my ($target, $msg) = split /\s+/, $args, 2; |
54 | my ($target, $msg) = split /\s+/, $args, 2; |
55 | |
55 | |
56 | my $name = $who->name; |
56 | my $name = $who->name; |
57 | |
57 | |
58 | if ($msg) { |
|
|
59 | if (my $other = cf::player::find $target) { |
58 | if (my $other = cf::player::find $target) { |
|
|
59 | if ($msg) { |
60 | |
60 | |
61 | if ($target ne $name and $other->ob->{ext_ignore_tell}{$name} < time) { |
61 | if ($target ne $name and $other->ob->{ext_ignore_tell}{$name} < time) { |
62 | $who->message ("You tell $target: $msg"); |
62 | $who->message ("You tell $target: $msg"); |
63 | $other->ob->message ("$name tells you: $msg"); |
63 | $other->ob->message ("$name tells you: $msg"); |
64 | $other->ob->{ext_last_tell} = $name; |
64 | $other->ob->{ext_last_tell} = $name; |
… | |
… | |
67 | } else { |
67 | } else { |
68 | $who->message ($other->ob->name . " ignores what you say. Give up on it.", cf::NDI_UNIQUE); |
68 | $who->message ($other->ob->name . " ignores what you say. Give up on it.", cf::NDI_UNIQUE); |
69 | } |
69 | } |
70 | |
70 | |
71 | } else { |
71 | } else { |
72 | $who->message ("No such player or ambiguous name. Your message: $msg", cf::NDI_UNIQUE); |
72 | $who->message ("What do you want to tell $target?", cf::NDI_UNIQUE); |
73 | } |
73 | } |
74 | } else { |
74 | } else { |
75 | $who->message ("What do you want to tell $target?", cf::NDI_UNIQUE); |
75 | $who->message ("No such player or ambiguous name. Your message: $msg", cf::NDI_UNIQUE); |
76 | } |
76 | } |
77 | }; |
77 | }; |
78 | |
78 | |
79 | cf::register_command reply => 0, sub { |
79 | cf::register_command reply => 0, sub { |
80 | my ($who, $args) = @_; |
80 | my ($who, $args) = @_; |
81 | my $name = $who->name; |
81 | my $name = $who->name; |
82 | |
82 | |
83 | if ($args) { |
|
|
84 | if (my $other = cf::player::find $who->{ext_last_tell}) { |
83 | if (my $other = cf::player::find $who->{ext_last_tell}) { |
|
|
84 | if ($args) { |
85 | |
85 | |
86 | $other->ob->{ext_ignore_tell}{$name} >= time |
86 | $other->ob->{ext_ignore_tell}{$name} >= time |
87 | or delete $other->ob->{ext_ignore_tell}{$name}; |
87 | or delete $other->ob->{ext_ignore_tell}{$name}; |
88 | |
88 | |
89 | if ($other->ob->{ext_ignore_tell}{$name} < time) { |
89 | if ($other->ob->{ext_ignore_tell}{$name} < time) { |
… | |
… | |
91 | $other->ob->message ("$name tells you: $args"); |
91 | $other->ob->message ("$name tells you: $args"); |
92 | $who->{ext_last_tell} = $other->ob->name; |
92 | $who->{ext_last_tell} = $other->ob->name; |
93 | } else { |
93 | } else { |
94 | $who->message ($other->ob->name . " ignores what you say. Give up on it.", cf::NDI_UNIQUE); |
94 | $who->message ($other->ob->name . " ignores what you say. Give up on it.", cf::NDI_UNIQUE); |
95 | } |
95 | } |
|
|
96 | } else { |
|
|
97 | $who->message ("What do you want to tell ".$other->ob->name."?", cf::NDI_UNIQUE); |
|
|
98 | } |
96 | |
99 | |
97 | } else { |
|
|
98 | $who->message ("Can't reply, player left. Your message: $args", cf::NDI_UNIQUE); |
|
|
99 | } |
|
|
100 | } else { |
100 | } else { |
101 | $who->message ("What do you want to tell ".$other->ob->name."?", cf::NDI_UNIQUE); |
101 | $who->message ("Can't reply, player left. Your message: $args", cf::NDI_UNIQUE); |
102 | } |
102 | } |
103 | }; |
103 | }; |
104 | |
104 | |
105 | cf::register_command ignore => 0, sub { |
105 | cf::register_command ignore => 0, sub { |
106 | my ($who, $args) = @_; |
106 | my ($who, $args) = @_; |