<% type = deed.property_type %>
<% top = -42 %> <% left = -45 %> <% adjust = 38 %> <% offset = ((20 * 6)+adjust) - (deed.levels * 6)+top %>
<%= draw_building(deed.levels,deed.property_type.id) %>
<% if @user.user_instance.instance.deeds.size > 1 %>
<% if deed.lower_item %> <%= link_to "Next", building_show_url(:id => deed.lower_item), :style => "float:right;" %> <% end %> <% if deed.higher_item %> <%= link_to "Previous", building_show_url( :id => deed.higher_item ) %> <% end %>
<% end %>
<%= render :partial=> 'building_title' %>

This building has seen <%= deed.total_revenue %> in profits since it was built <%= time_ago_in_words(deed.created_on) %> ago.

<% counter = 1 %> <% rent = type.base_rent %> <% cost = type.base_price %> <% table_head = capture do %> <% end %> <%= table_head %> <% max_affordable_levels=1000 type.max_levels.times do %> <% if @user.user_instance.account.balance < deed.cost_to_upgrade(counter) %> <% elsif deed.levels > counter %> <% else %> <% end %> <% if deed.cost_to_upgrade(counter) > @user.user_instance.account.balance and max_affordable_levels==1000 max_affordable_levels=counter-1 end %> <% if counter == type.max_levels or counter < (max_affordable_levels+2) %> <% elsif counter == max_affordable_levels+2 %> <% end %> <% counter += 1 %> <% end %>
Stories Rent Build / Sell  
<%= counter %> <%= number_with_delimiter(deed.property_type.rent(counter)) %> <% if deed.levels < counter %> -<%= number_with_delimiter(deed.cost_to_upgrade(counter)) %> <% elsif deed.levels >= counter %> +<%= number_with_delimiter(deed.cost_to_sell(counter-1)) %> <% else %>   <% end %> <% if deed.levels < counter and @user.user_instance.account.balance >= deed.cost_to_upgrade(counter-1) %> <%= link_to_remote "Buy", :update => "action_pane", :url => {:action=> 'upgrade', :id => deed.id, :levels => counter-deed.levels}, :oncomplete => "$('actual_message').innerHTML = '#{session[:messages]}'" %> <% elsif counter==1 %> <%= link_to "Sell", {:action=> 'sell', :id => deed.id, :levels => deed.levels-counter+1 } %> <% elsif deed.levels >= counter and deed.levels > 1 %> <%= link_to_remote "Sell", :update => "action_pane", :url => {:action=> 'sell', :id => deed.id, :levels => deed.levels-counter+1 } %> <% end %>
Cannot afford past <%= max_affordable_levels %> stories.

Upgrades

Build higher at any time by simply purchasing another story.

Maintenance

<% if deed.health == 14 %> Your building is in perfect shape and charging full rent. <% elsif deed.health < 14 and deed.health > 10 %> It's not looking too shabby yet, but the lack of maintenance is lowering your rates. <% elsif deed.health <= 10 and deed.health > 5 %> It's starting to get nasty. People are finding things under the beds, and it's not good. Your rates are hurting because of it. <% else %> If you don't do something about this wreck of a building it'll be condemned and you'll lose it. If that weren't bad enough, your rates are severely reduced because of all the puke. <% end %>

<% if deed.health < 14 %>

Perform <%= link_to "minimal maintenance", :action => "minimal", :id => deed.id %> (50)
Perform <%= link_to "maximum maintenance", :action => "maximum", :id => deed.id %> (<%= (14 - deed.health) * 50 %>)

<% end %>

Selling

Sell back levels to make some quick cash. Selling stories comes with a 10% penalty.