[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Enigma-cvs] enigma/src player.cc,1.33,1.34
From: |
Ralf Westram <address@hidden> |
Subject: |
[Enigma-cvs] enigma/src player.cc,1.33,1.34 |
Date: |
Wed, 22 Oct 2003 16:05:51 +0000 |
Update of /cvsroot/enigma/enigma/src
In directory subversions:/tmp/cvs-serv18227/src
Modified Files:
player.cc
Log Message:
- If all players have non-movable actors only the game restarts.
- new actor attribute "essential=x".
Game restarts if x essential players have died.
Index: player.cc
===================================================================
RCS file: /cvsroot/enigma/enigma/src/player.cc,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** player.cc 20 Oct 2003 17:05:53 -0000 1.33
--- player.cc 22 Oct 2003 16:05:46 -0000 1.34
***************
*** 485,489 ****
if (enigma::ConserveLevel) {
! bool all_players_dead = true;
for (unsigned pl = 0; pl<psize; ++pl) {
--- 485,490 ----
if (enigma::ConserveLevel) {
! // to live means to be not dead and to be able to move
! bool no_living_player = true;
for (unsigned pl = 0; pl<psize; ++pl) {
***************
*** 491,496 ****
if (!actors.empty()) {
! bool all_actors_dead = true;
vector<Actor*>::iterator a_end = actors.end();
for (vector<Actor*>::iterator ai = actors.begin(); ai !=
a_end; ++ai) {
--- 492,498 ----
if (!actors.empty()) {
! bool no_living_actor = true;
vector<Actor*>::iterator a_end = actors.end();
+ int dead_essentials = 0;
for (vector<Actor*>::iterator ai = actors.begin(); ai !=
a_end; ++ai) {
***************
*** 498,506 ****
if (!a->is_dead() || resurrect_actor(pl, a)) {
! all_players_dead = all_actors_dead = false;
}
}
! if (all_actors_dead) {
if (pl == icurrent_player)
toggle_player = true;
--- 500,519 ----
if (!a->is_dead() || resurrect_actor(pl, a)) {
! if (a->int_attrib("mouseforce") != 0) {
! no_living_player = no_living_actor = false;
! }
! }
! else { // player is dead and could not resurrect
! int essential = a->int_attrib("essential");
!
! if (essential>0) {
! dead_essentials++;
! if (dead_essentials >= essential)
! new_game = true;
! }
}
}
! if (no_living_actor) {
if (pl == icurrent_player)
toggle_player = true;
***************
*** 513,516 ****
--- 526,531 ----
}
+ // if no_living_player -> toggle_player is true and toggle_to_player
is NO_PLAYER
+ // => new_game is set to true below
}
else { // ConserveLevel == false
***************
*** 548,556 ****
}
! if (toggle_player) {
! if (toggle_to_player == NO_PLAYER)
! new_game = true;
! else
! SetCurrentPlayer(toggle_to_player);
}
--- 563,573 ----
}
! if (!new_game && !reset_level) {
! if (toggle_player) {
! if (toggle_to_player == NO_PLAYER)
! new_game = true;
! else
! SetCurrentPlayer(toggle_to_player);
! }
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Enigma-cvs] enigma/src player.cc,1.33,1.34,
Ralf Westram <address@hidden> <=
- Prev by Date:
[Enigma-cvs] enigma/src stones_complex.cc, 1.49, 1.50 world.cc, 1.75, 1.76 world.hh, 1.35, 1.36
- Next by Date:
[Enigma-cvs] enigma/data/levels ant16.lua,1.3,1.4
- Previous by thread:
[Enigma-cvs] enigma/src stones_complex.cc, 1.49, 1.50 world.cc, 1.75, 1.76 world.hh, 1.35, 1.36
- Next by thread:
[Enigma-cvs] enigma/data/levels ant16.lua,1.3,1.4
- Index(es):