Skip to content

Commit

Permalink
Moved all parliament code to embassy.
Browse files Browse the repository at this point in the history
  • Loading branch information
icydee committed Jul 4, 2014
1 parent 5cf9a1b commit 37fdd99
Show file tree
Hide file tree
Showing 6 changed files with 702 additions and 34 deletions.
26 changes: 12 additions & 14 deletions docs/Embassy.pod
Expand Up @@ -529,15 +529,15 @@ A session id.

=head3 building_id

The unique id of the Embassy
The unique ID of the Embassy.

=head3 filter (Optional)

{
"zone" : "2|0"
}

Return laws just for this zone. If not supplied laws for all zones will
Return laws just for one zone. If not supplied laws for all zones will
be returned.

=head3 RESPONSE
Expand Down Expand Up @@ -1250,7 +1250,7 @@ The unique id of a mining platform. See C<get_platforms_for_asteroid_in_jurisdic
"proposition" : {
"id" : "id-goes-here",
"name" : "Evict Bjoran Mining Platform",
"description" : "Evict a mining platform on Big Rock that is controlled by Bjoran.",
"description" : "Evict a mining platform from Big Rock.",
"votes_needed" : 7,
"votes_yes" : 0,
"votes_no" : 0,
Expand Down Expand Up @@ -1290,7 +1290,7 @@ The zone to which the law applies.
"proposition" : {
"id" : "id-goes-here",
"name" : "Members Only Colonization",
"description" : "Only members of The Federation of Planets should be allowed to colonize planets in the jurisdiction of this station.",
"description" : "Only members of The Federation of Planets should be allowed to colonize planets in the jurisdiction of this alliance in zone 2|0.",
"votes_needed" : 7,
"votes_yes" : 0,
"votes_no" : 0,
Expand Down Expand Up @@ -1329,7 +1329,7 @@ The zone in which this law applies.
"proposition" : {
"id" : "id-goes-here",
"name" : "BHG Neutralized",
"description" : "Black Hole Generators will not function in the jurisdiction of this station.",
"description" : "Black Hole Generators will not function in the jurisdiction of this alliance in zone 2|0.",
"votes_needed" : 7,
"votes_yes" : 0,
"votes_no" : 0,
Expand Down Expand Up @@ -1389,11 +1389,14 @@ The id of an empire within the alliance that wants control over the station.



=head2 propose_fire_bfg ( session_id, building_id, station_id, body_id, reason )
=head2 propose_fire_bfg ( session_id, building_id, body_id, reason )

Fires the BFG equipped on all space stations at an occupied planet of Parliament's choosing
as long as it is within range of the Space Station and the planet is in a system seized
by the alliance.
as long as the system the planet is in is seized by the alliance.

The amount of damage to the buildings depends upon the seize strength of that system.

Note, no-one Space Station fires, it is the combined output of all Stations within range.

Requires Embassy level 25 or above.

Expand All @@ -1408,10 +1411,6 @@ A session id.

The unique id of the Embassy.

=head3 station_id

The unique id of the Space station which is to fire the BFG.

=head3 body_id

A planet to fire at. See C<get_bodies_for_star_in_jurisdiction> for details.
Expand All @@ -1427,11 +1426,10 @@ An explict reason why the BFG should be fired upon the target. Same rules as an
"proposition" : {
"id" : "id-goes-here",
"name" : "Fire BFG",
"description" : "Fire BFG at Alderaan from The Death Star. Reason cited: The princess isn't talking!",
"description" : "Fire Alliance BFG at Alderaan. Reason cited: The princess isn't talking!",
"votes_needed" : 7,
"votes_yes" : 0,
"votes_no" : 0,
"station_id" : "123456",
"status" : "Pending",
"date_ends" : "01 31 2010 13:09:05 +0600",
"proposed_by" : {
Expand Down
3 changes: 2 additions & 1 deletion lib/Lacuna/DB/Result/Alliance.pm
Expand Up @@ -24,7 +24,8 @@ __PACKAGE__->belongs_to('leader', 'Lacuna::DB::Result::Empire', 'leader_id', { o
__PACKAGE__->has_many('members', 'Lacuna::DB::Result::Empire', 'alliance_id');
__PACKAGE__->has_many('invites', 'Lacuna::DB::Result::AllianceInvite', 'alliance_id');
__PACKAGE__->has_many('stations', 'Lacuna::DB::Result::Map::Body', 'alliance_id');

__PACKAGE__->has_many('laws', 'Lacuna::DB::Result::Law', 'alliance_id');
__PACKAGE__->has_many('propositions', 'Lacuna::DB::Result::Proposition', 'alliance_id');


sub date_created_formatted {
Expand Down
2 changes: 1 addition & 1 deletion lib/Lacuna/DB/Result/Law.pm
Expand Up @@ -92,7 +92,7 @@ sub notify_zone_inhabitants {


sub get_status {
my ($self, $empire) = @_;
my ($self) = @_;
my $out = {
id => $self->id,
name => $self->name,
Expand Down
5 changes: 4 additions & 1 deletion lib/Lacuna/DB/Result/Proposition.pm
Expand Up @@ -11,7 +11,8 @@ __PACKAGE__->load_components('DynamicSubclass');
__PACKAGE__->table('proposition');
__PACKAGE__->add_columns(
name => { data_type => 'varchar', size => 30, is_nullable => 0 },
station_id => { data_type => 'int', size => 11, is_nullable => 0 },
alliance_id => { data_type => 'int', size => 11, is_nullable => 0 },
station_id => { data_type => 'int', size => 11 },
votes_needed => { data_type => 'int', is_nullable => 0, default_value => 1 },
votes_yes => { data_type => 'int', is_nullable => 0, default_value => 0 },
votes_no => { data_type => 'int', is_nullable => 0, default_value => 0 },
Expand Down Expand Up @@ -55,6 +56,8 @@ __PACKAGE__->typecast_map(type => {

__PACKAGE__->belongs_to('proposed_by', 'Lacuna::DB::Result::Empire', 'proposed_by_id');
__PACKAGE__->belongs_to('station', 'Lacuna::DB::Result::Map::Body', 'station_id');
__PACKAGE__->belongs_to('alliance', 'Lacuna::DB::Result::Alliance', 'alliance_id');

__PACKAGE__->has_many('votes', 'Lacuna::DB::Result::Vote', 'proposition_id');

sub sqlt_deploy_hook {
Expand Down

0 comments on commit 37fdd99

Please sign in to comment.