From 40def6a3adab23ee6da3193715b82ba3ea2cc34e Mon Sep 17 00:00:00 2001 From: gyboth Date: Mon, 9 May 2005 14:00:43 +0000 Subject: [PATCH] Header event. --- src/live_game.c | 8 ++++++++ src/live_game_struct.h | 1 + src/treeview_helper.c | 2 ++ support_files/bygfoot_app | 1 + support_files/bygfoot_constants | 5 ++++- 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/live_game.c b/src/live_game.c index 81fbf29e..d695960a 100644 --- a/src/live_game.c +++ b/src/live_game.c @@ -543,6 +543,9 @@ live_game_event_scoring_chance(void) last_unit.event.values[LIVE_GAME_EVENT_VALUE_PLAYER], TRUE); } } + + if(math_rnd(0, 1) < const_float("float_live_game_scoring_chance_is_header")) + last_unit.event.type = LIVE_GAME_EVENT_HEADER; } live_game_finish_unit(); @@ -1228,6 +1231,11 @@ live_game_generate_commentary(LiveGameUnit *unit) player_of_id_team(tm[unit->possession], unit->event.values[LIVE_GAME_EVENT_VALUE_PLAYER])->name->str); break; + case LIVE_GAME_EVENT_HEADER: + g_string_printf(commentary, "header by %s", + player_of_id_team(tm[unit->possession], + unit->event.values[LIVE_GAME_EVENT_VALUE_PLAYER])->name->str); + break; case LIVE_GAME_EVENT_PENALTY: g_string_printf(commentary, "%s shoots penalty", player_of_id_team(tm[unit->possession], diff --git a/src/live_game_struct.h b/src/live_game_struct.h index 3a44ee01..72b8e754 100644 --- a/src/live_game_struct.h +++ b/src/live_game_struct.h @@ -19,6 +19,7 @@ enum LiveGameEventType LIVE_GAME_EVENT_END_MATCH, LIVE_GAME_EVENT_LOST_POSSESSION, LIVE_GAME_EVENT_SCORING_CHANCE, + LIVE_GAME_EVENT_HEADER, LIVE_GAME_EVENT_PENALTY, LIVE_GAME_EVENT_FREE_KICK, LIVE_GAME_EVENT_GOAL, diff --git a/src/treeview_helper.c b/src/treeview_helper.c index c5ea3c81..619f17f3 100644 --- a/src/treeview_helper.c +++ b/src/treeview_helper.c @@ -177,6 +177,8 @@ treeview_helper_live_game_icon(gint event_type) else if(event_type == LIVE_GAME_EVENT_SCORING_CHANCE || event_type == LIVE_GAME_EVENT_FREE_KICK) return const_app("string_live_game_event_scoring_chance_icon"); + else if(event_type == LIVE_GAME_EVENT_HEADER) + return const_app("string_live_game_event_header_icon"); else if(event_type == LIVE_GAME_EVENT_GOAL) return const_app("string_live_game_event_goal_icon"); else if(event_type == LIVE_GAME_EVENT_OWN_GOAL) diff --git a/support_files/bygfoot_app b/support_files/bygfoot_app index 4b6c6c6a..21577748 100644 --- a/support_files/bygfoot_app +++ b/support_files/bygfoot_app @@ -125,6 +125,7 @@ string_live_game_event_start_match_icon whistle.png string_live_game_event_lost_possession_icon string_live_game_event_penalty_icon penalty.png string_live_game_event_scoring_chance_icon scoring_chance.png +string_live_game_event_header_icon string_live_game_event_goal_icon goal.png string_live_game_event_own_goal_icon own_goal.png string_live_game_event_post_icon post.png diff --git a/support_files/bygfoot_constants b/support_files/bygfoot_constants index ae89f728..7fa1d736 100644 --- a/support_files/bygfoot_constants +++ b/support_files/bygfoot_constants @@ -371,7 +371,10 @@ float_live_game_scoring_chance_team_exponent 12500 # probability that it's the player in possession who # has the scoring chance. -float_live_game_player_in_poss_shoots 5000 +float_live_game_player_in_poss_shoots 3000 + +# prob that the scoring chance is a header +float_live_game_scoring_chance_is_header 3000 # base probability to score with a scoring chance. float_live_game_score_base_prob 3000