mirror of
https://github.com/tstellar/bygfoot.git
synced 2024-12-16 10:21:15 +01:00
Ticket prices as set in the stadium screen are now used in the calculation of the income. When switching teams the ticket price is reset.
This commit is contained in:
parent
8d439bba10
commit
36683a3a0d
@ -2071,7 +2071,7 @@
|
||||
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
|
||||
<property name="snap_to_ticks">False</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="adjustment">1 0 100 0.00999999977648 10 10</property>
|
||||
<property name="adjustment">1 0 100 0.10000000149 10 10</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
|
@ -322,10 +322,10 @@ finance_assign_game_money(const Fixture *fix)
|
||||
! g_array_index(cup_from_clid(fix->clid)->rounds, CupRound, fix->round).home_away)
|
||||
{
|
||||
ticket_income[0] =
|
||||
ticket_income[1] = fix->attendance * const_int("int_team_stadium_ticket_price") / 2;
|
||||
ticket_income[1] = fix->attendance * fix->teams[0]->stadium.ticket_price / 2;
|
||||
}
|
||||
else
|
||||
ticket_income[0] = fix->attendance * const_int("int_team_stadium_ticket_price");
|
||||
ticket_income[0] = fix->attendance * fix->teams[0]->stadium.ticket_price;
|
||||
|
||||
for(i = 0; i < 2; i++)
|
||||
{
|
||||
|
@ -335,9 +335,8 @@ game_assign_attendance(Fixture *fix)
|
||||
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);
|
||||
gfloat price_factor = 1/(1+const_float("float_team_stadium_price_attendance_factor")*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)*price_factor),
|
||||
|
@ -1004,7 +1004,7 @@ create_window_stadium (void)
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table3), 3);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table3), 3);
|
||||
|
||||
spin_ticket_price_adj = gtk_adjustment_new (1, 0, 100, 0.00999999977648, 10, 10);
|
||||
spin_ticket_price_adj = gtk_adjustment_new (1, 0, 100, 0.10000000149, 10, 10);
|
||||
spin_ticket_price = gtk_spin_button_new (GTK_ADJUSTMENT (spin_ticket_price_adj), 1, 2);
|
||||
gtk_widget_show (spin_ticket_price);
|
||||
gtk_table_attach (GTK_TABLE (table3), spin_ticket_price, 1, 2, 1, 2,
|
||||
|
@ -571,6 +571,9 @@ user_change_team(User *user, Team *tm)
|
||||
gint i;
|
||||
gint success = user->counters[COUNT_USER_SUCCESS];
|
||||
|
||||
/* Reset the ticketprice of the old team to the default value */
|
||||
user->tm->stadium.ticket_price = const_int("int_team_stadium_ticket_price");
|
||||
|
||||
user->tm = tm;
|
||||
user->team_id = tm->id;
|
||||
|
||||
|
@ -521,6 +521,11 @@ window_show_stadium(void)
|
||||
|
||||
spin_ticket_price = GTK_SPIN_BUTTON(lookup_widget(window.stadium, "spin_ticket_price"));
|
||||
gtk_spin_button_set_value(spin_ticket_price, tm->stadium.ticket_price);
|
||||
/* Set the lower bound to constant_ticket_price-(1/constant_ticket_attendance)
|
||||
+1 So that we can't divide by 0 or negative numbers*/
|
||||
gfloat lower_bound = const_int("int_team_stadium_ticket_price")-(1/const_float("float_team_stadium_price_attendance_factor"))+1;
|
||||
|
||||
gtk_spin_button_set_range(spin_ticket_price, lower_bound, 100);
|
||||
|
||||
progressbar_safety = GTK_PROGRESS_BAR(lookup_widget(window.stadium, "progressbar_safety"));
|
||||
progressbar_average_attendance = GTK_PROGRESS_BAR(lookup_widget(window.stadium, "progressbar_average_attendance"));
|
||||
|
@ -96,9 +96,14 @@ float_team_stadium_safety_upper 100000
|
||||
|
||||
# ticket price; this determines together with
|
||||
# the player wages the size of the stadium at
|
||||
# generation
|
||||
# generation. It's also used inattendance
|
||||
# calculation
|
||||
int_team_stadium_ticket_price 25
|
||||
|
||||
# price vs attendace. This determines together
|
||||
# with the prices gow high the attedace will be
|
||||
float_team_stadium_price_attendance_factor 12500
|
||||
|
||||
# factor for stadium size; this determines the income
|
||||
# of the user teams
|
||||
float_team_stadium_size_wage_factor 180000
|
||||
|
Loading…
Reference in New Issue
Block a user