generic invasion #306
Aliases: generic invasion, invasion
11 verbs · 34 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
setup | this none this | rxd | #306 | 32 |
is_active | this none this | rxd | #306 | 7 |
msg | this none this | rxd | #306 | 10 |
heartbeat | this none this | rxd | #306 | 44 |
on_spawn | this none this | rxd | #306 | 1 |
recycle | this none this | rxd | #306 | 1 |
end | this none this | rxd | #306 | 6 |
setup_spawn | this none this | rxd | #306 | 8 |
look_self | this none this | rxd | #306 | 4 |
hear_death | this none this | rxd | #306 | 8 |
entomb | this none this | rxd | #306 | 2 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
start_rooms | #306 | rc | #361 | {#101198, #147166} |
dest_rooms | #306 | rc | #361 | {#4908} |
spawns | #306 | rc | #361 | {#326148, #326148, #326148, #326148, #326148, #326148} |
invaders | #306 | rc | #361 | {} |
start | #306 | rc | #361 | #-1 |
dest | #306 | rc | #361 | #-1 |
leader_type | #306 | rc | #361 | #138 |
leader | #306 | rc | #361 | #-1 |
leader_spews_msg | #306 | rc | #361 | {"Get 'em boys!", "RIOT!"} |
fnn_start_msg | #306 | rc | #361 | {"FNN choppers have sighted a large group of %spawns in %area1, headed directly for %area2!"} |
fnn_reached_msg | #306 | rc | #361 | {"FNN's eye in the sky has live footage of the invasion of %area2 by %spawns!"} |
fnn | #306 | rc | #361 | #221210 |
heart | #306 | r | #361 | 0 |
last_heartbeat | #306 | r | #361 | 0 |
enemy_species | #306 | rc | #361 | {#10989, #6} |
aggression_chance | #306 | rc | #361 | 40 |
duration | #306 | rc | #361 | 2400 |
start_time | #306 | r | #361 | 0 |
arrived | #306 | r | #361 | 0 |
fnn_end_msg | #306 | rc | #361 | {"FNN's eye in the sky brings you up close with the aftermath of the invasion of %area2."} |
help_msg | #306 | rc | #361 | list of 23{"Create an $invasion and @chmod it +f. Set up these properties:", "", " start_rooms : A list of possible start locations.", "", " end_rooms : A list of possible destinations. After the invasion reaches one of these, the party will just wander from there.", "", " spawns : A list of unique NPCs and/or +f spawnable generic NPCs.", "", "Add your invasion to an area's .invasions list or manually call $rpg:spawn(invasion) to set one off.", "", "Optional properties:", "", " enemy_species: This list is set on any monster spawns.", "", " aggression_chance: As above.", "", " fnn_start_msg: Broadcast on FNN TV when the invasion starts.", "", " fnn_reached_msg: Broadcast on FNN TV when the invasion reaches the target.", "", " leader_spews_msg: The leader of the invasion will spout these quotes during the invasion. (The leader is the first creature in .spawns)", "", ""} |
last_announce_time | #306 | r | #361 | 0 |
fnn_continue_msg | #306 | rc | #361 | {"The rampage of %spawns in %area2 continues unabated!", "FCPD have yet to put a stop to the %spawns invasion."} |
job | #306 | rc | #361 | #517205 |
aliases | #1 | rc | #361 | {"generic invasion", "invasion"} |
description | #1 | rc | #361 | <clear> |
object_size | #1 | r | #29 | {9005, 1298434119} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | <clear> |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #1 root
Children: none
Call graph
Source
setup
Referenced by
- #306:on_spawn line 1:
this:setup
Source
1if (gamevalid(this.start) || this.f) 2return; 3endif 4this.heart = 0; 5$heart:register(this); 6start = this.start_rooms[random($)]; 7this.start = start; 8dest = this.dest_rooms[random($)]; 9this.dest = dest; 10invaders = {}; 11leader = #-1; 12for x in (this.spawns) 13suspend(1); 14if (x.f) 15inv = x:_spawn(); 16else 17inv = x; 18endif 19inv:moveto(start); 20this:setup_spawn(inv); 21invaders = {@invaders, inv}; 22if (!valid(leader)) 23if (is_a(inv, this.leader_type)) 24leader = inv; 25endif 26endif 27endfor 28this.leader = leader; 29this.invaders = invaders; 30this.start_time = time(); 31this.fnn:report(this:msg(this.fnn_start_msg)); 32$nets.gamenet:announce(this, ("Spawning in " + this.start:area():dname()) + "!");
is_active
Referenced by
none
Source
1inv = {}; 2for x in (this.invaders) 3if (is_a(x, $creature) && (!x:is_dead())) 4inv = {@inv, x}; 5endif 6endfor 7return inv;
msg
Referenced by
- #306:setup line 31:
this:msg - #306:heartbeat line 36:
this:msg - #306:heartbeat line 41:
this:msg - #306:end line 1:
this:msg
Source
1m = $su:msg(args[1]); 2if (this.invaders && is_a(this.invaders[$], $npc)) 3m = strsub(m, "%spawns", this.invaders[$].name + "s"); 4endif 5if (this.invaders && is_a(this.invaders[1], $npc)) 6m = strsub(m, "%leader", this.invaders[1]:iname()); 7endif 8m = strsub(m, "%area1", this.start:area():dname()); 9m = strsub(m, "%area2", this.dest:area():dname()); 10return m;
heartbeat
Referenced by
none
Source
1if (!this.invaders) 2$heart:unregister(this); 3return; 4endif 5if ((time() - this.start_time) > this.duration) 6return this:end(); 7endif 8alive = {}; 9for x in (this.invaders) 10if (is_a(x, $living) && ((parent(x) in this.spawns) || (x in this.spawns))) 11if (is_a(x:area(), $real_area)) 12alive = {@alive, x}; 13endif 14endif 15endfor 16this.invaders = alive; 17if (!alive) 18return this:end(); 19endif 20if ((time() - this.start_time) > this.duration) 21return this:end(); 22endif 23if ((is_a(this.leader, $living) && is_a(this.leader:area(), #1032)) && (m = this.leader_spews_msg)) 24m = $su:msg(m); 25this.leader:say(m); 26endif 27if (!this.arrived) 28arrived = 0; 29for x in (alive) 30if ((x.location == this.dest) || (x.destination == #-1)) 31arrived = 1; 32endif 33endfor 34if (arrived) 35this.arrived = 1; 36this.fnn:report(this:msg(this.fnn_reached_msg)); 37endif 38else 39if ((time() - this.last_announce_time) > 300) 40this.last_announce_time = time(); 41m = this:msg(this.fnn_continue_msg); 42this.fnn:report(m); 43endif 44endif
on_spawn
Referenced by
none
Source
1this:setup();
recycle
Referenced by
none
Source
1$heart:unregister(this);
end
Referenced by
- #306:heartbeat line 6:
this:end - #306:heartbeat line 18:
this:end - #306:heartbeat line 21:
this:end
Source
1this.fnn:report(this:msg(this.fnn_end_msg)); 2for x in (this.invaders) 3is_a(x, $living) && x:die(); 4yield; 5endfor 6$recycler:_recycle(this);
setup_spawn
Referenced by
- #306:setup line 20:
this:setup_spawn
Source
1who = args[1]; 2who.destination = this.dest; 3who.death_listeners = setadd(who.death_listeners, this); 4if (is_a(who, $monster)) 5who.enemy_species = this.enemy_species; 6who.aggression_chance = this.aggression_chance; 7who.areas = {this.start:area(), this.dest:area()}; 8endif
look_self
Referenced by
none
Source
1player:tell($time:duration(this.duration - (time() - this.start_time)), " to go."); 2for x in (this.invaders) 3player:tell($su:left(x.name, -30), x.location.name); 4endfor
hear_death
Referenced by
none
Source
1who = args[1]; 2killer = args[2]; 3if (is_a(killer, $player)) 4this.job:add_progress(killer); 5endif 6if (is_a(who, $creature)) 7who.death_listeners = setremove(who.death_listeners, this); 8endif
entomb
Referenced by
none
Source
1"Copied from generic invasion (#80731):recycle by Gilmore (#98) Wed Jun 2 21:43:18 2010 CDT"; 2$heart:unregister(this);