Skip to content

Commit fe6ed61

Browse files
committed
Trying to get Avatar to run
1 parent 439a86c commit fe6ed61

File tree

5 files changed

+61
-19
lines changed

5 files changed

+61
-19
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2000-05-18 Jeff Freedman <[email protected]>
2+
3+
* Save/restore working as of last night.
4+
* Have Avatar 'run' when shift key is down.
5+
16
2000-05-17 Willem Jan Palenstijn <[email protected]>
27
* usecode.cc: defined __STRING if not yet defined (e.g. in mingw32)
38
* configure.in: added flic library to windows section

docs/u7combat.txt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
From: "Coder Infidel" <[email protected]>
3+
4+
Status: R
5+
X-Status: N
6+
7+
>Okay, I do have a dim memory of knocking enemies unconscious, but not
8+
>killing
9+
>them. Perhaps they go unconscious at 0 (or 1 or 2) HP's, and die when HP
10+
>goes
11+
>negative?
12+
13+
Yes they do go unconscious at zero, but their health may need to be less
14+
than -1 for them to die, particularly for powerful monsters. That is why I
15+
suggested that the monster's strength may have something to do with it. To
16+
test this, I used a dagger to knock a dragon out and see how low its health
17+
could go, and it seemed to die approximately when its health got down to
18+
-12. Since the dragon had 36 strength, it seems that the negative amount may
19+
be one third of the strength.
20+
21+
>No problem. In the code, I'll recognize a dead 'Monster_actor' when it's
22+
>double-clicked on, and bring up the dead-body-gump. Perhaps monsters get
23+
>the
24+
>lying-down frame (seemed to be the case when I killed a horse last night),
25+
>but
26+
>human NPC's get one of the body shapes?
27+
28+
Monsters certainly get the lying-down frame when they are unconscious, but
29+
the body after they are killed is an entirely different shape. You can tell
30+
the difference because the dead body has blood on it (or other differences).
31+
For example a horse is shape 727 but the body is shape 778, frame 1 (shape
32+
778 frames are bodies for 13 types of monsters).
33+
34+
________________________________________________________________________
35+
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
36+
37+
38+
_______________________________________________
39+
Exult-general mailing list
40+
41+
http://lists.sourceforge.net/mailman/listinfo/exult-general
42+

exult.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ static int Filter_intro_events
337337
*/
338338
static int dragging = 0; // Object or gump being moved.
339339
static int dragged = 0; // Flag for when obj. moved.
340+
static int run_avatar = 0; // 1 if shift key held down.
340341

341342
/*
342343
* Handle events until a flag is set.
@@ -419,7 +420,11 @@ static void Handle_event
419420
// when right button pressed.
420421
if (event.button.button == 3 &&
421422
gwin->get_mode() == Game_window::normal)
422-
gwin->start_actor(event.button.x, event.button.y);
423+
{
424+
run_avatar = ((SDL_GetModState() & KMOD_SHIFT) != 0);
425+
gwin->start_actor(event.button.x, event.button.y,
426+
run_avatar);
427+
}
423428
break;
424429
case SDL_MOUSEBUTTONUP:
425430
if (event.button.button == 3)
@@ -484,7 +489,8 @@ static void Handle_event
484489
}
485490
// Dragging with right?
486491
if (event.motion.state & SDL_BUTTON(3))
487-
gwin->start_actor(event.motion.x, event.motion.y);
492+
gwin->start_actor(event.motion.x, event.motion.y,
493+
run_avatar);
488494
break;
489495
}
490496
case SDL_ACTIVEEVENT:

gamewin.cc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,22 +1244,6 @@ void Game_window::view_up
12441244
chunkx + (w + chunksize - 1)/chunksize, chunky + 1);
12451245
}
12461246

1247-
/*
1248-
* Start moving the actor.
1249-
*/
1250-
1251-
void Game_window::start_actor
1252-
(
1253-
int winx, int winy // Move towards this win. location.
1254-
)
1255-
{
1256-
if (mode != normal)
1257-
return;
1258-
// Move every 1/8 sec.
1259-
main_actor->walk_to_point(
1260-
chunkx*chunksize + winx, chunky*chunksize + winy, 125);
1261-
}
1262-
12631247
/*
12641248
* Stop the actor.
12651249
*/

gamewin.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,12 @@ class Game_window
402402
void view_down(); // Move view down.
403403
void view_up(); // Move view up.
404404
// Start moving actor.
405-
void start_actor(int winx, int winy);
405+
void start_actor(int winx, int winy, int speedup)
406+
{
407+
// 1/8 sec/frame.
408+
main_actor->walk_to_point(chunkx*chunksize + winx,
409+
chunky*chunksize + winy, 125>>speedup);
410+
}
406411
void stop_actor(); // Stop main actor.
407412
// Find gump (x, y) is in.
408413
Gump_object *find_gump(int x, int y);

0 commit comments

Comments
 (0)