ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/loader.C
(Generate patch)

Comparing deliantra/server/common/loader.C (file contents):
Revision 1.46 by pippijn, Mon Jan 15 21:06:18 2007 UTC vs.
Revision 1.49 by root, Fri Jan 19 17:54:15 2007 UTC

28 28
29 29
30#include <global.h> 30#include <global.h>
31#include <loader.h> 31#include <loader.h>
32#include <sproto.h> 32#include <sproto.h>
33
34// future resource loader base class
35struct loader_base
36{
37 virtual archetype *get_arch (const char *name);
38 virtual void put_arch (archetype *arch);
39
40 virtual object *get_object (const char *name);
41 virtual void put_object (object *op);
42
43 virtual player *get_player ();
44 virtual void put_player (player *pl);
45
46 virtual region *get_region ();
47 virtual void put_region (region *region);
48
49 virtual facetile *get_face (const char *name);
50 virtual void put_face (facetile *face);
51
52 virtual treasurelist *get_treasure (const char *name, bool one = false);
53 virtual void put_treasure (treasurelist *treasure);
54
55 virtual animation *get_animation (const char *name);
56 virtual void put_animation (animation *anim);
57};
58
59// future generic resource loader
60// handles generic stuff valid in most files, such as
61// animations, treasures, faces and so on
62struct loader_generic : loader_base
63{
64 virtual region *get_region ();
65 virtual void put_region (region *region);
66
67 virtual facetile *get_face (const char *name);
68 virtual void put_face (facetile *face);
69
70 virtual treasurelist *get_treasure (const char *name, bool one = false);
71 virtual void put_treasure (treasurelist *treasure);
72
73 virtual animation *get_animation (const char *name);
74 virtual void put_animation (animation *anim);
75};
33 76
34/* Maps the MOVE_* values to names */ 77/* Maps the MOVE_* values to names */
35static const char *const move_name[] = { "walk", "fly_low", "fly_high", "swim", "boat", NULL }; 78static const char *const move_name[] = { "walk", "fly_low", "fly_high", "swim", "boat", NULL };
36 79
37/* This table is only necessary to convert objects that existed before the 80/* This table is only necessary to convert objects that existed before the
374 } 417 }
375 418
376 if (QUERY_FLAG (op, FLAG_MONSTER)) 419 if (QUERY_FLAG (op, FLAG_MONSTER))
377 { 420 {
378 if (op->stats.hp > op->stats.maxhp) 421 if (op->stats.hp > op->stats.maxhp)
422 {
379 LOG (llevDebug, "Monster %s has hp set higher than maxhp (%d>%d)\n", op->debug_desc (), op->stats.hp, op->stats.maxhp); 423 LOG (llevDebug, "Monster %s has hp set higher than maxhp (%d>%d)\n", op->debug_desc (), op->stats.hp, op->stats.maxhp);
424 op->stats.maxhp = op->stats.hp;
425 }
380 426
381 /* The archs just need to be updated for this */ 427 /* The archs just need to be updated for this */
382 if (op->move_type == 0) 428 if (op->move_type == 0)
383 op->move_type = MOVE_WALK; 429 op->move_type = MOVE_WALK;
384 } 430 }
648 thawer.get (op->speed); 694 thawer.get (op->speed);
649 695
650 //TODO: maybe do in check_object 696 //TODO: maybe do in check_object
651 // removed check for style maps 697 // removed check for style maps
652 if (op->speed < 0) 698 if (op->speed < 0)
653 op->speed_left = op->speed_left - RANDOM () % 100 / 100.0; 699 op->speed_left = op->speed_left - rndm ();
654 700
655 break; 701 break;
656 702
657 case KW_slow_move: 703 case KW_slow_move:
658 op->move_slow |= MOVE_WALK; 704 op->move_slow |= MOVE_WALK;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines