Merge lp:~brandesign/armagetronad/0.4-conquest-output into lp:~armagetronad-dev/armagetronad/0.4-armagetronad-work

Proposed by David Brandes
Status: Superseded
Proposed branch: lp:~brandesign/armagetronad/0.4-conquest-output
Merge into: lp:~armagetronad-dev/armagetronad/0.4-armagetronad-work
Diff against target: 121 lines (+65/-2)
3 files modified
NEWS (+2/-0)
language/english_base.txt (+3/-0)
src/tron/zone/zFortress.cpp (+60/-2)
To merge this branch: bzr merge lp:~brandesign/armagetronad/0.4-conquest-output
Reviewer Review Type Date Requested Status
Armagetron Advanced Developers Pending
Review via email: mp+130303@code.launchpad.net

This proposal has been superseded by a proposal from 2012-10-18.

Description of the change

This adds the command CONDENSE_CONQUEST_OUTPUT. If set to 1 the output gets condensed into 1 line like:
Team 1, Team 2 and Team 3 where awarded 20 Points for conquering Team 4's base

To post a comment you must log in.
1451. By David <email address hidden>

update NEWS

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2012-10-15 16:28:12 +0000
+++ NEWS 2012-10-18 13:24:26 +0000
@@ -58,6 +58,8 @@
58- user*.cfg now resides in UserConfigDir.58- user*.cfg now resides in UserConfigDir.
59- Configuration files, with the exception of legacy user*.cfg files, are no longer59- Configuration files, with the exception of legacy user*.cfg files, are no longer
60 read from the var directory.60 read from the var directory.
61- New command CONDENSE_CONQUEST_OUTPUT. If set to 1 the zone conquering output gets condensed into 1 line like:
62 Team 1, Team 2 and Team 3 where awarded 20 Points for conquering Team 4's base
6163
62Changes since 0.3.064Changes since 0.3.0
63===================65===================
6466
=== modified file 'language/english_base.txt'
--- language/english_base.txt 2012-10-15 16:28:12 +0000
+++ language/english_base.txt 2012-10-18 13:24:26 +0000
@@ -341,6 +341,8 @@
341win_zone_deaths_help A value of 1 turns it into a death zone.341win_zone_deaths_help A value of 1 turns it into a death zone.
342win_zone_randomness_help Randomness factor of the initial win zone position. 0 fixes it at the arena center, 1 spreads the zone all over it.342win_zone_randomness_help Randomness factor of the initial win zone position. 0 fixes it at the arena center, 1 spreads the zone all over it.
343343
344condense_conquest_output_help Zone conquest output condensed into one line
345
344game_timeout_help Base timeout for game state synchronisation; gives approximately the maximum time between rounds.346game_timeout_help Base timeout for game state synchronisation; gives approximately the maximum time between rounds.
345last_chat_break_time_help Last round time a player in chat mode is able to pause the timer347last_chat_break_time_help Last round time a player in chat mode is able to pause the timer
346extra_round_time_help Length of an extra pause at the beginning of the round348extra_round_time_help Length of an extra pause at the beginning of the round
@@ -2845,6 +2847,7 @@
2845player_win_held_fortress \1 was awarded \2 points for holding the base.\n2847player_win_held_fortress \1 was awarded \2 points for holding the base.\n
2846player_lose_held_fortress \1 lost \2 points for being too defensive.\n2848player_lose_held_fortress \1 lost \2 points for being too defensive.\n
2847player_win_conquest_specific \1 was awarded \2 points for conquering \3's base.\n2849player_win_conquest_specific \1 was awarded \2 points for conquering \3's base.\n
2850players_win_condense_conquest \1 where awarded \2 points for conquering \3's base.\n
2848player_kill_collapse \1 was eradicated by its collapsing zone.\n2851player_kill_collapse \1 was eradicated by its collapsing zone.\n
2849player_win_hole \1 got \2 points for a sacrifice for the good of the team.\n2852player_win_hole \1 got \2 points for a sacrifice for the good of the team.\n
2850player_lose_hole 0xffff00ZOMG! 0xff7f00HOLER!!1!!0xRESETT \1 lost \2 points for being a cheap ass lamer.\n2853player_lose_hole 0xffff00ZOMG! 0xff7f00HOLER!!1!!0xRESETT \1 lost \2 points for being a cheap ass lamer.\n
28512854
=== modified file 'src/tron/zone/zFortress.cpp'
--- src/tron/zone/zFortress.cpp 2012-07-23 19:32:52 +0000
+++ src/tron/zone/zFortress.cpp 2012-10-18 13:24:26 +0000
@@ -132,6 +132,10 @@
132static bool sg_baseEnemyRespawn = false;132static bool sg_baseEnemyRespawn = false;
133static tSettingItem<bool> sg_baseEnemyRespawnConfig ("BASE_ENEMY_RESPAWN", sg_baseEnemyRespawn);133static tSettingItem<bool> sg_baseEnemyRespawnConfig ("BASE_ENEMY_RESPAWN", sg_baseEnemyRespawn);
134134
135//condense fort zone conquered output into one line for multiple winers.
136static bool sg_condenseConquestOutput = false;
137static tSettingItem<bool> sg_condenseConquestOutputConfig("CONDENSE_CONQUEST_OUTPUT", sg_condenseConquestOutput);
138
135void zFortressZone::setupVisuals(gParser::State_t & state)139void zFortressZone::setupVisuals(gParser::State_t & state)
136{140{
137 REAL tpR[] = {.0f, .3f};141 REAL tpR[] = {.0f, .3f};
@@ -524,9 +528,64 @@
524 }528 }
525529
526 int score = totalScore / (int)enemies_.size();530 int score = totalScore / (int)enemies_.size();
531 int tCount = 0;
532 tColoredString TeamOutputNames;
533 tColoredString lastTeam;
527 for ( TeamArray::iterator iter = enemies_.begin(); iter != enemies_.end(); ++iter )534 for ( TeamArray::iterator iter = enemies_.begin(); iter != enemies_.end(); ++iter )
528 {535 {
529 (*iter)->AddScore( score, win, tOutput() );536 if ( sg_condenseConquestOutput )
537 {
538 (*iter)->AddScore( score);
539
540 if ( tCount == 0 )
541 {
542 lastTeam = (*iter)->GetColoredName();
543 }
544 else if ( tCount == 1 )
545 {
546 TeamOutputNames << lastTeam;
547 lastTeam = (*iter)->GetColoredName();
548 }
549 else
550 {
551 TeamOutputNames << tColoredString::ColorString(1,1,1) << ", " << lastTeam;
552 lastTeam = (*iter)->GetColoredName();
553 }
554
555 tCount++;
556 }
557 else
558 {
559 (*iter)->AddScore( score, win, tOutput() );
560 }
561 }
562
563 if ( sg_condenseConquestOutput )
564 {
565 if ( tCount == 1 )
566 {
567 TeamOutputNames << tColoredString::ColorString(1,1,1) << lastTeam;
568 }
569 else
570 {
571 TeamOutputNames << tColoredString::ColorString(1,1,1) << " and " << lastTeam;
572 }
573
574 tOutput message;
575 message.SetTemplateParameter(1, TeamOutputNames);
576 message.SetTemplateParameter(2, score > 0 ? score : -score);
577 message.SetTemplateParameter(3, team->GetColoredName());
578 if ( tCount == 1 )
579 {
580 message << "$player_win_conquest_specific";
581 }
582 else
583 {
584 message << "$players_win_condense_conquest";
585 }
586
587 sn_ConsoleOut(message);
588 RequestSync(true);
530 }589 }
531 }590 }
532591
@@ -536,7 +595,6 @@
536 static const char* message="$player_win_conquest";595 static const char* message="$player_win_conquest";
537 sg_DeclareWinner( enemies_[0], message );596 sg_DeclareWinner( enemies_[0], message );
538 }597 }
539
540 CheckSurvivor();598 CheckSurvivor();
541}599}
542600

Subscribers

People subscribed via source and target branches