From 0e34fd76ab39fabaaf3590284f1ea9523cdcb730 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Mon, 3 May 2010 19:47:18 -0500 Subject: [PATCH] fixed bugs --- lib/Lacuna/DB/Building/Intelligence.pm | 2 +- lib/Lacuna/DB/Building/Shipyard.pm | 2 +- lib/Lacuna/Tutorial.pm | 6 ++---- t/long_running/Tutorial.t | 4 ++-- var/messages/tutorial/counter_spy.txt | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/Lacuna/DB/Building/Intelligence.pm b/lib/Lacuna/DB/Building/Intelligence.pm index 6d643a3b..ad7eef8c 100644 --- a/lib/Lacuna/DB/Building/Intelligence.pm +++ b/lib/Lacuna/DB/Building/Intelligence.pm @@ -179,7 +179,7 @@ sub train_spy { before delete => sub { my ($self) = @_; - $self->db->domain('spies')->search(where=>{from_body_id=>$self->body_id})->delete; + $self->simpledb->domain('spies')->search(where=>{from_body_id=>$self->body_id})->delete; }; diff --git a/lib/Lacuna/DB/Building/Shipyard.pm b/lib/Lacuna/DB/Building/Shipyard.pm index 2d8b72b7..0ad29002 100644 --- a/lib/Lacuna/DB/Building/Shipyard.pm +++ b/lib/Lacuna/DB/Building/Shipyard.pm @@ -161,7 +161,7 @@ sub build_ship { before delete => sub { my ($self) = @_; - $self->db->domain('ship_builds')->search(where=>{shipyard_id=>$self->id})->delete; + $self->simpledb->domain('ship_builds')->search(where=>{shipyard_id=>$self->id})->delete; }; use constant controller_class => 'Lacuna::Building::Shipyard'; diff --git a/lib/Lacuna/Tutorial.pm b/lib/Lacuna/Tutorial.pm index abd7fc79..78560e0a 100644 --- a/lib/Lacuna/Tutorial.pm +++ b/lib/Lacuna/Tutorial.pm @@ -180,10 +180,8 @@ sub counter_spy { my ($self, $finish) = @_; my $empire = $self->empire; if ($finish) { - my $spies = $empire->simpledb->domain('spies'); - my $counter = $spies->count(where=>{empire_id => $empire->id, task=>'Gather Intelligence'}); - my $sting = $spies->count(where=>{empire_id => $empire->id, task=>'Capture Spies'}); - if ($counter && $sting) { + my $counter = $empire->simpledb->domain('spies')->count(where=>{empire_id => $empire->id, task=>'Counter Espionage'}); + if ($counter >= 2) { $self->start('observatory'); return undef; } diff --git a/t/long_running/Tutorial.t b/t/long_running/Tutorial.t index 94cd78cb..792a32af 100644 --- a/t/long_running/Tutorial.t +++ b/t/long_running/Tutorial.t @@ -316,8 +316,8 @@ say "Waiting for spies to finish..."; sleep 216; my $spies = $building->get_spies; -$spies->next->assign('Capture Spies')->put; -$spies->next->assign('Gather Intelligence')->put; +$spies->next->assign('Counter Espionage')->put; +$spies->next->assign('Counter Espionage')->put; sleep 3; is($tutorial->finish, 1, 'counter spy'); diff --git a/var/messages/tutorial/counter_spy.txt b/var/messages/tutorial/counter_spy.txt index 5db8eb6c..efd301d5 100644 --- a/var/messages/tutorial/counter_spy.txt +++ b/var/messages/tutorial/counter_spy.txt @@ -1,6 +1,6 @@ Counter Spies ~~~ -Well done. I've been able to get you the plans to upgrade your Intelligence Ministry to level two and I've trained one of your spies personally. That should help keep some of your information and resources protected. You should train another spy so you have two. Then set one on Capture Spies duty and one on Gather Intelligence. The more the merrier when it comes to keeping the bad guys out. +Well done. I've been able to get you the plans to upgrade your Intelligence Ministry to level two and I've trained one of your spies personally. That should help keep some of your information and resources protected. You should train another spy so you have two. Then set them both on Counter Espionage. Counter Espionage is a defensive assignment, all other assignments are offensive, and should be used when you put your spies on enemy planets. I'm unsure how much longer I can keep helping you. Unfortunately, I believe they are wise to me, and with each message I send, they get closer to discovering my identity. Be careful. Trust no one. -- knotmirror 0.0.1