Crossfire Server, Trunk
ObjectWrapper.h
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2022 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #ifndef CRE_WRAPPER_OBJECT_h
14 #define CRE_WRAPPER_OBJECT_h
15 
16 #include <QObject>
17 
18 #include "global.h"
19 #include "assets/AssetWrapper.h"
21 
22 class ResourcesManager;
23 
30 #define OBJ_FLAG(name_, flag_) \
31  public: \
32  bool name_() const { return QUERY_FLAG(myWrappedItem, flag_); } \
33  void name_(bool value) const { if (value) SET_FLAG(myWrappedItem, flag_); else CLEAR_FLAG(myWrappedItem, flag_); } \
34  Q_PROPERTY(bool name_ READ name_ WRITE name_)
35 
36 class ObjectWrapper : public AssetTWrapper<object> {
37  Q_OBJECT
38 
39  ATW_RPROP(QString, name, name)
40  ATW_RPROP(QString, race, race)
41  ATW_RPROP(QString, title, title)
42  ATW_RPROP(QString, slaying, slaying)
43  ATW_RPROP(QString, skill, skill)
44  ATW_RPROP(int, type, type)
45  ATW_RPROP(int, subType, subtype)
46  ATW_PROP(int, level, level)
47  Q_PROPERTY(int suggested_level READ suggested_level);
48  OBJ_FLAG(isMonster, FLAG_MONSTER)
49  OBJ_FLAG(isAlive, FLAG_ALIVE)
50  OBJ_FLAG(isGenerator, FLAG_GENERATOR)
51  OBJ_FLAG(isUnaggressive, FLAG_UNAGGRESSIVE)
52  ATW_RPROP(quint32, attacktype, attacktype)
53  ATW_PROP(int, str, stats.Str);
54  ATW_PROP(int, dex, stats.Dex);
55  ATW_PROP(int, con, stats.Con);
56  ATW_PROP(int, wis, stats.Wis);
57  ATW_PROP(int, cha, stats.Cha);
58  ATW_PROP(int, intl, stats.Int);
59  ATW_PROP(int, pow, stats.Pow);
60  ATW_PROP(int, wc, stats.wc)
61  ATW_PROP(int, ac, stats.ac)
62  ATW_PROP(int, luck, stats.luck)
63  ATW_PROP(int, hp, stats.hp)
64  ATW_PROP(int, maxhp, stats.maxhp)
65  ATW_PROP(int, sp, stats.sp)
66  ATW_PROP(int, maxsp, stats.maxsp)
67  ATW_PROP(int, grace, stats.grace)
68  ATW_PROP(int, maxgrace, stats.maxgrace)
69  ATW_PROP(int, damage, stats.dam)
70  ATW_PROP(qint64, experience, stats.exp)
71  ATW_PROP(int, food, stats.food)
72  Q_PROPERTY(QObject* arch READ arch)
73  ATW_PROP(int, weight, weight)
74  ATW_RPROP(QString, materialName, materialname)
75  Q_PROPERTY(QObject* randomItems READ randomItems)
76  ATW_PROP(float, speed, speed);
77  Q_PROPERTY(float dps READ dps);
78  Q_PROPERTY(float regen READ regen);
79 
80  public:
81  ObjectWrapper(AssetWrapper *parent, object *ob, ResourcesManager *resourcesManager);
82  virtual ~ObjectWrapper();
83 
84  virtual QString displayName() const override { return name(); }
85 
86  object *getObject() { return myWrappedItem; }
87 
88  AssetWrapper* arch();
89  int suggested_level() const;
91  const Face *face() const { return myWrappedItem->face; }
92  float dps() const;
93  float regen() const;
94 
95  protected:
97 };
98 
99 #endif // CRE_WRAPPER_OBJECT_h
global.h
sword_of_souls.Dex
Dex
Definition: sword_of_souls.py:57
sword_of_souls.Pow
Pow
Definition: sword_of_souls.py:60
FLAG_GENERATOR
#define FLAG_GENERATOR
Definition: define.h:248
sword_of_souls.Str
Str
Definition: sword_of_souls.py:56
ObjectWrapper::regen
float regen
Definition: ObjectWrapper.h:77
sword_of_souls.Con
Con
Definition: sword_of_souls.py:58
guildjoin.ob
ob
Definition: guildjoin.py:42
AssetTWrapper< object >::myWrappedItem
object * myWrappedItem
Definition: AssetWrapper.h:104
curse_on_apply.ac
ac
Definition: curse_on_apply.py:4
AssetWrapper
Definition: AssetWrapper.h:25
name
Plugin animator file specs[Config] name
Definition: animfiles.txt:4
FLAG_ALIVE
#define FLAG_ALIVE
Definition: define.h:230
ObjectWrapper::displayName
virtual QString displayName() const override
Definition: ObjectWrapper.h:84
ObjectWrapper::getObject
object * getObject()
Definition: ObjectWrapper.h:86
damage
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your and press< Return > You can also use say if you feel like typing a little extra Other NPCs may not speak to but display intelligence with their movement Some monsters can be and may attack the nearest of your enemies Others can be in that they follow you around and help you in your quest to kill enemies and find treasure SPECIAL ITEMS There are many special items which can be found in of these the most important may be the signs all a player must do is apply the handle In the case of the player must move items over the button to hold it down Some of the larger buttons may need very large items to be moved onto before they can be activated Gates and locked but be for you could fall down into a pit full of ghosts or dragons and not be able to get back out Break away sometimes it may be worth a player s time to test the walls of a map for secret doors Fire such as missile weapons and spells you will notice them going up in smoke ! So be careful not to destroy valuable items Spellbooks sometimes a player can learn the other times they cannot There are many different types of books and scrolls out there Improve item have lower higher damage
Definition: survival-guide.txt:100
ATW_RPROP
#define ATW_RPROP(type_, name_, field_)
Definition: AssetWrapper.h:114
ObjectWrapper::suggested_level
int suggested_level
Definition: ObjectWrapper.h:47
sword_of_souls.Wis
Wis
Definition: sword_of_souls.py:61
speed
Player Stats effect how well a character can survie and interact inside the crossfire world This section discusses the various what they and how they effect the player s actions Also in this section are the stat modifiers that specific classes professions bring Player and sps the current and maximum the Current and Maximum The Current Sp can go somewhat negative When Sp is negative not all spells can be and a more negative Sp makes spell casting less likey to succeed can affect Damage and how the characters speed
Definition: stats.txt:23
make_face_from_files.str
str
Definition: make_face_from_files.py:30
object::face
const Face * face
Definition: object.h:341
AssetTWrapper
Definition: AssetWrapper.h:94
ResourcesManager
Definition: ResourcesManager.h:80
ObjectWrapper::ATW_PROP
ATW_PROP(int, str, stats.Str)
ObjectWrapper::myResourcesManager
ResourcesManager * myResourcesManager
Definition: ObjectWrapper.h:96
title
Definition: readable.cpp:108
FLAG_UNAGGRESSIVE
#define FLAG_UNAGGRESSIVE
Definition: define.h:272
ObjectWrapper
Definition: ObjectWrapper.h:36
weight
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your and press< Return > You can also use say if you feel like typing a little extra Other NPCs may not speak to but display intelligence with their movement Some monsters can be and may attack the nearest of your enemies Others can be in that they follow you around and help you in your quest to kill enemies and find treasure SPECIAL ITEMS There are many special items which can be found in of these the most important may be the signs all a player must do is apply the handle In the case of the player must move items over the button to hold it down Some of the larger buttons may need very large items to be moved onto before they can be activated Gates and locked but be for you could fall down into a pit full of ghosts or dragons and not be able to get back out Break away sometimes it may be worth a player s time to test the walls of a map for secret doors Fire such as missile weapons and spells you will notice them going up in smoke ! So be careful not to destroy valuable items Spellbooks sometimes a player can learn the other times they cannot There are many different types of books and scrolls out there Improve item have lower weight
Definition: survival-guide.txt:100
FLAG_MONSTER
#define FLAG_MONSTER
Definition: define.h:245
ObjectWrapper::face
const Face * face() const
Definition: ObjectWrapper.h:91
ObjectWrapper::arch
QObject arch
Definition: ObjectWrapper.h:72
OBJ_FLAG
#define OBJ_FLAG(name_, flag_)
Definition: ObjectWrapper.h:30
sword_of_souls.Cha
Cha
Definition: sword_of_souls.py:62
ObjectWrapper::randomItems
QObject randomItems
Definition: ObjectWrapper.h:75
sword_of_souls.Int
Int
Definition: sword_of_souls.py:59
stats
Player Stats effect how well a character can survie and interact inside the crossfire world This section discusses the various stats
Definition: stats.txt:2
Face
Definition: face.h:14
ObjectWrapper::dps
float dps
Definition: ObjectWrapper.h:77
skill
skill
Definition: arch-handbook.txt:585
AssetWrapper.h
TreasureListWrapper.h
is_valid_types_gen.type
list type
Definition: is_valid_types_gen.py:25
level
Definition: level.py:1