Commit Graph

105 Commits

Author SHA1 Message Date
Tom Stellard 0f25c31ee5 Fix bug in query_cup_begins()
The function incorrectly assumed that cups where all the scheduled games
had been played wre complete, and did not take into account the fact
that games for later rounds may not have been scheduled yet.
2021-03-05 23:38:28 -05:00
Tom Stellard fdc15fdf8a Add optional tag 2021-03-05 23:38:28 -05:00
Tom Stellard a3a9e1bacc Add cup sid to debug printfs 2021-03-05 23:38:28 -05:00
Tom Stellard be9b591c0e Add alternatives tag to choose_team
This allows you to specify an alternative choose_team in the case the
first choose_team does not match any teams.  This can happen if a team
qualifies for another cup in the same cup group.  You may list an
unlimited number of alternatives with this new tag.  Here is an example of
how to use it:

<choose_team>
  <choose_team_sid>faroe_islands_cup</choose_team_sid>
  <number_of_teams>1</number_of_teams>
  <start_idx>1</start_idx>
  <end_idx>1</end_idx>
  <alternatives>
    <choose_team>
      <choose_team_sid>faroe_islands1</choose_team_sid>
      <number_of_teams>1</number_of_teams>
      <start_idx>1</start_idx>
      <end_idx>1</end_idx>
    </choose_team>
  </alternatives>
</choose_team>

This example chooses the winner of the faroe_islands_cup, but if that
team is not eligible for the cup, then it will choose the winner of the
faroe_islands1 league.
2021-03-05 23:38:28 -05:00
Tom Stellard 8a3100a28c Add support for specifying cups in choose_team_sid tag for generated teams
This makes it possible to include national cup winners in international
cups.
2021-03-05 23:38:28 -05:00
Tom Stellard 347d74a3c4 Load all league and team names at the beginning of the game
This way we don't have to reload the country xml definitions every time
we have to generate a new team.
2021-03-05 23:38:28 -05:00
Tom Stellard 37b9d8bf46 Refactor cup_reset() 2021-03-05 23:38:28 -05:00
Tom Stellard f56e1b64be Refactor cup_load_choose_team_generate() 2021-03-05 23:38:28 -05:00
Tom Stellard 4248c08b7a Allow the user's country's league sids in choose_team tags
This allows for consistent and accurate international cup definitions,
because the draws will be the same no matter what the country a user
has choosen.

So now if a user is playing Faroe Islands, for example, a choose_team with an
sid of faroe_islands1, will select a team from the Faroe Islands.
Previously, this sid would have been ignored and the only way for a
user team to play in an international cup was if it used the special
LEAGUE* or CUP* sid.

As a result of this change, the 'generate' property of CupChooseTeam is
now infered based on the sid, so the generated tag no longer has an
effect in the definition files.
2021-03-05 23:38:28 -05:00
Tom Stellard 306482d403 Refactor cup_get_team_pointers() 2021-03-05 23:38:28 -05:00
Tom Stellard 9d2440be85 Exclude reserve teams from cups by default
If you need to define a cup that includes reserve teams, you can add the
include_reserve_teams property to the cup definition.
2020-12-24 10:43:39 -08:00
Tom Stellard 344bc82b53 Simplify some duplicated code in cup_load_choose_team_from_league() 2020-12-24 10:43:39 -08:00
Tom Stellard f928273875 Add first_team and reserve_level tags to team element
The first_team tag can be used to indicate that a team is a 'reserve
team'.  The value for this new tag is the name of the first team
for this reserve team.  The reserve_level is used to indicate if this
is the 2nd, 3rd, 4th, etc. team for the first team. For example:

<team>
  <team_name>Blue</team_name>
</team>
<team>
  <team_name>Blue 2</team_name>
  <first_team>Blue</first_team>
  <reserve_level>2</reserve_level>
</team>
<team>
  <team_name>Blue 3</team_name>
  <first_team>Blue</first_team>
  <reserve_level>3</reserve_level>
</team>
2020-12-24 10:43:39 -08:00
gunnar_g 3b04f321d1 Don't try to free up memory when you use that data later to tell the user why the application forcibly quits 2011-05-17 12:19:50 +00:00
gyboth 078b70a1ea Added debug logging. 2009-04-29 17:18:54 +00:00
gyboth 411c52092d UEFA cup correction. 2009-04-20 07:26:04 +00:00
gyboth 9d67ab30bd Fixed the horses problem. 2009-01-11 14:51:12 +00:00
gyboth a04940877b European cups. 2009-01-08 22:20:26 +00:00
gyboth c75b4f1327 Def system changes, cup round names. 2009-01-04 10:53:09 +00:00
gyboth 070847ef1d Cup scheduling bugfix. 2009-01-03 18:01:27 +00:00
gyboth ebf191cc2f Cup fixture scheduling. 2009-01-03 11:24:00 +00:00
gyboth 355a8b4f4e Def system changes. 2008-12-28 15:44:12 +00:00
gyboth 7324c289cc Fixture scheduling bugfix. 2008-12-28 10:24:54 +00:00
gyboth a76cae2a44 Week breaks introduced. 2008-12-26 15:59:46 +00:00
gyboth 2cf0e416ee Corrected cup delay. 2008-12-22 11:20:16 +00:00
gyboth fed258a749 Added custom round robin breaks to leagues and cups. 2008-12-14 10:37:10 +00:00
gyboth 6bf8fb819b Added possibility to configure number of round robins in cup stages. 2008-12-13 15:15:03 +00:00
gyboth d2f67a2b5b Randomise cup choose team sids. 2008-12-04 17:35:47 +00:00
gyboth 9f93039e05 Removed news from weekly functions. 2008-12-03 21:46:27 +00:00
gyboth 9f5d810e40 Multiple tables fix. 2008-11-26 19:27:00 +00:00
gyboth 23cfbb3f0c Added function name output when compiled with DEBUG. 2008-11-25 13:50:07 +00:00
gyboth 945c4d1093 Added league properties and changed league active status to property. 2008-11-24 11:16:36 +00:00
gyboth b3d36c7a66 Added cup fixture checking. 2008-11-23 15:06:00 +00:00
gyboth 83908c2c8d Possibility to specify table in choose_team. 2008-11-22 19:02:38 +00:00
gyboth a535439936 Added multiple tables for leagues. 2008-11-21 17:00:47 +00:00
gyboth d0c720ff8c Cup choose team cleanup; skip_group_check added. 2008-11-18 18:32:37 +00:00
gyboth 9bcccd7b21 Added talents from leagues to cup definitions. 2008-11-18 13:26:57 +00:00
gyboth fc80db9dcb Added two match weeks for cup rounds. 2007-02-18 13:04:19 +00:00
gyboth 86aaeb8f99 "Cup round delay added." 2006-06-29 16:06:52 +00:00
markc77 2b926ce3e1 Fix cup_get_matchdays_in_cup_round 2006-05-13 14:29:13 +00:00
gyboth f3b9966bcd "Bugfix related to the WC 2006." 2006-05-07 16:32:52 +00:00
gyboth 9cabaa9eb3 "Release 1.9.3" 2005-12-14 14:05:59 +00:00
gyboth 15ad0cbb01 "Job exchange, first buggy draft with lots of debugging output." 2005-12-01 11:50:54 +00:00
gyboth 6f61b20f96 "Minor bugfix in query_cup_begins." 2005-11-26 16:52:51 +00:00
gyboth 54132543c4 "Betting bugfix." 2005-10-31 16:19:14 +00:00
gyboth 3b23bb353f "CPU strategies, first draft." 2005-10-24 20:50:48 +00:00
gyboth fa0b06f39d "Randomise teams option added." 2005-10-20 15:45:00 +00:00
gyboth 53131dd2e9 "Switched most GStrings to gchar." 2005-10-09 09:35:44 +00:00
gyboth 6c959586c7 "Minor string array improvements." 2005-10-05 19:59:37 +00:00
gyboth 2c1c98bbec "Minor improvements." 2005-09-27 12:18:46 +00:00