ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/nimbus.ext
(Generate patch)

Comparing deliantra/server/ext/nimbus.ext (file contents):
Revision 1.2 by root, Thu Dec 21 22:41:34 2006 UTC vs.
Revision 1.9 by root, Sun Jan 14 19:55:37 2007 UTC

1#! perl 1#! perl # MANDATORY
2 2
3# handle the nimbus map and other stuff 3# handle the nimbus map and other stuff
4 4
5my @STATS = qw( 5my @STATS = qw(
6 Str Dex Con Wis Cha Int Pow 6 Str Dex Con Wis Cha Int Pow
74 $ob->message ("You start to feel dizzy.\n"); 74 $ob->message ("You start to feel dizzy.\n");
75 $ob->message ("The world around you blurs.\n"); 75 $ob->message ("The world around you blurs.\n");
76 $ob->message ("\n"); 76 $ob->message ("\n");
77 } 77 }
78 78
79 my $path = sprintf "%s/%s/%s/%s",
80 cf::localdir, cf::playerdir, $ob->name, "nimbus";
81
82 if ($ob->map->path ne $path) {
83 my $nimbus = cf::map::find "/schmorp/nimbus";
84 $nimbus->path ($path);
85 $nimbus->unique (1);
86
87 $pl->savebed ($path, 24, 12); 79 $pl->savebed ("/nimbus", 24, 12);
88 }
89 }, 80 },
90); 81);
91
92sub teleport {
93 my ($pl, $map, $x, $y) = @_;
94
95 return if $pl->ob->map->path eq $map
96 && abs ($pl->ob->x - $x) <= 1
97 && abs ($pl->ob->y - $y) <= 1;
98
99 my $portal = cf::object::new "exit";
100
101 $portal->slaying ($map);
102 $portal->stats->hp ($x);
103 $portal->stats->sp ($y);
104
105 $portal->apply ($pl->ob);
106
107 $portal->destroy;
108}
109 82
110cf::object::attachment nimbus_exit => 83cf::object::attachment nimbus_exit =>
111 on_trigger => sub { 84 on_trigger => sub {
112 my ($self, $ob) = @_; 85 my ($self, $ob) = @_;
113 86
129 102
130 } else { 103 } else {
131 @savebed = ("/scorn/taverns/inn", 10, 5); 104 @savebed = ("/scorn/taverns/inn", 10, 5);
132 } 105 }
133 106
107 my $map = $ob->map;
134 $pl->savebed (@savebed); 108 $pl->savebed (@savebed);
135 109
136 my $map = $ob->map; 110 cf::async {
111 $ob->goto (@savebed);
137 112
138 teleport $pl, @savebed; 113 $map->nuke;
139 114
140 # should make this a temporary map and let cf deal with it 115 $pl->play_sound_player_only (cf::SOUND_PLAYER_DIES);
141 unlink $map->path;
142 unlink $map->path . ".pst";
143 116
144 $map->delete_map;
145
146 $pl->play_sound_player_only (cf::SOUND_PLAYER_DIES);
147
148 $ob->message ("You feel as if you woke up from a dream.\n"); 117 $ob->message ("You feel as if you woke up from a dream.\n");
149 $ob->message ("You have a headache.\n"); 118 $ob->message ("You have a headache.\n");
150 $ob->message ("Maybe you should have a drink.\n"); 119 $ob->message ("Maybe you should have a drink.\n");
120 };
151 121
152 cf::override; 122 cf::override;
153 }, 123 },
154; 124;
155 125

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines