Changed the calculation for attendance based on the ticket_price the user selected

This commit is contained in:
gunnar_g 2008-10-29 17:27:16 +00:00
parent beff044999
commit 98a6c44bb2
3 changed files with 9 additions and 5 deletions

View File

@ -2615,7 +2615,7 @@
<child>
<widget class="GtkLabel" id="label107">
<property name="visible">True</property>
<property name="label" translatable="yes">Improve!</property>
<property name="label" translatable="yes">Confirm!</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@ -2653,7 +2653,7 @@
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Esc</property>
<property name="can_focus">True</property>
<property name="label">gtk-close</property>
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>

View File

@ -334,9 +334,13 @@ game_assign_attendance(Fixture *fix)
const_float("float_game_stadium_attendance_percentage_upper")) *
powf(tm[0]->stadium.safety,
const_float("float_game_stadium_attendance_safety_exponent"));
/* calculate the differnce in ticket prices has on attendance */
/* TODO: Make the factor 0.125 a constant*/
gfloat delta_price = tm[0]->stadium.ticket_price - const_int("int_team_stadium_ticket_price");
gfloat price_factor = 1/(1+0.125*delta_price);
gint max_att = MIN((gint)rint((gfloat)league_cup_average_capacity(tm[0]->clid) *
const_float("float_game_stadium_attendance_average_exceed_factor") *
math_rnd(0.9, 1.1)),
math_rnd(0.9, 1.1)*price_factor),
tm[0]->stadium.capacity);
if(fix->clid < ID_CUP_START &&

View File

@ -1137,11 +1137,11 @@ create_window_stadium (void)
gtk_widget_show (image60);
gtk_box_pack_start (GTK_BOX (hbox67), image60, FALSE, FALSE, 0);
label107 = gtk_label_new_with_mnemonic (_("Improve!"));
label107 = gtk_label_new_with_mnemonic (_("Confirm!"));
gtk_widget_show (label107);
gtk_box_pack_start (GTK_BOX (hbox67), label107, FALSE, FALSE, 0);
button_stadium_cancel = gtk_button_new_from_stock ("gtk-close");
button_stadium_cancel = gtk_button_new_from_stock ("gtk-cancel");
gtk_widget_show (button_stadium_cancel);
gtk_box_pack_start (GTK_BOX (vbox39), button_stadium_cancel, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, button_stadium_cancel, _("Esc"), NULL);