- movement-fixes

This commit is contained in:
Christian Schlittchen 2002-09-29 20:36:15 +00:00
parent 4371ebab96
commit 1fc035fe4e
3 changed files with 16 additions and 4 deletions

View File

@ -30,6 +30,7 @@
#include "racename.h" #include "racename.h"
#include "raceprefix.h" #include "raceprefix.h"
#include "synonym.h" #include "synonym.h"
#include "at_movement.h"
#ifdef USE_UGROUPS #ifdef USE_UGROUPS
# include "ugroup.h" # include "ugroup.h"
#endif #endif
@ -62,6 +63,7 @@ init_attributes(void)
init_otherfaction(); init_otherfaction();
init_racename(); init_racename();
init_synonym(); init_synonym();
init_movement();
init_moved(); init_moved();
#ifdef AT_OPTION #ifdef AT_OPTION

View File

@ -727,11 +727,11 @@ void
read_alliances(FILE * F) read_alliances(FILE * F)
{ {
char pbuf[32]; char pbuf[32];
rns(F, pbuf, sizeof(pbuf)); rs(F, pbuf);
while (strcmp(pbuf, "end")!=0) { while (strcmp(pbuf, "end")!=0) {
rs(F, buf); rs(F, buf);
makealliance(atoi36(pbuf), buf); makealliance(atoi36(pbuf), buf);
rns(F, pbuf, sizeof(pbuf)); rs(F, pbuf);
} }
} }
#endif #endif
@ -818,7 +818,7 @@ readgame(boolean backup)
/* Read factions */ /* Read factions */
#ifdef ALLIANCES #ifdef ALLIANCES
if (global.data_version>ALLIANCES_VERSION) { if (global.data_version>=ALLIANCES_VERSION) {
read_alliances(F); read_alliances(F);
} }
#endif #endif

View File

@ -34,6 +34,8 @@
#include <unit.h> #include <unit.h>
#include <base36.h> #include <base36.h>
#include <attributes/at_movement.h>
/* libc includes */ /* libc includes */
#include <ctype.h> #include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
@ -51,7 +53,7 @@ SpecialFunctionUnit(unit *u)
win = openwin(60, 5, "< Specials Units >"); win = openwin(60, 5, "< Specials Units >");
wmove(win, 1, 2); wmove(win, 1, 2);
wAddstr("B - give balloon"); wAddstr("B - give balloon, M - set noMovement");
wmove(win, 2, 2); wmove(win, 2, 2);
wrefresh(win); wrefresh(win);
switch(getch()) { switch(getch()) {
@ -70,6 +72,10 @@ SpecialFunctionUnit(unit *u)
fset(u, FL_OWNER); fset(u, FL_OWNER);
} }
break; break;
case 'm':
case 'M':
set_movement(&u->attribs, MV_CANNOTMOVE);
break;
} }
delwin(win); delwin(win);
} }
@ -871,6 +877,10 @@ mapper_spunit(dbllist ** SP, unit * u, int indent)
break; break;
} }
if(get_movement(&u->attribs, MV_CANNOTMOVE)) {
sncat(buf, ", cannot move", BUFSIZE);
}
sncat(buf, " (", BUFSIZE); icat(u->hp/u->number); sncat(buf, " HP)", BUFSIZE); sncat(buf, " (", BUFSIZE); icat(u->hp/u->number); sncat(buf, " HP)", BUFSIZE);
if (getguard(u)) if (getguard(u))